Skip to content

Commit e2e6171

Browse files
committed
style: format QVC IDE mock work bridge
1 parent b69f8e6 commit e2e6171

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

packages/server/src/controllers/sentinel-cockpit/classify.bridge.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,11 @@ function projectIdePreview(body: GatewayClassifyBody, enabled: boolean): IdePrev
10761076
return idePreviewHasForbiddenText(output) ? null : output
10771077
}
10781078

1079-
function projectIdeWork(body: GatewayClassifyBody | GatewayIdeWorkBody, enabled: boolean, actionsEnabled: boolean): IdeWorkProjection | null {
1079+
function projectIdeWork(
1080+
body: GatewayClassifyBody | GatewayIdeWorkBody,
1081+
enabled: boolean,
1082+
actionsEnabled: boolean
1083+
): IdeWorkProjection | null {
10801084
if (!enabled) return null
10811085
const ideWork = body[IDE_WORK_KEY]
10821086
if (!ideWork || typeof ideWork !== 'object' || Array.isArray(ideWork)) {
@@ -1118,9 +1122,7 @@ function projectIdeWork(body: GatewayClassifyBody | GatewayIdeWorkBody, enabled:
11181122
if (!allowedActions.length || allowedActions.some((action) => !IDE_WORK_ALLOWED_ACTIONS.includes(action))) {
11191123
return null
11201124
}
1121-
const blockedActions = Array.isArray(input.blocked_actions)
1122-
? input.blocked_actions.map((action) => readIdeWorkString(action, 160))
1123-
: []
1125+
const blockedActions = Array.isArray(input.blocked_actions) ? input.blocked_actions.map((action) => readIdeWorkString(action, 160)) : []
11241126
if (!blockedActions.length || blockedActions.some((action) => !action)) {
11251127
return null
11261128
}

packages/server/src/controllers/sentinel-cockpit/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,11 @@ function validateIdeWorkSession(session: {
635635
safe_error: null
636636
}) {
637637
assertResponseKeys(session as unknown as Record<string, unknown>, IDE_WORK_RESPONSE_KEYS)
638-
if (session.schema_version !== classifyBridge.IDE_WORK_BRIDGE_SCHEMA_VERSION || session.status !== 'ok' || session.safe_error !== null) {
638+
if (
639+
session.schema_version !== classifyBridge.IDE_WORK_BRIDGE_SCHEMA_VERSION ||
640+
session.status !== 'ok' ||
641+
session.safe_error !== null
642+
) {
639643
throw httpError(500, 'invalid_snapshot')
640644
}
641645
validateIdeWork(session.ide_work)

packages/ui/src/api/sentinelCockpit.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,9 @@ describe('sentinelCockpit API wrapper', () => {
539539
async (key) => {
540540
const fetchImpl = jest.fn()
541541

542-
await expect(requestIdeWorkAction({ action: 'approve_mock_backend_work', [key]: 'blocked' }, { fetchImpl })).rejects.toMatchObject({
542+
await expect(
543+
requestIdeWorkAction({ action: 'approve_mock_backend_work', [key]: 'blocked' }, { fetchImpl })
544+
).rejects.toMatchObject({
543545
code: 'invalid_request'
544546
})
545547
expect(fetchImpl).not.toHaveBeenCalled()

0 commit comments

Comments
 (0)