@trigger.dev/platform 0.0.0-prerelease-ecr-20251021203336
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/LICENSE +21 -0
- package/dist/index.cjs +576 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +7091 -0
- package/dist/index.d.ts +7091 -0
- package/dist/index.js +521 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Trigger.dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/v3/index.ts
|
|
21
|
+
var v3_exports = {};
|
|
22
|
+
__export(v3_exports, {
|
|
23
|
+
BillingAlertsResult: () => BillingAlertsResult,
|
|
24
|
+
BillingClient: () => BillingClient,
|
|
25
|
+
CurrentPlan: () => CurrentPlan,
|
|
26
|
+
CustomerPortalRequestBodySchema: () => CustomerPortalRequestBodySchema,
|
|
27
|
+
CustomerPortalSchema: () => CustomerPortalSchema,
|
|
28
|
+
ErrorSchema: () => ErrorSchema,
|
|
29
|
+
FreeConnectRequiredSchema: () => FreeConnectRequiredSchema,
|
|
30
|
+
FreeConnectedSchema: () => FreeConnectedSchema,
|
|
31
|
+
PlanDefinitionSchema: () => PlanDefinitionSchema,
|
|
32
|
+
Plans: () => Plans,
|
|
33
|
+
PlansResult: () => PlansResult,
|
|
34
|
+
RegistryCredentialsResponseSchema: () => RegistryCredentialsResponseSchema,
|
|
35
|
+
ReportComputeUsageEvent: () => ReportComputeUsageEvent,
|
|
36
|
+
ReportInvocationUsageEvent: () => ReportInvocationUsageEvent,
|
|
37
|
+
ReportInvocationUsageResult: () => ReportInvocationUsageResult,
|
|
38
|
+
ReportUsagePlan: () => ReportUsagePlan,
|
|
39
|
+
ReportUsageResult: () => ReportUsageResult,
|
|
40
|
+
SetPlanBodySchema: () => SetPlanBodySchema,
|
|
41
|
+
SubscribeResultSchema: () => SubscribeResultSchema,
|
|
42
|
+
SubscriptionResult: () => SubscriptionResult,
|
|
43
|
+
UpdateBillingAlertsRequest: () => UpdateBillingAlertsRequest,
|
|
44
|
+
UsageParams: () => UsageParams,
|
|
45
|
+
UsageResult: () => UsageResult,
|
|
46
|
+
UsageSeriesParams: () => UsageSeriesParams,
|
|
47
|
+
UsageSeriesResult: () => UsageSeriesResult,
|
|
48
|
+
defaultMachine: () => defaultMachine,
|
|
49
|
+
machineDefinition: () => machineDefinition,
|
|
50
|
+
machines: () => machines,
|
|
51
|
+
objectToSearchParams: () => objectToSearchParams
|
|
52
|
+
});
|
|
53
|
+
module.exports = __toCommonJS(v3_exports);
|
|
54
|
+
|
|
55
|
+
// src/v3/schemas/planDefinitions.ts
|
|
56
|
+
var import_zod = require("zod");
|
|
57
|
+
var ExceedableLimit = import_zod.z.object({
|
|
58
|
+
number: import_zod.z.number(),
|
|
59
|
+
canExceed: import_zod.z.boolean().optional()
|
|
60
|
+
});
|
|
61
|
+
var Limits = import_zod.z.object({
|
|
62
|
+
includedUsage: import_zod.z.number(),
|
|
63
|
+
concurrentRuns: ExceedableLimit,
|
|
64
|
+
teamMembers: ExceedableLimit,
|
|
65
|
+
schedules: ExceedableLimit,
|
|
66
|
+
logRetentionDays: ExceedableLimit,
|
|
67
|
+
alerts: ExceedableLimit,
|
|
68
|
+
hasStagingEnvironment: import_zod.z.boolean(),
|
|
69
|
+
realtimeConcurrentConnections: ExceedableLimit,
|
|
70
|
+
branches: ExceedableLimit,
|
|
71
|
+
support: import_zod.z.enum(["community", "slack"])
|
|
72
|
+
});
|
|
73
|
+
var commonMetadata = {
|
|
74
|
+
title: import_zod.z.string(),
|
|
75
|
+
code: import_zod.z.string()
|
|
76
|
+
};
|
|
77
|
+
var pricingLookup = {
|
|
78
|
+
tierPriceCode: import_zod.z.string(),
|
|
79
|
+
usagePriceCode: import_zod.z.string(),
|
|
80
|
+
usageCouponCode: import_zod.z.string().optional()
|
|
81
|
+
};
|
|
82
|
+
var FreePlanDefinition = import_zod.z.object({
|
|
83
|
+
...commonMetadata,
|
|
84
|
+
type: import_zod.z.literal("free"),
|
|
85
|
+
limits: Limits
|
|
86
|
+
});
|
|
87
|
+
var PaidPlanDefinition = import_zod.z.object({
|
|
88
|
+
...commonMetadata,
|
|
89
|
+
type: import_zod.z.literal("paid"),
|
|
90
|
+
tierPrice: import_zod.z.number(),
|
|
91
|
+
stripe: import_zod.z.object(pricingLookup),
|
|
92
|
+
limits: Limits
|
|
93
|
+
});
|
|
94
|
+
var EnterprisePlanDefinition = import_zod.z.object({
|
|
95
|
+
...commonMetadata,
|
|
96
|
+
type: import_zod.z.literal("enterprise"),
|
|
97
|
+
limits: Limits
|
|
98
|
+
});
|
|
99
|
+
var PlanDefinitionSchema = import_zod.z.discriminatedUnion("type", [
|
|
100
|
+
FreePlanDefinition,
|
|
101
|
+
PaidPlanDefinition,
|
|
102
|
+
EnterprisePlanDefinition
|
|
103
|
+
]);
|
|
104
|
+
var MachineDefinition = import_zod.z.object({
|
|
105
|
+
code: import_zod.z.string(),
|
|
106
|
+
title: import_zod.z.string(),
|
|
107
|
+
cpu: import_zod.z.number(),
|
|
108
|
+
memory: import_zod.z.number(),
|
|
109
|
+
centsPerMs: import_zod.z.number()
|
|
110
|
+
});
|
|
111
|
+
var Plans = import_zod.z.object({
|
|
112
|
+
free: FreePlanDefinition,
|
|
113
|
+
hobby: PaidPlanDefinition,
|
|
114
|
+
pro: PaidPlanDefinition,
|
|
115
|
+
enterprise: EnterprisePlanDefinition
|
|
116
|
+
});
|
|
117
|
+
var PlansResult = import_zod.z.object({
|
|
118
|
+
plans: Plans,
|
|
119
|
+
usagePricing: import_zod.z.object({
|
|
120
|
+
centsPerRunInvocation: import_zod.z.number(),
|
|
121
|
+
machines: import_zod.z.record(import_zod.z.string(), MachineDefinition),
|
|
122
|
+
defaultMachine: import_zod.z.string()
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// src/v3/schemas/subscription.ts
|
|
127
|
+
var import_zod2 = require("zod");
|
|
128
|
+
var FreeTierStatus = import_zod2.z.enum(["requires_connect", "approved", "rejected"]);
|
|
129
|
+
var SubscriptionResult = import_zod2.z.object({
|
|
130
|
+
freeTierStatus: FreeTierStatus,
|
|
131
|
+
isPaying: import_zod2.z.boolean(),
|
|
132
|
+
canceledAt: import_zod2.z.string().optional(),
|
|
133
|
+
plan: PlanDefinitionSchema.optional()
|
|
134
|
+
});
|
|
135
|
+
var CurrentPlan = import_zod2.z.object({
|
|
136
|
+
//todo remove this after the next deploy
|
|
137
|
+
subscription: import_zod2.z.any(),
|
|
138
|
+
v3Subscription: SubscriptionResult
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// src/v3/schemas/subscribe.ts
|
|
142
|
+
var import_zod3 = require("zod");
|
|
143
|
+
var SetPaidPlanBodySchema = import_zod3.z.object({
|
|
144
|
+
type: import_zod3.z.literal("paid"),
|
|
145
|
+
planCode: import_zod3.z.string(),
|
|
146
|
+
userId: import_zod3.z.string()
|
|
147
|
+
});
|
|
148
|
+
var SetFreePlanBodySchema = import_zod3.z.object({
|
|
149
|
+
type: import_zod3.z.literal("free"),
|
|
150
|
+
userId: import_zod3.z.string()
|
|
151
|
+
});
|
|
152
|
+
var SetPlanBodySchema = import_zod3.z.discriminatedUnion("type", [
|
|
153
|
+
SetPaidPlanBodySchema,
|
|
154
|
+
SetFreePlanBodySchema
|
|
155
|
+
]);
|
|
156
|
+
var FreeConnectRequiredSchema = import_zod3.z.object({
|
|
157
|
+
action: import_zod3.z.literal("free_connect_required"),
|
|
158
|
+
connectUrl: import_zod3.z.string().url()
|
|
159
|
+
});
|
|
160
|
+
var FreeConnectedSchema = import_zod3.z.object({
|
|
161
|
+
action: import_zod3.z.literal("free_connected"),
|
|
162
|
+
accepted: import_zod3.z.boolean()
|
|
163
|
+
});
|
|
164
|
+
var UpdatedSubscriptionResultSchema = import_zod3.z.object({
|
|
165
|
+
action: import_zod3.z.literal("updated_subscription"),
|
|
166
|
+
subscription: import_zod3.z.object({
|
|
167
|
+
planCode: import_zod3.z.string()
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
var CreateSubscriptionFlowStartSchema = import_zod3.z.object({
|
|
171
|
+
action: import_zod3.z.literal("create_subscription_flow_start"),
|
|
172
|
+
subscription: import_zod3.z.object({
|
|
173
|
+
planCode: import_zod3.z.string()
|
|
174
|
+
}),
|
|
175
|
+
checkoutUrl: import_zod3.z.string().url()
|
|
176
|
+
});
|
|
177
|
+
var CanceledSubscriptionResultSchema = import_zod3.z.object({
|
|
178
|
+
action: import_zod3.z.literal("canceled_subscription")
|
|
179
|
+
});
|
|
180
|
+
var SubscribeResultSchema = import_zod3.z.discriminatedUnion("action", [
|
|
181
|
+
FreeConnectRequiredSchema,
|
|
182
|
+
FreeConnectedSchema,
|
|
183
|
+
CreateSubscriptionFlowStartSchema,
|
|
184
|
+
UpdatedSubscriptionResultSchema,
|
|
185
|
+
CanceledSubscriptionResultSchema
|
|
186
|
+
]);
|
|
187
|
+
|
|
188
|
+
// src/v3/schemas/portal.ts
|
|
189
|
+
var import_zod4 = require("zod");
|
|
190
|
+
var CustomerPortalRequestBodySchema = import_zod4.z.object({
|
|
191
|
+
returnUrl: import_zod4.z.string()
|
|
192
|
+
});
|
|
193
|
+
var CustomerPortalSchema = import_zod4.z.object({
|
|
194
|
+
customerPortalUrl: import_zod4.z.string().optional()
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
// src/v3/schemas/error.ts
|
|
198
|
+
var import_zod5 = require("zod");
|
|
199
|
+
var ErrorSchema = import_zod5.z.object({
|
|
200
|
+
error: import_zod5.z.string()
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
// src/v3/schemas/usage.ts
|
|
204
|
+
var import_zod6 = require("zod");
|
|
205
|
+
var UsageParams = import_zod6.z.object({
|
|
206
|
+
from: import_zod6.z.coerce.date(),
|
|
207
|
+
to: import_zod6.z.coerce.date()
|
|
208
|
+
});
|
|
209
|
+
var UsageResult = import_zod6.z.object({
|
|
210
|
+
cents: import_zod6.z.number()
|
|
211
|
+
});
|
|
212
|
+
var Window = import_zod6.z.enum(["MINUTE", "HOUR", "DAY"]);
|
|
213
|
+
var BooleanParam = import_zod6.z.preprocess(
|
|
214
|
+
(val) => val === "true" ? true : false,
|
|
215
|
+
import_zod6.z.boolean()
|
|
216
|
+
);
|
|
217
|
+
var UsageSeriesParams = import_zod6.z.object({
|
|
218
|
+
from: import_zod6.z.coerce.date(),
|
|
219
|
+
to: import_zod6.z.coerce.date(),
|
|
220
|
+
/** defaults to DAY */
|
|
221
|
+
window: Window.optional(),
|
|
222
|
+
timezone: import_zod6.z.string().optional()
|
|
223
|
+
//these don't work at the moment because you can't group by items that aren't defined in the meter group by
|
|
224
|
+
// groupByEnvironmentType: BooleanParam.optional(),
|
|
225
|
+
// groupByTaskIdentifier: BooleanParam.optional(),
|
|
226
|
+
});
|
|
227
|
+
var UsageSeriesResult = import_zod6.z.object({
|
|
228
|
+
from: import_zod6.z.string(),
|
|
229
|
+
to: import_zod6.z.string(),
|
|
230
|
+
window: Window.optional(),
|
|
231
|
+
data: import_zod6.z.object({
|
|
232
|
+
value: import_zod6.z.number(),
|
|
233
|
+
windowStart: import_zod6.z.string(),
|
|
234
|
+
windowEnd: import_zod6.z.string()
|
|
235
|
+
//these don't work at the moment
|
|
236
|
+
// groupBy: z
|
|
237
|
+
// .object({
|
|
238
|
+
// environmentType: z.string().optional(),
|
|
239
|
+
// taskIdentifer: z.string().optional(),
|
|
240
|
+
// })
|
|
241
|
+
// .optional(),
|
|
242
|
+
}).array()
|
|
243
|
+
});
|
|
244
|
+
var ReportComputeUsageEvent = import_zod6.z.object({
|
|
245
|
+
durationMs: import_zod6.z.number()
|
|
246
|
+
});
|
|
247
|
+
var ReportUsagePlan = import_zod6.z.object({
|
|
248
|
+
type: import_zod6.z.string(),
|
|
249
|
+
code: import_zod6.z.string(),
|
|
250
|
+
isPaying: import_zod6.z.boolean()
|
|
251
|
+
});
|
|
252
|
+
var ReportUsageResult = import_zod6.z.object({
|
|
253
|
+
hasAccess: import_zod6.z.boolean(),
|
|
254
|
+
balance: import_zod6.z.number().optional(),
|
|
255
|
+
usage: import_zod6.z.number().optional(),
|
|
256
|
+
overage: import_zod6.z.number().optional(),
|
|
257
|
+
plan: ReportUsagePlan.optional()
|
|
258
|
+
});
|
|
259
|
+
var ReportInvocationUsageEvent = import_zod6.z.object({
|
|
260
|
+
organizationId: import_zod6.z.string(),
|
|
261
|
+
costInCents: import_zod6.z.number(),
|
|
262
|
+
additionalData: import_zod6.z.record(import_zod6.z.any()).optional()
|
|
263
|
+
});
|
|
264
|
+
var ReportInvocationUsageResult = import_zod6.z.discriminatedUnion("success", [
|
|
265
|
+
import_zod6.z.object({
|
|
266
|
+
success: import_zod6.z.literal(true)
|
|
267
|
+
}),
|
|
268
|
+
import_zod6.z.object({
|
|
269
|
+
success: import_zod6.z.literal(false),
|
|
270
|
+
error: import_zod6.z.string()
|
|
271
|
+
})
|
|
272
|
+
]);
|
|
273
|
+
|
|
274
|
+
// src/v3/schemas/billingAlerts.ts
|
|
275
|
+
var import_zod7 = require("zod");
|
|
276
|
+
var BillingAlertDefinition = import_zod7.z.object({
|
|
277
|
+
amount: import_zod7.z.number(),
|
|
278
|
+
emails: import_zod7.z.array(import_zod7.z.string()),
|
|
279
|
+
alertLevels: import_zod7.z.array(import_zod7.z.number())
|
|
280
|
+
});
|
|
281
|
+
var BillingAlertsResult = BillingAlertDefinition;
|
|
282
|
+
var UpdateBillingAlertsRequest = import_zod7.z.object({
|
|
283
|
+
amount: import_zod7.z.number(),
|
|
284
|
+
emails: import_zod7.z.array(import_zod7.z.string()),
|
|
285
|
+
alertLevels: import_zod7.z.array(import_zod7.z.number())
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
// src/v3/schemas/registryCredentials.ts
|
|
289
|
+
var import_zod8 = require("zod");
|
|
290
|
+
var RegistryCredentialsResponseSchema = import_zod8.z.object({
|
|
291
|
+
username: import_zod8.z.string(),
|
|
292
|
+
password: import_zod8.z.string(),
|
|
293
|
+
expiresAt: import_zod8.z.string().datetime(),
|
|
294
|
+
repositoryUri: import_zod8.z.string()
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
// src/v3/client/index.ts
|
|
298
|
+
var BillingClient = class {
|
|
299
|
+
constructor(config) {
|
|
300
|
+
this.config = config;
|
|
301
|
+
}
|
|
302
|
+
async plans() {
|
|
303
|
+
return await this.fetch(`/api/v1/plans/v3`, PlansResult);
|
|
304
|
+
}
|
|
305
|
+
async currentPlan(orgId) {
|
|
306
|
+
return await this.fetch(`/api/v1/orgs/${orgId}`, CurrentPlan);
|
|
307
|
+
}
|
|
308
|
+
async usage(orgId, params) {
|
|
309
|
+
const search = objectToSearchParams(params);
|
|
310
|
+
return await this.fetch(
|
|
311
|
+
`/api/v1/orgs/${orgId}/usage?${search == null ? void 0 : search.toString()}`,
|
|
312
|
+
UsageResult
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
async usageSeries(orgId, params) {
|
|
316
|
+
const search = objectToSearchParams(params);
|
|
317
|
+
return await this.fetch(
|
|
318
|
+
`/api/v1/orgs/${orgId}/usage/series?${search == null ? void 0 : search.toString()}`,
|
|
319
|
+
UsageSeriesResult
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
async setPlan(orgId, body) {
|
|
323
|
+
return await this.fetch(
|
|
324
|
+
`/api/v1/orgs/${orgId}/v3/subscription`,
|
|
325
|
+
SubscribeResultSchema,
|
|
326
|
+
{
|
|
327
|
+
method: "POST",
|
|
328
|
+
headers: {
|
|
329
|
+
"Content-Type": "application/json"
|
|
330
|
+
},
|
|
331
|
+
body: JSON.stringify(body)
|
|
332
|
+
}
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
async createPortalSession(orgId, body) {
|
|
336
|
+
return await this.fetch(
|
|
337
|
+
`/api/v1/orgs/${orgId}/v3/subscription/portal`,
|
|
338
|
+
CustomerPortalSchema,
|
|
339
|
+
{
|
|
340
|
+
method: "POST",
|
|
341
|
+
headers: {
|
|
342
|
+
"Content-Type": "application/json"
|
|
343
|
+
},
|
|
344
|
+
body: JSON.stringify(body)
|
|
345
|
+
}
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
*
|
|
350
|
+
* @param event The data is in the body, not using a JWT
|
|
351
|
+
* @returns details about usage
|
|
352
|
+
*/
|
|
353
|
+
async reportInvocationUsage(event) {
|
|
354
|
+
return await this.fetch(
|
|
355
|
+
`/api/v1/usage/ingest/invocation`,
|
|
356
|
+
ReportInvocationUsageResult,
|
|
357
|
+
{
|
|
358
|
+
method: "POST",
|
|
359
|
+
headers: {
|
|
360
|
+
"Content-Type": "application/json"
|
|
361
|
+
},
|
|
362
|
+
body: JSON.stringify(event)
|
|
363
|
+
}
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Generates registry credentials for a project. This is used to push images to a project's container repository.
|
|
368
|
+
*
|
|
369
|
+
* @param projectId The ID of the project
|
|
370
|
+
* @param region The region to generate credentials for
|
|
371
|
+
* @returns The registry credentials
|
|
372
|
+
*/
|
|
373
|
+
async generateRegistryCredentials(projectId, region) {
|
|
374
|
+
return await this.fetch(
|
|
375
|
+
`/api/v1/projects/${projectId}/generate-registry-credentials`,
|
|
376
|
+
RegistryCredentialsResponseSchema,
|
|
377
|
+
{
|
|
378
|
+
method: "POST",
|
|
379
|
+
headers: {
|
|
380
|
+
"Content-Type": "application/json"
|
|
381
|
+
},
|
|
382
|
+
body: JSON.stringify({ region })
|
|
383
|
+
}
|
|
384
|
+
);
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
*
|
|
388
|
+
* @param event The data is in the body, not using a JWT
|
|
389
|
+
* @returns details about usage
|
|
390
|
+
*/
|
|
391
|
+
async getEntitlement(orgId) {
|
|
392
|
+
return await this.fetch(
|
|
393
|
+
`/api/v1/orgs/${orgId}/usage/entitlement`,
|
|
394
|
+
ReportUsageResult
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
async getBillingAlerts(orgId) {
|
|
398
|
+
return await this.fetch(
|
|
399
|
+
`/api/v1/orgs/${orgId}/billing-alerts`,
|
|
400
|
+
BillingAlertsResult
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
async updateBillingAlerts(orgId, body) {
|
|
404
|
+
return await this.fetch(
|
|
405
|
+
`/api/v1/orgs/${orgId}/billing-alerts`,
|
|
406
|
+
BillingAlertsResult,
|
|
407
|
+
{
|
|
408
|
+
method: "POST",
|
|
409
|
+
headers: {
|
|
410
|
+
"Content-Type": "application/json"
|
|
411
|
+
},
|
|
412
|
+
body: JSON.stringify(body)
|
|
413
|
+
}
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
async fetch(path, schema, requestInit) {
|
|
417
|
+
const response = await fetch(`${this.config.url}${path}`, {
|
|
418
|
+
...requestInit,
|
|
419
|
+
headers: {
|
|
420
|
+
...requestInit == null ? void 0 : requestInit.headers,
|
|
421
|
+
Authorization: `Bearer ${this.config.apiKey}`
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
if (!response.ok) {
|
|
425
|
+
const json2 = await response.json();
|
|
426
|
+
const parsedError = ErrorSchema.parse(json2);
|
|
427
|
+
return {
|
|
428
|
+
success: false,
|
|
429
|
+
error: parsedError.error
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
const json = await response.json();
|
|
433
|
+
const parsed = schema.parse(json);
|
|
434
|
+
return {
|
|
435
|
+
success: true,
|
|
436
|
+
...parsed
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
function objectToSearchParams(obj) {
|
|
441
|
+
if (!obj)
|
|
442
|
+
return void 0;
|
|
443
|
+
const searchParams = new URLSearchParams();
|
|
444
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
445
|
+
if (value === void 0)
|
|
446
|
+
return;
|
|
447
|
+
if (Array.isArray(value)) {
|
|
448
|
+
const values = value.map((d) => {
|
|
449
|
+
if (d instanceof Date)
|
|
450
|
+
return d.toISOString();
|
|
451
|
+
return d;
|
|
452
|
+
});
|
|
453
|
+
searchParams.append(key, values.join(","));
|
|
454
|
+
} else {
|
|
455
|
+
const v = value instanceof Date ? value.toISOString() : value;
|
|
456
|
+
searchParams.append(key, v.toString());
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
return searchParams;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// src/v3/machineDefinition.ts
|
|
463
|
+
function machineDefinition({
|
|
464
|
+
code,
|
|
465
|
+
title,
|
|
466
|
+
cpu,
|
|
467
|
+
memory,
|
|
468
|
+
centsPerVCpuSecond: centsPerVCpuSecond2,
|
|
469
|
+
centsPerGbRamSecond: centsPerGbRamSecond2
|
|
470
|
+
}) {
|
|
471
|
+
const centsPerSecond = cpu * centsPerVCpuSecond2 + memory * centsPerGbRamSecond2;
|
|
472
|
+
const centsPerMs = centsPerSecond / 1e3;
|
|
473
|
+
return {
|
|
474
|
+
code,
|
|
475
|
+
title,
|
|
476
|
+
cpu,
|
|
477
|
+
memory,
|
|
478
|
+
centsPerMs
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// src/v3/machinePresets.ts
|
|
483
|
+
var centsPerVCpuSecond = Number(process.env.CENTS_PER_VCPU_SECOND ?? 0);
|
|
484
|
+
var centsPerGbRamSecond = Number(process.env.CENTS_PER_GB_RAM_SECOND ?? 0);
|
|
485
|
+
var machines = {
|
|
486
|
+
micro: machineDefinition({
|
|
487
|
+
code: "micro",
|
|
488
|
+
title: "Micro",
|
|
489
|
+
cpu: 0.25,
|
|
490
|
+
memory: 0.25,
|
|
491
|
+
centsPerVCpuSecond,
|
|
492
|
+
centsPerGbRamSecond
|
|
493
|
+
}),
|
|
494
|
+
"small-1x": machineDefinition({
|
|
495
|
+
code: "small-1x",
|
|
496
|
+
title: "Small 1x",
|
|
497
|
+
cpu: 0.5,
|
|
498
|
+
memory: 0.5,
|
|
499
|
+
centsPerVCpuSecond,
|
|
500
|
+
centsPerGbRamSecond
|
|
501
|
+
}),
|
|
502
|
+
"small-2x": machineDefinition({
|
|
503
|
+
code: "small-2x",
|
|
504
|
+
title: "Small 2x",
|
|
505
|
+
cpu: 1,
|
|
506
|
+
memory: 1,
|
|
507
|
+
centsPerVCpuSecond,
|
|
508
|
+
centsPerGbRamSecond
|
|
509
|
+
}),
|
|
510
|
+
"medium-1x": machineDefinition({
|
|
511
|
+
code: "medium-1x",
|
|
512
|
+
title: "Medium 1x",
|
|
513
|
+
cpu: 1,
|
|
514
|
+
memory: 2,
|
|
515
|
+
centsPerVCpuSecond,
|
|
516
|
+
centsPerGbRamSecond
|
|
517
|
+
}),
|
|
518
|
+
"medium-2x": machineDefinition({
|
|
519
|
+
code: "medium-2x",
|
|
520
|
+
title: "Medium 2x",
|
|
521
|
+
cpu: 2,
|
|
522
|
+
memory: 4,
|
|
523
|
+
centsPerVCpuSecond,
|
|
524
|
+
centsPerGbRamSecond
|
|
525
|
+
}),
|
|
526
|
+
"large-1x": machineDefinition({
|
|
527
|
+
code: "large-1x",
|
|
528
|
+
title: "Large 1x",
|
|
529
|
+
cpu: 4,
|
|
530
|
+
memory: 8,
|
|
531
|
+
centsPerVCpuSecond,
|
|
532
|
+
centsPerGbRamSecond
|
|
533
|
+
}),
|
|
534
|
+
"large-2x": machineDefinition({
|
|
535
|
+
code: "large-2x",
|
|
536
|
+
title: "Large 2x",
|
|
537
|
+
cpu: 8,
|
|
538
|
+
memory: 16,
|
|
539
|
+
centsPerVCpuSecond,
|
|
540
|
+
centsPerGbRamSecond
|
|
541
|
+
})
|
|
542
|
+
};
|
|
543
|
+
var defaultMachine = "small-1x";
|
|
544
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
545
|
+
0 && (module.exports = {
|
|
546
|
+
BillingAlertsResult,
|
|
547
|
+
BillingClient,
|
|
548
|
+
CurrentPlan,
|
|
549
|
+
CustomerPortalRequestBodySchema,
|
|
550
|
+
CustomerPortalSchema,
|
|
551
|
+
ErrorSchema,
|
|
552
|
+
FreeConnectRequiredSchema,
|
|
553
|
+
FreeConnectedSchema,
|
|
554
|
+
PlanDefinitionSchema,
|
|
555
|
+
Plans,
|
|
556
|
+
PlansResult,
|
|
557
|
+
RegistryCredentialsResponseSchema,
|
|
558
|
+
ReportComputeUsageEvent,
|
|
559
|
+
ReportInvocationUsageEvent,
|
|
560
|
+
ReportInvocationUsageResult,
|
|
561
|
+
ReportUsagePlan,
|
|
562
|
+
ReportUsageResult,
|
|
563
|
+
SetPlanBodySchema,
|
|
564
|
+
SubscribeResultSchema,
|
|
565
|
+
SubscriptionResult,
|
|
566
|
+
UpdateBillingAlertsRequest,
|
|
567
|
+
UsageParams,
|
|
568
|
+
UsageResult,
|
|
569
|
+
UsageSeriesParams,
|
|
570
|
+
UsageSeriesResult,
|
|
571
|
+
defaultMachine,
|
|
572
|
+
machineDefinition,
|
|
573
|
+
machines,
|
|
574
|
+
objectToSearchParams
|
|
575
|
+
});
|
|
576
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +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/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 Limits = z.object({\n includedUsage: z.number(),\n concurrentRuns: ExceedableLimit,\n teamMembers: ExceedableLimit,\n schedules: ExceedableLimit,\n logRetentionDays: ExceedableLimit,\n alerts: ExceedableLimit,\n hasStagingEnvironment: z.boolean(),\n realtimeConcurrentConnections: ExceedableLimit,\n branches: ExceedableLimit,\n support: z.enum([\"community\", \"slack\"]),\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};\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\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});\n\nexport type PlansResult = z.infer<typeof PlansResult>;\n","import { z } from \"zod\";\nimport { 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});\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","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 { 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} 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>;\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 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 *\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 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;;;ACAA,iBAAkB;AAElB,IAAM,kBAAkB,aAAE,OAAO;AAAA,EAC/B,QAAQ,aAAE,OAAO;AAAA,EACjB,WAAW,aAAE,QAAQ,EAAE,SAAS;AAClC,CAAC;AAID,IAAM,SAAS,aAAE,OAAO;AAAA,EACtB,eAAe,aAAE,OAAO;AAAA,EACxB,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,QAAQ;AAAA,EACR,uBAAuB,aAAE,QAAQ;AAAA,EACjC,+BAA+B;AAAA,EAC/B,UAAU;AAAA,EACV,SAAS,aAAE,KAAK,CAAC,aAAa,OAAO,CAAC;AACxC,CAAC;AAID,IAAM,iBAAiB;AAAA,EACrB,OAAO,aAAE,OAAO;AAAA,EAChB,MAAM,aAAE,OAAO;AACjB;AAEA,IAAM,gBAAgB;AAAA,EACpB,eAAe,aAAE,OAAO;AAAA,EACxB,gBAAgB,aAAE,OAAO;AAAA,EACzB,iBAAiB,aAAE,OAAO,EAAE,SAAS;AACvC;AAEA,IAAM,qBAAqB,aAAE,OAA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","import_zod","import_zod","import_zod","import_zod","json","centsPerVCpuSecond","centsPerGbRamSecond"]}
|