@runlot/api 0.1.0-rc.73 → 0.1.0-rc.75
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.d.ts +215 -179
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +232 -194
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ export type { components, paths, operations } from "./schema.js";
|
|
|
3
3
|
export declare const API_VERSION: "v1";
|
|
4
4
|
type Schemas = components["schemas"];
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* The success response body of an operation.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* We do not write the method return types by hand because a hand-written type
|
|
9
|
+
* still compiles after the spec changes — and that drift shows up at runtime as
|
|
10
|
+
* `undefined`.
|
|
10
11
|
*/
|
|
11
12
|
type Ok<K extends keyof operations> = operations[K]["responses"] extends {
|
|
12
13
|
200: {
|
|
@@ -82,25 +83,25 @@ export type RepoCommit = Schemas["RepoCommit"];
|
|
|
82
83
|
export type AccessPolicy = Schemas["AccessPolicy"];
|
|
83
84
|
export type AccessBypass = Schemas["AccessBypass"];
|
|
84
85
|
export type AccessAuthorize = Schemas["AccessAuthorize"];
|
|
85
|
-
/**
|
|
86
|
+
/** The three policies. The three radio buttons hang off this union (docs/access.md §3.1). */
|
|
86
87
|
export type AccessMode = NonNullable<AccessPolicy["mode"]>;
|
|
87
88
|
export type UsageRow = Schemas["UsageRow"];
|
|
88
89
|
export type Notification = Schemas["Notification"];
|
|
89
|
-
/**
|
|
90
|
+
/** The notification kinds. The dashboard's label table hangs off this union (§3.1). */
|
|
90
91
|
export type NotificationKind = NonNullable<Notification["kind"]>;
|
|
91
92
|
export type AuthStatus = Schemas["AuthStatus"];
|
|
92
93
|
export type AuthSettings = Schemas["AuthSettings"];
|
|
93
94
|
export type AuthBrand = Schemas["AuthBrand"];
|
|
94
95
|
export type AuthProviderMeta = Schemas["AuthProviderMeta"];
|
|
95
|
-
/**
|
|
96
|
+
/** The three providers. The rows on screen and the CLI's argument hang off this union. */
|
|
96
97
|
export type AuthProvider = Schemas["AuthProvider"];
|
|
97
|
-
/** PATCH
|
|
98
|
+
/** The PATCH body — a subset of `AuthSettings`. Only the fields given change. */
|
|
98
99
|
export type AuthSettingsInput = NonNullable<Schemas["AuthSettingsPatch"]["settings"]>;
|
|
99
100
|
export type Hostname = Schemas["Hostname"];
|
|
100
101
|
export type HostnameList = Schemas["HostnameList"];
|
|
101
102
|
export type HostnameVerify = Schemas["HostnameVerify"];
|
|
102
103
|
export type HostnameRecord = Schemas["HostnameRecord"];
|
|
103
|
-
/**
|
|
104
|
+
/** The four states. The badge on screen hangs off this value (docs/domains.md §3.3). */
|
|
104
105
|
export type HostnameState = NonNullable<Hostname["state"]>;
|
|
105
106
|
export type Zone = Schemas["Zone"];
|
|
106
107
|
export type ZoneDetail = Schemas["ZoneDetail"];
|
|
@@ -112,9 +113,9 @@ export type DomainList = Schemas["DomainList"];
|
|
|
112
113
|
export type DomainAvailability = Schemas["DomainAvailability"];
|
|
113
114
|
export type DomainContact = Schemas["DomainContact"];
|
|
114
115
|
export type DomainEvent = Schemas["DomainEvent"];
|
|
115
|
-
/** `Domain["state"]`
|
|
116
|
+
/** `Domain["state"]` is exported separately — the screen pins its badge table to this union. */
|
|
116
117
|
export type DomainState = Domain["state"];
|
|
117
|
-
/**
|
|
118
|
+
/** The exception that carries the server's error envelope unchanged. */
|
|
118
119
|
export declare class ApiError extends Error {
|
|
119
120
|
readonly status: number;
|
|
120
121
|
readonly code: string;
|
|
@@ -130,76 +131,82 @@ export declare class Client {
|
|
|
130
131
|
constructor(opts: ClientOptions);
|
|
131
132
|
private headers;
|
|
132
133
|
private request;
|
|
133
|
-
/**
|
|
134
|
+
/** A body that is not JSON (the raw mail). Error handling is the same as request. */
|
|
134
135
|
private text;
|
|
135
136
|
private json;
|
|
136
137
|
devLogin(subject: string): Promise<Ok<"devLogin">>;
|
|
137
138
|
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
139
|
+
* Takes the sign-up and sends the confirmation mail. Neither a session nor a
|
|
140
|
+
* password is created here — the password is chosen in `verifyEmail` by
|
|
141
|
+
* whoever opens the mailbox.
|
|
140
142
|
*/
|
|
141
143
|
passwordSignUp(email: string, name?: string): Promise<Ok<"passwordSignUp">>;
|
|
142
144
|
passwordSignIn(email: string, password: string): Promise<Ok<"passwordSignIn">>;
|
|
143
|
-
/**
|
|
145
|
+
/** The same accepted response comes back whether or not the email exists. */
|
|
144
146
|
passwordForgot(email: string): Promise<Ok<"passwordForgot">>;
|
|
145
147
|
passwordReset(token: string, password: string): Promise<Ok<"passwordReset">>;
|
|
146
|
-
/**
|
|
148
|
+
/** Uses the confirmation link and sets the account's first password. */
|
|
147
149
|
verifyEmail(token: string, password: string): Promise<Ok<"verifyEmail">>;
|
|
148
150
|
/**
|
|
149
|
-
* GitHub OAuth
|
|
150
|
-
* `window.location`
|
|
151
|
+
* The GitHub OAuth start URL. It is a 302 the browser follows, so it goes into
|
|
152
|
+
* `window.location` rather than being called with fetch. `redirect` has to be
|
|
153
|
+
* on the server's allow-list.
|
|
151
154
|
*/
|
|
152
155
|
githubStartUrl(redirect: string): string;
|
|
153
|
-
/** Google OAuth
|
|
156
|
+
/** The Google OAuth start URL. Uses the same dashboard callback shape as GitHub. */
|
|
154
157
|
googleStartUrl(redirect: string): string;
|
|
155
158
|
/**
|
|
156
|
-
*
|
|
159
|
+
* The names of this deployment (app domain, docs address). Callable without auth.
|
|
157
160
|
*
|
|
158
|
-
*
|
|
159
|
-
* §3.2) —
|
|
160
|
-
*
|
|
161
|
+
* This exists so the dashboard does not hard-code a domain into the screen
|
|
162
|
+
* (docs/environments.md §3.2) — hard-coded, the dev screen tells people a
|
|
163
|
+
* production address, and because that address opens, nobody ever says it is
|
|
164
|
+
* wrong.
|
|
161
165
|
*/
|
|
162
166
|
siteConfig(): Promise<Ok<"getSiteConfig">>;
|
|
163
167
|
me(): Promise<Ok<"getMe">>;
|
|
164
168
|
listOrgs(): Promise<Ok<"listOrgs">>;
|
|
165
|
-
/**
|
|
169
|
+
/** Changes the display name only (admin). The slug is the name that becomes an address, so it is not on this surface. */
|
|
166
170
|
updateOrg(org: string, name: string): Promise<Ok<"updateOrg">>;
|
|
167
171
|
/**
|
|
168
|
-
*
|
|
172
|
+
* Deletes the organization (admin). **This cannot be undone.**
|
|
169
173
|
*
|
|
170
|
-
* `confirm`
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* `details.holdings`
|
|
174
|
-
*
|
|
174
|
+
* `confirm` has to be the organization slug exactly — the confirmation lives on
|
|
175
|
+
* the server because three places call this surface (the screen, the CLI, and
|
|
176
|
+
* scripts). If a live project, domain, repository, or DNS zone is left, it is a
|
|
177
|
+
* 409 `org_not_empty` and `details.holdings` says what is left — **projects
|
|
178
|
+
* already deleted are not counted.**
|
|
175
179
|
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
180
|
+
* The `purgeAfter` in the answer is when the rows actually disappear. By the
|
|
181
|
+
* moment it returns the organization is already gone from every surface; what
|
|
182
|
+
* remains is retention until that time.
|
|
178
183
|
*/
|
|
179
184
|
deleteOrg(org: string, confirm: string): Promise<Ok<"deleteOrg">>;
|
|
180
185
|
createOrg(slug: string, name: string): Promise<Ok<"createOrg">>;
|
|
181
186
|
/**
|
|
182
|
-
*
|
|
187
|
+
* The organization's recent notifications (docs/limits.md §3.4).
|
|
183
188
|
*
|
|
184
|
-
* `sentAt`
|
|
185
|
-
*
|
|
189
|
+
* A row with no `sentAt` is either still queued or has no email address to
|
|
190
|
+
* reach — and for the second, this list is the only channel, so the screen
|
|
191
|
+
* draws both states the same way.
|
|
186
192
|
*/
|
|
187
193
|
listNotifications(org: string, limit?: number): Promise<Ok<"listNotifications">>;
|
|
188
194
|
/**
|
|
189
|
-
*
|
|
190
|
-
*
|
|
195
|
+
* The plan and billing state (docs/billing.md). If `enabled` is false, this
|
|
196
|
+
* deployment has no billing — the screen shows only a contact address.
|
|
191
197
|
*/
|
|
192
198
|
getBilling(org: string): Promise<Ok<"getBilling">>;
|
|
193
199
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
200
|
+
* A Pro checkout session. Send the browser to the `url` that comes back. Even
|
|
201
|
+
* once payment finishes, the thing that changes the plan is the webhook, so
|
|
202
|
+
* read `getBilling` again after the browser returns.
|
|
196
203
|
*/
|
|
197
204
|
createBillingCheckout(org: string, returnTo: string): Promise<Ok<"createBillingCheckout">>;
|
|
198
|
-
/**
|
|
205
|
+
/** A one-time `url` for the customer portal (payment method, receipts, cancellation). */
|
|
199
206
|
createBillingPortal(org: string, returnTo: string): Promise<Ok<"createBillingPortal">>;
|
|
200
|
-
/**
|
|
207
|
+
/** The customer session token for the payment-method embed (1 hour). An org with no payment history gets a 404. */
|
|
201
208
|
createBillingSession(org: string): Promise<Ok<"createBillingSession">>;
|
|
202
|
-
/**
|
|
209
|
+
/** Schedules cancellation at the end of the period (`cancel: true`), or undoes it. There is no immediate revocation. */
|
|
203
210
|
cancelBilling(org: string, body: {
|
|
204
211
|
cancel: boolean;
|
|
205
212
|
reason?: string;
|
|
@@ -209,67 +216,73 @@ export declare class Client {
|
|
|
209
216
|
createProject(org: string, name: string): Promise<Ok<"createProject">>;
|
|
210
217
|
getProject(org: string, name: string): Promise<Ok<"getProject">>;
|
|
211
218
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
219
|
+
* Renames the project (admin). **The default address moves with it and there is
|
|
220
|
+
* no alias** — which is why the response carries the new address. Unlike the
|
|
221
|
+
* org slug, this name can change because it is the inner label of the org
|
|
222
|
+
* wildcard certificate.
|
|
215
223
|
*/
|
|
216
224
|
updateProject(org: string, name: string, next: string): Promise<Ok<"updateProject">>;
|
|
217
225
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
226
|
+
* Starts tearing the project down (admin). **This cannot be undone and leaves
|
|
227
|
+
* no recovery generation.** `confirm` has to be the project name exactly.
|
|
220
228
|
*/
|
|
221
229
|
deleteProject(org: string, name: string, confirm: string): Promise<Ok<"deleteProject">>;
|
|
222
|
-
/**
|
|
230
|
+
/** Watches the teardown operation to its end even after the project is gone. */
|
|
223
231
|
getOrgOperation(org: string, opId: string): Promise<Ok<"getOrgOperation">>;
|
|
224
|
-
/**
|
|
232
|
+
/** Everything the project's first screen takes in one call. Usage calls `getUsage` alongside it. */
|
|
225
233
|
getProjectOverview(org: string, name: string): Promise<Ok<"getProjectOverview">>;
|
|
226
234
|
listDeployments(org: string, name: string): Promise<Ok<"listDeployments">>;
|
|
227
|
-
/**
|
|
235
|
+
/** The body is the bundle. One digest covers all of the code and the assets. */
|
|
228
236
|
/**
|
|
229
|
-
*
|
|
230
|
-
* createDeployment) —
|
|
237
|
+
* Uploads the bundle. `headers` carries the provenance headers
|
|
238
|
+
* (`X-Runlot-Git-*`, openapi createDeployment) — the body is the bundle
|
|
239
|
+
* itself, so the metadata can only travel in headers.
|
|
231
240
|
*/
|
|
232
241
|
deploy(org: string, name: string, bundle: Uint8Array, headers?: Record<string, string>): Promise<Ok<"createDeployment">>;
|
|
233
|
-
/**
|
|
242
|
+
/** Idempotent. Called twice, the password is not rolled and the same connection details come back. */
|
|
234
243
|
createDatabase(org: string, name: string): Promise<Ok<"createDatabase">>;
|
|
235
244
|
getDatabase(org: string, name: string): Promise<Ok<"getDatabase">>;
|
|
236
245
|
/**
|
|
237
|
-
*
|
|
238
|
-
* viewer
|
|
246
|
+
* The connection credentials as well. The route is split from `getDatabase`
|
|
247
|
+
* because of roles — a viewer may know whether there is a database, but not
|
|
248
|
+
* the password (proto/openapi.yaml).
|
|
239
249
|
*/
|
|
240
250
|
getDatabaseConnect(org: string, name: string): Promise<Ok<"getDatabaseConnect">>;
|
|
241
|
-
/**
|
|
251
|
+
/** The endpoint only — no credentials. A viewer gets it too. Used by `runlot port-forward`. */
|
|
242
252
|
getDatabaseEndpoint(org: string, name: string): Promise<Ok<"getDatabaseEndpoint">>;
|
|
243
|
-
/**
|
|
253
|
+
/** Issues a short-lived machine credential. The password is carried in this response and nowhere else. */
|
|
244
254
|
createDatabaseToken(org: string, name: string, ttlSeconds?: number): Promise<Ok<"createDatabaseToken">>;
|
|
245
255
|
listDatabaseTokens(org: string, name: string): Promise<Ok<"listDatabaseTokens">>;
|
|
246
256
|
deleteDatabaseToken(org: string, name: string, user: string): Promise<void>;
|
|
247
257
|
/**
|
|
248
|
-
*
|
|
258
|
+
* Makes one diagnostic image.
|
|
249
259
|
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
* (proto/openapi.yaml).
|
|
260
|
+
* **Not idempotent** — every call makes another image. And it is slow: the
|
|
261
|
+
* response comes after the dump finishes, and that project's actor is held
|
|
262
|
+
* for the whole of it (proto/openapi.yaml).
|
|
253
263
|
*/
|
|
254
264
|
exportDatabase(org: string, name: string): Promise<Ok<"exportDatabase">>;
|
|
255
265
|
/**
|
|
256
|
-
*
|
|
257
|
-
*
|
|
266
|
+
* Every generation a restore can choose, newest first. `lastCheckedAt` is the
|
|
267
|
+
* heartbeat of the no-change skip — it is what tells "no new generations"
|
|
268
|
+
* apart from "the backup is dead".
|
|
258
269
|
*/
|
|
259
270
|
listGenerations(org: string, name: string): Promise<Ok<"listGenerations">>;
|
|
260
271
|
/**
|
|
261
|
-
*
|
|
272
|
+
* Rolls back to a generation. **Writes made since then are lost.**
|
|
262
273
|
*
|
|
263
|
-
*
|
|
264
|
-
* `getDatabaseOperation
|
|
265
|
-
*
|
|
274
|
+
* It ends at 202 — what comes back is an operation id, and progress is read
|
|
275
|
+
* through `getDatabaseOperation`. The server does not resolve `latest`: the
|
|
276
|
+
* `(epoch, seq)` chosen from the list is carried as-is (proto/openapi.yaml).
|
|
266
277
|
*/
|
|
267
278
|
restoreDatabase(org: string, name: string, epoch: number, seq: number): Promise<Ok<"restoreDatabase">>;
|
|
268
279
|
/**
|
|
269
|
-
*
|
|
270
|
-
* `
|
|
271
|
-
*
|
|
272
|
-
*
|
|
280
|
+
* Rolls back to a restore point **inside** a backup (pg-feather docs/37):
|
|
281
|
+
* `txnId` is that commit, `at` is the last commit at or before that time. One
|
|
282
|
+
* backup carries the commits in between in order, so the place you can roll
|
|
283
|
+
* back to is not tied to a backup boundary. Everything else is as in
|
|
284
|
+
* restoreDatabase — 202, an operation id, and one safety backup before the
|
|
285
|
+
* rollback.
|
|
273
286
|
*/
|
|
274
287
|
restoreDatabaseTo(org: string, name: string, target: {
|
|
275
288
|
txnId: number;
|
|
@@ -277,18 +290,19 @@ export declare class Client {
|
|
|
277
290
|
at: string;
|
|
278
291
|
}): Promise<Ok<"restoreDatabase">>;
|
|
279
292
|
/**
|
|
280
|
-
*
|
|
281
|
-
*
|
|
293
|
+
* Removes the database. `confirm` has to match the project name **exactly**;
|
|
294
|
+
* if it does not, the server refuses with 400 `confirm_mismatch`.
|
|
282
295
|
*/
|
|
283
296
|
deleteDatabase(org: string, name: string, confirm: string): Promise<Ok<"deleteDatabase">>;
|
|
284
|
-
/**
|
|
297
|
+
/** The progress of one operation. The operation id is not a credential; it lives under the project path. */
|
|
285
298
|
getDatabaseOperation(org: string, name: string, opId: string): Promise<Ok<"getDatabaseOperation">>;
|
|
286
|
-
/**
|
|
299
|
+
/** Aborts an operation that has not yet reached a phase it cannot come back from. */
|
|
287
300
|
abortDatabaseOperation(org: string, name: string, opId: string): Promise<Ok<"abortDatabaseOperation">>;
|
|
288
301
|
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
*
|
|
302
|
+
* A live tail of the logs. It is **a stream, not JSON**, so it does not go
|
|
303
|
+
* through `request` — what comes back is an async iterable of line-by-line
|
|
304
|
+
* `LogEvent`, and aborting `signal` closes the connection. An error response
|
|
305
|
+
* (4xx/5xx) is the same `ApiError` as in every other method.
|
|
292
306
|
*/
|
|
293
307
|
tailLogs(org: string, name: string, opts?: {
|
|
294
308
|
tail?: number;
|
|
@@ -296,213 +310,235 @@ export declare class Client {
|
|
|
296
310
|
signal?: AbortSignal;
|
|
297
311
|
}): AsyncGenerator<LogEvent, void, undefined>;
|
|
298
312
|
listSecrets(org: string, name: string): Promise<Ok<"listSecrets">>;
|
|
299
|
-
/**
|
|
313
|
+
/** The value travels in this call only. It is in no response at all. */
|
|
300
314
|
setSecret(org: string, name: string, secret: string, value: string): Promise<Ok<"setSecret">>;
|
|
301
315
|
deleteSecret(org: string, name: string, secret: string): Promise<void>;
|
|
302
316
|
getUsage(org: string, name: string, hours?: number): Promise<Ok<"getUsage">>;
|
|
303
|
-
/**
|
|
317
|
+
/** Grant, prefix, quota, usage. `usedBytes` lags by the node's reporting interval. */
|
|
304
318
|
getStorage(org: string, name: string): Promise<Ok<"getStorage">>;
|
|
305
319
|
/**
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
320
|
+
* Grants storage. It is idempotent, so pressing twice leaves the prefix as it
|
|
321
|
+
* was. Taking neither the prefix nor the quota as an argument is the point —
|
|
322
|
+
* the prefix is the isolation boundary and the quota is set by the plan
|
|
323
|
+
* (proto/openapi.yaml).
|
|
309
324
|
*/
|
|
310
325
|
grantStorage(org: string, name: string): Promise<Ok<"grantStorage">>;
|
|
311
|
-
/**
|
|
326
|
+
/** Removes the grant. **The objects are not deleted** (docs/storage.md §7). */
|
|
312
327
|
revokeStorage(org: string, name: string): Promise<void>;
|
|
313
|
-
/**
|
|
328
|
+
/** Grant, address, sender, limits, recent counts. The address comes back as a preview even without a grant. */
|
|
314
329
|
getEmail(org: string, name: string): Promise<Ok<"getEmail">>;
|
|
315
|
-
/**
|
|
330
|
+
/** Turns it on. **Idempotent** — we choose the address. The deploy reads `"email": true` and calls this. */
|
|
316
331
|
grantEmail(org: string, name: string): Promise<Ok<"grantEmail">>;
|
|
317
|
-
/**
|
|
332
|
+
/** Turns it off. Mail arriving at that address now gets a 550. */
|
|
318
333
|
revokeEmail(org: string, name: string): Promise<void>;
|
|
319
334
|
/**
|
|
320
|
-
*
|
|
321
|
-
*
|
|
335
|
+
* The model catalogue. **Being logged in is enough to see it** — what you can
|
|
336
|
+
* buy is not an organization's secret, and this list is the price table.
|
|
322
337
|
*
|
|
323
|
-
*
|
|
324
|
-
*
|
|
338
|
+
* Prices are integer **micro-cents** per million tokens (1 µ¢ = 1e-8 USD).
|
|
339
|
+
* Not letting the server pick the decimal place is the point — a small call
|
|
340
|
+
* rounded to cents becomes 0.
|
|
325
341
|
*/
|
|
326
342
|
listAIModels(): Promise<Ok<"listAIModels">>;
|
|
327
|
-
/**
|
|
343
|
+
/** Grant, limits, the org balance, 24 h usage. The limits come back as a preview even without a grant. */
|
|
328
344
|
getAI(org: string, name: string): Promise<Ok<"getAI">>;
|
|
329
|
-
/**
|
|
345
|
+
/** Turns it on. **Idempotent.** The deploy reads `"ai": true` and calls this. */
|
|
330
346
|
grantAI(org: string, name: string): Promise<Ok<"grantAI">>;
|
|
331
|
-
/**
|
|
347
|
+
/** Turns it off. **The ledger and the balance are untouched** — the balance belongs to the org and the grant belongs to the project. */
|
|
332
348
|
revokeAI(org: string, name: string): Promise<void>;
|
|
333
|
-
/** org
|
|
349
|
+
/** The org's credit balance and its automatic top-up settings. The balance is in micro-cents and can be negative. */
|
|
334
350
|
getAICredit(org: string): Promise<Ok<"getAICredit">>;
|
|
335
|
-
/** org
|
|
351
|
+
/** One page of the org ledger. The cursor is `ledger_id` — cutting on time splits the same millisecond. */
|
|
336
352
|
listAILedger(org: string, opts?: {
|
|
337
353
|
limit?: number;
|
|
338
354
|
before?: number;
|
|
339
355
|
}): Promise<Ok<"listAILedger">>;
|
|
340
356
|
/**
|
|
341
|
-
*
|
|
342
|
-
*
|
|
357
|
+
* The credit top-up checkout. **A browser coming back is not evidence** — the
|
|
358
|
+
* one thing that raises the balance is the `order.paid` webhook, and the
|
|
359
|
+
* screen polls the balance after the success event.
|
|
343
360
|
*/
|
|
344
361
|
createAICreditCheckout(org: string, microCents: number, returnTo: string): Promise<Ok<"createAICreditCheckout">>;
|
|
345
362
|
/**
|
|
346
|
-
*
|
|
347
|
-
*
|
|
363
|
+
* Turns automatic top-up on or off. **Turning it on is explicit consent**
|
|
364
|
+
* (docs/ai.md §3.5) — the screen shows the charging terms verbatim and calls
|
|
365
|
+
* this only after the box is checked.
|
|
348
366
|
*/
|
|
349
367
|
setAIAutoTopup(org: string, body: {
|
|
350
368
|
enabled: boolean;
|
|
351
369
|
belowMicroCents?: number;
|
|
352
370
|
microCents?: number;
|
|
353
371
|
}): Promise<Ok<"setAIAutoTopup"> | void>;
|
|
354
|
-
/**
|
|
372
|
+
/** One page of the mail log (docs/email.md §6.1). Newest first, cursor-paged. */
|
|
355
373
|
listMailLog(org: string, name: string, opts?: {
|
|
356
374
|
direction?: "in" | "out";
|
|
357
375
|
cursor?: string;
|
|
358
376
|
limit?: number;
|
|
359
377
|
}): Promise<Ok<"listMailLog">>;
|
|
360
|
-
/**
|
|
378
|
+
/** The metadata of one message. */
|
|
361
379
|
getMailLog(org: string, name: string, mailId: string): Promise<Ok<"getMailLog">>;
|
|
362
|
-
/**
|
|
380
|
+
/** The URL of the raw message — the screen uses it as a download link (.eml). */
|
|
363
381
|
mailLogRawURL(org: string, name: string, mailId: string): string;
|
|
364
|
-
/**
|
|
382
|
+
/** The raw text. What the detail view draws the headers and body from. */
|
|
365
383
|
getMailLogRaw(org: string, name: string, mailId: string): Promise<string>;
|
|
366
384
|
/**
|
|
367
|
-
*
|
|
368
|
-
* DB
|
|
385
|
+
* Grant, settings, providers, hosts. **The signed-up users do not come** —
|
|
386
|
+
* that table is inside the project DB (docs/auth.md §6) and only the worker's
|
|
387
|
+
* `env.auth` sees it.
|
|
369
388
|
*
|
|
370
|
-
* `providers`
|
|
371
|
-
*
|
|
389
|
+
* `providers` carries the client id only. The client secret is sealed and
|
|
390
|
+
* appears in no response.
|
|
372
391
|
*/
|
|
373
392
|
getAuth(org: string, name: string): Promise<Ok<"getAuth">>;
|
|
374
393
|
/**
|
|
375
|
-
*
|
|
394
|
+
* Turns auth on (member). Idempotent.
|
|
376
395
|
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
396
|
+
* **With no database it is 409 `database_required`** — the user table lives
|
|
397
|
+
* inside the project DB, so standing up the grant alone leaves no table the
|
|
398
|
+
* moment the worker starts. The caller catches that code and points at the
|
|
399
|
+
* `"database": true` declaration — the deploy never sees this code, because
|
|
400
|
+
* its ordering rules it out.
|
|
380
401
|
*/
|
|
381
402
|
grantAuth(org: string, name: string): Promise<Ok<"grantAuth">>;
|
|
382
403
|
/**
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
*
|
|
404
|
+
* Changes the settings (member). **A partial update** — only the fields given
|
|
405
|
+
* change. Sending the whole thing on one switch means that when two people
|
|
406
|
+
* touch the same card, the later save overwrites the earlier one. With no
|
|
407
|
+
* grant it is 404 `not_granted`.
|
|
386
408
|
*/
|
|
387
409
|
updateAuthSettings(org: string, name: string, settings: AuthSettingsInput): Promise<Ok<"updateAuthSettings">>;
|
|
388
410
|
/**
|
|
389
|
-
*
|
|
390
|
-
*
|
|
411
|
+
* Turns auth off (admin). **The signed-up users are not deleted** — the
|
|
412
|
+
* `runlot_auth` tables stay in the project DB, and turning it back on lets the
|
|
413
|
+
* same people log in unchanged.
|
|
391
414
|
*/
|
|
392
415
|
revokeAuth(org: string, name: string): Promise<void>;
|
|
393
416
|
/**
|
|
394
|
-
*
|
|
417
|
+
* Registers or replaces a social provider (admin). It is the same PUT, so it
|
|
418
|
+
* is idempotent.
|
|
395
419
|
*
|
|
396
|
-
* **`clientSecret`
|
|
397
|
-
* `https://<host>/__runlot/auth/callback/<provider>`
|
|
398
|
-
*
|
|
420
|
+
* **`clientSecret` cannot be read back.** The callback URL is
|
|
421
|
+
* `https://<host>/__runlot/auth/callback/<provider>` for each host, and the
|
|
422
|
+
* list of hosts is in the response's `hosts`.
|
|
399
423
|
*/
|
|
400
424
|
setAuthProvider(org: string, name: string, provider: AuthProvider, clientId: string, clientSecret: string): Promise<Ok<"setAuthProvider">>;
|
|
401
425
|
/**
|
|
402
|
-
*
|
|
403
|
-
*
|
|
426
|
+
* Removes a provider (admin). Someone who signed up only through that provider
|
|
427
|
+
* loses their way in, but the user row stays — register it again and they come
|
|
428
|
+
* back to the same account.
|
|
404
429
|
*/
|
|
405
430
|
deleteAuthProvider(org: string, name: string, provider: AuthProvider): Promise<void>;
|
|
406
431
|
/**
|
|
407
|
-
*
|
|
408
|
-
*
|
|
432
|
+
* Who can reach this deployment. **No values** — both the password and the
|
|
433
|
+
* bypass secret live only as hashes, and what comes back here is the fact that
|
|
434
|
+
* there is one: `hasPassword` and `hasBypass`.
|
|
409
435
|
*
|
|
410
|
-
*
|
|
411
|
-
*
|
|
436
|
+
* A project that has never set a policy is `mode: "public"` with no
|
|
437
|
+
* `updatedAt`. The screen tells those two apart for the reason in §7 — a
|
|
438
|
+
* sentence about the state instead of an empty state.
|
|
412
439
|
*/
|
|
413
440
|
getAccess(org: string, name: string): Promise<Ok<"getAccess">>;
|
|
414
441
|
/**
|
|
415
|
-
*
|
|
416
|
-
*
|
|
442
|
+
* Changes the policy (admin). Without a `password`, **the existing password
|
|
443
|
+
* stays** — if a save that only changes the mode wiped the password, coming
|
|
444
|
+
* back to that mode would mean setting it again.
|
|
417
445
|
*/
|
|
418
446
|
setAccess(org: string, name: string, mode: AccessMode, password?: string): Promise<Ok<"setAccess">>;
|
|
419
447
|
/**
|
|
420
|
-
*
|
|
421
|
-
*
|
|
448
|
+
* Makes a bypass secret for automation (admin). **The value is in this answer
|
|
449
|
+
* and nowhere else** — the screen shows it once on arrival and can never fetch
|
|
450
|
+
* it again. Calling again kills the old value.
|
|
422
451
|
*/
|
|
423
452
|
newAccessBypass(org: string, name: string): Promise<Ok<"newAccessBypass">>;
|
|
424
|
-
/**
|
|
453
|
+
/** Removes the bypass (admin). Removing one that does not exist also succeeds. */
|
|
425
454
|
revokeAccessBypass(org: string, name: string): Promise<void>;
|
|
426
455
|
/**
|
|
427
|
-
*
|
|
456
|
+
* Gets a one-time address back into a protected deployment (docs/access.md §3.4-3).
|
|
428
457
|
*
|
|
429
|
-
*
|
|
430
|
-
* (
|
|
431
|
-
*
|
|
458
|
+
* It is **not** under the project path: all the calling screen knows is the
|
|
459
|
+
* hostname (the original request went there), and the server derives the org
|
|
460
|
+
* and project names from it. Doing `location.replace` with the `redirect` that
|
|
461
|
+
* comes back is the caller's job.
|
|
432
462
|
*/
|
|
433
463
|
authorizeAccess(to: string, next?: string): Promise<Ok<"authorizeAccess">>;
|
|
434
464
|
listMembers(org: string): Promise<Ok<"listMembers">>;
|
|
435
|
-
/**
|
|
465
|
+
/** This is not an invite — the user must already have logged in once (404 `user_not_found`). */
|
|
436
466
|
addMember(org: string, provider: "dev" | "github", subject: string, role: Role): Promise<Ok<"addMember">>;
|
|
437
467
|
setMemberRole(org: string, userId: string, role: Role): Promise<Ok<"setMemberRole">>;
|
|
438
468
|
/**
|
|
439
|
-
*
|
|
440
|
-
* (docs/members.md).
|
|
469
|
+
* Removing someone else is admin; **removing yourself is leaving**, which
|
|
470
|
+
* anyone can do (docs/members.md). The last admin can do neither
|
|
471
|
+
* (409 `last_admin`).
|
|
441
472
|
*/
|
|
442
473
|
removeMember(org: string, userId: string): Promise<void>;
|
|
443
|
-
/**
|
|
474
|
+
/** Pending and expired invites (admin). Accepted and revoked ones are history, so they do not come. */
|
|
444
475
|
listInvites(org: string): Promise<Ok<"listInvites">>;
|
|
445
476
|
/**
|
|
446
|
-
*
|
|
447
|
-
*
|
|
477
|
+
* Invites by email (admin). **Calling again with the same address is a
|
|
478
|
+
* resend** — the same row is updated rather than a new one created, and the
|
|
479
|
+
* server gives 200 instead of 201.
|
|
448
480
|
*/
|
|
449
481
|
createInvite(org: string, email: string, role: Role): Promise<Ok<"createInvite">>;
|
|
450
|
-
/**
|
|
482
|
+
/** Revokes an invite (admin). Mail that has not gone out yet does not go out. */
|
|
451
483
|
revokeInvite(org: string, inviteId: string): Promise<void>;
|
|
452
484
|
/**
|
|
453
|
-
*
|
|
454
|
-
*
|
|
485
|
+
* A preview of the invite. **No session needed** — whoever got the link has
|
|
486
|
+
* not logged in yet, and they need to know what they are accepting before
|
|
487
|
+
* they do.
|
|
455
488
|
*/
|
|
456
489
|
getInvite(token: string): Promise<Ok<"getInvite">>;
|
|
457
|
-
/**
|
|
490
|
+
/** Accepts (login required). If they are already a member the role does not change. */
|
|
458
491
|
acceptInvite(token: string): Promise<Ok<"acceptInvite">>;
|
|
459
|
-
/**
|
|
492
|
+
/** The default hostname and the custom domains come together (viewer). */
|
|
460
493
|
listHostnames(org: string, name: string): Promise<Ok<"listHostnames">>;
|
|
461
494
|
/**
|
|
462
|
-
*
|
|
495
|
+
* Attaches a custom domain (member).
|
|
463
496
|
*
|
|
464
|
-
*
|
|
465
|
-
*
|
|
497
|
+
* Idempotent — sending the same name again returns the existing row
|
|
498
|
+
* unchanged. The response's `verify` is the CNAME and TXT the customer has to
|
|
499
|
+
* add.
|
|
466
500
|
*/
|
|
467
501
|
addHostname(org: string, name: string, hostname: string): Promise<Ok<"addHostname">>;
|
|
468
|
-
/**
|
|
502
|
+
/** Runs the same check the background verifier makes, right now (member). */
|
|
469
503
|
verifyHostname(org: string, name: string, host: string): Promise<Ok<"verifyHostname">>;
|
|
470
|
-
/**
|
|
504
|
+
/** Detaches a custom domain (member). The default hostname gives a 400. */
|
|
471
505
|
deleteHostname(org: string, name: string, host: string): Promise<void>;
|
|
472
|
-
/**
|
|
506
|
+
/** The organization's zones. No `rrsets` — those ride only on a single-zone lookup. */
|
|
473
507
|
listZones(org: string): Promise<Ok<"listZones">>;
|
|
474
|
-
/**
|
|
508
|
+
/** Idempotent. A zone that already exists comes back unchanged. */
|
|
475
509
|
createZone(org: string, name: string): Promise<Ok<"createZone">>;
|
|
476
510
|
getZone(org: string, zone: string): Promise<Ok<"getZone">>;
|
|
477
511
|
deleteZone(org: string, zone: string): Promise<void>;
|
|
478
512
|
/**
|
|
479
|
-
*
|
|
480
|
-
*
|
|
513
|
+
* Replaces one rrset **whole**. `records` is the complete new set for that
|
|
514
|
+
* (name, type), so adding a single value means sending the current ones with
|
|
515
|
+
* it.
|
|
481
516
|
*/
|
|
482
517
|
putRRset(org: string, zone: string, name: string, type: RRsetType, ttl: number, records: string[]): Promise<Ok<"putRRset">>;
|
|
483
518
|
deleteRRset(org: string, zone: string, name: string, type: RRsetType): Promise<void>;
|
|
484
519
|
setZoneDNSSEC(org: string, zone: string, enabled: boolean): Promise<Ok<"setZoneDNSSEC">>;
|
|
485
520
|
setZoneDS(org: string, zone: string, ds: string[]): Promise<Ok<"setZoneDS">>;
|
|
486
|
-
/**
|
|
521
|
+
/** The shared prefix of the DNS surface. */
|
|
487
522
|
private dnsPath;
|
|
488
|
-
/** `@`
|
|
523
|
+
/** Both `@` and `*` arrive as a name. Keeps the same string out of four places. */
|
|
489
524
|
private rrsetPath;
|
|
490
525
|
/**
|
|
491
|
-
*
|
|
526
|
+
* Looks a name up (member or above).
|
|
492
527
|
*
|
|
493
|
-
* `priceCents`
|
|
494
|
-
*
|
|
495
|
-
*
|
|
528
|
+
* `priceCents` is the first year of registration; `renewalCents` is one year
|
|
529
|
+
* of renewal. They are separate because a first-year discount is common —
|
|
530
|
+
* folded into one, the screen cannot say "buy it for $1, then $15 next year".
|
|
496
531
|
*/
|
|
497
532
|
checkDomains(org: string, names: string[]): Promise<Ok<"checkDomains">>;
|
|
498
533
|
/**
|
|
499
|
-
*
|
|
534
|
+
* Buys a domain (admin — this spends money).
|
|
500
535
|
*
|
|
501
|
-
* **ICANN
|
|
502
|
-
*
|
|
536
|
+
* **The ICANN verification mail goes to `contact.email`.** The screen has to
|
|
537
|
+
* say so before the purchase (docs/domains.md §5.5).
|
|
503
538
|
*
|
|
504
|
-
*
|
|
505
|
-
*
|
|
539
|
+
* Sending the same request again is safe — a finished domain comes back
|
|
540
|
+
* unchanged, and a purchase that stopped part way resumes from where it
|
|
541
|
+
* stopped.
|
|
506
542
|
*/
|
|
507
543
|
purchaseDomain(org: string, body: {
|
|
508
544
|
name: string;
|
|
@@ -510,30 +546,30 @@ export declare class Client {
|
|
|
510
546
|
contact: DomainContact;
|
|
511
547
|
projectId?: string;
|
|
512
548
|
}): Promise<Ok<"purchaseDomain">>;
|
|
513
|
-
/**
|
|
549
|
+
/** Imports a domain you already own (admin). Creates the zone only; the registrar is not called. */
|
|
514
550
|
importDomain(org: string, name: string): Promise<Ok<"importDomain">>;
|
|
515
551
|
listDomains(org: string): Promise<Ok<"listDomains">>;
|
|
516
552
|
getDomain(org: string, name: string): Promise<Ok<"getDomain">>;
|
|
517
553
|
renewDomain(org: string, name: string, years: number): Promise<Ok<"renewDomain">>;
|
|
518
554
|
/**
|
|
519
|
-
*
|
|
555
|
+
* Changes only the **intent** to auto-renew.
|
|
520
556
|
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
*
|
|
557
|
+
* Auto-renew at the registrar stays on — a domain is an asset you lose if you
|
|
558
|
+
* are a day late, so we renew first and bill afterwards. The screen has to say
|
|
559
|
+
* this alongside.
|
|
524
560
|
*/
|
|
525
561
|
setDomainAutoRenew(org: string, name: string, enabled: boolean): Promise<Ok<"setDomainAutoRenew">>;
|
|
526
562
|
setDomainLock(org: string, name: string, locked: boolean): Promise<Ok<"setDomainLock">>;
|
|
527
|
-
/**
|
|
563
|
+
/** The transfer auth code. The audit records that one was issued and **not the code itself**. */
|
|
528
564
|
domainAuthCode(org: string, name: string): Promise<Ok<"getDomainAuthCode">>;
|
|
529
|
-
/**
|
|
565
|
+
/** Re-reads from the registrar right now (member). */
|
|
530
566
|
syncDomain(org: string, name: string): Promise<Ok<"syncDomain">>;
|
|
531
|
-
/**
|
|
567
|
+
/** The shared prefix of the domain surface. Keeps the same string out of ten places. */
|
|
532
568
|
private domainsPath;
|
|
533
569
|
private domainPath;
|
|
534
|
-
/**
|
|
570
|
+
/** The shared prefix of the project surface. */
|
|
535
571
|
private projectPath;
|
|
536
|
-
/**
|
|
572
|
+
/** The shared prefix of the database surface. Keeps the same string out of five places. */
|
|
537
573
|
private dbPath;
|
|
538
574
|
listRepos(org: string, project: string): Promise<Ok<"listRepos">>;
|
|
539
575
|
createRepo(org: string, project: string, body: {
|
|
@@ -548,13 +584,13 @@ export declare class Client {
|
|
|
548
584
|
defaultBranch?: string | undefined;
|
|
549
585
|
}): Promise<void>;
|
|
550
586
|
deleteRepo(org: string, project: string, name: string): Promise<void>;
|
|
551
|
-
/** ref
|
|
587
|
+
/** The ref history. The lead for recovering a commit lost to a force-push is here. */
|
|
552
588
|
listRefUpdates(org: string, project: string, name: string): Promise<Ok<"listRefUpdates">>;
|
|
553
589
|
listSSHKeys(): Promise<Ok<"listSSHKeys">>;
|
|
554
590
|
addSSHKey(publicKey: string, name?: string): Promise<Ok<"addSSHKey">>;
|
|
555
591
|
deleteSSHKey(keyId: string): Promise<void>;
|
|
556
592
|
listAccessTokens(): Promise<Ok<"listAccessTokens">>;
|
|
557
|
-
/**
|
|
593
|
+
/** The plaintext is carried in this response **once** and never again. */
|
|
558
594
|
createAccessToken(body: {
|
|
559
595
|
name: string;
|
|
560
596
|
scope?: TokenScope | undefined;
|
|
@@ -565,7 +601,7 @@ export declare class Client {
|
|
|
565
601
|
getRepoTree(org: string, project: string, name: string, ref?: string, path?: string): Promise<Ok<"getRepoTree">>;
|
|
566
602
|
getRepoBlob(org: string, project: string, name: string, ref?: string, path?: string): Promise<Ok<"getRepoBlob">>;
|
|
567
603
|
getRepoCommits(org: string, project: string, name: string, ref?: string, limit?: number): Promise<Ok<"getRepoCommits">>;
|
|
568
|
-
/**
|
|
604
|
+
/** The shared prefix of the repository surface. It sits under the project (§19). */
|
|
569
605
|
private repoPath;
|
|
570
606
|
rollback(org: string, name: string, version: number): Promise<Ok<"rollback">>;
|
|
571
607
|
}
|