@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.cjs +273 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +721 -1
- package/dist/index.d.ts +721 -1
- package/dist/index.js +255 -53
- package/dist/index.js.map +1 -1
- package/package.json +9 -5
package/dist/index.cjs
CHANGED
|
@@ -23,8 +23,20 @@ __export(v3_exports, {
|
|
|
23
23
|
AddOn: () => AddOn,
|
|
24
24
|
AddOnDefinition: () => AddOnDefinition,
|
|
25
25
|
AddOns: () => AddOns,
|
|
26
|
+
ApplyPromoCodeBodySchema: () => ApplyPromoCodeBodySchema,
|
|
27
|
+
ApplyPromoCodeResult: () => ApplyPromoCodeResult,
|
|
26
28
|
BillingAlertsResult: () => BillingAlertsResult,
|
|
27
29
|
BillingClient: () => BillingClient,
|
|
30
|
+
BillingLimitActiveOrg: () => BillingLimitActiveOrg,
|
|
31
|
+
BillingLimitConfiguredCustom: () => BillingLimitConfiguredCustom,
|
|
32
|
+
BillingLimitConfiguredNone: () => BillingLimitConfiguredNone,
|
|
33
|
+
BillingLimitConfiguredPlan: () => BillingLimitConfiguredPlan,
|
|
34
|
+
BillingLimitPendingResolveOrg: () => BillingLimitPendingResolveOrg,
|
|
35
|
+
BillingLimitResult: () => BillingLimitResult,
|
|
36
|
+
BillingLimitState: () => BillingLimitState,
|
|
37
|
+
BillingLimitUnconfigured: () => BillingLimitUnconfigured,
|
|
38
|
+
BillingLimitsActiveResult: () => BillingLimitsActiveResult,
|
|
39
|
+
BillingLimitsPendingResolvesResult: () => BillingLimitsPendingResolvesResult,
|
|
28
40
|
CreatePrivateLinkConnectionBody: () => CreatePrivateLinkConnectionBody,
|
|
29
41
|
CurrentPlan: () => CurrentPlan,
|
|
30
42
|
CustomerPortalRequestBodySchema: () => CustomerPortalRequestBodySchema,
|
|
@@ -35,6 +47,7 @@ __export(v3_exports, {
|
|
|
35
47
|
ErrorSchema: () => ErrorSchema,
|
|
36
48
|
FreeConnectRequiredSchema: () => FreeConnectRequiredSchema,
|
|
37
49
|
FreeConnectedSchema: () => FreeConnectedSchema,
|
|
50
|
+
MAX_INVOCATION_COST_IN_CENTS: () => MAX_INVOCATION_COST_IN_CENTS,
|
|
38
51
|
PlanDefinitionSchema: () => PlanDefinitionSchema,
|
|
39
52
|
Plans: () => Plans,
|
|
40
53
|
PlansResult: () => PlansResult,
|
|
@@ -42,12 +55,14 @@ __export(v3_exports, {
|
|
|
42
55
|
PrivateLinkConnectionList: () => PrivateLinkConnectionList,
|
|
43
56
|
PrivateLinkConnectionStatus: () => PrivateLinkConnectionStatus,
|
|
44
57
|
PrivateLinkRegionsResult: () => PrivateLinkRegionsResult,
|
|
58
|
+
PromoCreditsResult: () => PromoCreditsResult,
|
|
45
59
|
RegistryCredentialsResponseSchema: () => RegistryCredentialsResponseSchema,
|
|
46
60
|
ReportComputeUsageEvent: () => ReportComputeUsageEvent,
|
|
47
61
|
ReportInvocationUsageEvent: () => ReportInvocationUsageEvent,
|
|
48
62
|
ReportInvocationUsageResult: () => ReportInvocationUsageResult,
|
|
49
63
|
ReportUsagePlan: () => ReportUsagePlan,
|
|
50
64
|
ReportUsageResult: () => ReportUsageResult,
|
|
65
|
+
ResolveBillingLimitRequest: () => ResolveBillingLimitRequest,
|
|
51
66
|
SetAddOnBody: () => SetAddOnBody,
|
|
52
67
|
SetAddOnResult: () => SetAddOnResult,
|
|
53
68
|
SetPlanBodySchema: () => SetPlanBodySchema,
|
|
@@ -56,10 +71,13 @@ __export(v3_exports, {
|
|
|
56
71
|
TriggerInitialDeploymentRequestSchema: () => TriggerInitialDeploymentRequestSchema,
|
|
57
72
|
TriggerInitialDeploymentResponseSchema: () => TriggerInitialDeploymentResponseSchema,
|
|
58
73
|
UpdateBillingAlertsRequest: () => UpdateBillingAlertsRequest,
|
|
74
|
+
UpdateBillingLimitRequest: () => UpdateBillingLimitRequest,
|
|
59
75
|
UsageParams: () => UsageParams,
|
|
60
76
|
UsageResult: () => UsageResult,
|
|
61
77
|
UsageSeriesParams: () => UsageSeriesParams,
|
|
62
78
|
UsageSeriesResult: () => UsageSeriesResult,
|
|
79
|
+
ValidatePromoCodeBodySchema: () => ValidatePromoCodeBodySchema,
|
|
80
|
+
ValidatePromoCodeResult: () => ValidatePromoCodeResult,
|
|
63
81
|
defaultMachine: () => defaultMachine,
|
|
64
82
|
machineDefinition: () => machineDefinition,
|
|
65
83
|
machines: () => machines,
|
|
@@ -357,12 +375,15 @@ var ReportUsageResult = import_zod6.z.object({
|
|
|
357
375
|
balance: import_zod6.z.number().optional(),
|
|
358
376
|
usage: import_zod6.z.number().optional(),
|
|
359
377
|
overage: import_zod6.z.number().optional(),
|
|
360
|
-
plan: ReportUsagePlan.optional()
|
|
378
|
+
plan: ReportUsagePlan.optional(),
|
|
379
|
+
limitState: import_zod6.z.literal("grace").optional(),
|
|
380
|
+
reason: import_zod6.z.enum(["free_tier_exceeded", "billing_limit"]).optional()
|
|
361
381
|
});
|
|
382
|
+
var MAX_INVOCATION_COST_IN_CENTS = 1e4;
|
|
362
383
|
var ReportInvocationUsageEvent = import_zod6.z.object({
|
|
363
|
-
organizationId: import_zod6.z.string(),
|
|
364
|
-
costInCents: import_zod6.z.number(),
|
|
365
|
-
additionalData: import_zod6.z.record(import_zod6.z.any()).optional()
|
|
384
|
+
organizationId: import_zod6.z.string().min(1).max(128),
|
|
385
|
+
costInCents: import_zod6.z.number().finite().min(0).max(MAX_INVOCATION_COST_IN_CENTS),
|
|
386
|
+
additionalData: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.any()).optional()
|
|
366
387
|
});
|
|
367
388
|
var ReportInvocationUsageResult = import_zod6.z.discriminatedUnion("success", [
|
|
368
389
|
import_zod6.z.object({
|
|
@@ -383,76 +404,165 @@ var BillingAlertDefinition = import_zod7.z.object({
|
|
|
383
404
|
});
|
|
384
405
|
var BillingAlertsResult = BillingAlertDefinition;
|
|
385
406
|
var UpdateBillingAlertsRequest = import_zod7.z.object({
|
|
386
|
-
amount: import_zod7.z.number(),
|
|
407
|
+
amount: import_zod7.z.number().positive(),
|
|
387
408
|
emails: import_zod7.z.array(import_zod7.z.string()),
|
|
388
409
|
alertLevels: import_zod7.z.array(import_zod7.z.number())
|
|
389
410
|
});
|
|
390
411
|
|
|
391
|
-
// src/v3/schemas/
|
|
412
|
+
// src/v3/schemas/billingLimit.ts
|
|
392
413
|
var import_zod8 = require("zod");
|
|
393
|
-
var
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
414
|
+
var BillingLimitState = import_zod8.z.discriminatedUnion("status", [
|
|
415
|
+
import_zod8.z.object({
|
|
416
|
+
status: import_zod8.z.literal("ok")
|
|
417
|
+
}),
|
|
418
|
+
import_zod8.z.object({
|
|
419
|
+
status: import_zod8.z.literal("grace"),
|
|
420
|
+
hitAt: import_zod8.z.string(),
|
|
421
|
+
graceEndsAt: import_zod8.z.string()
|
|
422
|
+
}),
|
|
423
|
+
import_zod8.z.object({
|
|
424
|
+
status: import_zod8.z.literal("rejected"),
|
|
425
|
+
hitAt: import_zod8.z.string(),
|
|
426
|
+
graceEndsAt: import_zod8.z.string()
|
|
427
|
+
})
|
|
428
|
+
]);
|
|
429
|
+
var billingLimitConfiguredFields = {
|
|
430
|
+
isConfigured: import_zod8.z.literal(true),
|
|
431
|
+
cancelInProgressRuns: import_zod8.z.boolean(),
|
|
432
|
+
limitState: BillingLimitState,
|
|
433
|
+
effectiveAmountCents: import_zod8.z.number().int().nonnegative().nullable(),
|
|
434
|
+
gracePeriodMs: import_zod8.z.number().int().nonnegative()
|
|
435
|
+
};
|
|
436
|
+
var BillingLimitUnconfigured = import_zod8.z.object({
|
|
437
|
+
isConfigured: import_zod8.z.literal(false),
|
|
438
|
+
gracePeriodMs: import_zod8.z.number().int().nonnegative()
|
|
439
|
+
});
|
|
440
|
+
var BillingLimitConfiguredNone = import_zod8.z.object({
|
|
441
|
+
...billingLimitConfiguredFields,
|
|
442
|
+
mode: import_zod8.z.literal("none")
|
|
443
|
+
});
|
|
444
|
+
var BillingLimitConfiguredPlan = import_zod8.z.object({
|
|
445
|
+
...billingLimitConfiguredFields,
|
|
446
|
+
mode: import_zod8.z.literal("plan")
|
|
447
|
+
});
|
|
448
|
+
var BillingLimitConfiguredCustom = import_zod8.z.object({
|
|
449
|
+
...billingLimitConfiguredFields,
|
|
450
|
+
mode: import_zod8.z.literal("custom"),
|
|
451
|
+
amountCents: import_zod8.z.number().int().positive()
|
|
452
|
+
});
|
|
453
|
+
var BillingLimitResult = import_zod8.z.union([
|
|
454
|
+
BillingLimitUnconfigured,
|
|
455
|
+
BillingLimitConfiguredNone,
|
|
456
|
+
BillingLimitConfiguredPlan,
|
|
457
|
+
BillingLimitConfiguredCustom
|
|
458
|
+
]);
|
|
459
|
+
var UpdateBillingLimitRequest = import_zod8.z.discriminatedUnion("mode", [
|
|
460
|
+
import_zod8.z.object({
|
|
461
|
+
mode: import_zod8.z.literal("none"),
|
|
462
|
+
cancelInProgressRuns: import_zod8.z.boolean()
|
|
463
|
+
}),
|
|
464
|
+
import_zod8.z.object({
|
|
465
|
+
mode: import_zod8.z.literal("plan"),
|
|
466
|
+
cancelInProgressRuns: import_zod8.z.boolean()
|
|
467
|
+
}),
|
|
468
|
+
import_zod8.z.object({
|
|
469
|
+
mode: import_zod8.z.literal("custom"),
|
|
470
|
+
amountCents: import_zod8.z.number().int().positive(),
|
|
471
|
+
cancelInProgressRuns: import_zod8.z.boolean()
|
|
472
|
+
})
|
|
473
|
+
]);
|
|
474
|
+
var ResolveBillingLimitRequest = import_zod8.z.discriminatedUnion("action", [
|
|
475
|
+
import_zod8.z.object({
|
|
476
|
+
action: import_zod8.z.literal("increase"),
|
|
477
|
+
newAmountCents: import_zod8.z.number().int().positive(),
|
|
478
|
+
resumeMode: import_zod8.z.enum(["queue", "new_only"])
|
|
479
|
+
}),
|
|
480
|
+
import_zod8.z.object({
|
|
481
|
+
action: import_zod8.z.literal("remove"),
|
|
482
|
+
resumeMode: import_zod8.z.enum(["queue", "new_only"])
|
|
483
|
+
})
|
|
484
|
+
]);
|
|
485
|
+
var BillingLimitActiveOrg = import_zod8.z.object({
|
|
486
|
+
orgId: import_zod8.z.string(),
|
|
487
|
+
limitState: import_zod8.z.enum(["grace", "rejected"])
|
|
488
|
+
});
|
|
489
|
+
var BillingLimitsActiveResult = import_zod8.z.object({
|
|
490
|
+
orgs: import_zod8.z.array(BillingLimitActiveOrg)
|
|
491
|
+
});
|
|
492
|
+
var BillingLimitPendingResolveOrg = import_zod8.z.object({
|
|
493
|
+
organizationId: import_zod8.z.string(),
|
|
494
|
+
resumeMode: import_zod8.z.enum(["queue", "new_only"]),
|
|
495
|
+
resolvedAt: import_zod8.z.string()
|
|
496
|
+
});
|
|
497
|
+
var BillingLimitsPendingResolvesResult = import_zod8.z.object({
|
|
498
|
+
orgs: import_zod8.z.array(BillingLimitPendingResolveOrg)
|
|
398
499
|
});
|
|
399
500
|
|
|
400
|
-
// src/v3/schemas/
|
|
501
|
+
// src/v3/schemas/registryCredentials.ts
|
|
401
502
|
var import_zod9 = require("zod");
|
|
402
|
-
var
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
503
|
+
var RegistryCredentialsResponseSchema = import_zod9.z.object({
|
|
504
|
+
username: import_zod9.z.string(),
|
|
505
|
+
password: import_zod9.z.string(),
|
|
506
|
+
expiresAt: import_zod9.z.string().datetime(),
|
|
507
|
+
repositoryUri: import_zod9.z.string()
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
// src/v3/schemas/enqueueBuild.ts
|
|
511
|
+
var import_zod10 = require("zod");
|
|
512
|
+
var EnqueueBuildRequestSchema = import_zod10.z.object({
|
|
513
|
+
deploymentId: import_zod10.z.string(),
|
|
514
|
+
artifactKey: import_zod10.z.string(),
|
|
515
|
+
options: import_zod10.z.object({
|
|
516
|
+
skipPromotion: import_zod10.z.boolean().optional(),
|
|
517
|
+
configFilePath: import_zod10.z.string().optional()
|
|
408
518
|
})
|
|
409
519
|
});
|
|
410
|
-
var EnqueueBuildResponseSchema =
|
|
411
|
-
buildId:
|
|
520
|
+
var EnqueueBuildResponseSchema = import_zod10.z.object({
|
|
521
|
+
buildId: import_zod10.z.string()
|
|
412
522
|
});
|
|
413
523
|
|
|
414
524
|
// src/v3/schemas/initialDeployment.ts
|
|
415
|
-
var
|
|
416
|
-
var TriggerInitialDeploymentRequestSchema =
|
|
417
|
-
environment:
|
|
525
|
+
var import_zod11 = require("zod");
|
|
526
|
+
var TriggerInitialDeploymentRequestSchema = import_zod11.z.object({
|
|
527
|
+
environment: import_zod11.z.enum(["prod", "staging", "preview"])
|
|
418
528
|
});
|
|
419
|
-
var TriggerInitialDeploymentResponseSchema =
|
|
420
|
-
ok:
|
|
529
|
+
var TriggerInitialDeploymentResponseSchema = import_zod11.z.object({
|
|
530
|
+
ok: import_zod11.z.boolean()
|
|
421
531
|
});
|
|
422
532
|
|
|
423
533
|
// src/v3/schemas/privateLink.ts
|
|
424
|
-
var
|
|
425
|
-
var PrivateLinkConnectionStatus =
|
|
534
|
+
var import_zod12 = require("zod");
|
|
535
|
+
var PrivateLinkConnectionStatus = import_zod12.z.enum([
|
|
426
536
|
"PENDING",
|
|
427
537
|
"PROVISIONING",
|
|
428
538
|
"ACTIVE",
|
|
429
539
|
"ERROR",
|
|
430
540
|
"DELETING"
|
|
431
541
|
]);
|
|
432
|
-
var PrivateLinkConnection =
|
|
433
|
-
id:
|
|
434
|
-
friendlyId:
|
|
435
|
-
name:
|
|
436
|
-
organizationId:
|
|
437
|
-
endpointServiceName:
|
|
438
|
-
targetRegion:
|
|
542
|
+
var PrivateLinkConnection = import_zod12.z.object({
|
|
543
|
+
id: import_zod12.z.string(),
|
|
544
|
+
friendlyId: import_zod12.z.string(),
|
|
545
|
+
name: import_zod12.z.string(),
|
|
546
|
+
organizationId: import_zod12.z.string(),
|
|
547
|
+
endpointServiceName: import_zod12.z.string(),
|
|
548
|
+
targetRegion: import_zod12.z.string(),
|
|
439
549
|
status: PrivateLinkConnectionStatus,
|
|
440
|
-
statusMessage:
|
|
441
|
-
endpointDnsName:
|
|
442
|
-
endpointIps:
|
|
443
|
-
provisionedAt:
|
|
444
|
-
createdAt:
|
|
445
|
-
updatedAt:
|
|
446
|
-
});
|
|
447
|
-
var PrivateLinkConnectionList =
|
|
448
|
-
connections:
|
|
449
|
-
});
|
|
450
|
-
var CreatePrivateLinkConnectionBody =
|
|
451
|
-
name:
|
|
550
|
+
statusMessage: import_zod12.z.string().nullable(),
|
|
551
|
+
endpointDnsName: import_zod12.z.string().nullable(),
|
|
552
|
+
endpointIps: import_zod12.z.array(import_zod12.z.string()).nullable(),
|
|
553
|
+
provisionedAt: import_zod12.z.string().nullable(),
|
|
554
|
+
createdAt: import_zod12.z.string(),
|
|
555
|
+
updatedAt: import_zod12.z.string()
|
|
556
|
+
});
|
|
557
|
+
var PrivateLinkConnectionList = import_zod12.z.object({
|
|
558
|
+
connections: import_zod12.z.array(PrivateLinkConnection)
|
|
559
|
+
});
|
|
560
|
+
var CreatePrivateLinkConnectionBody = import_zod12.z.object({
|
|
561
|
+
name: import_zod12.z.string().min(1).max(100).regex(
|
|
452
562
|
/^[a-zA-Z][a-zA-Z0-9 _-]*$/,
|
|
453
563
|
"Must start with a letter and contain only letters, numbers, spaces, hyphens, or underscores"
|
|
454
564
|
),
|
|
455
|
-
endpointServiceName:
|
|
565
|
+
endpointServiceName: import_zod12.z.string().regex(
|
|
456
566
|
/^com\.amazonaws\.vpce\..+\.vpce-svc-.+$/,
|
|
457
567
|
"Must be a valid VPC Endpoint Service name (com.amazonaws.vpce.<region>.vpce-svc-*)"
|
|
458
568
|
),
|
|
@@ -460,14 +570,43 @@ var CreatePrivateLinkConnectionBody = import_zod11.z.object({
|
|
|
460
570
|
// this validates the AWS region *format* only; the authoritative check that
|
|
461
571
|
// the region is actually configured happens server-side against the set of
|
|
462
572
|
// regions discovered from env vars.
|
|
463
|
-
targetRegion:
|
|
573
|
+
targetRegion: import_zod12.z.string().regex(/^[a-z]{2}-[a-z]+-\d+$/, "Must be a valid AWS region")
|
|
574
|
+
});
|
|
575
|
+
var DeletePrivateLinkResult = import_zod12.z.object({
|
|
576
|
+
success: import_zod12.z.boolean()
|
|
577
|
+
});
|
|
578
|
+
var PrivateLinkRegionsResult = import_zod12.z.object({
|
|
579
|
+
availableRegions: import_zod12.z.array(import_zod12.z.string()),
|
|
580
|
+
activeRegions: import_zod12.z.array(import_zod12.z.string())
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
// src/v3/schemas/promoCodes.ts
|
|
584
|
+
var import_zod13 = require("zod");
|
|
585
|
+
var ValidatePromoCodeBodySchema = import_zod13.z.object({
|
|
586
|
+
code: import_zod13.z.string()
|
|
587
|
+
});
|
|
588
|
+
var ValidatePromoCodeResult = import_zod13.z.object({
|
|
589
|
+
valid: import_zod13.z.boolean(),
|
|
590
|
+
amountInCents: import_zod13.z.number().optional(),
|
|
591
|
+
expiresAt: import_zod13.z.string().datetime().nullable().optional()
|
|
592
|
+
});
|
|
593
|
+
var ApplyPromoCodeBodySchema = import_zod13.z.object({
|
|
594
|
+
code: import_zod13.z.string(),
|
|
595
|
+
userId: import_zod13.z.string()
|
|
464
596
|
});
|
|
465
|
-
var
|
|
466
|
-
|
|
597
|
+
var ApplyPromoCodeResult = import_zod13.z.object({
|
|
598
|
+
applied: import_zod13.z.boolean(),
|
|
599
|
+
amountInCents: import_zod13.z.number().optional(),
|
|
600
|
+
expiresAt: import_zod13.z.string().datetime().nullable().optional(),
|
|
601
|
+
// Present when applied is false, e.g. "already_redeemed" or "invalid".
|
|
602
|
+
reason: import_zod13.z.string().optional()
|
|
467
603
|
});
|
|
468
|
-
var
|
|
469
|
-
|
|
470
|
-
|
|
604
|
+
var PromoCreditsResult = import_zod13.z.object({
|
|
605
|
+
promoCredits: import_zod13.z.object({
|
|
606
|
+
grantedCents: import_zod13.z.number(),
|
|
607
|
+
remainingCents: import_zod13.z.number(),
|
|
608
|
+
expiresAt: import_zod13.z.string().datetime().nullable()
|
|
609
|
+
}).nullable()
|
|
471
610
|
});
|
|
472
611
|
|
|
473
612
|
// src/v3/client/index.ts
|
|
@@ -521,6 +660,34 @@ var BillingClient = class {
|
|
|
521
660
|
}
|
|
522
661
|
);
|
|
523
662
|
}
|
|
663
|
+
async validatePromoCode(code) {
|
|
664
|
+
return await this.fetch(`/api/v1/promo-codes/validate`, ValidatePromoCodeResult, {
|
|
665
|
+
method: "POST",
|
|
666
|
+
headers: {
|
|
667
|
+
"Content-Type": "application/json"
|
|
668
|
+
},
|
|
669
|
+
body: JSON.stringify({ code })
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
async applyPromoCode(orgId, body) {
|
|
673
|
+
return await this.fetch(
|
|
674
|
+
`/api/v1/orgs/${orgId}/promo/apply`,
|
|
675
|
+
ApplyPromoCodeResult,
|
|
676
|
+
{
|
|
677
|
+
method: "POST",
|
|
678
|
+
headers: {
|
|
679
|
+
"Content-Type": "application/json"
|
|
680
|
+
},
|
|
681
|
+
body: JSON.stringify(body)
|
|
682
|
+
}
|
|
683
|
+
);
|
|
684
|
+
}
|
|
685
|
+
async promoCredits(orgId) {
|
|
686
|
+
return await this.fetch(
|
|
687
|
+
`/api/v1/orgs/${orgId}/promo/credits`,
|
|
688
|
+
PromoCreditsResult
|
|
689
|
+
);
|
|
690
|
+
}
|
|
524
691
|
async createPortalSession(orgId, body) {
|
|
525
692
|
return await this.fetch(
|
|
526
693
|
`/api/v1/orgs/${orgId}/v3/subscription/portal`,
|
|
@@ -622,6 +789,41 @@ var BillingClient = class {
|
|
|
622
789
|
}
|
|
623
790
|
);
|
|
624
791
|
}
|
|
792
|
+
async getBillingLimit(orgId) {
|
|
793
|
+
return await this.fetch(
|
|
794
|
+
`/api/v1/orgs/${orgId}/billing-limit`,
|
|
795
|
+
BillingLimitResult
|
|
796
|
+
);
|
|
797
|
+
}
|
|
798
|
+
async updateBillingLimit(orgId, body) {
|
|
799
|
+
return await this.fetch(
|
|
800
|
+
`/api/v1/orgs/${orgId}/billing-limit`,
|
|
801
|
+
BillingLimitResult,
|
|
802
|
+
{
|
|
803
|
+
method: "PUT",
|
|
804
|
+
headers: {
|
|
805
|
+
"Content-Type": "application/json"
|
|
806
|
+
},
|
|
807
|
+
body: JSON.stringify(body)
|
|
808
|
+
}
|
|
809
|
+
);
|
|
810
|
+
}
|
|
811
|
+
async resolveBillingLimit(orgId, body) {
|
|
812
|
+
return await this.fetch(
|
|
813
|
+
`/api/v1/orgs/${orgId}/billing-limit/resolve`,
|
|
814
|
+
BillingLimitResult,
|
|
815
|
+
{
|
|
816
|
+
method: "POST",
|
|
817
|
+
headers: {
|
|
818
|
+
"Content-Type": "application/json"
|
|
819
|
+
},
|
|
820
|
+
body: JSON.stringify(body)
|
|
821
|
+
}
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
async getActiveBillingLimits() {
|
|
825
|
+
return await this.fetch(`/api/v1/billing-limits/active`, BillingLimitsActiveResult);
|
|
826
|
+
}
|
|
625
827
|
async getPrivateLinks(orgId) {
|
|
626
828
|
return await this.fetch(
|
|
627
829
|
`/api/v1/orgs/${orgId}/private-connections`,
|
|
@@ -806,8 +1008,20 @@ var defaultMachine = "small-1x";
|
|
|
806
1008
|
AddOn,
|
|
807
1009
|
AddOnDefinition,
|
|
808
1010
|
AddOns,
|
|
1011
|
+
ApplyPromoCodeBodySchema,
|
|
1012
|
+
ApplyPromoCodeResult,
|
|
809
1013
|
BillingAlertsResult,
|
|
810
1014
|
BillingClient,
|
|
1015
|
+
BillingLimitActiveOrg,
|
|
1016
|
+
BillingLimitConfiguredCustom,
|
|
1017
|
+
BillingLimitConfiguredNone,
|
|
1018
|
+
BillingLimitConfiguredPlan,
|
|
1019
|
+
BillingLimitPendingResolveOrg,
|
|
1020
|
+
BillingLimitResult,
|
|
1021
|
+
BillingLimitState,
|
|
1022
|
+
BillingLimitUnconfigured,
|
|
1023
|
+
BillingLimitsActiveResult,
|
|
1024
|
+
BillingLimitsPendingResolvesResult,
|
|
811
1025
|
CreatePrivateLinkConnectionBody,
|
|
812
1026
|
CurrentPlan,
|
|
813
1027
|
CustomerPortalRequestBodySchema,
|
|
@@ -818,6 +1032,7 @@ var defaultMachine = "small-1x";
|
|
|
818
1032
|
ErrorSchema,
|
|
819
1033
|
FreeConnectRequiredSchema,
|
|
820
1034
|
FreeConnectedSchema,
|
|
1035
|
+
MAX_INVOCATION_COST_IN_CENTS,
|
|
821
1036
|
PlanDefinitionSchema,
|
|
822
1037
|
Plans,
|
|
823
1038
|
PlansResult,
|
|
@@ -825,12 +1040,14 @@ var defaultMachine = "small-1x";
|
|
|
825
1040
|
PrivateLinkConnectionList,
|
|
826
1041
|
PrivateLinkConnectionStatus,
|
|
827
1042
|
PrivateLinkRegionsResult,
|
|
1043
|
+
PromoCreditsResult,
|
|
828
1044
|
RegistryCredentialsResponseSchema,
|
|
829
1045
|
ReportComputeUsageEvent,
|
|
830
1046
|
ReportInvocationUsageEvent,
|
|
831
1047
|
ReportInvocationUsageResult,
|
|
832
1048
|
ReportUsagePlan,
|
|
833
1049
|
ReportUsageResult,
|
|
1050
|
+
ResolveBillingLimitRequest,
|
|
834
1051
|
SetAddOnBody,
|
|
835
1052
|
SetAddOnResult,
|
|
836
1053
|
SetPlanBodySchema,
|
|
@@ -839,10 +1056,13 @@ var defaultMachine = "small-1x";
|
|
|
839
1056
|
TriggerInitialDeploymentRequestSchema,
|
|
840
1057
|
TriggerInitialDeploymentResponseSchema,
|
|
841
1058
|
UpdateBillingAlertsRequest,
|
|
1059
|
+
UpdateBillingLimitRequest,
|
|
842
1060
|
UsageParams,
|
|
843
1061
|
UsageResult,
|
|
844
1062
|
UsageSeriesParams,
|
|
845
1063
|
UsageSeriesResult,
|
|
1064
|
+
ValidatePromoCodeBodySchema,
|
|
1065
|
+
ValidatePromoCodeResult,
|
|
846
1066
|
defaultMachine,
|
|
847
1067
|
machineDefinition,
|
|
848
1068
|
machines,
|