@archildata/api-types 0.0.98 → 0.0.100

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.
Files changed (2) hide show
  1. package/index.d.ts +305 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -550,6 +550,40 @@ export interface paths {
550
550
  patch?: never;
551
551
  trace?: never;
552
552
  };
553
+ "/api/disks/{id}/checkpoints/{from}/diff/{to}": {
554
+ parameters: {
555
+ query?: never;
556
+ header?: never;
557
+ path?: never;
558
+ cookie?: never;
559
+ };
560
+ /**
561
+ * What changed between two checkpoints
562
+ * @description Lists the paths that changed between two checkpoints of a disk, or
563
+ * of one of its branches, one entry per path, in pages. Each entry
564
+ * gives both sides' modes and symlink targets. Read a file's bytes
565
+ * at a checkpoint from the S3 gateway, as `GET /{disk}/{key}` with
566
+ * `versionId={checkpoint}`, in the bucket `{disk}.{branch}` for a
567
+ * branch. Directories are listed too. A renamed directory is one
568
+ * entry, plus one for each path under it.
569
+ *
570
+ * Pages come in no path order. A page can hold fewer than `max-keys`
571
+ * entries, even none, and still not be the last. Past `max-keys` it
572
+ * holds only more paths of the inode at its end, such as a file's
573
+ * other hard links. Pass `next` back as `continuation-token` until a
574
+ * page has none.
575
+ *
576
+ * Only disks in Archil's flat-block format can be diffed.
577
+ */
578
+ get: operations["getCheckpointDiff"];
579
+ put?: never;
580
+ post?: never;
581
+ delete?: never;
582
+ options?: never;
583
+ head?: never;
584
+ patch?: never;
585
+ trace?: never;
586
+ };
553
587
  "/api/disks/{id}/users": {
554
588
  parameters: {
555
589
  query?: never;
@@ -840,6 +874,26 @@ export interface paths {
840
874
  patch?: never;
841
875
  trace?: never;
842
876
  };
877
+ "/api/exec/{execId}": {
878
+ parameters: {
879
+ query?: never;
880
+ header?: never;
881
+ path?: never;
882
+ cookie?: never;
883
+ };
884
+ /**
885
+ * Get an exec's status and result
886
+ * @description `wait` waits up to that many seconds for the exec to end.
887
+ */
888
+ get: operations["getExec"];
889
+ put?: never;
890
+ post?: never;
891
+ delete?: never;
892
+ options?: never;
893
+ head?: never;
894
+ patch?: never;
895
+ trace?: never;
896
+ };
843
897
  "/api/tokens": {
844
898
  parameters: {
845
899
  query?: never;
@@ -1357,6 +1411,75 @@ export interface components {
1357
1411
  success: boolean;
1358
1412
  data: components["schemas"]["BranchResponse"][];
1359
1413
  };
1414
+ CheckpointDiffApiResponse: {
1415
+ /** @example true */
1416
+ success: boolean;
1417
+ data: components["schemas"]["CheckpointDiffPage"];
1418
+ };
1419
+ CheckpointNotFlushedResponse: {
1420
+ /** @example false */
1421
+ success: boolean;
1422
+ error: string;
1423
+ /** @description Stable machine-readable error code. */
1424
+ code?: string;
1425
+ data?: components["schemas"]["CheckpointFlushBacklog"];
1426
+ };
1427
+ /**
1428
+ * @description How far the disk is from flushing a checkpoint. Retry until the
1429
+ * diff is served; `unflushedCommits` falls as flushes land.
1430
+ */
1431
+ CheckpointFlushBacklog: {
1432
+ /** @description Journal commits up to the checkpoint still to flush. */
1433
+ unflushedCommits: number;
1434
+ /** @description How long the oldest of them has waited. */
1435
+ oldestUnflushedSeconds?: number;
1436
+ };
1437
+ CheckpointDiffPage: {
1438
+ entries: components["schemas"]["CheckpointDiffEntry"][];
1439
+ /** @description Pass as `continuation-token` for the next page. Absent on the last. */
1440
+ next?: string;
1441
+ };
1442
+ CheckpointDiffEntry: {
1443
+ /**
1444
+ * @description `copied` is a rename whose old path another file now holds.
1445
+ * @enum {string}
1446
+ */
1447
+ change: "added" | "removed" | "modified" | "renamed" | "copied";
1448
+ /**
1449
+ * @description A path whose kind changed is a removal and an addition.
1450
+ * @enum {string}
1451
+ */
1452
+ kind: "file" | "directory" | "symlink" | "other";
1453
+ /** @description Where a rename or copy came from. */
1454
+ from?: string;
1455
+ /** @description The path at `to`; for a removal, at `from`. */
1456
+ path: string;
1457
+ old?: components["schemas"]["CheckpointDiffSide"];
1458
+ new?: components["schemas"]["CheckpointDiffSide"];
1459
+ replaced?: components["schemas"]["CheckpointDiffSide"];
1460
+ /**
1461
+ * @description What may differ between `old` and `new`. Without `data`, the
1462
+ * bytes differ only if the sizes do, as after a truncate.
1463
+ */
1464
+ changed?: ("metadata" | "data" | "xattrs")[];
1465
+ };
1466
+ /**
1467
+ * @description One side of a change. `old` is at the `from` checkpoint, at the
1468
+ * entry's `from` if set and else at `path`. `new` is at the `to`
1469
+ * checkpoint, at `path`. `replaced` is what a rename or copy
1470
+ * replaced at `path`, at the `from` checkpoint.
1471
+ */
1472
+ CheckpointDiffSide: {
1473
+ /** @description Permission bits, as `st_mode & 0o7777`. */
1474
+ mode: number;
1475
+ /**
1476
+ * Format: int64
1477
+ * @description In bytes.
1478
+ */
1479
+ size: number;
1480
+ /** @description A symlink's target. */
1481
+ target?: string;
1482
+ };
1360
1483
  ErrorResponse: {
1361
1484
  /** @example false */
1362
1485
  success: boolean;
@@ -3221,6 +3344,16 @@ export interface components {
3221
3344
  /** @description Memory in MiB for the command's VM. Defaults to 4096. Billed as described for `vcpuCount`. */
3222
3345
  memSizeMib?: number;
3223
3346
  network?: components["schemas"]["ExecNetwork"];
3347
+ /**
3348
+ * @description How long the command may run. A request waits up to 4.5 minutes for the result, then answers 202 with the exec's ID.
3349
+ * @default 300
3350
+ */
3351
+ timeoutSeconds: number;
3352
+ /**
3353
+ * @description Answer 202 with the exec's ID instead of waiting for the result.
3354
+ * @default false
3355
+ */
3356
+ async: boolean;
3224
3357
  };
3225
3358
  ExecDiskResult: {
3226
3359
  /**
@@ -3252,6 +3385,38 @@ export interface components {
3252
3385
  */
3253
3386
  executeMs: number;
3254
3387
  };
3388
+ ApiResponse_ExecAccepted: {
3389
+ /** @example true */
3390
+ success: boolean;
3391
+ data: {
3392
+ execId: string;
3393
+ /** @enum {string} */
3394
+ status: "running";
3395
+ };
3396
+ };
3397
+ ExecStatus: {
3398
+ execId: string;
3399
+ /**
3400
+ * @description `completed` when the command exited, whatever its exit code; `failed` when it timed out or couldn't run.
3401
+ * @enum {string}
3402
+ */
3403
+ status: "running" | "stopping" | "completed" | "failed";
3404
+ /** @description The command's exit code, once `completed` */
3405
+ exitCode?: number;
3406
+ /** @description The first 4 MiB of the command's output, once `completed` */
3407
+ stdout?: string;
3408
+ /** @description The first 4 MiB of the command's error output, once `completed` */
3409
+ stderr?: string;
3410
+ /** @description Why the exec `failed` */
3411
+ error?: string;
3412
+ /** @description How long the command ran */
3413
+ executeMs?: number;
3414
+ };
3415
+ ApiResponse_ExecStatus: {
3416
+ /** @example true */
3417
+ success: boolean;
3418
+ data: components["schemas"]["ExecStatus"];
3419
+ };
3255
3420
  ApiResponse_ExecDisk: {
3256
3421
  /** @example true */
3257
3422
  success: boolean;
@@ -3300,6 +3465,16 @@ export interface components {
3300
3465
  /** @description Memory in MiB for the command's VM. Defaults to 4096. Billed as described for `vcpuCount`. */
3301
3466
  memSizeMib?: number;
3302
3467
  network?: components["schemas"]["ExecNetwork"];
3468
+ /**
3469
+ * @description How long the command may run. A request waits up to 4.5 minutes for the result, then answers 202 with the exec's ID.
3470
+ * @default 300
3471
+ */
3472
+ timeoutSeconds: number;
3473
+ /**
3474
+ * @description Answer 202 with the exec's ID instead of waiting for the result.
3475
+ * @default false
3476
+ */
3477
+ async: boolean;
3303
3478
  };
3304
3479
  /**
3305
3480
  * @description Network policy for the command's container, using the sandbox egress
@@ -4936,6 +5111,82 @@ export interface operations {
4936
5111
  };
4937
5112
  };
4938
5113
  };
5114
+ getCheckpointDiff: {
5115
+ parameters: {
5116
+ query?: {
5117
+ /** @description The branch whose checkpoints to diff. Omit for the disk's own. */
5118
+ branch?: components["schemas"]["BranchName"];
5119
+ /** @description The `next` of the page before. */
5120
+ "continuation-token"?: string;
5121
+ /** @description The most entries a page asks for, up to 1000. */
5122
+ "max-keys"?: number;
5123
+ };
5124
+ header?: never;
5125
+ path: {
5126
+ /** @description Disk ID (format `dsk-{16 hex chars}`) */
5127
+ id: components["parameters"]["DiskId"];
5128
+ /** @description The earlier checkpoint's name. */
5129
+ from: string;
5130
+ /** @description The later checkpoint's name. */
5131
+ to: string;
5132
+ };
5133
+ cookie?: never;
5134
+ };
5135
+ requestBody?: never;
5136
+ responses: {
5137
+ /** @description One page of the diff */
5138
+ 200: {
5139
+ headers: {
5140
+ [name: string]: unknown;
5141
+ };
5142
+ content: {
5143
+ "application/json": components["schemas"]["CheckpointDiffApiResponse"];
5144
+ };
5145
+ };
5146
+ 400: components["responses"]["ValidationError"];
5147
+ /** @description Missing or invalid authentication credentials */
5148
+ 401: {
5149
+ headers: {
5150
+ [name: string]: unknown;
5151
+ };
5152
+ content: {
5153
+ "text/plain": string;
5154
+ };
5155
+ };
5156
+ /** @description Disk, branch or checkpoint not found */
5157
+ 404: {
5158
+ headers: {
5159
+ [name: string]: unknown;
5160
+ };
5161
+ content: {
5162
+ "application/json": components["schemas"]["ErrorResponse"];
5163
+ };
5164
+ };
5165
+ 500: components["responses"]["InternalError"];
5166
+ /** @description The disk is not in flat-block format */
5167
+ 501: {
5168
+ headers: {
5169
+ [name: string]: unknown;
5170
+ };
5171
+ content: {
5172
+ "application/json": components["schemas"]["ErrorResponse"];
5173
+ };
5174
+ };
5175
+ /**
5176
+ * @description A checkpoint is not readable yet, as its writes are still being
5177
+ * flushed (code `checkpoint_not_flushed`), or the disk is briefly
5178
+ * unavailable (code `temporarily_unavailable`). Retry.
5179
+ */
5180
+ 503: {
5181
+ headers: {
5182
+ [name: string]: unknown;
5183
+ };
5184
+ content: {
5185
+ "application/json": components["schemas"]["CheckpointNotFlushedResponse"];
5186
+ };
5187
+ };
5188
+ };
5189
+ };
4939
5190
  addDiskUser: {
4940
5191
  parameters: {
4941
5192
  query?: never;
@@ -5286,6 +5537,15 @@ export interface operations {
5286
5537
  "application/json": components["schemas"]["ApiResponse_ExecDisk"];
5287
5538
  };
5288
5539
  };
5540
+ /** @description The command is still running. Get its result from `GET /api/exec/{execId}`. */
5541
+ 202: {
5542
+ headers: {
5543
+ [name: string]: unknown;
5544
+ };
5545
+ content: {
5546
+ "application/json": components["schemas"]["ApiResponse_ExecAccepted"];
5547
+ };
5548
+ };
5289
5549
  400: components["responses"]["ValidationError"];
5290
5550
  401: components["responses"]["Unauthorized"];
5291
5551
  403: components["responses"]["ToolCallAllowanceExhausted"];
@@ -5395,6 +5655,15 @@ export interface operations {
5395
5655
  "application/json": components["schemas"]["ApiResponse_Exec"];
5396
5656
  };
5397
5657
  };
5658
+ /** @description The command is still running. Get its result from `GET /api/exec/{execId}`. */
5659
+ 202: {
5660
+ headers: {
5661
+ [name: string]: unknown;
5662
+ };
5663
+ content: {
5664
+ "application/json": components["schemas"]["ApiResponse_ExecAccepted"];
5665
+ };
5666
+ };
5398
5667
  400: components["responses"]["ValidationError"];
5399
5668
  401: components["responses"]["Unauthorized"];
5400
5669
  403: components["responses"]["ToolCallAllowanceExhausted"];
@@ -5420,6 +5689,42 @@ export interface operations {
5420
5689
  };
5421
5690
  };
5422
5691
  };
5692
+ getExec: {
5693
+ parameters: {
5694
+ query?: {
5695
+ wait?: number;
5696
+ };
5697
+ header?: never;
5698
+ path: {
5699
+ execId: string;
5700
+ };
5701
+ cookie?: never;
5702
+ };
5703
+ requestBody?: never;
5704
+ responses: {
5705
+ /** @description The exec's status, and its result once it has one */
5706
+ 200: {
5707
+ headers: {
5708
+ [name: string]: unknown;
5709
+ };
5710
+ content: {
5711
+ "application/json": components["schemas"]["ApiResponse_ExecStatus"];
5712
+ };
5713
+ };
5714
+ 400: components["responses"]["ValidationError"];
5715
+ 401: components["responses"]["Unauthorized"];
5716
+ /** @description Not allowed to access this exec */
5717
+ 403: {
5718
+ headers: {
5719
+ [name: string]: unknown;
5720
+ };
5721
+ content: {
5722
+ "application/json": components["schemas"]["ErrorResponse"];
5723
+ };
5724
+ };
5725
+ 404: components["responses"]["NotFound"];
5726
+ };
5727
+ };
5423
5728
  listApiTokens: {
5424
5729
  parameters: {
5425
5730
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archildata/api-types",
3
- "version": "0.0.98",
3
+ "version": "0.0.100",
4
4
  "description": "Public API types for Archil",
5
5
  "type": "module",
6
6
  "types": "index.d.ts",