@trigger.dev/platform 1.0.29 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -13821,6 +13821,8 @@ declare const ReportUsageResult: z.ZodObject<{
13821
13821
  type: string;
13822
13822
  isPaying: boolean;
13823
13823
  }>>;
13824
+ limitState: z.ZodOptional<z.ZodLiteral<"grace">>;
13825
+ reason: z.ZodOptional<z.ZodEnum<["free_tier_exceeded", "billing_limit"]>>;
13824
13826
  }, "strip", z.ZodTypeAny, {
13825
13827
  hasAccess: boolean;
13826
13828
  plan?: {
@@ -13831,6 +13833,8 @@ declare const ReportUsageResult: z.ZodObject<{
13831
13833
  balance?: number | undefined;
13832
13834
  usage?: number | undefined;
13833
13835
  overage?: number | undefined;
13836
+ limitState?: "grace" | undefined;
13837
+ reason?: "free_tier_exceeded" | "billing_limit" | undefined;
13834
13838
  }, {
13835
13839
  hasAccess: boolean;
13836
13840
  plan?: {
@@ -13841,8 +13845,12 @@ declare const ReportUsageResult: z.ZodObject<{
13841
13845
  balance?: number | undefined;
13842
13846
  usage?: number | undefined;
13843
13847
  overage?: number | undefined;
13848
+ limitState?: "grace" | undefined;
13849
+ reason?: "free_tier_exceeded" | "billing_limit" | undefined;
13844
13850
  }>;
13845
13851
  type ReportUsageResult = z.infer<typeof ReportUsageResult>;
13852
+ /** Upper bound for a single invocation base charge ($100). */
13853
+ declare const MAX_INVOCATION_COST_IN_CENTS = 10000;
13846
13854
  declare const ReportInvocationUsageEvent: z.ZodObject<{
13847
13855
  organizationId: z.ZodString;
13848
13856
  costInCents: z.ZodNumber;
@@ -13903,6 +13911,624 @@ declare const UpdateBillingAlertsRequest: z.ZodObject<{
13903
13911
  }>;
13904
13912
  type UpdateBillingAlertsRequest = z.infer<typeof UpdateBillingAlertsRequest>;
13905
13913
 
13914
+ declare const BillingLimitState: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
13915
+ status: z.ZodLiteral<"ok">;
13916
+ }, "strip", z.ZodTypeAny, {
13917
+ status: "ok";
13918
+ }, {
13919
+ status: "ok";
13920
+ }>, z.ZodObject<{
13921
+ status: z.ZodLiteral<"grace">;
13922
+ hitAt: z.ZodString;
13923
+ graceEndsAt: z.ZodString;
13924
+ }, "strip", z.ZodTypeAny, {
13925
+ status: "grace";
13926
+ hitAt: string;
13927
+ graceEndsAt: string;
13928
+ }, {
13929
+ status: "grace";
13930
+ hitAt: string;
13931
+ graceEndsAt: string;
13932
+ }>, z.ZodObject<{
13933
+ status: z.ZodLiteral<"rejected">;
13934
+ hitAt: z.ZodString;
13935
+ graceEndsAt: z.ZodString;
13936
+ }, "strip", z.ZodTypeAny, {
13937
+ status: "rejected";
13938
+ hitAt: string;
13939
+ graceEndsAt: string;
13940
+ }, {
13941
+ status: "rejected";
13942
+ hitAt: string;
13943
+ graceEndsAt: string;
13944
+ }>]>;
13945
+ type BillingLimitState = z.infer<typeof BillingLimitState>;
13946
+ declare const BillingLimitUnconfigured: z.ZodObject<{
13947
+ isConfigured: z.ZodLiteral<false>;
13948
+ gracePeriodMs: z.ZodNumber;
13949
+ }, "strip", z.ZodTypeAny, {
13950
+ isConfigured: false;
13951
+ gracePeriodMs: number;
13952
+ }, {
13953
+ isConfigured: false;
13954
+ gracePeriodMs: number;
13955
+ }>;
13956
+ declare const BillingLimitConfiguredNone: z.ZodObject<{
13957
+ mode: z.ZodLiteral<"none">;
13958
+ isConfigured: z.ZodLiteral<true>;
13959
+ cancelInProgressRuns: z.ZodBoolean;
13960
+ limitState: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
13961
+ status: z.ZodLiteral<"ok">;
13962
+ }, "strip", z.ZodTypeAny, {
13963
+ status: "ok";
13964
+ }, {
13965
+ status: "ok";
13966
+ }>, z.ZodObject<{
13967
+ status: z.ZodLiteral<"grace">;
13968
+ hitAt: z.ZodString;
13969
+ graceEndsAt: z.ZodString;
13970
+ }, "strip", z.ZodTypeAny, {
13971
+ status: "grace";
13972
+ hitAt: string;
13973
+ graceEndsAt: string;
13974
+ }, {
13975
+ status: "grace";
13976
+ hitAt: string;
13977
+ graceEndsAt: string;
13978
+ }>, z.ZodObject<{
13979
+ status: z.ZodLiteral<"rejected">;
13980
+ hitAt: z.ZodString;
13981
+ graceEndsAt: z.ZodString;
13982
+ }, "strip", z.ZodTypeAny, {
13983
+ status: "rejected";
13984
+ hitAt: string;
13985
+ graceEndsAt: string;
13986
+ }, {
13987
+ status: "rejected";
13988
+ hitAt: string;
13989
+ graceEndsAt: string;
13990
+ }>]>;
13991
+ effectiveAmountCents: z.ZodNullable<z.ZodNumber>;
13992
+ gracePeriodMs: z.ZodNumber;
13993
+ }, "strip", z.ZodTypeAny, {
13994
+ limitState: {
13995
+ status: "ok";
13996
+ } | {
13997
+ status: "grace";
13998
+ hitAt: string;
13999
+ graceEndsAt: string;
14000
+ } | {
14001
+ status: "rejected";
14002
+ hitAt: string;
14003
+ graceEndsAt: string;
14004
+ };
14005
+ isConfigured: true;
14006
+ gracePeriodMs: number;
14007
+ mode: "none";
14008
+ cancelInProgressRuns: boolean;
14009
+ effectiveAmountCents: number | null;
14010
+ }, {
14011
+ limitState: {
14012
+ status: "ok";
14013
+ } | {
14014
+ status: "grace";
14015
+ hitAt: string;
14016
+ graceEndsAt: string;
14017
+ } | {
14018
+ status: "rejected";
14019
+ hitAt: string;
14020
+ graceEndsAt: string;
14021
+ };
14022
+ isConfigured: true;
14023
+ gracePeriodMs: number;
14024
+ mode: "none";
14025
+ cancelInProgressRuns: boolean;
14026
+ effectiveAmountCents: number | null;
14027
+ }>;
14028
+ declare const BillingLimitConfiguredPlan: z.ZodObject<{
14029
+ mode: z.ZodLiteral<"plan">;
14030
+ isConfigured: z.ZodLiteral<true>;
14031
+ cancelInProgressRuns: z.ZodBoolean;
14032
+ limitState: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
14033
+ status: z.ZodLiteral<"ok">;
14034
+ }, "strip", z.ZodTypeAny, {
14035
+ status: "ok";
14036
+ }, {
14037
+ status: "ok";
14038
+ }>, z.ZodObject<{
14039
+ status: z.ZodLiteral<"grace">;
14040
+ hitAt: z.ZodString;
14041
+ graceEndsAt: z.ZodString;
14042
+ }, "strip", z.ZodTypeAny, {
14043
+ status: "grace";
14044
+ hitAt: string;
14045
+ graceEndsAt: string;
14046
+ }, {
14047
+ status: "grace";
14048
+ hitAt: string;
14049
+ graceEndsAt: string;
14050
+ }>, z.ZodObject<{
14051
+ status: z.ZodLiteral<"rejected">;
14052
+ hitAt: z.ZodString;
14053
+ graceEndsAt: z.ZodString;
14054
+ }, "strip", z.ZodTypeAny, {
14055
+ status: "rejected";
14056
+ hitAt: string;
14057
+ graceEndsAt: string;
14058
+ }, {
14059
+ status: "rejected";
14060
+ hitAt: string;
14061
+ graceEndsAt: string;
14062
+ }>]>;
14063
+ effectiveAmountCents: z.ZodNullable<z.ZodNumber>;
14064
+ gracePeriodMs: z.ZodNumber;
14065
+ }, "strip", z.ZodTypeAny, {
14066
+ limitState: {
14067
+ status: "ok";
14068
+ } | {
14069
+ status: "grace";
14070
+ hitAt: string;
14071
+ graceEndsAt: string;
14072
+ } | {
14073
+ status: "rejected";
14074
+ hitAt: string;
14075
+ graceEndsAt: string;
14076
+ };
14077
+ isConfigured: true;
14078
+ gracePeriodMs: number;
14079
+ mode: "plan";
14080
+ cancelInProgressRuns: boolean;
14081
+ effectiveAmountCents: number | null;
14082
+ }, {
14083
+ limitState: {
14084
+ status: "ok";
14085
+ } | {
14086
+ status: "grace";
14087
+ hitAt: string;
14088
+ graceEndsAt: string;
14089
+ } | {
14090
+ status: "rejected";
14091
+ hitAt: string;
14092
+ graceEndsAt: string;
14093
+ };
14094
+ isConfigured: true;
14095
+ gracePeriodMs: number;
14096
+ mode: "plan";
14097
+ cancelInProgressRuns: boolean;
14098
+ effectiveAmountCents: number | null;
14099
+ }>;
14100
+ declare const BillingLimitConfiguredCustom: z.ZodObject<{
14101
+ mode: z.ZodLiteral<"custom">;
14102
+ amountCents: z.ZodNumber;
14103
+ isConfigured: z.ZodLiteral<true>;
14104
+ cancelInProgressRuns: z.ZodBoolean;
14105
+ limitState: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
14106
+ status: z.ZodLiteral<"ok">;
14107
+ }, "strip", z.ZodTypeAny, {
14108
+ status: "ok";
14109
+ }, {
14110
+ status: "ok";
14111
+ }>, z.ZodObject<{
14112
+ status: z.ZodLiteral<"grace">;
14113
+ hitAt: z.ZodString;
14114
+ graceEndsAt: z.ZodString;
14115
+ }, "strip", z.ZodTypeAny, {
14116
+ status: "grace";
14117
+ hitAt: string;
14118
+ graceEndsAt: string;
14119
+ }, {
14120
+ status: "grace";
14121
+ hitAt: string;
14122
+ graceEndsAt: string;
14123
+ }>, z.ZodObject<{
14124
+ status: z.ZodLiteral<"rejected">;
14125
+ hitAt: z.ZodString;
14126
+ graceEndsAt: z.ZodString;
14127
+ }, "strip", z.ZodTypeAny, {
14128
+ status: "rejected";
14129
+ hitAt: string;
14130
+ graceEndsAt: string;
14131
+ }, {
14132
+ status: "rejected";
14133
+ hitAt: string;
14134
+ graceEndsAt: string;
14135
+ }>]>;
14136
+ effectiveAmountCents: z.ZodNullable<z.ZodNumber>;
14137
+ gracePeriodMs: z.ZodNumber;
14138
+ }, "strip", z.ZodTypeAny, {
14139
+ limitState: {
14140
+ status: "ok";
14141
+ } | {
14142
+ status: "grace";
14143
+ hitAt: string;
14144
+ graceEndsAt: string;
14145
+ } | {
14146
+ status: "rejected";
14147
+ hitAt: string;
14148
+ graceEndsAt: string;
14149
+ };
14150
+ isConfigured: true;
14151
+ gracePeriodMs: number;
14152
+ mode: "custom";
14153
+ cancelInProgressRuns: boolean;
14154
+ effectiveAmountCents: number | null;
14155
+ amountCents: number;
14156
+ }, {
14157
+ limitState: {
14158
+ status: "ok";
14159
+ } | {
14160
+ status: "grace";
14161
+ hitAt: string;
14162
+ graceEndsAt: string;
14163
+ } | {
14164
+ status: "rejected";
14165
+ hitAt: string;
14166
+ graceEndsAt: string;
14167
+ };
14168
+ isConfigured: true;
14169
+ gracePeriodMs: number;
14170
+ mode: "custom";
14171
+ cancelInProgressRuns: boolean;
14172
+ effectiveAmountCents: number | null;
14173
+ amountCents: number;
14174
+ }>;
14175
+ declare const BillingLimitResult: z.ZodUnion<[z.ZodObject<{
14176
+ isConfigured: z.ZodLiteral<false>;
14177
+ gracePeriodMs: z.ZodNumber;
14178
+ }, "strip", z.ZodTypeAny, {
14179
+ isConfigured: false;
14180
+ gracePeriodMs: number;
14181
+ }, {
14182
+ isConfigured: false;
14183
+ gracePeriodMs: number;
14184
+ }>, z.ZodObject<{
14185
+ mode: z.ZodLiteral<"none">;
14186
+ isConfigured: z.ZodLiteral<true>;
14187
+ cancelInProgressRuns: z.ZodBoolean;
14188
+ limitState: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
14189
+ status: z.ZodLiteral<"ok">;
14190
+ }, "strip", z.ZodTypeAny, {
14191
+ status: "ok";
14192
+ }, {
14193
+ status: "ok";
14194
+ }>, z.ZodObject<{
14195
+ status: z.ZodLiteral<"grace">;
14196
+ hitAt: z.ZodString;
14197
+ graceEndsAt: z.ZodString;
14198
+ }, "strip", z.ZodTypeAny, {
14199
+ status: "grace";
14200
+ hitAt: string;
14201
+ graceEndsAt: string;
14202
+ }, {
14203
+ status: "grace";
14204
+ hitAt: string;
14205
+ graceEndsAt: string;
14206
+ }>, z.ZodObject<{
14207
+ status: z.ZodLiteral<"rejected">;
14208
+ hitAt: z.ZodString;
14209
+ graceEndsAt: z.ZodString;
14210
+ }, "strip", z.ZodTypeAny, {
14211
+ status: "rejected";
14212
+ hitAt: string;
14213
+ graceEndsAt: string;
14214
+ }, {
14215
+ status: "rejected";
14216
+ hitAt: string;
14217
+ graceEndsAt: string;
14218
+ }>]>;
14219
+ effectiveAmountCents: z.ZodNullable<z.ZodNumber>;
14220
+ gracePeriodMs: z.ZodNumber;
14221
+ }, "strip", z.ZodTypeAny, {
14222
+ limitState: {
14223
+ status: "ok";
14224
+ } | {
14225
+ status: "grace";
14226
+ hitAt: string;
14227
+ graceEndsAt: string;
14228
+ } | {
14229
+ status: "rejected";
14230
+ hitAt: string;
14231
+ graceEndsAt: string;
14232
+ };
14233
+ isConfigured: true;
14234
+ gracePeriodMs: number;
14235
+ mode: "none";
14236
+ cancelInProgressRuns: boolean;
14237
+ effectiveAmountCents: number | null;
14238
+ }, {
14239
+ limitState: {
14240
+ status: "ok";
14241
+ } | {
14242
+ status: "grace";
14243
+ hitAt: string;
14244
+ graceEndsAt: string;
14245
+ } | {
14246
+ status: "rejected";
14247
+ hitAt: string;
14248
+ graceEndsAt: string;
14249
+ };
14250
+ isConfigured: true;
14251
+ gracePeriodMs: number;
14252
+ mode: "none";
14253
+ cancelInProgressRuns: boolean;
14254
+ effectiveAmountCents: number | null;
14255
+ }>, z.ZodObject<{
14256
+ mode: z.ZodLiteral<"plan">;
14257
+ isConfigured: z.ZodLiteral<true>;
14258
+ cancelInProgressRuns: z.ZodBoolean;
14259
+ limitState: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
14260
+ status: z.ZodLiteral<"ok">;
14261
+ }, "strip", z.ZodTypeAny, {
14262
+ status: "ok";
14263
+ }, {
14264
+ status: "ok";
14265
+ }>, z.ZodObject<{
14266
+ status: z.ZodLiteral<"grace">;
14267
+ hitAt: z.ZodString;
14268
+ graceEndsAt: z.ZodString;
14269
+ }, "strip", z.ZodTypeAny, {
14270
+ status: "grace";
14271
+ hitAt: string;
14272
+ graceEndsAt: string;
14273
+ }, {
14274
+ status: "grace";
14275
+ hitAt: string;
14276
+ graceEndsAt: string;
14277
+ }>, z.ZodObject<{
14278
+ status: z.ZodLiteral<"rejected">;
14279
+ hitAt: z.ZodString;
14280
+ graceEndsAt: z.ZodString;
14281
+ }, "strip", z.ZodTypeAny, {
14282
+ status: "rejected";
14283
+ hitAt: string;
14284
+ graceEndsAt: string;
14285
+ }, {
14286
+ status: "rejected";
14287
+ hitAt: string;
14288
+ graceEndsAt: string;
14289
+ }>]>;
14290
+ effectiveAmountCents: z.ZodNullable<z.ZodNumber>;
14291
+ gracePeriodMs: z.ZodNumber;
14292
+ }, "strip", z.ZodTypeAny, {
14293
+ limitState: {
14294
+ status: "ok";
14295
+ } | {
14296
+ status: "grace";
14297
+ hitAt: string;
14298
+ graceEndsAt: string;
14299
+ } | {
14300
+ status: "rejected";
14301
+ hitAt: string;
14302
+ graceEndsAt: string;
14303
+ };
14304
+ isConfigured: true;
14305
+ gracePeriodMs: number;
14306
+ mode: "plan";
14307
+ cancelInProgressRuns: boolean;
14308
+ effectiveAmountCents: number | null;
14309
+ }, {
14310
+ limitState: {
14311
+ status: "ok";
14312
+ } | {
14313
+ status: "grace";
14314
+ hitAt: string;
14315
+ graceEndsAt: string;
14316
+ } | {
14317
+ status: "rejected";
14318
+ hitAt: string;
14319
+ graceEndsAt: string;
14320
+ };
14321
+ isConfigured: true;
14322
+ gracePeriodMs: number;
14323
+ mode: "plan";
14324
+ cancelInProgressRuns: boolean;
14325
+ effectiveAmountCents: number | null;
14326
+ }>, z.ZodObject<{
14327
+ mode: z.ZodLiteral<"custom">;
14328
+ amountCents: z.ZodNumber;
14329
+ isConfigured: z.ZodLiteral<true>;
14330
+ cancelInProgressRuns: z.ZodBoolean;
14331
+ limitState: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
14332
+ status: z.ZodLiteral<"ok">;
14333
+ }, "strip", z.ZodTypeAny, {
14334
+ status: "ok";
14335
+ }, {
14336
+ status: "ok";
14337
+ }>, z.ZodObject<{
14338
+ status: z.ZodLiteral<"grace">;
14339
+ hitAt: z.ZodString;
14340
+ graceEndsAt: z.ZodString;
14341
+ }, "strip", z.ZodTypeAny, {
14342
+ status: "grace";
14343
+ hitAt: string;
14344
+ graceEndsAt: string;
14345
+ }, {
14346
+ status: "grace";
14347
+ hitAt: string;
14348
+ graceEndsAt: string;
14349
+ }>, z.ZodObject<{
14350
+ status: z.ZodLiteral<"rejected">;
14351
+ hitAt: z.ZodString;
14352
+ graceEndsAt: z.ZodString;
14353
+ }, "strip", z.ZodTypeAny, {
14354
+ status: "rejected";
14355
+ hitAt: string;
14356
+ graceEndsAt: string;
14357
+ }, {
14358
+ status: "rejected";
14359
+ hitAt: string;
14360
+ graceEndsAt: string;
14361
+ }>]>;
14362
+ effectiveAmountCents: z.ZodNullable<z.ZodNumber>;
14363
+ gracePeriodMs: z.ZodNumber;
14364
+ }, "strip", z.ZodTypeAny, {
14365
+ limitState: {
14366
+ status: "ok";
14367
+ } | {
14368
+ status: "grace";
14369
+ hitAt: string;
14370
+ graceEndsAt: string;
14371
+ } | {
14372
+ status: "rejected";
14373
+ hitAt: string;
14374
+ graceEndsAt: string;
14375
+ };
14376
+ isConfigured: true;
14377
+ gracePeriodMs: number;
14378
+ mode: "custom";
14379
+ cancelInProgressRuns: boolean;
14380
+ effectiveAmountCents: number | null;
14381
+ amountCents: number;
14382
+ }, {
14383
+ limitState: {
14384
+ status: "ok";
14385
+ } | {
14386
+ status: "grace";
14387
+ hitAt: string;
14388
+ graceEndsAt: string;
14389
+ } | {
14390
+ status: "rejected";
14391
+ hitAt: string;
14392
+ graceEndsAt: string;
14393
+ };
14394
+ isConfigured: true;
14395
+ gracePeriodMs: number;
14396
+ mode: "custom";
14397
+ cancelInProgressRuns: boolean;
14398
+ effectiveAmountCents: number | null;
14399
+ amountCents: number;
14400
+ }>]>;
14401
+ type BillingLimitResult = z.infer<typeof BillingLimitResult>;
14402
+ declare const UpdateBillingLimitRequest: z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
14403
+ mode: z.ZodLiteral<"none">;
14404
+ cancelInProgressRuns: z.ZodBoolean;
14405
+ }, "strip", z.ZodTypeAny, {
14406
+ mode: "none";
14407
+ cancelInProgressRuns: boolean;
14408
+ }, {
14409
+ mode: "none";
14410
+ cancelInProgressRuns: boolean;
14411
+ }>, z.ZodObject<{
14412
+ mode: z.ZodLiteral<"plan">;
14413
+ cancelInProgressRuns: z.ZodBoolean;
14414
+ }, "strip", z.ZodTypeAny, {
14415
+ mode: "plan";
14416
+ cancelInProgressRuns: boolean;
14417
+ }, {
14418
+ mode: "plan";
14419
+ cancelInProgressRuns: boolean;
14420
+ }>, z.ZodObject<{
14421
+ mode: z.ZodLiteral<"custom">;
14422
+ amountCents: z.ZodNumber;
14423
+ cancelInProgressRuns: z.ZodBoolean;
14424
+ }, "strip", z.ZodTypeAny, {
14425
+ mode: "custom";
14426
+ cancelInProgressRuns: boolean;
14427
+ amountCents: number;
14428
+ }, {
14429
+ mode: "custom";
14430
+ cancelInProgressRuns: boolean;
14431
+ amountCents: number;
14432
+ }>]>;
14433
+ type UpdateBillingLimitRequest = z.infer<typeof UpdateBillingLimitRequest>;
14434
+ declare const ResolveBillingLimitRequest: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
14435
+ action: z.ZodLiteral<"increase">;
14436
+ newAmountCents: z.ZodNumber;
14437
+ resumeMode: z.ZodEnum<["queue", "new_only"]>;
14438
+ }, "strip", z.ZodTypeAny, {
14439
+ action: "increase";
14440
+ newAmountCents: number;
14441
+ resumeMode: "queue" | "new_only";
14442
+ }, {
14443
+ action: "increase";
14444
+ newAmountCents: number;
14445
+ resumeMode: "queue" | "new_only";
14446
+ }>, z.ZodObject<{
14447
+ action: z.ZodLiteral<"remove">;
14448
+ resumeMode: z.ZodEnum<["queue", "new_only"]>;
14449
+ }, "strip", z.ZodTypeAny, {
14450
+ action: "remove";
14451
+ resumeMode: "queue" | "new_only";
14452
+ }, {
14453
+ action: "remove";
14454
+ resumeMode: "queue" | "new_only";
14455
+ }>]>;
14456
+ type ResolveBillingLimitRequest = z.infer<typeof ResolveBillingLimitRequest>;
14457
+ declare const BillingLimitActiveOrg: z.ZodObject<{
14458
+ orgId: z.ZodString;
14459
+ limitState: z.ZodEnum<["grace", "rejected"]>;
14460
+ }, "strip", z.ZodTypeAny, {
14461
+ limitState: "rejected" | "grace";
14462
+ orgId: string;
14463
+ }, {
14464
+ limitState: "rejected" | "grace";
14465
+ orgId: string;
14466
+ }>;
14467
+ declare const BillingLimitsActiveResult: z.ZodObject<{
14468
+ orgs: z.ZodArray<z.ZodObject<{
14469
+ orgId: z.ZodString;
14470
+ limitState: z.ZodEnum<["grace", "rejected"]>;
14471
+ }, "strip", z.ZodTypeAny, {
14472
+ limitState: "rejected" | "grace";
14473
+ orgId: string;
14474
+ }, {
14475
+ limitState: "rejected" | "grace";
14476
+ orgId: string;
14477
+ }>, "many">;
14478
+ }, "strip", z.ZodTypeAny, {
14479
+ orgs: {
14480
+ limitState: "rejected" | "grace";
14481
+ orgId: string;
14482
+ }[];
14483
+ }, {
14484
+ orgs: {
14485
+ limitState: "rejected" | "grace";
14486
+ orgId: string;
14487
+ }[];
14488
+ }>;
14489
+ type BillingLimitsActiveResult = z.infer<typeof BillingLimitsActiveResult>;
14490
+ declare const BillingLimitPendingResolveOrg: z.ZodObject<{
14491
+ organizationId: z.ZodString;
14492
+ resumeMode: z.ZodEnum<["queue", "new_only"]>;
14493
+ resolvedAt: z.ZodString;
14494
+ }, "strip", z.ZodTypeAny, {
14495
+ organizationId: string;
14496
+ resumeMode: "queue" | "new_only";
14497
+ resolvedAt: string;
14498
+ }, {
14499
+ organizationId: string;
14500
+ resumeMode: "queue" | "new_only";
14501
+ resolvedAt: string;
14502
+ }>;
14503
+ declare const BillingLimitsPendingResolvesResult: z.ZodObject<{
14504
+ orgs: z.ZodArray<z.ZodObject<{
14505
+ organizationId: z.ZodString;
14506
+ resumeMode: z.ZodEnum<["queue", "new_only"]>;
14507
+ resolvedAt: z.ZodString;
14508
+ }, "strip", z.ZodTypeAny, {
14509
+ organizationId: string;
14510
+ resumeMode: "queue" | "new_only";
14511
+ resolvedAt: string;
14512
+ }, {
14513
+ organizationId: string;
14514
+ resumeMode: "queue" | "new_only";
14515
+ resolvedAt: string;
14516
+ }>, "many">;
14517
+ }, "strip", z.ZodTypeAny, {
14518
+ orgs: {
14519
+ organizationId: string;
14520
+ resumeMode: "queue" | "new_only";
14521
+ resolvedAt: string;
14522
+ }[];
14523
+ }, {
14524
+ orgs: {
14525
+ organizationId: string;
14526
+ resumeMode: "queue" | "new_only";
14527
+ resolvedAt: string;
14528
+ }[];
14529
+ }>;
14530
+ type BillingLimitsPendingResolvesResult = z.infer<typeof BillingLimitsPendingResolvesResult>;
14531
+
13906
14532
  declare const RegistryCredentialsResponseSchema: z.ZodObject<{
13907
14533
  username: z.ZodString;
13908
14534
  password: z.ZodString;
@@ -14134,6 +14760,85 @@ declare const PrivateLinkRegionsResult: z.ZodObject<{
14134
14760
  }>;
14135
14761
  type PrivateLinkRegionsResult = z.infer<typeof PrivateLinkRegionsResult>;
14136
14762
 
14763
+ declare const ValidatePromoCodeBodySchema: z.ZodObject<{
14764
+ code: z.ZodString;
14765
+ }, "strip", z.ZodTypeAny, {
14766
+ code: string;
14767
+ }, {
14768
+ code: string;
14769
+ }>;
14770
+ type ValidatePromoCodeBody = z.infer<typeof ValidatePromoCodeBodySchema>;
14771
+ declare const ValidatePromoCodeResult: z.ZodObject<{
14772
+ valid: z.ZodBoolean;
14773
+ amountInCents: z.ZodOptional<z.ZodNumber>;
14774
+ expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14775
+ }, "strip", z.ZodTypeAny, {
14776
+ valid: boolean;
14777
+ expiresAt?: string | null | undefined;
14778
+ amountInCents?: number | undefined;
14779
+ }, {
14780
+ valid: boolean;
14781
+ expiresAt?: string | null | undefined;
14782
+ amountInCents?: number | undefined;
14783
+ }>;
14784
+ type ValidatePromoCodeResultType = z.infer<typeof ValidatePromoCodeResult>;
14785
+ declare const ApplyPromoCodeBodySchema: z.ZodObject<{
14786
+ code: z.ZodString;
14787
+ userId: z.ZodString;
14788
+ }, "strip", z.ZodTypeAny, {
14789
+ code: string;
14790
+ userId: string;
14791
+ }, {
14792
+ code: string;
14793
+ userId: string;
14794
+ }>;
14795
+ type ApplyPromoCodeBody = z.infer<typeof ApplyPromoCodeBodySchema>;
14796
+ declare const ApplyPromoCodeResult: z.ZodObject<{
14797
+ applied: z.ZodBoolean;
14798
+ amountInCents: z.ZodOptional<z.ZodNumber>;
14799
+ expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14800
+ reason: z.ZodOptional<z.ZodString>;
14801
+ }, "strip", z.ZodTypeAny, {
14802
+ applied: boolean;
14803
+ reason?: string | undefined;
14804
+ expiresAt?: string | null | undefined;
14805
+ amountInCents?: number | undefined;
14806
+ }, {
14807
+ applied: boolean;
14808
+ reason?: string | undefined;
14809
+ expiresAt?: string | null | undefined;
14810
+ amountInCents?: number | undefined;
14811
+ }>;
14812
+ type ApplyPromoCodeResultType = z.infer<typeof ApplyPromoCodeResult>;
14813
+ declare const PromoCreditsResult: z.ZodObject<{
14814
+ promoCredits: z.ZodNullable<z.ZodObject<{
14815
+ grantedCents: z.ZodNumber;
14816
+ remainingCents: z.ZodNumber;
14817
+ expiresAt: z.ZodNullable<z.ZodString>;
14818
+ }, "strip", z.ZodTypeAny, {
14819
+ expiresAt: string | null;
14820
+ grantedCents: number;
14821
+ remainingCents: number;
14822
+ }, {
14823
+ expiresAt: string | null;
14824
+ grantedCents: number;
14825
+ remainingCents: number;
14826
+ }>>;
14827
+ }, "strip", z.ZodTypeAny, {
14828
+ promoCredits: {
14829
+ expiresAt: string | null;
14830
+ grantedCents: number;
14831
+ remainingCents: number;
14832
+ } | null;
14833
+ }, {
14834
+ promoCredits: {
14835
+ expiresAt: string | null;
14836
+ grantedCents: number;
14837
+ remainingCents: number;
14838
+ } | null;
14839
+ }>;
14840
+ type PromoCreditsResultType = z.infer<typeof PromoCreditsResult>;
14841
+
14137
14842
  type BillingClientConfig = {
14138
14843
  url: string;
14139
14844
  apiKey: string;
@@ -14157,6 +14862,8 @@ type UsageSeriesResponse = Result<typeof UsageSeriesResult>;
14157
14862
  type UsageInvocationReportResponse = Result<typeof ReportInvocationUsageResult>;
14158
14863
  type UsageEntitlementResponse = Result<typeof ReportUsageResult>;
14159
14864
  type BillingAlertsResponse = Result<typeof BillingAlertsResult>;
14865
+ type BillingLimitResponse = Result<typeof BillingLimitResult>;
14866
+ type BillingLimitsActiveResponse = Result<typeof BillingLimitsActiveResult>;
14160
14867
  type RegistryCredentialsResult = Result<typeof RegistryCredentialsResponseSchema>;
14161
14868
  type SetAddOnResponse = Result<typeof SetAddOnResult>;
14162
14869
  type EnqueueBuildResult = Result<typeof EnqueueBuildResponseSchema>;
@@ -14165,6 +14872,9 @@ type PrivateLinkConnectionResponse = Result<typeof PrivateLinkConnection>;
14165
14872
  type DeletePrivateLinkResponse = Result<typeof DeletePrivateLinkResult>;
14166
14873
  type PrivateLinkRegionsResponse = Result<typeof PrivateLinkRegionsResult>;
14167
14874
  type TriggerInitialDeploymentResult = Result<typeof TriggerInitialDeploymentResponseSchema>;
14875
+ type ValidatePromoCodeResponse = Result<typeof ValidatePromoCodeResult>;
14876
+ type ApplyPromoCodeResponse = Result<typeof ApplyPromoCodeResult>;
14877
+ type PromoCreditsResponse = Result<typeof PromoCreditsResult>;
14168
14878
  declare class BillingClient {
14169
14879
  private readonly config;
14170
14880
  constructor(config: BillingClientConfig);
@@ -14174,6 +14884,12 @@ declare class BillingClient {
14174
14884
  usageSeries(orgId: string, params: UsageSeriesParams): Promise<UsageSeriesResponse>;
14175
14885
  setPlan(orgId: string, body: SetPlanBody): Promise<SetPlanResponse>;
14176
14886
  setAddOn(orgId: string, body: SetAddOnBody): Promise<SetAddOnResponse>;
14887
+ validatePromoCode(code: string): Promise<ValidatePromoCodeResponse>;
14888
+ applyPromoCode(orgId: string, body: {
14889
+ code: string;
14890
+ userId: string;
14891
+ }): Promise<ApplyPromoCodeResponse>;
14892
+ promoCredits(orgId: string): Promise<PromoCreditsResponse>;
14177
14893
  createPortalSession(orgId: string, body: CustomerPortalRequestBody): Promise<CustomerPortalResponse>;
14178
14894
  /**
14179
14895
  *
@@ -14205,6 +14921,10 @@ declare class BillingClient {
14205
14921
  getEntitlement(orgId: string): Promise<UsageEntitlementResponse>;
14206
14922
  getBillingAlerts(orgId: string): Promise<BillingAlertsResponse>;
14207
14923
  updateBillingAlerts(orgId: string, body: UpdateBillingAlertsRequest): Promise<BillingAlertsResponse>;
14924
+ getBillingLimit(orgId: string): Promise<BillingLimitResponse>;
14925
+ updateBillingLimit(orgId: string, body: UpdateBillingLimitRequest): Promise<BillingLimitResponse>;
14926
+ resolveBillingLimit(orgId: string, body: ResolveBillingLimitRequest): Promise<BillingLimitResponse>;
14927
+ getActiveBillingLimits(): Promise<BillingLimitsActiveResponse>;
14208
14928
  getPrivateLinks(orgId: string): Promise<PrivateLinkConnectionListResponse>;
14209
14929
  createPrivateLink(orgId: string, body: CreatePrivateLinkConnectionBody): Promise<PrivateLinkConnectionResponse>;
14210
14930
  deletePrivateLink(orgId: string, connectionId: string): Promise<DeletePrivateLinkResponse>;
@@ -14278,4 +14998,4 @@ declare const machines: {
14278
14998
  type MachineCode = keyof typeof machines;
14279
14999
  declare const defaultMachine: MachineCode;
14280
15000
 
14281
- export { AddOn, AddOnDefinition, AddOnPricing, AddOns, BatchQueueConcurrencyConfig, BatchRateLimitConfig, type BillingAlertsResponse, BillingAlertsResult, BillingClient, type CanceledSubscriptionResult, CreatePrivateLinkConnectionBody, type CreateSubscriptionFlowStart, CurrentPlan, type CurrentPlanResponse, type CustomerPortal, type CustomerPortalRequestBody, CustomerPortalRequestBodySchema, type CustomerPortalResponse, CustomerPortalSchema, type DeletePrivateLinkResponse, DeletePrivateLinkResult, type EnqueueBuildRequest, EnqueueBuildRequestSchema, type EnqueueBuildResponse, EnqueueBuildResponseSchema, type EnqueueBuildResult, EnterprisePlanDefinition, EnvironmentBasedLimit, type Error, ErrorSchema, ExceedableLimit, type FreeConnectRequired, FreeConnectRequiredSchema, type FreeConnected, FreeConnectedSchema, FreePlanDefinition, FreeTierStatus, Limits, type MachineCode, MachineDefinition, type MachineDefinitionInput, PaidPlanDefinition, type PlanDefinition, PlanDefinitionSchema, Plans, type PlansResponse, PlansResult, PrivateLinkConnection, PrivateLinkConnectionList, type PrivateLinkConnectionListResponse, type PrivateLinkConnectionResponse, PrivateLinkConnectionStatus, type PrivateLinkRegionsResponse, PrivateLinkRegionsResult, QueueSizeLimits, type RegistryCredentialsResponse, RegistryCredentialsResponseSchema, type RegistryCredentialsResult, ReportComputeUsageEvent, ReportInvocationUsageEvent, ReportInvocationUsageResult, ReportUsagePlan, ReportUsageResult, SetAddOnBody, type SetAddOnResponse, SetAddOnResult, type SetPlanBody, SetPlanBodySchema, type SetPlanResponse, type SubscribeResult, SubscribeResultSchema, SubscriptionResult, type TriggerInitialDeploymentRequest, TriggerInitialDeploymentRequestSchema, type TriggerInitialDeploymentResponse, TriggerInitialDeploymentResponseSchema, type TriggerInitialDeploymentResult, UpdateBillingAlertsRequest, type UpdatedSubscriptionResult, type UsageEntitlementResponse, type UsageInvocationReportResponse, UsageParams, type UsageResponse, UsageResult, UsageSeriesParams, type UsageSeriesResponse, UsageSeriesResult, defaultMachine, machineDefinition, machines, objectToSearchParams };
15001
+ export { AddOn, AddOnDefinition, AddOnPricing, AddOns, type ApplyPromoCodeBody, ApplyPromoCodeBodySchema, type ApplyPromoCodeResponse, ApplyPromoCodeResult, type ApplyPromoCodeResultType, BatchQueueConcurrencyConfig, BatchRateLimitConfig, type BillingAlertsResponse, BillingAlertsResult, BillingClient, BillingLimitActiveOrg, BillingLimitConfiguredCustom, BillingLimitConfiguredNone, BillingLimitConfiguredPlan, BillingLimitPendingResolveOrg, type BillingLimitResponse, BillingLimitResult, BillingLimitState, BillingLimitUnconfigured, type BillingLimitsActiveResponse, BillingLimitsActiveResult, BillingLimitsPendingResolvesResult, type CanceledSubscriptionResult, CreatePrivateLinkConnectionBody, type CreateSubscriptionFlowStart, CurrentPlan, type CurrentPlanResponse, type CustomerPortal, type CustomerPortalRequestBody, CustomerPortalRequestBodySchema, type CustomerPortalResponse, CustomerPortalSchema, type DeletePrivateLinkResponse, DeletePrivateLinkResult, type EnqueueBuildRequest, EnqueueBuildRequestSchema, type EnqueueBuildResponse, EnqueueBuildResponseSchema, type EnqueueBuildResult, EnterprisePlanDefinition, EnvironmentBasedLimit, type Error, ErrorSchema, ExceedableLimit, type FreeConnectRequired, FreeConnectRequiredSchema, type FreeConnected, FreeConnectedSchema, FreePlanDefinition, FreeTierStatus, Limits, MAX_INVOCATION_COST_IN_CENTS, type MachineCode, MachineDefinition, type MachineDefinitionInput, PaidPlanDefinition, type PlanDefinition, PlanDefinitionSchema, Plans, type PlansResponse, PlansResult, PrivateLinkConnection, PrivateLinkConnectionList, type PrivateLinkConnectionListResponse, type PrivateLinkConnectionResponse, PrivateLinkConnectionStatus, type PrivateLinkRegionsResponse, PrivateLinkRegionsResult, type PromoCreditsResponse, PromoCreditsResult, type PromoCreditsResultType, QueueSizeLimits, type RegistryCredentialsResponse, RegistryCredentialsResponseSchema, type RegistryCredentialsResult, ReportComputeUsageEvent, ReportInvocationUsageEvent, ReportInvocationUsageResult, ReportUsagePlan, ReportUsageResult, ResolveBillingLimitRequest, SetAddOnBody, type SetAddOnResponse, SetAddOnResult, type SetPlanBody, SetPlanBodySchema, type SetPlanResponse, type SubscribeResult, SubscribeResultSchema, SubscriptionResult, type TriggerInitialDeploymentRequest, TriggerInitialDeploymentRequestSchema, type TriggerInitialDeploymentResponse, TriggerInitialDeploymentResponseSchema, type TriggerInitialDeploymentResult, UpdateBillingAlertsRequest, UpdateBillingLimitRequest, type UpdatedSubscriptionResult, type UsageEntitlementResponse, type UsageInvocationReportResponse, UsageParams, type UsageResponse, UsageResult, UsageSeriesParams, type UsageSeriesResponse, UsageSeriesResult, type ValidatePromoCodeBody, ValidatePromoCodeBodySchema, type ValidatePromoCodeResponse, ValidatePromoCodeResult, type ValidatePromoCodeResultType, defaultMachine, machineDefinition, machines, objectToSearchParams };