@catamorphic/fastify-plugin 0.1.0-alpha.30 → 0.1.0-alpha.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -853,11 +853,32 @@ var RunsQuerySchema = PaginationQuerySchema.extend({
853
853
  correlationKey: CorrelationKeySchema.optional()
854
854
  });
855
855
  var SignalRunSchema = z.object({
856
+ runId: z.string().uuid(),
856
857
  correlationKey: CorrelationKeySchema,
857
858
  signal: z.string().min(1).max(255),
858
859
  idempotencyKey: z.string().min(1).max(255),
859
860
  value: JsonValueSchema
860
861
  });
862
+ var RunSignalReceiptSchema = z.discriminatedUnion("status", [
863
+ z.object({
864
+ id: z.string().uuid(),
865
+ runId: z.string().uuid(),
866
+ status: z.literal("buffered"),
867
+ pauseId: z.null()
868
+ }),
869
+ z.object({
870
+ id: z.string().uuid(),
871
+ runId: z.string().uuid(),
872
+ status: z.literal("resumed"),
873
+ pauseId: z.string().uuid()
874
+ }),
875
+ z.object({
876
+ id: z.string().uuid(),
877
+ runId: z.string().uuid(),
878
+ status: z.literal("discarded"),
879
+ pauseId: z.null()
880
+ })
881
+ ]);
861
882
  var CancelRunByKeySchema = z.object({
862
883
  correlationKey: CorrelationKeySchema,
863
884
  reason: z.string().max(1000).optional()
@@ -10199,6 +10220,8 @@ import {
10199
10220
  ProjectNotFoundError as ProjectNotFoundError11,
10200
10221
  RunCapabilityError as RunCapabilityError3,
10201
10222
  RunResumeConflictError as RunResumeConflictError2,
10223
+ RunSignalInvalidError,
10224
+ RunSignalLimitError,
10202
10225
  RunSignalNotFoundError,
10203
10226
  WorkflowNotFoundError as WorkflowNotFoundError3
10204
10227
  } from "@catamorphic/core";
@@ -10391,7 +10414,9 @@ function registerWorkflowRoutes(app, ctx) {
10391
10414
  params: WorkflowNameParamsSchema,
10392
10415
  body: SignalRunSchema,
10393
10416
  response: {
10394
- 200: RunSchema,
10417
+ 200: RunSignalReceiptSchema,
10418
+ 400: ErrorSchema,
10419
+ 429: ErrorSchema,
10395
10420
  404: ErrorSchema,
10396
10421
  409: ErrorSchema,
10397
10422
  503: ErrorSchema
@@ -10406,6 +10431,7 @@ function registerWorkflowRoutes(app, ctx) {
10406
10431
  projectId: request.params.projectId,
10407
10432
  workflowName: request.params.name,
10408
10433
  correlationKey: request.body.correlationKey,
10434
+ runId: request.body.runId,
10409
10435
  signal: request.body.signal,
10410
10436
  idempotencyKey: request.body.idempotencyKey,
10411
10437
  value: request.body.value
@@ -10417,6 +10443,10 @@ function registerWorkflowRoutes(app, ctx) {
10417
10443
  if (err instanceof RunSignalNotFoundError) {
10418
10444
  return reply.status(404).send({ error: err.message });
10419
10445
  }
10446
+ if (err instanceof RunSignalInvalidError)
10447
+ return reply.status(400).send({ error: err.message });
10448
+ if (err instanceof RunSignalLimitError)
10449
+ return reply.status(429).send({ error: err.message });
10420
10450
  if (err instanceof RunResumeConflictError2 || err instanceof RunCapabilityError3) {
10421
10451
  return reply.status(409).send({ error: err.message });
10422
10452
  }
@@ -10880,5 +10910,5 @@ export {
10880
10910
  serveSpaDist
10881
10911
  };
10882
10912
 
10883
- //# debugId=304FC8487E41CE9764756E2164756E21
10913
+ //# debugId=9F70713B254AE84764756E2164756E21
10884
10914
  //# sourceMappingURL=index.js.map