@trigger.dev/platform 1.0.26 → 1.0.27

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 CHANGED
@@ -430,6 +430,7 @@ var PrivateLinkConnection = import_zod11.z.object({
430
430
  status: PrivateLinkConnectionStatus,
431
431
  statusMessage: import_zod11.z.string().nullable(),
432
432
  endpointDnsName: import_zod11.z.string().nullable(),
433
+ endpointIps: import_zod11.z.array(import_zod11.z.string()).nullable(),
433
434
  provisionedAt: import_zod11.z.string().nullable(),
434
435
  createdAt: import_zod11.z.string(),
435
436
  updatedAt: import_zod11.z.string()
@@ -438,7 +439,10 @@ var PrivateLinkConnectionList = import_zod11.z.object({
438
439
  connections: import_zod11.z.array(PrivateLinkConnection)
439
440
  });
440
441
  var CreatePrivateLinkConnectionBody = import_zod11.z.object({
441
- name: import_zod11.z.string().min(1).max(100),
442
+ name: import_zod11.z.string().min(1).max(100).regex(
443
+ /^[a-zA-Z][a-zA-Z0-9 _-]*$/,
444
+ "Must start with a letter and contain only letters, numbers, spaces, hyphens, or underscores"
445
+ ),
442
446
  endpointServiceName: import_zod11.z.string().regex(
443
447
  /^com\.amazonaws\.vpce\..+\.vpce-svc-.+$/,
444
448
  "Must be a valid VPC Endpoint Service name (com.amazonaws.vpce.<region>.vpce-svc-*)"
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v3/index.ts","../src/v3/schemas/planDefinitions.ts","../src/v3/schemas/subscription.ts","../src/v3/schemas/subscribe.ts","../src/v3/schemas/portal.ts","../src/v3/schemas/error.ts","../src/v3/schemas/usage.ts","../src/v3/schemas/billingAlerts.ts","../src/v3/schemas/registryCredentials.ts","../src/v3/schemas/enqueueBuild.ts","../src/v3/schemas/initialDeployment.ts","../src/v3/schemas/privateLink.ts","../src/v3/client/index.ts","../src/v3/machineDefinition.ts","../src/v3/machinePresets.ts"],"sourcesContent":["export * from \"./schemas\";\nexport * from \"./client\";\nexport * from \"./machineDefinition\";\nexport * from \"./machinePresets\";\n","import { z } from \"zod\";\n\nconst ExceedableLimit = z.object({\n number: z.number(),\n canExceed: z.boolean().optional(),\n});\n\nexport type ExceedableLimit = z.infer<typeof ExceedableLimit>;\n\nconst EnvironmentBasedLimit = z.object({\n production: z.number(),\n staging: z.number(),\n preview: z.number(),\n development: z.number(),\n canExceed: z.boolean().optional(),\n // Legacy, return the `production` value\n number: z.number(),\n});\nexport type EnvironmentBasedLimit = z.infer<typeof EnvironmentBasedLimit>;\n\nconst BatchRateLimitConfig = z.object({\n type: z.string(),\n interval: z.string(),\n maxTokens: z.number(),\n refillRate: z.number(),\n});\nexport type BatchRateLimitConfig = z.infer<typeof BatchRateLimitConfig>;\n\nconst BatchQueueConcurrencyConfig = z.object({\n processingConcurrency: z.number(),\n});\nexport type BatchQueueConcurrencyConfig = z.infer<\n typeof BatchQueueConcurrencyConfig\n>;\n\nconst QueueSizeLimits = z.object({\n development: z.number(),\n deployed: z.number(),\n});\nexport type QueueSizeLimits = z.infer<typeof QueueSizeLimits>;\n\nconst Limits = z.object({\n includedUsage: z.number(),\n concurrentRuns: EnvironmentBasedLimit,\n teamMembers: ExceedableLimit,\n schedules: ExceedableLimit,\n logRetentionDays: ExceedableLimit,\n queryPeriodDays: ExceedableLimit,\n alerts: ExceedableLimit,\n hasStagingEnvironment: z.boolean(),\n realtimeConcurrentConnections: ExceedableLimit,\n branches: ExceedableLimit,\n support: z.enum([\"community\", \"slack\"]),\n batchRateLimitConfig: BatchRateLimitConfig.optional(),\n batchQueueConcurrencyConfig: BatchQueueConcurrencyConfig.optional(),\n metricDashboards: ExceedableLimit,\n metricWidgetsPerDashboard: ExceedableLimit,\n queueSizeLimits: QueueSizeLimits.optional(),\n hasPrivateNetworking: z.boolean().optional(),\n privateLinkConnectionLimit: z.number().optional(),\n});\n\nexport type Limits = z.infer<typeof Limits>;\n\nconst commonMetadata = {\n title: z.string(),\n code: z.string(),\n};\n\nconst pricingLookup = {\n tierPriceCode: z.string(),\n usagePriceCode: z.string(),\n usageCouponCode: z.string().optional(),\n};\nconst FreePlanDefinition = z.object({\n ...commonMetadata,\n type: z.literal(\"free\"),\n limits: Limits,\n});\nexport type FreePlanDefinition = z.infer<typeof FreePlanDefinition>;\n\nconst PaidPlanDefinition = z.object({\n ...commonMetadata,\n type: z.literal(\"paid\"),\n tierPrice: z.number(),\n stripe: z.object(pricingLookup),\n limits: Limits,\n});\nexport type PaidPlanDefinition = z.infer<typeof PaidPlanDefinition>;\n\nconst EnterprisePlanDefinition = z.object({\n ...commonMetadata,\n type: z.literal(\"enterprise\"),\n limits: Limits,\n});\nexport type EnterprisePlanDefinition = z.infer<typeof EnterprisePlanDefinition>;\n\nexport const PlanDefinitionSchema = z.discriminatedUnion(\"type\", [\n FreePlanDefinition,\n PaidPlanDefinition,\n EnterprisePlanDefinition,\n]);\nexport type PlanDefinition = z.infer<typeof PlanDefinitionSchema>;\n\nconst MachineDefinition = z.object({\n code: z.string(),\n title: z.string(),\n cpu: z.number(),\n memory: z.number(),\n centsPerMs: z.number(),\n});\n\nexport type MachineDefinition = z.infer<typeof MachineDefinition>;\n\nexport const Plans = z.object({\n free: FreePlanDefinition,\n hobby: PaidPlanDefinition,\n pro: PaidPlanDefinition,\n enterprise: EnterprisePlanDefinition,\n});\nexport type Plans = z.infer<typeof Plans>;\n\n/** The pricing per step of the add-on, e.g. $10 for 50 units */\nconst AddOnPricing = z.object({\n /** The step size - must purchase in multiples of this amount */\n stepSize: z.number(),\n /** Price per step in cents */\n centsPerStep: z.number(),\n});\nexport type AddOnPricing = z.infer<typeof AddOnPricing>;\n\nexport const PlansResult = z.object({\n plans: Plans,\n usagePricing: z.object({\n centsPerRunInvocation: z.number(),\n machines: z.record(z.string(), MachineDefinition),\n defaultMachine: z.string(),\n }),\n addOnPricing: z.object({\n concurrency: AddOnPricing,\n branches: AddOnPricing,\n seats: AddOnPricing,\n }),\n});\n\nexport type PlansResult = z.infer<typeof PlansResult>;\n\nexport const AddOnDefinition = z.object({\n code: z.enum([\"concurrency\", \"branches\", \"seats\"]),\n priceCode: z.string(),\n pricing: AddOnPricing,\n});\n\nexport type AddOnDefinition = z.infer<typeof AddOnDefinition>;\n\nexport const AddOn = z.object({\n purchased: z.number(),\n quota: z.number().optional(),\n});\nexport type AddOn = z.infer<typeof AddOn>;\n\nexport const AddOns = z.object({\n concurrentRuns: AddOn.optional(),\n branches: AddOn.optional(),\n seats: AddOn.optional(),\n});\nexport type AddOns = z.infer<typeof AddOns>;\n","import { z } from \"zod\";\nimport { AddOns, PlanDefinitionSchema } from \"./planDefinitions\";\n\nconst FreeTierStatus = z.enum([\"requires_connect\", \"approved\", \"rejected\"]);\nexport type FreeTierStatus = z.infer<typeof FreeTierStatus>;\n\nexport const SubscriptionResult = z.object({\n freeTierStatus: FreeTierStatus,\n isPaying: z.boolean(),\n canceledAt: z.string().optional(),\n plan: PlanDefinitionSchema.optional(),\n addOns: AddOns.optional(),\n});\n\nexport type SubscriptionResult = z.infer<typeof SubscriptionResult>;\n\nexport const CurrentPlan = z.object({\n //todo remove this after the next deploy\n subscription: z.any(),\n v3Subscription: SubscriptionResult,\n});\n\nexport type CurrentPlan = z.infer<typeof CurrentPlan>;\n","import { z } from \"zod\";\n\nconst SetPaidPlanBodySchema = z.object({\n type: z.literal(\"paid\"),\n planCode: z.string(),\n userId: z.string(),\n});\n\nconst SetFreePlanBodySchema = z.object({\n type: z.literal(\"free\"),\n userId: z.string(),\n});\n\nexport const SetPlanBodySchema = z.discriminatedUnion(\"type\", [\n SetPaidPlanBodySchema,\n SetFreePlanBodySchema,\n]);\n\nexport type SetPlanBody = z.infer<typeof SetPlanBodySchema>;\n\nexport const FreeConnectRequiredSchema = z.object({\n action: z.literal(\"free_connect_required\"),\n connectUrl: z.string().url(),\n});\n\nexport type FreeConnectRequired = z.infer<typeof FreeConnectRequiredSchema>;\n\nexport const FreeConnectedSchema = z.object({\n action: z.literal(\"free_connected\"),\n accepted: z.boolean(),\n});\n\nexport type FreeConnected = z.infer<typeof FreeConnectedSchema>;\n\nconst UpdatedSubscriptionResultSchema = z.object({\n action: z.literal(\"updated_subscription\"),\n subscription: z.object({\n planCode: z.string(),\n }),\n});\n\nexport type UpdatedSubscriptionResult = z.infer<\n typeof UpdatedSubscriptionResultSchema\n>;\n\nconst CreateSubscriptionFlowStartSchema = z.object({\n action: z.literal(\"create_subscription_flow_start\"),\n subscription: z.object({\n planCode: z.string(),\n }),\n checkoutUrl: z.string().url(),\n});\n\nexport type CreateSubscriptionFlowStart = z.infer<\n typeof CreateSubscriptionFlowStartSchema\n>;\n\nconst CanceledSubscriptionResultSchema = z.object({\n action: z.literal(\"canceled_subscription\"),\n});\n\nexport type CanceledSubscriptionResult = z.infer<\n typeof CanceledSubscriptionResultSchema\n>;\n\nexport const SubscribeResultSchema = z.discriminatedUnion(\"action\", [\n FreeConnectRequiredSchema,\n FreeConnectedSchema,\n CreateSubscriptionFlowStartSchema,\n UpdatedSubscriptionResultSchema,\n CanceledSubscriptionResultSchema,\n]);\n\nexport type SubscribeResult = z.infer<typeof SubscribeResultSchema>;\n\nexport const SetAddOnBody = z.object({\n type: z.enum([\"concurrency\", \"branches\", \"seats\"]),\n amount: z.number(),\n});\n\nexport type SetAddOnBody = z.infer<typeof SetAddOnBody>;\n\nexport const SetAddOnResult = z.discriminatedUnion(\"result\", [\n z.object({\n result: z.literal(\"error\"),\n error: z.string(),\n }),\n z.object({\n result: z.literal(\"success\"),\n type: z.string(),\n amount: z.number(),\n subscription: z.object({\n id: z.string(),\n }),\n }),\n z.object({\n result: z.literal(\"max_quota_reached\"),\n type: z.string(),\n maxQuota: z.number(),\n }),\n]);\n\nexport type SetAddOnResult = z.infer<typeof SetAddOnResult>;\n","import { z } from \"zod\";\n\nexport const CustomerPortalRequestBodySchema = z.object({\n returnUrl: z.string(),\n});\n\nexport type CustomerPortalRequestBody = z.infer<\n typeof CustomerPortalRequestBodySchema\n>;\n\nexport const CustomerPortalSchema = z.object({\n customerPortalUrl: z.string().optional(),\n});\n\nexport type CustomerPortal = z.infer<typeof CustomerPortalSchema>;\n","import { z } from \"zod\";\n\nexport const ErrorSchema = z.object({\n error: z.string(),\n});\n\nexport type Error = z.infer<typeof ErrorSchema>;\n","import { z } from \"zod\";\n\nexport const UsageParams = z.object({\n from: z.coerce.date(),\n to: z.coerce.date(),\n});\nexport type UsageParams = z.infer<typeof UsageParams>;\n\nexport const UsageResult = z.object({\n cents: z.number(),\n});\nexport type UsageResult = z.infer<typeof UsageResult>;\n\nconst Window = z.enum([\"MINUTE\", \"HOUR\", \"DAY\"]);\n\nconst BooleanParam = z.preprocess(\n (val) => (val === \"true\" ? true : false),\n z.boolean()\n);\n\nexport const UsageSeriesParams = z.object({\n from: z.coerce.date(),\n to: z.coerce.date(),\n /** defaults to DAY */\n window: Window.optional(),\n timezone: z.string().optional(),\n //these don't work at the moment because you can't group by items that aren't defined in the meter group by\n // groupByEnvironmentType: BooleanParam.optional(),\n // groupByTaskIdentifier: BooleanParam.optional(),\n});\n\nexport type UsageSeriesParams = z.infer<typeof UsageSeriesParams>;\n\nexport const UsageSeriesResult = z.object({\n from: z.string(),\n to: z.string(),\n window: Window.optional(),\n data: z\n .object({\n value: z.number(),\n windowStart: z.string(),\n windowEnd: z.string(),\n //these don't work at the moment\n // groupBy: z\n // .object({\n // environmentType: z.string().optional(),\n // taskIdentifer: z.string().optional(),\n // })\n // .optional(),\n })\n .array(),\n});\n\nexport type UsageSeriesResult = z.infer<typeof UsageSeriesResult>;\n\nexport const ReportComputeUsageEvent = z.object({\n durationMs: z.number(),\n});\n\nexport type ReportComputeUsageEvent = z.infer<typeof ReportComputeUsageEvent>;\n\nexport const ReportUsagePlan = z.object({\n type: z.string(),\n code: z.string(),\n isPaying: z.boolean(),\n});\n\nexport type ReportUsagePlan = z.infer<typeof ReportUsagePlan>;\n\nexport const ReportUsageResult = z.object({\n hasAccess: z.boolean(),\n balance: z.number().optional(),\n usage: z.number().optional(),\n overage: z.number().optional(),\n plan: ReportUsagePlan.optional(),\n});\n\nexport type ReportUsageResult = z.infer<typeof ReportUsageResult>;\n\nexport const ReportInvocationUsageEvent = z.object({\n organizationId: z.string(),\n costInCents: z.number(),\n additionalData: z.record(z.any()).optional(),\n});\n\nexport type ReportInvocationUsageEvent = z.infer<\n typeof ReportInvocationUsageEvent\n>;\n\nexport const ReportInvocationUsageResult = z.discriminatedUnion(\"success\", [\n z.object({\n success: z.literal(true),\n }),\n z.object({\n success: z.literal(false),\n error: z.string(),\n }),\n]);\n","import { z } from \"zod\";\n\nconst BillingAlertDefinition = z.object({\n amount: z.number(),\n emails: z.array(z.string()),\n alertLevels: z.array(z.number()),\n});\n\nexport const BillingAlertsResult = BillingAlertDefinition;\n\nexport type BillingAlertsResult = z.infer<typeof BillingAlertsResult>;\n\nexport const UpdateBillingAlertsRequest = z.object({\n amount: z.number(),\n emails: z.array(z.string()),\n alertLevels: z.array(z.number()),\n});\n\nexport type UpdateBillingAlertsRequest = z.infer<\n typeof UpdateBillingAlertsRequest\n>;\n","import { z } from \"zod\";\n\nexport const RegistryCredentialsResponseSchema = z.object({\n username: z.string(),\n password: z.string(),\n expiresAt: z.string().datetime(),\n repositoryUri: z.string(),\n});\n\nexport type RegistryCredentialsResponse = z.infer<\n typeof RegistryCredentialsResponseSchema\n>;\n","import { z } from \"zod\";\n\nexport const EnqueueBuildRequestSchema = z.object({\n deploymentId: z.string(),\n artifactKey: z.string(),\n options: z.object({\n skipPromotion: z.boolean().optional(),\n configFilePath: z.string().optional(),\n }),\n});\n\nexport type EnqueueBuildRequest = z.infer<typeof EnqueueBuildRequestSchema>;\n\nexport const EnqueueBuildResponseSchema = z.object({\n buildId: z.string(),\n});\n\nexport type EnqueueBuildResponse = z.infer<typeof EnqueueBuildResponseSchema>;\n","import { z } from \"zod\";\n\nexport const TriggerInitialDeploymentRequestSchema = z.object({\n environment: z.enum([\"prod\", \"staging\", \"preview\"]),\n});\n\nexport type TriggerInitialDeploymentRequest = z.infer<typeof TriggerInitialDeploymentRequestSchema>;\n\nexport const TriggerInitialDeploymentResponseSchema = z.object({\n ok: z.boolean(),\n});\n\nexport type TriggerInitialDeploymentResponse = z.infer<\n typeof TriggerInitialDeploymentResponseSchema\n>;\n","import { z } from \"zod\";\n\nexport const PrivateLinkConnectionStatus = z.enum([\n \"PENDING\",\n \"PROVISIONING\",\n \"ACTIVE\",\n \"ERROR\",\n \"DELETING\",\n]);\nexport type PrivateLinkConnectionStatus = z.infer<typeof PrivateLinkConnectionStatus>;\n\nexport const PrivateLinkConnection = z.object({\n id: z.string(),\n friendlyId: z.string(),\n name: z.string(),\n organizationId: z.string(),\n endpointServiceName: z.string(),\n targetRegion: z.string(),\n status: PrivateLinkConnectionStatus,\n statusMessage: z.string().nullable(),\n endpointDnsName: z.string().nullable(),\n provisionedAt: z.string().nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\nexport type PrivateLinkConnection = z.infer<typeof PrivateLinkConnection>;\n\nexport const PrivateLinkConnectionList = z.object({\n connections: z.array(PrivateLinkConnection),\n});\nexport type PrivateLinkConnectionList = z.infer<typeof PrivateLinkConnectionList>;\n\nexport const CreatePrivateLinkConnectionBody = z.object({\n name: z.string().min(1).max(100),\n endpointServiceName: z\n .string()\n .regex(\n /^com\\.amazonaws\\.vpce\\..+\\.vpce-svc-.+$/,\n \"Must be a valid VPC Endpoint Service name (com.amazonaws.vpce.<region>.vpce-svc-*)\"\n ),\n targetRegion: z.enum([\"us-east-1\", \"eu-central-1\"]),\n});\nexport type CreatePrivateLinkConnectionBody = z.infer<typeof CreatePrivateLinkConnectionBody>;\n\nexport const DeletePrivateLinkResult = z.object({\n success: z.boolean(),\n});\nexport type DeletePrivateLinkResult = z.infer<typeof DeletePrivateLinkResult>;\n\nexport const PrivateLinkRegionsResult = z.object({\n availableRegions: z.array(z.string()),\n activeRegions: z.array(z.string()),\n});\nexport type PrivateLinkRegionsResult = z.infer<typeof PrivateLinkRegionsResult>;\n","import { ZodType, z } from \"zod\";\nimport {\n BillingAlertsResult,\n CurrentPlan,\n CustomerPortalRequestBody,\n CustomerPortalSchema,\n ErrorSchema,\n PlansResult,\n ReportInvocationUsageEvent,\n ReportInvocationUsageResult,\n ReportUsageResult,\n SetPlanBody,\n SubscribeResultSchema,\n UpdateBillingAlertsRequest,\n UsageParams,\n UsageResult,\n UsageSeriesParams,\n UsageSeriesResult,\n RegistryCredentialsResponseSchema,\n SetAddOnResult,\n SetAddOnBody,\n EnqueueBuildResponseSchema,\n EnqueueBuildRequest,\n TriggerInitialDeploymentRequest,\n TriggerInitialDeploymentResponseSchema,\n PrivateLinkConnectionList,\n PrivateLinkConnection,\n CreatePrivateLinkConnectionBody,\n DeletePrivateLinkResult,\n PrivateLinkRegionsResult,\n} from \"../schemas\";\n\ntype BillingClientConfig = {\n url: string;\n apiKey: string;\n};\n\ntype SuccessResult<TSchema extends ZodType> = {\n success: true;\n} & z.infer<TSchema>;\n\ntype ErrorResult = {\n success: false;\n error: string;\n};\n\ntype Result<TSchema extends ZodType> = SuccessResult<TSchema> | ErrorResult;\n\nexport type PlansResponse = Result<typeof PlansResult>;\nexport type CurrentPlanResponse = Result<typeof CurrentPlan>;\nexport type SetPlanResponse = Result<typeof SubscribeResultSchema>;\nexport type CustomerPortalResponse = Result<typeof CustomerPortalSchema>;\nexport type UsageResponse = Result<typeof UsageResult>;\nexport type UsageSeriesResponse = Result<typeof UsageSeriesResult>;\nexport type UsageInvocationReportResponse = Result<\n typeof ReportInvocationUsageResult\n>;\nexport type UsageEntitlementResponse = Result<typeof ReportUsageResult>;\nexport type BillingAlertsResponse = Result<typeof BillingAlertsResult>;\nexport type RegistryCredentialsResult = Result<\n typeof RegistryCredentialsResponseSchema\n>;\nexport type SetAddOnResponse = Result<typeof SetAddOnResult>;\nexport type EnqueueBuildResult = Result<typeof EnqueueBuildResponseSchema>;\nexport type PrivateLinkConnectionListResponse = Result<\n typeof PrivateLinkConnectionList\n>;\nexport type PrivateLinkConnectionResponse = Result<\n typeof PrivateLinkConnection\n>;\nexport type DeletePrivateLinkResponse = Result<typeof DeletePrivateLinkResult>;\nexport type PrivateLinkRegionsResponse = Result<typeof PrivateLinkRegionsResult>;\nexport type TriggerInitialDeploymentResult = Result<\n typeof TriggerInitialDeploymentResponseSchema\n>;\n\nexport class BillingClient {\n constructor(private readonly config: BillingClientConfig) {}\n\n async plans(): Promise<PlansResponse> {\n return await this.fetch(`/api/v1/plans/v3`, PlansResult);\n }\n\n async currentPlan(orgId: string): Promise<CurrentPlanResponse> {\n return await this.fetch(`/api/v1/orgs/${orgId}`, CurrentPlan);\n }\n\n async usage(orgId: string, params: UsageParams): Promise<UsageResponse> {\n const search = objectToSearchParams(params);\n return await this.fetch(\n `/api/v1/orgs/${orgId}/usage?${search?.toString()}`,\n UsageResult\n );\n }\n\n async usageSeries(\n orgId: string,\n params: UsageSeriesParams\n ): Promise<UsageSeriesResponse> {\n const search = objectToSearchParams(params);\n return await this.fetch(\n `/api/v1/orgs/${orgId}/usage/series?${search?.toString()}`,\n UsageSeriesResult\n );\n }\n\n async setPlan(orgId: string, body: SetPlanBody): Promise<SetPlanResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/v3/subscription`,\n SubscribeResultSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async setAddOn(orgId: string, body: SetAddOnBody): Promise<SetAddOnResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/v3/subscription/addon`,\n SetAddOnResult,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async createPortalSession(\n orgId: string,\n body: CustomerPortalRequestBody\n ): Promise<CustomerPortalResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/v3/subscription/portal`,\n CustomerPortalSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n /**\n *\n * @param event The data is in the body, not using a JWT\n * @returns details about usage\n */\n async reportInvocationUsage(\n event: ReportInvocationUsageEvent\n ): Promise<UsageInvocationReportResponse> {\n return await this.fetch(\n `/api/v1/usage/ingest/invocation`,\n ReportInvocationUsageResult,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(event),\n }\n );\n }\n\n /**\n * Generates registry credentials for a project. This is used to push images to a project's container repository.\n *\n * @param projectId The ID of the project\n * @param region The region to generate credentials for\n * @returns The registry credentials\n */\n async generateRegistryCredentials(\n projectId: string,\n region: \"us-east-1\" | \"eu-central-1\"\n ): Promise<RegistryCredentialsResult> {\n return await this.fetch(\n `/api/v1/projects/${projectId}/generate-registry-credentials`,\n RegistryCredentialsResponseSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ region }),\n }\n );\n }\n\n /**\n * Enqueues a build for a project deployment.\n *\n * @param projectId The ID of the project\n * @param body The enqueue build request containing the deployment ID\n * @returns The build ID\n */\n async enqueueBuild(\n projectId: string,\n body: EnqueueBuildRequest\n ): Promise<EnqueueBuildResult> {\n return await this.fetch(\n `/api/v1/projects/${projectId}/enqueue-build`,\n EnqueueBuildResponseSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n /**\n *\n * @param event The data is in the body, not using a JWT\n * @returns details about usage\n */\n async getEntitlement(orgId: string): Promise<UsageEntitlementResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/usage/entitlement`,\n ReportUsageResult\n );\n }\n\n async getBillingAlerts(orgId: string): Promise<BillingAlertsResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/billing-alerts`,\n BillingAlertsResult\n );\n }\n\n async updateBillingAlerts(\n orgId: string,\n body: UpdateBillingAlertsRequest\n ): Promise<BillingAlertsResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/billing-alerts`,\n BillingAlertsResult,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async getPrivateLinks(\n orgId: string\n ): Promise<PrivateLinkConnectionListResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections`,\n PrivateLinkConnectionList\n );\n }\n\n async createPrivateLink(\n orgId: string,\n body: CreatePrivateLinkConnectionBody\n ): Promise<PrivateLinkConnectionResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections`,\n PrivateLinkConnection,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async deletePrivateLink(\n orgId: string,\n connectionId: string\n ): Promise<DeletePrivateLinkResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections/${connectionId}`,\n DeletePrivateLinkResult,\n {\n method: \"DELETE\",\n }\n );\n }\n\n async getPrivateLinkRegions(\n orgId: string\n ): Promise<PrivateLinkRegionsResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections/regions`,\n PrivateLinkRegionsResult\n );\n }\n\n async triggerInitialDeployment(\n projectId: string,\n body: TriggerInitialDeploymentRequest\n ): Promise<TriggerInitialDeploymentResult> {\n return await this.fetch(\n `/api/v1/projects/${projectId}/initial-deployment`,\n TriggerInitialDeploymentResponseSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async fetch<TSchema extends ZodType = z.ZodTypeAny>(\n path: string,\n schema: TSchema,\n requestInit?: RequestInit\n ): Promise<Result<TSchema>> {\n const response = await fetch(`${this.config.url}${path}`, {\n ...requestInit,\n headers: {\n ...requestInit?.headers,\n Authorization: `Bearer ${this.config.apiKey}`,\n },\n });\n\n if (!response.ok) {\n const json = await response.json();\n const parsedError = ErrorSchema.parse(json);\n return {\n success: false,\n error: parsedError.error,\n };\n }\n\n const json = await response.json();\n const parsed = schema.parse(json);\n return {\n success: true,\n ...parsed,\n };\n }\n}\n\nexport function objectToSearchParams(\n obj:\n | undefined\n | Record<\n string,\n | string\n | string[]\n | number\n | number[]\n | boolean\n | boolean[]\n | Date\n | Date[]\n | undefined\n >\n): URLSearchParams | undefined {\n if (!obj) return undefined;\n\n const searchParams = new URLSearchParams();\n //for each item add to the search params, skip undefined and join arrays with commas\n Object.entries(obj).forEach(([key, value]) => {\n if (value === undefined) return;\n if (Array.isArray(value)) {\n const values = value.map((d) => {\n if (d instanceof Date) return d.toISOString();\n return d;\n });\n\n searchParams.append(key, values.join(\",\"));\n } else {\n const v = value instanceof Date ? value.toISOString() : value;\n searchParams.append(key, v.toString());\n }\n });\n\n return searchParams;\n}\n","import { MachineDefinition } from \"./schemas\";\n\nexport type MachineDefinitionInput = {\n code: string;\n title: string;\n cpu: number;\n memory: number;\n centsPerVCpuSecond: number;\n centsPerGbRamSecond: number;\n};\n\nexport function machineDefinition({\n code,\n title,\n cpu,\n memory,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n}: MachineDefinitionInput): MachineDefinition {\n const centsPerSecond =\n cpu * centsPerVCpuSecond + memory * centsPerGbRamSecond;\n const centsPerMs = centsPerSecond / 1000;\n return {\n code,\n title,\n cpu,\n memory,\n centsPerMs,\n };\n}\n","import { machineDefinition } from \"./machineDefinition\";\n\nconst centsPerVCpuSecond = Number(process.env.CENTS_PER_VCPU_SECOND ?? 0);\nconst centsPerGbRamSecond = Number(process.env.CENTS_PER_GB_RAM_SECOND ?? 0);\n\nexport const machines = {\n micro: machineDefinition({\n code: \"micro\",\n title: \"Micro\",\n cpu: 0.25,\n memory: 0.25,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"small-1x\": machineDefinition({\n code: \"small-1x\",\n title: \"Small 1x\",\n cpu: 0.5,\n memory: 0.5,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"small-2x\": machineDefinition({\n code: \"small-2x\",\n title: \"Small 2x\",\n cpu: 1,\n memory: 1,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"medium-1x\": machineDefinition({\n code: \"medium-1x\",\n title: \"Medium 1x\",\n cpu: 1,\n memory: 2,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"medium-2x\": machineDefinition({\n code: \"medium-2x\",\n title: \"Medium 2x\",\n cpu: 2,\n memory: 4,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"large-1x\": machineDefinition({\n code: \"large-1x\",\n title: \"Large 1x\",\n cpu: 4,\n memory: 8,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"large-2x\": machineDefinition({\n code: \"large-2x\",\n title: \"Large 2x\",\n cpu: 8,\n memory: 16,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n};\n\nexport type MachineCode = keyof typeof machines;\n\nexport const defaultMachine: MachineCode = \"small-1x\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAElB,IAAM,kBAAkB,aAAE,OAAO;AAAA,EAC/B,QAAQ,aAAE,OAAO;AAAA,EACjB,WAAW,aAAE,QAAQ,EAAE,SAAS;AAClC,CAAC;AAID,IAAM,wBAAwB,aAAE,OAAO;AAAA,EACrC,YAAY,aAAE,OAAO;AAAA,EACrB,SAAS,aAAE,OAAO;AAAA,EAClB,SAAS,aAAE,OAAO;AAAA,EAClB,aAAa,aAAE,OAAO;AAAA,EACtB,WAAW,aAAE,QAAQ,EAAE,SAAS;AAAA;AAAA,E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A,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,aAAa,kBAAkB;AAAA,IAC7B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,aAAa,kBAAkB;AAAA,IAC7B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAIO,IAAM,iBAA8B;","names":["import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","json","centsPerVCpuSecond","centsPerGbRamSecond"]}
1
+ {"version":3,"sources":["../src/v3/index.ts","../src/v3/schemas/planDefinitions.ts","../src/v3/schemas/subscription.ts","../src/v3/schemas/subscribe.ts","../src/v3/schemas/portal.ts","../src/v3/schemas/error.ts","../src/v3/schemas/usage.ts","../src/v3/schemas/billingAlerts.ts","../src/v3/schemas/registryCredentials.ts","../src/v3/schemas/enqueueBuild.ts","../src/v3/schemas/initialDeployment.ts","../src/v3/schemas/privateLink.ts","../src/v3/client/index.ts","../src/v3/machineDefinition.ts","../src/v3/machinePresets.ts"],"sourcesContent":["export * from \"./schemas\";\nexport * from \"./client\";\nexport * from \"./machineDefinition\";\nexport * from \"./machinePresets\";\n","import { z } from \"zod\";\n\nconst ExceedableLimit = z.object({\n number: z.number(),\n canExceed: z.boolean().optional(),\n});\n\nexport type ExceedableLimit = z.infer<typeof ExceedableLimit>;\n\nconst EnvironmentBasedLimit = z.object({\n production: z.number(),\n staging: z.number(),\n preview: z.number(),\n development: z.number(),\n canExceed: z.boolean().optional(),\n // Legacy, return the `production` value\n number: z.number(),\n});\nexport type EnvironmentBasedLimit = z.infer<typeof EnvironmentBasedLimit>;\n\nconst BatchRateLimitConfig = z.object({\n type: z.string(),\n interval: z.string(),\n maxTokens: z.number(),\n refillRate: z.number(),\n});\nexport type BatchRateLimitConfig = z.infer<typeof BatchRateLimitConfig>;\n\nconst BatchQueueConcurrencyConfig = z.object({\n processingConcurrency: z.number(),\n});\nexport type BatchQueueConcurrencyConfig = z.infer<\n typeof BatchQueueConcurrencyConfig\n>;\n\nconst QueueSizeLimits = z.object({\n development: z.number(),\n deployed: z.number(),\n});\nexport type QueueSizeLimits = z.infer<typeof QueueSizeLimits>;\n\nconst Limits = z.object({\n includedUsage: z.number(),\n concurrentRuns: EnvironmentBasedLimit,\n teamMembers: ExceedableLimit,\n schedules: ExceedableLimit,\n logRetentionDays: ExceedableLimit,\n queryPeriodDays: ExceedableLimit,\n alerts: ExceedableLimit,\n hasStagingEnvironment: z.boolean(),\n realtimeConcurrentConnections: ExceedableLimit,\n branches: ExceedableLimit,\n support: z.enum([\"community\", \"slack\"]),\n batchRateLimitConfig: BatchRateLimitConfig.optional(),\n batchQueueConcurrencyConfig: BatchQueueConcurrencyConfig.optional(),\n metricDashboards: ExceedableLimit,\n metricWidgetsPerDashboard: ExceedableLimit,\n queueSizeLimits: QueueSizeLimits.optional(),\n hasPrivateNetworking: z.boolean().optional(),\n privateLinkConnectionLimit: z.number().optional(),\n});\n\nexport type Limits = z.infer<typeof Limits>;\n\nconst commonMetadata = {\n title: z.string(),\n code: z.string(),\n};\n\nconst pricingLookup = {\n tierPriceCode: z.string(),\n usagePriceCode: z.string(),\n usageCouponCode: z.string().optional(),\n};\nconst FreePlanDefinition = z.object({\n ...commonMetadata,\n type: z.literal(\"free\"),\n limits: Limits,\n});\nexport type FreePlanDefinition = z.infer<typeof FreePlanDefinition>;\n\nconst PaidPlanDefinition = z.object({\n ...commonMetadata,\n type: z.literal(\"paid\"),\n tierPrice: z.number(),\n stripe: z.object(pricingLookup),\n limits: Limits,\n});\nexport type PaidPlanDefinition = z.infer<typeof PaidPlanDefinition>;\n\nconst EnterprisePlanDefinition = z.object({\n ...commonMetadata,\n type: z.literal(\"enterprise\"),\n limits: Limits,\n});\nexport type EnterprisePlanDefinition = z.infer<typeof EnterprisePlanDefinition>;\n\nexport const PlanDefinitionSchema = z.discriminatedUnion(\"type\", [\n FreePlanDefinition,\n PaidPlanDefinition,\n EnterprisePlanDefinition,\n]);\nexport type PlanDefinition = z.infer<typeof PlanDefinitionSchema>;\n\nconst MachineDefinition = z.object({\n code: z.string(),\n title: z.string(),\n cpu: z.number(),\n memory: z.number(),\n centsPerMs: z.number(),\n});\n\nexport type MachineDefinition = z.infer<typeof MachineDefinition>;\n\nexport const Plans = z.object({\n free: FreePlanDefinition,\n hobby: PaidPlanDefinition,\n pro: PaidPlanDefinition,\n enterprise: EnterprisePlanDefinition,\n});\nexport type Plans = z.infer<typeof Plans>;\n\n/** The pricing per step of the add-on, e.g. $10 for 50 units */\nconst AddOnPricing = z.object({\n /** The step size - must purchase in multiples of this amount */\n stepSize: z.number(),\n /** Price per step in cents */\n centsPerStep: z.number(),\n});\nexport type AddOnPricing = z.infer<typeof AddOnPricing>;\n\nexport const PlansResult = z.object({\n plans: Plans,\n usagePricing: z.object({\n centsPerRunInvocation: z.number(),\n machines: z.record(z.string(), MachineDefinition),\n defaultMachine: z.string(),\n }),\n addOnPricing: z.object({\n concurrency: AddOnPricing,\n branches: AddOnPricing,\n seats: AddOnPricing,\n }),\n});\n\nexport type PlansResult = z.infer<typeof PlansResult>;\n\nexport const AddOnDefinition = z.object({\n code: z.enum([\"concurrency\", \"branches\", \"seats\"]),\n priceCode: z.string(),\n pricing: AddOnPricing,\n});\n\nexport type AddOnDefinition = z.infer<typeof AddOnDefinition>;\n\nexport const AddOn = z.object({\n purchased: z.number(),\n quota: z.number().optional(),\n});\nexport type AddOn = z.infer<typeof AddOn>;\n\nexport const AddOns = z.object({\n concurrentRuns: AddOn.optional(),\n branches: AddOn.optional(),\n seats: AddOn.optional(),\n});\nexport type AddOns = z.infer<typeof AddOns>;\n","import { z } from \"zod\";\nimport { AddOns, PlanDefinitionSchema } from \"./planDefinitions\";\n\nconst FreeTierStatus = z.enum([\"requires_connect\", \"approved\", \"rejected\"]);\nexport type FreeTierStatus = z.infer<typeof FreeTierStatus>;\n\nexport const SubscriptionResult = z.object({\n freeTierStatus: FreeTierStatus,\n isPaying: z.boolean(),\n canceledAt: z.string().optional(),\n plan: PlanDefinitionSchema.optional(),\n addOns: AddOns.optional(),\n});\n\nexport type SubscriptionResult = z.infer<typeof SubscriptionResult>;\n\nexport const CurrentPlan = z.object({\n //todo remove this after the next deploy\n subscription: z.any(),\n v3Subscription: SubscriptionResult,\n});\n\nexport type CurrentPlan = z.infer<typeof CurrentPlan>;\n","import { z } from \"zod\";\n\nconst SetPaidPlanBodySchema = z.object({\n type: z.literal(\"paid\"),\n planCode: z.string(),\n userId: z.string(),\n});\n\nconst SetFreePlanBodySchema = z.object({\n type: z.literal(\"free\"),\n userId: z.string(),\n});\n\nexport const SetPlanBodySchema = z.discriminatedUnion(\"type\", [\n SetPaidPlanBodySchema,\n SetFreePlanBodySchema,\n]);\n\nexport type SetPlanBody = z.infer<typeof SetPlanBodySchema>;\n\nexport const FreeConnectRequiredSchema = z.object({\n action: z.literal(\"free_connect_required\"),\n connectUrl: z.string().url(),\n});\n\nexport type FreeConnectRequired = z.infer<typeof FreeConnectRequiredSchema>;\n\nexport const FreeConnectedSchema = z.object({\n action: z.literal(\"free_connected\"),\n accepted: z.boolean(),\n});\n\nexport type FreeConnected = z.infer<typeof FreeConnectedSchema>;\n\nconst UpdatedSubscriptionResultSchema = z.object({\n action: z.literal(\"updated_subscription\"),\n subscription: z.object({\n planCode: z.string(),\n }),\n});\n\nexport type UpdatedSubscriptionResult = z.infer<\n typeof UpdatedSubscriptionResultSchema\n>;\n\nconst CreateSubscriptionFlowStartSchema = z.object({\n action: z.literal(\"create_subscription_flow_start\"),\n subscription: z.object({\n planCode: z.string(),\n }),\n checkoutUrl: z.string().url(),\n});\n\nexport type CreateSubscriptionFlowStart = z.infer<\n typeof CreateSubscriptionFlowStartSchema\n>;\n\nconst CanceledSubscriptionResultSchema = z.object({\n action: z.literal(\"canceled_subscription\"),\n});\n\nexport type CanceledSubscriptionResult = z.infer<\n typeof CanceledSubscriptionResultSchema\n>;\n\nexport const SubscribeResultSchema = z.discriminatedUnion(\"action\", [\n FreeConnectRequiredSchema,\n FreeConnectedSchema,\n CreateSubscriptionFlowStartSchema,\n UpdatedSubscriptionResultSchema,\n CanceledSubscriptionResultSchema,\n]);\n\nexport type SubscribeResult = z.infer<typeof SubscribeResultSchema>;\n\nexport const SetAddOnBody = z.object({\n type: z.enum([\"concurrency\", \"branches\", \"seats\"]),\n amount: z.number(),\n});\n\nexport type SetAddOnBody = z.infer<typeof SetAddOnBody>;\n\nexport const SetAddOnResult = z.discriminatedUnion(\"result\", [\n z.object({\n result: z.literal(\"error\"),\n error: z.string(),\n }),\n z.object({\n result: z.literal(\"success\"),\n type: z.string(),\n amount: z.number(),\n subscription: z.object({\n id: z.string(),\n }),\n }),\n z.object({\n result: z.literal(\"max_quota_reached\"),\n type: z.string(),\n maxQuota: z.number(),\n }),\n]);\n\nexport type SetAddOnResult = z.infer<typeof SetAddOnResult>;\n","import { z } from \"zod\";\n\nexport const CustomerPortalRequestBodySchema = z.object({\n returnUrl: z.string(),\n});\n\nexport type CustomerPortalRequestBody = z.infer<\n typeof CustomerPortalRequestBodySchema\n>;\n\nexport const CustomerPortalSchema = z.object({\n customerPortalUrl: z.string().optional(),\n});\n\nexport type CustomerPortal = z.infer<typeof CustomerPortalSchema>;\n","import { z } from \"zod\";\n\nexport const ErrorSchema = z.object({\n error: z.string(),\n});\n\nexport type Error = z.infer<typeof ErrorSchema>;\n","import { z } from \"zod\";\n\nexport const UsageParams = z.object({\n from: z.coerce.date(),\n to: z.coerce.date(),\n});\nexport type UsageParams = z.infer<typeof UsageParams>;\n\nexport const UsageResult = z.object({\n cents: z.number(),\n});\nexport type UsageResult = z.infer<typeof UsageResult>;\n\nconst Window = z.enum([\"MINUTE\", \"HOUR\", \"DAY\"]);\n\nconst BooleanParam = z.preprocess(\n (val) => (val === \"true\" ? true : false),\n z.boolean()\n);\n\nexport const UsageSeriesParams = z.object({\n from: z.coerce.date(),\n to: z.coerce.date(),\n /** defaults to DAY */\n window: Window.optional(),\n timezone: z.string().optional(),\n //these don't work at the moment because you can't group by items that aren't defined in the meter group by\n // groupByEnvironmentType: BooleanParam.optional(),\n // groupByTaskIdentifier: BooleanParam.optional(),\n});\n\nexport type UsageSeriesParams = z.infer<typeof UsageSeriesParams>;\n\nexport const UsageSeriesResult = z.object({\n from: z.string(),\n to: z.string(),\n window: Window.optional(),\n data: z\n .object({\n value: z.number(),\n windowStart: z.string(),\n windowEnd: z.string(),\n //these don't work at the moment\n // groupBy: z\n // .object({\n // environmentType: z.string().optional(),\n // taskIdentifer: z.string().optional(),\n // })\n // .optional(),\n })\n .array(),\n});\n\nexport type UsageSeriesResult = z.infer<typeof UsageSeriesResult>;\n\nexport const ReportComputeUsageEvent = z.object({\n durationMs: z.number(),\n});\n\nexport type ReportComputeUsageEvent = z.infer<typeof ReportComputeUsageEvent>;\n\nexport const ReportUsagePlan = z.object({\n type: z.string(),\n code: z.string(),\n isPaying: z.boolean(),\n});\n\nexport type ReportUsagePlan = z.infer<typeof ReportUsagePlan>;\n\nexport const ReportUsageResult = z.object({\n hasAccess: z.boolean(),\n balance: z.number().optional(),\n usage: z.number().optional(),\n overage: z.number().optional(),\n plan: ReportUsagePlan.optional(),\n});\n\nexport type ReportUsageResult = z.infer<typeof ReportUsageResult>;\n\nexport const ReportInvocationUsageEvent = z.object({\n organizationId: z.string(),\n costInCents: z.number(),\n additionalData: z.record(z.any()).optional(),\n});\n\nexport type ReportInvocationUsageEvent = z.infer<\n typeof ReportInvocationUsageEvent\n>;\n\nexport const ReportInvocationUsageResult = z.discriminatedUnion(\"success\", [\n z.object({\n success: z.literal(true),\n }),\n z.object({\n success: z.literal(false),\n error: z.string(),\n }),\n]);\n","import { z } from \"zod\";\n\nconst BillingAlertDefinition = z.object({\n amount: z.number(),\n emails: z.array(z.string()),\n alertLevels: z.array(z.number()),\n});\n\nexport const BillingAlertsResult = BillingAlertDefinition;\n\nexport type BillingAlertsResult = z.infer<typeof BillingAlertsResult>;\n\nexport const UpdateBillingAlertsRequest = z.object({\n amount: z.number(),\n emails: z.array(z.string()),\n alertLevels: z.array(z.number()),\n});\n\nexport type UpdateBillingAlertsRequest = z.infer<\n typeof UpdateBillingAlertsRequest\n>;\n","import { z } from \"zod\";\n\nexport const RegistryCredentialsResponseSchema = z.object({\n username: z.string(),\n password: z.string(),\n expiresAt: z.string().datetime(),\n repositoryUri: z.string(),\n});\n\nexport type RegistryCredentialsResponse = z.infer<\n typeof RegistryCredentialsResponseSchema\n>;\n","import { z } from \"zod\";\n\nexport const EnqueueBuildRequestSchema = z.object({\n deploymentId: z.string(),\n artifactKey: z.string(),\n options: z.object({\n skipPromotion: z.boolean().optional(),\n configFilePath: z.string().optional(),\n }),\n});\n\nexport type EnqueueBuildRequest = z.infer<typeof EnqueueBuildRequestSchema>;\n\nexport const EnqueueBuildResponseSchema = z.object({\n buildId: z.string(),\n});\n\nexport type EnqueueBuildResponse = z.infer<typeof EnqueueBuildResponseSchema>;\n","import { z } from \"zod\";\n\nexport const TriggerInitialDeploymentRequestSchema = z.object({\n environment: z.enum([\"prod\", \"staging\", \"preview\"]),\n});\n\nexport type TriggerInitialDeploymentRequest = z.infer<typeof TriggerInitialDeploymentRequestSchema>;\n\nexport const TriggerInitialDeploymentResponseSchema = z.object({\n ok: z.boolean(),\n});\n\nexport type TriggerInitialDeploymentResponse = z.infer<\n typeof TriggerInitialDeploymentResponseSchema\n>;\n","import { z } from \"zod\";\n\nexport const PrivateLinkConnectionStatus = z.enum([\n \"PENDING\",\n \"PROVISIONING\",\n \"ACTIVE\",\n \"ERROR\",\n \"DELETING\",\n]);\nexport type PrivateLinkConnectionStatus = z.infer<typeof PrivateLinkConnectionStatus>;\n\nexport const PrivateLinkConnection = z.object({\n id: z.string(),\n friendlyId: z.string(),\n name: z.string(),\n organizationId: z.string(),\n endpointServiceName: z.string(),\n targetRegion: z.string(),\n status: PrivateLinkConnectionStatus,\n statusMessage: z.string().nullable(),\n endpointDnsName: z.string().nullable(),\n endpointIps: z.array(z.string()).nullable(),\n provisionedAt: z.string().nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\nexport type PrivateLinkConnection = z.infer<typeof PrivateLinkConnection>;\n\nexport const PrivateLinkConnectionList = z.object({\n connections: z.array(PrivateLinkConnection),\n});\nexport type PrivateLinkConnectionList = z.infer<typeof PrivateLinkConnectionList>;\n\nexport const CreatePrivateLinkConnectionBody = z.object({\n name: z\n .string()\n .min(1)\n .max(100)\n .regex(\n /^[a-zA-Z][a-zA-Z0-9 _-]*$/,\n \"Must start with a letter and contain only letters, numbers, spaces, hyphens, or underscores\"\n ),\n endpointServiceName: z\n .string()\n .regex(\n /^com\\.amazonaws\\.vpce\\..+\\.vpce-svc-.+$/,\n \"Must be a valid VPC Endpoint Service name (com.amazonaws.vpce.<region>.vpce-svc-*)\"\n ),\n targetRegion: z.enum([\"us-east-1\", \"eu-central-1\"]),\n});\nexport type CreatePrivateLinkConnectionBody = z.infer<typeof CreatePrivateLinkConnectionBody>;\n\nexport const DeletePrivateLinkResult = z.object({\n success: z.boolean(),\n});\nexport type DeletePrivateLinkResult = z.infer<typeof DeletePrivateLinkResult>;\n\nexport const PrivateLinkRegionsResult = z.object({\n availableRegions: z.array(z.string()),\n activeRegions: z.array(z.string()),\n});\nexport type PrivateLinkRegionsResult = z.infer<typeof PrivateLinkRegionsResult>;\n","import { ZodType, z } from \"zod\";\nimport {\n BillingAlertsResult,\n CurrentPlan,\n CustomerPortalRequestBody,\n CustomerPortalSchema,\n ErrorSchema,\n PlansResult,\n ReportInvocationUsageEvent,\n ReportInvocationUsageResult,\n ReportUsageResult,\n SetPlanBody,\n SubscribeResultSchema,\n UpdateBillingAlertsRequest,\n UsageParams,\n UsageResult,\n UsageSeriesParams,\n UsageSeriesResult,\n RegistryCredentialsResponseSchema,\n SetAddOnResult,\n SetAddOnBody,\n EnqueueBuildResponseSchema,\n EnqueueBuildRequest,\n TriggerInitialDeploymentRequest,\n TriggerInitialDeploymentResponseSchema,\n PrivateLinkConnectionList,\n PrivateLinkConnection,\n CreatePrivateLinkConnectionBody,\n DeletePrivateLinkResult,\n PrivateLinkRegionsResult,\n} from \"../schemas\";\n\ntype BillingClientConfig = {\n url: string;\n apiKey: string;\n};\n\ntype SuccessResult<TSchema extends ZodType> = {\n success: true;\n} & z.infer<TSchema>;\n\ntype ErrorResult = {\n success: false;\n error: string;\n};\n\ntype Result<TSchema extends ZodType> = SuccessResult<TSchema> | ErrorResult;\n\nexport type PlansResponse = Result<typeof PlansResult>;\nexport type CurrentPlanResponse = Result<typeof CurrentPlan>;\nexport type SetPlanResponse = Result<typeof SubscribeResultSchema>;\nexport type CustomerPortalResponse = Result<typeof CustomerPortalSchema>;\nexport type UsageResponse = Result<typeof UsageResult>;\nexport type UsageSeriesResponse = Result<typeof UsageSeriesResult>;\nexport type UsageInvocationReportResponse = Result<\n typeof ReportInvocationUsageResult\n>;\nexport type UsageEntitlementResponse = Result<typeof ReportUsageResult>;\nexport type BillingAlertsResponse = Result<typeof BillingAlertsResult>;\nexport type RegistryCredentialsResult = Result<\n typeof RegistryCredentialsResponseSchema\n>;\nexport type SetAddOnResponse = Result<typeof SetAddOnResult>;\nexport type EnqueueBuildResult = Result<typeof EnqueueBuildResponseSchema>;\nexport type PrivateLinkConnectionListResponse = Result<\n typeof PrivateLinkConnectionList\n>;\nexport type PrivateLinkConnectionResponse = Result<\n typeof PrivateLinkConnection\n>;\nexport type DeletePrivateLinkResponse = Result<typeof DeletePrivateLinkResult>;\nexport type PrivateLinkRegionsResponse = Result<typeof PrivateLinkRegionsResult>;\nexport type TriggerInitialDeploymentResult = Result<\n typeof TriggerInitialDeploymentResponseSchema\n>;\n\nexport class BillingClient {\n constructor(private readonly config: BillingClientConfig) {}\n\n async plans(): Promise<PlansResponse> {\n return await this.fetch(`/api/v1/plans/v3`, PlansResult);\n }\n\n async currentPlan(orgId: string): Promise<CurrentPlanResponse> {\n return await this.fetch(`/api/v1/orgs/${orgId}`, CurrentPlan);\n }\n\n async usage(orgId: string, params: UsageParams): Promise<UsageResponse> {\n const search = objectToSearchParams(params);\n return await this.fetch(\n `/api/v1/orgs/${orgId}/usage?${search?.toString()}`,\n UsageResult\n );\n }\n\n async usageSeries(\n orgId: string,\n params: UsageSeriesParams\n ): Promise<UsageSeriesResponse> {\n const search = objectToSearchParams(params);\n return await this.fetch(\n `/api/v1/orgs/${orgId}/usage/series?${search?.toString()}`,\n UsageSeriesResult\n );\n }\n\n async setPlan(orgId: string, body: SetPlanBody): Promise<SetPlanResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/v3/subscription`,\n SubscribeResultSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async setAddOn(orgId: string, body: SetAddOnBody): Promise<SetAddOnResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/v3/subscription/addon`,\n SetAddOnResult,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async createPortalSession(\n orgId: string,\n body: CustomerPortalRequestBody\n ): Promise<CustomerPortalResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/v3/subscription/portal`,\n CustomerPortalSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n /**\n *\n * @param event The data is in the body, not using a JWT\n * @returns details about usage\n */\n async reportInvocationUsage(\n event: ReportInvocationUsageEvent\n ): Promise<UsageInvocationReportResponse> {\n return await this.fetch(\n `/api/v1/usage/ingest/invocation`,\n ReportInvocationUsageResult,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(event),\n }\n );\n }\n\n /**\n * Generates registry credentials for a project. This is used to push images to a project's container repository.\n *\n * @param projectId The ID of the project\n * @param region The region to generate credentials for\n * @returns The registry credentials\n */\n async generateRegistryCredentials(\n projectId: string,\n region: \"us-east-1\" | \"eu-central-1\"\n ): Promise<RegistryCredentialsResult> {\n return await this.fetch(\n `/api/v1/projects/${projectId}/generate-registry-credentials`,\n RegistryCredentialsResponseSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ region }),\n }\n );\n }\n\n /**\n * Enqueues a build for a project deployment.\n *\n * @param projectId The ID of the project\n * @param body The enqueue build request containing the deployment ID\n * @returns The build ID\n */\n async enqueueBuild(\n projectId: string,\n body: EnqueueBuildRequest\n ): Promise<EnqueueBuildResult> {\n return await this.fetch(\n `/api/v1/projects/${projectId}/enqueue-build`,\n EnqueueBuildResponseSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n /**\n *\n * @param event The data is in the body, not using a JWT\n * @returns details about usage\n */\n async getEntitlement(orgId: string): Promise<UsageEntitlementResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/usage/entitlement`,\n ReportUsageResult\n );\n }\n\n async getBillingAlerts(orgId: string): Promise<BillingAlertsResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/billing-alerts`,\n BillingAlertsResult\n );\n }\n\n async updateBillingAlerts(\n orgId: string,\n body: UpdateBillingAlertsRequest\n ): Promise<BillingAlertsResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/billing-alerts`,\n BillingAlertsResult,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async getPrivateLinks(\n orgId: string\n ): Promise<PrivateLinkConnectionListResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections`,\n PrivateLinkConnectionList\n );\n }\n\n async createPrivateLink(\n orgId: string,\n body: CreatePrivateLinkConnectionBody\n ): Promise<PrivateLinkConnectionResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections`,\n PrivateLinkConnection,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async deletePrivateLink(\n orgId: string,\n connectionId: string\n ): Promise<DeletePrivateLinkResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections/${connectionId}`,\n DeletePrivateLinkResult,\n {\n method: \"DELETE\",\n }\n );\n }\n\n async getPrivateLinkRegions(\n orgId: string\n ): Promise<PrivateLinkRegionsResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections/regions`,\n PrivateLinkRegionsResult\n );\n }\n\n async triggerInitialDeployment(\n projectId: string,\n body: TriggerInitialDeploymentRequest\n ): Promise<TriggerInitialDeploymentResult> {\n return await this.fetch(\n `/api/v1/projects/${projectId}/initial-deployment`,\n TriggerInitialDeploymentResponseSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async fetch<TSchema extends ZodType = z.ZodTypeAny>(\n path: string,\n schema: TSchema,\n requestInit?: RequestInit\n ): Promise<Result<TSchema>> {\n const response = await fetch(`${this.config.url}${path}`, {\n ...requestInit,\n headers: {\n ...requestInit?.headers,\n Authorization: `Bearer ${this.config.apiKey}`,\n },\n });\n\n if (!response.ok) {\n const json = await response.json();\n const parsedError = ErrorSchema.parse(json);\n return {\n success: false,\n error: parsedError.error,\n };\n }\n\n const json = await response.json();\n const parsed = schema.parse(json);\n return {\n success: true,\n ...parsed,\n };\n }\n}\n\nexport function objectToSearchParams(\n obj:\n | undefined\n | Record<\n string,\n | string\n | string[]\n | number\n | number[]\n | boolean\n | boolean[]\n | Date\n | Date[]\n | undefined\n >\n): URLSearchParams | undefined {\n if (!obj) return undefined;\n\n const searchParams = new URLSearchParams();\n //for each item add to the search params, skip undefined and join arrays with commas\n Object.entries(obj).forEach(([key, value]) => {\n if (value === undefined) return;\n if (Array.isArray(value)) {\n const values = value.map((d) => {\n if (d instanceof Date) return d.toISOString();\n return d;\n });\n\n searchParams.append(key, values.join(\",\"));\n } else {\n const v = value instanceof Date ? value.toISOString() : value;\n searchParams.append(key, v.toString());\n }\n });\n\n return searchParams;\n}\n","import { MachineDefinition } from \"./schemas\";\n\nexport type MachineDefinitionInput = {\n code: string;\n title: string;\n cpu: number;\n memory: number;\n centsPerVCpuSecond: number;\n centsPerGbRamSecond: number;\n};\n\nexport function machineDefinition({\n code,\n title,\n cpu,\n memory,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n}: MachineDefinitionInput): MachineDefinition {\n const centsPerSecond =\n cpu * centsPerVCpuSecond + memory * centsPerGbRamSecond;\n const centsPerMs = centsPerSecond / 1000;\n return {\n code,\n title,\n cpu,\n memory,\n centsPerMs,\n };\n}\n","import { machineDefinition } from \"./machineDefinition\";\n\nconst centsPerVCpuSecond = Number(process.env.CENTS_PER_VCPU_SECOND ?? 0);\nconst centsPerGbRamSecond = Number(process.env.CENTS_PER_GB_RAM_SECOND ?? 0);\n\nexport const machines = {\n micro: machineDefinition({\n code: \"micro\",\n title: \"Micro\",\n cpu: 0.25,\n memory: 0.25,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"small-1x\": machineDefinition({\n code: \"small-1x\",\n title: \"Small 1x\",\n cpu: 0.5,\n memory: 0.5,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"small-2x\": machineDefinition({\n code: \"small-2x\",\n title: \"Small 2x\",\n cpu: 1,\n memory: 1,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"medium-1x\": machineDefinition({\n code: \"medium-1x\",\n title: \"Medium 1x\",\n cpu: 1,\n memory: 2,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"medium-2x\": machineDefinition({\n code: \"medium-2x\",\n title: \"Medium 2x\",\n cpu: 2,\n memory: 4,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"large-1x\": machineDefinition({\n code: \"large-1x\",\n title: \"Large 1x\",\n cpu: 4,\n memory: 8,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"large-2x\": machineDefinition({\n code: \"large-2x\",\n title: \"Large 2x\",\n cpu: 8,\n memory: 16,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n};\n\nexport type MachineCode = keyof typeof machines;\n\nexport const defaultMachine: MachineCode = \"small-1x\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAElB,IAAM,kBAAkB,aAAE,OAAO;AAAA,EAC/B,QAAQ,aAAE,OAAO;AAAA,EACjB,WAAW,aAAE,QAAQ,EAAE,SAAS;AAClC,CAAC;AAID,IAAM,wBAAwB,aAAE,OAAO;AAAA,EACrC,YAAY,aAAE,OAAO;AAAA,EACrB,SAAS,aAAE,OAAO;AAAA,EAClB,SAAS,aAAE,OAAO;AAAA,EAClB,aAAa,aAAE,OAAO;AAAA,EACtB,WAAW,aAAE,QAAQ,EAAE,SAAS;AAAA;AAAA,EAEh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,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,aAAa,kBAAkB;AAAA,IAC7B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,aAAa,kBAAkB;AAAA,IAC7B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAIO,IAAM,iBAA8B;","names":["import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","import_zod","json","centsPerVCpuSecond","centsPerGbRamSecond"]}
package/dist/index.d.cts CHANGED
@@ -13020,6 +13020,7 @@ declare const PrivateLinkConnection: z.ZodObject<{
13020
13020
  status: z.ZodEnum<["PENDING", "PROVISIONING", "ACTIVE", "ERROR", "DELETING"]>;
13021
13021
  statusMessage: z.ZodNullable<z.ZodString>;
13022
13022
  endpointDnsName: z.ZodNullable<z.ZodString>;
13023
+ endpointIps: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
13023
13024
  provisionedAt: z.ZodNullable<z.ZodString>;
13024
13025
  createdAt: z.ZodString;
13025
13026
  updatedAt: z.ZodString;
@@ -13033,6 +13034,7 @@ declare const PrivateLinkConnection: z.ZodObject<{
13033
13034
  targetRegion: string;
13034
13035
  statusMessage: string | null;
13035
13036
  endpointDnsName: string | null;
13037
+ endpointIps: string[] | null;
13036
13038
  provisionedAt: string | null;
13037
13039
  createdAt: string;
13038
13040
  updatedAt: string;
@@ -13046,6 +13048,7 @@ declare const PrivateLinkConnection: z.ZodObject<{
13046
13048
  targetRegion: string;
13047
13049
  statusMessage: string | null;
13048
13050
  endpointDnsName: string | null;
13051
+ endpointIps: string[] | null;
13049
13052
  provisionedAt: string | null;
13050
13053
  createdAt: string;
13051
13054
  updatedAt: string;
@@ -13062,6 +13065,7 @@ declare const PrivateLinkConnectionList: z.ZodObject<{
13062
13065
  status: z.ZodEnum<["PENDING", "PROVISIONING", "ACTIVE", "ERROR", "DELETING"]>;
13063
13066
  statusMessage: z.ZodNullable<z.ZodString>;
13064
13067
  endpointDnsName: z.ZodNullable<z.ZodString>;
13068
+ endpointIps: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
13065
13069
  provisionedAt: z.ZodNullable<z.ZodString>;
13066
13070
  createdAt: z.ZodString;
13067
13071
  updatedAt: z.ZodString;
@@ -13075,6 +13079,7 @@ declare const PrivateLinkConnectionList: z.ZodObject<{
13075
13079
  targetRegion: string;
13076
13080
  statusMessage: string | null;
13077
13081
  endpointDnsName: string | null;
13082
+ endpointIps: string[] | null;
13078
13083
  provisionedAt: string | null;
13079
13084
  createdAt: string;
13080
13085
  updatedAt: string;
@@ -13088,6 +13093,7 @@ declare const PrivateLinkConnectionList: z.ZodObject<{
13088
13093
  targetRegion: string;
13089
13094
  statusMessage: string | null;
13090
13095
  endpointDnsName: string | null;
13096
+ endpointIps: string[] | null;
13091
13097
  provisionedAt: string | null;
13092
13098
  createdAt: string;
13093
13099
  updatedAt: string;
@@ -13103,6 +13109,7 @@ declare const PrivateLinkConnectionList: z.ZodObject<{
13103
13109
  targetRegion: string;
13104
13110
  statusMessage: string | null;
13105
13111
  endpointDnsName: string | null;
13112
+ endpointIps: string[] | null;
13106
13113
  provisionedAt: string | null;
13107
13114
  createdAt: string;
13108
13115
  updatedAt: string;
@@ -13118,6 +13125,7 @@ declare const PrivateLinkConnectionList: z.ZodObject<{
13118
13125
  targetRegion: string;
13119
13126
  statusMessage: string | null;
13120
13127
  endpointDnsName: string | null;
13128
+ endpointIps: string[] | null;
13121
13129
  provisionedAt: string | null;
13122
13130
  createdAt: string;
13123
13131
  updatedAt: string;
package/dist/index.d.ts CHANGED
@@ -13020,6 +13020,7 @@ declare const PrivateLinkConnection: z.ZodObject<{
13020
13020
  status: z.ZodEnum<["PENDING", "PROVISIONING", "ACTIVE", "ERROR", "DELETING"]>;
13021
13021
  statusMessage: z.ZodNullable<z.ZodString>;
13022
13022
  endpointDnsName: z.ZodNullable<z.ZodString>;
13023
+ endpointIps: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
13023
13024
  provisionedAt: z.ZodNullable<z.ZodString>;
13024
13025
  createdAt: z.ZodString;
13025
13026
  updatedAt: z.ZodString;
@@ -13033,6 +13034,7 @@ declare const PrivateLinkConnection: z.ZodObject<{
13033
13034
  targetRegion: string;
13034
13035
  statusMessage: string | null;
13035
13036
  endpointDnsName: string | null;
13037
+ endpointIps: string[] | null;
13036
13038
  provisionedAt: string | null;
13037
13039
  createdAt: string;
13038
13040
  updatedAt: string;
@@ -13046,6 +13048,7 @@ declare const PrivateLinkConnection: z.ZodObject<{
13046
13048
  targetRegion: string;
13047
13049
  statusMessage: string | null;
13048
13050
  endpointDnsName: string | null;
13051
+ endpointIps: string[] | null;
13049
13052
  provisionedAt: string | null;
13050
13053
  createdAt: string;
13051
13054
  updatedAt: string;
@@ -13062,6 +13065,7 @@ declare const PrivateLinkConnectionList: z.ZodObject<{
13062
13065
  status: z.ZodEnum<["PENDING", "PROVISIONING", "ACTIVE", "ERROR", "DELETING"]>;
13063
13066
  statusMessage: z.ZodNullable<z.ZodString>;
13064
13067
  endpointDnsName: z.ZodNullable<z.ZodString>;
13068
+ endpointIps: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
13065
13069
  provisionedAt: z.ZodNullable<z.ZodString>;
13066
13070
  createdAt: z.ZodString;
13067
13071
  updatedAt: z.ZodString;
@@ -13075,6 +13079,7 @@ declare const PrivateLinkConnectionList: z.ZodObject<{
13075
13079
  targetRegion: string;
13076
13080
  statusMessage: string | null;
13077
13081
  endpointDnsName: string | null;
13082
+ endpointIps: string[] | null;
13078
13083
  provisionedAt: string | null;
13079
13084
  createdAt: string;
13080
13085
  updatedAt: string;
@@ -13088,6 +13093,7 @@ declare const PrivateLinkConnectionList: z.ZodObject<{
13088
13093
  targetRegion: string;
13089
13094
  statusMessage: string | null;
13090
13095
  endpointDnsName: string | null;
13096
+ endpointIps: string[] | null;
13091
13097
  provisionedAt: string | null;
13092
13098
  createdAt: string;
13093
13099
  updatedAt: string;
@@ -13103,6 +13109,7 @@ declare const PrivateLinkConnectionList: z.ZodObject<{
13103
13109
  targetRegion: string;
13104
13110
  statusMessage: string | null;
13105
13111
  endpointDnsName: string | null;
13112
+ endpointIps: string[] | null;
13106
13113
  provisionedAt: string | null;
13107
13114
  createdAt: string;
13108
13115
  updatedAt: string;
@@ -13118,6 +13125,7 @@ declare const PrivateLinkConnectionList: z.ZodObject<{
13118
13125
  targetRegion: string;
13119
13126
  statusMessage: string | null;
13120
13127
  endpointDnsName: string | null;
13128
+ endpointIps: string[] | null;
13121
13129
  provisionedAt: string | null;
13122
13130
  createdAt: string;
13123
13131
  updatedAt: string;
package/dist/index.js CHANGED
@@ -361,6 +361,7 @@ var PrivateLinkConnection = z11.object({
361
361
  status: PrivateLinkConnectionStatus,
362
362
  statusMessage: z11.string().nullable(),
363
363
  endpointDnsName: z11.string().nullable(),
364
+ endpointIps: z11.array(z11.string()).nullable(),
364
365
  provisionedAt: z11.string().nullable(),
365
366
  createdAt: z11.string(),
366
367
  updatedAt: z11.string()
@@ -369,7 +370,10 @@ var PrivateLinkConnectionList = z11.object({
369
370
  connections: z11.array(PrivateLinkConnection)
370
371
  });
371
372
  var CreatePrivateLinkConnectionBody = z11.object({
372
- name: z11.string().min(1).max(100),
373
+ name: z11.string().min(1).max(100).regex(
374
+ /^[a-zA-Z][a-zA-Z0-9 _-]*$/,
375
+ "Must start with a letter and contain only letters, numbers, spaces, hyphens, or underscores"
376
+ ),
373
377
  endpointServiceName: z11.string().regex(
374
378
  /^com\.amazonaws\.vpce\..+\.vpce-svc-.+$/,
375
379
  "Must be a valid VPC Endpoint Service name (com.amazonaws.vpce.<region>.vpce-svc-*)"
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v3/schemas/planDefinitions.ts","../src/v3/schemas/subscription.ts","../src/v3/schemas/subscribe.ts","../src/v3/schemas/portal.ts","../src/v3/schemas/error.ts","../src/v3/schemas/usage.ts","../src/v3/schemas/billingAlerts.ts","../src/v3/schemas/registryCredentials.ts","../src/v3/schemas/enqueueBuild.ts","../src/v3/schemas/initialDeployment.ts","../src/v3/schemas/privateLink.ts","../src/v3/client/index.ts","../src/v3/machineDefinition.ts","../src/v3/machinePresets.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst ExceedableLimit = z.object({\n number: z.number(),\n canExceed: z.boolean().optional(),\n});\n\nexport type ExceedableLimit = z.infer<typeof ExceedableLimit>;\n\nconst EnvironmentBasedLimit = z.object({\n production: z.number(),\n staging: z.number(),\n preview: z.number(),\n development: z.number(),\n canExceed: z.boolean().optional(),\n // Legacy, return the `production` value\n number: z.number(),\n});\nexport type EnvironmentBasedLimit = z.infer<typeof EnvironmentBasedLimit>;\n\nconst BatchRateLimitConfig = z.object({\n type: z.string(),\n interval: z.string(),\n maxTokens: z.number(),\n refillRate: z.number(),\n});\nexport type BatchRateLimitConfig = z.infer<typeof BatchRateLimitConfig>;\n\nconst BatchQueueConcurrencyConfig = z.object({\n processingConcurrency: z.number(),\n});\nexport type BatchQueueConcurrencyConfig = z.infer<\n typeof BatchQueueConcurrencyConfig\n>;\n\nconst QueueSizeLimits = z.object({\n development: z.number(),\n deployed: z.number(),\n});\nexport type QueueSizeLimits = z.infer<typeof QueueSizeLimits>;\n\nconst Limits = z.object({\n includedUsage: z.number(),\n concurrentRuns: EnvironmentBasedLimit,\n teamMembers: ExceedableLimit,\n schedules: ExceedableLimit,\n logRetentionDays: ExceedableLimit,\n queryPeriodDays: ExceedableLimit,\n alerts: ExceedableLimit,\n hasStagingEnvironment: z.boolean(),\n realtimeConcurrentConnections: ExceedableLimit,\n branches: ExceedableLimit,\n support: z.enum([\"community\", \"slack\"]),\n batchRateLimitConfig: BatchRateLimitConfig.optional(),\n batchQueueConcurrencyConfig: BatchQueueConcurrencyConfig.optional(),\n metricDashboards: ExceedableLimit,\n metricWidgetsPerDashboard: ExceedableLimit,\n queueSizeLimits: QueueSizeLimits.optional(),\n hasPrivateNetworking: z.boolean().optional(),\n privateLinkConnectionLimit: z.number().optional(),\n});\n\nexport type Limits = z.infer<typeof Limits>;\n\nconst commonMetadata = {\n title: z.string(),\n code: z.string(),\n};\n\nconst pricingLookup = {\n tierPriceCode: z.string(),\n usagePriceCode: z.string(),\n usageCouponCode: z.string().optional(),\n};\nconst FreePlanDefinition = z.object({\n ...commonMetadata,\n type: z.literal(\"free\"),\n limits: Limits,\n});\nexport type FreePlanDefinition = z.infer<typeof FreePlanDefinition>;\n\nconst PaidPlanDefinition = z.object({\n ...commonMetadata,\n type: z.literal(\"paid\"),\n tierPrice: z.number(),\n stripe: z.object(pricingLookup),\n limits: Limits,\n});\nexport type PaidPlanDefinition = z.infer<typeof PaidPlanDefinition>;\n\nconst EnterprisePlanDefinition = z.object({\n ...commonMetadata,\n type: z.literal(\"enterprise\"),\n limits: Limits,\n});\nexport type EnterprisePlanDefinition = z.infer<typeof EnterprisePlanDefinition>;\n\nexport const PlanDefinitionSchema = z.discriminatedUnion(\"type\", [\n FreePlanDefinition,\n PaidPlanDefinition,\n EnterprisePlanDefinition,\n]);\nexport type PlanDefinition = z.infer<typeof PlanDefinitionSchema>;\n\nconst MachineDefinition = z.object({\n code: z.string(),\n title: z.string(),\n cpu: z.number(),\n memory: z.number(),\n centsPerMs: z.number(),\n});\n\nexport type MachineDefinition = z.infer<typeof MachineDefinition>;\n\nexport const Plans = z.object({\n free: FreePlanDefinition,\n hobby: PaidPlanDefinition,\n pro: PaidPlanDefinition,\n enterprise: EnterprisePlanDefinition,\n});\nexport type Plans = z.infer<typeof Plans>;\n\n/** The pricing per step of the add-on, e.g. $10 for 50 units */\nconst AddOnPricing = z.object({\n /** The step size - must purchase in multiples of this amount */\n stepSize: z.number(),\n /** Price per step in cents */\n centsPerStep: z.number(),\n});\nexport type AddOnPricing = z.infer<typeof AddOnPricing>;\n\nexport const PlansResult = z.object({\n plans: Plans,\n usagePricing: z.object({\n centsPerRunInvocation: z.number(),\n machines: z.record(z.string(), MachineDefinition),\n defaultMachine: z.string(),\n }),\n addOnPricing: z.object({\n concurrency: AddOnPricing,\n branches: AddOnPricing,\n seats: AddOnPricing,\n }),\n});\n\nexport type PlansResult = z.infer<typeof PlansResult>;\n\nexport const AddOnDefinition = z.object({\n code: z.enum([\"concurrency\", \"branches\", \"seats\"]),\n priceCode: z.string(),\n pricing: AddOnPricing,\n});\n\nexport type AddOnDefinition = z.infer<typeof AddOnDefinition>;\n\nexport const AddOn = z.object({\n purchased: z.number(),\n quota: z.number().optional(),\n});\nexport type AddOn = z.infer<typeof AddOn>;\n\nexport const AddOns = z.object({\n concurrentRuns: AddOn.optional(),\n branches: AddOn.optional(),\n seats: AddOn.optional(),\n});\nexport type AddOns = z.infer<typeof AddOns>;\n","import { z } from \"zod\";\nimport { AddOns, PlanDefinitionSchema } from \"./planDefinitions\";\n\nconst FreeTierStatus = z.enum([\"requires_connect\", \"approved\", \"rejected\"]);\nexport type FreeTierStatus = z.infer<typeof FreeTierStatus>;\n\nexport const SubscriptionResult = z.object({\n freeTierStatus: FreeTierStatus,\n isPaying: z.boolean(),\n canceledAt: z.string().optional(),\n plan: PlanDefinitionSchema.optional(),\n addOns: AddOns.optional(),\n});\n\nexport type SubscriptionResult = z.infer<typeof SubscriptionResult>;\n\nexport const CurrentPlan = z.object({\n //todo remove this after the next deploy\n subscription: z.any(),\n v3Subscription: SubscriptionResult,\n});\n\nexport type CurrentPlan = z.infer<typeof CurrentPlan>;\n","import { z } from \"zod\";\n\nconst SetPaidPlanBodySchema = z.object({\n type: z.literal(\"paid\"),\n planCode: z.string(),\n userId: z.string(),\n});\n\nconst SetFreePlanBodySchema = z.object({\n type: z.literal(\"free\"),\n userId: z.string(),\n});\n\nexport const SetPlanBodySchema = z.discriminatedUnion(\"type\", [\n SetPaidPlanBodySchema,\n SetFreePlanBodySchema,\n]);\n\nexport type SetPlanBody = z.infer<typeof SetPlanBodySchema>;\n\nexport const FreeConnectRequiredSchema = z.object({\n action: z.literal(\"free_connect_required\"),\n connectUrl: z.string().url(),\n});\n\nexport type FreeConnectRequired = z.infer<typeof FreeConnectRequiredSchema>;\n\nexport const FreeConnectedSchema = z.object({\n action: z.literal(\"free_connected\"),\n accepted: z.boolean(),\n});\n\nexport type FreeConnected = z.infer<typeof FreeConnectedSchema>;\n\nconst UpdatedSubscriptionResultSchema = z.object({\n action: z.literal(\"updated_subscription\"),\n subscription: z.object({\n planCode: z.string(),\n }),\n});\n\nexport type UpdatedSubscriptionResult = z.infer<\n typeof UpdatedSubscriptionResultSchema\n>;\n\nconst CreateSubscriptionFlowStartSchema = z.object({\n action: z.literal(\"create_subscription_flow_start\"),\n subscription: z.object({\n planCode: z.string(),\n }),\n checkoutUrl: z.string().url(),\n});\n\nexport type CreateSubscriptionFlowStart = z.infer<\n typeof CreateSubscriptionFlowStartSchema\n>;\n\nconst CanceledSubscriptionResultSchema = z.object({\n action: z.literal(\"canceled_subscription\"),\n});\n\nexport type CanceledSubscriptionResult = z.infer<\n typeof CanceledSubscriptionResultSchema\n>;\n\nexport const SubscribeResultSchema = z.discriminatedUnion(\"action\", [\n FreeConnectRequiredSchema,\n FreeConnectedSchema,\n CreateSubscriptionFlowStartSchema,\n UpdatedSubscriptionResultSchema,\n CanceledSubscriptionResultSchema,\n]);\n\nexport type SubscribeResult = z.infer<typeof SubscribeResultSchema>;\n\nexport const SetAddOnBody = z.object({\n type: z.enum([\"concurrency\", \"branches\", \"seats\"]),\n amount: z.number(),\n});\n\nexport type SetAddOnBody = z.infer<typeof SetAddOnBody>;\n\nexport const SetAddOnResult = z.discriminatedUnion(\"result\", [\n z.object({\n result: z.literal(\"error\"),\n error: z.string(),\n }),\n z.object({\n result: z.literal(\"success\"),\n type: z.string(),\n amount: z.number(),\n subscription: z.object({\n id: z.string(),\n }),\n }),\n z.object({\n result: z.literal(\"max_quota_reached\"),\n type: z.string(),\n maxQuota: z.number(),\n }),\n]);\n\nexport type SetAddOnResult = z.infer<typeof SetAddOnResult>;\n","import { z } from \"zod\";\n\nexport const CustomerPortalRequestBodySchema = z.object({\n returnUrl: z.string(),\n});\n\nexport type CustomerPortalRequestBody = z.infer<\n typeof CustomerPortalRequestBodySchema\n>;\n\nexport const CustomerPortalSchema = z.object({\n customerPortalUrl: z.string().optional(),\n});\n\nexport type CustomerPortal = z.infer<typeof CustomerPortalSchema>;\n","import { z } from \"zod\";\n\nexport const ErrorSchema = z.object({\n error: z.string(),\n});\n\nexport type Error = z.infer<typeof ErrorSchema>;\n","import { z } from \"zod\";\n\nexport const UsageParams = z.object({\n from: z.coerce.date(),\n to: z.coerce.date(),\n});\nexport type UsageParams = z.infer<typeof UsageParams>;\n\nexport const UsageResult = z.object({\n cents: z.number(),\n});\nexport type UsageResult = z.infer<typeof UsageResult>;\n\nconst Window = z.enum([\"MINUTE\", \"HOUR\", \"DAY\"]);\n\nconst BooleanParam = z.preprocess(\n (val) => (val === \"true\" ? true : false),\n z.boolean()\n);\n\nexport const UsageSeriesParams = z.object({\n from: z.coerce.date(),\n to: z.coerce.date(),\n /** defaults to DAY */\n window: Window.optional(),\n timezone: z.string().optional(),\n //these don't work at the moment because you can't group by items that aren't defined in the meter group by\n // groupByEnvironmentType: BooleanParam.optional(),\n // groupByTaskIdentifier: BooleanParam.optional(),\n});\n\nexport type UsageSeriesParams = z.infer<typeof UsageSeriesParams>;\n\nexport const UsageSeriesResult = z.object({\n from: z.string(),\n to: z.string(),\n window: Window.optional(),\n data: z\n .object({\n value: z.number(),\n windowStart: z.string(),\n windowEnd: z.string(),\n //these don't work at the moment\n // groupBy: z\n // .object({\n // environmentType: z.string().optional(),\n // taskIdentifer: z.string().optional(),\n // })\n // .optional(),\n })\n .array(),\n});\n\nexport type UsageSeriesResult = z.infer<typeof UsageSeriesResult>;\n\nexport const ReportComputeUsageEvent = z.object({\n durationMs: z.number(),\n});\n\nexport type ReportComputeUsageEvent = z.infer<typeof ReportComputeUsageEvent>;\n\nexport const ReportUsagePlan = z.object({\n type: z.string(),\n code: z.string(),\n isPaying: z.boolean(),\n});\n\nexport type ReportUsagePlan = z.infer<typeof ReportUsagePlan>;\n\nexport const ReportUsageResult = z.object({\n hasAccess: z.boolean(),\n balance: z.number().optional(),\n usage: z.number().optional(),\n overage: z.number().optional(),\n plan: ReportUsagePlan.optional(),\n});\n\nexport type ReportUsageResult = z.infer<typeof ReportUsageResult>;\n\nexport const ReportInvocationUsageEvent = z.object({\n organizationId: z.string(),\n costInCents: z.number(),\n additionalData: z.record(z.any()).optional(),\n});\n\nexport type ReportInvocationUsageEvent = z.infer<\n typeof ReportInvocationUsageEvent\n>;\n\nexport const ReportInvocationUsageResult = z.discriminatedUnion(\"success\", [\n z.object({\n success: z.literal(true),\n }),\n z.object({\n success: z.literal(false),\n error: z.string(),\n }),\n]);\n","import { z } from \"zod\";\n\nconst BillingAlertDefinition = z.object({\n amount: z.number(),\n emails: z.array(z.string()),\n alertLevels: z.array(z.number()),\n});\n\nexport const BillingAlertsResult = BillingAlertDefinition;\n\nexport type BillingAlertsResult = z.infer<typeof BillingAlertsResult>;\n\nexport const UpdateBillingAlertsRequest = z.object({\n amount: z.number(),\n emails: z.array(z.string()),\n alertLevels: z.array(z.number()),\n});\n\nexport type UpdateBillingAlertsRequest = z.infer<\n typeof UpdateBillingAlertsRequest\n>;\n","import { z } from \"zod\";\n\nexport const RegistryCredentialsResponseSchema = z.object({\n username: z.string(),\n password: z.string(),\n expiresAt: z.string().datetime(),\n repositoryUri: z.string(),\n});\n\nexport type RegistryCredentialsResponse = z.infer<\n typeof RegistryCredentialsResponseSchema\n>;\n","import { z } from \"zod\";\n\nexport const EnqueueBuildRequestSchema = z.object({\n deploymentId: z.string(),\n artifactKey: z.string(),\n options: z.object({\n skipPromotion: z.boolean().optional(),\n configFilePath: z.string().optional(),\n }),\n});\n\nexport type EnqueueBuildRequest = z.infer<typeof EnqueueBuildRequestSchema>;\n\nexport const EnqueueBuildResponseSchema = z.object({\n buildId: z.string(),\n});\n\nexport type EnqueueBuildResponse = z.infer<typeof EnqueueBuildResponseSchema>;\n","import { z } from \"zod\";\n\nexport const TriggerInitialDeploymentRequestSchema = z.object({\n environment: z.enum([\"prod\", \"staging\", \"preview\"]),\n});\n\nexport type TriggerInitialDeploymentRequest = z.infer<typeof TriggerInitialDeploymentRequestSchema>;\n\nexport const TriggerInitialDeploymentResponseSchema = z.object({\n ok: z.boolean(),\n});\n\nexport type TriggerInitialDeploymentResponse = z.infer<\n typeof TriggerInitialDeploymentResponseSchema\n>;\n","import { z } from \"zod\";\n\nexport const PrivateLinkConnectionStatus = z.enum([\n \"PENDING\",\n \"PROVISIONING\",\n \"ACTIVE\",\n \"ERROR\",\n \"DELETING\",\n]);\nexport type PrivateLinkConnectionStatus = z.infer<typeof PrivateLinkConnectionStatus>;\n\nexport const PrivateLinkConnection = z.object({\n id: z.string(),\n friendlyId: z.string(),\n name: z.string(),\n organizationId: z.string(),\n endpointServiceName: z.string(),\n targetRegion: z.string(),\n status: PrivateLinkConnectionStatus,\n statusMessage: z.string().nullable(),\n endpointDnsName: z.string().nullable(),\n provisionedAt: z.string().nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\nexport type PrivateLinkConnection = z.infer<typeof PrivateLinkConnection>;\n\nexport const PrivateLinkConnectionList = z.object({\n connections: z.array(PrivateLinkConnection),\n});\nexport type PrivateLinkConnectionList = z.infer<typeof PrivateLinkConnectionList>;\n\nexport const CreatePrivateLinkConnectionBody = z.object({\n name: z.string().min(1).max(100),\n endpointServiceName: z\n .string()\n .regex(\n /^com\\.amazonaws\\.vpce\\..+\\.vpce-svc-.+$/,\n \"Must be a valid VPC Endpoint Service name (com.amazonaws.vpce.<region>.vpce-svc-*)\"\n ),\n targetRegion: z.enum([\"us-east-1\", \"eu-central-1\"]),\n});\nexport type CreatePrivateLinkConnectionBody = z.infer<typeof CreatePrivateLinkConnectionBody>;\n\nexport const DeletePrivateLinkResult = z.object({\n success: z.boolean(),\n});\nexport type DeletePrivateLinkResult = z.infer<typeof DeletePrivateLinkResult>;\n\nexport const PrivateLinkRegionsResult = z.object({\n availableRegions: z.array(z.string()),\n activeRegions: z.array(z.string()),\n});\nexport type PrivateLinkRegionsResult = z.infer<typeof PrivateLinkRegionsResult>;\n","import { ZodType, z } from \"zod\";\nimport {\n BillingAlertsResult,\n CurrentPlan,\n CustomerPortalRequestBody,\n CustomerPortalSchema,\n ErrorSchema,\n PlansResult,\n ReportInvocationUsageEvent,\n ReportInvocationUsageResult,\n ReportUsageResult,\n SetPlanBody,\n SubscribeResultSchema,\n UpdateBillingAlertsRequest,\n UsageParams,\n UsageResult,\n UsageSeriesParams,\n UsageSeriesResult,\n RegistryCredentialsResponseSchema,\n SetAddOnResult,\n SetAddOnBody,\n EnqueueBuildResponseSchema,\n EnqueueBuildRequest,\n TriggerInitialDeploymentRequest,\n TriggerInitialDeploymentResponseSchema,\n PrivateLinkConnectionList,\n PrivateLinkConnection,\n CreatePrivateLinkConnectionBody,\n DeletePrivateLinkResult,\n PrivateLinkRegionsResult,\n} from \"../schemas\";\n\ntype BillingClientConfig = {\n url: string;\n apiKey: string;\n};\n\ntype SuccessResult<TSchema extends ZodType> = {\n success: true;\n} & z.infer<TSchema>;\n\ntype ErrorResult = {\n success: false;\n error: string;\n};\n\ntype Result<TSchema extends ZodType> = SuccessResult<TSchema> | ErrorResult;\n\nexport type PlansResponse = Result<typeof PlansResult>;\nexport type CurrentPlanResponse = Result<typeof CurrentPlan>;\nexport type SetPlanResponse = Result<typeof SubscribeResultSchema>;\nexport type CustomerPortalResponse = Result<typeof CustomerPortalSchema>;\nexport type UsageResponse = Result<typeof UsageResult>;\nexport type UsageSeriesResponse = Result<typeof UsageSeriesResult>;\nexport type UsageInvocationReportResponse = Result<\n typeof ReportInvocationUsageResult\n>;\nexport type UsageEntitlementResponse = Result<typeof ReportUsageResult>;\nexport type BillingAlertsResponse = Result<typeof BillingAlertsResult>;\nexport type RegistryCredentialsResult = Result<\n typeof RegistryCredentialsResponseSchema\n>;\nexport type SetAddOnResponse = Result<typeof SetAddOnResult>;\nexport type EnqueueBuildResult = Result<typeof EnqueueBuildResponseSchema>;\nexport type PrivateLinkConnectionListResponse = Result<\n typeof PrivateLinkConnectionList\n>;\nexport type PrivateLinkConnectionResponse = Result<\n typeof PrivateLinkConnection\n>;\nexport type DeletePrivateLinkResponse = Result<typeof DeletePrivateLinkResult>;\nexport type PrivateLinkRegionsResponse = Result<typeof PrivateLinkRegionsResult>;\nexport type TriggerInitialDeploymentResult = Result<\n typeof TriggerInitialDeploymentResponseSchema\n>;\n\nexport class BillingClient {\n constructor(private readonly config: BillingClientConfig) {}\n\n async plans(): Promise<PlansResponse> {\n return await this.fetch(`/api/v1/plans/v3`, PlansResult);\n }\n\n async currentPlan(orgId: string): Promise<CurrentPlanResponse> {\n return await this.fetch(`/api/v1/orgs/${orgId}`, CurrentPlan);\n }\n\n async usage(orgId: string, params: UsageParams): Promise<UsageResponse> {\n const search = objectToSearchParams(params);\n return await this.fetch(\n `/api/v1/orgs/${orgId}/usage?${search?.toString()}`,\n UsageResult\n );\n }\n\n async usageSeries(\n orgId: string,\n params: UsageSeriesParams\n ): Promise<UsageSeriesResponse> {\n const search = objectToSearchParams(params);\n return await this.fetch(\n `/api/v1/orgs/${orgId}/usage/series?${search?.toString()}`,\n UsageSeriesResult\n );\n }\n\n async setPlan(orgId: string, body: SetPlanBody): Promise<SetPlanResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/v3/subscription`,\n SubscribeResultSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async setAddOn(orgId: string, body: SetAddOnBody): Promise<SetAddOnResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/v3/subscription/addon`,\n SetAddOnResult,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async createPortalSession(\n orgId: string,\n body: CustomerPortalRequestBody\n ): Promise<CustomerPortalResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/v3/subscription/portal`,\n CustomerPortalSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n /**\n *\n * @param event The data is in the body, not using a JWT\n * @returns details about usage\n */\n async reportInvocationUsage(\n event: ReportInvocationUsageEvent\n ): Promise<UsageInvocationReportResponse> {\n return await this.fetch(\n `/api/v1/usage/ingest/invocation`,\n ReportInvocationUsageResult,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(event),\n }\n );\n }\n\n /**\n * Generates registry credentials for a project. This is used to push images to a project's container repository.\n *\n * @param projectId The ID of the project\n * @param region The region to generate credentials for\n * @returns The registry credentials\n */\n async generateRegistryCredentials(\n projectId: string,\n region: \"us-east-1\" | \"eu-central-1\"\n ): Promise<RegistryCredentialsResult> {\n return await this.fetch(\n `/api/v1/projects/${projectId}/generate-registry-credentials`,\n RegistryCredentialsResponseSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ region }),\n }\n );\n }\n\n /**\n * Enqueues a build for a project deployment.\n *\n * @param projectId The ID of the project\n * @param body The enqueue build request containing the deployment ID\n * @returns The build ID\n */\n async enqueueBuild(\n projectId: string,\n body: EnqueueBuildRequest\n ): Promise<EnqueueBuildResult> {\n return await this.fetch(\n `/api/v1/projects/${projectId}/enqueue-build`,\n EnqueueBuildResponseSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n /**\n *\n * @param event The data is in the body, not using a JWT\n * @returns details about usage\n */\n async getEntitlement(orgId: string): Promise<UsageEntitlementResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/usage/entitlement`,\n ReportUsageResult\n );\n }\n\n async getBillingAlerts(orgId: string): Promise<BillingAlertsResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/billing-alerts`,\n BillingAlertsResult\n );\n }\n\n async updateBillingAlerts(\n orgId: string,\n body: UpdateBillingAlertsRequest\n ): Promise<BillingAlertsResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/billing-alerts`,\n BillingAlertsResult,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async getPrivateLinks(\n orgId: string\n ): Promise<PrivateLinkConnectionListResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections`,\n PrivateLinkConnectionList\n );\n }\n\n async createPrivateLink(\n orgId: string,\n body: CreatePrivateLinkConnectionBody\n ): Promise<PrivateLinkConnectionResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections`,\n PrivateLinkConnection,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async deletePrivateLink(\n orgId: string,\n connectionId: string\n ): Promise<DeletePrivateLinkResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections/${connectionId}`,\n DeletePrivateLinkResult,\n {\n method: \"DELETE\",\n }\n );\n }\n\n async getPrivateLinkRegions(\n orgId: string\n ): Promise<PrivateLinkRegionsResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections/regions`,\n PrivateLinkRegionsResult\n );\n }\n\n async triggerInitialDeployment(\n projectId: string,\n body: TriggerInitialDeploymentRequest\n ): Promise<TriggerInitialDeploymentResult> {\n return await this.fetch(\n `/api/v1/projects/${projectId}/initial-deployment`,\n TriggerInitialDeploymentResponseSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async fetch<TSchema extends ZodType = z.ZodTypeAny>(\n path: string,\n schema: TSchema,\n requestInit?: RequestInit\n ): Promise<Result<TSchema>> {\n const response = await fetch(`${this.config.url}${path}`, {\n ...requestInit,\n headers: {\n ...requestInit?.headers,\n Authorization: `Bearer ${this.config.apiKey}`,\n },\n });\n\n if (!response.ok) {\n const json = await response.json();\n const parsedError = ErrorSchema.parse(json);\n return {\n success: false,\n error: parsedError.error,\n };\n }\n\n const json = await response.json();\n const parsed = schema.parse(json);\n return {\n success: true,\n ...parsed,\n };\n }\n}\n\nexport function objectToSearchParams(\n obj:\n | undefined\n | Record<\n string,\n | string\n | string[]\n | number\n | number[]\n | boolean\n | boolean[]\n | Date\n | Date[]\n | undefined\n >\n): URLSearchParams | undefined {\n if (!obj) return undefined;\n\n const searchParams = new URLSearchParams();\n //for each item add to the search params, skip undefined and join arrays with commas\n Object.entries(obj).forEach(([key, value]) => {\n if (value === undefined) return;\n if (Array.isArray(value)) {\n const values = value.map((d) => {\n if (d instanceof Date) return d.toISOString();\n return d;\n });\n\n searchParams.append(key, values.join(\",\"));\n } else {\n const v = value instanceof Date ? value.toISOString() : value;\n searchParams.append(key, v.toString());\n }\n });\n\n return searchParams;\n}\n","import { MachineDefinition } from \"./schemas\";\n\nexport type MachineDefinitionInput = {\n code: string;\n title: string;\n cpu: number;\n memory: number;\n centsPerVCpuSecond: number;\n centsPerGbRamSecond: number;\n};\n\nexport function machineDefinition({\n code,\n title,\n cpu,\n memory,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n}: MachineDefinitionInput): MachineDefinition {\n const centsPerSecond =\n cpu * centsPerVCpuSecond + memory * centsPerGbRamSecond;\n const centsPerMs = centsPerSecond / 1000;\n return {\n code,\n title,\n cpu,\n memory,\n centsPerMs,\n };\n}\n","import { machineDefinition } from \"./machineDefinition\";\n\nconst centsPerVCpuSecond = Number(process.env.CENTS_PER_VCPU_SECOND ?? 0);\nconst centsPerGbRamSecond = Number(process.env.CENTS_PER_GB_RAM_SECOND ?? 0);\n\nexport const machines = {\n micro: machineDefinition({\n code: \"micro\",\n title: \"Micro\",\n cpu: 0.25,\n memory: 0.25,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"small-1x\": machineDefinition({\n code: \"small-1x\",\n title: \"Small 1x\",\n cpu: 0.5,\n memory: 0.5,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"small-2x\": machineDefinition({\n code: \"small-2x\",\n title: \"Small 2x\",\n cpu: 1,\n memory: 1,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"medium-1x\": machineDefinition({\n code: \"medium-1x\",\n title: \"Medium 1x\",\n cpu: 1,\n memory: 2,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"medium-2x\": machineDefinition({\n code: \"medium-2x\",\n title: \"Medium 2x\",\n cpu: 2,\n memory: 4,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"large-1x\": machineDefinition({\n code: \"large-1x\",\n title: \"Large 1x\",\n cpu: 4,\n memory: 8,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"large-2x\": machineDefinition({\n code: \"large-2x\",\n title: \"Large 2x\",\n cpu: 8,\n memory: 16,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n};\n\nexport type MachineCode = keyof typeof machines;\n\nexport const defaultMachine: MachineCode = \"small-1x\";\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,IAAM,kBAAkB,EAAE,O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ACA;AAAA,EACF;AACF;;;AC3BA,IAAM,qBAAqB,OAAO,QAAQ,IAAI,yBAAyB,CAAC;AACxE,IAAM,sBAAsB,OAAO,QAAQ,IAAI,2BAA2B,CAAC;AAEpE,IAAM,WAAW;AAAA,EACtB,OAAO,kBAAkB;AAAA,IACvB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,aAAa,kBAAkB;AAAA,IAC7B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,aAAa,kBAAkB;AAAA,IAC7B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAIO,IAAM,iBAA8B;","names":["z","z","z","z","z","z","z","z","z","z","z","json","centsPerVCpuSecond","centsPerGbRamSecond"]}
1
+ {"version":3,"sources":["../src/v3/schemas/planDefinitions.ts","../src/v3/schemas/subscription.ts","../src/v3/schemas/subscribe.ts","../src/v3/schemas/portal.ts","../src/v3/schemas/error.ts","../src/v3/schemas/usage.ts","../src/v3/schemas/billingAlerts.ts","../src/v3/schemas/registryCredentials.ts","../src/v3/schemas/enqueueBuild.ts","../src/v3/schemas/initialDeployment.ts","../src/v3/schemas/privateLink.ts","../src/v3/client/index.ts","../src/v3/machineDefinition.ts","../src/v3/machinePresets.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst ExceedableLimit = z.object({\n number: z.number(),\n canExceed: z.boolean().optional(),\n});\n\nexport type ExceedableLimit = z.infer<typeof ExceedableLimit>;\n\nconst EnvironmentBasedLimit = z.object({\n production: z.number(),\n staging: z.number(),\n preview: z.number(),\n development: z.number(),\n canExceed: z.boolean().optional(),\n // Legacy, return the `production` value\n number: z.number(),\n});\nexport type EnvironmentBasedLimit = z.infer<typeof EnvironmentBasedLimit>;\n\nconst BatchRateLimitConfig = z.object({\n type: z.string(),\n interval: z.string(),\n maxTokens: z.number(),\n refillRate: z.number(),\n});\nexport type BatchRateLimitConfig = z.infer<typeof BatchRateLimitConfig>;\n\nconst BatchQueueConcurrencyConfig = z.object({\n processingConcurrency: z.number(),\n});\nexport type BatchQueueConcurrencyConfig = z.infer<\n typeof BatchQueueConcurrencyConfig\n>;\n\nconst QueueSizeLimits = z.object({\n development: z.number(),\n deployed: z.number(),\n});\nexport type QueueSizeLimits = z.infer<typeof QueueSizeLimits>;\n\nconst Limits = z.object({\n includedUsage: z.number(),\n concurrentRuns: EnvironmentBasedLimit,\n teamMembers: ExceedableLimit,\n schedules: ExceedableLimit,\n logRetentionDays: ExceedableLimit,\n queryPeriodDays: ExceedableLimit,\n alerts: ExceedableLimit,\n hasStagingEnvironment: z.boolean(),\n realtimeConcurrentConnections: ExceedableLimit,\n branches: ExceedableLimit,\n support: z.enum([\"community\", \"slack\"]),\n batchRateLimitConfig: BatchRateLimitConfig.optional(),\n batchQueueConcurrencyConfig: BatchQueueConcurrencyConfig.optional(),\n metricDashboards: ExceedableLimit,\n metricWidgetsPerDashboard: ExceedableLimit,\n queueSizeLimits: QueueSizeLimits.optional(),\n hasPrivateNetworking: z.boolean().optional(),\n privateLinkConnectionLimit: z.number().optional(),\n});\n\nexport type Limits = z.infer<typeof Limits>;\n\nconst commonMetadata = {\n title: z.string(),\n code: z.string(),\n};\n\nconst pricingLookup = {\n tierPriceCode: z.string(),\n usagePriceCode: z.string(),\n usageCouponCode: z.string().optional(),\n};\nconst FreePlanDefinition = z.object({\n ...commonMetadata,\n type: z.literal(\"free\"),\n limits: Limits,\n});\nexport type FreePlanDefinition = z.infer<typeof FreePlanDefinition>;\n\nconst PaidPlanDefinition = z.object({\n ...commonMetadata,\n type: z.literal(\"paid\"),\n tierPrice: z.number(),\n stripe: z.object(pricingLookup),\n limits: Limits,\n});\nexport type PaidPlanDefinition = z.infer<typeof PaidPlanDefinition>;\n\nconst EnterprisePlanDefinition = z.object({\n ...commonMetadata,\n type: z.literal(\"enterprise\"),\n limits: Limits,\n});\nexport type EnterprisePlanDefinition = z.infer<typeof EnterprisePlanDefinition>;\n\nexport const PlanDefinitionSchema = z.discriminatedUnion(\"type\", [\n FreePlanDefinition,\n PaidPlanDefinition,\n EnterprisePlanDefinition,\n]);\nexport type PlanDefinition = z.infer<typeof PlanDefinitionSchema>;\n\nconst MachineDefinition = z.object({\n code: z.string(),\n title: z.string(),\n cpu: z.number(),\n memory: z.number(),\n centsPerMs: z.number(),\n});\n\nexport type MachineDefinition = z.infer<typeof MachineDefinition>;\n\nexport const Plans = z.object({\n free: FreePlanDefinition,\n hobby: PaidPlanDefinition,\n pro: PaidPlanDefinition,\n enterprise: EnterprisePlanDefinition,\n});\nexport type Plans = z.infer<typeof Plans>;\n\n/** The pricing per step of the add-on, e.g. $10 for 50 units */\nconst AddOnPricing = z.object({\n /** The step size - must purchase in multiples of this amount */\n stepSize: z.number(),\n /** Price per step in cents */\n centsPerStep: z.number(),\n});\nexport type AddOnPricing = z.infer<typeof AddOnPricing>;\n\nexport const PlansResult = z.object({\n plans: Plans,\n usagePricing: z.object({\n centsPerRunInvocation: z.number(),\n machines: z.record(z.string(), MachineDefinition),\n defaultMachine: z.string(),\n }),\n addOnPricing: z.object({\n concurrency: AddOnPricing,\n branches: AddOnPricing,\n seats: AddOnPricing,\n }),\n});\n\nexport type PlansResult = z.infer<typeof PlansResult>;\n\nexport const AddOnDefinition = z.object({\n code: z.enum([\"concurrency\", \"branches\", \"seats\"]),\n priceCode: z.string(),\n pricing: AddOnPricing,\n});\n\nexport type AddOnDefinition = z.infer<typeof AddOnDefinition>;\n\nexport const AddOn = z.object({\n purchased: z.number(),\n quota: z.number().optional(),\n});\nexport type AddOn = z.infer<typeof AddOn>;\n\nexport const AddOns = z.object({\n concurrentRuns: AddOn.optional(),\n branches: AddOn.optional(),\n seats: AddOn.optional(),\n});\nexport type AddOns = z.infer<typeof AddOns>;\n","import { z } from \"zod\";\nimport { AddOns, PlanDefinitionSchema } from \"./planDefinitions\";\n\nconst FreeTierStatus = z.enum([\"requires_connect\", \"approved\", \"rejected\"]);\nexport type FreeTierStatus = z.infer<typeof FreeTierStatus>;\n\nexport const SubscriptionResult = z.object({\n freeTierStatus: FreeTierStatus,\n isPaying: z.boolean(),\n canceledAt: z.string().optional(),\n plan: PlanDefinitionSchema.optional(),\n addOns: AddOns.optional(),\n});\n\nexport type SubscriptionResult = z.infer<typeof SubscriptionResult>;\n\nexport const CurrentPlan = z.object({\n //todo remove this after the next deploy\n subscription: z.any(),\n v3Subscription: SubscriptionResult,\n});\n\nexport type CurrentPlan = z.infer<typeof CurrentPlan>;\n","import { z } from \"zod\";\n\nconst SetPaidPlanBodySchema = z.object({\n type: z.literal(\"paid\"),\n planCode: z.string(),\n userId: z.string(),\n});\n\nconst SetFreePlanBodySchema = z.object({\n type: z.literal(\"free\"),\n userId: z.string(),\n});\n\nexport const SetPlanBodySchema = z.discriminatedUnion(\"type\", [\n SetPaidPlanBodySchema,\n SetFreePlanBodySchema,\n]);\n\nexport type SetPlanBody = z.infer<typeof SetPlanBodySchema>;\n\nexport const FreeConnectRequiredSchema = z.object({\n action: z.literal(\"free_connect_required\"),\n connectUrl: z.string().url(),\n});\n\nexport type FreeConnectRequired = z.infer<typeof FreeConnectRequiredSchema>;\n\nexport const FreeConnectedSchema = z.object({\n action: z.literal(\"free_connected\"),\n accepted: z.boolean(),\n});\n\nexport type FreeConnected = z.infer<typeof FreeConnectedSchema>;\n\nconst UpdatedSubscriptionResultSchema = z.object({\n action: z.literal(\"updated_subscription\"),\n subscription: z.object({\n planCode: z.string(),\n }),\n});\n\nexport type UpdatedSubscriptionResult = z.infer<\n typeof UpdatedSubscriptionResultSchema\n>;\n\nconst CreateSubscriptionFlowStartSchema = z.object({\n action: z.literal(\"create_subscription_flow_start\"),\n subscription: z.object({\n planCode: z.string(),\n }),\n checkoutUrl: z.string().url(),\n});\n\nexport type CreateSubscriptionFlowStart = z.infer<\n typeof CreateSubscriptionFlowStartSchema\n>;\n\nconst CanceledSubscriptionResultSchema = z.object({\n action: z.literal(\"canceled_subscription\"),\n});\n\nexport type CanceledSubscriptionResult = z.infer<\n typeof CanceledSubscriptionResultSchema\n>;\n\nexport const SubscribeResultSchema = z.discriminatedUnion(\"action\", [\n FreeConnectRequiredSchema,\n FreeConnectedSchema,\n CreateSubscriptionFlowStartSchema,\n UpdatedSubscriptionResultSchema,\n CanceledSubscriptionResultSchema,\n]);\n\nexport type SubscribeResult = z.infer<typeof SubscribeResultSchema>;\n\nexport const SetAddOnBody = z.object({\n type: z.enum([\"concurrency\", \"branches\", \"seats\"]),\n amount: z.number(),\n});\n\nexport type SetAddOnBody = z.infer<typeof SetAddOnBody>;\n\nexport const SetAddOnResult = z.discriminatedUnion(\"result\", [\n z.object({\n result: z.literal(\"error\"),\n error: z.string(),\n }),\n z.object({\n result: z.literal(\"success\"),\n type: z.string(),\n amount: z.number(),\n subscription: z.object({\n id: z.string(),\n }),\n }),\n z.object({\n result: z.literal(\"max_quota_reached\"),\n type: z.string(),\n maxQuota: z.number(),\n }),\n]);\n\nexport type SetAddOnResult = z.infer<typeof SetAddOnResult>;\n","import { z } from \"zod\";\n\nexport const CustomerPortalRequestBodySchema = z.object({\n returnUrl: z.string(),\n});\n\nexport type CustomerPortalRequestBody = z.infer<\n typeof CustomerPortalRequestBodySchema\n>;\n\nexport const CustomerPortalSchema = z.object({\n customerPortalUrl: z.string().optional(),\n});\n\nexport type CustomerPortal = z.infer<typeof CustomerPortalSchema>;\n","import { z } from \"zod\";\n\nexport const ErrorSchema = z.object({\n error: z.string(),\n});\n\nexport type Error = z.infer<typeof ErrorSchema>;\n","import { z } from \"zod\";\n\nexport const UsageParams = z.object({\n from: z.coerce.date(),\n to: z.coerce.date(),\n});\nexport type UsageParams = z.infer<typeof UsageParams>;\n\nexport const UsageResult = z.object({\n cents: z.number(),\n});\nexport type UsageResult = z.infer<typeof UsageResult>;\n\nconst Window = z.enum([\"MINUTE\", \"HOUR\", \"DAY\"]);\n\nconst BooleanParam = z.preprocess(\n (val) => (val === \"true\" ? true : false),\n z.boolean()\n);\n\nexport const UsageSeriesParams = z.object({\n from: z.coerce.date(),\n to: z.coerce.date(),\n /** defaults to DAY */\n window: Window.optional(),\n timezone: z.string().optional(),\n //these don't work at the moment because you can't group by items that aren't defined in the meter group by\n // groupByEnvironmentType: BooleanParam.optional(),\n // groupByTaskIdentifier: BooleanParam.optional(),\n});\n\nexport type UsageSeriesParams = z.infer<typeof UsageSeriesParams>;\n\nexport const UsageSeriesResult = z.object({\n from: z.string(),\n to: z.string(),\n window: Window.optional(),\n data: z\n .object({\n value: z.number(),\n windowStart: z.string(),\n windowEnd: z.string(),\n //these don't work at the moment\n // groupBy: z\n // .object({\n // environmentType: z.string().optional(),\n // taskIdentifer: z.string().optional(),\n // })\n // .optional(),\n })\n .array(),\n});\n\nexport type UsageSeriesResult = z.infer<typeof UsageSeriesResult>;\n\nexport const ReportComputeUsageEvent = z.object({\n durationMs: z.number(),\n});\n\nexport type ReportComputeUsageEvent = z.infer<typeof ReportComputeUsageEvent>;\n\nexport const ReportUsagePlan = z.object({\n type: z.string(),\n code: z.string(),\n isPaying: z.boolean(),\n});\n\nexport type ReportUsagePlan = z.infer<typeof ReportUsagePlan>;\n\nexport const ReportUsageResult = z.object({\n hasAccess: z.boolean(),\n balance: z.number().optional(),\n usage: z.number().optional(),\n overage: z.number().optional(),\n plan: ReportUsagePlan.optional(),\n});\n\nexport type ReportUsageResult = z.infer<typeof ReportUsageResult>;\n\nexport const ReportInvocationUsageEvent = z.object({\n organizationId: z.string(),\n costInCents: z.number(),\n additionalData: z.record(z.any()).optional(),\n});\n\nexport type ReportInvocationUsageEvent = z.infer<\n typeof ReportInvocationUsageEvent\n>;\n\nexport const ReportInvocationUsageResult = z.discriminatedUnion(\"success\", [\n z.object({\n success: z.literal(true),\n }),\n z.object({\n success: z.literal(false),\n error: z.string(),\n }),\n]);\n","import { z } from \"zod\";\n\nconst BillingAlertDefinition = z.object({\n amount: z.number(),\n emails: z.array(z.string()),\n alertLevels: z.array(z.number()),\n});\n\nexport const BillingAlertsResult = BillingAlertDefinition;\n\nexport type BillingAlertsResult = z.infer<typeof BillingAlertsResult>;\n\nexport const UpdateBillingAlertsRequest = z.object({\n amount: z.number(),\n emails: z.array(z.string()),\n alertLevels: z.array(z.number()),\n});\n\nexport type UpdateBillingAlertsRequest = z.infer<\n typeof UpdateBillingAlertsRequest\n>;\n","import { z } from \"zod\";\n\nexport const RegistryCredentialsResponseSchema = z.object({\n username: z.string(),\n password: z.string(),\n expiresAt: z.string().datetime(),\n repositoryUri: z.string(),\n});\n\nexport type RegistryCredentialsResponse = z.infer<\n typeof RegistryCredentialsResponseSchema\n>;\n","import { z } from \"zod\";\n\nexport const EnqueueBuildRequestSchema = z.object({\n deploymentId: z.string(),\n artifactKey: z.string(),\n options: z.object({\n skipPromotion: z.boolean().optional(),\n configFilePath: z.string().optional(),\n }),\n});\n\nexport type EnqueueBuildRequest = z.infer<typeof EnqueueBuildRequestSchema>;\n\nexport const EnqueueBuildResponseSchema = z.object({\n buildId: z.string(),\n});\n\nexport type EnqueueBuildResponse = z.infer<typeof EnqueueBuildResponseSchema>;\n","import { z } from \"zod\";\n\nexport const TriggerInitialDeploymentRequestSchema = z.object({\n environment: z.enum([\"prod\", \"staging\", \"preview\"]),\n});\n\nexport type TriggerInitialDeploymentRequest = z.infer<typeof TriggerInitialDeploymentRequestSchema>;\n\nexport const TriggerInitialDeploymentResponseSchema = z.object({\n ok: z.boolean(),\n});\n\nexport type TriggerInitialDeploymentResponse = z.infer<\n typeof TriggerInitialDeploymentResponseSchema\n>;\n","import { z } from \"zod\";\n\nexport const PrivateLinkConnectionStatus = z.enum([\n \"PENDING\",\n \"PROVISIONING\",\n \"ACTIVE\",\n \"ERROR\",\n \"DELETING\",\n]);\nexport type PrivateLinkConnectionStatus = z.infer<typeof PrivateLinkConnectionStatus>;\n\nexport const PrivateLinkConnection = z.object({\n id: z.string(),\n friendlyId: z.string(),\n name: z.string(),\n organizationId: z.string(),\n endpointServiceName: z.string(),\n targetRegion: z.string(),\n status: PrivateLinkConnectionStatus,\n statusMessage: z.string().nullable(),\n endpointDnsName: z.string().nullable(),\n endpointIps: z.array(z.string()).nullable(),\n provisionedAt: z.string().nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\nexport type PrivateLinkConnection = z.infer<typeof PrivateLinkConnection>;\n\nexport const PrivateLinkConnectionList = z.object({\n connections: z.array(PrivateLinkConnection),\n});\nexport type PrivateLinkConnectionList = z.infer<typeof PrivateLinkConnectionList>;\n\nexport const CreatePrivateLinkConnectionBody = z.object({\n name: z\n .string()\n .min(1)\n .max(100)\n .regex(\n /^[a-zA-Z][a-zA-Z0-9 _-]*$/,\n \"Must start with a letter and contain only letters, numbers, spaces, hyphens, or underscores\"\n ),\n endpointServiceName: z\n .string()\n .regex(\n /^com\\.amazonaws\\.vpce\\..+\\.vpce-svc-.+$/,\n \"Must be a valid VPC Endpoint Service name (com.amazonaws.vpce.<region>.vpce-svc-*)\"\n ),\n targetRegion: z.enum([\"us-east-1\", \"eu-central-1\"]),\n});\nexport type CreatePrivateLinkConnectionBody = z.infer<typeof CreatePrivateLinkConnectionBody>;\n\nexport const DeletePrivateLinkResult = z.object({\n success: z.boolean(),\n});\nexport type DeletePrivateLinkResult = z.infer<typeof DeletePrivateLinkResult>;\n\nexport const PrivateLinkRegionsResult = z.object({\n availableRegions: z.array(z.string()),\n activeRegions: z.array(z.string()),\n});\nexport type PrivateLinkRegionsResult = z.infer<typeof PrivateLinkRegionsResult>;\n","import { ZodType, z } from \"zod\";\nimport {\n BillingAlertsResult,\n CurrentPlan,\n CustomerPortalRequestBody,\n CustomerPortalSchema,\n ErrorSchema,\n PlansResult,\n ReportInvocationUsageEvent,\n ReportInvocationUsageResult,\n ReportUsageResult,\n SetPlanBody,\n SubscribeResultSchema,\n UpdateBillingAlertsRequest,\n UsageParams,\n UsageResult,\n UsageSeriesParams,\n UsageSeriesResult,\n RegistryCredentialsResponseSchema,\n SetAddOnResult,\n SetAddOnBody,\n EnqueueBuildResponseSchema,\n EnqueueBuildRequest,\n TriggerInitialDeploymentRequest,\n TriggerInitialDeploymentResponseSchema,\n PrivateLinkConnectionList,\n PrivateLinkConnection,\n CreatePrivateLinkConnectionBody,\n DeletePrivateLinkResult,\n PrivateLinkRegionsResult,\n} from \"../schemas\";\n\ntype BillingClientConfig = {\n url: string;\n apiKey: string;\n};\n\ntype SuccessResult<TSchema extends ZodType> = {\n success: true;\n} & z.infer<TSchema>;\n\ntype ErrorResult = {\n success: false;\n error: string;\n};\n\ntype Result<TSchema extends ZodType> = SuccessResult<TSchema> | ErrorResult;\n\nexport type PlansResponse = Result<typeof PlansResult>;\nexport type CurrentPlanResponse = Result<typeof CurrentPlan>;\nexport type SetPlanResponse = Result<typeof SubscribeResultSchema>;\nexport type CustomerPortalResponse = Result<typeof CustomerPortalSchema>;\nexport type UsageResponse = Result<typeof UsageResult>;\nexport type UsageSeriesResponse = Result<typeof UsageSeriesResult>;\nexport type UsageInvocationReportResponse = Result<\n typeof ReportInvocationUsageResult\n>;\nexport type UsageEntitlementResponse = Result<typeof ReportUsageResult>;\nexport type BillingAlertsResponse = Result<typeof BillingAlertsResult>;\nexport type RegistryCredentialsResult = Result<\n typeof RegistryCredentialsResponseSchema\n>;\nexport type SetAddOnResponse = Result<typeof SetAddOnResult>;\nexport type EnqueueBuildResult = Result<typeof EnqueueBuildResponseSchema>;\nexport type PrivateLinkConnectionListResponse = Result<\n typeof PrivateLinkConnectionList\n>;\nexport type PrivateLinkConnectionResponse = Result<\n typeof PrivateLinkConnection\n>;\nexport type DeletePrivateLinkResponse = Result<typeof DeletePrivateLinkResult>;\nexport type PrivateLinkRegionsResponse = Result<typeof PrivateLinkRegionsResult>;\nexport type TriggerInitialDeploymentResult = Result<\n typeof TriggerInitialDeploymentResponseSchema\n>;\n\nexport class BillingClient {\n constructor(private readonly config: BillingClientConfig) {}\n\n async plans(): Promise<PlansResponse> {\n return await this.fetch(`/api/v1/plans/v3`, PlansResult);\n }\n\n async currentPlan(orgId: string): Promise<CurrentPlanResponse> {\n return await this.fetch(`/api/v1/orgs/${orgId}`, CurrentPlan);\n }\n\n async usage(orgId: string, params: UsageParams): Promise<UsageResponse> {\n const search = objectToSearchParams(params);\n return await this.fetch(\n `/api/v1/orgs/${orgId}/usage?${search?.toString()}`,\n UsageResult\n );\n }\n\n async usageSeries(\n orgId: string,\n params: UsageSeriesParams\n ): Promise<UsageSeriesResponse> {\n const search = objectToSearchParams(params);\n return await this.fetch(\n `/api/v1/orgs/${orgId}/usage/series?${search?.toString()}`,\n UsageSeriesResult\n );\n }\n\n async setPlan(orgId: string, body: SetPlanBody): Promise<SetPlanResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/v3/subscription`,\n SubscribeResultSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async setAddOn(orgId: string, body: SetAddOnBody): Promise<SetAddOnResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/v3/subscription/addon`,\n SetAddOnResult,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async createPortalSession(\n orgId: string,\n body: CustomerPortalRequestBody\n ): Promise<CustomerPortalResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/v3/subscription/portal`,\n CustomerPortalSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n /**\n *\n * @param event The data is in the body, not using a JWT\n * @returns details about usage\n */\n async reportInvocationUsage(\n event: ReportInvocationUsageEvent\n ): Promise<UsageInvocationReportResponse> {\n return await this.fetch(\n `/api/v1/usage/ingest/invocation`,\n ReportInvocationUsageResult,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(event),\n }\n );\n }\n\n /**\n * Generates registry credentials for a project. This is used to push images to a project's container repository.\n *\n * @param projectId The ID of the project\n * @param region The region to generate credentials for\n * @returns The registry credentials\n */\n async generateRegistryCredentials(\n projectId: string,\n region: \"us-east-1\" | \"eu-central-1\"\n ): Promise<RegistryCredentialsResult> {\n return await this.fetch(\n `/api/v1/projects/${projectId}/generate-registry-credentials`,\n RegistryCredentialsResponseSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ region }),\n }\n );\n }\n\n /**\n * Enqueues a build for a project deployment.\n *\n * @param projectId The ID of the project\n * @param body The enqueue build request containing the deployment ID\n * @returns The build ID\n */\n async enqueueBuild(\n projectId: string,\n body: EnqueueBuildRequest\n ): Promise<EnqueueBuildResult> {\n return await this.fetch(\n `/api/v1/projects/${projectId}/enqueue-build`,\n EnqueueBuildResponseSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n /**\n *\n * @param event The data is in the body, not using a JWT\n * @returns details about usage\n */\n async getEntitlement(orgId: string): Promise<UsageEntitlementResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/usage/entitlement`,\n ReportUsageResult\n );\n }\n\n async getBillingAlerts(orgId: string): Promise<BillingAlertsResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/billing-alerts`,\n BillingAlertsResult\n );\n }\n\n async updateBillingAlerts(\n orgId: string,\n body: UpdateBillingAlertsRequest\n ): Promise<BillingAlertsResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/billing-alerts`,\n BillingAlertsResult,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async getPrivateLinks(\n orgId: string\n ): Promise<PrivateLinkConnectionListResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections`,\n PrivateLinkConnectionList\n );\n }\n\n async createPrivateLink(\n orgId: string,\n body: CreatePrivateLinkConnectionBody\n ): Promise<PrivateLinkConnectionResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections`,\n PrivateLinkConnection,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async deletePrivateLink(\n orgId: string,\n connectionId: string\n ): Promise<DeletePrivateLinkResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections/${connectionId}`,\n DeletePrivateLinkResult,\n {\n method: \"DELETE\",\n }\n );\n }\n\n async getPrivateLinkRegions(\n orgId: string\n ): Promise<PrivateLinkRegionsResponse> {\n return await this.fetch(\n `/api/v1/orgs/${orgId}/private-connections/regions`,\n PrivateLinkRegionsResult\n );\n }\n\n async triggerInitialDeployment(\n projectId: string,\n body: TriggerInitialDeploymentRequest\n ): Promise<TriggerInitialDeploymentResult> {\n return await this.fetch(\n `/api/v1/projects/${projectId}/initial-deployment`,\n TriggerInitialDeploymentResponseSchema,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n }\n );\n }\n\n async fetch<TSchema extends ZodType = z.ZodTypeAny>(\n path: string,\n schema: TSchema,\n requestInit?: RequestInit\n ): Promise<Result<TSchema>> {\n const response = await fetch(`${this.config.url}${path}`, {\n ...requestInit,\n headers: {\n ...requestInit?.headers,\n Authorization: `Bearer ${this.config.apiKey}`,\n },\n });\n\n if (!response.ok) {\n const json = await response.json();\n const parsedError = ErrorSchema.parse(json);\n return {\n success: false,\n error: parsedError.error,\n };\n }\n\n const json = await response.json();\n const parsed = schema.parse(json);\n return {\n success: true,\n ...parsed,\n };\n }\n}\n\nexport function objectToSearchParams(\n obj:\n | undefined\n | Record<\n string,\n | string\n | string[]\n | number\n | number[]\n | boolean\n | boolean[]\n | Date\n | Date[]\n | undefined\n >\n): URLSearchParams | undefined {\n if (!obj) return undefined;\n\n const searchParams = new URLSearchParams();\n //for each item add to the search params, skip undefined and join arrays with commas\n Object.entries(obj).forEach(([key, value]) => {\n if (value === undefined) return;\n if (Array.isArray(value)) {\n const values = value.map((d) => {\n if (d instanceof Date) return d.toISOString();\n return d;\n });\n\n searchParams.append(key, values.join(\",\"));\n } else {\n const v = value instanceof Date ? value.toISOString() : value;\n searchParams.append(key, v.toString());\n }\n });\n\n return searchParams;\n}\n","import { MachineDefinition } from \"./schemas\";\n\nexport type MachineDefinitionInput = {\n code: string;\n title: string;\n cpu: number;\n memory: number;\n centsPerVCpuSecond: number;\n centsPerGbRamSecond: number;\n};\n\nexport function machineDefinition({\n code,\n title,\n cpu,\n memory,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n}: MachineDefinitionInput): MachineDefinition {\n const centsPerSecond =\n cpu * centsPerVCpuSecond + memory * centsPerGbRamSecond;\n const centsPerMs = centsPerSecond / 1000;\n return {\n code,\n title,\n cpu,\n memory,\n centsPerMs,\n };\n}\n","import { machineDefinition } from \"./machineDefinition\";\n\nconst centsPerVCpuSecond = Number(process.env.CENTS_PER_VCPU_SECOND ?? 0);\nconst centsPerGbRamSecond = Number(process.env.CENTS_PER_GB_RAM_SECOND ?? 0);\n\nexport const machines = {\n micro: machineDefinition({\n code: \"micro\",\n title: \"Micro\",\n cpu: 0.25,\n memory: 0.25,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"small-1x\": machineDefinition({\n code: \"small-1x\",\n title: \"Small 1x\",\n cpu: 0.5,\n memory: 0.5,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"small-2x\": machineDefinition({\n code: \"small-2x\",\n title: \"Small 2x\",\n cpu: 1,\n memory: 1,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"medium-1x\": machineDefinition({\n code: \"medium-1x\",\n title: \"Medium 1x\",\n cpu: 1,\n memory: 2,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"medium-2x\": machineDefinition({\n code: \"medium-2x\",\n title: \"Medium 2x\",\n cpu: 2,\n memory: 4,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"large-1x\": machineDefinition({\n code: \"large-1x\",\n title: \"Large 1x\",\n cpu: 4,\n memory: 8,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n \"large-2x\": machineDefinition({\n code: \"large-2x\",\n title: \"Large 2x\",\n cpu: 8,\n memory: 16,\n centsPerVCpuSecond,\n centsPerGbRamSecond,\n }),\n};\n\nexport type MachineCode = keyof typeof machines;\n\nexport const defaultMachine: MachineCode = \"small-1x\";\n"],"mappings":";AAAA,SAAS,SAAS;AAElB,IAAM,kBAAkB,EAAE,OAAO;AAAA,EAC/B,QAAQ,EAAE,OAAO;AAAA,EACjB,WAAW,EAAE,QAAQ,EAAE,SAAS;AAClC,CAAC;AAID,IAAM,wBAAwB,EAAE,OAAO;AAAA,EACrC,YAAY,EAAE,OAAO;AAAA,EACrB,SAAS,EAAE,OAAO;AAAA,EAClB,SAAS,EAAE,OAAO;AAAA,EAClB,aAAa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E,IAAM,WAAW;AAAA,EACtB,OAAO,kBAAkB;AAAA,IACvB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,aAAa,kBAAkB;AAAA,IAC7B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,aAAa,kBAAkB;AAAA,IAC7B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,YAAY,kBAAkB;AAAA,IAC5B,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAIO,IAAM,iBAA8B;","names":["z","z","z","z","z","z","z","z","z","z","z","json","centsPerVCpuSecond","centsPerGbRamSecond"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trigger.dev/platform",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Used to communicate with the Trigger.dev platform. This is not a package you should use directly.",
5
5
  "license": "MIT",
6
6
  "type": "module",