@blokjs/helper 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -350,6 +350,15 @@ export declare const HttpTriggerOptsSchema: z.ZodEffects<z.ZodObject<{
350
350
  accept: z.ZodDefault<z.ZodString>;
351
351
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
352
352
  legacyKeyPrefix: z.ZodOptional<z.ZodBoolean>;
353
+ middleware: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
354
+ examples: z.ZodOptional<z.ZodObject<{
355
+ body: z.ZodOptional<z.ZodUnknown>;
356
+ }, "strip", z.ZodTypeAny, {
357
+ body?: unknown;
358
+ }, {
359
+ body?: unknown;
360
+ }>>;
361
+ recordSample: z.ZodOptional<z.ZodBoolean>;
353
362
  }, "strip", z.ZodTypeAny, {
354
363
  method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "ANY";
355
364
  accept: string;
@@ -374,6 +383,11 @@ export declare const HttpTriggerOptsSchema: z.ZodEffects<z.ZodObject<{
374
383
  } | undefined;
375
384
  headers?: Record<string, any> | undefined;
376
385
  legacyKeyPrefix?: boolean | undefined;
386
+ middleware?: string[] | undefined;
387
+ examples?: {
388
+ body?: unknown;
389
+ } | undefined;
390
+ recordSample?: boolean | undefined;
377
391
  }, {
378
392
  path?: string | undefined;
379
393
  concurrencyKey?: string | undefined;
@@ -398,6 +412,11 @@ export declare const HttpTriggerOptsSchema: z.ZodEffects<z.ZodObject<{
398
412
  accept?: string | undefined;
399
413
  headers?: Record<string, any> | undefined;
400
414
  legacyKeyPrefix?: boolean | undefined;
415
+ middleware?: string[] | undefined;
416
+ examples?: {
417
+ body?: unknown;
418
+ } | undefined;
419
+ recordSample?: boolean | undefined;
401
420
  }>, {
402
421
  method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "ANY";
403
422
  accept: string;
@@ -422,6 +441,11 @@ export declare const HttpTriggerOptsSchema: z.ZodEffects<z.ZodObject<{
422
441
  } | undefined;
423
442
  headers?: Record<string, any> | undefined;
424
443
  legacyKeyPrefix?: boolean | undefined;
444
+ middleware?: string[] | undefined;
445
+ examples?: {
446
+ body?: unknown;
447
+ } | undefined;
448
+ recordSample?: boolean | undefined;
425
449
  }, {
426
450
  path?: string | undefined;
427
451
  concurrencyKey?: string | undefined;
@@ -446,6 +470,11 @@ export declare const HttpTriggerOptsSchema: z.ZodEffects<z.ZodObject<{
446
470
  accept?: string | undefined;
447
471
  headers?: Record<string, any> | undefined;
448
472
  legacyKeyPrefix?: boolean | undefined;
473
+ middleware?: string[] | undefined;
474
+ examples?: {
475
+ body?: unknown;
476
+ } | undefined;
477
+ recordSample?: boolean | undefined;
449
478
  }>;
450
479
  /** Configuration for an HTTP trigger. Use with `addTrigger("http", ...)`. */
451
480
  export type HttpTriggerOpts = z.input<typeof HttpTriggerOptsSchema>;
@@ -507,6 +536,15 @@ export declare const TriggerOptsSchema: z.ZodEffects<z.ZodObject<{
507
536
  accept: z.ZodDefault<z.ZodString>;
508
537
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
509
538
  legacyKeyPrefix: z.ZodOptional<z.ZodBoolean>;
539
+ middleware: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
540
+ examples: z.ZodOptional<z.ZodObject<{
541
+ body: z.ZodOptional<z.ZodUnknown>;
542
+ }, "strip", z.ZodTypeAny, {
543
+ body?: unknown;
544
+ }, {
545
+ body?: unknown;
546
+ }>>;
547
+ recordSample: z.ZodOptional<z.ZodBoolean>;
510
548
  }, "strip", z.ZodTypeAny, {
511
549
  method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "ANY";
512
550
  accept: string;
@@ -531,6 +569,11 @@ export declare const TriggerOptsSchema: z.ZodEffects<z.ZodObject<{
531
569
  } | undefined;
532
570
  headers?: Record<string, any> | undefined;
533
571
  legacyKeyPrefix?: boolean | undefined;
572
+ middleware?: string[] | undefined;
573
+ examples?: {
574
+ body?: unknown;
575
+ } | undefined;
576
+ recordSample?: boolean | undefined;
534
577
  }, {
535
578
  path?: string | undefined;
536
579
  concurrencyKey?: string | undefined;
@@ -555,6 +598,11 @@ export declare const TriggerOptsSchema: z.ZodEffects<z.ZodObject<{
555
598
  accept?: string | undefined;
556
599
  headers?: Record<string, any> | undefined;
557
600
  legacyKeyPrefix?: boolean | undefined;
601
+ middleware?: string[] | undefined;
602
+ examples?: {
603
+ body?: unknown;
604
+ } | undefined;
605
+ recordSample?: boolean | undefined;
558
606
  }>, {
559
607
  method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "ANY";
560
608
  accept: string;
@@ -579,6 +627,11 @@ export declare const TriggerOptsSchema: z.ZodEffects<z.ZodObject<{
579
627
  } | undefined;
580
628
  headers?: Record<string, any> | undefined;
581
629
  legacyKeyPrefix?: boolean | undefined;
630
+ middleware?: string[] | undefined;
631
+ examples?: {
632
+ body?: unknown;
633
+ } | undefined;
634
+ recordSample?: boolean | undefined;
582
635
  }, {
583
636
  path?: string | undefined;
584
637
  concurrencyKey?: string | undefined;
@@ -603,6 +656,11 @@ export declare const TriggerOptsSchema: z.ZodEffects<z.ZodObject<{
603
656
  accept?: string | undefined;
604
657
  headers?: Record<string, any> | undefined;
605
658
  legacyKeyPrefix?: boolean | undefined;
659
+ middleware?: string[] | undefined;
660
+ examples?: {
661
+ body?: unknown;
662
+ } | undefined;
663
+ recordSample?: boolean | undefined;
606
664
  }>;
607
665
  /**
608
666
  * Legacy alias for {@link HttpTriggerOpts}. Prefer the explicit name.
@@ -648,37 +706,95 @@ export declare const QueueTriggerOptsSchema: z.ZodObject<{
648
706
  concurrency?: number | undefined;
649
707
  }>;
650
708
  export type QueueTriggerOpts = z.input<typeof QueueTriggerOptsSchema>;
651
- export declare const PubSubProviderSchema: z.ZodEnum<["gcp", "aws", "azure"]>;
709
+ /**
710
+ * v0.7 PR 6 — supported pub/sub adapter providers.
711
+ *
712
+ * Pub/Sub is distinct from Worker: pub/sub is **1:N fan-out by default**
713
+ * (every subscriber sees every message). When `consumerGroup` is set,
714
+ * semantics shift to **competing-consumer** (1 of N within group). This
715
+ * single field disambiguates the two semantics — matching NestJS's
716
+ * `@MessagePattern` vs `@EventPattern` distinction.
717
+ *
718
+ * `nats` and `redis-streams` and `kafka` appear in both Worker and
719
+ * Pub/Sub provider lists because the underlying brokers support both
720
+ * semantics — the same broker connection serves both adapter kinds
721
+ * via different code paths.
722
+ *
723
+ * `BLOK_PUBSUB_ADAPTER` env var sets the default when `provider` is
724
+ * omitted on the workflow.
725
+ */
726
+ export declare const PubSubProviderSchema: z.ZodEnum<["nats", "redis-streams", "kafka", "gcp", "aws", "azure"]>;
652
727
  export type PubSubProvider = z.infer<typeof PubSubProviderSchema>;
653
728
  export declare const PubSubTriggerOptsSchema: z.ZodObject<{
654
- provider: z.ZodEnum<["gcp", "aws", "azure"]>;
729
+ provider: z.ZodOptional<z.ZodEnum<["nats", "redis-streams", "kafka", "gcp", "aws", "azure"]>>;
655
730
  topic: z.ZodString;
656
- subscription: z.ZodString;
731
+ subscription: z.ZodOptional<z.ZodString>;
732
+ consumerGroup: z.ZodOptional<z.ZodString>;
733
+ durable: z.ZodOptional<z.ZodBoolean>;
734
+ startFrom: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"earliest">, z.ZodLiteral<"latest">, z.ZodObject<{
735
+ seq: z.ZodNumber;
736
+ }, "strip", z.ZodTypeAny, {
737
+ seq: number;
738
+ }, {
739
+ seq: number;
740
+ }>, z.ZodObject<{
741
+ timestamp: z.ZodNumber;
742
+ }, "strip", z.ZodTypeAny, {
743
+ timestamp: number;
744
+ }, {
745
+ timestamp: number;
746
+ }>]>>;
657
747
  ack: z.ZodDefault<z.ZodBoolean>;
658
748
  maxMessages: z.ZodDefault<z.ZodNumber>;
659
749
  ackDeadline: z.ZodDefault<z.ZodNumber>;
660
750
  deadLetterTopic: z.ZodOptional<z.ZodString>;
661
751
  filter: z.ZodOptional<z.ZodString>;
662
752
  }, "strip", z.ZodTypeAny, {
663
- provider: "gcp" | "aws" | "azure";
664
753
  topic: string;
665
- subscription: string;
666
754
  ack: boolean;
667
755
  maxMessages: number;
668
756
  ackDeadline: number;
669
757
  filter?: string | undefined;
758
+ provider?: "kafka" | "nats" | "redis-streams" | "gcp" | "aws" | "azure" | undefined;
759
+ subscription?: string | undefined;
760
+ consumerGroup?: string | undefined;
761
+ durable?: boolean | undefined;
762
+ startFrom?: "earliest" | "latest" | {
763
+ seq: number;
764
+ } | {
765
+ timestamp: number;
766
+ } | undefined;
670
767
  deadLetterTopic?: string | undefined;
671
768
  }, {
672
- provider: "gcp" | "aws" | "azure";
673
769
  topic: string;
674
- subscription: string;
675
770
  filter?: string | undefined;
771
+ provider?: "kafka" | "nats" | "redis-streams" | "gcp" | "aws" | "azure" | undefined;
772
+ subscription?: string | undefined;
773
+ consumerGroup?: string | undefined;
676
774
  ack?: boolean | undefined;
775
+ durable?: boolean | undefined;
776
+ startFrom?: "earliest" | "latest" | {
777
+ seq: number;
778
+ } | {
779
+ timestamp: number;
780
+ } | undefined;
677
781
  maxMessages?: number | undefined;
678
782
  ackDeadline?: number | undefined;
679
783
  deadLetterTopic?: string | undefined;
680
784
  }>;
681
785
  export type PubSubTriggerOpts = z.input<typeof PubSubTriggerOptsSchema>;
786
+ /**
787
+ * v0.7 — supported worker adapter providers. `BLOK_WORKER_ADAPTER`
788
+ * env var sets the default when `provider` is omitted on the workflow
789
+ * (per Q7 resolution). `in-memory` is the dev/test fallback.
790
+ *
791
+ * `nats` and `bullmq` shipped pre-v0.7. The other five (kafka,
792
+ * rabbitmq, sqs, redis, pg-boss) are new in PR 5 — each ships behind a
793
+ * peer-dependency so workflows that don't use that provider don't
794
+ * pay the install cost.
795
+ */
796
+ export declare const WorkerProviderSchema: z.ZodEnum<["in-memory", "nats", "bullmq", "kafka", "rabbitmq", "sqs", "redis", "pg-boss"]>;
797
+ export type WorkerProvider = z.infer<typeof WorkerProviderSchema>;
682
798
  export declare const WorkerTriggerOptsSchema: z.ZodEffects<z.ZodObject<{
683
799
  delay: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
684
800
  ttl: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
@@ -727,10 +843,15 @@ export declare const WorkerTriggerOptsSchema: z.ZodEffects<z.ZodObject<{
727
843
  factor?: number | undefined;
728
844
  }>>;
729
845
  queue: z.ZodString;
846
+ provider: z.ZodOptional<z.ZodEnum<["in-memory", "nats", "bullmq", "kafka", "rabbitmq", "sqs", "redis", "pg-boss"]>>;
730
847
  concurrency: z.ZodDefault<z.ZodNumber>;
731
848
  timeout: z.ZodOptional<z.ZodNumber>;
732
849
  retries: z.ZodDefault<z.ZodNumber>;
733
850
  priority: z.ZodDefault<z.ZodNumber>;
851
+ consumerGroup: z.ZodOptional<z.ZodString>;
852
+ ack: z.ZodOptional<z.ZodBoolean>;
853
+ deadLetterQueue: z.ZodOptional<z.ZodString>;
854
+ fromBeginning: z.ZodOptional<z.ZodBoolean>;
734
855
  }, "strip", z.ZodTypeAny, {
735
856
  queue: string;
736
857
  concurrency: number;
@@ -754,7 +875,12 @@ export declare const WorkerTriggerOptsSchema: z.ZodEffects<z.ZodObject<{
754
875
  delay: string | number;
755
876
  maxDelay?: string | number | undefined;
756
877
  } | undefined;
878
+ provider?: "kafka" | "rabbitmq" | "sqs" | "redis" | "nats" | "in-memory" | "bullmq" | "pg-boss" | undefined;
879
+ consumerGroup?: string | undefined;
880
+ ack?: boolean | undefined;
881
+ deadLetterQueue?: string | undefined;
757
882
  timeout?: number | undefined;
883
+ fromBeginning?: boolean | undefined;
758
884
  }, {
759
885
  queue: string;
760
886
  concurrencyKey?: string | undefined;
@@ -775,10 +901,15 @@ export declare const WorkerTriggerOptsSchema: z.ZodEffects<z.ZodObject<{
775
901
  mode?: "leading" | "trailing" | undefined;
776
902
  maxDelay?: string | number | undefined;
777
903
  } | undefined;
904
+ provider?: "kafka" | "rabbitmq" | "sqs" | "redis" | "nats" | "in-memory" | "bullmq" | "pg-boss" | undefined;
905
+ consumerGroup?: string | undefined;
906
+ ack?: boolean | undefined;
907
+ deadLetterQueue?: string | undefined;
778
908
  concurrency?: number | undefined;
779
909
  timeout?: number | undefined;
780
910
  retries?: number | undefined;
781
911
  priority?: number | undefined;
912
+ fromBeginning?: boolean | undefined;
782
913
  }>, {
783
914
  queue: string;
784
915
  concurrency: number;
@@ -802,7 +933,12 @@ export declare const WorkerTriggerOptsSchema: z.ZodEffects<z.ZodObject<{
802
933
  delay: string | number;
803
934
  maxDelay?: string | number | undefined;
804
935
  } | undefined;
936
+ provider?: "kafka" | "rabbitmq" | "sqs" | "redis" | "nats" | "in-memory" | "bullmq" | "pg-boss" | undefined;
937
+ consumerGroup?: string | undefined;
938
+ ack?: boolean | undefined;
939
+ deadLetterQueue?: string | undefined;
805
940
  timeout?: number | undefined;
941
+ fromBeginning?: boolean | undefined;
806
942
  }, {
807
943
  queue: string;
808
944
  concurrencyKey?: string | undefined;
@@ -823,10 +959,15 @@ export declare const WorkerTriggerOptsSchema: z.ZodEffects<z.ZodObject<{
823
959
  mode?: "leading" | "trailing" | undefined;
824
960
  maxDelay?: string | number | undefined;
825
961
  } | undefined;
962
+ provider?: "kafka" | "rabbitmq" | "sqs" | "redis" | "nats" | "in-memory" | "bullmq" | "pg-boss" | undefined;
963
+ consumerGroup?: string | undefined;
964
+ ack?: boolean | undefined;
965
+ deadLetterQueue?: string | undefined;
826
966
  concurrency?: number | undefined;
827
967
  timeout?: number | undefined;
828
968
  retries?: number | undefined;
829
969
  priority?: number | undefined;
970
+ fromBeginning?: boolean | undefined;
830
971
  }>;
831
972
  export type WorkerTriggerOpts = z.input<typeof WorkerTriggerOptsSchema>;
832
973
  export declare const CronTriggerOptsSchema: z.ZodObject<{
@@ -843,21 +984,135 @@ export declare const CronTriggerOptsSchema: z.ZodObject<{
843
984
  overlap?: boolean | undefined;
844
985
  }>;
845
986
  export type CronTriggerOpts = z.input<typeof CronTriggerOptsSchema>;
987
+ /**
988
+ * v0.7 — custom signature scheme for unknown webhook providers.
989
+ *
990
+ * Authors who use a webhook source NOT in the built-in `provider`
991
+ * allowlist (github / stripe / slack / shopify / svix) supply this
992
+ * config; the trigger does HMAC verification using these fields.
993
+ *
994
+ * The `format` template names the layout of the signature payload —
995
+ * `{hex}` is substituted with the hex digest at verify time. Supports
996
+ * common shapes:
997
+ * - GitHub-style: `sha256={hex}`
998
+ * - Plain hex: `{hex}`
999
+ * - Base64: `{base64}` (encoded variant)
1000
+ *
1001
+ * When `timestampHeader` is set, the verifier mixes the header value
1002
+ * into the signed string as `{timestamp}.{rawBody}` (Stripe pattern)
1003
+ * and rejects deliveries whose timestamp drifted by more than
1004
+ * `tolerance` seconds (default 300s / 5min).
1005
+ */
1006
+ export declare const WebhookCustomSignatureSchema: z.ZodObject<{
1007
+ scheme: z.ZodDefault<z.ZodEnum<["hmac-sha256", "hmac-sha1", "hmac-sha512"]>>;
1008
+ header: z.ZodString;
1009
+ format: z.ZodDefault<z.ZodString>;
1010
+ secretEnv: z.ZodString;
1011
+ tolerance: z.ZodDefault<z.ZodNumber>;
1012
+ timestampHeader: z.ZodOptional<z.ZodString>;
1013
+ }, "strip", z.ZodTypeAny, {
1014
+ scheme: "hmac-sha256" | "hmac-sha1" | "hmac-sha512";
1015
+ header: string;
1016
+ format: string;
1017
+ secretEnv: string;
1018
+ tolerance: number;
1019
+ timestampHeader?: string | undefined;
1020
+ }, {
1021
+ header: string;
1022
+ secretEnv: string;
1023
+ scheme?: "hmac-sha256" | "hmac-sha1" | "hmac-sha512" | undefined;
1024
+ format?: string | undefined;
1025
+ tolerance?: number | undefined;
1026
+ timestampHeader?: string | undefined;
1027
+ }>;
1028
+ export type WebhookCustomSignature = z.input<typeof WebhookCustomSignatureSchema>;
1029
+ /**
1030
+ * v0.7 webhook trigger config. See the v0.7 additional-triggers plan
1031
+ * for the full design.
1032
+ *
1033
+ * **`provider`** selects a built-in verifier (GitHub, Stripe, Slack,
1034
+ * Shopify, Standard Webhooks via Svix). For unknown providers, omit
1035
+ * `provider` and supply `signature` instead.
1036
+ *
1037
+ * **`namespace`** (combined with a polymorphic `subworkflow` step in
1038
+ * the workflow body) lets one trigger workflow dispatch to many
1039
+ * per-event handler workflows by name. Example: webhook fires with
1040
+ * `body.type === "invoice.paid"` and namespace `"stripe"` resolves
1041
+ * to sub-workflow `"stripe.invoice.paid"`.
1042
+ *
1043
+ * **`secretEnv`** is the env var name to read the shared secret from
1044
+ * — the verifier never sees the secret value at config time, and
1045
+ * workflow JSON files never contain it.
1046
+ *
1047
+ * **`events`** (allowlist) skips verifier-validated deliveries that
1048
+ * are NOT in the list — returns 200 with `{status: "ignored"}` so
1049
+ * the sender doesn't retry. Absent allowlist = accept all events.
1050
+ */
846
1051
  export declare const WebhookTriggerOptsSchema: z.ZodObject<{
847
- source: z.ZodString;
848
- events: z.ZodArray<z.ZodString, "many">;
849
- secret: z.ZodOptional<z.ZodString>;
1052
+ provider: z.ZodOptional<z.ZodEnum<["github", "stripe", "slack", "shopify", "svix"]>>;
850
1053
  path: z.ZodOptional<z.ZodString>;
1054
+ events: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1055
+ secretEnv: z.ZodOptional<z.ZodString>;
1056
+ signature: z.ZodOptional<z.ZodObject<{
1057
+ scheme: z.ZodDefault<z.ZodEnum<["hmac-sha256", "hmac-sha1", "hmac-sha512"]>>;
1058
+ header: z.ZodString;
1059
+ format: z.ZodDefault<z.ZodString>;
1060
+ secretEnv: z.ZodString;
1061
+ tolerance: z.ZodDefault<z.ZodNumber>;
1062
+ timestampHeader: z.ZodOptional<z.ZodString>;
1063
+ }, "strip", z.ZodTypeAny, {
1064
+ scheme: "hmac-sha256" | "hmac-sha1" | "hmac-sha512";
1065
+ header: string;
1066
+ format: string;
1067
+ secretEnv: string;
1068
+ tolerance: number;
1069
+ timestampHeader?: string | undefined;
1070
+ }, {
1071
+ header: string;
1072
+ secretEnv: string;
1073
+ scheme?: "hmac-sha256" | "hmac-sha1" | "hmac-sha512" | undefined;
1074
+ format?: string | undefined;
1075
+ tolerance?: number | undefined;
1076
+ timestampHeader?: string | undefined;
1077
+ }>>;
1078
+ tolerance: z.ZodOptional<z.ZodNumber>;
1079
+ idempotencyKey: z.ZodOptional<z.ZodString>;
1080
+ namespace: z.ZodOptional<z.ZodString>;
1081
+ middleware: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
851
1082
  }, "strip", z.ZodTypeAny, {
852
- source: string;
853
- events: string[];
854
1083
  path?: string | undefined;
855
- secret?: string | undefined;
1084
+ middleware?: string[] | undefined;
1085
+ provider?: "github" | "stripe" | "slack" | "shopify" | "svix" | undefined;
1086
+ secretEnv?: string | undefined;
1087
+ tolerance?: number | undefined;
1088
+ events?: string[] | undefined;
1089
+ signature?: {
1090
+ scheme: "hmac-sha256" | "hmac-sha1" | "hmac-sha512";
1091
+ header: string;
1092
+ format: string;
1093
+ secretEnv: string;
1094
+ tolerance: number;
1095
+ timestampHeader?: string | undefined;
1096
+ } | undefined;
1097
+ idempotencyKey?: string | undefined;
1098
+ namespace?: string | undefined;
856
1099
  }, {
857
- source: string;
858
- events: string[];
859
1100
  path?: string | undefined;
860
- secret?: string | undefined;
1101
+ middleware?: string[] | undefined;
1102
+ provider?: "github" | "stripe" | "slack" | "shopify" | "svix" | undefined;
1103
+ secretEnv?: string | undefined;
1104
+ tolerance?: number | undefined;
1105
+ events?: string[] | undefined;
1106
+ signature?: {
1107
+ header: string;
1108
+ secretEnv: string;
1109
+ scheme?: "hmac-sha256" | "hmac-sha1" | "hmac-sha512" | undefined;
1110
+ format?: string | undefined;
1111
+ tolerance?: number | undefined;
1112
+ timestampHeader?: string | undefined;
1113
+ } | undefined;
1114
+ idempotencyKey?: string | undefined;
1115
+ namespace?: string | undefined;
861
1116
  }>;
862
1117
  export type WebhookTriggerOpts = z.input<typeof WebhookTriggerOptsSchema>;
863
1118
  export declare const WebSocketTriggerOptsSchema: z.ZodObject<{
@@ -987,6 +1242,15 @@ export declare const TRIGGER_SCHEMAS: {
987
1242
  accept: z.ZodDefault<z.ZodString>;
988
1243
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
989
1244
  legacyKeyPrefix: z.ZodOptional<z.ZodBoolean>;
1245
+ middleware: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1246
+ examples: z.ZodOptional<z.ZodObject<{
1247
+ body: z.ZodOptional<z.ZodUnknown>;
1248
+ }, "strip", z.ZodTypeAny, {
1249
+ body?: unknown;
1250
+ }, {
1251
+ body?: unknown;
1252
+ }>>;
1253
+ recordSample: z.ZodOptional<z.ZodBoolean>;
990
1254
  }, "strip", z.ZodTypeAny, {
991
1255
  method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "ANY";
992
1256
  accept: string;
@@ -1011,6 +1275,11 @@ export declare const TRIGGER_SCHEMAS: {
1011
1275
  } | undefined;
1012
1276
  headers?: Record<string, any> | undefined;
1013
1277
  legacyKeyPrefix?: boolean | undefined;
1278
+ middleware?: string[] | undefined;
1279
+ examples?: {
1280
+ body?: unknown;
1281
+ } | undefined;
1282
+ recordSample?: boolean | undefined;
1014
1283
  }, {
1015
1284
  path?: string | undefined;
1016
1285
  concurrencyKey?: string | undefined;
@@ -1035,6 +1304,11 @@ export declare const TRIGGER_SCHEMAS: {
1035
1304
  accept?: string | undefined;
1036
1305
  headers?: Record<string, any> | undefined;
1037
1306
  legacyKeyPrefix?: boolean | undefined;
1307
+ middleware?: string[] | undefined;
1308
+ examples?: {
1309
+ body?: unknown;
1310
+ } | undefined;
1311
+ recordSample?: boolean | undefined;
1038
1312
  }>, {
1039
1313
  method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "ANY";
1040
1314
  accept: string;
@@ -1059,6 +1333,11 @@ export declare const TRIGGER_SCHEMAS: {
1059
1333
  } | undefined;
1060
1334
  headers?: Record<string, any> | undefined;
1061
1335
  legacyKeyPrefix?: boolean | undefined;
1336
+ middleware?: string[] | undefined;
1337
+ examples?: {
1338
+ body?: unknown;
1339
+ } | undefined;
1340
+ recordSample?: boolean | undefined;
1062
1341
  }, {
1063
1342
  path?: string | undefined;
1064
1343
  concurrencyKey?: string | undefined;
@@ -1083,6 +1362,11 @@ export declare const TRIGGER_SCHEMAS: {
1083
1362
  accept?: string | undefined;
1084
1363
  headers?: Record<string, any> | undefined;
1085
1364
  legacyKeyPrefix?: boolean | undefined;
1365
+ middleware?: string[] | undefined;
1366
+ examples?: {
1367
+ body?: unknown;
1368
+ } | undefined;
1369
+ recordSample?: boolean | undefined;
1086
1370
  }>;
1087
1371
  readonly queue: z.ZodObject<{
1088
1372
  provider: z.ZodEnum<["kafka", "rabbitmq", "sqs", "redis", "beanstalk", "nats"]>;
@@ -1119,29 +1403,58 @@ export declare const TRIGGER_SCHEMAS: {
1119
1403
  concurrency?: number | undefined;
1120
1404
  }>;
1121
1405
  readonly pubsub: z.ZodObject<{
1122
- provider: z.ZodEnum<["gcp", "aws", "azure"]>;
1406
+ provider: z.ZodOptional<z.ZodEnum<["nats", "redis-streams", "kafka", "gcp", "aws", "azure"]>>;
1123
1407
  topic: z.ZodString;
1124
- subscription: z.ZodString;
1408
+ subscription: z.ZodOptional<z.ZodString>;
1409
+ consumerGroup: z.ZodOptional<z.ZodString>;
1410
+ durable: z.ZodOptional<z.ZodBoolean>;
1411
+ startFrom: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"earliest">, z.ZodLiteral<"latest">, z.ZodObject<{
1412
+ seq: z.ZodNumber;
1413
+ }, "strip", z.ZodTypeAny, {
1414
+ seq: number;
1415
+ }, {
1416
+ seq: number;
1417
+ }>, z.ZodObject<{
1418
+ timestamp: z.ZodNumber;
1419
+ }, "strip", z.ZodTypeAny, {
1420
+ timestamp: number;
1421
+ }, {
1422
+ timestamp: number;
1423
+ }>]>>;
1125
1424
  ack: z.ZodDefault<z.ZodBoolean>;
1126
1425
  maxMessages: z.ZodDefault<z.ZodNumber>;
1127
1426
  ackDeadline: z.ZodDefault<z.ZodNumber>;
1128
1427
  deadLetterTopic: z.ZodOptional<z.ZodString>;
1129
1428
  filter: z.ZodOptional<z.ZodString>;
1130
1429
  }, "strip", z.ZodTypeAny, {
1131
- provider: "gcp" | "aws" | "azure";
1132
1430
  topic: string;
1133
- subscription: string;
1134
1431
  ack: boolean;
1135
1432
  maxMessages: number;
1136
1433
  ackDeadline: number;
1137
1434
  filter?: string | undefined;
1435
+ provider?: "kafka" | "nats" | "redis-streams" | "gcp" | "aws" | "azure" | undefined;
1436
+ subscription?: string | undefined;
1437
+ consumerGroup?: string | undefined;
1438
+ durable?: boolean | undefined;
1439
+ startFrom?: "earliest" | "latest" | {
1440
+ seq: number;
1441
+ } | {
1442
+ timestamp: number;
1443
+ } | undefined;
1138
1444
  deadLetterTopic?: string | undefined;
1139
1445
  }, {
1140
- provider: "gcp" | "aws" | "azure";
1141
1446
  topic: string;
1142
- subscription: string;
1143
1447
  filter?: string | undefined;
1448
+ provider?: "kafka" | "nats" | "redis-streams" | "gcp" | "aws" | "azure" | undefined;
1449
+ subscription?: string | undefined;
1450
+ consumerGroup?: string | undefined;
1144
1451
  ack?: boolean | undefined;
1452
+ durable?: boolean | undefined;
1453
+ startFrom?: "earliest" | "latest" | {
1454
+ seq: number;
1455
+ } | {
1456
+ timestamp: number;
1457
+ } | undefined;
1145
1458
  maxMessages?: number | undefined;
1146
1459
  ackDeadline?: number | undefined;
1147
1460
  deadLetterTopic?: string | undefined;
@@ -1194,10 +1507,15 @@ export declare const TRIGGER_SCHEMAS: {
1194
1507
  factor?: number | undefined;
1195
1508
  }>>;
1196
1509
  queue: z.ZodString;
1510
+ provider: z.ZodOptional<z.ZodEnum<["in-memory", "nats", "bullmq", "kafka", "rabbitmq", "sqs", "redis", "pg-boss"]>>;
1197
1511
  concurrency: z.ZodDefault<z.ZodNumber>;
1198
1512
  timeout: z.ZodOptional<z.ZodNumber>;
1199
1513
  retries: z.ZodDefault<z.ZodNumber>;
1200
1514
  priority: z.ZodDefault<z.ZodNumber>;
1515
+ consumerGroup: z.ZodOptional<z.ZodString>;
1516
+ ack: z.ZodOptional<z.ZodBoolean>;
1517
+ deadLetterQueue: z.ZodOptional<z.ZodString>;
1518
+ fromBeginning: z.ZodOptional<z.ZodBoolean>;
1201
1519
  }, "strip", z.ZodTypeAny, {
1202
1520
  queue: string;
1203
1521
  concurrency: number;
@@ -1221,7 +1539,12 @@ export declare const TRIGGER_SCHEMAS: {
1221
1539
  delay: string | number;
1222
1540
  maxDelay?: string | number | undefined;
1223
1541
  } | undefined;
1542
+ provider?: "kafka" | "rabbitmq" | "sqs" | "redis" | "nats" | "in-memory" | "bullmq" | "pg-boss" | undefined;
1543
+ consumerGroup?: string | undefined;
1544
+ ack?: boolean | undefined;
1545
+ deadLetterQueue?: string | undefined;
1224
1546
  timeout?: number | undefined;
1547
+ fromBeginning?: boolean | undefined;
1225
1548
  }, {
1226
1549
  queue: string;
1227
1550
  concurrencyKey?: string | undefined;
@@ -1242,10 +1565,15 @@ export declare const TRIGGER_SCHEMAS: {
1242
1565
  mode?: "leading" | "trailing" | undefined;
1243
1566
  maxDelay?: string | number | undefined;
1244
1567
  } | undefined;
1568
+ provider?: "kafka" | "rabbitmq" | "sqs" | "redis" | "nats" | "in-memory" | "bullmq" | "pg-boss" | undefined;
1569
+ consumerGroup?: string | undefined;
1570
+ ack?: boolean | undefined;
1571
+ deadLetterQueue?: string | undefined;
1245
1572
  concurrency?: number | undefined;
1246
1573
  timeout?: number | undefined;
1247
1574
  retries?: number | undefined;
1248
1575
  priority?: number | undefined;
1576
+ fromBeginning?: boolean | undefined;
1249
1577
  }>, {
1250
1578
  queue: string;
1251
1579
  concurrency: number;
@@ -1269,7 +1597,12 @@ export declare const TRIGGER_SCHEMAS: {
1269
1597
  delay: string | number;
1270
1598
  maxDelay?: string | number | undefined;
1271
1599
  } | undefined;
1600
+ provider?: "kafka" | "rabbitmq" | "sqs" | "redis" | "nats" | "in-memory" | "bullmq" | "pg-boss" | undefined;
1601
+ consumerGroup?: string | undefined;
1602
+ ack?: boolean | undefined;
1603
+ deadLetterQueue?: string | undefined;
1272
1604
  timeout?: number | undefined;
1605
+ fromBeginning?: boolean | undefined;
1273
1606
  }, {
1274
1607
  queue: string;
1275
1608
  concurrencyKey?: string | undefined;
@@ -1290,10 +1623,15 @@ export declare const TRIGGER_SCHEMAS: {
1290
1623
  mode?: "leading" | "trailing" | undefined;
1291
1624
  maxDelay?: string | number | undefined;
1292
1625
  } | undefined;
1626
+ provider?: "kafka" | "rabbitmq" | "sqs" | "redis" | "nats" | "in-memory" | "bullmq" | "pg-boss" | undefined;
1627
+ consumerGroup?: string | undefined;
1628
+ ack?: boolean | undefined;
1629
+ deadLetterQueue?: string | undefined;
1293
1630
  concurrency?: number | undefined;
1294
1631
  timeout?: number | undefined;
1295
1632
  retries?: number | undefined;
1296
1633
  priority?: number | undefined;
1634
+ fromBeginning?: boolean | undefined;
1297
1635
  }>;
1298
1636
  readonly cron: z.ZodObject<{
1299
1637
  schedule: z.ZodString;
@@ -1309,20 +1647,70 @@ export declare const TRIGGER_SCHEMAS: {
1309
1647
  overlap?: boolean | undefined;
1310
1648
  }>;
1311
1649
  readonly webhook: z.ZodObject<{
1312
- source: z.ZodString;
1313
- events: z.ZodArray<z.ZodString, "many">;
1314
- secret: z.ZodOptional<z.ZodString>;
1650
+ provider: z.ZodOptional<z.ZodEnum<["github", "stripe", "slack", "shopify", "svix"]>>;
1315
1651
  path: z.ZodOptional<z.ZodString>;
1652
+ events: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1653
+ secretEnv: z.ZodOptional<z.ZodString>;
1654
+ signature: z.ZodOptional<z.ZodObject<{
1655
+ scheme: z.ZodDefault<z.ZodEnum<["hmac-sha256", "hmac-sha1", "hmac-sha512"]>>;
1656
+ header: z.ZodString;
1657
+ format: z.ZodDefault<z.ZodString>;
1658
+ secretEnv: z.ZodString;
1659
+ tolerance: z.ZodDefault<z.ZodNumber>;
1660
+ timestampHeader: z.ZodOptional<z.ZodString>;
1661
+ }, "strip", z.ZodTypeAny, {
1662
+ scheme: "hmac-sha256" | "hmac-sha1" | "hmac-sha512";
1663
+ header: string;
1664
+ format: string;
1665
+ secretEnv: string;
1666
+ tolerance: number;
1667
+ timestampHeader?: string | undefined;
1668
+ }, {
1669
+ header: string;
1670
+ secretEnv: string;
1671
+ scheme?: "hmac-sha256" | "hmac-sha1" | "hmac-sha512" | undefined;
1672
+ format?: string | undefined;
1673
+ tolerance?: number | undefined;
1674
+ timestampHeader?: string | undefined;
1675
+ }>>;
1676
+ tolerance: z.ZodOptional<z.ZodNumber>;
1677
+ idempotencyKey: z.ZodOptional<z.ZodString>;
1678
+ namespace: z.ZodOptional<z.ZodString>;
1679
+ middleware: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1316
1680
  }, "strip", z.ZodTypeAny, {
1317
- source: string;
1318
- events: string[];
1319
1681
  path?: string | undefined;
1320
- secret?: string | undefined;
1682
+ middleware?: string[] | undefined;
1683
+ provider?: "github" | "stripe" | "slack" | "shopify" | "svix" | undefined;
1684
+ secretEnv?: string | undefined;
1685
+ tolerance?: number | undefined;
1686
+ events?: string[] | undefined;
1687
+ signature?: {
1688
+ scheme: "hmac-sha256" | "hmac-sha1" | "hmac-sha512";
1689
+ header: string;
1690
+ format: string;
1691
+ secretEnv: string;
1692
+ tolerance: number;
1693
+ timestampHeader?: string | undefined;
1694
+ } | undefined;
1695
+ idempotencyKey?: string | undefined;
1696
+ namespace?: string | undefined;
1321
1697
  }, {
1322
- source: string;
1323
- events: string[];
1324
1698
  path?: string | undefined;
1325
- secret?: string | undefined;
1699
+ middleware?: string[] | undefined;
1700
+ provider?: "github" | "stripe" | "slack" | "shopify" | "svix" | undefined;
1701
+ secretEnv?: string | undefined;
1702
+ tolerance?: number | undefined;
1703
+ events?: string[] | undefined;
1704
+ signature?: {
1705
+ header: string;
1706
+ secretEnv: string;
1707
+ scheme?: "hmac-sha256" | "hmac-sha1" | "hmac-sha512" | undefined;
1708
+ format?: string | undefined;
1709
+ tolerance?: number | undefined;
1710
+ timestampHeader?: string | undefined;
1711
+ } | undefined;
1712
+ idempotencyKey?: string | undefined;
1713
+ namespace?: string | undefined;
1326
1714
  }>;
1327
1715
  readonly sse: z.ZodObject<{
1328
1716
  events: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;