@lilbox/contracts 0.0.0-stage → 0.0.1
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/README.md +66 -2
- package/dist/account.d.ts +175 -0
- package/dist/account.js +156 -0
- package/dist/app.d.ts +860 -0
- package/dist/app.js +169 -0
- package/dist/billing.d.ts +396 -0
- package/dist/billing.js +215 -0
- package/dist/common.d.ts +43 -0
- package/dist/common.js +59 -0
- package/dist/define.d.ts +29 -0
- package/dist/define.js +16 -0
- package/dist/deployment.d.ts +1495 -0
- package/dist/deployment.js +297 -0
- package/dist/errors.d.ts +141 -0
- package/dist/errors.js +58 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +20 -0
- package/dist/manifest.d.ts +101 -0
- package/dist/manifest.js +78 -0
- package/dist/mcp-tools.json +7748 -0
- package/dist/openapi.d.ts +60 -0
- package/dist/openapi.js +156 -0
- package/dist/openapi.json +5349 -0
- package/dist/registry.d.ts +2393 -0
- package/dist/registry.js +49 -0
- package/dist/runtime.d.ts +277 -0
- package/dist/runtime.js +144 -0
- package/dist/schemas/app.schema.json +256 -0
- package/dist/security.d.ts +127 -0
- package/dist/security.js +64 -0
- package/package.json +29 -4
package/dist/app.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// Group 2: Application. What does the user want running? (desired state)
|
|
2
|
+
//
|
|
3
|
+
// The app is the unit everything attaches to: its name is its hostname, it has one config, and Deployment
|
|
4
|
+
// gives it deployments. No projects, no environments. Status, health and what's live are Runtime's (get_status).
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { AppId, AppName, DryRun, EnvName, NextCursor, PageInput, Timestamp } from "./common.js";
|
|
7
|
+
import { defineOperation } from "./define.js";
|
|
8
|
+
import { Deployment } from "./deployment.js";
|
|
9
|
+
// -----------------------------------------------------------------------------------------------------------
|
|
10
|
+
// Entities
|
|
11
|
+
// -----------------------------------------------------------------------------------------------------------
|
|
12
|
+
export const App = z
|
|
13
|
+
.object({
|
|
14
|
+
id: AppId,
|
|
15
|
+
name: AppName,
|
|
16
|
+
url: z.url().meta({ description: "https://<name>.lilbox.app. Answers once a deployment is live." }),
|
|
17
|
+
state: z.enum(["active", "deleting"]).meta({ description: "The app's own lifecycle. Whether it's running is get_status." }),
|
|
18
|
+
created_at: Timestamp,
|
|
19
|
+
updated_at: Timestamp,
|
|
20
|
+
})
|
|
21
|
+
.meta({ id: "App" });
|
|
22
|
+
export const AppConfig = z
|
|
23
|
+
.object({
|
|
24
|
+
version: z.number().int().meta({ description: "Increases with every change. Deployments record the version they run." }),
|
|
25
|
+
env: z.record(EnvName, z.string()),
|
|
26
|
+
secrets: z.array(z.object({ name: EnvName, updated_at: Timestamp })).meta({ description: "Names only; values are never returned." }),
|
|
27
|
+
platform_env: z.array(EnvName).meta({ description: "Variables lilbox sets itself (PORT, LILBOX_URL…), names only." }),
|
|
28
|
+
})
|
|
29
|
+
.meta({ id: "AppConfig" });
|
|
30
|
+
/** A config change writes a new config version, then Deployment makes it live (trigger: config, same image). */
|
|
31
|
+
const ConfigChangeResult = z.object({
|
|
32
|
+
config: AppConfig,
|
|
33
|
+
deployment: Deployment.nullable().meta({ description: "The deployment that applies the change. Null if nothing is deployed yet." }),
|
|
34
|
+
});
|
|
35
|
+
// -----------------------------------------------------------------------------------------------------------
|
|
36
|
+
// Tools: apps
|
|
37
|
+
// -----------------------------------------------------------------------------------------------------------
|
|
38
|
+
export const list_apps = defineOperation({
|
|
39
|
+
name: "list_apps",
|
|
40
|
+
title: "List apps",
|
|
41
|
+
description: "Lists your apps, newest first. For each one's health and live deployment, use get_status.",
|
|
42
|
+
http: { method: "GET", path: "/v1/apps" },
|
|
43
|
+
scopes: ["apps:read"],
|
|
44
|
+
mutating: false,
|
|
45
|
+
phase: 1,
|
|
46
|
+
audience: "agent",
|
|
47
|
+
input: z.object({ ...PageInput }),
|
|
48
|
+
output: z.object({ apps: z.array(App), next_cursor: NextCursor }),
|
|
49
|
+
hints: { readOnly: true },
|
|
50
|
+
});
|
|
51
|
+
export const create_app = defineOperation({
|
|
52
|
+
name: "create_app",
|
|
53
|
+
title: "Create an app",
|
|
54
|
+
description: "Creates an empty app. Its name becomes its URL: https://<name>.lilbox.app. Nothing runs until you " +
|
|
55
|
+
"deploy. Fails with conflict if the name is taken or reserved, and quota_exceeded at the plan's app limit. " +
|
|
56
|
+
"Next: create_deployment.",
|
|
57
|
+
http: { method: "POST", path: "/v1/apps" },
|
|
58
|
+
scopes: ["apps:write"],
|
|
59
|
+
mutating: true,
|
|
60
|
+
phase: 1,
|
|
61
|
+
audience: "agent",
|
|
62
|
+
input: z.object({ name: AppName, dry_run: DryRun }),
|
|
63
|
+
output: z.object({ app: App }),
|
|
64
|
+
});
|
|
65
|
+
export const get_app = defineOperation({
|
|
66
|
+
name: "get_app",
|
|
67
|
+
title: "Get an app",
|
|
68
|
+
description: "Returns one app. For health, conditions and the live deployment, use get_status.",
|
|
69
|
+
http: { method: "GET", path: "/v1/apps/{app_id}" },
|
|
70
|
+
scopes: ["apps:read"],
|
|
71
|
+
mutating: false,
|
|
72
|
+
phase: 1,
|
|
73
|
+
audience: "agent",
|
|
74
|
+
input: z.object({ app_id: AppId }),
|
|
75
|
+
output: z.object({ app: App }),
|
|
76
|
+
hints: { readOnly: true },
|
|
77
|
+
});
|
|
78
|
+
export const delete_app = defineOperation({
|
|
79
|
+
name: "delete_app",
|
|
80
|
+
title: "Delete an app",
|
|
81
|
+
description: "Deletes an app: its URL stops answering and its deployments, config and logs are removed. Cannot be " +
|
|
82
|
+
"undone. confirm_name must equal the app's name. Returns the app in state deleting; get_app returns not_found " +
|
|
83
|
+
"once it's gone.",
|
|
84
|
+
http: { method: "DELETE", path: "/v1/apps/{app_id}" },
|
|
85
|
+
scopes: ["apps:write"],
|
|
86
|
+
mutating: true,
|
|
87
|
+
phase: 1,
|
|
88
|
+
audience: "agent",
|
|
89
|
+
input: z.object({
|
|
90
|
+
app_id: AppId,
|
|
91
|
+
confirm_name: AppName.meta({ description: "The app's name, as a guard against deleting the wrong one." }),
|
|
92
|
+
dry_run: DryRun,
|
|
93
|
+
}),
|
|
94
|
+
output: z.object({ app: App }),
|
|
95
|
+
hints: { destructive: true },
|
|
96
|
+
});
|
|
97
|
+
// -----------------------------------------------------------------------------------------------------------
|
|
98
|
+
// Tools: config. Secret values are write-only: never returned by any call.
|
|
99
|
+
// -----------------------------------------------------------------------------------------------------------
|
|
100
|
+
export const list_config = defineOperation({
|
|
101
|
+
name: "list_config",
|
|
102
|
+
title: "List config",
|
|
103
|
+
description: "Returns the app's env vars with values, and secret names without values.",
|
|
104
|
+
http: { method: "GET", path: "/v1/apps/{app_id}/config" },
|
|
105
|
+
scopes: ["apps:read"],
|
|
106
|
+
mutating: false,
|
|
107
|
+
phase: 1,
|
|
108
|
+
audience: "agent",
|
|
109
|
+
input: z.object({ app_id: AppId }),
|
|
110
|
+
output: AppConfig,
|
|
111
|
+
hints: { readOnly: true },
|
|
112
|
+
});
|
|
113
|
+
export const set_env = defineOperation({
|
|
114
|
+
name: "set_env",
|
|
115
|
+
title: "Set env vars",
|
|
116
|
+
description: "Sets plain (non-secret) env vars, merging with existing ones, and deploys the change (same image, new config). " +
|
|
117
|
+
"Put credentials, tokens and connection strings in set_secret instead: env values are readable.",
|
|
118
|
+
http: { method: "PATCH", path: "/v1/apps/{app_id}/config/env" },
|
|
119
|
+
scopes: ["apps:write"],
|
|
120
|
+
mutating: true,
|
|
121
|
+
phase: 1,
|
|
122
|
+
audience: "agent",
|
|
123
|
+
input: z.object({ app_id: AppId, vars: z.record(EnvName, z.string().max(32_768)) }),
|
|
124
|
+
output: ConfigChangeResult,
|
|
125
|
+
});
|
|
126
|
+
export const unset_env = defineOperation({
|
|
127
|
+
name: "unset_env",
|
|
128
|
+
title: "Unset env vars",
|
|
129
|
+
description: "Removes env vars or secrets by name and deploys the change.",
|
|
130
|
+
http: { method: "POST", path: "/v1/apps/{app_id}/config/unset" },
|
|
131
|
+
scopes: ["apps:write"],
|
|
132
|
+
mutating: true,
|
|
133
|
+
phase: 1,
|
|
134
|
+
audience: "agent",
|
|
135
|
+
input: z.object({ app_id: AppId, names: z.array(EnvName).min(1) }),
|
|
136
|
+
output: ConfigChangeResult,
|
|
137
|
+
});
|
|
138
|
+
export const set_secret = defineOperation({
|
|
139
|
+
name: "set_secret",
|
|
140
|
+
title: "Set a secret",
|
|
141
|
+
description: "Stores a secret (API key, DATABASE_URL, signing key) encrypted, exposes it to the app as an env var, and " +
|
|
142
|
+
"deploys the change. The value is never returned. If the human must provide the value, ask them; don't invent " +
|
|
143
|
+
"one. For random values (session keys), use generate_secret.",
|
|
144
|
+
http: { method: "PUT", path: "/v1/apps/{app_id}/config/secrets/{name}" },
|
|
145
|
+
scopes: ["apps:write"],
|
|
146
|
+
mutating: true,
|
|
147
|
+
phase: 1,
|
|
148
|
+
audience: "agent",
|
|
149
|
+
input: z.object({ app_id: AppId, name: EnvName, value: z.string().min(1).max(32_768) }),
|
|
150
|
+
output: ConfigChangeResult,
|
|
151
|
+
});
|
|
152
|
+
export const generate_secret = defineOperation({
|
|
153
|
+
name: "generate_secret",
|
|
154
|
+
title: "Generate a secret",
|
|
155
|
+
description: "Generates a random secret on the server (so it never passes through the conversation), stores it like " +
|
|
156
|
+
"set_secret, and deploys the change. Use for session keys, signing keys and internal tokens.",
|
|
157
|
+
http: { method: "POST", path: "/v1/apps/{app_id}/config/secrets/{name}/generate" },
|
|
158
|
+
scopes: ["apps:write"],
|
|
159
|
+
mutating: true,
|
|
160
|
+
phase: 1,
|
|
161
|
+
audience: "agent",
|
|
162
|
+
input: z.object({
|
|
163
|
+
app_id: AppId,
|
|
164
|
+
name: EnvName,
|
|
165
|
+
length: z.number().int().min(16).max(256).default(48).optional(),
|
|
166
|
+
charset: z.enum(["base64url", "hex", "alphanumeric"]).default("base64url").optional(),
|
|
167
|
+
}),
|
|
168
|
+
output: ConfigChangeResult,
|
|
169
|
+
});
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const Meter: z.ZodEnum<{
|
|
3
|
+
apps: "apps";
|
|
4
|
+
compute_hours: "compute_hours";
|
|
5
|
+
requests: "requests";
|
|
6
|
+
egress_gb: "egress_gb";
|
|
7
|
+
build_minutes: "build_minutes";
|
|
8
|
+
}>;
|
|
9
|
+
export declare const BillingPlan: z.ZodObject<{
|
|
10
|
+
code: z.ZodEnum<{
|
|
11
|
+
trial: "trial";
|
|
12
|
+
starter: "starter";
|
|
13
|
+
pro: "pro";
|
|
14
|
+
scale: "scale";
|
|
15
|
+
}>;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
monthly_usd: z.ZodNumber;
|
|
18
|
+
available: z.ZodBoolean;
|
|
19
|
+
waitlist_url: z.ZodOptional<z.ZodURL>;
|
|
20
|
+
runtimes: z.ZodArray<z.ZodEnum<{
|
|
21
|
+
serverless: "serverless";
|
|
22
|
+
container: "container";
|
|
23
|
+
}>>;
|
|
24
|
+
limits: z.ZodRecord<z.ZodEnum<{
|
|
25
|
+
apps: "apps";
|
|
26
|
+
compute_hours: "compute_hours";
|
|
27
|
+
requests: "requests";
|
|
28
|
+
egress_gb: "egress_gb";
|
|
29
|
+
build_minutes: "build_minutes";
|
|
30
|
+
}>, z.ZodNumber>;
|
|
31
|
+
capabilities: z.ZodArray<z.ZodEnum<{
|
|
32
|
+
work_after_response: "work_after_response";
|
|
33
|
+
in_process_scheduler: "in_process_scheduler";
|
|
34
|
+
queue_consumer: "queue_consumer";
|
|
35
|
+
websockets: "websockets";
|
|
36
|
+
writes_outside_tmp: "writes_outside_tmp";
|
|
37
|
+
needs_root: "needs_root";
|
|
38
|
+
long_requests: "long_requests";
|
|
39
|
+
large_bodies: "large_bodies";
|
|
40
|
+
always_on: "always_on";
|
|
41
|
+
slow_boot: "slow_boot";
|
|
42
|
+
}>>;
|
|
43
|
+
features: z.ZodArray<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export declare const SubscriptionStatus: z.ZodEnum<{
|
|
46
|
+
active: "active";
|
|
47
|
+
trialing: "trialing";
|
|
48
|
+
past_due: "past_due";
|
|
49
|
+
canceled: "canceled";
|
|
50
|
+
expired: "expired";
|
|
51
|
+
}>;
|
|
52
|
+
export declare const Subscription: z.ZodObject<{
|
|
53
|
+
plan: z.ZodEnum<{
|
|
54
|
+
trial: "trial";
|
|
55
|
+
starter: "starter";
|
|
56
|
+
pro: "pro";
|
|
57
|
+
scale: "scale";
|
|
58
|
+
}>;
|
|
59
|
+
status: z.ZodEnum<{
|
|
60
|
+
active: "active";
|
|
61
|
+
trialing: "trialing";
|
|
62
|
+
past_due: "past_due";
|
|
63
|
+
canceled: "canceled";
|
|
64
|
+
expired: "expired";
|
|
65
|
+
}>;
|
|
66
|
+
trial_started_at: z.ZodNullable<z.ZodISODateTime>;
|
|
67
|
+
trial_ends_at: z.ZodNullable<z.ZodISODateTime>;
|
|
68
|
+
cancel_at_period_end: z.ZodBoolean;
|
|
69
|
+
current_period_id: z.ZodNullable<z.ZodString>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export declare const MeterUsage: z.ZodObject<{
|
|
72
|
+
meter: z.ZodEnum<{
|
|
73
|
+
apps: "apps";
|
|
74
|
+
compute_hours: "compute_hours";
|
|
75
|
+
requests: "requests";
|
|
76
|
+
egress_gb: "egress_gb";
|
|
77
|
+
build_minutes: "build_minutes";
|
|
78
|
+
}>;
|
|
79
|
+
used: z.ZodNumber;
|
|
80
|
+
limit: z.ZodNumber;
|
|
81
|
+
unit: z.ZodString;
|
|
82
|
+
state: z.ZodEnum<{
|
|
83
|
+
warning: "warning";
|
|
84
|
+
ok: "ok";
|
|
85
|
+
exceeded: "exceeded";
|
|
86
|
+
}>;
|
|
87
|
+
by_app: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
88
|
+
app_id: z.ZodString;
|
|
89
|
+
used: z.ZodNumber;
|
|
90
|
+
}, z.core.$strip>>>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export declare const InvoiceCopy: z.ZodObject<{
|
|
93
|
+
number: z.ZodString;
|
|
94
|
+
amount: z.ZodNumber;
|
|
95
|
+
currency: z.ZodString;
|
|
96
|
+
status: z.ZodEnum<{
|
|
97
|
+
void: "void";
|
|
98
|
+
failed: "failed";
|
|
99
|
+
draft: "draft";
|
|
100
|
+
open: "open";
|
|
101
|
+
paid: "paid";
|
|
102
|
+
}>;
|
|
103
|
+
paid_at: z.ZodNullable<z.ZodISODateTime>;
|
|
104
|
+
hosted_url: z.ZodNullable<z.ZodURL>;
|
|
105
|
+
pdf_url: z.ZodNullable<z.ZodURL>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
export declare const BillingPeriod: z.ZodObject<{
|
|
108
|
+
id: z.ZodString;
|
|
109
|
+
from: z.ZodISODateTime;
|
|
110
|
+
to: z.ZodISODateTime;
|
|
111
|
+
plan: z.ZodEnum<{
|
|
112
|
+
trial: "trial";
|
|
113
|
+
starter: "starter";
|
|
114
|
+
pro: "pro";
|
|
115
|
+
scale: "scale";
|
|
116
|
+
}>;
|
|
117
|
+
status: z.ZodEnum<{
|
|
118
|
+
open: "open";
|
|
119
|
+
closed: "closed";
|
|
120
|
+
}>;
|
|
121
|
+
usage: z.ZodArray<z.ZodObject<{
|
|
122
|
+
meter: z.ZodEnum<{
|
|
123
|
+
apps: "apps";
|
|
124
|
+
compute_hours: "compute_hours";
|
|
125
|
+
requests: "requests";
|
|
126
|
+
egress_gb: "egress_gb";
|
|
127
|
+
build_minutes: "build_minutes";
|
|
128
|
+
}>;
|
|
129
|
+
used: z.ZodNumber;
|
|
130
|
+
limit: z.ZodNumber;
|
|
131
|
+
unit: z.ZodString;
|
|
132
|
+
state: z.ZodEnum<{
|
|
133
|
+
warning: "warning";
|
|
134
|
+
ok: "ok";
|
|
135
|
+
exceeded: "exceeded";
|
|
136
|
+
}>;
|
|
137
|
+
by_app: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
138
|
+
app_id: z.ZodString;
|
|
139
|
+
used: z.ZodNumber;
|
|
140
|
+
}, z.core.$strip>>>;
|
|
141
|
+
}, z.core.$strip>>;
|
|
142
|
+
measured_at: z.ZodISODateTime;
|
|
143
|
+
invoice: z.ZodNullable<z.ZodObject<{
|
|
144
|
+
number: z.ZodString;
|
|
145
|
+
amount: z.ZodNumber;
|
|
146
|
+
currency: z.ZodString;
|
|
147
|
+
status: z.ZodEnum<{
|
|
148
|
+
void: "void";
|
|
149
|
+
failed: "failed";
|
|
150
|
+
draft: "draft";
|
|
151
|
+
open: "open";
|
|
152
|
+
paid: "paid";
|
|
153
|
+
}>;
|
|
154
|
+
paid_at: z.ZodNullable<z.ZodISODateTime>;
|
|
155
|
+
hosted_url: z.ZodNullable<z.ZodURL>;
|
|
156
|
+
pdf_url: z.ZodNullable<z.ZodURL>;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
export declare const Bonus: z.ZodObject<{
|
|
160
|
+
meter: z.ZodEnum<{
|
|
161
|
+
apps: "apps";
|
|
162
|
+
compute_hours: "compute_hours";
|
|
163
|
+
requests: "requests";
|
|
164
|
+
egress_gb: "egress_gb";
|
|
165
|
+
build_minutes: "build_minutes";
|
|
166
|
+
}>;
|
|
167
|
+
amount: z.ZodNumber;
|
|
168
|
+
source: z.ZodEnum<{
|
|
169
|
+
support: "support";
|
|
170
|
+
referral: "referral";
|
|
171
|
+
promotion: "promotion";
|
|
172
|
+
}>;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
export declare const Referral: z.ZodObject<{
|
|
175
|
+
url: z.ZodURL;
|
|
176
|
+
code: z.ZodString;
|
|
177
|
+
reward: z.ZodObject<{
|
|
178
|
+
apps: z.ZodNumber;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
redeemed: z.ZodBoolean;
|
|
181
|
+
}, z.core.$strip>;
|
|
182
|
+
export declare const get_plans: import("./define.js").OperationDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
183
|
+
plans: z.ZodArray<z.ZodObject<{
|
|
184
|
+
code: z.ZodEnum<{
|
|
185
|
+
trial: "trial";
|
|
186
|
+
starter: "starter";
|
|
187
|
+
pro: "pro";
|
|
188
|
+
scale: "scale";
|
|
189
|
+
}>;
|
|
190
|
+
name: z.ZodString;
|
|
191
|
+
monthly_usd: z.ZodNumber;
|
|
192
|
+
available: z.ZodBoolean;
|
|
193
|
+
waitlist_url: z.ZodOptional<z.ZodURL>;
|
|
194
|
+
runtimes: z.ZodArray<z.ZodEnum<{
|
|
195
|
+
serverless: "serverless";
|
|
196
|
+
container: "container";
|
|
197
|
+
}>>;
|
|
198
|
+
limits: z.ZodRecord<z.ZodEnum<{
|
|
199
|
+
apps: "apps";
|
|
200
|
+
compute_hours: "compute_hours";
|
|
201
|
+
requests: "requests";
|
|
202
|
+
egress_gb: "egress_gb";
|
|
203
|
+
build_minutes: "build_minutes";
|
|
204
|
+
}>, z.ZodNumber>;
|
|
205
|
+
capabilities: z.ZodArray<z.ZodEnum<{
|
|
206
|
+
work_after_response: "work_after_response";
|
|
207
|
+
in_process_scheduler: "in_process_scheduler";
|
|
208
|
+
queue_consumer: "queue_consumer";
|
|
209
|
+
websockets: "websockets";
|
|
210
|
+
writes_outside_tmp: "writes_outside_tmp";
|
|
211
|
+
needs_root: "needs_root";
|
|
212
|
+
long_requests: "long_requests";
|
|
213
|
+
large_bodies: "large_bodies";
|
|
214
|
+
always_on: "always_on";
|
|
215
|
+
slow_boot: "slow_boot";
|
|
216
|
+
}>>;
|
|
217
|
+
features: z.ZodArray<z.ZodString>;
|
|
218
|
+
}, z.core.$strip>>;
|
|
219
|
+
}, z.core.$strip>>;
|
|
220
|
+
export declare const get_subscription: import("./define.js").OperationDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
221
|
+
subscription: z.ZodObject<{
|
|
222
|
+
plan: z.ZodEnum<{
|
|
223
|
+
trial: "trial";
|
|
224
|
+
starter: "starter";
|
|
225
|
+
pro: "pro";
|
|
226
|
+
scale: "scale";
|
|
227
|
+
}>;
|
|
228
|
+
status: z.ZodEnum<{
|
|
229
|
+
active: "active";
|
|
230
|
+
trialing: "trialing";
|
|
231
|
+
past_due: "past_due";
|
|
232
|
+
canceled: "canceled";
|
|
233
|
+
expired: "expired";
|
|
234
|
+
}>;
|
|
235
|
+
trial_started_at: z.ZodNullable<z.ZodISODateTime>;
|
|
236
|
+
trial_ends_at: z.ZodNullable<z.ZodISODateTime>;
|
|
237
|
+
cancel_at_period_end: z.ZodBoolean;
|
|
238
|
+
current_period_id: z.ZodNullable<z.ZodString>;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
bonuses: z.ZodArray<z.ZodObject<{
|
|
241
|
+
meter: z.ZodEnum<{
|
|
242
|
+
apps: "apps";
|
|
243
|
+
compute_hours: "compute_hours";
|
|
244
|
+
requests: "requests";
|
|
245
|
+
egress_gb: "egress_gb";
|
|
246
|
+
build_minutes: "build_minutes";
|
|
247
|
+
}>;
|
|
248
|
+
amount: z.ZodNumber;
|
|
249
|
+
source: z.ZodEnum<{
|
|
250
|
+
support: "support";
|
|
251
|
+
referral: "referral";
|
|
252
|
+
promotion: "promotion";
|
|
253
|
+
}>;
|
|
254
|
+
}, z.core.$strip>>;
|
|
255
|
+
}, z.core.$strip>>;
|
|
256
|
+
export declare const get_usage: import("./define.js").OperationDef<z.ZodObject<{
|
|
257
|
+
by_app: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
258
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
259
|
+
period: z.ZodNullable<z.ZodObject<{
|
|
260
|
+
id: z.ZodString;
|
|
261
|
+
from: z.ZodISODateTime;
|
|
262
|
+
to: z.ZodISODateTime;
|
|
263
|
+
plan: z.ZodEnum<{
|
|
264
|
+
trial: "trial";
|
|
265
|
+
starter: "starter";
|
|
266
|
+
pro: "pro";
|
|
267
|
+
scale: "scale";
|
|
268
|
+
}>;
|
|
269
|
+
status: z.ZodEnum<{
|
|
270
|
+
open: "open";
|
|
271
|
+
closed: "closed";
|
|
272
|
+
}>;
|
|
273
|
+
usage: z.ZodArray<z.ZodObject<{
|
|
274
|
+
meter: z.ZodEnum<{
|
|
275
|
+
apps: "apps";
|
|
276
|
+
compute_hours: "compute_hours";
|
|
277
|
+
requests: "requests";
|
|
278
|
+
egress_gb: "egress_gb";
|
|
279
|
+
build_minutes: "build_minutes";
|
|
280
|
+
}>;
|
|
281
|
+
used: z.ZodNumber;
|
|
282
|
+
limit: z.ZodNumber;
|
|
283
|
+
unit: z.ZodString;
|
|
284
|
+
state: z.ZodEnum<{
|
|
285
|
+
warning: "warning";
|
|
286
|
+
ok: "ok";
|
|
287
|
+
exceeded: "exceeded";
|
|
288
|
+
}>;
|
|
289
|
+
by_app: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
290
|
+
app_id: z.ZodString;
|
|
291
|
+
used: z.ZodNumber;
|
|
292
|
+
}, z.core.$strip>>>;
|
|
293
|
+
}, z.core.$strip>>;
|
|
294
|
+
measured_at: z.ZodISODateTime;
|
|
295
|
+
invoice: z.ZodNullable<z.ZodObject<{
|
|
296
|
+
number: z.ZodString;
|
|
297
|
+
amount: z.ZodNumber;
|
|
298
|
+
currency: z.ZodString;
|
|
299
|
+
status: z.ZodEnum<{
|
|
300
|
+
void: "void";
|
|
301
|
+
failed: "failed";
|
|
302
|
+
draft: "draft";
|
|
303
|
+
open: "open";
|
|
304
|
+
paid: "paid";
|
|
305
|
+
}>;
|
|
306
|
+
paid_at: z.ZodNullable<z.ZodISODateTime>;
|
|
307
|
+
hosted_url: z.ZodNullable<z.ZodURL>;
|
|
308
|
+
pdf_url: z.ZodNullable<z.ZodURL>;
|
|
309
|
+
}, z.core.$strip>>;
|
|
310
|
+
}, z.core.$strip>>;
|
|
311
|
+
}, z.core.$strip>>;
|
|
312
|
+
export declare const list_billing_periods: import("./define.js").OperationDef<z.ZodObject<{
|
|
313
|
+
limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
314
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
315
|
+
by_app: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
316
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
317
|
+
periods: z.ZodArray<z.ZodObject<{
|
|
318
|
+
id: z.ZodString;
|
|
319
|
+
from: z.ZodISODateTime;
|
|
320
|
+
to: z.ZodISODateTime;
|
|
321
|
+
plan: z.ZodEnum<{
|
|
322
|
+
trial: "trial";
|
|
323
|
+
starter: "starter";
|
|
324
|
+
pro: "pro";
|
|
325
|
+
scale: "scale";
|
|
326
|
+
}>;
|
|
327
|
+
status: z.ZodEnum<{
|
|
328
|
+
open: "open";
|
|
329
|
+
closed: "closed";
|
|
330
|
+
}>;
|
|
331
|
+
usage: z.ZodArray<z.ZodObject<{
|
|
332
|
+
meter: z.ZodEnum<{
|
|
333
|
+
apps: "apps";
|
|
334
|
+
compute_hours: "compute_hours";
|
|
335
|
+
requests: "requests";
|
|
336
|
+
egress_gb: "egress_gb";
|
|
337
|
+
build_minutes: "build_minutes";
|
|
338
|
+
}>;
|
|
339
|
+
used: z.ZodNumber;
|
|
340
|
+
limit: z.ZodNumber;
|
|
341
|
+
unit: z.ZodString;
|
|
342
|
+
state: z.ZodEnum<{
|
|
343
|
+
warning: "warning";
|
|
344
|
+
ok: "ok";
|
|
345
|
+
exceeded: "exceeded";
|
|
346
|
+
}>;
|
|
347
|
+
by_app: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
348
|
+
app_id: z.ZodString;
|
|
349
|
+
used: z.ZodNumber;
|
|
350
|
+
}, z.core.$strip>>>;
|
|
351
|
+
}, z.core.$strip>>;
|
|
352
|
+
measured_at: z.ZodISODateTime;
|
|
353
|
+
invoice: z.ZodNullable<z.ZodObject<{
|
|
354
|
+
number: z.ZodString;
|
|
355
|
+
amount: z.ZodNumber;
|
|
356
|
+
currency: z.ZodString;
|
|
357
|
+
status: z.ZodEnum<{
|
|
358
|
+
void: "void";
|
|
359
|
+
failed: "failed";
|
|
360
|
+
draft: "draft";
|
|
361
|
+
open: "open";
|
|
362
|
+
paid: "paid";
|
|
363
|
+
}>;
|
|
364
|
+
paid_at: z.ZodNullable<z.ZodISODateTime>;
|
|
365
|
+
hosted_url: z.ZodNullable<z.ZodURL>;
|
|
366
|
+
pdf_url: z.ZodNullable<z.ZodURL>;
|
|
367
|
+
}, z.core.$strip>>;
|
|
368
|
+
}, z.core.$strip>>;
|
|
369
|
+
next_cursor: z.ZodOptional<z.ZodString>;
|
|
370
|
+
}, z.core.$strip>>;
|
|
371
|
+
export declare const request_upgrade: import("./define.js").OperationDef<z.ZodObject<{
|
|
372
|
+
plan: z.ZodEnum<{
|
|
373
|
+
starter: "starter";
|
|
374
|
+
pro: "pro";
|
|
375
|
+
scale: "scale";
|
|
376
|
+
}>;
|
|
377
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
378
|
+
status: z.ZodEnum<{
|
|
379
|
+
checkout_required: "checkout_required";
|
|
380
|
+
already_on_plan: "already_on_plan";
|
|
381
|
+
}>;
|
|
382
|
+
checkout_url: z.ZodOptional<z.ZodURL>;
|
|
383
|
+
}, z.core.$strip>>;
|
|
384
|
+
export declare const get_referral: import("./define.js").OperationDef<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
385
|
+
url: z.ZodURL;
|
|
386
|
+
code: z.ZodString;
|
|
387
|
+
reward: z.ZodObject<{
|
|
388
|
+
apps: z.ZodNumber;
|
|
389
|
+
}, z.core.$strip>;
|
|
390
|
+
redeemed: z.ZodBoolean;
|
|
391
|
+
}, z.core.$strip>>;
|
|
392
|
+
export declare const open_billing_portal: import("./define.js").OperationDef<z.ZodObject<{
|
|
393
|
+
return_url: z.ZodOptional<z.ZodURL>;
|
|
394
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
395
|
+
url: z.ZodURL;
|
|
396
|
+
}, z.core.$strip>>;
|