@shipfox/api-logs 10.2.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +45 -0
- package/README.md +6 -6
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/core/append-logs.js +1 -1
- package/dist/core/append-logs.js.map +1 -1
- package/dist/core/budget.d.ts +1 -1
- package/dist/core/budget.js +1 -1
- package/dist/core/budget.js.map +1 -1
- package/dist/core/errors.d.ts +4 -4
- package/dist/core/errors.js +4 -4
- package/dist/core/errors.js.map +1 -1
- package/dist/db/schema/attempt-streams.d.ts +2 -2
- package/dist/db/schema/attempt-streams.js +2 -2
- package/dist/db/schema/attempt-streams.js.map +1 -1
- package/dist/db/schema/job-accounting.d.ts +1 -1
- package/dist/db/schema/job-accounting.js +1 -1
- package/dist/db/schema/job-accounting.js.map +1 -1
- package/dist/presentation/routes/read-logs.d.ts.map +1 -1
- package/dist/presentation/routes/read-logs.js +11 -5
- package/dist/presentation/routes/read-logs.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/config.ts +1 -1
- package/src/core/append-logs.test.ts +4 -0
- package/src/core/append-logs.ts +1 -1
- package/src/core/budget.ts +1 -1
- package/src/core/errors.ts +4 -4
- package/src/core/finalize-attempt-stream.test.ts +1 -0
- package/src/db/schema/attempt-streams.ts +2 -2
- package/src/db/schema/job-accounting.ts +1 -1
- package/src/presentation/routes/read-logs.test.ts +18 -4
- package/src/presentation/routes/read-logs.ts +9 -5
- package/test/fixtures/workflows-client.ts +1 -0
- package/test/globalSetup.ts +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/presentation/routes/read-logs.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/routes/read-logs.ts"],"sourcesContent":["import {requireWorkspaceResourceAccess} from '@shipfox/api-auth-context';\nimport {readLogsQuerySchema, readLogsResponseSchema} from '@shipfox/api-logs-dto';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {buildLogReadResult} from '#core/read-logs.js';\nimport {getStreamByStepAttempt} from '#db/streams.js';\nimport {toReadLogsDto} from '#presentation/dto/read-logs.js';\n\nexport const readLogsRoute = defineRoute({\n method: 'GET',\n path: '/:stepId/attempts/:attempt/logs',\n description:\n 'Read a page of logs for a step attempt: inline NDJSON while the stream is hot, a presigned object URL once it is compacted.',\n schema: {\n params: z.object({\n stepId: z.string().uuid(),\n attempt: z.coerce.number().int().min(1),\n }),\n querystring: readLogsQuerySchema,\n response: {\n 200: readLogsResponseSchema,\n },\n },\n handler: async (request) => {\n const {stepId, attempt} = request.params;\n const {cursor} = request.query;\n\n const stream = await getStreamByStepAttempt({stepId, attempt});\n // Missing streams and memberships remain 404 so the endpoint never leaks another\n // workspace's step; lifecycle claims propagate their stable access errors.\n if (!stream) {\n throw new ClientError('Logs not found', 'not-found', {status: 404});\n }\n requireWorkspaceResourceAccess({\n request,\n workspaceId: stream.workspaceId,\n notFoundError: new ClientError('Logs not found', 'not-found', {status: 404}),\n });\n\n return toReadLogsDto(await buildLogReadResult(stream, cursor));\n },\n});\n"],"names":["requireWorkspaceResourceAccess","readLogsQuerySchema","readLogsResponseSchema","ClientError","defineRoute","z","buildLogReadResult","getStreamByStepAttempt","toReadLogsDto","readLogsRoute","method","path","description","schema","params","object","stepId","string","uuid","attempt","coerce","number","int","min","querystring","response","handler","request","cursor","query","stream","status","workspaceId","notFoundError"],"mappings":"AAAA,SAAQA,8BAA8B,QAAO,4BAA4B;AACzE,SAAQC,mBAAmB,EAAEC,sBAAsB,QAAO,wBAAwB;AAClF,SAAQC,WAAW,EAAEC,WAAW,QAAO,wBAAwB;AAC/D,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,kBAAkB,QAAO,qBAAqB;AACtD,SAAQC,sBAAsB,QAAO,iBAAiB;AACtD,SAAQC,aAAa,QAAO,iCAAiC;AAE7D,OAAO,MAAMC,gBAAgBL,YAAY;IACvCM,QAAQ;IACRC,MAAM;IACNC,aACE;IACFC,QAAQ;QACNC,QAAQT,EAAEU,MAAM,CAAC;YACfC,QAAQX,EAAEY,MAAM,GAAGC,IAAI;YACvBC,SAASd,EAAEe,MAAM,CAACC,MAAM,GAAGC,GAAG,GAAGC,GAAG,CAAC;QACvC;QACAC,aAAavB;QACbwB,UAAU;YACR,KAAKvB;QACP;IACF;IACAwB,SAAS,OAAOC;QACd,MAAM,EAACX,MAAM,EAAEG,OAAO,EAAC,GAAGQ,QAAQb,MAAM;QACxC,MAAM,EAACc,MAAM,EAAC,GAAGD,QAAQE,KAAK;QAE9B,MAAMC,SAAS,MAAMvB,uBAAuB;YAACS;YAAQG;QAAO;QAC5D,iFAAiF;QACjF,2EAA2E;QAC3E,IAAI,CAACW,QAAQ;YACX,MAAM,IAAI3B,YAAY,kBAAkB,aAAa;gBAAC4B,QAAQ;YAAG;QACnE;QACA/B,+BAA+B;YAC7B2B;YACAK,aAAaF,OAAOE,WAAW;YAC/BC,eAAe,IAAI9B,YAAY,kBAAkB,aAAa;gBAAC4B,QAAQ;YAAG;QAC5E;QAEA,OAAOvB,cAAc,MAAMF,mBAAmBwB,QAAQF;IACxD;AACF,GAAG"}
|