@shipfox/api-workflows 7.1.0 → 9.0.1

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.
Files changed (153) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/CHANGELOG.md +80 -0
  3. package/dist/core/agent-defaults.d.ts +2 -1
  4. package/dist/core/agent-defaults.d.ts.map +1 -1
  5. package/dist/core/agent-defaults.js.map +1 -1
  6. package/dist/core/agent-tools.d.ts +5 -2
  7. package/dist/core/agent-tools.d.ts.map +1 -1
  8. package/dist/core/agent-tools.js.map +1 -1
  9. package/dist/core/checkout.d.ts +2 -2
  10. package/dist/core/checkout.d.ts.map +1 -1
  11. package/dist/core/checkout.js.map +1 -1
  12. package/dist/core/entities/step.d.ts +2 -1
  13. package/dist/core/entities/step.d.ts.map +1 -1
  14. package/dist/core/entities/step.js.map +1 -1
  15. package/dist/core/errors.d.ts +0 -4
  16. package/dist/core/errors.d.ts.map +1 -1
  17. package/dist/core/errors.js +0 -6
  18. package/dist/core/errors.js.map +1 -1
  19. package/dist/core/job-execution.d.ts +0 -2
  20. package/dist/core/job-execution.d.ts.map +1 -1
  21. package/dist/core/job-execution.js +3 -7
  22. package/dist/core/job-execution.js.map +1 -1
  23. package/dist/core/run-workflow.d.ts +2 -2
  24. package/dist/core/run-workflow.d.ts.map +1 -1
  25. package/dist/core/run-workflow.js.map +1 -1
  26. package/dist/core/step-config/agent.d.ts +1 -1
  27. package/dist/core/step-config/agent.d.ts.map +1 -1
  28. package/dist/core/step-config/agent.js.map +1 -1
  29. package/dist/db/job-listeners.d.ts +2 -2
  30. package/dist/db/job-listeners.d.ts.map +1 -1
  31. package/dist/db/job-listeners.js.map +1 -1
  32. package/dist/db/workflow-runs/job-executions.d.ts +0 -5
  33. package/dist/db/workflow-runs/job-executions.d.ts.map +1 -1
  34. package/dist/db/workflow-runs/job-executions.js +0 -7
  35. package/dist/db/workflow-runs/job-executions.js.map +1 -1
  36. package/dist/db/workflow-runs/run-create.d.ts +2 -2
  37. package/dist/db/workflow-runs/run-create.d.ts.map +1 -1
  38. package/dist/db/workflow-runs/run-create.js.map +1 -1
  39. package/dist/db/workflow-runs.d.ts +1 -1
  40. package/dist/db/workflow-runs.d.ts.map +1 -1
  41. package/dist/db/workflow-runs.js +1 -1
  42. package/dist/db/workflow-runs.js.map +1 -1
  43. package/dist/index.d.ts +2 -2
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +2 -1
  46. package/dist/index.js.map +1 -1
  47. package/dist/presentation/inter-module.d.ts +2 -2
  48. package/dist/presentation/inter-module.d.ts.map +1 -1
  49. package/dist/presentation/inter-module.js +2 -1
  50. package/dist/presentation/inter-module.js.map +1 -1
  51. package/dist/presentation/routes/cancel-run.d.ts +1 -1
  52. package/dist/presentation/routes/cancel-run.d.ts.map +1 -1
  53. package/dist/presentation/routes/cancel-run.js.map +1 -1
  54. package/dist/presentation/routes/checkout-token.d.ts +2 -2
  55. package/dist/presentation/routes/checkout-token.d.ts.map +1 -1
  56. package/dist/presentation/routes/checkout-token.js +1 -1
  57. package/dist/presentation/routes/checkout-token.js.map +1 -1
  58. package/dist/presentation/routes/get-run-aggregates.d.ts +1 -1
  59. package/dist/presentation/routes/get-run-aggregates.d.ts.map +1 -1
  60. package/dist/presentation/routes/get-run-aggregates.js.map +1 -1
  61. package/dist/presentation/routes/get-run.d.ts +1 -1
  62. package/dist/presentation/routes/get-run.d.ts.map +1 -1
  63. package/dist/presentation/routes/get-run.js.map +1 -1
  64. package/dist/presentation/routes/index.d.ts +2 -2
  65. package/dist/presentation/routes/index.d.ts.map +1 -1
  66. package/dist/presentation/routes/index.js.map +1 -1
  67. package/dist/presentation/routes/list-run-attempts.d.ts +1 -1
  68. package/dist/presentation/routes/list-run-attempts.d.ts.map +1 -1
  69. package/dist/presentation/routes/list-run-attempts.js.map +1 -1
  70. package/dist/presentation/routes/list-runs.d.ts +1 -1
  71. package/dist/presentation/routes/list-runs.d.ts.map +1 -1
  72. package/dist/presentation/routes/list-runs.js.map +1 -1
  73. package/dist/presentation/routes/next-step.d.ts.map +1 -1
  74. package/dist/presentation/routes/next-step.js +11 -8
  75. package/dist/presentation/routes/next-step.js.map +1 -1
  76. package/dist/presentation/routes/project-access.d.ts +1 -1
  77. package/dist/presentation/routes/project-access.d.ts.map +1 -1
  78. package/dist/presentation/routes/project-access.js.map +1 -1
  79. package/dist/presentation/routes/require-accessible-run.d.ts +1 -1
  80. package/dist/presentation/routes/require-accessible-run.d.ts.map +1 -1
  81. package/dist/presentation/routes/require-accessible-run.js.map +1 -1
  82. package/dist/presentation/routes/rerun-run.d.ts +1 -1
  83. package/dist/presentation/routes/rerun-run.d.ts.map +1 -1
  84. package/dist/presentation/routes/rerun-run.js.map +1 -1
  85. package/dist/temporal/activities/index.d.ts +2 -2
  86. package/dist/temporal/activities/index.d.ts.map +1 -1
  87. package/dist/temporal/activities/index.js.map +1 -1
  88. package/dist/temporal/activities/orchestration-activities.d.ts +2 -2
  89. package/dist/temporal/activities/orchestration-activities.d.ts.map +1 -1
  90. package/dist/temporal/activities/orchestration-activities.js.map +1 -1
  91. package/dist/tsconfig.test.tsbuildinfo +1 -1
  92. package/package.json +26 -28
  93. package/src/core/agent-defaults.ts +2 -1
  94. package/src/core/agent-tool-capability-warning.test.ts +26 -56
  95. package/src/core/agent-tools.ts +9 -7
  96. package/src/core/checkout.test.ts +2 -2
  97. package/src/core/checkout.ts +2 -2
  98. package/src/core/entities/step.ts +1 -2
  99. package/src/core/errors.ts +0 -7
  100. package/src/core/job-execution.ts +3 -10
  101. package/src/core/run-workflow.test.ts +22 -55
  102. package/src/core/run-workflow.ts +2 -2
  103. package/src/core/step-config/agent.ts +1 -1
  104. package/src/core/step-config/materialize-job-execution-steps.test.ts +1 -2
  105. package/src/core/step-config/materialize-workflow-model.test.ts +10 -13
  106. package/src/db/job-listeners.ts +2 -2
  107. package/src/db/workflow-runs/job-executions.ts +0 -21
  108. package/src/db/workflow-runs/run-create.test.ts +30 -23
  109. package/src/db/workflow-runs/run-create.ts +2 -2
  110. package/src/db/workflow-runs.ts +0 -1
  111. package/src/index.ts +3 -3
  112. package/src/presentation/dto/checkout-token.test.ts +7 -1
  113. package/src/presentation/inter-module.ts +4 -7
  114. package/src/presentation/routes/agent-runtime-config.test.ts +40 -132
  115. package/src/presentation/routes/cancel-run.test.ts +1 -1
  116. package/src/presentation/routes/cancel-run.ts +1 -1
  117. package/src/presentation/routes/checkout-token.test.ts +4 -37
  118. package/src/presentation/routes/checkout-token.ts +2 -2
  119. package/src/presentation/routes/get-run-aggregates.test.ts +1 -1
  120. package/src/presentation/routes/get-run-aggregates.ts +1 -1
  121. package/src/presentation/routes/get-run.test.ts +1 -1
  122. package/src/presentation/routes/get-run.ts +1 -1
  123. package/src/presentation/routes/get-step-secrets.test.ts +2 -2
  124. package/src/presentation/routes/index.test.ts +3 -3
  125. package/src/presentation/routes/index.ts +2 -2
  126. package/src/presentation/routes/list-run-attempts.test.ts +1 -1
  127. package/src/presentation/routes/list-run-attempts.ts +1 -1
  128. package/src/presentation/routes/list-runs.test.ts +1 -1
  129. package/src/presentation/routes/list-runs.ts +1 -1
  130. package/src/presentation/routes/next-step.test.ts +27 -69
  131. package/src/presentation/routes/next-step.ts +9 -5
  132. package/src/presentation/routes/project-access.ts +1 -1
  133. package/src/presentation/routes/report-step.test.ts +2 -3
  134. package/src/presentation/routes/require-accessible-run.ts +1 -1
  135. package/src/presentation/routes/rerun-run.test.ts +1 -1
  136. package/src/presentation/routes/rerun-run.ts +1 -1
  137. package/src/temporal/activities/index.ts +2 -2
  138. package/src/temporal/activities/orchestration-activities.ts +2 -2
  139. package/test/factories/workflow-model.ts +3 -1
  140. package/test/fixtures/active-lease-token.ts +5 -32
  141. package/test/fixtures/agent-inter-module.ts +32 -1
  142. package/test/fixtures/auth-inter-module.ts +2 -13
  143. package/test/fixtures/lease-token.ts +43 -29
  144. package/test/fixtures/projects-inter-module.ts +1 -1
  145. package/test/fixtures/runners-inter-module.ts +40 -48
  146. package/test/globalSetup.ts +0 -38
  147. package/test/setup.ts +2 -0
  148. package/tsconfig.build.tsbuildinfo +1 -1
  149. package/dist/db/runner-lease-table.d.ts +0 -469
  150. package/dist/db/runner-lease-table.d.ts.map +0 -1
  151. package/dist/db/runner-lease-table.js +0 -43
  152. package/dist/db/runner-lease-table.js.map +0 -1
  153. package/src/db/runner-lease-table.ts +0 -39
@@ -1,5 +1,5 @@
1
- import { type IntegrationsModuleClient } from '@shipfox/api-integration-core-dto';
2
- import type { ProjectsModuleClient } from '@shipfox/api-projects-dto';
1
+ import { type IntegrationsModuleClient } from '@shipfox/api-integration-core-dto/inter-module';
2
+ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
3
3
  import type { RunnersInterModuleClient } from '@shipfox/api-runners-dto/inter-module';
4
4
  export declare function createCheckoutTokenRoute(clients: {
5
5
  runners: RunnersInterModuleClient;
@@ -1 +1 @@
1
- {"version":3,"file":"checkout-token.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/checkout-token.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AAYpF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,OAAO,EAAE,wBAAwB,CAAC;IAClC,YAAY,EAAE,wBAAwB,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC;CAChC,mDAkGA"}
1
+ {"version":3,"file":"checkout-token.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/checkout-token.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AAYpF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,OAAO,EAAE,wBAAwB,CAAC;IAClC,YAAY,EAAE,wBAAwB,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC;CAChC,mDAkGA"}
@@ -1,5 +1,5 @@
1
1
  import { requireLeasedJobContext } from '@shipfox/api-auth-context';
2
- import { integrationsInterModuleContract } from '@shipfox/api-integration-core-dto';
2
+ import { integrationsInterModuleContract } from '@shipfox/api-integration-core-dto/inter-module';
3
3
  import { checkoutTokenResponseSchema } from '@shipfox/api-workflows-dto';
4
4
  import { isInterModuleKnownError } from '@shipfox/inter-module';
5
5
  import { ClientError, defineRoute } from '@shipfox/node-fastify';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/presentation/routes/checkout-token.ts"],"sourcesContent":["import {requireLeasedJobContext} from '@shipfox/api-auth-context';\nimport {\n type IntegrationsModuleClient,\n integrationsInterModuleContract,\n} from '@shipfox/api-integration-core-dto';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport {checkoutTokenResponseSchema} from '@shipfox/api-workflows-dto';\nimport {isInterModuleKnownError} from '@shipfox/inter-module';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {createJobCheckoutSpec} from '#core/checkout.js';\nimport {\n CheckoutIntentUnresolvedError,\n JobNotFoundError,\n WorkflowRunNotFoundError,\n} from '#core/errors.js';\nimport {toCheckoutTokenDto} from '#presentation/dto/checkout-token.js';\n\nexport function createCheckoutTokenRoute(clients: {\n runners: RunnersInterModuleClient;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n}) {\n return defineRoute({\n method: 'POST',\n path: '/checkout-token',\n description:\n \"Exchanges the runner's job lease for short-lived, read-only checkout credentials for the job's repository. The job is identified by the access token, so no job ID is needed. The checkout target is resolved server-side from the job's run and project; no credential material is stored on the job or run. Returns the repository URL, ref, and (when the provider needs auth) a short-lived credential that expires soon.\",\n schema: {response: {200: checkoutTokenResponseSchema}},\n errorHandler: (error) => {\n const known = isInterModuleKnownError(\n integrationsInterModuleContract.methods.createCheckoutSpec,\n error,\n )\n ? error\n : undefined;\n if (error instanceof JobNotFoundError)\n throw new ClientError(error.message, 'job-not-found', {status: 404});\n if (error instanceof WorkflowRunNotFoundError)\n throw new ClientError(error.message, 'run-not-found', {status: 404});\n if (error instanceof CheckoutIntentUnresolvedError)\n throw new ClientError(error.message, 'checkout-unavailable', {status: 404});\n if (known?.code === 'connection-not-found')\n throw new ClientError(\n 'Integration connection not found',\n 'integration-connection-not-found',\n {\n status: 404,\n },\n );\n if (known?.code === 'connection-inactive')\n throw new ClientError(\n 'Integration connection is not active',\n 'integration-connection-inactive',\n {\n status: 422,\n },\n );\n if (known?.code === 'connection-workspace-mismatch')\n throw new ClientError(\n 'Integration connection does not belong to this workspace',\n 'forbidden',\n {status: 403},\n );\n if (known?.code === 'provider-unavailable')\n throw new ClientError(\n 'Integration provider is unavailable',\n 'integration-provider-unavailable',\n {\n status: 422,\n },\n );\n if (known?.code === 'capability-unavailable')\n throw new ClientError(\n 'Integration capability is unavailable',\n 'integration-capability-unavailable',\n {\n status: 422,\n },\n );\n if (known?.code === 'checkout-unsupported')\n throw new ClientError(\n 'Integration checkout is unsupported',\n 'integration-checkout-unsupported',\n {\n status: 422,\n },\n );\n if (known?.code === 'provider-failure') {\n const status =\n known.details.reason === 'rate-limited'\n ? 429\n : known.details.reason === 'timeout' || known.details.reason === 'provider-unavailable'\n ? 503\n : 422;\n throw new ClientError('Integration provider request failed', known.details.reason, {\n details: {retry_after_seconds: known.details.retryAfterSeconds},\n status,\n });\n }\n throw error;\n },\n handler: async (request, reply) => {\n const leasedJob = requireLeasedJobContext(request);\n const {active: leaseIsActive} = await clients.runners.getLeaseState({\n jobId: leasedJob.jobId,\n jobExecutionId: leasedJob.jobExecutionId,\n runnerSessionId: leasedJob.runnerSessionId,\n });\n if (!leaseIsActive)\n throw new ClientError('Job lease is no longer active', 'lease-not-active', {status: 404});\n const checkout = await createJobCheckoutSpec({\n jobId: leasedJob.jobId,\n integrations: clients.integrations,\n projects: clients.projects,\n });\n reply.header('cache-control', 'no-store');\n return toCheckoutTokenDto(checkout.spec, {persist: checkout.persistCredentials});\n },\n });\n}\n"],"names":["requireLeasedJobContext","integrationsInterModuleContract","checkoutTokenResponseSchema","isInterModuleKnownError","ClientError","defineRoute","createJobCheckoutSpec","CheckoutIntentUnresolvedError","JobNotFoundError","WorkflowRunNotFoundError","toCheckoutTokenDto","createCheckoutTokenRoute","clients","method","path","description","schema","response","errorHandler","error","known","methods","createCheckoutSpec","undefined","message","status","code","details","reason","retry_after_seconds","retryAfterSeconds","handler","request","reply","leasedJob","active","leaseIsActive","runners","getLeaseState","jobId","jobExecutionId","runnerSessionId","checkout","integrations","projects","header","spec","persist","persistCredentials"],"mappings":"AAAA,SAAQA,uBAAuB,QAAO,4BAA4B;AAClE,SAEEC,+BAA+B,QAC1B,oCAAoC;AAG3C,SAAQC,2BAA2B,QAAO,6BAA6B;AACvE,SAAQC,uBAAuB,QAAO,wBAAwB;AAC9D,SAAQC,WAAW,EAAEC,WAAW,QAAO,wBAAwB;AAC/D,SAAQC,qBAAqB,QAAO,oBAAoB;AACxD,SACEC,6BAA6B,EAC7BC,gBAAgB,EAChBC,wBAAwB,QACnB,kBAAkB;AACzB,SAAQC,kBAAkB,QAAO,sCAAsC;AAEvE,OAAO,SAASC,yBAAyBC,OAIxC;IACC,OAAOP,YAAY;QACjBQ,QAAQ;QACRC,MAAM;QACNC,aACE;QACFC,QAAQ;YAACC,UAAU;gBAAC,KAAKf;YAA2B;QAAC;QACrDgB,cAAc,CAACC;YACb,MAAMC,QAAQjB,wBACZF,gCAAgCoB,OAAO,CAACC,kBAAkB,EAC1DH,SAEEA,QACAI;YACJ,IAAIJ,iBAAiBX,kBACnB,MAAM,IAAIJ,YAAYe,MAAMK,OAAO,EA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AAa,CAAC;gBAClEC,OAAOL,UAAUK,KAAK;gBACtBC,gBAAgBN,UAAUM,cAAc;gBACxCC,iBAAiBP,UAAUO,eAAe;YAC5C;YACA,IAAI,CAACL,eACH,MAAM,IAAIhC,YAAY,iCAAiC,oBAAoB;gBAACqB,QAAQ;YAAG;YACzF,MAAMiB,WAAW,MAAMpC,sBAAsB;gBAC3CiC,OAAOL,UAAUK,KAAK;gBACtBI,cAAc/B,QAAQ+B,YAAY;gBAClCC,UAAUhC,QAAQgC,QAAQ;YAC5B;YACAX,MAAMY,MAAM,CAAC,iBAAiB;YAC9B,OAAOnC,mBAAmBgC,SAASI,IAAI,EAAE;gBAACC,SAASL,SAASM,kBAAkB;YAAA;QAChF;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/presentation/routes/checkout-token.ts"],"sourcesContent":["import {requireLeasedJobContext} from '@shipfox/api-auth-context';\nimport {\n type IntegrationsModuleClient,\n integrationsInterModuleContract,\n} from '@shipfox/api-integration-core-dto/inter-module';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport {checkoutTokenResponseSchema} from '@shipfox/api-workflows-dto';\nimport {isInterModuleKnownError} from '@shipfox/inter-module';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {createJobCheckoutSpec} from '#core/checkout.js';\nimport {\n CheckoutIntentUnresolvedError,\n JobNotFoundError,\n WorkflowRunNotFoundError,\n} from '#core/errors.js';\nimport {toCheckoutTokenDto} from '#presentation/dto/checkout-token.js';\n\nexport function createCheckoutTokenRoute(clients: {\n runners: RunnersInterModuleClient;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n}) {\n return defineRoute({\n method: 'POST',\n path: '/checkout-token',\n description:\n \"Exchanges the runner's job lease for short-lived, read-only checkout credentials for the job's repository. The job is identified by the access token, so no job ID is needed. The checkout target is resolved server-side from the job's run and project; no credential material is stored on the job or run. Returns the repository URL, ref, and (when the provider needs auth) a short-lived credential that expires soon.\",\n schema: {response: {200: checkoutTokenResponseSchema}},\n errorHandler: (error) => {\n const known = isInterModuleKnownError(\n integrationsInterModuleContract.methods.createCheckoutSpec,\n error,\n )\n ? error\n : undefined;\n if (error instanceof JobNotFoundError)\n throw new ClientError(error.message, 'job-not-found', {status: 404});\n if (error instanceof WorkflowRunNotFoundError)\n throw new ClientError(error.message, 'run-not-found', {status: 404});\n if (error instanceof CheckoutIntentUnresolvedError)\n throw new ClientError(error.message, 'checkout-unavailable', {status: 404});\n if (known?.code === 'connection-not-found')\n throw new ClientError(\n 'Integration connection not found',\n 'integration-connection-not-found',\n {\n status: 404,\n },\n );\n if (known?.code === 'connection-inactive')\n throw new ClientError(\n 'Integration connection is not active',\n 'integration-connection-inactive',\n {\n status: 422,\n },\n );\n if (known?.code === 'connection-workspace-mismatch')\n throw new ClientError(\n 'Integration connection does not belong to this workspace',\n 'forbidden',\n {status: 403},\n );\n if (known?.code === 'provider-unavailable')\n throw new ClientError(\n 'Integration provider is unavailable',\n 'integration-provider-unavailable',\n {\n status: 422,\n },\n );\n if (known?.code === 'capability-unavailable')\n throw new ClientError(\n 'Integration capability is unavailable',\n 'integration-capability-unavailable',\n {\n status: 422,\n },\n );\n if (known?.code === 'checkout-unsupported')\n throw new ClientError(\n 'Integration checkout is unsupported',\n 'integration-checkout-unsupported',\n {\n status: 422,\n },\n );\n if (known?.code === 'provider-failure') {\n const status =\n known.details.reason === 'rate-limited'\n ? 429\n : known.details.reason === 'timeout' || known.details.reason === 'provider-unavailable'\n ? 503\n : 422;\n throw new ClientError('Integration provider request failed', known.details.reason, {\n details: {retry_after_seconds: known.details.retryAfterSeconds},\n status,\n });\n }\n throw error;\n },\n handler: async (request, reply) => {\n const leasedJob = requireLeasedJobContext(request);\n const {active: leaseIsActive} = await clients.runners.getLeaseState({\n jobId: leasedJob.jobId,\n jobExecutionId: leasedJob.jobExecutionId,\n runnerSessionId: leasedJob.runnerSessionId,\n });\n if (!leaseIsActive)\n throw new ClientError('Job lease is no longer active', 'lease-not-active', {status: 404});\n const checkout = await createJobCheckoutSpec({\n jobId: leasedJob.jobId,\n integrations: clients.integrations,\n projects: clients.projects,\n });\n reply.header('cache-control', 'no-store');\n return toCheckoutTokenDto(checkout.spec, {persist: checkout.persistCredentials});\n },\n });\n}\n"],"names":["requireLeasedJobContext","integrationsInterModuleContract","checkoutTokenResponseSchema","isInterModuleKnownError","ClientError","defineRoute","createJobCheckoutSpec","CheckoutIntentUnresolvedError","JobNotFoundError","WorkflowRunNotFoundError","toCheckoutTokenDto","createCheckoutTokenRoute","clients","method","path","description","schema","response","errorHandler","error","known","methods","createCheckoutSpec","undefined","message","status","code","details","reason","retry_after_seconds","retryAfterSeconds","handler","request","reply","leasedJob","active","leaseIsActive","runners","getLeaseState","jobId","jobExecutionId","runnerSessionId","checkout","integrations","projects","header","spec","persist","persistCredentials"],"mappings":"AAAA,SAAQA,uBAAuB,QAAO,4BAA4B;AAClE,SAEEC,+BAA+B,QAC1B,iDAAiD;AAGxD,SAAQC,2BAA2B,QAAO,6BAA6B;AACvE,SAAQC,uBAAuB,QAAO,wBAAwB;AAC9D,SAAQC,WAAW,EAAEC,WAAW,QAAO,wBAAwB;AAC/D,SAAQC,qBAAqB,QAAO,oBAAoB;AACxD,SACEC,6BAA6B,EAC7BC,gBAAgB,EAChBC,wBAAwB,QACnB,kBAAkB;AACzB,SAAQC,kBAAkB,QAAO,sCAAsC;AAEvE,OAAO,SAASC,yBAAyBC,OAIxC;IACC,OAAOP,YAAY;QACjBQ,QAAQ;QACRC,MAAM;QACNC,aACE;QACFC,QAAQ;YAACC,UAAU;gBAAC,KAAKf;YAA2B;QAAC;QACrDgB,cAAc,CAACC;YACb,MAAMC,QAAQjB,wBACZF,gCAAgCoB,OAAO,CAACC,kBAAkB,EAC1DH,SAEEA,QACAI;YACJ,IAAIJ,iBAAiBX,kBACnB,MAAM,IAAIJ,YAAYe,MAAMK,OAAO,EAAE,iB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AAC;gBAClEC,OAAOL,UAAUK,KAAK;gBACtBC,gBAAgBN,UAAUM,cAAc;gBACxCC,iBAAiBP,UAAUO,eAAe;YAC5C;YACA,IAAI,CAACL,eACH,MAAM,IAAIhC,YAAY,iCAAiC,oBAAoB;gBAACqB,QAAQ;YAAG;YACzF,MAAMiB,WAAW,MAAMpC,sBAAsB;gBAC3CiC,OAAOL,UAAUK,KAAK;gBACtBI,cAAc/B,QAAQ+B,YAAY;gBAClCC,UAAUhC,QAAQgC,QAAQ;YAC5B;YACAX,MAAMY,MAAM,CAAC,iBAAiB;YAC9B,OAAOnC,mBAAmBgC,SAASI,IAAI,EAAE;gBAACC,SAASL,SAASM,kBAAkB;YAAA;QAChF;IACF;AACF"}
@@ -1,3 +1,3 @@
1
- import type { ProjectsModuleClient } from '@shipfox/api-projects-dto';
1
+ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
2
2
  export declare function getRunAggregatesRoute(projects: ProjectsModuleClient): import("@shipfox/node-fastify").RouteDefinition;
3
3
  //# sourceMappingURL=get-run-aggregates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-run-aggregates.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/get-run-aggregates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAUpE,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,oBAAoB,mDAuDnE"}
1
+ {"version":3,"file":"get-run-aggregates.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/get-run-aggregates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAUjF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,oBAAoB,mDAuDnE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/presentation/routes/get-run-aggregates.ts"],"sourcesContent":["import type {ProjectsModuleClient} from '@shipfox/api-projects-dto';\nimport {\n workflowRunAggregatesQuerySchema,\n workflowRunAggregatesResponseSchema,\n} from '@shipfox/api-workflows-dto';\nimport {defineRoute} from '@shipfox/node-fastify';\nimport {logger} from '@shipfox/node-opentelemetry';\nimport {getWorkflowRunAggregates} from '#db/index.js';\nimport {requireProjectAccess} from './project-access.js';\n\nexport function getRunAggregatesRoute(projects: ProjectsModuleClient) {\n return defineRoute({\n method: 'GET',\n path: '/aggregates',\n description: 'Get faceted workflow run counts for a project',\n schema: {\n querystring: workflowRunAggregatesQuerySchema,\n response: {\n 200: workflowRunAggregatesResponseSchema,\n },\n },\n handler: async (request) => {\n const startedAt = performance.now();\n const {\n project_id: projectId,\n status,\n definition_id: definitionId,\n trigger_source: triggerSource,\n created_from: createdFrom,\n created_to: createdTo,\n } = request.query;\n\n const project = await requireProjectAccess(request, projectId, projects);\n const filters = {\n status,\n definitionId,\n triggerSource,\n createdFrom: createdFrom ? new Date(createdFrom) : undefined,\n createdTo: createdTo ? new Date(createdTo) : undefined,\n };\n const aggregates = await getWorkflowRunAggregates({projectId: project.id, filters});\n\n logger().info(\n {\n projectId: project.id,\n filterKeys: Object.entries(filters)\n .filter(([, value]) => value !== undefined)\n .map(([key]) => key),\n aggregateBucketSizes: {\n status: aggregates.status.length,\n triggerSource: aggregates.triggerSource.length,\n workflow: aggregates.workflow.length,\n },\n durationMs: Math.round(performance.now() - startedAt),\n },\n 'Aggregated workflow runs',\n );\n\n return {\n status: aggregates.status,\n trigger_source: aggregates.triggerSource,\n workflow: aggregates.workflow,\n };\n },\n });\n}\n"],"names":["workflowRunAggregatesQuerySchema","workflowRunAggregatesResponseSchema","defineRoute","logger","getWorkflowRunAggregates","requireProjectAccess","getRunAggregatesRoute","projects","method","path","description","schema","querystring","response","handler","request","startedAt","performance","now","project_id","projectId","status","definition_id","definitionId","trigger_source","triggerSource","created_from","createdFrom","created_to","createdTo","query","project","filters","Date","undefined","aggregates","id","info","filterKeys","Object","entries","filter","value","map","key","aggregateBucketSizes","length","workflow","durationMs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F;YAC7C,GACA;YAGF,OAAO;gBACLK,QAAQc,WAAWd,MAAM;gBACzBG,gBAAgBW,WAAWV,aAAa;gBACxCsB,UAAUZ,WAAWY,QAAQ;YAC/B;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/presentation/routes/get-run-aggregates.ts"],"sourcesContent":["import type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {\n workflowRunAggregatesQuerySchema,\n workflowRunAggregatesResponseSchema,\n} from '@shipfox/api-workflows-dto';\nimport {defineRoute} from '@shipfox/node-fastify';\nimport {logger} from '@shipfox/node-opentelemetry';\nimport {getWorkflowRunAggregates} from '#db/index.js';\nimport {requireProjectAccess} from './project-access.js';\n\nexport function getRunAggregatesRoute(projects: ProjectsModuleClient) {\n return defineRoute({\n method: 'GET',\n path: '/aggregates',\n description: 'Get faceted workflow run counts for a project',\n schema: {\n querystring: workflowRunAggregatesQuerySchema,\n response: {\n 200: workflowRunAggregatesResponseSchema,\n },\n },\n handler: async (request) => {\n const startedAt = performance.now();\n const {\n project_id: projectId,\n status,\n definition_id: definitionId,\n trigger_source: triggerSource,\n created_from: createdFrom,\n created_to: createdTo,\n } = request.query;\n\n const project = await requireProjectAccess(request, projectId, projects);\n const filters = {\n status,\n definitionId,\n triggerSource,\n createdFrom: createdFrom ? new Date(createdFrom) : undefined,\n createdTo: createdTo ? new Date(createdTo) : undefined,\n };\n const aggregates = await getWorkflowRunAggregates({projectId: project.id, filters});\n\n logger().info(\n {\n projectId: project.id,\n filterKeys: Object.entries(filters)\n .filter(([, value]) => value !== undefined)\n .map(([key]) => key),\n aggregateBucketSizes: {\n status: aggregates.status.length,\n triggerSource: aggregates.triggerSource.length,\n workflow: aggregates.workflow.length,\n },\n durationMs: Math.round(performance.now() - startedAt),\n },\n 'Aggregated workflow runs',\n );\n\n return {\n status: aggregates.status,\n trigger_source: aggregates.triggerSource,\n workflow: aggregates.workflow,\n };\n },\n });\n}\n"],"names":["workflowRunAggregatesQuerySchema","workflowRunAggregatesResponseSchema","defineRoute","logger","getWorkflowRunAggregates","requireProjectAccess","getRunAggregatesRoute","projects","method","path","description","schema","querystring","response","handler","request","startedAt","performance","now","project_id","projectId","status","definition_id","definitionId","trigger_source","triggerSource","created_from","createdFrom","created_to","createdTo","query","project","filters","Date","undefined","aggregates","id","info","filterKeys","Object","entries","filter","value","map","key","aggregateBucketSizes","length","workflow","durationMs","Math","round"],"mappings":"AACA,SACEA,gCAAgC,EAChCC,mCAAmC,QAC9B,6BAA6B;AACpC,SAAQC,WAAW,QAAO,wBAAwB;AAClD,SAAQC,MAAM,QAAO,8BAA8B;AACnD,SAAQC,wBAAwB,QAAO,eAAe;AACtD,SAAQC,oBAAoB,QAAO,sBAAsB;AAEzD,OAAO,SAASC,sBAAsBC,QAA8B;IAClE,OAAOL,YAAY;QACjBM,QAAQ;QACRC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACNC,aAAaZ;YACba,UAAU;gBACR,KAAKZ;YACP;QACF;QACAa,SAAS,OAAOC;YACd,MAAMC,YAAYC,YAAYC,GAAG;YACjC,MAAM,EACJC,YAAYC,SAAS,EACrBC,MAAM,EACNC,eAAeC,YAAY,EAC3BC,gBAAgBC,aAAa,EAC7BC,cAAcC,WAAW,EACzBC,YAAYC,SAAS,EACtB,GAAGd,QAAQe,KAAK;YAEjB,MAAMC,UAAU,MAAM1B,qBAAqBU,SAASK,WAAWb;YAC/D,MAAMyB,UAAU;gBACdX;gBACAE;gBACAE;gBACAE,aAAaA,cAAc,IAAIM,KAAKN,eAAeO;gBACnDL,WAAWA,YAAY,IAAII,KAAKJ,aAAaK;YAC/C;YACA,MAAMC,aAAa,MAAM/B,yBAAyB;gBAACgB,WAAWW,QAAQK,EAAE;gBAAEJ;YAAO;YAEjF7B,SAASkC,IAAI,CACX;gBACEjB,WAAWW,QAAQK,EAAE;gBACrBE,YAAYC,OAAOC,OAAO,CAACR,SACxBS,MAAM,CAAC,CAAC,GAAGC,MAAM,GAAKA,UAAUR,WAChCS,GAAG,CAAC,CAAC,CAACC,IAAI,GAAKA;gBAClBC,sBAAsB;oBACpBxB,QAAQc,WAAWd,MAAM,CAACyB,MAAM;oBAChCrB,eAAeU,WAAWV,aAAa,CAACqB,MAAM;oBAC9CC,UAAUZ,WAAWY,QAAQ,CAACD,MAAM;gBACtC;gBACAE,YAAYC,KAAKC,KAAK,CAACjC,YAAYC,GAAG,KAAKF;YAC7C,GACA;YAGF,OAAO;gBACLK,QAAQc,WAAWd,MAAM;gBACzBG,gBAAgBW,WAAWV,aAAa;gBACxCsB,UAAUZ,WAAWY,QAAQ;YAC/B;QACF;IACF;AACF"}
@@ -1,3 +1,3 @@
1
- import type { ProjectsModuleClient } from '@shipfox/api-projects-dto';
1
+ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
2
2
  export declare function getRunRoute(projects: ProjectsModuleClient): import("@shipfox/node-fastify").RouteDefinition;
3
3
  //# sourceMappingURL=get-run.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-run.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/get-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAepE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,oBAAoB,mDAqDzD"}
1
+ {"version":3,"file":"get-run.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/get-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAejF,wBAAgB,WAAW,CAAC,QAAQ,EAAE,oBAAoB,mDAqDzD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/presentation/routes/get-run.ts"],"sourcesContent":["import type {ProjectsModuleClient} from '@shipfox/api-projects-dto';\nimport {workflowRunDetailResponseSchema} from '@shipfox/api-workflows-dto';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {getWorkflowRunDetail} from '#db/index.js';\nimport {\n toJobDto,\n toJobExecutionDto,\n toRunAttemptDto,\n toRunDto,\n toStepAttemptDto,\n toStepDto,\n} from '#presentation/dto/index.js';\nimport {requireAccessibleRun} from './require-accessible-run.js';\n\nexport function getRunRoute(projects: ProjectsModuleClient) {\n return defineRoute({\n method: 'GET',\n path: '/:id',\n description: 'Get a workflow run by ID with jobs and steps',\n schema: {\n params: z.object({\n id: z.string().uuid(),\n }),\n querystring: z.object({\n attempt: z.coerce.number().int().positive().optional(),\n }),\n response: {\n 200: workflowRunDetailResponseSchema,\n },\n },\n handler: async (request) => {\n const {id} = request.params;\n await requireAccessibleRun({request, id, projects});\n\n const run = await getWorkflowRunDetail(id, request.query.attempt);\n if (!run) {\n throw new ClientError('Run not found', 'not-found', {status: 404});\n }\n\n const jobDtos = run.jobs.map((job) => ({\n ...toJobDto(job),\n job_executions: job.jobExecutions.map((jobExecution) => ({\n ...toJobExecutionDto(jobExecution),\n steps: jobExecution.steps.map((step) => {\n const attempts = step.attempts.map(toStepAttemptDto);\n const latestTerminalAttempt = attempts\n .filter((attempt) => attempt.status !== 'running')\n .at(-1);\n return {\n ...toStepDto(step),\n exit_code: latestTerminalAttempt?.exit_code ?? null,\n outputs: latestTerminalAttempt?.outputs ?? null,\n response: latestTerminalAttempt?.response ?? null,\n gate_result: latestTerminalAttempt?.gate_result ?? null,\n attempts,\n };\n }),\n })),\n }));\n\n return {\n ...toRunDto(run, run.latestAttempt),\n run_attempt: toRunAttemptDto(run.runAttempt),\n jobs: jobDtos,\n };\n },\n });\n}\n"],"names":["workflowRunDetailResponseSchema","ClientError","defineRoute","z","getWorkflowRunDetail","toJobDto","toJobExecutionDto","toRunAttemptDto","toRunDto","toStepAttemptDto","toStepDto","requireAccessibleRun","getRunRoute","projects","method","path","description","schema","params","object","id","string","uuid","querystring","attempt","coerce","number","int","positive","optional","response","handler","request","run","query","status","jobDtos","jobs","map","job","job_executions","jobExecutions","jobExecution","steps","step","attempts","latestTerminalAttempt","filter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gCAC7B,MAAMC,WAAWD,KAAKC,QAAQ,CAACP,GAAG,CAAC7B;gCACnC,MAAMqC,wBAAwBD,SAC3BE,MAAM,CAAC,CAACvB,UAAYA,QAAQW,MAAM,KAAK,WACvCa,EAAE,CAAC,CAAC;gCACP,OAAO;oCACL,GAAGtC,UAAUkC,KAAK;oCAClBK,WAAWH,uBAAuBG,aAAa;oCAC/CC,SAASJ,uBAAuBI,WAAW;oCAC3CpB,UAAUgB,uBAAuBhB,YAAY;oCAC7CqB,aAAaL,uBAAuBK,eAAe;oCACnDN;gCACF;4BACF;wBACF,CAAA;gBACF,CAAA;YAEA,OAAO;gBACL,GAAGrC,SAASyB,KAAKA,IAAImB,aAAa,CAAC;gBACnCC,aAAa9C,gBAAgB0B,IAAIqB,UAAU;gBAC3CjB,MAAMD;YACR;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/presentation/routes/get-run.ts"],"sourcesContent":["import type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {workflowRunDetailResponseSchema} from '@shipfox/api-workflows-dto';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {getWorkflowRunDetail} from '#db/index.js';\nimport {\n toJobDto,\n toJobExecutionDto,\n toRunAttemptDto,\n toRunDto,\n toStepAttemptDto,\n toStepDto,\n} from '#presentation/dto/index.js';\nimport {requireAccessibleRun} from './require-accessible-run.js';\n\nexport function getRunRoute(projects: ProjectsModuleClient) {\n return defineRoute({\n method: 'GET',\n path: '/:id',\n description: 'Get a workflow run by ID with jobs and steps',\n schema: {\n params: z.object({\n id: z.string().uuid(),\n }),\n querystring: z.object({\n attempt: z.coerce.number().int().positive().optional(),\n }),\n response: {\n 200: workflowRunDetailResponseSchema,\n },\n },\n handler: async (request) => {\n const {id} = request.params;\n await requireAccessibleRun({request, id, projects});\n\n const run = await getWorkflowRunDetail(id, request.query.attempt);\n if (!run) {\n throw new ClientError('Run not found', 'not-found', {status: 404});\n }\n\n const jobDtos = run.jobs.map((job) => ({\n ...toJobDto(job),\n job_executions: job.jobExecutions.map((jobExecution) => ({\n ...toJobExecutionDto(jobExecution),\n steps: jobExecution.steps.map((step) => {\n const attempts = step.attempts.map(toStepAttemptDto);\n const latestTerminalAttempt = attempts\n .filter((attempt) => attempt.status !== 'running')\n .at(-1);\n return {\n ...toStepDto(step),\n exit_code: latestTerminalAttempt?.exit_code ?? null,\n outputs: latestTerminalAttempt?.outputs ?? null,\n response: latestTerminalAttempt?.response ?? null,\n gate_result: latestTerminalAttempt?.gate_result ?? null,\n attempts,\n };\n }),\n })),\n }));\n\n return {\n ...toRunDto(run, run.latestAttempt),\n run_attempt: toRunAttemptDto(run.runAttempt),\n jobs: jobDtos,\n };\n },\n });\n}\n"],"names":["workflowRunDetailResponseSchema","ClientError","defineRoute","z","getWorkflowRunDetail","toJobDto","toJobExecutionDto","toRunAttemptDto","toRunDto","toStepAttemptDto","toStepDto","requireAccessibleRun","getRunRoute","projects","method","path","description","schema","params","object","id","string","uuid","querystring","attempt","coerce","number","int","positive","optional","response","handler","request","run","query","status","jobDtos","jobs","map","job","job_executions","jobExecutions","jobExecution","steps","step","attempts","latestTerminalAttempt","filter","at","exit_code","outputs","gate_result","latestAttempt","run_attempt","runAttempt"],"mappings":"AACA,SAAQA,+BAA+B,QAAO,6BAA6B;AAC3E,SAAQC,WAAW,EAAEC,WAAW,QAAO,wBAAwB;AAC/D,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,oBAAoB,QAAO,eAAe;AAClD,SACEC,QAAQ,EACRC,iBAAiB,EACjBC,eAAe,EACfC,QAAQ,EACRC,gBAAgB,EAChBC,SAAS,QACJ,6BAA6B;AACpC,SAAQC,oBAAoB,QAAO,8BAA8B;AAEjE,OAAO,SAASC,YAAYC,QAA8B;IACxD,OAAOX,YAAY;QACjBY,QAAQ;QACRC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACNC,QAAQf,EAAEgB,MAAM,CAAC;gBACfC,IAAIjB,E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MAAMD;YACR;QACF;IACF;AACF"}
@@ -1,8 +1,8 @@
1
1
  import type { AnnotationsInterModuleClient } from '@shipfox/annotations-dto/inter-module';
2
2
  import type { AgentInterModuleClient } from '@shipfox/api-agent-dto/inter-module';
3
3
  import type { AuthInterModuleClient } from '@shipfox/api-auth-dto/inter-module';
4
- import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto';
5
- import type { ProjectsModuleClient } from '@shipfox/api-projects-dto';
4
+ import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto/inter-module';
5
+ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
6
6
  import type { RunnersInterModuleClient } from '@shipfox/api-runners-dto/inter-module';
7
7
  import type { SecretsInterModuleClient } from '@shipfox/api-secrets-dto/inter-module';
8
8
  import type { RouteGroup } from '@shipfox/node-fastify';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,uCAAuC,CAAC;AACxF,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAEhF,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAatD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,sBAAsB,CAAC;IAC9B,WAAW,EAAE,4BAA4B,CAAC;IAC1C,IAAI,EAAE,qBAAqB,CAAC;IAC5B,YAAY,EAAE,wB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B/E"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/presentation/routes/index.ts"],"sourcesContent":["import type {AnnotationsInterModuleClient} from '@shipfox/annotations-dto/inter-module';\nimport type {AgentInterModuleClient} from '@shipfox/api-agent-dto/inter-module';\nimport {AUTH_LEASED_JOB, AUTH_USER} from '@shipfox/api-auth-context';\nimport type {AuthInterModuleClient} from '@shipfox/api-auth-dto/inter-module';\nimport type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport type {SecretsInterModuleClient} from '@shipfox/api-secrets-dto/inter-module';\nimport type {RouteGroup} from '@shipfox/node-fastify';\nimport {createAgentRuntimeConfigRoute} from './agent-runtime-config.js';\nimport {cancelRunRoute} from './cancel-run.js';\nimport {createCheckoutTokenRoute} from './checkout-token.js';\nimport {getRunRoute} from './get-run.js';\nimport {getRunAggregatesRoute} from './get-run-aggregates.js';\nimport {createGetStepSecretsRoute} from './get-step-secrets.js';\nimport {listRunAttemptsRoute} from './list-run-attempts.js';\nimport {listRunsRoute} from './list-runs.js';\nimport {createNextStepRoute} from './next-step.js';\nimport {createReportStepRoute} from './report-step.js';\nimport {rerunRunRoute} from './rerun-run.js';\n\ntype WorkflowRouteClients = {\n agent: AgentInterModuleClient;\n annotations: AnnotationsInterModuleClient;\n auth: AuthInterModuleClient;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n runners: RunnersInterModuleClient;\n secrets: SecretsInterModuleClient;\n};\n\nexport function createLeaseTokenRouteGroup(params: WorkflowRouteClients): RouteGroup {\n return {\n // The lease token names the job, so the path carries no job id (\"current\").\n prefix: '/runs/jobs/current',\n auth: AUTH_LEASED_JOB,\n routes: [\n createNextStepRoute(params),\n createReportStepRoute(params.runners),\n createCheckoutTokenRoute({\n integrations: params.integrations,\n projects: params.projects,\n runners: params.runners,\n }),\n createAgentRuntimeConfigRoute(params),\n createGetStepSecretsRoute(params.runners, params.secrets),\n ],\n };\n}\n\nexport function createWorkflowRoutes(params: WorkflowRouteClients): RouteGroup[] {\n return [\n {\n prefix: '/workflows/runs',\n auth: AUTH_USER,\n routes: [\n listRunsRoute(params.projects),\n getRunAggregatesRoute(params.projects),\n listRunAttemptsRoute(params.projects),\n getRunRoute(params.projects),\n cancelRunRoute(params.projects),\n rerunRunRoute(params.projects),\n ],\n },\n createLeaseTokenRouteGroup(params),\n ];\n}\n"],"names":["AUTH_LEASED_JOB","AUTH_USER","createAgentRuntimeConfigRoute","cancelRunRoute","createCheckoutTokenRoute","getRunRoute","getRunAggregatesRoute","createGetStepSecretsRoute","listRunAttemptsRoute","listRunsRoute","createNextStepRoute","createReportStepRoute","rerunRunRoute","createLeaseTokenRouteGroup","params","prefix","auth","routes","runners","integrations","projects","secrets","createWorkflowRoutes"],"mappings":"AAEA,SAAQA,eAAe,EAAEC,SAAS,QAAO,4BAA4B;AAOrE,SAAQC,6BAA6B,QAAO,4BAA4B;AACxE,SAAQC,cAAc,QAAO,kBAAkB;AAC/C,SAAQC,wBAAwB,QAAO,sBAAsB;AAC7D,SAAQC,WAAW,QAAO,eAAe;AACzC,SAAQC,qBAAqB,QAAO,0BAA0B;AAC9D,SAAQC,yBAAyB,QAAO,wBAAwB;AAChE,SAAQC,oBAAoB,QAAO,yBAAyB;AAC5D,SAAQC,aAAa,QAAO,iBAAiB;AAC7C,SAAQC,mBAAmB,QAAO,iBAAiB;AACnD,SAAQC,qBAAqB,QAAO,mBAAmB;AACvD,SAAQC,aAAa,QAAO,iBAAiB;AAY7C,OAAO,SAASC,2BAA2BC,MAA4B;IACrE,OAAO;QACL,4EAA4E;QAC5EC,QAAQ;QACRC,MAAMhB;QACNiB,QAAQ;YACNP,oBAAoBI;YACpBH,sBAAsBG,OAAOI,OAAO;YACpCd,yBAAyB;gBACvBe,cAAcL,OAAOK,YAAY;gBACjCC,UAAUN,OAAOM,QAAQ;gBACzBF,SAASJ,OAAOI,OAAO;YACzB;YACAhB,8BAA8BY;YAC9BP,0BAA0BO,OAAOI,OAAO,EAAEJ,OAAOO,OAAO;SACzD;IACH;AACF;AAEA,OAAO,SAASC,qBAAqBR,MAA4B;IAC/D,OAAO;QACL;YACEC,QAAQ;YACRC,MAAMf;YACNgB,QAAQ;gBACNR,cAAcK,OAAOM,QAAQ;gBAC7Bd,sBAAsBQ,OAAOM,QAAQ;gBACrCZ,qBAAqBM,OAAOM,QAAQ;gBACpCf,YAAYS,OAAOM,QAAQ;gBAC3BjB,eAAeW,OAAOM,QAAQ;gBAC9BR,cAAcE,OAAOM,QAAQ;aAC9B;QACH;QACAP,2BAA2BC;KAC5B;AACH"}
1
+ {"version":3,"sources":["../../../src/presentation/routes/index.ts"],"sourcesContent":["import type {AnnotationsInterModuleClient} from '@shipfox/annotations-dto/inter-module';\nimport type {AgentInterModuleClient} from '@shipfox/api-agent-dto/inter-module';\nimport {AUTH_LEASED_JOB, AUTH_USER} from '@shipfox/api-auth-context';\nimport type {AuthInterModuleClient} from '@shipfox/api-auth-dto/inter-module';\nimport type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport type {SecretsInterModuleClient} from '@shipfox/api-secrets-dto/inter-module';\nimport type {RouteGroup} from '@shipfox/node-fastify';\nimport {createAgentRuntimeConfigRoute} from './agent-runtime-config.js';\nimport {cancelRunRoute} from './cancel-run.js';\nimport {createCheckoutTokenRoute} from './checkout-token.js';\nimport {getRunRoute} from './get-run.js';\nimport {getRunAggregatesRoute} from './get-run-aggregates.js';\nimport {createGetStepSecretsRoute} from './get-step-secrets.js';\nimport {listRunAttemptsRoute} from './list-run-attempts.js';\nimport {listRunsRoute} from './list-runs.js';\nimport {createNextStepRoute} from './next-step.js';\nimport {createReportStepRoute} from './report-step.js';\nimport {rerunRunRoute} from './rerun-run.js';\n\ntype WorkflowRouteClients = {\n agent: AgentInterModuleClient;\n annotations: AnnotationsInterModuleClient;\n auth: AuthInterModuleClient;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n runners: RunnersInterModuleClient;\n secrets: SecretsInterModuleClient;\n};\n\nexport function createLeaseTokenRouteGroup(params: WorkflowRouteClients): RouteGroup {\n return {\n // The lease token names the job, so the path carries no job id (\"current\").\n prefix: '/runs/jobs/current',\n auth: AUTH_LEASED_JOB,\n routes: [\n createNextStepRoute(params),\n createReportStepRoute(params.runners),\n createCheckoutTokenRoute({\n integrations: params.integrations,\n projects: params.projects,\n runners: params.runners,\n }),\n createAgentRuntimeConfigRoute(params),\n createGetStepSecretsRoute(params.runners, params.secrets),\n ],\n };\n}\n\nexport function createWorkflowRoutes(params: WorkflowRouteClients): RouteGroup[] {\n return [\n {\n prefix: '/workflows/runs',\n auth: AUTH_USER,\n routes: [\n listRunsRoute(params.projects),\n getRunAggregatesRoute(params.projects),\n listRunAttemptsRoute(params.projects),\n getRunRoute(params.projects),\n cancelRunRoute(params.projects),\n rerunRunRoute(params.projects),\n ],\n },\n createLeaseTokenRouteGroup(params),\n ];\n}\n"],"names":["AUTH_LEASED_JOB","AUTH_USER","createAgentRuntimeConfigRoute","cancelRunRoute","createCheckoutTokenRoute","getRunRoute","getRunAggregatesRoute","createGetStepSecretsRoute","listRunAttemptsRoute","listRunsRoute","createNextStepRoute","createReportStepRoute","rerunRunRoute","createLeaseTokenRouteGroup","params","prefix","auth","routes","runners","integrations","projects","secrets","createWorkflowRoutes"],"mappings":"AAEA,SAAQA,eAAe,EAAEC,SAAS,QAAO,4BAA4B;AAOrE,SAAQC,6BAA6B,QAAO,4BAA4B;AACxE,SAAQC,cAAc,QAAO,kBAAkB;AAC/C,SAAQC,wBAAwB,QAAO,sBAAsB;AAC7D,SAAQC,WAAW,QAAO,eAAe;AACzC,SAAQC,qBAAqB,QAAO,0BAA0B;AAC9D,SAAQC,yBAAyB,QAAO,wBAAwB;AAChE,SAAQC,oBAAoB,QAAO,yBAAyB;AAC5D,SAAQC,aAAa,QAAO,iBAAiB;AAC7C,SAAQC,mBAAmB,QAAO,iBAAiB;AACnD,SAAQC,qBAAqB,QAAO,mBAAmB;AACvD,SAAQC,aAAa,QAAO,iBAAiB;AAY7C,OAAO,SAASC,2BAA2BC,MAA4B;IACrE,OAAO;QACL,4EAA4E;QAC5EC,QAAQ;QACRC,MAAMhB;QACNiB,QAAQ;YACNP,oBAAoBI;YACpBH,sBAAsBG,OAAOI,OAAO;YACpCd,yBAAyB;gBACvBe,cAAcL,OAAOK,YAAY;gBACjCC,UAAUN,OAAOM,QAAQ;gBACzBF,SAASJ,OAAOI,OAAO;YACzB;YACAhB,8BAA8BY;YAC9BP,0BAA0BO,OAAOI,OAAO,EAAEJ,OAAOO,OAAO;SACzD;IACH;AACF;AAEA,OAAO,SAASC,qBAAqBR,MAA4B;IAC/D,OAAO;QACL;YACEC,QAAQ;YACRC,MAAMf;YACNgB,QAAQ;gBACNR,cAAcK,OAAOM,QAAQ;gBAC7Bd,sBAAsBQ,OAAOM,QAAQ;gBACrCZ,qBAAqBM,OAAOM,QAAQ;gBACpCf,YAAYS,OAAOM,QAAQ;gBAC3BjB,eAAeW,OAAOM,QAAQ;gBAC9BR,cAAcE,OAAOM,QAAQ;aAC9B;QACH;QACAP,2BAA2BC;KAC5B;AACH"}
@@ -1,3 +1,3 @@
1
- import type { ProjectsModuleClient } from '@shipfox/api-projects-dto';
1
+ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
2
2
  export declare function listRunAttemptsRoute(projects: ProjectsModuleClient): import("@shipfox/node-fastify").RouteDefinition;
3
3
  //# sourceMappingURL=list-run-attempts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-run-attempts.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/list-run-attempts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAQpE,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,oBAAoB,mDAqBlE"}
1
+ {"version":3,"file":"list-run-attempts.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/list-run-attempts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAQjF,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,oBAAoB,mDAqBlE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/presentation/routes/list-run-attempts.ts"],"sourcesContent":["import type {ProjectsModuleClient} from '@shipfox/api-projects-dto';\nimport {workflowRunAttemptsResponseSchema} from '@shipfox/api-workflows-dto';\nimport {defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {listRunAttempts} from '#db/index.js';\nimport {toRunAttemptDto} from '#presentation/dto/index.js';\nimport {requireAccessibleRun} from './require-accessible-run.js';\n\nexport function listRunAttemptsRoute(projects: ProjectsModuleClient) {\n return defineRoute({\n method: 'GET',\n path: '/:id/attempts',\n description: 'List attempts in a workflow run lineage',\n schema: {\n params: z.object({\n id: z.string().uuid(),\n }),\n response: {\n 200: workflowRunAttemptsResponseSchema,\n },\n },\n handler: async (request) => {\n const {id} = request.params;\n const run = await requireAccessibleRun({request, id, projects});\n const attempts = await listRunAttempts({workflowRunId: run.id, projectId: run.projectId});\n\n return {attempts: attempts.map(toRunAttemptDto)};\n },\n });\n}\n"],"names":["workflowRunAttemptsResponseSchema","defineRoute","z","listRunAttempts","toRunAttemptDto","requireAccessibleRun","listRunAttemptsRoute","projects","method","path","description","schema","params","object","id","string","uuid","response","handler","request","run","attempts","workflowRunId","projectId","map"],"mappings":"AACA,SAAQA,iCAAiC,QAAO,6BAA6B;AAC7E,SAAQC,WAAW,QAAO,wBAAwB;AAClD,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,eAAe,QAAO,eAAe;AAC7C,SAAQC,eAAe,QAAO,6BAA6B;AAC3D,SAAQC,oBAAoB,QAAO,8BAA8B;AAEjE,OAAO,SAASC,qBAAqBC,QAA8B;IACjE,OAAON,YAAY;QACjBO,QAAQ;QACRC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACNC,QAAQV,EAAEW,MAAM,CAAC;gBACfC,IAAIZ,EAAEa,MAAM,GAAGC,IAAI;YACrB;YACAC,UAAU;gBACR,KAAKjB;YACP;QACF;QACAkB,SAAS,OAAOC;YACd,MAAM,EAACL,EAAE,EAAC,GAAGK,QAAQP,MAAM;YAC3B,MAAMQ,MAAM,MAAMf,qBAAqB;gBAACc;gBAASL;gBAAIP;YAAQ;YAC7D,MAAMc,WAAW,MAAMlB,gBAAgB;gBAACmB,eAAeF,IAAIN,EAAE;gBAAES,WAAWH,IAAIG,SAAS;YAAA;YAEvF,OAAO;gBAACF,UAAUA,SAASG,GAAG,CAACpB;YAAgB;QACjD;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/presentation/routes/list-run-attempts.ts"],"sourcesContent":["import type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {workflowRunAttemptsResponseSchema} from '@shipfox/api-workflows-dto';\nimport {defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {listRunAttempts} from '#db/index.js';\nimport {toRunAttemptDto} from '#presentation/dto/index.js';\nimport {requireAccessibleRun} from './require-accessible-run.js';\n\nexport function listRunAttemptsRoute(projects: ProjectsModuleClient) {\n return defineRoute({\n method: 'GET',\n path: '/:id/attempts',\n description: 'List attempts in a workflow run lineage',\n schema: {\n params: z.object({\n id: z.string().uuid(),\n }),\n response: {\n 200: workflowRunAttemptsResponseSchema,\n },\n },\n handler: async (request) => {\n const {id} = request.params;\n const run = await requireAccessibleRun({request, id, projects});\n const attempts = await listRunAttempts({workflowRunId: run.id, projectId: run.projectId});\n\n return {attempts: attempts.map(toRunAttemptDto)};\n },\n });\n}\n"],"names":["workflowRunAttemptsResponseSchema","defineRoute","z","listRunAttempts","toRunAttemptDto","requireAccessibleRun","listRunAttemptsRoute","projects","method","path","description","schema","params","object","id","string","uuid","response","handler","request","run","attempts","workflowRunId","projectId","map"],"mappings":"AACA,SAAQA,iCAAiC,QAAO,6BAA6B;AAC7E,SAAQC,WAAW,QAAO,wBAAwB;AAClD,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,eAAe,QAAO,eAAe;AAC7C,SAAQC,eAAe,QAAO,6BAA6B;AAC3D,SAAQC,oBAAoB,QAAO,8BAA8B;AAEjE,OAAO,SAASC,qBAAqBC,QAA8B;IACjE,OAAON,YAAY;QACjBO,QAAQ;QACRC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACNC,QAAQV,EAAEW,MAAM,CAAC;gBACfC,IAAIZ,EAAEa,MAAM,GAAGC,IAAI;YACrB;YACAC,UAAU;gBACR,KAAKjB;YACP;QACF;QACAkB,SAAS,OAAOC;YACd,MAAM,EAACL,EAAE,EAAC,GAAGK,QAAQP,MAAM;YAC3B,MAAMQ,MAAM,MAAMf,qBAAqB;gBAACc;gBAASL;gBAAIP;YAAQ;YAC7D,MAAMc,WAAW,MAAMlB,gBAAgB;gBAACmB,eAAeF,IAAIN,EAAE;gBAAES,WAAWH,IAAIG,SAAS;YAAA;YAEvF,OAAO;gBAACF,UAAUA,SAASG,GAAG,CAACpB;YAAgB;QACjD;IACF;AACF"}
@@ -1,3 +1,3 @@
1
- import type { ProjectsModuleClient } from '@shipfox/api-projects-dto';
1
+ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
2
2
  export declare function listRunsRoute(projects: ProjectsModuleClient): import("@shipfox/node-fastify").RouteDefinition;
3
3
  //# sourceMappingURL=list-runs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-runs.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/list-runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAYpE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,oBAAoB,mDAmE3D"}
1
+ {"version":3,"file":"list-runs.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/list-runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAYjF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,oBAAoB,mDAmE3D"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/presentation/routes/list-runs.ts"],"sourcesContent":["import type {ProjectsModuleClient} from '@shipfox/api-projects-dto';\nimport {\n workflowRunListQuerySchema,\n workflowRunListResponseSchema,\n} from '@shipfox/api-workflows-dto';\nimport {decodeTimestampIdCursor, encodeTimestampIdCursor} from '@shipfox/node-drizzle';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {logger} from '@shipfox/node-opentelemetry';\nimport {listWorkflowRuns} from '#db/index.js';\nimport {toRunDto} from '#presentation/dto/index.js';\nimport {requireProjectAccess} from './project-access.js';\n\nexport function listRunsRoute(projects: ProjectsModuleClient) {\n return defineRoute({\n method: 'GET',\n path: '/',\n description: 'List workflow runs for a project',\n schema: {\n querystring: workflowRunListQuerySchema,\n response: {\n 200: workflowRunListResponseSchema,\n },\n },\n handler: async (request) => {\n const startedAt = performance.now();\n const {\n project_id: projectId,\n limit,\n cursor,\n status,\n definition_id: definitionId,\n trigger_source: triggerSource,\n created_from: createdFrom,\n created_to: createdTo,\n } = request.query;\n const decodedCursor = decodeTimestampIdCursor(cursor);\n if (cursor && !decodedCursor) {\n throw new ClientError('Invalid cursor', 'invalid-cursor', {status: 400});\n }\n\n const project = await requireProjectAccess(request, projectId, projects);\n\n const filters = {\n status,\n definitionId,\n triggerSource,\n createdFrom: createdFrom ? new Date(createdFrom) : undefined,\n createdTo: createdTo ? new Date(createdTo) : undefined,\n };\n const result = await listWorkflowRuns({\n projectId: project.id,\n limit,\n cursor: decodedCursor,\n filters,\n includeTotal: !decodedCursor,\n });\n\n logger().info(\n {\n projectId: project.id,\n filterKeys: Object.entries(filters)\n .filter(([, value]) => value !== undefined)\n .map(([key]) => key),\n limit,\n cursorPresent: Boolean(cursor),\n resultCount: result.runs.length,\n nextCursorPresent: Boolean(result.nextCursor),\n durationMs: Math.round(performance.now() - startedAt),\n },\n 'Listed workflow runs',\n );\n\n return {\n runs: result.runs.map((run) => toRunDto(run)),\n next_cursor: result.nextCursor ? encodeTimestampIdCursor(result.nextCursor) : null,\n filtered_total_count: result.filteredTotalCount,\n };\n },\n });\n}\n"],"names":["workflowRunListQuerySchema","workflowRunListResponseSchema","decodeTimestampIdCursor","encodeTimestampIdCursor","ClientError","defineRoute","logger","listWorkflowRuns","toRunDto","requireProjectAccess","listRunsRoute","projects","method","path","description","schema","querystring","response","handler","request","startedAt","performance","now","project_id","projectId","limit","cursor","status","definition_id","definitionId","trigger_source","triggerSource","created_from","createdFrom","created_to","createdTo","query","decodedCursor","project","filters","Date","undefined","result","id","includeTotal","info","filterKeys","Object","entries","filter","value","map","key","cursorPresent","Boolean","resultCount","runs","length","nextCursorPresent","nextCursor","durationMs","Math","round","run","next_cursor","filtered_total_count","filteredTotalCount"],"mappings":"AACA,SACEA,0BAA0B,EAC1BC,6BAA6B,QACxB,6BAA6B;AACpC,SAAQC,uBAAuB,EAAEC,uBAAuB,QAAO,wBAAwB;AACvF,SAAQC,WAAW,EAAEC,WAAW,QAAO,wBAAwB;AAC/D,SAAQC,MAAM,QAAO,8BAA8B;AACnD,SAAQC,gBAAgB,QAAO,eAAe;AAC9C,SAAQC,QAAQ,QAAO,6BAA6B;AACpD,SAAQC,oBAAoB,QAAO,sBAAsB;AAEzD,OAAO,SAASC,cAAcC,QAA8B;IAC1D,OAAON,YAAY;QACjBO,QAAQ;QACRC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACNC,aAAahB;YACbiB,UAAU;gBACR,KAAKhB;YACP;QACF;QACAiB,SAAS,OAAOC;YACd,MAAMC,YAAYC,YAAYC,GAAG;YACjC,MAAM,EACJC,YAAYC,SAAS,EACr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ourcesContent":["import type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {\n workflowRunListQuerySchema,\n workflowRunListResponseSchema,\n} from '@shipfox/api-workflows-dto';\nimport {decodeTimestampIdCursor, encodeTimestampIdCursor} from '@shipfox/node-drizzle';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {logger} from '@shipfox/node-opentelemetry';\nimport {listWorkflowRuns} from '#db/index.js';\nimport {toRunDto} from '#presentation/dto/index.js';\nimport {requireProjectAccess} from './project-access.js';\n\nexport function listRunsRoute(projects: ProjectsModuleClient) {\n return defineRoute({\n method: 'GET',\n path: '/',\n description: 'List workflow runs for a project',\n schema: {\n querystring: workflowRunListQuerySchema,\n response: {\n 200: workflowRunListResponseSchema,\n },\n },\n handler: async (request) => {\n const startedAt = performance.now();\n const {\n project_id: projectId,\n limit,\n cursor,\n status,\n definition_id: definitionId,\n trigger_source: triggerSource,\n created_from: createdFrom,\n created_to: createdTo,\n } = request.query;\n const decodedCursor = decodeTimestampIdCursor(cursor);\n if (cursor && !decodedCursor) {\n throw new ClientError('Invalid cursor', 'invalid-cursor', {status: 400});\n }\n\n const project = await requireProjectAccess(request, projectId, projects);\n\n const filters = {\n status,\n definitionId,\n triggerSource,\n createdFrom: createdFrom ? new Date(createdFrom) : undefined,\n createdTo: createdTo ? new Date(createdTo) : undefined,\n };\n const result = await listWorkflowRuns({\n projectId: project.id,\n limit,\n cursor: decodedCursor,\n filters,\n includeTotal: !decodedCursor,\n });\n\n logger().info(\n {\n projectId: project.id,\n filterKeys: Object.entries(filters)\n .filter(([, value]) => value !== undefined)\n .map(([key]) => key),\n limit,\n cursorPresent: Boolean(cursor),\n resultCount: result.runs.length,\n nextCursorPresent: Boolean(result.nextCursor),\n durationMs: Math.round(performance.now() - startedAt),\n },\n 'Listed workflow runs',\n );\n\n return {\n runs: result.runs.map((run) => toRunDto(run)),\n next_cursor: result.nextCursor ? encodeTimestampIdCursor(result.nextCursor) : null,\n filtered_total_count: result.filteredTotalCount,\n };\n },\n });\n}\n"],"names":["workflowRunListQuerySchema","workflowRunListResponseSchema","decodeTimestampIdCursor","encodeTimestampIdCursor","ClientError","defineRoute","logger","listWorkflowRuns","toRunDto","requireProjectAccess","listRunsRoute","projects","method","path","description","schema","querystring","response","handler","request","startedAt","performance","now","project_id","projectId","limit","cursor","status","definition_id","definitionId","trigger_source","triggerSource","created_from","createdFrom","created_to","createdTo","query","decodedCursor","project","filters","Date","undefined","result","id","includeTotal","info","filterKeys","Object","entries","filter","value","map","key","cursorPresent","Boolean","resultCount","runs","length","nextCursorPresent","nextCursor","durationMs","Math","round","run","next_cursor","filtered_total_count","filteredTotalCount"],"mappings":"AACA,SACEA,0BAA0B,EAC1BC,6BAA6B,QACxB,6BAA6B;AACpC,SAAQC,uBAAuB,EAAEC,uBAAuB,QAAO,wBAAwB;AACvF,SAAQC,WAAW,EAAEC,WAAW,QAAO,wBAAwB;AAC/D,SAAQC,MAAM,QAAO,8BAA8B;AACnD,SAAQC,gBAAgB,QAAO,eAAe;AAC9C,SAAQC,QAAQ,QAAO,6BAA6B;AACpD,SAAQC,oBAAoB,QAAO,sBAAsB;AAEzD,OAAO,SAASC,cAAcC,QAA8B;IAC1D,OAAON,YAAY;QACjBO,QAAQ;QACRC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACNC,aAAahB;YACbiB,UAAU;gBACR,KAAKhB;YACP;QACF;QACAiB,SAAS,OAAOC;YACd,MAAMC,YAAYC,YAAYC,GAAG;YACjC,MAAM,EACJC,YAAYC,SAAS,EACrBC,KAAK,EACLC,MAAM,EACNC,MAAM,EACNC,eAAeC,YAAY,EAC3BC,gBAAgBC,aAAa,EAC7BC,cAAcC,WAAW,EACzBC,YAAYC,SAAS,EACtB,GAAGhB,QAAQiB,KAAK;YACjB,MAAMC,gBAAgBnC,wBAAwBwB;YAC9C,IAAIA,UAAU,CAACW,eAAe;gBAC5B,MAAM,IAAIjC,YAAY,kBAAkB,kBAAkB;oBAACuB,QAAQ;gBAAG;YACxE;YAEA,MAAMW,UAAU,MAAM7B,qBAAqBU,SAASK,WAAWb;YAE/D,MAAM4B,UAAU;gBACdZ;gBACAE;gBACAE;gBACAE,aAAaA,cAAc,IAAIO,KAAKP,eAAeQ;gBACnDN,WAAWA,YAAY,IAAIK,KAAKL,aAAaM;YAC/C;YACA,MAAMC,SAAS,MAAMnC,iBAAiB;gBACpCiB,WAAWc,QAAQK,EAAE;gBACrBlB;gBACAC,QAAQW;gBACRE;gBACAK,cAAc,CAACP;YACjB;YAEA/B,SAASuC,IAAI,CACX;gBACErB,WAAWc,QAAQK,EAAE;gBACrBG,YAAYC,OAAOC,OAAO,CAACT,SACxBU,MAAM,CAAC,CAAC,GAAGC,MAAM,GAAKA,UAAUT,WAChCU,GAAG,CAAC,CAAC,CAACC,IAAI,GAAKA;gBAClB3B;gBACA4B,eAAeC,QAAQ5B;gBACvB6B,aAAab,OAAOc,IAAI,CAACC,MAAM;gBAC/BC,mBAAmBJ,QAAQZ,OAAOiB,UAAU;gBAC5CC,YAAYC,KAAKC,KAAK,CAACzC,YAAYC,GAAG,KAAKF;YAC7C,GACA;YAGF,OAAO;gBACLoC,MAAMd,OAAOc,IAAI,CAACL,GAAG,CAAC,CAACY,MAAQvD,SAASuD;gBACxCC,aAAatB,OAAOiB,UAAU,GAAGxD,wBAAwBuC,OAAOiB,UAAU,IAAI;gBAC9EM,sBAAsBvB,OAAOwB,kBAAkB;YACjD;QACF;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"next-step.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/next-step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,uCAAuC,CAAC;AACxF,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAEhF,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AAQpF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,KAAK,EAAE,sBAAsB,CAAC;IAC9B,WAAW,EAAE,4BAA4B,CAAC;IAC1C,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,wBAAwB,CAAC;CACnC,mDAgEA"}
1
+ {"version":3,"file":"next-step.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/next-step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,uCAAuC,CAAC;AACxF,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAEhF,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AAQpF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,KAAK,EAAE,sBAAsB,CAAC;IAC9B,WAAW,EAAE,4BAA4B,CAAC;IAC1C,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,wBAAwB,CAAC;CACnC,mDAoEA"}
@@ -2,7 +2,7 @@ import { requireLeasedJobContext } from '@shipfox/api-auth-context';
2
2
  import { nextStepResponseSchema } from '@shipfox/api-workflows-dto';
3
3
  import { ClientError, defineRoute } from '@shipfox/node-fastify';
4
4
  import { warnAgentToolCapabilityMismatchOnDispatch } from '#core/agent-tool-capability-warning.js';
5
- import { JobLeaseNotActiveError, JobNotFoundError } from '#core/errors.js';
5
+ import { JobNotFoundError } from '#core/errors.js';
6
6
  import { nextStepForLeasedJobExecution } from '#core/job-execution.js';
7
7
  import { toStepDto } from '#presentation/dto/step.js';
8
8
  export function createNextStepRoute(params) {
@@ -21,19 +21,22 @@ export function createNextStepRoute(params) {
21
21
  status: 404
22
22
  });
23
23
  }
24
- if (error instanceof JobLeaseNotActiveError) {
25
- throw new ClientError('Job lease is no longer active', 'lease-not-active', {
26
- status: 404
27
- });
28
- }
29
24
  throw error;
30
25
  },
31
26
  handler: async (request)=>{
32
27
  const leasedJob = requireLeasedJobContext(request);
33
- const next = await nextStepForLeasedJobExecution({
28
+ const { active: leaseIsActive } = await params.runners.getLeaseState({
34
29
  jobId: leasedJob.jobId,
35
30
  jobExecutionId: leasedJob.jobExecutionId,
36
- runnerSessionId: leasedJob.runnerSessionId,
31
+ runnerSessionId: leasedJob.runnerSessionId
32
+ });
33
+ if (!leaseIsActive) {
34
+ throw new ClientError('Job lease is no longer active', 'lease-not-active', {
35
+ status: 404
36
+ });
37
+ }
38
+ const next = await nextStepForLeasedJobExecution({
39
+ jobExecutionId: leasedJob.jobExecutionId,
37
40
  agent: params.agent
38
41
  });
39
42
  if (next.kind === 'step') {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/presentation/routes/next-step.ts"],"sourcesContent":["import type {AnnotationsInterModuleClient} from '@shipfox/annotations-dto/inter-module';\nimport type {AgentInterModuleClient} from '@shipfox/api-agent-dto/inter-module';\nimport {requireLeasedJobContext} from '@shipfox/api-auth-context';\nimport type {AuthInterModuleClient} from '@shipfox/api-auth-dto/inter-module';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport {nextStepResponseSchema} from '@shipfox/api-workflows-dto';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {warnAgentToolCapabilityMismatchOnDispatch} from '#core/agent-tool-capability-warning.js';\nimport {JobLeaseNotActiveError, JobNotFoundError} from '#core/errors.js';\nimport {nextStepForLeasedJobExecution} from '#core/job-execution.js';\nimport {toStepDto} from '#presentation/dto/step.js';\n\nexport function createNextStepRoute(params: {\n agent: AgentInterModuleClient;\n annotations: AnnotationsInterModuleClient;\n auth: AuthInterModuleClient;\n runners: RunnersInterModuleClient;\n}) {\n return defineRoute({\n method: 'POST',\n path: '/steps/next',\n description:\n 'Returns the next step for the runner to run on its job. The job is identified by the access token, so no job ID is needed. Calling this again before reporting the current step returns that same step, so retries are safe. When no runnable steps remain, the response reports that there are no more steps to run, along with the job status; the runner then stops. Finalization is driven server-side from recorded step results and dispatch-time skips, not by the runner calling a job-completion endpoint.',\n schema: {\n response: {\n 200: nextStepResponseSchema,\n },\n },\n errorHandler: (error) => {\n if (error instanceof JobNotFoundError) {\n throw new ClientError(error.message, 'job-not-found', {status: 404});\n }\n if (error instanceof JobLeaseNotActiveError) {\n throw new ClientError('Job lease is no longer active', 'lease-not-active', {status: 404});\n }\n throw error;\n },\n handler: async (request) => {\n const leasedJob = requireLeasedJobContext(request);\n const next = await nextStepForLeasedJobExecution({\n jobId: leasedJob.jobId,\n jobExecutionId: leasedJob.jobExecutionId,\n runnerSessionId: leasedJob.runnerSessionId,\n agent: params.agent,\n });\n\n if (next.kind === 'step') {\n const {token: leaseToken} = await params.auth.mintJobLeaseToken({\n workflowRunId: leasedJob.workflowRunId,\n ...(leasedJob.workflowRunAttempt === undefined\n ? {}\n : {workflowRunAttempt: leasedJob.workflowRunAttempt}),\n workflowRunAttemptId: leasedJob.workflowRunAttemptId,\n jobId: leasedJob.jobId,\n jobExecutionId: leasedJob.jobExecutionId,\n projectId: leasedJob.projectId,\n workspaceId: leasedJob.workspaceId,\n runnerSessionId: leasedJob.runnerSessionId,\n currentStepId: next.step.id,\n currentStepAttempt: next.step.currentAttempt,\n });\n if (next.dispatched) {\n await warnAgentToolCapabilityMismatchOnDispatch({\n annotations: params.annotations,\n runners: params.runners,\n leaseIdentity: leasedJob,\n step: next.step,\n });\n }\n // The runner echoes this back on report so a stale report from a superseded\n // attempt is ignored.\n return {\n kind: 'step' as const,\n step: toStepDto(next.step),\n attempt: next.step.currentAttempt,\n lease_token: leaseToken,\n };\n }\n return {kind: 'done' as const, status: next.status};\n },\n });\n}\n"],"names":["requireLeasedJobContext","nextStepResponseSchema","ClientError","defineRoute","warnAgentToolCapabilityMismatchOnDispatch","JobLeaseNotActiveError","JobNotFoundError","nextStepForLeasedJobExecution","toStepDto","createNextStepRoute","params","method","path","description","schema","response","errorHandler","error","message","status","handler","request","leasedJob","next","jobId","jobExecutionId","runnerSessionId","agent","kind","token","leaseToken","auth","mintJobLeaseToken","workflowRunId","workflowRunAttempt","undefined","workflowRunAttemptId","projectId","workspaceId","currentStepId","step","id","currentStepAttempt","currentAttempt","dispatched","annotations","runners","leaseIdentity","attempt","lease_token"],"mappings":"AAEA,SAAQA,uBAAuB,QAAO,4BAA4B;AAGlE,SAAQC,sBAAsB,QAAO,6BAA6B;AAClE,SAAQC,WAAW,EAAEC,WAAW,QAAO,wBAAwB;AAC/D,SAAQC,yCAAyC,QAAO,yCAAyC;AACjG,SAAQC,sBAAsB,EAAEC,gBAAgB,QAAO,kBAAkB;AACzE,SAAQC,6BAA6B,QAAO,yBAAyB;AACrE,SAAQC,SAAS,QAAO,4BAA4B;AAEpD,OAAO,SAASC,oBAAoBC,MAKnC;IACC,OAAOP,YAAY;QACjBQ,QAAQ;QACRC,MAAM;QACNC,aACE;QACFC,QAAQ;YACNC,UAAU;gBACR,KAAKd;YACP;QACF;QACAe,cAAc,CAACC;YACb,IAAIA,iBAAiBX,kBAAkB;gBACrC,MAAM,IAAIJ,YAAYe,MAAMC,OAAO,EAAE,iBAAiB;oBAACC,QAAQ;gBAAG;YACpE;YACA,IAAIF,iBAAiBZ,wBAAwB;gBAC3C,MAAM,IAAIH,YAAY,iCAAiC,oBAAoB;oBAACiB,QAAQ;gBAAG;YACzF;YACA,MAAMF;QACR;QACAG,SAAS,OAAOC;YACd,MAAMC,YAAYtB,wBAAwBqB;YAC1C,MAAME,OAAO,MAAMhB,8BAA8B;gBAC/CiB,OAAOF,UAAUE,KAAK;gBACtBC,gBAAgBH,UAAUG,cAAc;gBACxCC,iBAAiBJ,UAAUI,eAAe;gBAC1CC,OAAOjB,OAAOiB,KAAK;YACrB;YAEA,IAAIJ,KAAKK,IAAI,KAAK,QAAQ;gBACxB,MAAM,EAACC,OAAOC,UAAU,EAAC,GAAG,MAAMpB,OAAOqB,IAAI,CAACC,iBAAiB,CAAC;oBAC9DC,eAAeX,UAAUW,aAAa;oBACtC,GAAIX,UAAUY,kBAAkB,KAAKC,YACjC,CAAC,IACD;wBAACD,oBAAoBZ,UAAUY,kBAAkB;oBAAA,CAAC;oBACtDE,sBAAsBd,UAAUc,oBAAoB;oBACpDZ,OAAOF,UAAUE,KAAK;oBACtBC,gBAAgBH,UAAUG,cAAc;oBACxCY,WAAWf,UAAUe,SAAS;oBAC9BC,aAAahB,UAAUgB,WAAW;oBAClCZ,iBAAiBJ,UAAUI,eAAe;oBAC1Ca,eAAehB,KAAKiB,IAAI,CAACC,EAAE;oBAC3BC,oBAAoBnB,KAAKiB,IAAI,CAACG,cAAc;gBAC9C;gBACA,IAAIpB,KAAKqB,UAAU,EAAE;oBACnB,MAAMxC,0CAA0C;wBAC9CyC,aAAanC,OAAOmC,WAAW;wBAC/BC,SAASpC,OAAOoC,OAAO;wBACvBC,eAAezB;wBACfkB,MAAMjB,KAAKiB,IAAI;oBACjB;gBACF;gBACA,4EAA4E;gBAC5E,sBAAsB;gBACtB,OAAO;oBACLZ,MAAM;oBACNY,MAAMhC,UAAUe,KAAKiB,IAAI;oBACzBQ,SAASzB,KAAKiB,IAAI,CAACG,cAAc;oBACjCM,aAAanB;gBACf;YACF;YACA,OAAO;gBAACF,MAAM;gBAAiBT,QAAQI,KAAKJ,MAAM;YAAA;QACpD;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/presentation/routes/next-step.ts"],"sourcesContent":["import type {AnnotationsInterModuleClient} from '@shipfox/annotations-dto/inter-module';\nimport type {AgentInterModuleClient} from '@shipfox/api-agent-dto/inter-module';\nimport {requireLeasedJobContext} from '@shipfox/api-auth-context';\nimport type {AuthInterModuleClient} from '@shipfox/api-auth-dto/inter-module';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport {nextStepResponseSchema} from '@shipfox/api-workflows-dto';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {warnAgentToolCapabilityMismatchOnDispatch} from '#core/agent-tool-capability-warning.js';\nimport {JobNotFoundError} from '#core/errors.js';\nimport {nextStepForLeasedJobExecution} from '#core/job-execution.js';\nimport {toStepDto} from '#presentation/dto/step.js';\n\nexport function createNextStepRoute(params: {\n agent: AgentInterModuleClient;\n annotations: AnnotationsInterModuleClient;\n auth: AuthInterModuleClient;\n runners: RunnersInterModuleClient;\n}) {\n return defineRoute({\n method: 'POST',\n path: '/steps/next',\n description:\n 'Returns the next step for the runner to run on its job. The job is identified by the access token, so no job ID is needed. Calling this again before reporting the current step returns that same step, so retries are safe. When no runnable steps remain, the response reports that there are no more steps to run, along with the job status; the runner then stops. Finalization is driven server-side from recorded step results and dispatch-time skips, not by the runner calling a job-completion endpoint.',\n schema: {\n response: {\n 200: nextStepResponseSchema,\n },\n },\n errorHandler: (error) => {\n if (error instanceof JobNotFoundError) {\n throw new ClientError(error.message, 'job-not-found', {status: 404});\n }\n throw error;\n },\n handler: async (request) => {\n const leasedJob = requireLeasedJobContext(request);\n const {active: leaseIsActive} = await params.runners.getLeaseState({\n jobId: leasedJob.jobId,\n jobExecutionId: leasedJob.jobExecutionId,\n runnerSessionId: leasedJob.runnerSessionId,\n });\n if (!leaseIsActive) {\n throw new ClientError('Job lease is no longer active', 'lease-not-active', {status: 404});\n }\n\n const next = await nextStepForLeasedJobExecution({\n jobExecutionId: leasedJob.jobExecutionId,\n agent: params.agent,\n });\n\n if (next.kind === 'step') {\n const {token: leaseToken} = await params.auth.mintJobLeaseToken({\n workflowRunId: leasedJob.workflowRunId,\n ...(leasedJob.workflowRunAttempt === undefined\n ? {}\n : {workflowRunAttempt: leasedJob.workflowRunAttempt}),\n workflowRunAttemptId: leasedJob.workflowRunAttemptId,\n jobId: leasedJob.jobId,\n jobExecutionId: leasedJob.jobExecutionId,\n projectId: leasedJob.projectId,\n workspaceId: leasedJob.workspaceId,\n runnerSessionId: leasedJob.runnerSessionId,\n currentStepId: next.step.id,\n currentStepAttempt: next.step.currentAttempt,\n });\n if (next.dispatched) {\n await warnAgentToolCapabilityMismatchOnDispatch({\n annotations: params.annotations,\n runners: params.runners,\n leaseIdentity: leasedJob,\n step: next.step,\n });\n }\n // The runner echoes this back on report so a stale report from a superseded\n // attempt is ignored.\n return {\n kind: 'step' as const,\n step: toStepDto(next.step),\n attempt: next.step.currentAttempt,\n lease_token: leaseToken,\n };\n }\n return {kind: 'done' as const, status: next.status};\n },\n });\n}\n"],"names":["requireLeasedJobContext","nextStepResponseSchema","ClientError","defineRoute","warnAgentToolCapabilityMismatchOnDispatch","JobNotFoundError","nextStepForLeasedJobExecution","toStepDto","createNextStepRoute","params","method","path","description","schema","response","errorHandler","error","message","status","handler","request","leasedJob","active","leaseIsActive","runners","getLeaseState","jobId","jobExecutionId","runnerSessionId","next","agent","kind","token","leaseToken","auth","mintJobLeaseToken","workflowRunId","workflowRunAttempt","undefined","workflowRunAttemptId","projectId","workspaceId","currentStepId","step","id","currentStepAttempt","currentAttempt","dispatched","annotations","leaseIdentity","attempt","lease_token"],"mappings":"AAEA,SAAQA,uBAAuB,QAAO,4BAA4B;AAGlE,SAAQC,sBAAsB,QAAO,6BAA6B;AAClE,SAAQC,WAAW,EAAEC,WAAW,QAAO,wBAAwB;AAC/D,SAAQC,yCAAyC,QAAO,yCAAyC;AACjG,SAAQC,gBAAgB,QAAO,kBAAkB;AACjD,SAAQC,6BAA6B,QAAO,yBAAyB;AACrE,SAAQC,SAAS,QAAO,4BAA4B;AAEpD,OAAO,SAASC,oBAAoBC,MAKnC;IACC,OAAON,YAAY;QACjBO,QAAQ;QACRC,MAAM;QACNC,aACE;QACFC,QAAQ;YACNC,UAAU;gBACR,KAAKb;YACP;QACF;QACAc,cAAc,CAACC;YACb,IAAIA,iBAAiBX,kBAAkB;gBACrC,MAAM,IAAIH,YAAYc,MAAMC,OAAO,EAAE,iBAAiB;oBAACC,QAAQ;gBAAG;YACpE;YACA,MAAMF;QACR;QACAG,SAAS,OAAOC;YACd,MAAMC,YAAYrB,wBAAwBoB;YAC1C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AACG,cAAc;oBACjCK,aAAalB;gBACf;YACF;YACA,OAAO;gBAACF,MAAM;gBAAiBb,QAAQW,KAAKX,MAAM;YAAA;QACpD;IACF;AACF"}
@@ -1,4 +1,4 @@
1
- import type { ProjectsModuleClient } from '@shipfox/api-projects-dto';
1
+ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
2
2
  import type { FastifyRequest } from 'fastify';
3
3
  export declare function requireProjectAccess(request: FastifyRequest, projectId: string, projects: ProjectsModuleClient): Promise<{
4
4
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"project-access.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/project-access.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAEpE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAE5C,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,oBAAoB;;;;;;GAO/B"}
1
+ {"version":3,"file":"project-access.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/project-access.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAEjF,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAE5C,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,oBAAoB;;;;;;GAO/B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/presentation/routes/project-access.ts"],"sourcesContent":["import {requireWorkspaceAccess} from '@shipfox/api-auth-context';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto';\nimport {ClientError} from '@shipfox/node-fastify';\nimport type {FastifyRequest} from 'fastify';\n\nexport async function requireProjectAccess(\n request: FastifyRequest,\n projectId: string,\n projects: ProjectsModuleClient,\n) {\n const result = await projects.getProjectById({projectId});\n if (result.project === null)\n throw new ClientError('Project not found', 'project-not-found', {status: 404});\n requireWorkspaceAccess({request, workspaceId: result.project.workspaceId});\n return result.project;\n}\n"],"names":["requireWorkspaceAccess","ClientError","requireProjectAccess","request","projectId","projects","result","getProjectById","project","status","workspaceId"],"mappings":"AAAA,SAAQA,sBAAsB,QAAO,4BAA4B;AAEjE,SAAQC,WAAW,QAAO,wBAAwB;AAGlD,OAAO,eAAeC,qBACpBC,OAAuB,EACvBC,SAAiB,EACjBC,QAA8B;IAE9B,MAAMC,SAAS,MAAMD,SAASE,cAAc,CAAC;QAACH;IAAS;IACvD,IAAIE,OAAOE,OAAO,KAAK,MACrB,MAAM,IAAIP,YAAY,qBAAqB,qBAAqB;QAACQ,QAAQ;IAAG;IAC9ET,uBAAuB;QAACG;QAASO,aAAaJ,OAAOE,OAAO,CAACE,WAAW;IAAA;IACxE,OAAOJ,OAAOE,OAAO;AACvB"}
1
+ {"version":3,"sources":["../../../src/presentation/routes/project-access.ts"],"sourcesContent":["import {requireWorkspaceAccess} from '@shipfox/api-auth-context';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {ClientError} from '@shipfox/node-fastify';\nimport type {FastifyRequest} from 'fastify';\n\nexport async function requireProjectAccess(\n request: FastifyRequest,\n projectId: string,\n projects: ProjectsModuleClient,\n) {\n const result = await projects.getProjectById({projectId});\n if (result.project === null)\n throw new ClientError('Project not found', 'project-not-found', {status: 404});\n requireWorkspaceAccess({request, workspaceId: result.project.workspaceId});\n return result.project;\n}\n"],"names":["requireWorkspaceAccess","ClientError","requireProjectAccess","request","projectId","projects","result","getProjectById","project","status","workspaceId"],"mappings":"AAAA,SAAQA,sBAAsB,QAAO,4BAA4B;AAEjE,SAAQC,WAAW,QAAO,wBAAwB;AAGlD,OAAO,eAAeC,qBACpBC,OAAuB,EACvBC,SAAiB,EACjBC,QAA8B;IAE9B,MAAMC,SAAS,MAAMD,SAASE,cAAc,CAAC;QAACH;IAAS;IACvD,IAAIE,OAAOE,OAAO,KAAK,MACrB,MAAM,IAAIP,YAAY,qBAAqB,qBAAqB;QAACQ,QAAQ;IAAG;IAC9ET,uBAAuB;QAACG;QAASO,aAAaJ,OAAOE,OAAO,CAACE,WAAW;IAAA;IACxE,OAAOJ,OAAOE,OAAO;AACvB"}
@@ -1,4 +1,4 @@
1
- import type { ProjectsModuleClient } from '@shipfox/api-projects-dto';
1
+ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
2
2
  import type { FastifyRequest } from 'fastify';
3
3
  import type { WorkflowRun } from '#core/entities/workflow-run.js';
4
4
  export declare function requireAccessibleRun({ request, id, projects, }: {
@@ -1 +1 @@
1
- {"version":3,"file":"require-accessible-run.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/require-accessible-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAEpE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gCAAgC,CAAC;AAIhE,wBAAsB,oBAAoB,CAAC,EACzC,OAAO,EACP,EAAE,EACF,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,cAAc,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,oBAAoB,CAAC;CAChC,GAAG,OAAO,CAAC,WAAW,CAAC,CAcvB"}
1
+ {"version":3,"file":"require-accessible-run.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/require-accessible-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAEjF,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gCAAgC,CAAC;AAIhE,wBAAsB,oBAAoB,CAAC,EACzC,OAAO,EACP,EAAE,EACF,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,cAAc,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,oBAAoB,CAAC;CAChC,GAAG,OAAO,CAAC,WAAW,CAAC,CAcvB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/presentation/routes/require-accessible-run.ts"],"sourcesContent":["import type {ProjectsModuleClient} from '@shipfox/api-projects-dto';\nimport {ClientError} from '@shipfox/node-fastify';\nimport type {FastifyRequest} from 'fastify';\nimport type {WorkflowRun} from '#core/entities/workflow-run.js';\nimport {getWorkflowRunById} from '#db/index.js';\nimport {requireProjectAccess} from './project-access.js';\n\nexport async function requireAccessibleRun({\n request,\n id,\n projects,\n}: {\n request: FastifyRequest;\n id: string;\n projects: ProjectsModuleClient;\n}): Promise<WorkflowRun> {\n const run = await getWorkflowRunById(id);\n if (!run) {\n throw new ClientError('Run not found', 'not-found', {status: 404});\n }\n\n await requireProjectAccess(request, run.projectId, projects).catch((err: unknown) => {\n if (err instanceof ClientError && (err.status === 403 || err.status === 404)) {\n throw new ClientError('Run not found', 'not-found', {status: 404});\n }\n throw err;\n });\n\n return run;\n}\n"],"names":["ClientError","getWorkflowRunById","requireProjectAccess","requireAccessibleRun","request","id","projects","run","status","projectId","catch","err"],"mappings":"AACA,SAAQA,WAAW,QAAO,wBAAwB;AAGlD,SAAQC,kBAAkB,QAAO,eAAe;AAChD,SAAQC,oBAAoB,QAAO,sBAAsB;AAEzD,OAAO,eAAeC,qBAAqB,EACzCC,OAAO,EACPC,EAAE,EACFC,QAAQ,EAKT;IACC,MAAMC,MAAM,MAAMN,mBAAmBI;IACrC,IAAI,CAACE,KAAK;QACR,MAAM,IAAIP,YAAY,iBAAiB,aAAa;YAACQ,QAAQ;QAAG;IAClE;IAEA,MAAMN,qBAAqBE,SAASG,IAAIE,SAAS,EAAEH,UAAUI,KAAK,CAAC,CAACC;QAClE,IAAIA,eAAeX,eAAgBW,CAAAA,IAAIH,MAAM,KAAK,OAAOG,IAAIH,MAAM,KAAK,GAAE,GAAI;YAC5E,MAAM,IAAIR,YAAY,iBAAiB,aAAa;gBAACQ,QAAQ;YAAG;QAClE;QACA,MAAMG;IACR;IAEA,OAAOJ;AACT"}
1
+ {"version":3,"sources":["../../../src/presentation/routes/require-accessible-run.ts"],"sourcesContent":["import type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {ClientError} from '@shipfox/node-fastify';\nimport type {FastifyRequest} from 'fastify';\nimport type {WorkflowRun} from '#core/entities/workflow-run.js';\nimport {getWorkflowRunById} from '#db/index.js';\nimport {requireProjectAccess} from './project-access.js';\n\nexport async function requireAccessibleRun({\n request,\n id,\n projects,\n}: {\n request: FastifyRequest;\n id: string;\n projects: ProjectsModuleClient;\n}): Promise<WorkflowRun> {\n const run = await getWorkflowRunById(id);\n if (!run) {\n throw new ClientError('Run not found', 'not-found', {status: 404});\n }\n\n await requireProjectAccess(request, run.projectId, projects).catch((err: unknown) => {\n if (err instanceof ClientError && (err.status === 403 || err.status === 404)) {\n throw new ClientError('Run not found', 'not-found', {status: 404});\n }\n throw err;\n });\n\n return run;\n}\n"],"names":["ClientError","getWorkflowRunById","requireProjectAccess","requireAccessibleRun","request","id","projects","run","status","projectId","catch","err"],"mappings":"AACA,SAAQA,WAAW,QAAO,wBAAwB;AAGlD,SAAQC,kBAAkB,QAAO,eAAe;AAChD,SAAQC,oBAAoB,QAAO,sBAAsB;AAEzD,OAAO,eAAeC,qBAAqB,EACzCC,OAAO,EACPC,EAAE,EACFC,QAAQ,EAKT;IACC,MAAMC,MAAM,MAAMN,mBAAmBI;IACrC,IAAI,CAACE,KAAK;QACR,MAAM,IAAIP,YAAY,iBAAiB,aAAa;YAACQ,QAAQ;QAAG;IAClE;IAEA,MAAMN,qBAAqBE,SAASG,IAAIE,SAAS,EAAEH,UAAUI,KAAK,CAAC,CAACC;QAClE,IAAIA,eAAeX,eAAgBW,CAAAA,IAAIH,MAAM,KAAK,OAAOG,IAAIH,MAAM,KAAK,GAAE,GAAI;YAC5E,MAAM,IAAIR,YAAY,iBAAiB,aAAa;gBAACQ,QAAQ;YAAG;QAClE;QACA,MAAMG;IACR;IAEA,OAAOJ;AACT"}
@@ -1,3 +1,3 @@
1
- import type { ProjectsModuleClient } from '@shipfox/api-projects-dto';
1
+ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
2
2
  export declare function rerunRunRoute(projects: ProjectsModuleClient): import("@shipfox/node-fastify").RouteDefinition;
3
3
  //# sourceMappingURL=rerun-run.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rerun-run.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/rerun-run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AASpE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,oBAAoB,mDAwC3D"}
1
+ {"version":3,"file":"rerun-run.d.ts","sourceRoot":"","sources":["../../../src/presentation/routes/rerun-run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AASjF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,oBAAoB,mDAwC3D"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/presentation/routes/rerun-run.ts"],"sourcesContent":["import {requireUserContext} from '@shipfox/api-auth-context';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto';\nimport {rerunWorkflowRunBodySchema, workflowRunResponseSchema} from '@shipfox/api-workflows-dto';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {NoFailedJobsError, RunNotTerminalError, SourceRunNotFoundError} from '#core/errors.js';\nimport {createRerunWorkflowRun} from '#db/index.js';\nimport {toRunDto} from '#presentation/dto/index.js';\nimport {requireAccessibleRun} from './require-accessible-run.js';\n\nexport function rerunRunRoute(projects: ProjectsModuleClient) {\n return defineRoute({\n method: 'POST',\n path: '/:id/rerun',\n description: 'Re-run a terminal workflow run',\n schema: {\n params: z.object({\n id: z.string().uuid(),\n }),\n body: rerunWorkflowRunBodySchema,\n response: {\n 200: workflowRunResponseSchema,\n },\n },\n errorHandler: (error) => {\n if (error instanceof SourceRunNotFoundError) {\n throw new ClientError('Run not found', 'not-found', {status: 404});\n }\n if (error instanceof RunNotTerminalError) {\n throw new ClientError('Run is not terminal', 'run-not-terminal', {status: 409});\n }\n if (error instanceof NoFailedJobsError) {\n throw new ClientError('Run has no failed jobs', 'no-failed-jobs', {status: 409});\n }\n throw error;\n },\n handler: async (request) => {\n const {id} = request.params;\n const sourceRun = await requireAccessibleRun({request, id, projects});\n\n const actor = requireUserContext(request);\n const run = await createRerunWorkflowRun({\n workflowRunId: sourceRun.id,\n mode: request.body.mode,\n actorUserId: actor.userId,\n });\n\n return toRunDto(run, run.currentAttempt);\n },\n });\n}\n"],"names":["requireUserContext","rerunWorkflowRunBodySchema","workflowRunResponseSchema","ClientError","defineRoute","z","NoFailedJobsError","RunNotTerminalError","SourceRunNotFoundError","createRerunWorkflowRun","toRunDto","requireAccessibleRun","rerunRunRoute","projects","method","path","description","schema","params","object","id","string","uuid","body","response","errorHandler","error","status","handler","request","sourceRun","actor","run","workflowRunId","mode","actorUserId","userId","currentAttempt"],"mappings":"AAAA,SAAQA,kBAAkB,QAAO,4BAA4B;AAE7D,SAAQC,0BAA0B,EAAEC,yBAAyB,QAAO,6BAA6B;AACjG,SAAQC,WAAW,EAAEC,WAAW,QAAO,wBAAwB;AAC/D,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,iBAAiB,EAAEC,mBAAmB,EAAEC,sBAAsB,QAAO,kBAAkB;AAC/F,SAAQC,sBAAsB,QAAO,eAAe;AACpD,SAAQC,QAAQ,QAAO,6BAA6B;AACpD,SAAQC,oBAAoB,QAAO,8BAA8B;AAEjE,OAAO,SAASC,cAAcC,QAA8B;IAC1D,OAAOT,YAAY;QACjBU,QAAQ;QACRC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACNC,QAAQb,EAAEc,MAAM,CAAC;gBACfC,IAAIf,EAAEgB,MAAM,GAAGC,IAAI;YACrB;YACAC,MAAMtB;YACNuB,UAAU;gBACR,KAAKtB;YACP;QACF;QACAuB,cAAc,CAACC;YACb,IAAIA,iBAAiBlB,wBAAwB;gBAC3C,MAAM,IAAIL,YAAY,iBAAiB,aAAa;oBAACwB,QAAQ;gBAAG;YAClE;YACA,IAAID,iBAAiBnB,qBAAqB;gBACxC,MAAM,IAAIJ,YAAY,uBAAuB,oBAAoB;oBAACwB,QAAQ;gBAAG;YAC/E;YACA,IAAID,iBAAiBpB,mBAAmB;gBACtC,MAAM,IAAIH,YAAY,0BAA0B,kBAAkB;oBAACwB,QAAQ;gBAAG;YAChF;YACA,MAAMD;QACR;QACAE,SAAS,OAAOC;YACd,MAAM,EAACT,EAAE,EAAC,GAAGS,QAAQX,MAAM;YAC3B,MAAMY,YAAY,MAAMnB,qBAAqB;gBAACkB;gBAAST;gBAAIP;YAAQ;YAEnE,MAAMkB,QAAQ/B,mBAAmB6B;YACjC,MAAMG,MAAM,MAAMvB,uBAAuB;gBACvCwB,eAAeH,UAAUV,EAAE;gBAC3Bc,MAAML,QAAQN,IAAI,CAACW,IAAI;gBACvBC,aAAaJ,MAAMK,MAAM;YAC3B;YAEA,OAAO1B,SAASsB,KAAKA,IAAIK,cAAc;QACzC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/presentation/routes/rerun-run.ts"],"sourcesContent":["import {requireUserContext} from '@shipfox/api-auth-context';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport {rerunWorkflowRunBodySchema, workflowRunResponseSchema} from '@shipfox/api-workflows-dto';\nimport {ClientError, defineRoute} from '@shipfox/node-fastify';\nimport {z} from 'zod';\nimport {NoFailedJobsError, RunNotTerminalError, SourceRunNotFoundError} from '#core/errors.js';\nimport {createRerunWorkflowRun} from '#db/index.js';\nimport {toRunDto} from '#presentation/dto/index.js';\nimport {requireAccessibleRun} from './require-accessible-run.js';\n\nexport function rerunRunRoute(projects: ProjectsModuleClient) {\n return defineRoute({\n method: 'POST',\n path: '/:id/rerun',\n description: 'Re-run a terminal workflow run',\n schema: {\n params: z.object({\n id: z.string().uuid(),\n }),\n body: rerunWorkflowRunBodySchema,\n response: {\n 200: workflowRunResponseSchema,\n },\n },\n errorHandler: (error) => {\n if (error instanceof SourceRunNotFoundError) {\n throw new ClientError('Run not found', 'not-found', {status: 404});\n }\n if (error instanceof RunNotTerminalError) {\n throw new ClientError('Run is not terminal', 'run-not-terminal', {status: 409});\n }\n if (error instanceof NoFailedJobsError) {\n throw new ClientError('Run has no failed jobs', 'no-failed-jobs', {status: 409});\n }\n throw error;\n },\n handler: async (request) => {\n const {id} = request.params;\n const sourceRun = await requireAccessibleRun({request, id, projects});\n\n const actor = requireUserContext(request);\n const run = await createRerunWorkflowRun({\n workflowRunId: sourceRun.id,\n mode: request.body.mode,\n actorUserId: actor.userId,\n });\n\n return toRunDto(run, run.currentAttempt);\n },\n });\n}\n"],"names":["requireUserContext","rerunWorkflowRunBodySchema","workflowRunResponseSchema","ClientError","defineRoute","z","NoFailedJobsError","RunNotTerminalError","SourceRunNotFoundError","createRerunWorkflowRun","toRunDto","requireAccessibleRun","rerunRunRoute","projects","method","path","description","schema","params","object","id","string","uuid","body","response","errorHandler","error","status","handler","request","sourceRun","actor","run","workflowRunId","mode","actorUserId","userId","currentAttempt"],"mappings":"AAAA,SAAQA,kBAAkB,QAAO,4BAA4B;AAE7D,SAAQC,0BAA0B,EAAEC,yBAAyB,QAAO,6BAA6B;AACjG,SAAQC,WAAW,EAAEC,WAAW,QAAO,wBAAwB;AAC/D,SAAQC,CAAC,QAAO,MAAM;AACtB,SAAQC,iBAAiB,EAAEC,mBAAmB,EAAEC,sBAAsB,QAAO,kBAAkB;AAC/F,SAAQC,sBAAsB,QAAO,eAAe;AACpD,SAAQC,QAAQ,QAAO,6BAA6B;AACpD,SAAQC,oBAAoB,QAAO,8BAA8B;AAEjE,OAAO,SAASC,cAAcC,QAA8B;IAC1D,OAAOT,YAAY;QACjBU,QAAQ;QACRC,MAAM;QACNC,aAAa;QACbC,QAAQ;YACNC,QAAQb,EAAEc,MAAM,CAAC;gBACfC,IAAIf,EAAEgB,MAAM,GAAGC,IAAI;YACrB;YACAC,MAAMtB;YACNuB,UAAU;gBACR,KAAKtB;YACP;QACF;QACAuB,cAAc,CAACC;YACb,IAAIA,iBAAiBlB,wBAAwB;gBAC3C,MAAM,IAAIL,YAAY,iBAAiB,aAAa;oBAACwB,QAAQ;gBAAG;YAClE;YACA,IAAID,iBAAiBnB,qBAAqB;gBACxC,MAAM,IAAIJ,YAAY,uBAAuB,oBAAoB;oBAACwB,QAAQ;gBAAG;YAC/E;YACA,IAAID,iBAAiBpB,mBAAmB;gBACtC,MAAM,IAAIH,YAAY,0BAA0B,kBAAkB;oBAACwB,QAAQ;gBAAG;YAChF;YACA,MAAMD;QACR;QACAE,SAAS,OAAOC;YACd,MAAM,EAACT,EAAE,EAAC,GAAGS,QAAQX,MAAM;YAC3B,MAAMY,YAAY,MAAMnB,qBAAqB;gBAACkB;gBAAST;gBAAIP;YAAQ;YAEnE,MAAMkB,QAAQ/B,mBAAmB6B;YACjC,MAAMG,MAAM,MAAMvB,uBAAuB;gBACvCwB,eAAeH,UAAUV,EAAE;gBAC3Bc,MAAML,QAAQN,IAAI,CAACW,IAAI;gBACvBC,aAAaJ,MAAMK,MAAM;YAC3B;YAEA,OAAO1B,SAASsB,KAAKA,IAAIK,cAAc;QACzC;IACF;AACF"}
@@ -1,6 +1,6 @@
1
1
  import type { AgentInterModuleClient } from '@shipfox/api-agent-dto/inter-module';
2
- import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto';
3
- import type { ProjectsModuleClient } from '@shipfox/api-projects-dto';
2
+ import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto/inter-module';
3
+ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
4
4
  import type { RunnersInterModuleClient } from '@shipfox/api-runners-dto/inter-module';
5
5
  import type { SecretsInterModuleClient } from '@shipfox/api-secrets-dto/inter-module';
6
6
  import { activateJobListenerActivity, bulkSetStepStatuses, evaluateJobActivationsActivity, failJobExecutionAsTimedOutActivity, failRunAsTimedOutActivity, loadRunAttemptDag, peekListenerBufferActivity, recordListenerFiringOutcomeActivity, resolveJobListenerActivity, resolveJobStatusFromJobExecutionsActivity, resolveLeaseExpiredJobExecutionActivity, setJobExecutionStatus, setJobStatus, setRunAttemptStatus, settleListenerJobExecutionActivity } from './orchestration-activities.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/temporal/activities/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AACpF,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EAKnB,8BAA8B,EAC9B,kCAAkC,EAClC,yBAAyB,EACzB,iBAAiB,EACjB,0BAA0B,EAC1B,mCAAmC,EACnC,0BAA0B,EAC1B,yCAAyC,EACzC,uCAAuC,EACvC,qBAAqB,EACrB,YAAY,EACZ,mBAAmB,EACnB,kCAAkC,EACnC,MAAM,+BAA+B,CAAC;AAEvC,wBAAgB,6BAA6B,CAAC,MAAM,EAAE;IACpD,KAAK,EAAE,sBAAsB,CAAC;IAC9B,YAAY,EAAE,wBAAwB,CAAC;IACvC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,OAAO,EAAE,wBAAwB,CAAC;IAClC,OAAO,EAAE,IAAI,CAAC,wBAAwB,EAA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;;;yDAOvE,UAAU,CAAC,OAAO,kCAAkC,CAAC,CAAC,CAAC,CAAC;;;;;;;;eAoBgkP,CAAC;;;;;;8DANznP,UAAU,CAAC,OAAO,uCAAuC,CAAC,CAAC,CAAC,CAAC;;;;;;;;EAKlF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/temporal/activities/index.ts"],"sourcesContent":["import type {AgentInterModuleClient} from '@shipfox/api-agent-dto/inter-module';\nimport type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport type {SecretsInterModuleClient} from '@shipfox/api-secrets-dto/inter-module';\nimport {\n activateJobListenerActivity,\n bulkSetStepStatuses,\n createCancelRunnerJobsActivity,\n createDrainListenerEventsActivity,\n createEnqueueJobExecutionForRunner,\n createReleaseLeaseActivity,\n evaluateJobActivationsActivity,\n failJobExecutionAsTimedOutActivity,\n failRunAsTimedOutActivity,\n loadRunAttemptDag,\n peekListenerBufferActivity,\n recordListenerFiringOutcomeActivity,\n resolveJobListenerActivity,\n resolveJobStatusFromJobExecutionsActivity,\n resolveLeaseExpiredJobExecutionActivity,\n setJobExecutionStatus,\n setJobStatus,\n setRunAttemptStatus,\n settleListenerJobExecutionActivity,\n} from './orchestration-activities.js';\n\nexport function createOrchestrationActivities(params: {\n agent: AgentInterModuleClient;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n runners: RunnersInterModuleClient;\n secrets: Pick<SecretsInterModuleClient, 'getVariablesByNamespace'>;\n}) {\n return {\n loadRunAttemptDag,\n setRunAttemptStatus,\n setJobStatus,\n setJobExecutionStatus: async (activityParams: Parameters<typeof setJobExecutionStatus>[0]) =>\n await setJobExecutionStatus(activityParams, params.secrets),\n bulkSetStepStatuses,\n cancelRunnerJobsActivity: createCancelRunnerJobsActivity(params.runners),\n enqueueJobExecutionForRunner: createEnqueueJobExecutionForRunner(params.runners),\n evaluateJobActivationsActivity,\n failJobExecutionAsTimedOutActivity: async (\n activityParams: Parameters<typeof failJobExecutionAsTimedOutActivity>[0],\n ) => await failJobExecutionAsTimedOutActivity(activityParams, params.secrets),\n failRunAsTimedOutActivity,\n activateJobListenerActivity,\n drainListenerEventsActivity: createDrainListenerEventsActivity({\n agent: params.agent,\n integrations: params.integrations,\n projects: params.projects,\n }),\n peekListenerBufferActivity,\n resolveJobListenerActivity,\n settleListenerJobExecutionActivity,\n recordListenerFiringOutcomeActivity,\n resolveLeaseExpiredJobExecutionActivity: async (\n activityParams: Parameters<typeof resolveLeaseExpiredJobExecutionActivity>[0],\n ) => await resolveLeaseExpiredJobExecutionActivity(activityParams, params.secrets),\n resolveJobStatusFromJobExecutionsActivity,\n releaseLeaseActivity: createReleaseLeaseActivity(params.runners),\n };\n}\n"],"names":["activateJobListenerActivity","bulkSetStepStatuses","createCancelRunnerJobsActivity","createDrainListenerEventsActivity","createEnqueueJobExecutionForRunner","createReleaseLeaseActivity","evaluateJobActivationsActivity","failJobExecutionAsTimedOutActivity","failRunAsTimedOutActivity","loadRunAttemptDag","peekListenerBufferActivity","recordListenerFiringOutcomeActivity","resolveJobListenerActivity","resolveJobStatusFromJobExecutionsActivity","resolveLeaseExpiredJobExecutionActivity","setJobExecutionStatus","setJobStatus","setRunAttemptStatus","settleListenerJobExecutionActivity","createOrchestrationActivities","params","activityParams","secrets","cancelRunnerJobsActivity","runners","enqueueJobExecutionForRunner","drainListenerEventsActivity","agent","integrations","projects","releaseLeaseActivity"],"mappings":"AAKA,SACEA,2BAA2B,EAC3BC,mBAAmB,EACnBC,8BAA8B,EAC9BC,iCAAiC,EACjCC,kCAAkC,EAClCC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,kCAAkC,EAClCC,yBAAyB,EACzBC,iBAAiB,EACjBC,0BAA0B,EAC1BC,mCAAmC,EACnCC,0BAA0B,EAC1BC,yCAAyC,EACzCC,uCAAuC,EACvCC,qBAAqB,EACrBC,YAAY,EACZC,mBAAmB,EACnBC,kCAAkC,QAC7B,gCAAgC;AAEvC,OAAO,SAASC,8BAA8BC,MAM7C;IACC,OAAO;QACLX;QACAQ;QACAD;QACAD,uBAAuB,OAAOM,iBAC5B,MAAMN,sBAAsBM,gBAAgBD,OAAOE,OAAO;QAC5DrB;QACAsB,0BAA0BrB,+BAA+BkB,OAAOI,OAAO;QACvEC,8BAA8BrB,mCAAmCgB,OAAOI,OAAO;QAC/ElB;QACAC,oCAAoC,OAClCc,iBACG,MAAMd,mCAAmCc,gBAAgBD,OAAOE,OAAO;QAC5Ed;QACAR;QACA0B,6BAA6BvB,kCAAkC;YAC7DwB,OAAOP,OAAOO,KAAK;YACnBC,cAAcR,OAAOQ,YAAY;YACjCC,UAAUT,OAAOS,QAAQ;QAC3B;QACAnB;QACAE;QACAM;QACAP;QACAG,yCAAyC,OACvCO,iBACG,MAAMP,wCAAwCO,gBAAgBD,OAAOE,OAAO;QACjFT;QACAiB,sBAAsBzB,2BAA2Be,OAAOI,OAAO;IACjE;AACF"}
1
+ {"version":3,"sources":["../../../src/temporal/activities/index.ts"],"sourcesContent":["import type {AgentInterModuleClient} from '@shipfox/api-agent-dto/inter-module';\nimport type {IntegrationsModuleClient} from '@shipfox/api-integration-core-dto/inter-module';\nimport type {ProjectsModuleClient} from '@shipfox/api-projects-dto/inter-module';\nimport type {RunnersInterModuleClient} from '@shipfox/api-runners-dto/inter-module';\nimport type {SecretsInterModuleClient} from '@shipfox/api-secrets-dto/inter-module';\nimport {\n activateJobListenerActivity,\n bulkSetStepStatuses,\n createCancelRunnerJobsActivity,\n createDrainListenerEventsActivity,\n createEnqueueJobExecutionForRunner,\n createReleaseLeaseActivity,\n evaluateJobActivationsActivity,\n failJobExecutionAsTimedOutActivity,\n failRunAsTimedOutActivity,\n loadRunAttemptDag,\n peekListenerBufferActivity,\n recordListenerFiringOutcomeActivity,\n resolveJobListenerActivity,\n resolveJobStatusFromJobExecutionsActivity,\n resolveLeaseExpiredJobExecutionActivity,\n setJobExecutionStatus,\n setJobStatus,\n setRunAttemptStatus,\n settleListenerJobExecutionActivity,\n} from './orchestration-activities.js';\n\nexport function createOrchestrationActivities(params: {\n agent: AgentInterModuleClient;\n integrations: IntegrationsModuleClient;\n projects: ProjectsModuleClient;\n runners: RunnersInterModuleClient;\n secrets: Pick<SecretsInterModuleClient, 'getVariablesByNamespace'>;\n}) {\n return {\n loadRunAttemptDag,\n setRunAttemptStatus,\n setJobStatus,\n setJobExecutionStatus: async (activityParams: Parameters<typeof setJobExecutionStatus>[0]) =>\n await setJobExecutionStatus(activityParams, params.secrets),\n bulkSetStepStatuses,\n cancelRunnerJobsActivity: createCancelRunnerJobsActivity(params.runners),\n enqueueJobExecutionForRunner: createEnqueueJobExecutionForRunner(params.runners),\n evaluateJobActivationsActivity,\n failJobExecutionAsTimedOutActivity: async (\n activityParams: Parameters<typeof failJobExecutionAsTimedOutActivity>[0],\n ) => await failJobExecutionAsTimedOutActivity(activityParams, params.secrets),\n failRunAsTimedOutActivity,\n activateJobListenerActivity,\n drainListenerEventsActivity: createDrainListenerEventsActivity({\n agent: params.agent,\n integrations: params.integrations,\n projects: params.projects,\n }),\n peekListenerBufferActivity,\n resolveJobListenerActivity,\n settleListenerJobExecutionActivity,\n recordListenerFiringOutcomeActivity,\n resolveLeaseExpiredJobExecutionActivity: async (\n activityParams: Parameters<typeof resolveLeaseExpiredJobExecutionActivity>[0],\n ) => await resolveLeaseExpiredJobExecutionActivity(activityParams, params.secrets),\n resolveJobStatusFromJobExecutionsActivity,\n releaseLeaseActivity: createReleaseLeaseActivity(params.runners),\n };\n}\n"],"names":["activateJobListenerActivity","bulkSetStepStatuses","createCancelRunnerJobsActivity","createDrainListenerEventsActivity","createEnqueueJobExecutionForRunner","createReleaseLeaseActivity","evaluateJobActivationsActivity","failJobExecutionAsTimedOutActivity","failRunAsTimedOutActivity","loadRunAttemptDag","peekListenerBufferActivity","recordListenerFiringOutcomeActivity","resolveJobListenerActivity","resolveJobStatusFromJobExecutionsActivity","resolveLeaseExpiredJobExecutionActivity","setJobExecutionStatus","setJobStatus","setRunAttemptStatus","settleListenerJobExecutionActivity","createOrchestrationActivities","params","activityParams","secrets","cancelRunnerJobsActivity","runners","enqueueJobExecutionForRunner","drainListenerEventsActivity","agent","integrations","projects","releaseLeaseActivity"],"mappings":"AAKA,SACEA,2BAA2B,EAC3BC,mBAAmB,EACnBC,8BAA8B,EAC9BC,iCAAiC,EACjCC,kCAAkC,EAClCC,0BAA0B,EAC1BC,8BAA8B,EAC9BC,kCAAkC,EAClCC,yBAAyB,EACzBC,iBAAiB,EACjBC,0BAA0B,EAC1BC,mCAAmC,EACnCC,0BAA0B,EAC1BC,yCAAyC,EACzCC,uCAAuC,EACvCC,qBAAqB,EACrBC,YAAY,EACZC,mBAAmB,EACnBC,kCAAkC,QAC7B,gCAAgC;AAEvC,OAAO,SAASC,8BAA8BC,MAM7C;IACC,OAAO;QACLX;QACAQ;QACAD;QACAD,uBAAuB,OAAOM,iBAC5B,MAAMN,sBAAsBM,gBAAgBD,OAAOE,OAAO;QAC5DrB;QACAsB,0BAA0BrB,+BAA+BkB,OAAOI,OAAO;QACvEC,8BAA8BrB,mCAAmCgB,OAAOI,OAAO;QAC/ElB;QACAC,oCAAoC,OAClCc,iBACG,MAAMd,mCAAmCc,gBAAgBD,OAAOE,OAAO;QAC5Ed;QACAR;QACA0B,6BAA6BvB,kCAAkC;YAC7DwB,OAAOP,OAAOO,KAAK;YACnBC,cAAcR,OAAOQ,YAAY;YACjCC,UAAUT,OAAOS,QAAQ;QAC3B;QACAnB;QACAE;QACAM;QACAP;QACAG,yCAAyC,OACvCO,iBACG,MAAMP,wCAAwCO,gBAAgBD,OAAOE,OAAO;QACjFT;QACAiB,sBAAsBzB,2BAA2Be,OAAOI,OAAO;IACjE;AACF"}
@@ -1,6 +1,6 @@
1
1
  import type { AgentInterModuleClient } from '@shipfox/api-agent-dto/inter-module';
2
- import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto';
3
- import type { ProjectsModuleClient } from '@shipfox/api-projects-dto';
2
+ import type { IntegrationsModuleClient } from '@shipfox/api-integration-core-dto/inter-module';
3
+ import type { ProjectsModuleClient } from '@shipfox/api-projects-dto/inter-module';
4
4
  import { type RunnersInterModuleClient } from '@shipfox/api-runners-dto/inter-module';
5
5
  import type { SecretsInterModuleClient } from '@shipfox/api-secrets-dto/inter-module';
6
6
  import type { JobStatus, JobStatusReason, ResolutionReason } from '#core/entities/job.js';
@@ -1 +1 @@
1
- {"version":3,"file":"orchestration-activities.d.ts","sourceRoot":"","sources":["../../../src/temporal/activities/orchestration-activities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AACpE,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AAIpF,OAAO,KAAK,EAAC,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACxF,OAAO,KAAK,EAAC,6BAA6B,EAAE,UAAU,EAAC,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AAEtE,OAAO,KAAK,EACV,uBAAuB,EACvB,cAAc,EACf,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAIL,KAAK,4BAA4B,EAQjC,KAAK,qBAAqB,EAS3B,MAAM,cAAc,CAAC;AAGtB,MAAM,WAAW,MAAO,SAAQ,cAAc;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,GAAG,WAAW,CAAC;IAC/B,MAAM,EAAE,SAA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AEjE;AAED,wBAAsB,2BAA2B,CAAC,MAAM,EAAE;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;CACzB,6DAEA;AAED,wBAAgB,iCAAiC,CAAC,OAAO,EAAE;IACzD,KAAK,EAAE,sBAAsB,CAAC;IAC9B,YAAY,CAAC,EAAE,wBAAwB,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAC7C,IACmD,QAAQ;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,+DAGF;AAED,wBAAsB,0BAA0B,CAAC,MAAM,EAAE;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,sDAEvE;AAED,wBAAsB,0BAA0B,CAAC,MAAM,EAAE;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,CAAC;CAC1B;;;GAEA;AAED,wBAAsB,kCAAkC,CAAC,MAAM,EAAE;IAC/D,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAC;CAChC,iBAEA;AAQD,wBAAgB,mCAAmC,CAAC,MAAM,EAAE;IAC1D,OAAO,EAAE,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;CAC/C,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhB"}
1
+ {"version":3,"file":"orchestration-activities.d.ts","sourceRoot":"","sources":["../../../src/temporal/activities/orchestration-activities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AACjF,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,uCAAuC,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