@promigence/sdk 0.1.0-beta.14 → 0.1.0-beta.16
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/caller.js +1 -1
- package/dist/cjs/caller.js +1 -1
- package/dist/cjs/client.d.ts +134 -23
- package/dist/cjs/client.js +202 -80
- package/dist/cjs/command-errors.d.ts +1 -0
- package/dist/cjs/command-errors.js +2 -0
- package/dist/cjs/context.d.ts +19 -4
- package/dist/cjs/context.js +77 -5
- package/dist/cjs/core.d.ts +32 -4
- package/dist/cjs/core.js +30 -5
- package/dist/cjs/http2.d.ts +8 -0
- package/dist/cjs/http2.js +22 -1
- package/dist/cjs/models.gen.d.ts +663 -43
- package/dist/cjs/pty.d.ts +11 -14
- package/dist/cjs/pty.js +15 -12
- package/dist/cjs/sandbox.d.ts +26 -8
- package/dist/cjs/sandbox.js +28 -4
- package/dist/cjs/transport-worker.js +10 -1
- package/dist/client.d.ts +134 -23
- package/dist/client.js +201 -77
- package/dist/command-errors.d.ts +1 -0
- package/dist/command-errors.js +3 -1
- package/dist/context.d.ts +19 -4
- package/dist/context.js +74 -4
- package/dist/core.d.ts +32 -4
- package/dist/core.js +26 -4
- package/dist/http2.d.ts +8 -0
- package/dist/http2.js +22 -1
- package/dist/models.gen.d.ts +663 -43
- package/dist/pty.d.ts +11 -14
- package/dist/pty.js +13 -11
- package/dist/sandbox.d.ts +26 -8
- package/dist/sandbox.js +28 -4
- package/dist/transport-worker.js +10 -1
- package/package.json +1 -1
package/dist/cjs/models.gen.d.ts
CHANGED
|
@@ -113,6 +113,108 @@ export interface AutoPauseSet {
|
|
|
113
113
|
ok: boolean;
|
|
114
114
|
sandbox_id: string;
|
|
115
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Auto-reload: when available credits fall below `threshold_usd`, `amount_usd` is charged to
|
|
118
|
+
* `card` and added as credits.
|
|
119
|
+
*/
|
|
120
|
+
export interface AutoReload {
|
|
121
|
+
/**
|
|
122
|
+
* What each reload adds, whole USD.
|
|
123
|
+
*/
|
|
124
|
+
amount_usd: number;
|
|
125
|
+
/**
|
|
126
|
+
* What turning auto-reload on asks the owner to accept.
|
|
127
|
+
*/
|
|
128
|
+
authorization: AutoReloadAuthorization;
|
|
129
|
+
/**
|
|
130
|
+
* The payment method a reload charges.
|
|
131
|
+
*/
|
|
132
|
+
card?: CardOnFile | null;
|
|
133
|
+
/**
|
|
134
|
+
* The latest reload; `null` before the first.
|
|
135
|
+
*/
|
|
136
|
+
last?: AutoReloadLast | null;
|
|
137
|
+
/**
|
|
138
|
+
* Whether auto-reload is on.
|
|
139
|
+
*/
|
|
140
|
+
on: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Why auto-reload is paused, or `null`: `declined`, `authentication_required`, `daily_limit`,
|
|
143
|
+
* `disputed`, `amount_over_limit` or `support`.
|
|
144
|
+
*/
|
|
145
|
+
paused_reason?: string | null;
|
|
146
|
+
/**
|
|
147
|
+
* With `paused_reason` `daily_limit`, which limit of the day it reached: `count` (the most
|
|
148
|
+
* auto-reloads in a day) or `amount` (the most purchases and reloads can add in a day); `null`
|
|
149
|
+
* otherwise.
|
|
150
|
+
*/
|
|
151
|
+
paused_why?: string | null;
|
|
152
|
+
/**
|
|
153
|
+
* The level that starts a reload, whole USD.
|
|
154
|
+
*/
|
|
155
|
+
threshold_usd: number;
|
|
156
|
+
/**
|
|
157
|
+
* Why auto-reload cannot be turned on for this payment method, or `null`: `card_country`.
|
|
158
|
+
*/
|
|
159
|
+
unavailable_reason?: string | null;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The authorization an owner accepts to turn auto-reload on.
|
|
163
|
+
*/
|
|
164
|
+
export interface AutoReloadAuthorization {
|
|
165
|
+
/**
|
|
166
|
+
* Its words, with `{card}`, `{amount}`, `{threshold}`, `{n}` and `{day_max}` to fill in.
|
|
167
|
+
*/
|
|
168
|
+
template: string;
|
|
169
|
+
/**
|
|
170
|
+
* Its version: turning auto-reload on sends it back, to say which words were accepted.
|
|
171
|
+
*/
|
|
172
|
+
version: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* The latest auto-reload.
|
|
176
|
+
*/
|
|
177
|
+
export interface AutoReloadLast {
|
|
178
|
+
/**
|
|
179
|
+
* USD.
|
|
180
|
+
*/
|
|
181
|
+
amount_usd: number;
|
|
182
|
+
/**
|
|
183
|
+
* When it was charged, RFC 3339.
|
|
184
|
+
*/
|
|
185
|
+
at: string;
|
|
186
|
+
/**
|
|
187
|
+
* While it is unpaid, the page to pay it.
|
|
188
|
+
*/
|
|
189
|
+
pay_url?: string | null;
|
|
190
|
+
/**
|
|
191
|
+
* `pending`, `paid`, `needs_action` (the bank asks you to confirm it) or `failed`.
|
|
192
|
+
*/
|
|
193
|
+
state: string;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* `PUT /v1/billing/auto-reload`.
|
|
197
|
+
*/
|
|
198
|
+
export interface AutoReloadSet {
|
|
199
|
+
/**
|
|
200
|
+
* What each reload adds, whole USD; omitted: unchanged.
|
|
201
|
+
*/
|
|
202
|
+
amount_usd?: number | null;
|
|
203
|
+
/**
|
|
204
|
+
* The version of the authorization the owner accepted (`auto_reload.authorization.version` of
|
|
205
|
+
* `GET /v1/billing`). Needed to turn auto-reload on, or to change the level, the amount or the
|
|
206
|
+
* card.
|
|
207
|
+
*/
|
|
208
|
+
authorization_version?: string | null;
|
|
209
|
+
/**
|
|
210
|
+
* Whether auto-reload is on.
|
|
211
|
+
*/
|
|
212
|
+
on: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* The level that starts a reload, whole USD; omitted: unchanged.
|
|
215
|
+
*/
|
|
216
|
+
threshold_usd?: number | null;
|
|
217
|
+
}
|
|
116
218
|
/**
|
|
117
219
|
* A background command, as `GET /v1/sandboxes/{id}/execs/{exec_id}` reports it, and as the
|
|
118
220
|
* `202` from `POST /v1/sandboxes/{id}/execs` with `background: true` hands it over.
|
|
@@ -243,6 +345,37 @@ export interface BackgroundExecList {
|
|
|
243
345
|
execs: Array<BackgroundExec>;
|
|
244
346
|
sandbox_id: string;
|
|
245
347
|
}
|
|
348
|
+
/**
|
|
349
|
+
* What the organization's credits can pay for.
|
|
350
|
+
*/
|
|
351
|
+
export interface BillingCredits {
|
|
352
|
+
/**
|
|
353
|
+
* What new work can use: the balance less what is held, never below 0, USD.
|
|
354
|
+
*/
|
|
355
|
+
available_usd: number;
|
|
356
|
+
/**
|
|
357
|
+
* Credits on the account, USD.
|
|
358
|
+
*/
|
|
359
|
+
balance_usd: number;
|
|
360
|
+
/**
|
|
361
|
+
* Available credits cannot start new work.
|
|
362
|
+
*/
|
|
363
|
+
exhausted: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* Of the balance, what running and paused work may still use, plus data out sent and not yet
|
|
366
|
+
* charged and, once storage is priced, the next 7 days of storage, USD.
|
|
367
|
+
*/
|
|
368
|
+
held_usd: number;
|
|
369
|
+
/**
|
|
370
|
+
* Available credits are below the low-balance level.
|
|
371
|
+
*/
|
|
372
|
+
low: boolean;
|
|
373
|
+
/**
|
|
374
|
+
* The credits that expire next: how much and when; `null` when none expire in the next 30
|
|
375
|
+
* days.
|
|
376
|
+
*/
|
|
377
|
+
next_expiry?: CreditsExpiry | null;
|
|
378
|
+
}
|
|
246
379
|
/**
|
|
247
380
|
* `GET /v1/billing/history` — your billing history, newest first: every credit you received and
|
|
248
381
|
* every payment, one page at a time.
|
|
@@ -273,6 +406,32 @@ export interface BillingHistoryEntry {
|
|
|
273
406
|
*/
|
|
274
407
|
payment?: Payment | null;
|
|
275
408
|
}
|
|
409
|
+
/**
|
|
410
|
+
* A hold that refuses new work.
|
|
411
|
+
*/
|
|
412
|
+
export interface BillingHold {
|
|
413
|
+
/**
|
|
414
|
+
* The disputed payment, or the unpaid invoice, USD.
|
|
415
|
+
*/
|
|
416
|
+
amount_usd: number;
|
|
417
|
+
/**
|
|
418
|
+
* The disputed payment's id, for `POST /v1/billing/disputes/{dispute_id}/repay`; `null` for an
|
|
419
|
+
* invoice.
|
|
420
|
+
*/
|
|
421
|
+
dispute_id?: string | null;
|
|
422
|
+
/**
|
|
423
|
+
* `dispute_open`, `dispute_lost`, `pre_move_unpaid` or `invoice_unpaid`.
|
|
424
|
+
*/
|
|
425
|
+
kind: string;
|
|
426
|
+
/**
|
|
427
|
+
* Why, in words.
|
|
428
|
+
*/
|
|
429
|
+
reason: string;
|
|
430
|
+
/**
|
|
431
|
+
* The page that lifts it: the invoice's page to pay it; `null` for a disputed payment.
|
|
432
|
+
*/
|
|
433
|
+
url?: string | null;
|
|
434
|
+
}
|
|
276
435
|
/**
|
|
277
436
|
* The billing period `usage` covers.
|
|
278
437
|
*/
|
|
@@ -291,11 +450,16 @@ export interface BillingPeriod {
|
|
|
291
450
|
start: string;
|
|
292
451
|
}
|
|
293
452
|
/**
|
|
294
|
-
* `GET /v1/billing` — plan, card on file, this month's usage, and the
|
|
295
|
-
* Never fails because the payment provider is slow: the estimate is the only part
|
|
296
|
-
* and its failure is a field, not a status.
|
|
453
|
+
* `GET /v1/billing` — plan, credits, auto-reload, card on file, this month's usage, and the next
|
|
454
|
+
* plan invoice. Never fails because the payment provider is slow: the estimate is the only part
|
|
455
|
+
* that asks it, and its failure is a field, not a status.
|
|
297
456
|
*/
|
|
298
457
|
export interface BillingStatus {
|
|
458
|
+
/**
|
|
459
|
+
* Auto-reload: when available credits fall below `threshold_usd`, `amount_usd` is charged to
|
|
460
|
+
* `card` and added as credits.
|
|
461
|
+
*/
|
|
462
|
+
auto_reload: AutoReload;
|
|
299
463
|
/**
|
|
300
464
|
* False while card billing is not available.
|
|
301
465
|
*/
|
|
@@ -311,30 +475,82 @@ export interface BillingStatus {
|
|
|
311
475
|
*/
|
|
312
476
|
card_note?: string | null;
|
|
313
477
|
card_on_file: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* What the organization's credits can pay for.
|
|
480
|
+
*/
|
|
481
|
+
credits: BillingCredits;
|
|
314
482
|
/**
|
|
315
483
|
* True once a billing customer exists for the organisation.
|
|
316
484
|
*/
|
|
317
485
|
customer: boolean;
|
|
486
|
+
/**
|
|
487
|
+
* A hold that refuses new work, or `null`: `kind`, `reason`, `amount_usd`, `dispute_id` for a
|
|
488
|
+
* disputed payment, and `url`, the page that lifts it.
|
|
489
|
+
*/
|
|
490
|
+
hold?: BillingHold | null;
|
|
318
491
|
/**
|
|
319
492
|
* The $1 that confirms the payment method on file when it has no stable payer (Apple Pay,
|
|
320
493
|
* Google Pay, Amazon Pay); `null` when it needed none.
|
|
321
494
|
*/
|
|
322
495
|
method_check?: MethodCheckView | null;
|
|
496
|
+
/**
|
|
497
|
+
* How usage is paid: `credits` (from credits bought in advance) or `postpaid` (billed after use,
|
|
498
|
+
* until `switch.at`).
|
|
499
|
+
*/
|
|
500
|
+
model: string;
|
|
323
501
|
notice?: TrialNotice | null;
|
|
324
502
|
org_id: string;
|
|
325
503
|
period: BillingPeriod;
|
|
326
504
|
plan: string;
|
|
505
|
+
/**
|
|
506
|
+
* The plan in force: `id`, `name`, `renews_at`, and `renewal` while a renewal payment is in
|
|
507
|
+
* trouble.
|
|
508
|
+
*/
|
|
509
|
+
plan_status: PlanStatus;
|
|
327
510
|
suspend_reason?: string | null;
|
|
328
511
|
suspended: boolean;
|
|
512
|
+
/**
|
|
513
|
+
* For a `postpaid` organization: `at`, when it moves to credits, and `credits_waiting_usd`, the
|
|
514
|
+
* credits bought before then, ready at the move.
|
|
515
|
+
*/
|
|
516
|
+
switch?: BillingSwitch | null;
|
|
329
517
|
trial: TrialStatus;
|
|
330
518
|
/**
|
|
331
|
-
* The
|
|
332
|
-
|
|
519
|
+
* The most this organization can buy now.
|
|
520
|
+
*/
|
|
521
|
+
trust: TrustLimits;
|
|
522
|
+
/**
|
|
523
|
+
* The next invoice, estimated: a plan's fee, and for an organization not yet on credits, its
|
|
524
|
+
* usage. `null` when there is neither, or when the estimate could not be fetched (see
|
|
525
|
+
* `upcoming_invoice_error`).
|
|
333
526
|
*/
|
|
334
527
|
upcoming_invoice?: UpcomingInvoice | null;
|
|
335
528
|
upcoming_invoice_error?: string | null;
|
|
336
529
|
usage: PeriodUsage;
|
|
337
530
|
}
|
|
531
|
+
/**
|
|
532
|
+
* When a `postpaid` organization moves to credits.
|
|
533
|
+
*/
|
|
534
|
+
export interface BillingSwitch {
|
|
535
|
+
/**
|
|
536
|
+
* When it moves to credits, RFC 3339.
|
|
537
|
+
*/
|
|
538
|
+
at: string;
|
|
539
|
+
/**
|
|
540
|
+
* The credits bought before then, ready at the move, USD.
|
|
541
|
+
*/
|
|
542
|
+
credits_waiting_usd: number;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* What one build holds of the credits.
|
|
546
|
+
*/
|
|
547
|
+
export interface BuildCreditHold {
|
|
548
|
+
build_id: string;
|
|
549
|
+
/**
|
|
550
|
+
* What it may still use, USD.
|
|
551
|
+
*/
|
|
552
|
+
held_usd: number;
|
|
553
|
+
}
|
|
338
554
|
/**
|
|
339
555
|
* An identical build that was already in progress, answered as if it were the caller's own.
|
|
340
556
|
*/
|
|
@@ -523,6 +739,11 @@ export interface BuildQueued {
|
|
|
523
739
|
* True when a verification command was given.
|
|
524
740
|
*/
|
|
525
741
|
verified: boolean;
|
|
742
|
+
/**
|
|
743
|
+
* What to know before the build ends: with `move_alias`, which snapshot gives up the alias
|
|
744
|
+
* to it once it is stored.
|
|
745
|
+
*/
|
|
746
|
+
warnings?: Array<string>;
|
|
526
747
|
}
|
|
527
748
|
/**
|
|
528
749
|
* Builds in the period.
|
|
@@ -829,7 +1050,7 @@ export interface CheckoutSession {
|
|
|
829
1050
|
mode: string;
|
|
830
1051
|
session_id?: string | null;
|
|
831
1052
|
/**
|
|
832
|
-
* Open this.
|
|
1053
|
+
* Open this. Your credits are kept.
|
|
833
1054
|
*/
|
|
834
1055
|
url: string;
|
|
835
1056
|
}
|
|
@@ -925,7 +1146,7 @@ export interface CliTokenCreate {
|
|
|
925
1146
|
/**
|
|
926
1147
|
* Every error and failure code the API returns.
|
|
927
1148
|
*/
|
|
928
|
-
export type Code = "fork_failed" | "start_timeout" | "readiness_failed" | "verify_too_slow" | "verify_each_failed" | "sandbox_unresponsive" | "oom_within_tier" | "disk_full_within_tier" | "sandbox_interrupted" | "integrity_mismatch" | "egress_unavailable" | "service_timeout" | "capacity_busy" | "verify_did_not_cover" | "nonzero_exit" | "task_timeout" | "oom_over_tier" | "disk_over_tier" | "cap_killed" | "cap_exceeded" | "aborted_by_client" | "expired" | "not_started" | "superseded" | "usage" | "internal" | "auth" | "not_found" | "unreachable" | "rate_limited" | "timeout" | "not_verified" | "enoent" | "trial_credits_exhausted" | "card_required" | "concurrency_limit" | "egress_cap_reached" | "network_policy_unsupported" | "network_host_refused" | "toolchain_mismatch" | "resume_unavailable" | "sandbox_unreachable" | "region_at_capacity" | "tier_unavailable" | "snapshot_unavailable" | "capacity_limit" | "build_timeout" | "builder_unavailable" | "builder_busy" | "overloaded" | "preempted" | "grader_failed" | "grade_not_passed" | "shutdown_by_task" | "modified_by_task" | "cap_paused" | "credits_paused" | "stopped_by_support" | "forbidden" | "snapshot_incompatible" | "storage_limit_reached" | "dockerfile_build_failed" | "image_unresolvable" | "registry_unavailable" | "credit_unclaimed" | "billing_unavailable" | "project_cap_reached" | "spend_limit_reached" | "billing_hold" | "tier_over_plan" | "secrets_in_snapshot" | "secrets_unavailable" | "secret_binding_unsupported" | "idempotency_key_reused" | "idempotency_key_in_use" | "repo_credentials_not_supported" | "account_exists" | "invite_invalid" | "invite_required" | "key_expired" | "account_blocked" | "setup_required";
|
|
1149
|
+
export type Code = "fork_failed" | "start_timeout" | "readiness_failed" | "verify_too_slow" | "verify_each_failed" | "sandbox_unresponsive" | "oom_within_tier" | "disk_full_within_tier" | "sandbox_interrupted" | "integrity_mismatch" | "egress_unavailable" | "service_timeout" | "capacity_busy" | "verify_did_not_cover" | "nonzero_exit" | "task_timeout" | "oom_over_tier" | "disk_over_tier" | "cap_killed" | "cap_exceeded" | "aborted_by_client" | "expired" | "not_started" | "superseded" | "usage" | "internal" | "auth" | "not_found" | "unreachable" | "rate_limited" | "timeout" | "not_verified" | "enoent" | "trial_credits_exhausted" | "credits_exhausted" | "card_required" | "purchase_limit" | "purchases_blocked" | "card_needed" | "auto_reload_unavailable" | "concurrency_limit" | "egress_cap_reached" | "network_policy_unsupported" | "network_host_refused" | "toolchain_mismatch" | "resume_unavailable" | "sandbox_unreachable" | "region_at_capacity" | "tier_unavailable" | "snapshot_unavailable" | "capacity_limit" | "build_timeout" | "builder_unavailable" | "builder_busy" | "overloaded" | "preempted" | "grader_failed" | "grade_not_passed" | "shutdown_by_task" | "modified_by_task" | "cap_paused" | "credits_paused" | "stopped_by_support" | "forbidden" | "snapshot_incompatible" | "storage_limit_reached" | "dockerfile_build_failed" | "image_unresolvable" | "registry_unavailable" | "credit_unclaimed" | "billing_unavailable" | "project_cap_reached" | "spend_limit_reached" | "billing_hold" | "tier_over_plan" | "secrets_in_snapshot" | "secrets_unavailable" | "secret_binding_unsupported" | "idempotency_key_reused" | "idempotency_key_in_use" | "repo_credentials_not_supported" | "account_exists" | "invite_invalid" | "invite_required" | "key_expired" | "account_blocked" | "setup_required";
|
|
929
1150
|
export interface Concurrency {
|
|
930
1151
|
}
|
|
931
1152
|
/**
|
|
@@ -1024,7 +1245,7 @@ export interface CreditGrant {
|
|
|
1024
1245
|
*/
|
|
1025
1246
|
granted_at: string;
|
|
1026
1247
|
/**
|
|
1027
|
-
* USD.
|
|
1248
|
+
* USD. For `credit_taken_back`, what was taken back.
|
|
1028
1249
|
*/
|
|
1029
1250
|
granted_usd: number;
|
|
1030
1251
|
/**
|
|
@@ -1032,7 +1253,10 @@ export interface CreditGrant {
|
|
|
1032
1253
|
* `referral` (a referral reward), `plan` (usage included with a paid plan),
|
|
1033
1254
|
* `from_promigence` (credit Promigence added to your account), `service_restart` (credit
|
|
1034
1255
|
* for a command a service restart stopped), `confirmation_credit` (a $1 charge that
|
|
1035
|
-
* confirmed a payment method, added back as credit),
|
|
1256
|
+
* confirmed a payment method, added back as credit), `credits_bought` (credits bought on a
|
|
1257
|
+
* payment page), `auto_reload` (credits added by auto-reload), `credit_taken_back` (credits
|
|
1258
|
+
* taken back after a refund or a dispute), `credit_regranted` (credits given back after a
|
|
1259
|
+
* dispute was decided for you, withdrawn or closed), or `other`.
|
|
1036
1260
|
*/
|
|
1037
1261
|
kind: string;
|
|
1038
1262
|
/**
|
|
@@ -1046,6 +1270,33 @@ export interface CreditGrant {
|
|
|
1046
1270
|
*/
|
|
1047
1271
|
status: string;
|
|
1048
1272
|
}
|
|
1273
|
+
/**
|
|
1274
|
+
* `GET /v1/billing/holds` — What each running or paused sandbox holds of the organization's
|
|
1275
|
+
* credits.
|
|
1276
|
+
*/
|
|
1277
|
+
export interface CreditHolds {
|
|
1278
|
+
/**
|
|
1279
|
+
* Each build still running, and what it holds.
|
|
1280
|
+
*/
|
|
1281
|
+
builds: Array<BuildCreditHold>;
|
|
1282
|
+
/**
|
|
1283
|
+
* Data out sent and not yet charged, USD.
|
|
1284
|
+
*/
|
|
1285
|
+
data_out_usd: number;
|
|
1286
|
+
/**
|
|
1287
|
+
* Of the balance, what running and paused work may still use, plus data out sent and not yet
|
|
1288
|
+
* charged and, once storage is priced, the next 7 days of storage, USD.
|
|
1289
|
+
*/
|
|
1290
|
+
held_usd: number;
|
|
1291
|
+
/**
|
|
1292
|
+
* Each running or paused sandbox, and what it holds.
|
|
1293
|
+
*/
|
|
1294
|
+
sandboxes: Array<SandboxCreditHold>;
|
|
1295
|
+
/**
|
|
1296
|
+
* The next 7 days of storage, once storage is priced, USD.
|
|
1297
|
+
*/
|
|
1298
|
+
storage_usd: number;
|
|
1299
|
+
}
|
|
1049
1300
|
/**
|
|
1050
1301
|
* The account's free credit (`GET /v1/credits/offer`, and the answer to a claim). The credit is
|
|
1051
1302
|
* claimed in the browser, where the terms are accepted: `POST /v1/credits/claim-link` makes the
|
|
@@ -1083,6 +1334,52 @@ export interface CreditOffer {
|
|
|
1083
1334
|
*/
|
|
1084
1335
|
state: string;
|
|
1085
1336
|
}
|
|
1337
|
+
/**
|
|
1338
|
+
* `POST /v1/billing/credits`.
|
|
1339
|
+
*/
|
|
1340
|
+
export interface CreditsBuy {
|
|
1341
|
+
/**
|
|
1342
|
+
* What to buy, in whole dollars, from 5.
|
|
1343
|
+
*/
|
|
1344
|
+
amount_usd: number;
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* Credits that expire, and when.
|
|
1348
|
+
*/
|
|
1349
|
+
export interface CreditsExpiry {
|
|
1350
|
+
/**
|
|
1351
|
+
* USD.
|
|
1352
|
+
*/
|
|
1353
|
+
amount_usd: number;
|
|
1354
|
+
/**
|
|
1355
|
+
* RFC 3339.
|
|
1356
|
+
*/
|
|
1357
|
+
at: string;
|
|
1358
|
+
}
|
|
1359
|
+
/**
|
|
1360
|
+
* `POST /v1/billing/credits/{session_id}/settle` — Check a credits payment and add its credits if it
|
|
1361
|
+
* went through. Safe to call more than once.
|
|
1362
|
+
*/
|
|
1363
|
+
export interface CreditsSettled {
|
|
1364
|
+
/**
|
|
1365
|
+
* USD.
|
|
1366
|
+
*/
|
|
1367
|
+
amount_usd: number;
|
|
1368
|
+
/**
|
|
1369
|
+
* With `paid`: what new work can use now, USD.
|
|
1370
|
+
*/
|
|
1371
|
+
available_usd?: number | null;
|
|
1372
|
+
/**
|
|
1373
|
+
* `paid` (the credits were added), `paid_awaiting_switch` (paid; the credits are added at
|
|
1374
|
+
* `switch_at`), `open` (not paid yet), `processing` (paid; the payment is still being
|
|
1375
|
+
* confirmed), `expired` (no payment was made) or `failed` (the payment did not go through).
|
|
1376
|
+
*/
|
|
1377
|
+
state: string;
|
|
1378
|
+
/**
|
|
1379
|
+
* With `paid_awaiting_switch`: when the credits are added, RFC 3339.
|
|
1380
|
+
*/
|
|
1381
|
+
switch_at?: string | null;
|
|
1382
|
+
}
|
|
1086
1383
|
/**
|
|
1087
1384
|
* One entry of a directory listing.
|
|
1088
1385
|
*/
|
|
@@ -1106,7 +1403,7 @@ export interface DirEntry {
|
|
|
1106
1403
|
/**
|
|
1107
1404
|
* The exact bytes of `path`, base64, when the name is not UTF-8: `name` and `path` then show
|
|
1108
1405
|
* U+FFFD where those bytes are, and name no file. A directory holding such names is fetched
|
|
1109
|
-
* exactly as an archive (`
|
|
1406
|
+
* exactly as an archive (`POST …/files/archive`).
|
|
1110
1407
|
*/
|
|
1111
1408
|
path_b64?: string | null;
|
|
1112
1409
|
/**
|
|
@@ -1210,7 +1507,7 @@ export interface ErrorBody {
|
|
|
1210
1507
|
/**
|
|
1211
1508
|
* Every error code the API returns. `category` decides whether the failure is billed: `env` is ours (not billed before hand-over; after it, the time since the sandbox's last snapshot is credited back, up to 24 hours, when our side shows the cause), `task` is your command and is billed. The full table is `x-promigence-error-codes` at the document root.
|
|
1212
1509
|
*/
|
|
1213
|
-
export type ErrorCode = "fork_failed" | "start_timeout" | "readiness_failed" | "verify_too_slow" | "verify_each_failed" | "toolchain_mismatch" | "sandbox_unresponsive" | "oom_within_tier" | "disk_full_within_tier" | "sandbox_interrupted" | "integrity_mismatch" | "egress_unavailable" | "service_timeout" | "preempted" | "verify_did_not_cover" | "grader_failed" | "nonzero_exit" | "grade_not_passed" | "task_timeout" | "oom_over_tier" | "disk_over_tier" | "shutdown_by_task" | "modified_by_task" | "cap_killed" | "cap_exceeded" | "cap_paused" | "credits_paused" | "aborted_by_client" | "stopped_by_support" | "expired" | "not_started" | "superseded" | "usage" | "internal" | "auth" | "forbidden" | "not_found" | "unreachable" | "rate_limited" | "timeout" | "not_verified" | "snapshot_incompatible" | "storage_limit_reached" | "resume_unavailable" | "sandbox_unreachable" | "capacity_busy" | "region_at_capacity" | "builder_unavailable" | "builder_busy" | "overloaded" | "tier_unavailable" | "snapshot_unavailable" | "capacity_limit" | "build_timeout" | "dockerfile_build_failed" | "image_unresolvable" | "registry_unavailable" | "enoent" | "trial_credits_exhausted" | "credit_unclaimed" | "setup_required" | "card_required" | "billing_unavailable" | "concurrency_limit" | "egress_cap_reached" | "project_cap_reached" | "spend_limit_reached" | "billing_hold" | "tier_over_plan" | "network_host_refused" | "network_policy_unsupported" | "secrets_in_snapshot" | "secrets_unavailable" | "secret_binding_unsupported" | "idempotency_key_reused" | "idempotency_key_in_use" | "repo_credentials_not_supported" | "account_exists" | "invite_invalid" | "invite_required" | "key_expired" | "account_blocked";
|
|
1510
|
+
export type ErrorCode = "fork_failed" | "start_timeout" | "readiness_failed" | "verify_too_slow" | "verify_each_failed" | "toolchain_mismatch" | "sandbox_unresponsive" | "oom_within_tier" | "disk_full_within_tier" | "sandbox_interrupted" | "integrity_mismatch" | "egress_unavailable" | "service_timeout" | "preempted" | "verify_did_not_cover" | "grader_failed" | "nonzero_exit" | "grade_not_passed" | "task_timeout" | "oom_over_tier" | "disk_over_tier" | "shutdown_by_task" | "modified_by_task" | "cap_killed" | "cap_exceeded" | "cap_paused" | "credits_paused" | "aborted_by_client" | "stopped_by_support" | "expired" | "not_started" | "superseded" | "usage" | "internal" | "auth" | "forbidden" | "not_found" | "unreachable" | "rate_limited" | "timeout" | "not_verified" | "snapshot_incompatible" | "storage_limit_reached" | "resume_unavailable" | "sandbox_unreachable" | "capacity_busy" | "region_at_capacity" | "builder_unavailable" | "builder_busy" | "overloaded" | "tier_unavailable" | "snapshot_unavailable" | "capacity_limit" | "build_timeout" | "dockerfile_build_failed" | "image_unresolvable" | "registry_unavailable" | "enoent" | "trial_credits_exhausted" | "credits_exhausted" | "credit_unclaimed" | "setup_required" | "card_required" | "billing_unavailable" | "purchase_limit" | "card_needed" | "auto_reload_unavailable" | "purchases_blocked" | "concurrency_limit" | "egress_cap_reached" | "project_cap_reached" | "spend_limit_reached" | "billing_hold" | "tier_over_plan" | "network_host_refused" | "network_policy_unsupported" | "secrets_in_snapshot" | "secrets_unavailable" | "secret_binding_unsupported" | "idempotency_key_reused" | "idempotency_key_in_use" | "repo_credentials_not_supported" | "account_exists" | "invite_invalid" | "invite_required" | "key_expired" | "account_blocked";
|
|
1214
1511
|
/**
|
|
1215
1512
|
* `POST /v1/sandboxes/{id}/execs`, and the `exec` of `POST /v1/runs`: one command. `argv` (a
|
|
1216
1513
|
* non-empty list) or `sh` (a shell line) is required.
|
|
@@ -1531,6 +1828,13 @@ export interface FileCopy {
|
|
|
1531
1828
|
recursive?: boolean | null;
|
|
1532
1829
|
to: string;
|
|
1533
1830
|
}
|
|
1831
|
+
/**
|
|
1832
|
+
* `DELETE /v1/sandboxes/{id}/files`: a path, and `recursive` for a directory with something in it.
|
|
1833
|
+
*/
|
|
1834
|
+
export interface FileDeleteRequest {
|
|
1835
|
+
path: string;
|
|
1836
|
+
recursive?: boolean | null;
|
|
1837
|
+
}
|
|
1534
1838
|
/**
|
|
1535
1839
|
* `DELETE /v1/sandboxes/{id}/files`. Idempotent: a path that was not there is a 200 with
|
|
1536
1840
|
* `existed: false`, not a 404.
|
|
@@ -1570,7 +1874,32 @@ export interface FileInfo {
|
|
|
1570
1874
|
size: number;
|
|
1571
1875
|
}
|
|
1572
1876
|
/**
|
|
1573
|
-
*
|
|
1877
|
+
* `POST /v1/sandboxes/{id}/files/list`: one directory, or a walk below it.
|
|
1878
|
+
*/
|
|
1879
|
+
export interface FileListRequest {
|
|
1880
|
+
/**
|
|
1881
|
+
* How many levels a recursive walk goes down.
|
|
1882
|
+
*/
|
|
1883
|
+
depth?: number | null;
|
|
1884
|
+
/**
|
|
1885
|
+
* `false` leaves out names starting with `.`; they are listed by default.
|
|
1886
|
+
*/
|
|
1887
|
+
hidden?: boolean | null;
|
|
1888
|
+
/**
|
|
1889
|
+
* At most this many entries; past it the answer says `truncated: true`.
|
|
1890
|
+
*/
|
|
1891
|
+
limit?: number | null;
|
|
1892
|
+
/**
|
|
1893
|
+
* The directory (absolute). Default: `/`.
|
|
1894
|
+
*/
|
|
1895
|
+
path?: string | null;
|
|
1896
|
+
/**
|
|
1897
|
+
* Walk below the directory too.
|
|
1898
|
+
*/
|
|
1899
|
+
recursive?: boolean | null;
|
|
1900
|
+
}
|
|
1901
|
+
/**
|
|
1902
|
+
* The reply to `POST /v1/sandboxes/:id/files/list`.
|
|
1574
1903
|
*/
|
|
1575
1904
|
export interface FileListing {
|
|
1576
1905
|
entries: Array<DirEntry>;
|
|
@@ -1607,6 +1936,42 @@ export interface FileMove {
|
|
|
1607
1936
|
overwrite?: boolean | null;
|
|
1608
1937
|
to: string;
|
|
1609
1938
|
}
|
|
1939
|
+
/**
|
|
1940
|
+
* `POST /v1/sandboxes/{id}/files/read` and `POST /v1/sandboxes/{id}/files/stat`: one path,
|
|
1941
|
+
* absolute, inside the sandbox.
|
|
1942
|
+
*/
|
|
1943
|
+
export interface FilePathRequest {
|
|
1944
|
+
path: string;
|
|
1945
|
+
}
|
|
1946
|
+
/**
|
|
1947
|
+
* `POST /v1/sandboxes/{id}/files/search`: `pattern`, `contains`, or both.
|
|
1948
|
+
*/
|
|
1949
|
+
export interface FileSearchRequest {
|
|
1950
|
+
/**
|
|
1951
|
+
* Literal text to find inside the files that match; a match carries its line.
|
|
1952
|
+
*/
|
|
1953
|
+
contains?: string | null;
|
|
1954
|
+
/**
|
|
1955
|
+
* `false` leaves out names starting with `.`; they are searched by default.
|
|
1956
|
+
*/
|
|
1957
|
+
hidden?: boolean | null;
|
|
1958
|
+
/**
|
|
1959
|
+
* Match `contains` without regard to case.
|
|
1960
|
+
*/
|
|
1961
|
+
ignore_case?: boolean | null;
|
|
1962
|
+
/**
|
|
1963
|
+
* At most this many matches; past it the answer says `truncated: true`.
|
|
1964
|
+
*/
|
|
1965
|
+
limit?: number | null;
|
|
1966
|
+
/**
|
|
1967
|
+
* The directory to search (absolute). Default: `/`.
|
|
1968
|
+
*/
|
|
1969
|
+
path?: string | null;
|
|
1970
|
+
/**
|
|
1971
|
+
* A glob over the file name, e.g. `*.py`.
|
|
1972
|
+
*/
|
|
1973
|
+
pattern?: string | null;
|
|
1974
|
+
}
|
|
1610
1975
|
/**
|
|
1611
1976
|
* Size, mode, modification time and kind for one path, as the sandbox reports them.
|
|
1612
1977
|
*/
|
|
@@ -1625,7 +1990,7 @@ export interface FileStat {
|
|
|
1625
1990
|
size?: number | null;
|
|
1626
1991
|
}
|
|
1627
1992
|
/**
|
|
1628
|
-
* `
|
|
1993
|
+
* `POST /v1/sandboxes/{id}/files/stat`.
|
|
1629
1994
|
*/
|
|
1630
1995
|
export interface FileStatView {
|
|
1631
1996
|
path: string;
|
|
@@ -1633,7 +1998,7 @@ export interface FileStatView {
|
|
|
1633
1998
|
stat: FileStat;
|
|
1634
1999
|
}
|
|
1635
2000
|
/**
|
|
1636
|
-
* The answer to `PUT /v1/sandboxes/{id}/files` (
|
|
2001
|
+
* The answer to `PUT /v1/sandboxes/{id}/files` (a form: `path`, `mode`, `offset` and the `file`).
|
|
1637
2002
|
*/
|
|
1638
2003
|
export interface FileWritten {
|
|
1639
2004
|
/**
|
|
@@ -1645,12 +2010,12 @@ export interface FileWritten {
|
|
|
1645
2010
|
*/
|
|
1646
2011
|
chunks: number;
|
|
1647
2012
|
/**
|
|
1648
|
-
* The file's permission bits after the write, octal (`644`). Without
|
|
2013
|
+
* The file's permission bits after the write, octal (`644`). Without `mode` a file that
|
|
1649
2014
|
* already existed keeps its own, and a new file is `644`.
|
|
1650
2015
|
*/
|
|
1651
2016
|
mode: string;
|
|
1652
2017
|
/**
|
|
1653
|
-
* Where this request's bytes start in the file (
|
|
2018
|
+
* Where this request's bytes start in the file (`offset`, else 0).
|
|
1654
2019
|
*/
|
|
1655
2020
|
offset: number;
|
|
1656
2021
|
ok: boolean;
|
|
@@ -2714,7 +3079,7 @@ export interface NameCreate {
|
|
|
2714
3079
|
*/
|
|
2715
3080
|
name: string;
|
|
2716
3081
|
}
|
|
2717
|
-
export type Network = "none" | "egress";
|
|
3082
|
+
export type Network = "none" | "egress" | "allow";
|
|
2718
3083
|
/**
|
|
2719
3084
|
* An allowlist: the only hosts the sandbox may reach.
|
|
2720
3085
|
*/
|
|
@@ -2857,14 +3222,27 @@ export interface OrgList {
|
|
|
2857
3222
|
orgs: Array<OrgView>;
|
|
2858
3223
|
}
|
|
2859
3224
|
/**
|
|
2860
|
-
* `PATCH /v1/orgs/{org}`: rename the organization
|
|
2861
|
-
*
|
|
3225
|
+
* `PATCH /v1/orgs/{org}`: rename the organization, set how long its command output is kept, or
|
|
3226
|
+
* both: at least one field. Its id never changes; anything that names it by the old name (a
|
|
3227
|
+
* script, `--org`, a saved URL) must use the new one.
|
|
2862
3228
|
*/
|
|
2863
3229
|
export interface OrgPatch {
|
|
3230
|
+
/**
|
|
3231
|
+
* Keep a failed sandbox so it can be reopened where it broke, when a run does not say
|
|
3232
|
+
* (`capture`): `true` or `false`; `null` = the next level's setting. Set by an owner, on its
|
|
3233
|
+
* own (no other field in the same request).
|
|
3234
|
+
*/
|
|
3235
|
+
failure_captures?: boolean | null;
|
|
2864
3236
|
/**
|
|
2865
3237
|
* 1–40 lowercase letters, digits and dashes.
|
|
2866
3238
|
*/
|
|
2867
|
-
name
|
|
3239
|
+
name?: string | null;
|
|
3240
|
+
/**
|
|
3241
|
+
* Days the organization's command output (what its commands ran and printed) is kept after
|
|
3242
|
+
* its sandbox ends, 1–30; `null` = the default, 7. A project may name its own. Set by an
|
|
3243
|
+
* owner.
|
|
3244
|
+
*/
|
|
3245
|
+
output_retention_days?: number | null;
|
|
2868
3246
|
}
|
|
2869
3247
|
/**
|
|
2870
3248
|
* One organization you belong to. Billing, members and credits belong to it.
|
|
@@ -2882,9 +3260,19 @@ export interface OrgView {
|
|
|
2882
3260
|
* True for the organization a sign-in and the CLI use when none is named.
|
|
2883
3261
|
*/
|
|
2884
3262
|
default: boolean;
|
|
3263
|
+
/**
|
|
3264
|
+
* Whether a failed sandbox is kept so you can reopen it where it broke, when a run does not
|
|
3265
|
+
* say (`capture`); `null` = the default. A project may name its own.
|
|
3266
|
+
*/
|
|
3267
|
+
failure_captures?: boolean | null;
|
|
2885
3268
|
members: number;
|
|
2886
3269
|
name: string;
|
|
2887
3270
|
org_id: string;
|
|
3271
|
+
/**
|
|
3272
|
+
* Days command output is kept after a sandbox ends; `null` = the default, 7. A project may
|
|
3273
|
+
* name its own.
|
|
3274
|
+
*/
|
|
3275
|
+
output_retention_days?: number | null;
|
|
2888
3276
|
projects: number;
|
|
2889
3277
|
/**
|
|
2890
3278
|
* Your role in it: `owner` or `member`.
|
|
@@ -2985,24 +3373,38 @@ export interface Payment {
|
|
|
2985
3373
|
* The invoice's number, as the invoice shows it; `null` when not known.
|
|
2986
3374
|
*/
|
|
2987
3375
|
invoice_number?: string | null;
|
|
3376
|
+
/**
|
|
3377
|
+
* The invoice, as a PDF.
|
|
3378
|
+
*/
|
|
3379
|
+
invoice_pdf?: string | null;
|
|
2988
3380
|
/**
|
|
2989
3381
|
* The invoice's page: its receipt once it is paid, where to pay it while a payment has
|
|
2990
3382
|
* failed; `null` when not known.
|
|
2991
3383
|
*/
|
|
2992
3384
|
invoice_url?: string | null;
|
|
2993
3385
|
/**
|
|
2994
|
-
* `invoice_paid`, `payment_failed`, `refund`,
|
|
2995
|
-
* confirmed a payment method; it comes back as credit)
|
|
3386
|
+
* `invoice_paid`, `payment_failed`, `refund`, `method_check` (a charge, usually $1, that
|
|
3387
|
+
* confirmed a payment method; it comes back as credit), `credits_bought` (credits bought on a
|
|
3388
|
+
* payment page), `auto_reload` (credits added by auto-reload), `plan_invoice` (a plan's fee),
|
|
3389
|
+
* or `dispute_repaid` (a disputed payment, repaid).
|
|
2996
3390
|
*/
|
|
2997
3391
|
kind: string;
|
|
2998
3392
|
/**
|
|
2999
3393
|
* `method_check`: the payment method it confirmed, by name (`Apple Pay`); `null` otherwise.
|
|
3000
3394
|
*/
|
|
3001
3395
|
method?: string | null;
|
|
3396
|
+
/**
|
|
3397
|
+
* While it is unpaid, the page to pay it.
|
|
3398
|
+
*/
|
|
3399
|
+
pay_url?: string | null;
|
|
3002
3400
|
/**
|
|
3003
3401
|
* The plan whose fee the invoice billed; `null` when it billed usage alone.
|
|
3004
3402
|
*/
|
|
3005
3403
|
plan?: string | null;
|
|
3404
|
+
/**
|
|
3405
|
+
* The receipt.
|
|
3406
|
+
*/
|
|
3407
|
+
receipt_url?: string | null;
|
|
3006
3408
|
/**
|
|
3007
3409
|
* `paid` (for a payment that failed: paid since), `retrying` (it failed and will be tried
|
|
3008
3410
|
* again), `failed` (it failed and will not be tried again; for `method_check`, the method
|
|
@@ -3010,6 +3412,27 @@ export interface Payment {
|
|
|
3010
3412
|
*/
|
|
3011
3413
|
status: string;
|
|
3012
3414
|
}
|
|
3415
|
+
/**
|
|
3416
|
+
* A payment page to open (buying credits, or repaying a disputed payment).
|
|
3417
|
+
*/
|
|
3418
|
+
export interface PaymentPage {
|
|
3419
|
+
/**
|
|
3420
|
+
* What it charges, USD.
|
|
3421
|
+
*/
|
|
3422
|
+
amount_usd: number;
|
|
3423
|
+
/**
|
|
3424
|
+
* When the page stops working, RFC 3339.
|
|
3425
|
+
*/
|
|
3426
|
+
expires_at: string;
|
|
3427
|
+
/**
|
|
3428
|
+
* The page's id: `POST /v1/billing/credits/{session_id}/settle` checks it.
|
|
3429
|
+
*/
|
|
3430
|
+
session_id: string;
|
|
3431
|
+
/**
|
|
3432
|
+
* Open this to pay.
|
|
3433
|
+
*/
|
|
3434
|
+
url: string;
|
|
3435
|
+
}
|
|
3013
3436
|
export interface Percentiles {
|
|
3014
3437
|
p50: number;
|
|
3015
3438
|
p95: number;
|
|
@@ -3023,12 +3446,12 @@ export interface Percentiles {
|
|
|
3023
3446
|
*/
|
|
3024
3447
|
export interface PeriodUsage {
|
|
3025
3448
|
/**
|
|
3026
|
-
*
|
|
3449
|
+
* Usage billed after use, for an organization not yet on credits; 0 on credits.
|
|
3027
3450
|
*/
|
|
3028
3451
|
billable: number;
|
|
3029
3452
|
builds: BuildUsage;
|
|
3030
3453
|
/**
|
|
3031
|
-
* Of `total`, what
|
|
3454
|
+
* Of `total`, what credits paid.
|
|
3032
3455
|
*/
|
|
3033
3456
|
credits_applied: number;
|
|
3034
3457
|
/**
|
|
@@ -3048,15 +3471,59 @@ export interface PeriodUsage {
|
|
|
3048
3471
|
* Sandbox time by tier.
|
|
3049
3472
|
*/
|
|
3050
3473
|
sandboxes: Record<string, SandboxUsage>;
|
|
3474
|
+
/**
|
|
3475
|
+
* Storage, USD; absent when it is $0.
|
|
3476
|
+
*/
|
|
3477
|
+
storage?: number | null;
|
|
3051
3478
|
/**
|
|
3052
3479
|
* USD.
|
|
3053
3480
|
*/
|
|
3054
3481
|
total: number;
|
|
3055
3482
|
/**
|
|
3056
|
-
* Charges not yet
|
|
3483
|
+
* Charges not yet billed, for an organization not yet on credits; 0 on credits.
|
|
3057
3484
|
*/
|
|
3058
3485
|
unreported_entries: number;
|
|
3059
3486
|
}
|
|
3487
|
+
/**
|
|
3488
|
+
* A renewal payment in trouble. The plan stays in force while it is tried again.
|
|
3489
|
+
*/
|
|
3490
|
+
export interface PlanRenewal {
|
|
3491
|
+
/**
|
|
3492
|
+
* When it is tried again, RFC 3339; `null` when no try is due.
|
|
3493
|
+
*/
|
|
3494
|
+
next_try_at?: string | null;
|
|
3495
|
+
/**
|
|
3496
|
+
* The page to pay or confirm it.
|
|
3497
|
+
*/
|
|
3498
|
+
pay_url?: string | null;
|
|
3499
|
+
/**
|
|
3500
|
+
* `past_due` (the payment did not go through and is tried again) or `action_required` (your
|
|
3501
|
+
* bank asks you to confirm it).
|
|
3502
|
+
*/
|
|
3503
|
+
state: string;
|
|
3504
|
+
}
|
|
3505
|
+
/**
|
|
3506
|
+
* The plan in force.
|
|
3507
|
+
*/
|
|
3508
|
+
export interface PlanStatus {
|
|
3509
|
+
/**
|
|
3510
|
+
* The plan's id, as `plan` names it.
|
|
3511
|
+
*/
|
|
3512
|
+
id: string;
|
|
3513
|
+
/**
|
|
3514
|
+
* The plan's name.
|
|
3515
|
+
*/
|
|
3516
|
+
name: string;
|
|
3517
|
+
/**
|
|
3518
|
+
* While a renewal payment is in trouble: what stands and the page that settles it; `null`
|
|
3519
|
+
* otherwise.
|
|
3520
|
+
*/
|
|
3521
|
+
renewal?: PlanRenewal | null;
|
|
3522
|
+
/**
|
|
3523
|
+
* When it renews, RFC 3339; `null` for a plan that does not renew.
|
|
3524
|
+
*/
|
|
3525
|
+
renews_at?: string | null;
|
|
3526
|
+
}
|
|
3060
3527
|
/**
|
|
3061
3528
|
* One preview URL. Anyone holding the URL can reach the port behind it — it is a bearer token in
|
|
3062
3529
|
* a link.
|
|
@@ -3066,6 +3533,11 @@ export interface Port {
|
|
|
3066
3533
|
* Unix nanoseconds.
|
|
3067
3534
|
*/
|
|
3068
3535
|
created_unix_ns?: number | null;
|
|
3536
|
+
/**
|
|
3537
|
+
* When the URL stops working on its own, Unix nanoseconds; `null` when it works until it is
|
|
3538
|
+
* revoked or the sandbox ends.
|
|
3539
|
+
*/
|
|
3540
|
+
expires_unix_ns?: number | null;
|
|
3069
3541
|
/**
|
|
3070
3542
|
* The same publication addressed by name rather than by path. Apps that emit absolute paths
|
|
3071
3543
|
* need this form.
|
|
@@ -3077,8 +3549,8 @@ export interface Port {
|
|
|
3077
3549
|
port?: number | null;
|
|
3078
3550
|
sandbox_id: string;
|
|
3079
3551
|
/**
|
|
3080
|
-
* The token the URL carries. Pass it
|
|
3081
|
-
* revoke this one URL.
|
|
3552
|
+
* The token the URL carries. Pass it in the body of `POST /v1/sandboxes/{id}/ports/revoke`
|
|
3553
|
+
* (`{"token": …}`) to revoke this one URL.
|
|
3082
3554
|
*/
|
|
3083
3555
|
token?: string | null;
|
|
3084
3556
|
/**
|
|
@@ -3101,6 +3573,25 @@ export interface PortOpen {
|
|
|
3101
3573
|
* 1–65535.
|
|
3102
3574
|
*/
|
|
3103
3575
|
port: number;
|
|
3576
|
+
/**
|
|
3577
|
+
* Seconds until the URL stops working on its own, 1 to 2592000 (30 days). Absent: it works
|
|
3578
|
+
* until it is revoked or the sandbox ends.
|
|
3579
|
+
*/
|
|
3580
|
+
ttl_s?: number | null;
|
|
3581
|
+
}
|
|
3582
|
+
/**
|
|
3583
|
+
* `POST /v1/sandboxes/{id}/ports/revoke`: revoke one URL by its token, or every URL of a port,
|
|
3584
|
+
* with what it names in the body. The token never travels in a URL.
|
|
3585
|
+
*/
|
|
3586
|
+
export interface PortRevoke {
|
|
3587
|
+
/**
|
|
3588
|
+
* A port: every URL minted for it is revoked. Exactly one of `token` and `port`.
|
|
3589
|
+
*/
|
|
3590
|
+
port?: number | null;
|
|
3591
|
+
/**
|
|
3592
|
+
* The token of the one URL to revoke.
|
|
3593
|
+
*/
|
|
3594
|
+
token?: string | null;
|
|
3104
3595
|
}
|
|
3105
3596
|
/**
|
|
3106
3597
|
* `POST /v1/billing/portal` — a link to the billing portal.
|
|
@@ -3109,7 +3600,7 @@ export interface PortalSession {
|
|
|
3109
3600
|
url: string;
|
|
3110
3601
|
}
|
|
3111
3602
|
/**
|
|
3112
|
-
* `DELETE /v1/sandboxes/{id}/ports/{token_or_port}`.
|
|
3603
|
+
* `POST /v1/sandboxes/{id}/ports/revoke` and `DELETE /v1/sandboxes/{id}/ports/{token_or_port}`.
|
|
3113
3604
|
*/
|
|
3114
3605
|
export interface PortsRevoked {
|
|
3115
3606
|
ok: boolean;
|
|
@@ -3201,8 +3692,8 @@ export interface PricingLimits {
|
|
|
3201
3692
|
export interface PricingPlan {
|
|
3202
3693
|
display_name: string;
|
|
3203
3694
|
/**
|
|
3204
|
-
*
|
|
3205
|
-
*
|
|
3695
|
+
* The trial's limits apply until a card not already used by another organization is added, or
|
|
3696
|
+
* credits are bought.
|
|
3206
3697
|
*/
|
|
3207
3698
|
on_trial: boolean;
|
|
3208
3699
|
/**
|
|
@@ -3311,7 +3802,12 @@ export interface PricingView {
|
|
|
3311
3802
|
*/
|
|
3312
3803
|
granularity_seconds: number;
|
|
3313
3804
|
/**
|
|
3314
|
-
*
|
|
3805
|
+
* For how many paid months the plan adds `included_credits_usd`; `null` when it adds them every
|
|
3806
|
+
* paid month.
|
|
3807
|
+
*/
|
|
3808
|
+
included_credits_promo_months?: number | null;
|
|
3809
|
+
/**
|
|
3810
|
+
* Credits the plan adds each paid month, USD.
|
|
3315
3811
|
*/
|
|
3316
3812
|
included_credits_usd: number;
|
|
3317
3813
|
limits: PricingLimits;
|
|
@@ -3386,11 +3882,22 @@ export interface ProjectMoved {
|
|
|
3386
3882
|
* `PATCH /v1/orgs/{org}/projects/{project}`: at least one field.
|
|
3387
3883
|
*/
|
|
3388
3884
|
export interface ProjectPatch {
|
|
3885
|
+
/**
|
|
3886
|
+
* Keep a failed sandbox so it can be reopened where it broke, when a run does not say
|
|
3887
|
+
* (`capture`): `true` or `false`; `null` = the next level's setting. Set by an owner, on its
|
|
3888
|
+
* own (no other field in the same request).
|
|
3889
|
+
*/
|
|
3890
|
+
failure_captures?: boolean | null;
|
|
3389
3891
|
/**
|
|
3390
3892
|
* A monthly spending cap in USD, 0–1000000; `null` removes the cap.
|
|
3391
3893
|
*/
|
|
3392
3894
|
monthly_cap_usd?: number | null;
|
|
3393
3895
|
name?: string | null;
|
|
3896
|
+
/**
|
|
3897
|
+
* Days this project's command output (what its commands ran and printed) is kept after its
|
|
3898
|
+
* sandbox ends, 1–30; `null` = the organization's setting. Set by an owner.
|
|
3899
|
+
*/
|
|
3900
|
+
output_retention_days?: number | null;
|
|
3394
3901
|
}
|
|
3395
3902
|
/**
|
|
3396
3903
|
* One project. API keys belong to a project; a project holds any number of repositories.
|
|
@@ -3404,6 +3911,11 @@ export interface ProjectView {
|
|
|
3404
3911
|
* True for the project every organization starts with. It cannot be renamed or deleted.
|
|
3405
3912
|
*/
|
|
3406
3913
|
default: boolean;
|
|
3914
|
+
/**
|
|
3915
|
+
* Whether this project's failed sandboxes are kept to reopen, when a run does not say
|
|
3916
|
+
* (`capture`); `null` = the organization's setting. Set by an owner.
|
|
3917
|
+
*/
|
|
3918
|
+
failure_captures?: boolean | null;
|
|
3407
3919
|
/**
|
|
3408
3920
|
* Keys that still work.
|
|
3409
3921
|
*/
|
|
@@ -3425,6 +3937,11 @@ export interface ProjectView {
|
|
|
3425
3937
|
monthly_cap_usd?: number | null;
|
|
3426
3938
|
name: string;
|
|
3427
3939
|
org_id: string;
|
|
3940
|
+
/**
|
|
3941
|
+
* Days this project's command output is kept after a sandbox ends; `null` = the
|
|
3942
|
+
* organization's setting. Set by an owner.
|
|
3943
|
+
*/
|
|
3944
|
+
output_retention_days?: number | null;
|
|
3428
3945
|
project_id: string;
|
|
3429
3946
|
}
|
|
3430
3947
|
export interface Provenance {
|
|
@@ -3522,12 +4039,13 @@ export interface ReferralApplied {
|
|
|
3522
4039
|
*/
|
|
3523
4040
|
qualifying_plans: Array<string>;
|
|
3524
4041
|
/**
|
|
3525
|
-
* Compute credit this organization gets
|
|
4042
|
+
* Compute credit this organization gets (or got) once it first pays at least this much, for
|
|
4043
|
+
* credits or a plan, USD.
|
|
3526
4044
|
*/
|
|
3527
4045
|
reward_usd: number;
|
|
3528
4046
|
/**
|
|
3529
|
-
* `pending` (your credit comes with your first
|
|
3530
|
-
* sign-in only — `not_applied`.
|
|
4047
|
+
* `pending` (your credit comes with your first payment of at least the reward), `under_review`,
|
|
4048
|
+
* or — at sign-in only — `not_applied`.
|
|
3531
4049
|
*/
|
|
3532
4050
|
status: string;
|
|
3533
4051
|
}
|
|
@@ -3582,7 +4100,8 @@ export interface ReferralOffer {
|
|
|
3582
4100
|
*/
|
|
3583
4101
|
get_usd: number;
|
|
3584
4102
|
/**
|
|
3585
|
-
* Compute credit the friend gets
|
|
4103
|
+
* Compute credit the friend gets once they first pay at least this much, for credits or a plan,
|
|
4104
|
+
* USD.
|
|
3586
4105
|
*/
|
|
3587
4106
|
give_usd: number;
|
|
3588
4107
|
/**
|
|
@@ -3638,7 +4157,8 @@ export interface ReferralStatus {
|
|
|
3638
4157
|
*/
|
|
3639
4158
|
export interface ReferredBy {
|
|
3640
4159
|
/**
|
|
3641
|
-
* Compute credit this organization gets (or got)
|
|
4160
|
+
* Compute credit this organization gets (or got) once it first pays at least this much, for
|
|
4161
|
+
* credits or a plan, USD.
|
|
3642
4162
|
*/
|
|
3643
4163
|
reward_usd: number;
|
|
3644
4164
|
/**
|
|
@@ -3667,6 +4187,11 @@ export interface ReplayStats {
|
|
|
3667
4187
|
success_pct: number;
|
|
3668
4188
|
}
|
|
3669
4189
|
export interface Requested {
|
|
4190
|
+
/**
|
|
4191
|
+
* With `network: "allow"`: the only destinations the run's sandboxes may reach, as the run
|
|
4192
|
+
* named them. Absent for the other modes.
|
|
4193
|
+
*/
|
|
4194
|
+
allow?: Array<string>;
|
|
3670
4195
|
allow_partial: boolean;
|
|
3671
4196
|
count: number;
|
|
3672
4197
|
/**
|
|
@@ -4245,6 +4770,12 @@ export interface Sandbox {
|
|
|
4245
4770
|
*/
|
|
4246
4771
|
holdout_passed?: boolean | null;
|
|
4247
4772
|
holdout_score?: number | null;
|
|
4773
|
+
/**
|
|
4774
|
+
* `PROMIGENCE_INDEX`: this sandbox's place in its run, from 0. A retry, a replay or a
|
|
4775
|
+
* reopened failure keeps its original's. Absent when the run's command set the variable
|
|
4776
|
+
* itself.
|
|
4777
|
+
*/
|
|
4778
|
+
index?: number | null;
|
|
4248
4779
|
/**
|
|
4249
4780
|
* True when this is a one-time wait: once the waiting sandboxes can start, the rest of the
|
|
4250
4781
|
* run starts at once too. False otherwise.
|
|
@@ -4272,6 +4803,12 @@ export interface Sandbox {
|
|
|
4272
4803
|
retry_of?: string | null;
|
|
4273
4804
|
sandbox_id: string;
|
|
4274
4805
|
score?: number | null;
|
|
4806
|
+
/**
|
|
4807
|
+
* `PROMIGENCE_SEED`: the number this sandbox's commands were given in that variable. A
|
|
4808
|
+
* retry, a replay or a reopened failure keeps its original's. Absent when the run's command
|
|
4809
|
+
* set the variable itself.
|
|
4810
|
+
*/
|
|
4811
|
+
seed?: number | null;
|
|
4275
4812
|
state: SandboxState;
|
|
4276
4813
|
t_end?: string | null;
|
|
4277
4814
|
t_handoff?: string | null;
|
|
@@ -4284,6 +4821,33 @@ export interface Sandbox {
|
|
|
4284
4821
|
warm_measured?: WarmMeasured | null;
|
|
4285
4822
|
warnings?: Array<string>;
|
|
4286
4823
|
}
|
|
4824
|
+
/**
|
|
4825
|
+
* What one sandbox holds of the credits.
|
|
4826
|
+
*/
|
|
4827
|
+
export interface SandboxCreditHold {
|
|
4828
|
+
/**
|
|
4829
|
+
* How long it has run, in milliseconds.
|
|
4830
|
+
*/
|
|
4831
|
+
elapsed_ms: number;
|
|
4832
|
+
/**
|
|
4833
|
+
* When its timeout ends it, RFC 3339; `null` while it is paused.
|
|
4834
|
+
*/
|
|
4835
|
+
ends_at?: string | null;
|
|
4836
|
+
/**
|
|
4837
|
+
* What it may still use, USD.
|
|
4838
|
+
*/
|
|
4839
|
+
held_usd: number;
|
|
4840
|
+
sandbox_id: string;
|
|
4841
|
+
/**
|
|
4842
|
+
* `running` or `paused`.
|
|
4843
|
+
*/
|
|
4844
|
+
state: string;
|
|
4845
|
+
/**
|
|
4846
|
+
* Its timeout, in milliseconds, counted from its hand-over: `PATCH /v1/sandboxes/{id}`
|
|
4847
|
+
* `timeout_ms` shortens it.
|
|
4848
|
+
*/
|
|
4849
|
+
timeout_ms: number;
|
|
4850
|
+
}
|
|
4287
4851
|
/**
|
|
4288
4852
|
* The sandbox's new lifetime and what it costs.
|
|
4289
4853
|
*/
|
|
@@ -4406,7 +4970,8 @@ export interface SandboxPatch {
|
|
|
4406
4970
|
*/
|
|
4407
4971
|
auto_pause_s?: number | null;
|
|
4408
4972
|
/**
|
|
4409
|
-
* The new lifetime in milliseconds, counted from
|
|
4973
|
+
* The sandbox's new lifetime in milliseconds, counted from its hand-over. A longer one extends
|
|
4974
|
+
* it; a shorter one is accepted down to the time it has run plus 60 seconds.
|
|
4410
4975
|
*/
|
|
4411
4976
|
timeout_ms?: number | null;
|
|
4412
4977
|
}
|
|
@@ -4777,6 +5342,29 @@ export interface SandboxView {
|
|
|
4777
5342
|
verify_each_ms?: number | null;
|
|
4778
5343
|
warnings: Array<string>;
|
|
4779
5344
|
}
|
|
5345
|
+
/**
|
|
5346
|
+
* `POST /v1/sandboxes/resume`.
|
|
5347
|
+
*/
|
|
5348
|
+
export interface SandboxesResume {
|
|
5349
|
+
/**
|
|
5350
|
+
* `credits`: every sandbox paused because credits ran out.
|
|
5351
|
+
*/
|
|
5352
|
+
paused_for: string;
|
|
5353
|
+
}
|
|
5354
|
+
/**
|
|
5355
|
+
* `POST /v1/sandboxes/resume` — Resume every sandbox paused because credits ran out. Each resume
|
|
5356
|
+
* is checked like new work. The answer says how many resumed and how many still need credits.
|
|
5357
|
+
*/
|
|
5358
|
+
export interface SandboxesResumed {
|
|
5359
|
+
/**
|
|
5360
|
+
* The sandboxes that resumed.
|
|
5361
|
+
*/
|
|
5362
|
+
resumed: Array<string>;
|
|
5363
|
+
/**
|
|
5364
|
+
* The sandboxes still paused because credits do not cover them.
|
|
5365
|
+
*/
|
|
5366
|
+
still_need_credits: Array<string>;
|
|
5367
|
+
}
|
|
4780
5368
|
/**
|
|
4781
5369
|
* How the grader's result is read.
|
|
4782
5370
|
*/
|
|
@@ -4842,7 +5430,7 @@ export interface SearchMatch {
|
|
|
4842
5430
|
text?: string | null;
|
|
4843
5431
|
}
|
|
4844
5432
|
/**
|
|
4845
|
-
* The reply to `
|
|
5433
|
+
* The reply to `POST /v1/sandboxes/:id/files/search`.
|
|
4846
5434
|
*/
|
|
4847
5435
|
export interface SearchResult {
|
|
4848
5436
|
matches: Array<SearchMatch>;
|
|
@@ -5150,6 +5738,11 @@ export interface SessionTrial {
|
|
|
5150
5738
|
*/
|
|
5151
5739
|
export interface SnapshotAliasSet {
|
|
5152
5740
|
alias: string | null;
|
|
5741
|
+
/**
|
|
5742
|
+
* Take the name from the snapshot of the project that has it, which stays, unnamed. Without
|
|
5743
|
+
* it, a name another snapshot has is refused.
|
|
5744
|
+
*/
|
|
5745
|
+
move_alias?: boolean;
|
|
5153
5746
|
}
|
|
5154
5747
|
/**
|
|
5155
5748
|
* What an image occupies in storage: `allocated`, which can be less than its size.
|
|
@@ -5203,6 +5796,11 @@ export interface SnapshotCreate {
|
|
|
5203
5796
|
* A container image, `REF@sha256:<digest>`; a tag is resolved to its digest first.
|
|
5204
5797
|
*/
|
|
5205
5798
|
image?: string | null;
|
|
5799
|
+
/**
|
|
5800
|
+
* With `alias`: take the name from the snapshot of the project that has it, which stays,
|
|
5801
|
+
* unnamed. Without it, an `alias` another snapshot has is refused and nothing is built.
|
|
5802
|
+
*/
|
|
5803
|
+
move_alias?: boolean;
|
|
5206
5804
|
/**
|
|
5207
5805
|
* `github:` repositories: a branch, a tag or a commit sha, resolved to the commit it names
|
|
5208
5806
|
* when the build is accepted. Default: the repository's default branch.
|
|
@@ -5273,9 +5871,10 @@ export interface SnapshotDeduped {
|
|
|
5273
5871
|
alias_applied?: boolean | null;
|
|
5274
5872
|
/**
|
|
5275
5873
|
* The alias that was asked for, when the snapshot did not hold it. The snapshot takes it
|
|
5276
|
-
* (`alias_applied: true`) as a new build would: another snapshot of the project
|
|
5277
|
-
*
|
|
5278
|
-
*
|
|
5874
|
+
* (`alias_applied: true`) as a new build would: a name another snapshot of the project has
|
|
5875
|
+
* is taken only with `move_alias`, and that snapshot keeps its row, without a name. A
|
|
5876
|
+
* snapshot has one alias, so a name it had before gives way. `warnings` says which names
|
|
5877
|
+
* moved.
|
|
5279
5878
|
*/
|
|
5280
5879
|
alias_requested?: string | null;
|
|
5281
5880
|
/**
|
|
@@ -6002,8 +6601,8 @@ export interface TrialStatus {
|
|
|
6002
6601
|
*/
|
|
6003
6602
|
credits_reserved: number;
|
|
6004
6603
|
/**
|
|
6005
|
-
* Data out included this month, in GiB: the plan's allowance. Above it, data out is
|
|
6006
|
-
*
|
|
6604
|
+
* Data out included this month, in GiB: the plan's allowance. Above it, data out is paid from
|
|
6605
|
+
* credits and is cut when they run out; `null` when the plan includes none.
|
|
6007
6606
|
*/
|
|
6008
6607
|
egress_gb_cap?: number | null;
|
|
6009
6608
|
/**
|
|
@@ -6021,6 +6620,27 @@ export interface TrialStatus {
|
|
|
6021
6620
|
on_trial: boolean;
|
|
6022
6621
|
policy: TrialPolicy;
|
|
6023
6622
|
}
|
|
6623
|
+
/**
|
|
6624
|
+
* What this organization can buy now.
|
|
6625
|
+
*/
|
|
6626
|
+
export interface TrustLimits {
|
|
6627
|
+
/**
|
|
6628
|
+
* The most purchases and reloads can add today, USD.
|
|
6629
|
+
*/
|
|
6630
|
+
per_day_max_usd: number;
|
|
6631
|
+
/**
|
|
6632
|
+
* The most one purchase can be now, a plan's fee included, USD.
|
|
6633
|
+
*/
|
|
6634
|
+
per_purchase_max_usd: number;
|
|
6635
|
+
/**
|
|
6636
|
+
* The most one auto-reload can add, USD.
|
|
6637
|
+
*/
|
|
6638
|
+
reload_max_usd: number;
|
|
6639
|
+
/**
|
|
6640
|
+
* The most auto-reloads in a day.
|
|
6641
|
+
*/
|
|
6642
|
+
reloads_per_day: number;
|
|
6643
|
+
}
|
|
6024
6644
|
/**
|
|
6025
6645
|
* The payment provider's estimate of the next invoice. Amounts are USD; each is `null` when
|
|
6026
6646
|
* the provider did not state it.
|