@trigger.dev/platform 1.1.0 → 1.3.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 +301 -138
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13440 -577
- package/dist/index.d.ts +13440 -577
- package/dist/index.js +283 -138
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
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,
|
|
@@ -115,6 +133,7 @@ var Limits = import_zod.z.object({
|
|
|
115
133
|
queueSizeLimits: QueueSizeLimits.optional(),
|
|
116
134
|
hasPrivateNetworking: import_zod.z.boolean().optional(),
|
|
117
135
|
privateLinkConnectionLimit: import_zod.z.number().optional(),
|
|
136
|
+
hasSso: import_zod.z.boolean().optional(),
|
|
118
137
|
// Duration string (e.g. "30d", "1y"). When set, the org gets a
|
|
119
138
|
// dedicated S2 stream basin with this retention; when omitted, the
|
|
120
139
|
// org's streams flow to the shared global basin.
|
|
@@ -313,10 +332,6 @@ var UsageResult = import_zod6.z.object({
|
|
|
313
332
|
cents: import_zod6.z.number()
|
|
314
333
|
});
|
|
315
334
|
var Window = import_zod6.z.enum(["MINUTE", "HOUR", "DAY"]);
|
|
316
|
-
var BooleanParam = import_zod6.z.preprocess(
|
|
317
|
-
(val) => val === "true" ? true : false,
|
|
318
|
-
import_zod6.z.boolean()
|
|
319
|
-
);
|
|
320
335
|
var UsageSeriesParams = import_zod6.z.object({
|
|
321
336
|
from: import_zod6.z.coerce.date(),
|
|
322
337
|
to: import_zod6.z.coerce.date(),
|
|
@@ -357,11 +372,14 @@ var ReportUsageResult = import_zod6.z.object({
|
|
|
357
372
|
balance: import_zod6.z.number().optional(),
|
|
358
373
|
usage: import_zod6.z.number().optional(),
|
|
359
374
|
overage: import_zod6.z.number().optional(),
|
|
360
|
-
plan: ReportUsagePlan.optional()
|
|
375
|
+
plan: ReportUsagePlan.optional(),
|
|
376
|
+
limitState: import_zod6.z.literal("grace").optional(),
|
|
377
|
+
reason: import_zod6.z.enum(["free_tier_exceeded", "billing_limit"]).optional()
|
|
361
378
|
});
|
|
379
|
+
var MAX_INVOCATION_COST_IN_CENTS = 1e4;
|
|
362
380
|
var ReportInvocationUsageEvent = import_zod6.z.object({
|
|
363
|
-
organizationId: import_zod6.z.string(),
|
|
364
|
-
costInCents: import_zod6.z.number(),
|
|
381
|
+
organizationId: import_zod6.z.string().min(1).max(128),
|
|
382
|
+
costInCents: import_zod6.z.number().finite().min(0).max(MAX_INVOCATION_COST_IN_CENTS),
|
|
365
383
|
additionalData: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.any()).optional()
|
|
366
384
|
});
|
|
367
385
|
var ReportInvocationUsageResult = import_zod6.z.discriminatedUnion("success", [
|
|
@@ -383,76 +401,165 @@ var BillingAlertDefinition = import_zod7.z.object({
|
|
|
383
401
|
});
|
|
384
402
|
var BillingAlertsResult = BillingAlertDefinition;
|
|
385
403
|
var UpdateBillingAlertsRequest = import_zod7.z.object({
|
|
386
|
-
amount: import_zod7.z.number(),
|
|
404
|
+
amount: import_zod7.z.number().positive(),
|
|
387
405
|
emails: import_zod7.z.array(import_zod7.z.string()),
|
|
388
406
|
alertLevels: import_zod7.z.array(import_zod7.z.number())
|
|
389
407
|
});
|
|
390
408
|
|
|
391
|
-
// src/v3/schemas/
|
|
409
|
+
// src/v3/schemas/billingLimit.ts
|
|
392
410
|
var import_zod8 = require("zod");
|
|
393
|
-
var
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
411
|
+
var BillingLimitState = import_zod8.z.discriminatedUnion("status", [
|
|
412
|
+
import_zod8.z.object({
|
|
413
|
+
status: import_zod8.z.literal("ok")
|
|
414
|
+
}),
|
|
415
|
+
import_zod8.z.object({
|
|
416
|
+
status: import_zod8.z.literal("grace"),
|
|
417
|
+
hitAt: import_zod8.z.string(),
|
|
418
|
+
graceEndsAt: import_zod8.z.string()
|
|
419
|
+
}),
|
|
420
|
+
import_zod8.z.object({
|
|
421
|
+
status: import_zod8.z.literal("rejected"),
|
|
422
|
+
hitAt: import_zod8.z.string(),
|
|
423
|
+
graceEndsAt: import_zod8.z.string()
|
|
424
|
+
})
|
|
425
|
+
]);
|
|
426
|
+
var billingLimitConfiguredFields = {
|
|
427
|
+
isConfigured: import_zod8.z.literal(true),
|
|
428
|
+
cancelInProgressRuns: import_zod8.z.boolean(),
|
|
429
|
+
limitState: BillingLimitState,
|
|
430
|
+
effectiveAmountCents: import_zod8.z.number().int().nonnegative().nullable(),
|
|
431
|
+
gracePeriodMs: import_zod8.z.number().int().nonnegative()
|
|
432
|
+
};
|
|
433
|
+
var BillingLimitUnconfigured = import_zod8.z.object({
|
|
434
|
+
isConfigured: import_zod8.z.literal(false),
|
|
435
|
+
gracePeriodMs: import_zod8.z.number().int().nonnegative()
|
|
436
|
+
});
|
|
437
|
+
var BillingLimitConfiguredNone = import_zod8.z.object({
|
|
438
|
+
...billingLimitConfiguredFields,
|
|
439
|
+
mode: import_zod8.z.literal("none")
|
|
440
|
+
});
|
|
441
|
+
var BillingLimitConfiguredPlan = import_zod8.z.object({
|
|
442
|
+
...billingLimitConfiguredFields,
|
|
443
|
+
mode: import_zod8.z.literal("plan")
|
|
444
|
+
});
|
|
445
|
+
var BillingLimitConfiguredCustom = import_zod8.z.object({
|
|
446
|
+
...billingLimitConfiguredFields,
|
|
447
|
+
mode: import_zod8.z.literal("custom"),
|
|
448
|
+
amountCents: import_zod8.z.number().int().positive()
|
|
449
|
+
});
|
|
450
|
+
var BillingLimitResult = import_zod8.z.union([
|
|
451
|
+
BillingLimitUnconfigured,
|
|
452
|
+
BillingLimitConfiguredNone,
|
|
453
|
+
BillingLimitConfiguredPlan,
|
|
454
|
+
BillingLimitConfiguredCustom
|
|
455
|
+
]);
|
|
456
|
+
var UpdateBillingLimitRequest = import_zod8.z.discriminatedUnion("mode", [
|
|
457
|
+
import_zod8.z.object({
|
|
458
|
+
mode: import_zod8.z.literal("none"),
|
|
459
|
+
cancelInProgressRuns: import_zod8.z.boolean()
|
|
460
|
+
}),
|
|
461
|
+
import_zod8.z.object({
|
|
462
|
+
mode: import_zod8.z.literal("plan"),
|
|
463
|
+
cancelInProgressRuns: import_zod8.z.boolean()
|
|
464
|
+
}),
|
|
465
|
+
import_zod8.z.object({
|
|
466
|
+
mode: import_zod8.z.literal("custom"),
|
|
467
|
+
amountCents: import_zod8.z.number().int().positive(),
|
|
468
|
+
cancelInProgressRuns: import_zod8.z.boolean()
|
|
469
|
+
})
|
|
470
|
+
]);
|
|
471
|
+
var ResolveBillingLimitRequest = import_zod8.z.discriminatedUnion("action", [
|
|
472
|
+
import_zod8.z.object({
|
|
473
|
+
action: import_zod8.z.literal("increase"),
|
|
474
|
+
newAmountCents: import_zod8.z.number().int().positive(),
|
|
475
|
+
resumeMode: import_zod8.z.enum(["queue", "new_only"])
|
|
476
|
+
}),
|
|
477
|
+
import_zod8.z.object({
|
|
478
|
+
action: import_zod8.z.literal("remove"),
|
|
479
|
+
resumeMode: import_zod8.z.enum(["queue", "new_only"])
|
|
480
|
+
})
|
|
481
|
+
]);
|
|
482
|
+
var BillingLimitActiveOrg = import_zod8.z.object({
|
|
483
|
+
orgId: import_zod8.z.string(),
|
|
484
|
+
limitState: import_zod8.z.enum(["grace", "rejected"])
|
|
485
|
+
});
|
|
486
|
+
var BillingLimitsActiveResult = import_zod8.z.object({
|
|
487
|
+
orgs: import_zod8.z.array(BillingLimitActiveOrg)
|
|
488
|
+
});
|
|
489
|
+
var BillingLimitPendingResolveOrg = import_zod8.z.object({
|
|
490
|
+
organizationId: import_zod8.z.string(),
|
|
491
|
+
resumeMode: import_zod8.z.enum(["queue", "new_only"]),
|
|
492
|
+
resolvedAt: import_zod8.z.string()
|
|
493
|
+
});
|
|
494
|
+
var BillingLimitsPendingResolvesResult = import_zod8.z.object({
|
|
495
|
+
orgs: import_zod8.z.array(BillingLimitPendingResolveOrg)
|
|
398
496
|
});
|
|
399
497
|
|
|
400
|
-
// src/v3/schemas/
|
|
498
|
+
// src/v3/schemas/registryCredentials.ts
|
|
401
499
|
var import_zod9 = require("zod");
|
|
402
|
-
var
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
500
|
+
var RegistryCredentialsResponseSchema = import_zod9.z.object({
|
|
501
|
+
username: import_zod9.z.string(),
|
|
502
|
+
password: import_zod9.z.string(),
|
|
503
|
+
expiresAt: import_zod9.z.string().datetime(),
|
|
504
|
+
repositoryUri: import_zod9.z.string()
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
// src/v3/schemas/enqueueBuild.ts
|
|
508
|
+
var import_zod10 = require("zod");
|
|
509
|
+
var EnqueueBuildRequestSchema = import_zod10.z.object({
|
|
510
|
+
deploymentId: import_zod10.z.string(),
|
|
511
|
+
artifactKey: import_zod10.z.string(),
|
|
512
|
+
options: import_zod10.z.object({
|
|
513
|
+
skipPromotion: import_zod10.z.boolean().optional(),
|
|
514
|
+
configFilePath: import_zod10.z.string().optional()
|
|
408
515
|
})
|
|
409
516
|
});
|
|
410
|
-
var EnqueueBuildResponseSchema =
|
|
411
|
-
buildId:
|
|
517
|
+
var EnqueueBuildResponseSchema = import_zod10.z.object({
|
|
518
|
+
buildId: import_zod10.z.string()
|
|
412
519
|
});
|
|
413
520
|
|
|
414
521
|
// src/v3/schemas/initialDeployment.ts
|
|
415
|
-
var
|
|
416
|
-
var TriggerInitialDeploymentRequestSchema =
|
|
417
|
-
environment:
|
|
522
|
+
var import_zod11 = require("zod");
|
|
523
|
+
var TriggerInitialDeploymentRequestSchema = import_zod11.z.object({
|
|
524
|
+
environment: import_zod11.z.enum(["prod", "staging", "preview"])
|
|
418
525
|
});
|
|
419
|
-
var TriggerInitialDeploymentResponseSchema =
|
|
420
|
-
ok:
|
|
526
|
+
var TriggerInitialDeploymentResponseSchema = import_zod11.z.object({
|
|
527
|
+
ok: import_zod11.z.boolean()
|
|
421
528
|
});
|
|
422
529
|
|
|
423
530
|
// src/v3/schemas/privateLink.ts
|
|
424
|
-
var
|
|
425
|
-
var PrivateLinkConnectionStatus =
|
|
531
|
+
var import_zod12 = require("zod");
|
|
532
|
+
var PrivateLinkConnectionStatus = import_zod12.z.enum([
|
|
426
533
|
"PENDING",
|
|
427
534
|
"PROVISIONING",
|
|
428
535
|
"ACTIVE",
|
|
429
536
|
"ERROR",
|
|
430
537
|
"DELETING"
|
|
431
538
|
]);
|
|
432
|
-
var PrivateLinkConnection =
|
|
433
|
-
id:
|
|
434
|
-
friendlyId:
|
|
435
|
-
name:
|
|
436
|
-
organizationId:
|
|
437
|
-
endpointServiceName:
|
|
438
|
-
targetRegion:
|
|
539
|
+
var PrivateLinkConnection = import_zod12.z.object({
|
|
540
|
+
id: import_zod12.z.string(),
|
|
541
|
+
friendlyId: import_zod12.z.string(),
|
|
542
|
+
name: import_zod12.z.string(),
|
|
543
|
+
organizationId: import_zod12.z.string(),
|
|
544
|
+
endpointServiceName: import_zod12.z.string(),
|
|
545
|
+
targetRegion: import_zod12.z.string(),
|
|
439
546
|
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:
|
|
547
|
+
statusMessage: import_zod12.z.string().nullable(),
|
|
548
|
+
endpointDnsName: import_zod12.z.string().nullable(),
|
|
549
|
+
endpointIps: import_zod12.z.array(import_zod12.z.string()).nullable(),
|
|
550
|
+
provisionedAt: import_zod12.z.string().nullable(),
|
|
551
|
+
createdAt: import_zod12.z.string(),
|
|
552
|
+
updatedAt: import_zod12.z.string()
|
|
553
|
+
});
|
|
554
|
+
var PrivateLinkConnectionList = import_zod12.z.object({
|
|
555
|
+
connections: import_zod12.z.array(PrivateLinkConnection)
|
|
556
|
+
});
|
|
557
|
+
var CreatePrivateLinkConnectionBody = import_zod12.z.object({
|
|
558
|
+
name: import_zod12.z.string().min(1).max(100).regex(
|
|
452
559
|
/^[a-zA-Z][a-zA-Z0-9 _-]*$/,
|
|
453
560
|
"Must start with a letter and contain only letters, numbers, spaces, hyphens, or underscores"
|
|
454
561
|
),
|
|
455
|
-
endpointServiceName:
|
|
562
|
+
endpointServiceName: import_zod12.z.string().regex(
|
|
456
563
|
/^com\.amazonaws\.vpce\..+\.vpce-svc-.+$/,
|
|
457
564
|
"Must be a valid VPC Endpoint Service name (com.amazonaws.vpce.<region>.vpce-svc-*)"
|
|
458
565
|
),
|
|
@@ -460,14 +567,43 @@ var CreatePrivateLinkConnectionBody = import_zod11.z.object({
|
|
|
460
567
|
// this validates the AWS region *format* only; the authoritative check that
|
|
461
568
|
// the region is actually configured happens server-side against the set of
|
|
462
569
|
// regions discovered from env vars.
|
|
463
|
-
targetRegion:
|
|
570
|
+
targetRegion: import_zod12.z.string().regex(/^[a-z]{2}-[a-z]+-\d+$/, "Must be a valid AWS region")
|
|
464
571
|
});
|
|
465
|
-
var DeletePrivateLinkResult =
|
|
466
|
-
success:
|
|
572
|
+
var DeletePrivateLinkResult = import_zod12.z.object({
|
|
573
|
+
success: import_zod12.z.boolean()
|
|
467
574
|
});
|
|
468
|
-
var PrivateLinkRegionsResult =
|
|
469
|
-
availableRegions:
|
|
470
|
-
activeRegions:
|
|
575
|
+
var PrivateLinkRegionsResult = import_zod12.z.object({
|
|
576
|
+
availableRegions: import_zod12.z.array(import_zod12.z.string()),
|
|
577
|
+
activeRegions: import_zod12.z.array(import_zod12.z.string())
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
// src/v3/schemas/promoCodes.ts
|
|
581
|
+
var import_zod13 = require("zod");
|
|
582
|
+
var ValidatePromoCodeBodySchema = import_zod13.z.object({
|
|
583
|
+
code: import_zod13.z.string()
|
|
584
|
+
});
|
|
585
|
+
var ValidatePromoCodeResult = import_zod13.z.object({
|
|
586
|
+
valid: import_zod13.z.boolean(),
|
|
587
|
+
amountInCents: import_zod13.z.number().optional(),
|
|
588
|
+
expiresAt: import_zod13.z.string().datetime().nullable().optional()
|
|
589
|
+
});
|
|
590
|
+
var ApplyPromoCodeBodySchema = import_zod13.z.object({
|
|
591
|
+
code: import_zod13.z.string(),
|
|
592
|
+
userId: import_zod13.z.string()
|
|
593
|
+
});
|
|
594
|
+
var ApplyPromoCodeResult = import_zod13.z.object({
|
|
595
|
+
applied: import_zod13.z.boolean(),
|
|
596
|
+
amountInCents: import_zod13.z.number().optional(),
|
|
597
|
+
expiresAt: import_zod13.z.string().datetime().nullable().optional(),
|
|
598
|
+
// Present when applied is false, e.g. "already_redeemed" or "invalid".
|
|
599
|
+
reason: import_zod13.z.string().optional()
|
|
600
|
+
});
|
|
601
|
+
var PromoCreditsResult = import_zod13.z.object({
|
|
602
|
+
promoCredits: import_zod13.z.object({
|
|
603
|
+
grantedCents: import_zod13.z.number(),
|
|
604
|
+
remainingCents: import_zod13.z.number(),
|
|
605
|
+
expiresAt: import_zod13.z.string().datetime().nullable()
|
|
606
|
+
}).nullable()
|
|
471
607
|
});
|
|
472
608
|
|
|
473
609
|
// src/v3/client/index.ts
|
|
@@ -483,10 +619,7 @@ var BillingClient = class {
|
|
|
483
619
|
}
|
|
484
620
|
async usage(orgId, params) {
|
|
485
621
|
const search = objectToSearchParams(params);
|
|
486
|
-
return await this.fetch(
|
|
487
|
-
`/api/v1/orgs/${orgId}/usage?${search == null ? void 0 : search.toString()}`,
|
|
488
|
-
UsageResult
|
|
489
|
-
);
|
|
622
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/usage?${search == null ? void 0 : search.toString()}`, UsageResult);
|
|
490
623
|
}
|
|
491
624
|
async usageSeries(orgId, params) {
|
|
492
625
|
const search = objectToSearchParams(params);
|
|
@@ -496,43 +629,52 @@ var BillingClient = class {
|
|
|
496
629
|
);
|
|
497
630
|
}
|
|
498
631
|
async setPlan(orgId, body) {
|
|
499
|
-
return await this.fetch(
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
},
|
|
507
|
-
body: JSON.stringify(body)
|
|
508
|
-
}
|
|
509
|
-
);
|
|
632
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/v3/subscription`, SubscribeResultSchema, {
|
|
633
|
+
method: "POST",
|
|
634
|
+
headers: {
|
|
635
|
+
"Content-Type": "application/json"
|
|
636
|
+
},
|
|
637
|
+
body: JSON.stringify(body)
|
|
638
|
+
});
|
|
510
639
|
}
|
|
511
640
|
async setAddOn(orgId, body) {
|
|
512
|
-
return await this.fetch(
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
641
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/v3/subscription/addon`, SetAddOnResult, {
|
|
642
|
+
method: "POST",
|
|
643
|
+
headers: {
|
|
644
|
+
"Content-Type": "application/json"
|
|
645
|
+
},
|
|
646
|
+
body: JSON.stringify(body)
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
async validatePromoCode(code) {
|
|
650
|
+
return await this.fetch(`/api/v1/promo-codes/validate`, ValidatePromoCodeResult, {
|
|
651
|
+
method: "POST",
|
|
652
|
+
headers: {
|
|
653
|
+
"Content-Type": "application/json"
|
|
654
|
+
},
|
|
655
|
+
body: JSON.stringify({ code })
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
async applyPromoCode(orgId, body) {
|
|
659
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/promo/apply`, ApplyPromoCodeResult, {
|
|
660
|
+
method: "POST",
|
|
661
|
+
headers: {
|
|
662
|
+
"Content-Type": "application/json"
|
|
663
|
+
},
|
|
664
|
+
body: JSON.stringify(body)
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
async promoCredits(orgId) {
|
|
668
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/promo/credits`, PromoCreditsResult);
|
|
523
669
|
}
|
|
524
670
|
async createPortalSession(orgId, body) {
|
|
525
|
-
return await this.fetch(
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
},
|
|
533
|
-
body: JSON.stringify(body)
|
|
534
|
-
}
|
|
535
|
-
);
|
|
671
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/v3/subscription/portal`, CustomerPortalSchema, {
|
|
672
|
+
method: "POST",
|
|
673
|
+
headers: {
|
|
674
|
+
"Content-Type": "application/json"
|
|
675
|
+
},
|
|
676
|
+
body: JSON.stringify(body)
|
|
677
|
+
});
|
|
536
678
|
}
|
|
537
679
|
/**
|
|
538
680
|
*
|
|
@@ -540,17 +682,13 @@ var BillingClient = class {
|
|
|
540
682
|
* @returns details about usage
|
|
541
683
|
*/
|
|
542
684
|
async reportInvocationUsage(event) {
|
|
543
|
-
return await this.fetch(
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
},
|
|
551
|
-
body: JSON.stringify(event)
|
|
552
|
-
}
|
|
553
|
-
);
|
|
685
|
+
return await this.fetch(`/api/v1/usage/ingest/invocation`, ReportInvocationUsageResult, {
|
|
686
|
+
method: "POST",
|
|
687
|
+
headers: {
|
|
688
|
+
"Content-Type": "application/json"
|
|
689
|
+
},
|
|
690
|
+
body: JSON.stringify(event)
|
|
691
|
+
});
|
|
554
692
|
}
|
|
555
693
|
/**
|
|
556
694
|
* Generates registry credentials for a project. This is used to push images to a project's container repository.
|
|
@@ -598,48 +736,55 @@ var BillingClient = class {
|
|
|
598
736
|
* @returns details about usage
|
|
599
737
|
*/
|
|
600
738
|
async getEntitlement(orgId) {
|
|
601
|
-
return await this.fetch(
|
|
602
|
-
`/api/v1/orgs/${orgId}/usage/entitlement`,
|
|
603
|
-
ReportUsageResult
|
|
604
|
-
);
|
|
739
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/usage/entitlement`, ReportUsageResult);
|
|
605
740
|
}
|
|
606
741
|
async getBillingAlerts(orgId) {
|
|
607
|
-
return await this.fetch(
|
|
608
|
-
`/api/v1/orgs/${orgId}/billing-alerts`,
|
|
609
|
-
BillingAlertsResult
|
|
610
|
-
);
|
|
742
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/billing-alerts`, BillingAlertsResult);
|
|
611
743
|
}
|
|
612
744
|
async updateBillingAlerts(orgId, body) {
|
|
613
|
-
return await this.fetch(
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
745
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/billing-alerts`, BillingAlertsResult, {
|
|
746
|
+
method: "POST",
|
|
747
|
+
headers: {
|
|
748
|
+
"Content-Type": "application/json"
|
|
749
|
+
},
|
|
750
|
+
body: JSON.stringify(body)
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
async getBillingLimit(orgId) {
|
|
754
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/billing-limit`, BillingLimitResult);
|
|
755
|
+
}
|
|
756
|
+
async updateBillingLimit(orgId, body) {
|
|
757
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/billing-limit`, BillingLimitResult, {
|
|
758
|
+
method: "PUT",
|
|
759
|
+
headers: {
|
|
760
|
+
"Content-Type": "application/json"
|
|
761
|
+
},
|
|
762
|
+
body: JSON.stringify(body)
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
async resolveBillingLimit(orgId, body) {
|
|
766
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/billing-limit/resolve`, BillingLimitResult, {
|
|
767
|
+
method: "POST",
|
|
768
|
+
headers: {
|
|
769
|
+
"Content-Type": "application/json"
|
|
770
|
+
},
|
|
771
|
+
body: JSON.stringify(body)
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
async getActiveBillingLimits() {
|
|
775
|
+
return await this.fetch(`/api/v1/billing-limits/active`, BillingLimitsActiveResult);
|
|
624
776
|
}
|
|
625
777
|
async getPrivateLinks(orgId) {
|
|
626
|
-
return await this.fetch(
|
|
627
|
-
`/api/v1/orgs/${orgId}/private-connections`,
|
|
628
|
-
PrivateLinkConnectionList
|
|
629
|
-
);
|
|
778
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/private-connections`, PrivateLinkConnectionList);
|
|
630
779
|
}
|
|
631
780
|
async createPrivateLink(orgId, body) {
|
|
632
|
-
return await this.fetch(
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
},
|
|
640
|
-
body: JSON.stringify(body)
|
|
641
|
-
}
|
|
642
|
-
);
|
|
781
|
+
return await this.fetch(`/api/v1/orgs/${orgId}/private-connections`, PrivateLinkConnection, {
|
|
782
|
+
method: "POST",
|
|
783
|
+
headers: {
|
|
784
|
+
"Content-Type": "application/json"
|
|
785
|
+
},
|
|
786
|
+
body: JSON.stringify(body)
|
|
787
|
+
});
|
|
643
788
|
}
|
|
644
789
|
async deletePrivateLink(orgId, connectionId) {
|
|
645
790
|
return await this.fetch(
|
|
@@ -806,8 +951,20 @@ var defaultMachine = "small-1x";
|
|
|
806
951
|
AddOn,
|
|
807
952
|
AddOnDefinition,
|
|
808
953
|
AddOns,
|
|
954
|
+
ApplyPromoCodeBodySchema,
|
|
955
|
+
ApplyPromoCodeResult,
|
|
809
956
|
BillingAlertsResult,
|
|
810
957
|
BillingClient,
|
|
958
|
+
BillingLimitActiveOrg,
|
|
959
|
+
BillingLimitConfiguredCustom,
|
|
960
|
+
BillingLimitConfiguredNone,
|
|
961
|
+
BillingLimitConfiguredPlan,
|
|
962
|
+
BillingLimitPendingResolveOrg,
|
|
963
|
+
BillingLimitResult,
|
|
964
|
+
BillingLimitState,
|
|
965
|
+
BillingLimitUnconfigured,
|
|
966
|
+
BillingLimitsActiveResult,
|
|
967
|
+
BillingLimitsPendingResolvesResult,
|
|
811
968
|
CreatePrivateLinkConnectionBody,
|
|
812
969
|
CurrentPlan,
|
|
813
970
|
CustomerPortalRequestBodySchema,
|
|
@@ -818,6 +975,7 @@ var defaultMachine = "small-1x";
|
|
|
818
975
|
ErrorSchema,
|
|
819
976
|
FreeConnectRequiredSchema,
|
|
820
977
|
FreeConnectedSchema,
|
|
978
|
+
MAX_INVOCATION_COST_IN_CENTS,
|
|
821
979
|
PlanDefinitionSchema,
|
|
822
980
|
Plans,
|
|
823
981
|
PlansResult,
|
|
@@ -825,12 +983,14 @@ var defaultMachine = "small-1x";
|
|
|
825
983
|
PrivateLinkConnectionList,
|
|
826
984
|
PrivateLinkConnectionStatus,
|
|
827
985
|
PrivateLinkRegionsResult,
|
|
986
|
+
PromoCreditsResult,
|
|
828
987
|
RegistryCredentialsResponseSchema,
|
|
829
988
|
ReportComputeUsageEvent,
|
|
830
989
|
ReportInvocationUsageEvent,
|
|
831
990
|
ReportInvocationUsageResult,
|
|
832
991
|
ReportUsagePlan,
|
|
833
992
|
ReportUsageResult,
|
|
993
|
+
ResolveBillingLimitRequest,
|
|
834
994
|
SetAddOnBody,
|
|
835
995
|
SetAddOnResult,
|
|
836
996
|
SetPlanBodySchema,
|
|
@@ -839,10 +999,13 @@ var defaultMachine = "small-1x";
|
|
|
839
999
|
TriggerInitialDeploymentRequestSchema,
|
|
840
1000
|
TriggerInitialDeploymentResponseSchema,
|
|
841
1001
|
UpdateBillingAlertsRequest,
|
|
1002
|
+
UpdateBillingLimitRequest,
|
|
842
1003
|
UsageParams,
|
|
843
1004
|
UsageResult,
|
|
844
1005
|
UsageSeriesParams,
|
|
845
1006
|
UsageSeriesResult,
|
|
1007
|
+
ValidatePromoCodeBodySchema,
|
|
1008
|
+
ValidatePromoCodeResult,
|
|
846
1009
|
defaultMachine,
|
|
847
1010
|
machineDefinition,
|
|
848
1011
|
machines,
|