@trigger.dev/platform 1.0.11

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.
@@ -0,0 +1,1557 @@
1
+ import { z, ZodType } from 'zod';
2
+
3
+ declare const BracketSchema: z.ZodObject<{
4
+ code: z.ZodString;
5
+ upto: z.ZodNumber;
6
+ tierCost: z.ZodNumber;
7
+ }, "strip", z.ZodTypeAny, {
8
+ code: string;
9
+ upto: number;
10
+ tierCost: number;
11
+ }, {
12
+ code: string;
13
+ upto: number;
14
+ tierCost: number;
15
+ }>;
16
+ declare const PlanDefinitionSchema: z.ZodObject<{
17
+ title: z.ZodString;
18
+ code: z.ZodString;
19
+ concurrentRuns: z.ZodOptional<z.ZodObject<{
20
+ pricing: z.ZodOptional<z.ZodObject<{
21
+ tiers: z.ZodArray<z.ZodObject<{
22
+ code: z.ZodString;
23
+ upto: z.ZodNumber;
24
+ tierCost: z.ZodNumber;
25
+ }, "strip", z.ZodTypeAny, {
26
+ code: string;
27
+ upto: number;
28
+ tierCost: number;
29
+ }, {
30
+ code: string;
31
+ upto: number;
32
+ tierCost: number;
33
+ }>, "many">;
34
+ }, "strip", z.ZodTypeAny, {
35
+ tiers: {
36
+ code: string;
37
+ upto: number;
38
+ tierCost: number;
39
+ }[];
40
+ }, {
41
+ tiers: {
42
+ code: string;
43
+ upto: number;
44
+ tierCost: number;
45
+ }[];
46
+ }>>;
47
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ pricing?: {
50
+ tiers: {
51
+ code: string;
52
+ upto: number;
53
+ tierCost: number;
54
+ }[];
55
+ } | undefined;
56
+ freeAllowance?: number | undefined;
57
+ }, {
58
+ pricing?: {
59
+ tiers: {
60
+ code: string;
61
+ upto: number;
62
+ tierCost: number;
63
+ }[];
64
+ } | undefined;
65
+ freeAllowance?: number | undefined;
66
+ }>>;
67
+ runs: z.ZodOptional<z.ZodObject<{
68
+ pricing: z.ZodOptional<z.ZodObject<{
69
+ code: z.ZodString;
70
+ }, "strip", z.ZodTypeAny, {
71
+ code: string;
72
+ }, {
73
+ code: string;
74
+ }>>;
75
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
76
+ }, "strip", z.ZodTypeAny, {
77
+ pricing?: {
78
+ code: string;
79
+ } | undefined;
80
+ freeAllowance?: number | undefined;
81
+ }, {
82
+ pricing?: {
83
+ code: string;
84
+ } | undefined;
85
+ freeAllowance?: number | undefined;
86
+ }>>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ code: string;
89
+ title: string;
90
+ concurrentRuns?: {
91
+ pricing?: {
92
+ tiers: {
93
+ code: string;
94
+ upto: number;
95
+ tierCost: number;
96
+ }[];
97
+ } | undefined;
98
+ freeAllowance?: number | undefined;
99
+ } | undefined;
100
+ runs?: {
101
+ pricing?: {
102
+ code: string;
103
+ } | undefined;
104
+ freeAllowance?: number | undefined;
105
+ } | undefined;
106
+ }, {
107
+ code: string;
108
+ title: string;
109
+ concurrentRuns?: {
110
+ pricing?: {
111
+ tiers: {
112
+ code: string;
113
+ upto: number;
114
+ tierCost: number;
115
+ }[];
116
+ } | undefined;
117
+ freeAllowance?: number | undefined;
118
+ } | undefined;
119
+ runs?: {
120
+ pricing?: {
121
+ code: string;
122
+ } | undefined;
123
+ freeAllowance?: number | undefined;
124
+ } | undefined;
125
+ }>;
126
+ type PlanDefinition = z.infer<typeof PlanDefinitionSchema>;
127
+
128
+ declare const PricedMetricSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
129
+ type: z.ZodLiteral<"fixed">;
130
+ cost: z.ZodNumber;
131
+ }, "strip", z.ZodTypeAny, {
132
+ type: "fixed";
133
+ cost: number;
134
+ }, {
135
+ type: "fixed";
136
+ cost: number;
137
+ }>, z.ZodObject<{
138
+ type: z.ZodLiteral<"graduated">;
139
+ brackets: z.ZodArray<z.ZodObject<{
140
+ upto: z.ZodOptional<z.ZodNumber>;
141
+ flatCost: z.ZodNumber;
142
+ perUnitCost: z.ZodNumber;
143
+ }, "strip", z.ZodTypeAny, {
144
+ flatCost: number;
145
+ perUnitCost: number;
146
+ upto?: number | undefined;
147
+ }, {
148
+ flatCost: number;
149
+ perUnitCost: number;
150
+ upto?: number | undefined;
151
+ }>, "many">;
152
+ }, "strip", z.ZodTypeAny, {
153
+ type: "graduated";
154
+ brackets: {
155
+ flatCost: number;
156
+ perUnitCost: number;
157
+ upto?: number | undefined;
158
+ }[];
159
+ }, {
160
+ type: "graduated";
161
+ brackets: {
162
+ flatCost: number;
163
+ perUnitCost: number;
164
+ upto?: number | undefined;
165
+ }[];
166
+ }>, z.ZodObject<{
167
+ type: z.ZodLiteral<"volume">;
168
+ brackets: z.ZodArray<z.ZodObject<{
169
+ upto: z.ZodOptional<z.ZodNumber>;
170
+ flatCost: z.ZodNumber;
171
+ perUnitCost: z.ZodNumber;
172
+ }, "strip", z.ZodTypeAny, {
173
+ flatCost: number;
174
+ perUnitCost: number;
175
+ upto?: number | undefined;
176
+ }, {
177
+ flatCost: number;
178
+ perUnitCost: number;
179
+ upto?: number | undefined;
180
+ }>, "many">;
181
+ }, "strip", z.ZodTypeAny, {
182
+ type: "volume";
183
+ brackets: {
184
+ flatCost: number;
185
+ perUnitCost: number;
186
+ upto?: number | undefined;
187
+ }[];
188
+ }, {
189
+ type: "volume";
190
+ brackets: {
191
+ flatCost: number;
192
+ perUnitCost: number;
193
+ upto?: number | undefined;
194
+ }[];
195
+ }>]>;
196
+ type PricedMetric = z.infer<typeof PricedMetricSchema>;
197
+
198
+ declare const ActiveSubscriptionSchema: z.ZodObject<{
199
+ isPaying: z.ZodBoolean;
200
+ plan: z.ZodObject<{
201
+ title: z.ZodString;
202
+ code: z.ZodString;
203
+ concurrentRuns: z.ZodObject<{
204
+ pricing: z.ZodOptional<z.ZodObject<{
205
+ code: z.ZodString;
206
+ upto: z.ZodOptional<z.ZodNumber>;
207
+ tierCost: z.ZodOptional<z.ZodNumber>;
208
+ }, "strip", z.ZodTypeAny, {
209
+ code: string;
210
+ upto?: number | undefined;
211
+ tierCost?: number | undefined;
212
+ }, {
213
+ code: string;
214
+ upto?: number | undefined;
215
+ tierCost?: number | undefined;
216
+ }>>;
217
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
218
+ }, "strip", z.ZodTypeAny, {
219
+ pricing?: {
220
+ code: string;
221
+ upto?: number | undefined;
222
+ tierCost?: number | undefined;
223
+ } | undefined;
224
+ freeAllowance?: number | undefined;
225
+ }, {
226
+ pricing?: {
227
+ code: string;
228
+ upto?: number | undefined;
229
+ tierCost?: number | undefined;
230
+ } | undefined;
231
+ freeAllowance?: number | undefined;
232
+ }>;
233
+ runs: z.ZodOptional<z.ZodObject<{
234
+ pricing: z.ZodOptional<z.ZodObject<{
235
+ code: z.ZodString;
236
+ }, "strip", z.ZodTypeAny, {
237
+ code: string;
238
+ }, {
239
+ code: string;
240
+ }>>;
241
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
242
+ }, "strip", z.ZodTypeAny, {
243
+ pricing?: {
244
+ code: string;
245
+ } | undefined;
246
+ freeAllowance?: number | undefined;
247
+ }, {
248
+ pricing?: {
249
+ code: string;
250
+ } | undefined;
251
+ freeAllowance?: number | undefined;
252
+ }>>;
253
+ }, "strip", z.ZodTypeAny, {
254
+ code: string;
255
+ title: string;
256
+ concurrentRuns: {
257
+ pricing?: {
258
+ code: string;
259
+ upto?: number | undefined;
260
+ tierCost?: number | undefined;
261
+ } | undefined;
262
+ freeAllowance?: number | undefined;
263
+ };
264
+ runs?: {
265
+ pricing?: {
266
+ code: string;
267
+ } | undefined;
268
+ freeAllowance?: number | undefined;
269
+ } | undefined;
270
+ }, {
271
+ code: string;
272
+ title: string;
273
+ concurrentRuns: {
274
+ pricing?: {
275
+ code: string;
276
+ upto?: number | undefined;
277
+ tierCost?: number | undefined;
278
+ } | undefined;
279
+ freeAllowance?: number | undefined;
280
+ };
281
+ runs?: {
282
+ pricing?: {
283
+ code: string;
284
+ } | undefined;
285
+ freeAllowance?: number | undefined;
286
+ } | undefined;
287
+ }>;
288
+ limits: z.ZodObject<{
289
+ runs: z.ZodOptional<z.ZodNumber>;
290
+ concurrentRuns: z.ZodOptional<z.ZodNumber>;
291
+ }, "strip", z.ZodTypeAny, {
292
+ runs?: number | undefined;
293
+ concurrentRuns?: number | undefined;
294
+ }, {
295
+ runs?: number | undefined;
296
+ concurrentRuns?: number | undefined;
297
+ }>;
298
+ canceledAt: z.ZodOptional<z.ZodString>;
299
+ }, "strip", z.ZodTypeAny, {
300
+ isPaying: boolean;
301
+ plan: {
302
+ code: string;
303
+ title: string;
304
+ concurrentRuns: {
305
+ pricing?: {
306
+ code: string;
307
+ upto?: number | undefined;
308
+ tierCost?: number | undefined;
309
+ } | undefined;
310
+ freeAllowance?: number | undefined;
311
+ };
312
+ runs?: {
313
+ pricing?: {
314
+ code: string;
315
+ } | undefined;
316
+ freeAllowance?: number | undefined;
317
+ } | undefined;
318
+ };
319
+ limits: {
320
+ runs?: number | undefined;
321
+ concurrentRuns?: number | undefined;
322
+ };
323
+ canceledAt?: string | undefined;
324
+ }, {
325
+ isPaying: boolean;
326
+ plan: {
327
+ code: string;
328
+ title: string;
329
+ concurrentRuns: {
330
+ pricing?: {
331
+ code: string;
332
+ upto?: number | undefined;
333
+ tierCost?: number | undefined;
334
+ } | undefined;
335
+ freeAllowance?: number | undefined;
336
+ };
337
+ runs?: {
338
+ pricing?: {
339
+ code: string;
340
+ } | undefined;
341
+ freeAllowance?: number | undefined;
342
+ } | undefined;
343
+ };
344
+ limits: {
345
+ runs?: number | undefined;
346
+ concurrentRuns?: number | undefined;
347
+ };
348
+ canceledAt?: string | undefined;
349
+ }>;
350
+ type ActiveSubscription = z.infer<typeof ActiveSubscriptionSchema>;
351
+ declare const CurrentPlanSchema: z.ZodObject<{
352
+ subscription: z.ZodOptional<z.ZodObject<{
353
+ isPaying: z.ZodBoolean;
354
+ plan: z.ZodObject<{
355
+ title: z.ZodString;
356
+ code: z.ZodString;
357
+ concurrentRuns: z.ZodObject<{
358
+ pricing: z.ZodOptional<z.ZodObject<{
359
+ code: z.ZodString;
360
+ upto: z.ZodOptional<z.ZodNumber>;
361
+ tierCost: z.ZodOptional<z.ZodNumber>;
362
+ }, "strip", z.ZodTypeAny, {
363
+ code: string;
364
+ upto?: number | undefined;
365
+ tierCost?: number | undefined;
366
+ }, {
367
+ code: string;
368
+ upto?: number | undefined;
369
+ tierCost?: number | undefined;
370
+ }>>;
371
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
372
+ }, "strip", z.ZodTypeAny, {
373
+ pricing?: {
374
+ code: string;
375
+ upto?: number | undefined;
376
+ tierCost?: number | undefined;
377
+ } | undefined;
378
+ freeAllowance?: number | undefined;
379
+ }, {
380
+ pricing?: {
381
+ code: string;
382
+ upto?: number | undefined;
383
+ tierCost?: number | undefined;
384
+ } | undefined;
385
+ freeAllowance?: number | undefined;
386
+ }>;
387
+ runs: z.ZodOptional<z.ZodObject<{
388
+ pricing: z.ZodOptional<z.ZodObject<{
389
+ code: z.ZodString;
390
+ }, "strip", z.ZodTypeAny, {
391
+ code: string;
392
+ }, {
393
+ code: string;
394
+ }>>;
395
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
396
+ }, "strip", z.ZodTypeAny, {
397
+ pricing?: {
398
+ code: string;
399
+ } | undefined;
400
+ freeAllowance?: number | undefined;
401
+ }, {
402
+ pricing?: {
403
+ code: string;
404
+ } | undefined;
405
+ freeAllowance?: number | undefined;
406
+ }>>;
407
+ }, "strip", z.ZodTypeAny, {
408
+ code: string;
409
+ title: string;
410
+ concurrentRuns: {
411
+ pricing?: {
412
+ code: string;
413
+ upto?: number | undefined;
414
+ tierCost?: number | undefined;
415
+ } | undefined;
416
+ freeAllowance?: number | undefined;
417
+ };
418
+ runs?: {
419
+ pricing?: {
420
+ code: string;
421
+ } | undefined;
422
+ freeAllowance?: number | undefined;
423
+ } | undefined;
424
+ }, {
425
+ code: string;
426
+ title: string;
427
+ concurrentRuns: {
428
+ pricing?: {
429
+ code: string;
430
+ upto?: number | undefined;
431
+ tierCost?: number | undefined;
432
+ } | undefined;
433
+ freeAllowance?: number | undefined;
434
+ };
435
+ runs?: {
436
+ pricing?: {
437
+ code: string;
438
+ } | undefined;
439
+ freeAllowance?: number | undefined;
440
+ } | undefined;
441
+ }>;
442
+ limits: z.ZodObject<{
443
+ runs: z.ZodOptional<z.ZodNumber>;
444
+ concurrentRuns: z.ZodOptional<z.ZodNumber>;
445
+ }, "strip", z.ZodTypeAny, {
446
+ runs?: number | undefined;
447
+ concurrentRuns?: number | undefined;
448
+ }, {
449
+ runs?: number | undefined;
450
+ concurrentRuns?: number | undefined;
451
+ }>;
452
+ canceledAt: z.ZodOptional<z.ZodString>;
453
+ }, "strip", z.ZodTypeAny, {
454
+ isPaying: boolean;
455
+ plan: {
456
+ code: string;
457
+ title: string;
458
+ concurrentRuns: {
459
+ pricing?: {
460
+ code: string;
461
+ upto?: number | undefined;
462
+ tierCost?: number | undefined;
463
+ } | undefined;
464
+ freeAllowance?: number | undefined;
465
+ };
466
+ runs?: {
467
+ pricing?: {
468
+ code: string;
469
+ } | undefined;
470
+ freeAllowance?: number | undefined;
471
+ } | undefined;
472
+ };
473
+ limits: {
474
+ runs?: number | undefined;
475
+ concurrentRuns?: number | undefined;
476
+ };
477
+ canceledAt?: string | undefined;
478
+ }, {
479
+ isPaying: boolean;
480
+ plan: {
481
+ code: string;
482
+ title: string;
483
+ concurrentRuns: {
484
+ pricing?: {
485
+ code: string;
486
+ upto?: number | undefined;
487
+ tierCost?: number | undefined;
488
+ } | undefined;
489
+ freeAllowance?: number | undefined;
490
+ };
491
+ runs?: {
492
+ pricing?: {
493
+ code: string;
494
+ } | undefined;
495
+ freeAllowance?: number | undefined;
496
+ } | undefined;
497
+ };
498
+ limits: {
499
+ runs?: number | undefined;
500
+ concurrentRuns?: number | undefined;
501
+ };
502
+ canceledAt?: string | undefined;
503
+ }>>;
504
+ }, "strip", z.ZodTypeAny, {
505
+ subscription?: {
506
+ isPaying: boolean;
507
+ plan: {
508
+ code: string;
509
+ title: string;
510
+ concurrentRuns: {
511
+ pricing?: {
512
+ code: string;
513
+ upto?: number | undefined;
514
+ tierCost?: number | undefined;
515
+ } | undefined;
516
+ freeAllowance?: number | undefined;
517
+ };
518
+ runs?: {
519
+ pricing?: {
520
+ code: string;
521
+ } | undefined;
522
+ freeAllowance?: number | undefined;
523
+ } | undefined;
524
+ };
525
+ limits: {
526
+ runs?: number | undefined;
527
+ concurrentRuns?: number | undefined;
528
+ };
529
+ canceledAt?: string | undefined;
530
+ } | undefined;
531
+ }, {
532
+ subscription?: {
533
+ isPaying: boolean;
534
+ plan: {
535
+ code: string;
536
+ title: string;
537
+ concurrentRuns: {
538
+ pricing?: {
539
+ code: string;
540
+ upto?: number | undefined;
541
+ tierCost?: number | undefined;
542
+ } | undefined;
543
+ freeAllowance?: number | undefined;
544
+ };
545
+ runs?: {
546
+ pricing?: {
547
+ code: string;
548
+ } | undefined;
549
+ freeAllowance?: number | undefined;
550
+ } | undefined;
551
+ };
552
+ limits: {
553
+ runs?: number | undefined;
554
+ concurrentRuns?: number | undefined;
555
+ };
556
+ canceledAt?: string | undefined;
557
+ } | undefined;
558
+ }>;
559
+ type CurrentPlan = z.infer<typeof CurrentPlanSchema>;
560
+ declare const SetPlanBodySchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
561
+ type: z.ZodLiteral<"paid">;
562
+ planCode: z.ZodString;
563
+ concurrentRunBracket: z.ZodString;
564
+ }, "strip", z.ZodTypeAny, {
565
+ type: "paid";
566
+ planCode: string;
567
+ concurrentRunBracket: string;
568
+ }, {
569
+ type: "paid";
570
+ planCode: string;
571
+ concurrentRunBracket: string;
572
+ }>, z.ZodObject<{
573
+ type: z.ZodLiteral<"free">;
574
+ }, "strip", z.ZodTypeAny, {
575
+ type: "free";
576
+ }, {
577
+ type: "free";
578
+ }>]>;
579
+ type SetPlanBody = z.infer<typeof SetPlanBodySchema>;
580
+
581
+ declare const RunPriceBracketSchema: z.ZodObject<{
582
+ upto: z.ZodOptional<z.ZodNumber>;
583
+ unitCost: z.ZodNumber;
584
+ }, "strip", z.ZodTypeAny, {
585
+ unitCost: number;
586
+ upto?: number | undefined;
587
+ }, {
588
+ unitCost: number;
589
+ upto?: number | undefined;
590
+ }>;
591
+ type RunPriceBracket = z.infer<typeof RunPriceBracketSchema>;
592
+ declare const RunPricingSchema: z.ZodObject<{
593
+ pricing: z.ZodOptional<z.ZodObject<{
594
+ code: z.ZodString;
595
+ brackets: z.ZodArray<z.ZodObject<{
596
+ upto: z.ZodOptional<z.ZodNumber>;
597
+ unitCost: z.ZodNumber;
598
+ }, "strip", z.ZodTypeAny, {
599
+ unitCost: number;
600
+ upto?: number | undefined;
601
+ }, {
602
+ unitCost: number;
603
+ upto?: number | undefined;
604
+ }>, "many">;
605
+ }, "strip", z.ZodTypeAny, {
606
+ code: string;
607
+ brackets: {
608
+ unitCost: number;
609
+ upto?: number | undefined;
610
+ }[];
611
+ }, {
612
+ code: string;
613
+ brackets: {
614
+ unitCost: number;
615
+ upto?: number | undefined;
616
+ }[];
617
+ }>>;
618
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
619
+ }, "strip", z.ZodTypeAny, {
620
+ pricing?: {
621
+ code: string;
622
+ brackets: {
623
+ unitCost: number;
624
+ upto?: number | undefined;
625
+ }[];
626
+ } | undefined;
627
+ freeAllowance?: number | undefined;
628
+ }, {
629
+ pricing?: {
630
+ code: string;
631
+ brackets: {
632
+ unitCost: number;
633
+ upto?: number | undefined;
634
+ }[];
635
+ } | undefined;
636
+ freeAllowance?: number | undefined;
637
+ }>;
638
+ declare const PlanSchema: z.ZodObject<{
639
+ title: z.ZodString;
640
+ code: z.ZodString;
641
+ concurrentRuns: z.ZodOptional<z.ZodObject<{
642
+ pricing: z.ZodOptional<z.ZodObject<{
643
+ tiers: z.ZodArray<z.ZodObject<{
644
+ code: z.ZodString;
645
+ upto: z.ZodNumber;
646
+ tierCost: z.ZodNumber;
647
+ }, "strip", z.ZodTypeAny, {
648
+ code: string;
649
+ upto: number;
650
+ tierCost: number;
651
+ }, {
652
+ code: string;
653
+ upto: number;
654
+ tierCost: number;
655
+ }>, "many">;
656
+ }, "strip", z.ZodTypeAny, {
657
+ tiers: {
658
+ code: string;
659
+ upto: number;
660
+ tierCost: number;
661
+ }[];
662
+ }, {
663
+ tiers: {
664
+ code: string;
665
+ upto: number;
666
+ tierCost: number;
667
+ }[];
668
+ }>>;
669
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
670
+ }, "strip", z.ZodTypeAny, {
671
+ pricing?: {
672
+ tiers: {
673
+ code: string;
674
+ upto: number;
675
+ tierCost: number;
676
+ }[];
677
+ } | undefined;
678
+ freeAllowance?: number | undefined;
679
+ }, {
680
+ pricing?: {
681
+ tiers: {
682
+ code: string;
683
+ upto: number;
684
+ tierCost: number;
685
+ }[];
686
+ } | undefined;
687
+ freeAllowance?: number | undefined;
688
+ }>>;
689
+ runs: z.ZodOptional<z.ZodObject<{
690
+ pricing: z.ZodOptional<z.ZodObject<{
691
+ code: z.ZodString;
692
+ brackets: z.ZodArray<z.ZodObject<{
693
+ upto: z.ZodOptional<z.ZodNumber>;
694
+ unitCost: z.ZodNumber;
695
+ }, "strip", z.ZodTypeAny, {
696
+ unitCost: number;
697
+ upto?: number | undefined;
698
+ }, {
699
+ unitCost: number;
700
+ upto?: number | undefined;
701
+ }>, "many">;
702
+ }, "strip", z.ZodTypeAny, {
703
+ code: string;
704
+ brackets: {
705
+ unitCost: number;
706
+ upto?: number | undefined;
707
+ }[];
708
+ }, {
709
+ code: string;
710
+ brackets: {
711
+ unitCost: number;
712
+ upto?: number | undefined;
713
+ }[];
714
+ }>>;
715
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
716
+ }, "strip", z.ZodTypeAny, {
717
+ pricing?: {
718
+ code: string;
719
+ brackets: {
720
+ unitCost: number;
721
+ upto?: number | undefined;
722
+ }[];
723
+ } | undefined;
724
+ freeAllowance?: number | undefined;
725
+ }, {
726
+ pricing?: {
727
+ code: string;
728
+ brackets: {
729
+ unitCost: number;
730
+ upto?: number | undefined;
731
+ }[];
732
+ } | undefined;
733
+ freeAllowance?: number | undefined;
734
+ }>>;
735
+ }, "strip", z.ZodTypeAny, {
736
+ code: string;
737
+ title: string;
738
+ concurrentRuns?: {
739
+ pricing?: {
740
+ tiers: {
741
+ code: string;
742
+ upto: number;
743
+ tierCost: number;
744
+ }[];
745
+ } | undefined;
746
+ freeAllowance?: number | undefined;
747
+ } | undefined;
748
+ runs?: {
749
+ pricing?: {
750
+ code: string;
751
+ brackets: {
752
+ unitCost: number;
753
+ upto?: number | undefined;
754
+ }[];
755
+ } | undefined;
756
+ freeAllowance?: number | undefined;
757
+ } | undefined;
758
+ }, {
759
+ code: string;
760
+ title: string;
761
+ concurrentRuns?: {
762
+ pricing?: {
763
+ tiers: {
764
+ code: string;
765
+ upto: number;
766
+ tierCost: number;
767
+ }[];
768
+ } | undefined;
769
+ freeAllowance?: number | undefined;
770
+ } | undefined;
771
+ runs?: {
772
+ pricing?: {
773
+ code: string;
774
+ brackets: {
775
+ unitCost: number;
776
+ upto?: number | undefined;
777
+ }[];
778
+ } | undefined;
779
+ freeAllowance?: number | undefined;
780
+ } | undefined;
781
+ }>;
782
+ type Plan = z.infer<typeof PlanSchema>;
783
+ declare const PlansSchema: z.ZodObject<{
784
+ free: z.ZodObject<{
785
+ title: z.ZodString;
786
+ code: z.ZodString;
787
+ concurrentRuns: z.ZodOptional<z.ZodObject<{
788
+ pricing: z.ZodOptional<z.ZodObject<{
789
+ tiers: z.ZodArray<z.ZodObject<{
790
+ code: z.ZodString;
791
+ upto: z.ZodNumber;
792
+ tierCost: z.ZodNumber;
793
+ }, "strip", z.ZodTypeAny, {
794
+ code: string;
795
+ upto: number;
796
+ tierCost: number;
797
+ }, {
798
+ code: string;
799
+ upto: number;
800
+ tierCost: number;
801
+ }>, "many">;
802
+ }, "strip", z.ZodTypeAny, {
803
+ tiers: {
804
+ code: string;
805
+ upto: number;
806
+ tierCost: number;
807
+ }[];
808
+ }, {
809
+ tiers: {
810
+ code: string;
811
+ upto: number;
812
+ tierCost: number;
813
+ }[];
814
+ }>>;
815
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
816
+ }, "strip", z.ZodTypeAny, {
817
+ pricing?: {
818
+ tiers: {
819
+ code: string;
820
+ upto: number;
821
+ tierCost: number;
822
+ }[];
823
+ } | undefined;
824
+ freeAllowance?: number | undefined;
825
+ }, {
826
+ pricing?: {
827
+ tiers: {
828
+ code: string;
829
+ upto: number;
830
+ tierCost: number;
831
+ }[];
832
+ } | undefined;
833
+ freeAllowance?: number | undefined;
834
+ }>>;
835
+ runs: z.ZodOptional<z.ZodObject<{
836
+ pricing: z.ZodOptional<z.ZodObject<{
837
+ code: z.ZodString;
838
+ brackets: z.ZodArray<z.ZodObject<{
839
+ upto: z.ZodOptional<z.ZodNumber>;
840
+ unitCost: z.ZodNumber;
841
+ }, "strip", z.ZodTypeAny, {
842
+ unitCost: number;
843
+ upto?: number | undefined;
844
+ }, {
845
+ unitCost: number;
846
+ upto?: number | undefined;
847
+ }>, "many">;
848
+ }, "strip", z.ZodTypeAny, {
849
+ code: string;
850
+ brackets: {
851
+ unitCost: number;
852
+ upto?: number | undefined;
853
+ }[];
854
+ }, {
855
+ code: string;
856
+ brackets: {
857
+ unitCost: number;
858
+ upto?: number | undefined;
859
+ }[];
860
+ }>>;
861
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
862
+ }, "strip", z.ZodTypeAny, {
863
+ pricing?: {
864
+ code: string;
865
+ brackets: {
866
+ unitCost: number;
867
+ upto?: number | undefined;
868
+ }[];
869
+ } | undefined;
870
+ freeAllowance?: number | undefined;
871
+ }, {
872
+ pricing?: {
873
+ code: string;
874
+ brackets: {
875
+ unitCost: number;
876
+ upto?: number | undefined;
877
+ }[];
878
+ } | undefined;
879
+ freeAllowance?: number | undefined;
880
+ }>>;
881
+ }, "strip", z.ZodTypeAny, {
882
+ code: string;
883
+ title: string;
884
+ concurrentRuns?: {
885
+ pricing?: {
886
+ tiers: {
887
+ code: string;
888
+ upto: number;
889
+ tierCost: number;
890
+ }[];
891
+ } | undefined;
892
+ freeAllowance?: number | undefined;
893
+ } | undefined;
894
+ runs?: {
895
+ pricing?: {
896
+ code: string;
897
+ brackets: {
898
+ unitCost: number;
899
+ upto?: number | undefined;
900
+ }[];
901
+ } | undefined;
902
+ freeAllowance?: number | undefined;
903
+ } | undefined;
904
+ }, {
905
+ code: string;
906
+ title: string;
907
+ concurrentRuns?: {
908
+ pricing?: {
909
+ tiers: {
910
+ code: string;
911
+ upto: number;
912
+ tierCost: number;
913
+ }[];
914
+ } | undefined;
915
+ freeAllowance?: number | undefined;
916
+ } | undefined;
917
+ runs?: {
918
+ pricing?: {
919
+ code: string;
920
+ brackets: {
921
+ unitCost: number;
922
+ upto?: number | undefined;
923
+ }[];
924
+ } | undefined;
925
+ freeAllowance?: number | undefined;
926
+ } | undefined;
927
+ }>;
928
+ paid: z.ZodObject<{
929
+ title: z.ZodString;
930
+ code: z.ZodString;
931
+ concurrentRuns: z.ZodOptional<z.ZodObject<{
932
+ pricing: z.ZodOptional<z.ZodObject<{
933
+ tiers: z.ZodArray<z.ZodObject<{
934
+ code: z.ZodString;
935
+ upto: z.ZodNumber;
936
+ tierCost: z.ZodNumber;
937
+ }, "strip", z.ZodTypeAny, {
938
+ code: string;
939
+ upto: number;
940
+ tierCost: number;
941
+ }, {
942
+ code: string;
943
+ upto: number;
944
+ tierCost: number;
945
+ }>, "many">;
946
+ }, "strip", z.ZodTypeAny, {
947
+ tiers: {
948
+ code: string;
949
+ upto: number;
950
+ tierCost: number;
951
+ }[];
952
+ }, {
953
+ tiers: {
954
+ code: string;
955
+ upto: number;
956
+ tierCost: number;
957
+ }[];
958
+ }>>;
959
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
960
+ }, "strip", z.ZodTypeAny, {
961
+ pricing?: {
962
+ tiers: {
963
+ code: string;
964
+ upto: number;
965
+ tierCost: number;
966
+ }[];
967
+ } | undefined;
968
+ freeAllowance?: number | undefined;
969
+ }, {
970
+ pricing?: {
971
+ tiers: {
972
+ code: string;
973
+ upto: number;
974
+ tierCost: number;
975
+ }[];
976
+ } | undefined;
977
+ freeAllowance?: number | undefined;
978
+ }>>;
979
+ runs: z.ZodOptional<z.ZodObject<{
980
+ pricing: z.ZodOptional<z.ZodObject<{
981
+ code: z.ZodString;
982
+ brackets: z.ZodArray<z.ZodObject<{
983
+ upto: z.ZodOptional<z.ZodNumber>;
984
+ unitCost: z.ZodNumber;
985
+ }, "strip", z.ZodTypeAny, {
986
+ unitCost: number;
987
+ upto?: number | undefined;
988
+ }, {
989
+ unitCost: number;
990
+ upto?: number | undefined;
991
+ }>, "many">;
992
+ }, "strip", z.ZodTypeAny, {
993
+ code: string;
994
+ brackets: {
995
+ unitCost: number;
996
+ upto?: number | undefined;
997
+ }[];
998
+ }, {
999
+ code: string;
1000
+ brackets: {
1001
+ unitCost: number;
1002
+ upto?: number | undefined;
1003
+ }[];
1004
+ }>>;
1005
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
1006
+ }, "strip", z.ZodTypeAny, {
1007
+ pricing?: {
1008
+ code: string;
1009
+ brackets: {
1010
+ unitCost: number;
1011
+ upto?: number | undefined;
1012
+ }[];
1013
+ } | undefined;
1014
+ freeAllowance?: number | undefined;
1015
+ }, {
1016
+ pricing?: {
1017
+ code: string;
1018
+ brackets: {
1019
+ unitCost: number;
1020
+ upto?: number | undefined;
1021
+ }[];
1022
+ } | undefined;
1023
+ freeAllowance?: number | undefined;
1024
+ }>>;
1025
+ }, "strip", z.ZodTypeAny, {
1026
+ code: string;
1027
+ title: string;
1028
+ concurrentRuns?: {
1029
+ pricing?: {
1030
+ tiers: {
1031
+ code: string;
1032
+ upto: number;
1033
+ tierCost: number;
1034
+ }[];
1035
+ } | undefined;
1036
+ freeAllowance?: number | undefined;
1037
+ } | undefined;
1038
+ runs?: {
1039
+ pricing?: {
1040
+ code: string;
1041
+ brackets: {
1042
+ unitCost: number;
1043
+ upto?: number | undefined;
1044
+ }[];
1045
+ } | undefined;
1046
+ freeAllowance?: number | undefined;
1047
+ } | undefined;
1048
+ }, {
1049
+ code: string;
1050
+ title: string;
1051
+ concurrentRuns?: {
1052
+ pricing?: {
1053
+ tiers: {
1054
+ code: string;
1055
+ upto: number;
1056
+ tierCost: number;
1057
+ }[];
1058
+ } | undefined;
1059
+ freeAllowance?: number | undefined;
1060
+ } | undefined;
1061
+ runs?: {
1062
+ pricing?: {
1063
+ code: string;
1064
+ brackets: {
1065
+ unitCost: number;
1066
+ upto?: number | undefined;
1067
+ }[];
1068
+ } | undefined;
1069
+ freeAllowance?: number | undefined;
1070
+ } | undefined;
1071
+ }>;
1072
+ enterprise: z.ZodObject<{
1073
+ title: z.ZodString;
1074
+ code: z.ZodString;
1075
+ concurrentRuns: z.ZodOptional<z.ZodObject<{
1076
+ pricing: z.ZodOptional<z.ZodObject<{
1077
+ tiers: z.ZodArray<z.ZodObject<{
1078
+ code: z.ZodString;
1079
+ upto: z.ZodNumber;
1080
+ tierCost: z.ZodNumber;
1081
+ }, "strip", z.ZodTypeAny, {
1082
+ code: string;
1083
+ upto: number;
1084
+ tierCost: number;
1085
+ }, {
1086
+ code: string;
1087
+ upto: number;
1088
+ tierCost: number;
1089
+ }>, "many">;
1090
+ }, "strip", z.ZodTypeAny, {
1091
+ tiers: {
1092
+ code: string;
1093
+ upto: number;
1094
+ tierCost: number;
1095
+ }[];
1096
+ }, {
1097
+ tiers: {
1098
+ code: string;
1099
+ upto: number;
1100
+ tierCost: number;
1101
+ }[];
1102
+ }>>;
1103
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
1104
+ }, "strip", z.ZodTypeAny, {
1105
+ pricing?: {
1106
+ tiers: {
1107
+ code: string;
1108
+ upto: number;
1109
+ tierCost: number;
1110
+ }[];
1111
+ } | undefined;
1112
+ freeAllowance?: number | undefined;
1113
+ }, {
1114
+ pricing?: {
1115
+ tiers: {
1116
+ code: string;
1117
+ upto: number;
1118
+ tierCost: number;
1119
+ }[];
1120
+ } | undefined;
1121
+ freeAllowance?: number | undefined;
1122
+ }>>;
1123
+ runs: z.ZodOptional<z.ZodObject<{
1124
+ pricing: z.ZodOptional<z.ZodObject<{
1125
+ code: z.ZodString;
1126
+ brackets: z.ZodArray<z.ZodObject<{
1127
+ upto: z.ZodOptional<z.ZodNumber>;
1128
+ unitCost: z.ZodNumber;
1129
+ }, "strip", z.ZodTypeAny, {
1130
+ unitCost: number;
1131
+ upto?: number | undefined;
1132
+ }, {
1133
+ unitCost: number;
1134
+ upto?: number | undefined;
1135
+ }>, "many">;
1136
+ }, "strip", z.ZodTypeAny, {
1137
+ code: string;
1138
+ brackets: {
1139
+ unitCost: number;
1140
+ upto?: number | undefined;
1141
+ }[];
1142
+ }, {
1143
+ code: string;
1144
+ brackets: {
1145
+ unitCost: number;
1146
+ upto?: number | undefined;
1147
+ }[];
1148
+ }>>;
1149
+ freeAllowance: z.ZodOptional<z.ZodNumber>;
1150
+ }, "strip", z.ZodTypeAny, {
1151
+ pricing?: {
1152
+ code: string;
1153
+ brackets: {
1154
+ unitCost: number;
1155
+ upto?: number | undefined;
1156
+ }[];
1157
+ } | undefined;
1158
+ freeAllowance?: number | undefined;
1159
+ }, {
1160
+ pricing?: {
1161
+ code: string;
1162
+ brackets: {
1163
+ unitCost: number;
1164
+ upto?: number | undefined;
1165
+ }[];
1166
+ } | undefined;
1167
+ freeAllowance?: number | undefined;
1168
+ }>>;
1169
+ }, "strip", z.ZodTypeAny, {
1170
+ code: string;
1171
+ title: string;
1172
+ concurrentRuns?: {
1173
+ pricing?: {
1174
+ tiers: {
1175
+ code: string;
1176
+ upto: number;
1177
+ tierCost: number;
1178
+ }[];
1179
+ } | undefined;
1180
+ freeAllowance?: number | undefined;
1181
+ } | undefined;
1182
+ runs?: {
1183
+ pricing?: {
1184
+ code: string;
1185
+ brackets: {
1186
+ unitCost: number;
1187
+ upto?: number | undefined;
1188
+ }[];
1189
+ } | undefined;
1190
+ freeAllowance?: number | undefined;
1191
+ } | undefined;
1192
+ }, {
1193
+ code: string;
1194
+ title: string;
1195
+ concurrentRuns?: {
1196
+ pricing?: {
1197
+ tiers: {
1198
+ code: string;
1199
+ upto: number;
1200
+ tierCost: number;
1201
+ }[];
1202
+ } | undefined;
1203
+ freeAllowance?: number | undefined;
1204
+ } | undefined;
1205
+ runs?: {
1206
+ pricing?: {
1207
+ code: string;
1208
+ brackets: {
1209
+ unitCost: number;
1210
+ upto?: number | undefined;
1211
+ }[];
1212
+ } | undefined;
1213
+ freeAllowance?: number | undefined;
1214
+ } | undefined;
1215
+ }>;
1216
+ }, "strip", z.ZodTypeAny, {
1217
+ paid: {
1218
+ code: string;
1219
+ title: string;
1220
+ concurrentRuns?: {
1221
+ pricing?: {
1222
+ tiers: {
1223
+ code: string;
1224
+ upto: number;
1225
+ tierCost: number;
1226
+ }[];
1227
+ } | undefined;
1228
+ freeAllowance?: number | undefined;
1229
+ } | undefined;
1230
+ runs?: {
1231
+ pricing?: {
1232
+ code: string;
1233
+ brackets: {
1234
+ unitCost: number;
1235
+ upto?: number | undefined;
1236
+ }[];
1237
+ } | undefined;
1238
+ freeAllowance?: number | undefined;
1239
+ } | undefined;
1240
+ };
1241
+ free: {
1242
+ code: string;
1243
+ title: string;
1244
+ concurrentRuns?: {
1245
+ pricing?: {
1246
+ tiers: {
1247
+ code: string;
1248
+ upto: number;
1249
+ tierCost: number;
1250
+ }[];
1251
+ } | undefined;
1252
+ freeAllowance?: number | undefined;
1253
+ } | undefined;
1254
+ runs?: {
1255
+ pricing?: {
1256
+ code: string;
1257
+ brackets: {
1258
+ unitCost: number;
1259
+ upto?: number | undefined;
1260
+ }[];
1261
+ } | undefined;
1262
+ freeAllowance?: number | undefined;
1263
+ } | undefined;
1264
+ };
1265
+ enterprise: {
1266
+ code: string;
1267
+ title: string;
1268
+ concurrentRuns?: {
1269
+ pricing?: {
1270
+ tiers: {
1271
+ code: string;
1272
+ upto: number;
1273
+ tierCost: number;
1274
+ }[];
1275
+ } | undefined;
1276
+ freeAllowance?: number | undefined;
1277
+ } | undefined;
1278
+ runs?: {
1279
+ pricing?: {
1280
+ code: string;
1281
+ brackets: {
1282
+ unitCost: number;
1283
+ upto?: number | undefined;
1284
+ }[];
1285
+ } | undefined;
1286
+ freeAllowance?: number | undefined;
1287
+ } | undefined;
1288
+ };
1289
+ }, {
1290
+ paid: {
1291
+ code: string;
1292
+ title: string;
1293
+ concurrentRuns?: {
1294
+ pricing?: {
1295
+ tiers: {
1296
+ code: string;
1297
+ upto: number;
1298
+ tierCost: number;
1299
+ }[];
1300
+ } | undefined;
1301
+ freeAllowance?: number | undefined;
1302
+ } | undefined;
1303
+ runs?: {
1304
+ pricing?: {
1305
+ code: string;
1306
+ brackets: {
1307
+ unitCost: number;
1308
+ upto?: number | undefined;
1309
+ }[];
1310
+ } | undefined;
1311
+ freeAllowance?: number | undefined;
1312
+ } | undefined;
1313
+ };
1314
+ free: {
1315
+ code: string;
1316
+ title: string;
1317
+ concurrentRuns?: {
1318
+ pricing?: {
1319
+ tiers: {
1320
+ code: string;
1321
+ upto: number;
1322
+ tierCost: number;
1323
+ }[];
1324
+ } | undefined;
1325
+ freeAllowance?: number | undefined;
1326
+ } | undefined;
1327
+ runs?: {
1328
+ pricing?: {
1329
+ code: string;
1330
+ brackets: {
1331
+ unitCost: number;
1332
+ upto?: number | undefined;
1333
+ }[];
1334
+ } | undefined;
1335
+ freeAllowance?: number | undefined;
1336
+ } | undefined;
1337
+ };
1338
+ enterprise: {
1339
+ code: string;
1340
+ title: string;
1341
+ concurrentRuns?: {
1342
+ pricing?: {
1343
+ tiers: {
1344
+ code: string;
1345
+ upto: number;
1346
+ tierCost: number;
1347
+ }[];
1348
+ } | undefined;
1349
+ freeAllowance?: number | undefined;
1350
+ } | undefined;
1351
+ runs?: {
1352
+ pricing?: {
1353
+ code: string;
1354
+ brackets: {
1355
+ unitCost: number;
1356
+ upto?: number | undefined;
1357
+ }[];
1358
+ } | undefined;
1359
+ freeAllowance?: number | undefined;
1360
+ } | undefined;
1361
+ };
1362
+ }>;
1363
+ type Plans = z.infer<typeof PlansSchema>;
1364
+
1365
+ declare const UpdatedSubscriptionResultSchema: z.ZodObject<{
1366
+ action: z.ZodLiteral<"updated_subscription">;
1367
+ subscription: z.ZodObject<{
1368
+ planCode: z.ZodString;
1369
+ concurrentRunBracket: z.ZodString;
1370
+ }, "strip", z.ZodTypeAny, {
1371
+ planCode: string;
1372
+ concurrentRunBracket: string;
1373
+ }, {
1374
+ planCode: string;
1375
+ concurrentRunBracket: string;
1376
+ }>;
1377
+ }, "strip", z.ZodTypeAny, {
1378
+ subscription: {
1379
+ planCode: string;
1380
+ concurrentRunBracket: string;
1381
+ };
1382
+ action: "updated_subscription";
1383
+ }, {
1384
+ subscription: {
1385
+ planCode: string;
1386
+ concurrentRunBracket: string;
1387
+ };
1388
+ action: "updated_subscription";
1389
+ }>;
1390
+ type UpdatedSubscriptionResult = z.infer<typeof UpdatedSubscriptionResultSchema>;
1391
+ declare const CreateSubscriptionFlowStartSchema: z.ZodObject<{
1392
+ action: z.ZodLiteral<"create_subscription_flow_start">;
1393
+ subscription: z.ZodObject<{
1394
+ planCode: z.ZodString;
1395
+ concurrentRunBracket: z.ZodString;
1396
+ }, "strip", z.ZodTypeAny, {
1397
+ planCode: string;
1398
+ concurrentRunBracket: string;
1399
+ }, {
1400
+ planCode: string;
1401
+ concurrentRunBracket: string;
1402
+ }>;
1403
+ checkoutUrl: z.ZodString;
1404
+ }, "strip", z.ZodTypeAny, {
1405
+ subscription: {
1406
+ planCode: string;
1407
+ concurrentRunBracket: string;
1408
+ };
1409
+ action: "create_subscription_flow_start";
1410
+ checkoutUrl: string;
1411
+ }, {
1412
+ subscription: {
1413
+ planCode: string;
1414
+ concurrentRunBracket: string;
1415
+ };
1416
+ action: "create_subscription_flow_start";
1417
+ checkoutUrl: string;
1418
+ }>;
1419
+ type CreateSubscriptionFlowStart = z.infer<typeof CreateSubscriptionFlowStartSchema>;
1420
+ declare const CanceledSubscriptionResultSchema: z.ZodObject<{
1421
+ action: z.ZodLiteral<"canceled_subscription">;
1422
+ }, "strip", z.ZodTypeAny, {
1423
+ action: "canceled_subscription";
1424
+ }, {
1425
+ action: "canceled_subscription";
1426
+ }>;
1427
+ type CanceledSubscriptionResult = z.infer<typeof CanceledSubscriptionResultSchema>;
1428
+ declare const SubscribeResultSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
1429
+ action: z.ZodLiteral<"create_subscription_flow_start">;
1430
+ subscription: z.ZodObject<{
1431
+ planCode: z.ZodString;
1432
+ concurrentRunBracket: z.ZodString;
1433
+ }, "strip", z.ZodTypeAny, {
1434
+ planCode: string;
1435
+ concurrentRunBracket: string;
1436
+ }, {
1437
+ planCode: string;
1438
+ concurrentRunBracket: string;
1439
+ }>;
1440
+ checkoutUrl: z.ZodString;
1441
+ }, "strip", z.ZodTypeAny, {
1442
+ subscription: {
1443
+ planCode: string;
1444
+ concurrentRunBracket: string;
1445
+ };
1446
+ action: "create_subscription_flow_start";
1447
+ checkoutUrl: string;
1448
+ }, {
1449
+ subscription: {
1450
+ planCode: string;
1451
+ concurrentRunBracket: string;
1452
+ };
1453
+ action: "create_subscription_flow_start";
1454
+ checkoutUrl: string;
1455
+ }>, z.ZodObject<{
1456
+ action: z.ZodLiteral<"updated_subscription">;
1457
+ subscription: z.ZodObject<{
1458
+ planCode: z.ZodString;
1459
+ concurrentRunBracket: z.ZodString;
1460
+ }, "strip", z.ZodTypeAny, {
1461
+ planCode: string;
1462
+ concurrentRunBracket: string;
1463
+ }, {
1464
+ planCode: string;
1465
+ concurrentRunBracket: string;
1466
+ }>;
1467
+ }, "strip", z.ZodTypeAny, {
1468
+ subscription: {
1469
+ planCode: string;
1470
+ concurrentRunBracket: string;
1471
+ };
1472
+ action: "updated_subscription";
1473
+ }, {
1474
+ subscription: {
1475
+ planCode: string;
1476
+ concurrentRunBracket: string;
1477
+ };
1478
+ action: "updated_subscription";
1479
+ }>, z.ZodObject<{
1480
+ action: z.ZodLiteral<"canceled_subscription">;
1481
+ }, "strip", z.ZodTypeAny, {
1482
+ action: "canceled_subscription";
1483
+ }, {
1484
+ action: "canceled_subscription";
1485
+ }>]>;
1486
+ type SubscribeResult = z.infer<typeof SubscribeResultSchema>;
1487
+
1488
+ declare const CustomerPortalRequestBodySchema: z.ZodObject<{
1489
+ returnUrl: z.ZodString;
1490
+ }, "strip", z.ZodTypeAny, {
1491
+ returnUrl: string;
1492
+ }, {
1493
+ returnUrl: string;
1494
+ }>;
1495
+ type CustomerPortalRequestBody = z.infer<typeof CustomerPortalRequestBodySchema>;
1496
+ declare const CustomerPortalSchema: z.ZodObject<{
1497
+ customerPortalUrl: z.ZodOptional<z.ZodString>;
1498
+ }, "strip", z.ZodTypeAny, {
1499
+ customerPortalUrl?: string | undefined;
1500
+ }, {
1501
+ customerPortalUrl?: string | undefined;
1502
+ }>;
1503
+ type CustomerPortal = z.infer<typeof CustomerPortalSchema>;
1504
+
1505
+ declare const ErrorSchema: z.ZodObject<{
1506
+ error: z.ZodString;
1507
+ }, "strip", z.ZodTypeAny, {
1508
+ error: string;
1509
+ }, {
1510
+ error: string;
1511
+ }>;
1512
+ type Error = z.infer<typeof ErrorSchema>;
1513
+
1514
+ type PlanCostResult = {
1515
+ runsCost: number;
1516
+ concurrentRunCost: number;
1517
+ total: number;
1518
+ };
1519
+
1520
+ type EstimateResult = {
1521
+ plan: {
1522
+ code: string;
1523
+ };
1524
+ cost: PlanCostResult;
1525
+ };
1526
+ declare function estimate({ usage, plans, }: {
1527
+ usage: Record<string, number>;
1528
+ plans: Plan[];
1529
+ }): EstimateResult | undefined;
1530
+
1531
+ type BillingClientConfig = {
1532
+ url: string;
1533
+ apiKey: string;
1534
+ };
1535
+ type SuccessResult<TSchema extends ZodType> = {
1536
+ success: true;
1537
+ } & z.infer<TSchema>;
1538
+ type ErrorResult = {
1539
+ success: false;
1540
+ error: string;
1541
+ };
1542
+ type Result<TSchema extends ZodType> = SuccessResult<TSchema> | ErrorResult;
1543
+ type PlansResponse = Result<typeof PlansSchema>;
1544
+ type CurrentPlanResponse = Result<typeof CurrentPlanSchema>;
1545
+ type SetPlanResponse = Result<typeof SubscribeResultSchema>;
1546
+ type CustomerPortalResponse = Result<typeof CustomerPortalSchema>;
1547
+ declare class BillingClient {
1548
+ private readonly config;
1549
+ constructor(config: BillingClientConfig);
1550
+ plans(): Promise<PlansResponse>;
1551
+ currentPlan(orgId: string): Promise<CurrentPlanResponse>;
1552
+ setPlan(orgId: string, body: SetPlanBody): Promise<SetPlanResponse>;
1553
+ createPortalSession(orgId: string, body: CustomerPortalRequestBody): Promise<CustomerPortalResponse>;
1554
+ fetch<TSchema extends ZodType = z.ZodTypeAny>(path: string, schema: TSchema, requestInit?: RequestInit): Promise<Result<TSchema>>;
1555
+ }
1556
+
1557
+ export { type ActiveSubscription, ActiveSubscriptionSchema, BillingClient, BracketSchema, type CanceledSubscriptionResult, type CreateSubscriptionFlowStart, type CurrentPlan, type CurrentPlanResponse, CurrentPlanSchema, type CustomerPortal, type CustomerPortalRequestBody, CustomerPortalRequestBodySchema, type CustomerPortalResponse, CustomerPortalSchema, type Error, ErrorSchema, type Plan, type PlanDefinition, PlanDefinitionSchema, PlanSchema, type Plans, type PlansResponse, PlansSchema, type PricedMetric, PricedMetricSchema, type RunPriceBracket, RunPricingSchema, type SetPlanBody, SetPlanBodySchema, type SetPlanResponse, type SubscribeResult, SubscribeResultSchema, type UpdatedSubscriptionResult, estimate };