disk 0.8.0 → 0.8.9

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.
@@ -0,0 +1,1145 @@
1
+ import { Client } from 'openapi-fetch';
2
+
3
+ /**
4
+ * This file was auto-generated by openapi-typescript.
5
+ * Do not make direct changes to the file.
6
+ */
7
+
8
+ interface paths {
9
+ "/api/disks": {
10
+ parameters: {
11
+ query?: never;
12
+ header?: never;
13
+ path?: never;
14
+ cookie?: never;
15
+ };
16
+ /**
17
+ * List all disks
18
+ * @description Returns all disks owned by the authenticated account.
19
+ */
20
+ get: operations["listDisks"];
21
+ put?: never;
22
+ /**
23
+ * Create a new disk
24
+ * @description Creates a new disk with the specified configuration. A default token
25
+ * user is automatically generated and returned in the response, so the
26
+ * disk is immediately mountable. The one-time token appears in
27
+ * `authorizedUsers[].token` and cannot be retrieved again.
28
+ *
29
+ * To provide your own users instead, pass the deprecated `authMethods`
30
+ * field or call AddDiskUser after creation.
31
+ */
32
+ post: operations["createDisk"];
33
+ delete?: never;
34
+ options?: never;
35
+ head?: never;
36
+ patch?: never;
37
+ trace?: never;
38
+ };
39
+ "/api/disks/{id}": {
40
+ parameters: {
41
+ query?: never;
42
+ header?: never;
43
+ path?: never;
44
+ cookie?: never;
45
+ };
46
+ /**
47
+ * Get disk details
48
+ * @description Returns detailed information about a specific disk.
49
+ */
50
+ get: operations["getDisk"];
51
+ put?: never;
52
+ post?: never;
53
+ /**
54
+ * Delete a disk
55
+ * @description Deletes a disk and all associated resources.
56
+ */
57
+ delete: operations["deleteDisk"];
58
+ options?: never;
59
+ head?: never;
60
+ patch?: never;
61
+ trace?: never;
62
+ };
63
+ "/api/disks/{id}/users": {
64
+ parameters: {
65
+ query?: never;
66
+ header?: never;
67
+ path?: never;
68
+ cookie?: never;
69
+ };
70
+ get?: never;
71
+ put?: never;
72
+ /**
73
+ * Add user to disk
74
+ * @description Adds an authorized user to a disk. Users can authenticate via:
75
+ * - **token**: A shared token with a nickname and 4-character suffix
76
+ * - **awssts**: AWS STS role assumption with an IAM principal ARN
77
+ */
78
+ post: operations["addDiskUser"];
79
+ delete?: never;
80
+ options?: never;
81
+ head?: never;
82
+ patch?: never;
83
+ trace?: never;
84
+ };
85
+ "/api/disks/{id}/users/{userType}": {
86
+ parameters: {
87
+ query?: never;
88
+ header?: never;
89
+ path?: never;
90
+ cookie?: never;
91
+ };
92
+ get?: never;
93
+ put?: never;
94
+ post?: never;
95
+ /**
96
+ * Remove user from disk
97
+ * @description Removes an authorized user from a disk.
98
+ */
99
+ delete: operations["removeDiskUser"];
100
+ options?: never;
101
+ head?: never;
102
+ patch?: never;
103
+ trace?: never;
104
+ };
105
+ "/api/disks/{id}/exec": {
106
+ parameters: {
107
+ query?: never;
108
+ header?: never;
109
+ path?: never;
110
+ cookie?: never;
111
+ };
112
+ get?: never;
113
+ put?: never;
114
+ /**
115
+ * Execute a command on a disk
116
+ * @description Launches a container with the specified disk mounted, runs the given
117
+ * command to completion, and shuts down the container. Returns immediately
118
+ * with the container info; poll the container endpoint for completion.
119
+ */
120
+ post: operations["execDisk"];
121
+ delete?: never;
122
+ options?: never;
123
+ head?: never;
124
+ patch?: never;
125
+ trace?: never;
126
+ };
127
+ "/api/tokens": {
128
+ parameters: {
129
+ query?: never;
130
+ header?: never;
131
+ path?: never;
132
+ cookie?: never;
133
+ };
134
+ /**
135
+ * List API tokens
136
+ * @description Returns all API tokens for the authenticated account.
137
+ */
138
+ get: operations["listApiTokens"];
139
+ put?: never;
140
+ /**
141
+ * Create API token
142
+ * @description Creates a new API token for programmatic access. The full token value
143
+ * is only returned once at creation time.
144
+ */
145
+ post: operations["createApiToken"];
146
+ delete?: never;
147
+ options?: never;
148
+ head?: never;
149
+ patch?: never;
150
+ trace?: never;
151
+ };
152
+ "/api/tokens/{id}": {
153
+ parameters: {
154
+ query?: never;
155
+ header?: never;
156
+ path?: never;
157
+ cookie?: never;
158
+ };
159
+ get?: never;
160
+ put?: never;
161
+ post?: never;
162
+ /**
163
+ * Delete API token
164
+ * @description Revokes and deletes an API token.
165
+ */
166
+ delete: operations["deleteApiToken"];
167
+ options?: never;
168
+ head?: never;
169
+ patch?: never;
170
+ trace?: never;
171
+ };
172
+ }
173
+ interface components {
174
+ schemas: {
175
+ ErrorResponse: {
176
+ /** @example false */
177
+ success: boolean;
178
+ /** @example Invalid request parameters */
179
+ error: string;
180
+ };
181
+ ApiResponse_Empty: {
182
+ /** @example true */
183
+ success: boolean;
184
+ };
185
+ ApiResponse_Message: {
186
+ /** @example true */
187
+ success: boolean;
188
+ data: {
189
+ message?: string;
190
+ };
191
+ };
192
+ CreateDiskRequest: {
193
+ /**
194
+ * @description Disk name (alphanumeric, dashes, underscores)
195
+ * @example my-data-disk
196
+ */
197
+ name: string;
198
+ /** @description Storage mount to attach. Omit for archil-managed storage. */
199
+ mounts?: components["schemas"]["MountConfig"][];
200
+ /**
201
+ * @deprecated
202
+ * @description Deprecated. Use AddDiskUser after creation instead. When provided, suppresses the default auto-generated token user.
203
+ */
204
+ authMethods?: components["schemas"]["DiskUser"][];
205
+ };
206
+ MountConfig: components["schemas"]["S3Mount"] | components["schemas"]["GCSMount"] | components["schemas"]["R2Mount"] | components["schemas"]["S3CompatibleMount"] | components["schemas"]["AzureBlobMount"];
207
+ /**
208
+ * S3
209
+ * @description Mount configuration for Amazon S3 buckets
210
+ */
211
+ S3Mount: {
212
+ /**
213
+ * @description Mount type identifier (enum property replaced by openapi-typescript)
214
+ * @enum {string}
215
+ */
216
+ type: "s3";
217
+ /**
218
+ * @description S3 bucket name
219
+ * @example my-bucket
220
+ */
221
+ bucketName: string;
222
+ /** @description AWS access key ID (optional for public buckets or IAM role auth) */
223
+ accessKeyId?: string;
224
+ /**
225
+ * Format: password
226
+ * @description AWS secret access key
227
+ */
228
+ secretAccessKey?: string;
229
+ /** @description Session token for temporary credentials */
230
+ sessionToken?: string;
231
+ /**
232
+ * @description Prefix within the bucket
233
+ * @example data/
234
+ */
235
+ bucketPrefix?: string;
236
+ };
237
+ /**
238
+ * Google Cloud Storage
239
+ * @description Mount configuration for Google Cloud Storage buckets
240
+ */
241
+ GCSMount: {
242
+ /**
243
+ * @description Mount type identifier (enum property replaced by openapi-typescript)
244
+ * @enum {string}
245
+ */
246
+ type: "gcs";
247
+ /**
248
+ * @description GCS bucket name
249
+ * @example my-gcs-bucket
250
+ */
251
+ bucketName: string;
252
+ /** @description HMAC access key ID */
253
+ accessKeyId: string;
254
+ /**
255
+ * Format: password
256
+ * @description HMAC secret access key
257
+ */
258
+ secretAccessKey: string;
259
+ /**
260
+ * @description Prefix within the bucket (optional)
261
+ * @example data/
262
+ */
263
+ bucketPrefix?: string;
264
+ };
265
+ /**
266
+ * Cloudflare R2
267
+ * @description Mount configuration for Cloudflare R2 buckets
268
+ */
269
+ R2Mount: {
270
+ /**
271
+ * @description Mount type identifier (enum property replaced by openapi-typescript)
272
+ * @enum {string}
273
+ */
274
+ type: "r2";
275
+ /**
276
+ * @description R2 bucket name
277
+ * @example my-r2-bucket
278
+ */
279
+ bucketName: string;
280
+ /**
281
+ * @description R2 endpoint URL
282
+ * @example https://accountid.r2.cloudflarestorage.com
283
+ */
284
+ bucketEndpoint: string;
285
+ /** @description R2 access key ID */
286
+ accessKeyId: string;
287
+ /**
288
+ * Format: password
289
+ * @description R2 secret access key
290
+ */
291
+ secretAccessKey: string;
292
+ /**
293
+ * @description Prefix within the bucket (optional)
294
+ * @example data/
295
+ */
296
+ bucketPrefix?: string;
297
+ };
298
+ /**
299
+ * S3-Compatible
300
+ * @description Mount configuration for S3-compatible storage (MinIO, Backblaze B2, etc.)
301
+ */
302
+ S3CompatibleMount: {
303
+ /**
304
+ * @description Mount type identifier (enum property replaced by openapi-typescript)
305
+ * @enum {string}
306
+ */
307
+ type: "s3-compatible";
308
+ /**
309
+ * @description Bucket name
310
+ * @example my-bucket
311
+ */
312
+ bucketName: string;
313
+ /**
314
+ * @description S3-compatible endpoint URL
315
+ * @example https://s3.us-west-001.backblazeb2.com
316
+ */
317
+ bucketEndpoint: string;
318
+ /** @description Access key ID */
319
+ accessKeyId: string;
320
+ /**
321
+ * Format: password
322
+ * @description Secret access key
323
+ */
324
+ secretAccessKey: string;
325
+ /**
326
+ * @description Prefix within the bucket (optional)
327
+ * @example data/
328
+ */
329
+ bucketPrefix?: string;
330
+ };
331
+ /**
332
+ * Azure Blob Storage
333
+ * @description Mount configuration for Azure Blob Storage containers
334
+ */
335
+ AzureBlobMount: {
336
+ /**
337
+ * @description Mount type identifier (enum property replaced by openapi-typescript)
338
+ * @enum {string}
339
+ */
340
+ type: "azure-blob";
341
+ /**
342
+ * @description Azure blob container name
343
+ * @example my-container
344
+ */
345
+ containerName: string;
346
+ /**
347
+ * @description Azure blob endpoint URL (optional if storageAccountName provided)
348
+ * @example https://myaccount.blob.core.windows.net
349
+ */
350
+ endpoint?: string;
351
+ /**
352
+ * @description Azure storage account name (used to derive endpoint if not provided)
353
+ * @example myaccount
354
+ */
355
+ storageAccountName?: string;
356
+ /** @description Azure AD tenant ID */
357
+ tenantId: string;
358
+ /** @description Azure AD application client ID */
359
+ clientId: string;
360
+ /**
361
+ * Format: password
362
+ * @description Azure AD application client secret
363
+ */
364
+ clientSecret: string;
365
+ /**
366
+ * @description Prefix within the container
367
+ * @example data/
368
+ */
369
+ bucketPrefix?: string;
370
+ };
371
+ TokenUser: {
372
+ /**
373
+ * @description discriminator enum property added by openapi-typescript
374
+ * @enum {string}
375
+ */
376
+ type: "token";
377
+ /**
378
+ * @deprecated
379
+ * @description Deprecated. Client-provided token. If omitted, the server generates a cryptographically secure token and returns it in the response.
380
+ */
381
+ principal?: string;
382
+ nickname: string;
383
+ /**
384
+ * @deprecated
385
+ * @description Deprecated. Last 4 characters of the token. Required when principal is provided; ignored when the server generates the token.
386
+ */
387
+ tokenSuffix?: string;
388
+ };
389
+ AwsStsUser: {
390
+ /**
391
+ * @description discriminator enum property added by openapi-typescript
392
+ * @enum {string}
393
+ */
394
+ type: "awssts";
395
+ /** @description IAM principal ARN */
396
+ principal: string;
397
+ };
398
+ DiskUser: components["schemas"]["TokenUser"] | components["schemas"]["AwsStsUser"];
399
+ DiskResponse: {
400
+ /**
401
+ * @description Disk ID
402
+ * @example dsk-0123456789abcdef
403
+ */
404
+ id: string;
405
+ /** @description Disk name */
406
+ name: string;
407
+ /** @description Owning organization ID */
408
+ organization: string;
409
+ /**
410
+ * @description Disk status
411
+ * @enum {string}
412
+ */
413
+ status: "available" | "creating" | "deleting" | "deleted" | "failed";
414
+ /** @description Filesystem handler status */
415
+ fsHandlerStatus?: string;
416
+ /** @description Cloud provider */
417
+ provider: string;
418
+ /** @description Disk region (e.g., aws-us-east-1, gcp-us-central1) */
419
+ region: string;
420
+ /**
421
+ * Format: date-time
422
+ * @description Creation timestamp
423
+ */
424
+ createdAt: string;
425
+ /**
426
+ * Format: date-time
427
+ * @description Last access timestamp
428
+ */
429
+ lastAccessed?: string;
430
+ /**
431
+ * Format: int64
432
+ * @description Total data size in bytes
433
+ */
434
+ dataSize?: number;
435
+ /** @description Monthly usage amount formatted as a currency string (e.g., "$1.23") */
436
+ monthlyUsage?: string;
437
+ mounts?: components["schemas"]["MountResponse"][];
438
+ metrics?: components["schemas"]["DiskMetrics"];
439
+ connectedClients?: components["schemas"]["ConnectedClient"][];
440
+ authorizedUsers?: components["schemas"]["AuthorizedUser"][];
441
+ };
442
+ MountResponse: {
443
+ /** @description Mount identifier */
444
+ id?: string;
445
+ /**
446
+ * @description Storage backend type
447
+ * @enum {string}
448
+ */
449
+ type?: "s3" | "gcs" | "r2" | "s3-compatible" | "azure-blob";
450
+ /** @description Mount path */
451
+ path?: string;
452
+ /** @description Bucket/container name */
453
+ name?: string;
454
+ /**
455
+ * @description Access mode
456
+ * @example rw
457
+ * @enum {string}
458
+ */
459
+ accessMode?: "rw" | "ro";
460
+ config?: components["schemas"]["MountConfigResponse"];
461
+ /**
462
+ * @description Current connection status
463
+ * @enum {string}
464
+ */
465
+ connectionStatus?: "connected" | "disconnected";
466
+ /** @description Authentication error message (if disconnected) */
467
+ authError?: string;
468
+ /**
469
+ * @description How the mount authenticates to the storage backend
470
+ * @enum {string}
471
+ */
472
+ authorizationType?: "iam" | "accessKeys" | "oauth";
473
+ };
474
+ /** @description Mount configuration details (secrets omitted) */
475
+ MountConfigResponse: {
476
+ /** @description Bucket name */
477
+ bucketName?: string;
478
+ /** @description Storage endpoint URL */
479
+ bucketEndpoint?: string;
480
+ /** @description Prefix within the bucket */
481
+ bucketPrefix?: string;
482
+ /** @description Session identifier for IAM-authorized mounts */
483
+ sessionId?: string;
484
+ };
485
+ DiskMetrics: {
486
+ /** @description Data transfer amount with unit (e.g., "1.5 GB") */
487
+ dataTransfer?: string;
488
+ /** @description Total request count as a formatted string (e.g., "1,234") */
489
+ requests?: string;
490
+ /** @description Average response time with unit (e.g., "45ms") */
491
+ avgResponseTime?: string;
492
+ };
493
+ ConnectedClient: {
494
+ id?: string;
495
+ ipAddress?: string;
496
+ /** Format: date-time */
497
+ connectedAt?: string;
498
+ };
499
+ AuthorizedUser: {
500
+ /** @enum {string} */
501
+ type?: "token" | "awssts";
502
+ /**
503
+ * @deprecated
504
+ * @description Use identifier instead. Only populated for awssts type (the IAM ARN).
505
+ */
506
+ principal?: string;
507
+ nickname?: string;
508
+ tokenSuffix?: string;
509
+ /** @description The generated mount token. Only present in the response when the server generates the token (i.e. principal was not provided). This value is shown exactly once and cannot be retrieved again. */
510
+ token?: string;
511
+ /** @description Stable identifier for this user, returned in creation and list responses. Use this value with DELETE /api/disks/{id}/users/{type}?identifier={identifier} to remove the user. For awssts users, this is the IAM ARN. */
512
+ identifier?: string;
513
+ /** Format: date-time */
514
+ createdAt?: string;
515
+ };
516
+ /** @description All API responses use a standard envelope with `success: boolean` and `data` (on success) or `error: string` (on failure). The ApiResponse_* schemas each define the specific `data` shape for their endpoint. */
517
+ ApiResponse_DiskList: {
518
+ /** @example true */
519
+ success: boolean;
520
+ data: components["schemas"]["DiskResponse"][];
521
+ };
522
+ ApiResponse_Disk: {
523
+ /** @example true */
524
+ success: boolean;
525
+ data: components["schemas"]["DiskResponse"];
526
+ };
527
+ ApiResponse_CreateDisk: {
528
+ /** @example true */
529
+ success: boolean;
530
+ data: {
531
+ /** @example dsk-0123456789abcdef */
532
+ diskId?: string;
533
+ authorizedUsers?: components["schemas"]["AuthorizedUser"][];
534
+ };
535
+ };
536
+ ApiResponse_AuthorizedUser: {
537
+ /** @example true */
538
+ success: boolean;
539
+ data: components["schemas"]["AuthorizedUser"];
540
+ };
541
+ CreateApiTokenRequest: {
542
+ /** @description Token name */
543
+ name: string;
544
+ /** @description Token description */
545
+ description?: string;
546
+ };
547
+ ApiTokenResponse: {
548
+ /** @description Token hash/ID */
549
+ id?: string;
550
+ name?: string;
551
+ description?: string;
552
+ /** @description Last 4 characters of the token */
553
+ tokenSuffix?: string;
554
+ /** Format: date-time */
555
+ createdAt?: string;
556
+ /** Format: date-time */
557
+ lastUsedAt?: string;
558
+ };
559
+ ApiResponse_TokenList: {
560
+ /** @example true */
561
+ success: boolean;
562
+ data: {
563
+ tokens?: components["schemas"]["ApiTokenResponse"][];
564
+ };
565
+ };
566
+ ApiResponse_TokenCreated: {
567
+ /** @example true */
568
+ success: boolean;
569
+ data: components["schemas"]["ApiTokenResponse"] & {
570
+ /**
571
+ * @description Full token value (only shown at creation)
572
+ * @example key-abc123...
573
+ */
574
+ token?: string;
575
+ };
576
+ };
577
+ ExecDiskRequest: {
578
+ /**
579
+ * @description Shell command to execute inside the container
580
+ * @example ls -la /mnt/archil
581
+ */
582
+ command: string;
583
+ };
584
+ ExecDiskResult: {
585
+ /**
586
+ * @description Exit code of the command (0 = success)
587
+ * @example 0
588
+ */
589
+ exitCode: number;
590
+ /** @description Standard output from the command */
591
+ stdout: string;
592
+ /** @description Standard error from the command */
593
+ stderr: string;
594
+ timing: components["schemas"]["ExecTiming"];
595
+ };
596
+ /** @description Server-measured timings for an exec request. */
597
+ ExecTiming: {
598
+ /**
599
+ * @description End-to-end wall clock measured on the server, from request arrival to response.
600
+ * @example 2450
601
+ */
602
+ totalMs: number;
603
+ /**
604
+ * @description Time spent queueing, scheduling, booting/claiming a VM, and mounting the filesystem before the command started running.
605
+ * @example 150
606
+ */
607
+ queueMs: number;
608
+ /**
609
+ * @description Time the user's command itself ran, measured by the runtime.
610
+ * @example 2300
611
+ */
612
+ executeMs: number;
613
+ };
614
+ ApiResponse_ExecDisk: {
615
+ /** @example true */
616
+ success: boolean;
617
+ data: components["schemas"]["ExecDiskResult"];
618
+ };
619
+ };
620
+ responses: {
621
+ /** @description Invalid or missing authentication credentials */
622
+ Unauthorized: {
623
+ headers: {
624
+ [name: string]: unknown;
625
+ };
626
+ content: {
627
+ "application/json": components["schemas"]["ErrorResponse"];
628
+ };
629
+ };
630
+ /** @description Validation error */
631
+ ValidationError: {
632
+ headers: {
633
+ [name: string]: unknown;
634
+ };
635
+ content: {
636
+ "application/json": components["schemas"]["ErrorResponse"];
637
+ };
638
+ };
639
+ /** @description Resource not found */
640
+ NotFound: {
641
+ headers: {
642
+ [name: string]: unknown;
643
+ };
644
+ content: {
645
+ "application/json": components["schemas"]["ErrorResponse"];
646
+ };
647
+ };
648
+ /** @description Internal server error */
649
+ InternalError: {
650
+ headers: {
651
+ [name: string]: unknown;
652
+ };
653
+ content: {
654
+ "application/json": components["schemas"]["ErrorResponse"];
655
+ };
656
+ };
657
+ };
658
+ parameters: {
659
+ /** @description Disk ID (format `dsk-{16 hex chars}`) */
660
+ DiskId: string;
661
+ /** @description Maximum number of items to return */
662
+ Limit: number;
663
+ /** @description Pagination cursor from a previous response */
664
+ Cursor: string;
665
+ };
666
+ requestBodies: never;
667
+ headers: never;
668
+ pathItems: never;
669
+ }
670
+ interface operations {
671
+ listDisks: {
672
+ parameters: {
673
+ query?: {
674
+ /** @description Maximum number of items to return */
675
+ limit?: components["parameters"]["Limit"];
676
+ /** @description Pagination cursor from a previous response */
677
+ cursor?: components["parameters"]["Cursor"];
678
+ /** @description Filter disks by exact name match. */
679
+ name?: string;
680
+ };
681
+ header?: never;
682
+ path?: never;
683
+ cookie?: never;
684
+ };
685
+ requestBody?: never;
686
+ responses: {
687
+ /** @description List of disks */
688
+ 200: {
689
+ headers: {
690
+ [name: string]: unknown;
691
+ };
692
+ content: {
693
+ "application/json": components["schemas"]["ApiResponse_DiskList"];
694
+ };
695
+ };
696
+ 401: components["responses"]["Unauthorized"];
697
+ 500: components["responses"]["InternalError"];
698
+ };
699
+ };
700
+ createDisk: {
701
+ parameters: {
702
+ query?: never;
703
+ header?: never;
704
+ path?: never;
705
+ cookie?: never;
706
+ };
707
+ requestBody: {
708
+ content: {
709
+ "application/json": components["schemas"]["CreateDiskRequest"];
710
+ };
711
+ };
712
+ responses: {
713
+ /** @description Disk with this name already exists and configuration matches (idempotent) */
714
+ 200: {
715
+ headers: {
716
+ [name: string]: unknown;
717
+ };
718
+ content: {
719
+ "application/json": components["schemas"]["ApiResponse_CreateDisk"];
720
+ };
721
+ };
722
+ /** @description Disk created successfully */
723
+ 201: {
724
+ headers: {
725
+ [name: string]: unknown;
726
+ };
727
+ content: {
728
+ "application/json": components["schemas"]["ApiResponse_CreateDisk"];
729
+ };
730
+ };
731
+ 400: components["responses"]["ValidationError"];
732
+ 401: components["responses"]["Unauthorized"];
733
+ /** @description Access denied (e.g., preview region not enabled) */
734
+ 403: {
735
+ headers: {
736
+ [name: string]: unknown;
737
+ };
738
+ content: {
739
+ "application/json": components["schemas"]["ErrorResponse"];
740
+ };
741
+ };
742
+ /** @description Disk with this name already exists but configuration differs */
743
+ 409: {
744
+ headers: {
745
+ [name: string]: unknown;
746
+ };
747
+ content: {
748
+ "application/json": components["schemas"]["ErrorResponse"];
749
+ };
750
+ };
751
+ 500: components["responses"]["InternalError"];
752
+ };
753
+ };
754
+ getDisk: {
755
+ parameters: {
756
+ query?: never;
757
+ header?: never;
758
+ path: {
759
+ /** @description Disk ID (format `dsk-{16 hex chars}`) */
760
+ id: components["parameters"]["DiskId"];
761
+ };
762
+ cookie?: never;
763
+ };
764
+ requestBody?: never;
765
+ responses: {
766
+ /** @description Disk details */
767
+ 200: {
768
+ headers: {
769
+ [name: string]: unknown;
770
+ };
771
+ content: {
772
+ "application/json": components["schemas"]["ApiResponse_Disk"];
773
+ };
774
+ };
775
+ 400: components["responses"]["ValidationError"];
776
+ 401: components["responses"]["Unauthorized"];
777
+ 404: components["responses"]["NotFound"];
778
+ 500: components["responses"]["InternalError"];
779
+ };
780
+ };
781
+ deleteDisk: {
782
+ parameters: {
783
+ query?: never;
784
+ header?: never;
785
+ path: {
786
+ /** @description Disk ID (format `dsk-{16 hex chars}`) */
787
+ id: components["parameters"]["DiskId"];
788
+ };
789
+ cookie?: never;
790
+ };
791
+ requestBody?: never;
792
+ responses: {
793
+ /** @description Disk deleted successfully */
794
+ 200: {
795
+ headers: {
796
+ [name: string]: unknown;
797
+ };
798
+ content: {
799
+ "application/json": components["schemas"]["ApiResponse_Empty"];
800
+ };
801
+ };
802
+ 400: components["responses"]["ValidationError"];
803
+ 401: components["responses"]["Unauthorized"];
804
+ 404: components["responses"]["NotFound"];
805
+ 500: components["responses"]["InternalError"];
806
+ };
807
+ };
808
+ addDiskUser: {
809
+ parameters: {
810
+ query?: never;
811
+ header?: never;
812
+ path: {
813
+ /** @description Disk ID (format `dsk-{16 hex chars}`) */
814
+ id: components["parameters"]["DiskId"];
815
+ };
816
+ cookie?: never;
817
+ };
818
+ requestBody: {
819
+ content: {
820
+ "application/json": components["schemas"]["DiskUser"];
821
+ };
822
+ };
823
+ responses: {
824
+ /** @description User added successfully */
825
+ 201: {
826
+ headers: {
827
+ [name: string]: unknown;
828
+ };
829
+ content: {
830
+ "application/json": components["schemas"]["ApiResponse_AuthorizedUser"];
831
+ };
832
+ };
833
+ 400: components["responses"]["ValidationError"];
834
+ 401: components["responses"]["Unauthorized"];
835
+ 500: components["responses"]["InternalError"];
836
+ };
837
+ };
838
+ removeDiskUser: {
839
+ parameters: {
840
+ query?: {
841
+ /** @description Identifier of the user to remove, as returned in the creation or list response. For awssts users, this is the IAM ARN. */
842
+ identifier?: string;
843
+ /**
844
+ * @deprecated
845
+ * @description Use identifier instead.
846
+ */
847
+ principal?: string;
848
+ };
849
+ header?: never;
850
+ path: {
851
+ /** @description Disk ID (format `dsk-{16 hex chars}`) */
852
+ id: components["parameters"]["DiskId"];
853
+ /** @description The type of user authentication */
854
+ userType: "token" | "awssts";
855
+ };
856
+ cookie?: never;
857
+ };
858
+ requestBody?: never;
859
+ responses: {
860
+ /** @description User removed successfully */
861
+ 200: {
862
+ headers: {
863
+ [name: string]: unknown;
864
+ };
865
+ content: {
866
+ "application/json": components["schemas"]["ApiResponse_Message"];
867
+ };
868
+ };
869
+ 400: components["responses"]["ValidationError"];
870
+ 401: components["responses"]["Unauthorized"];
871
+ 500: components["responses"]["InternalError"];
872
+ };
873
+ };
874
+ execDisk: {
875
+ parameters: {
876
+ query?: never;
877
+ header?: never;
878
+ path: {
879
+ /** @description Disk ID (format `dsk-{16 hex chars}`) */
880
+ id: components["parameters"]["DiskId"];
881
+ };
882
+ cookie?: never;
883
+ };
884
+ requestBody: {
885
+ content: {
886
+ "application/json": components["schemas"]["ExecDiskRequest"];
887
+ };
888
+ };
889
+ responses: {
890
+ /** @description Command completed */
891
+ 200: {
892
+ headers: {
893
+ [name: string]: unknown;
894
+ };
895
+ content: {
896
+ "application/json": components["schemas"]["ApiResponse_ExecDisk"];
897
+ };
898
+ };
899
+ 400: components["responses"]["ValidationError"];
900
+ 401: components["responses"]["Unauthorized"];
901
+ 404: components["responses"]["NotFound"];
902
+ 500: components["responses"]["InternalError"];
903
+ /** @description Command timed out */
904
+ 504: {
905
+ headers: {
906
+ [name: string]: unknown;
907
+ };
908
+ content: {
909
+ "application/json": components["schemas"]["ErrorResponse"];
910
+ };
911
+ };
912
+ };
913
+ };
914
+ listApiTokens: {
915
+ parameters: {
916
+ query?: {
917
+ /** @description Maximum number of items to return */
918
+ limit?: components["parameters"]["Limit"];
919
+ /** @description Pagination cursor from a previous response */
920
+ cursor?: components["parameters"]["Cursor"];
921
+ };
922
+ header?: never;
923
+ path?: never;
924
+ cookie?: never;
925
+ };
926
+ requestBody?: never;
927
+ responses: {
928
+ /** @description List of API tokens */
929
+ 200: {
930
+ headers: {
931
+ [name: string]: unknown;
932
+ };
933
+ content: {
934
+ "application/json": components["schemas"]["ApiResponse_TokenList"];
935
+ };
936
+ };
937
+ 401: components["responses"]["Unauthorized"];
938
+ 500: components["responses"]["InternalError"];
939
+ };
940
+ };
941
+ createApiToken: {
942
+ parameters: {
943
+ query?: never;
944
+ header?: never;
945
+ path?: never;
946
+ cookie?: never;
947
+ };
948
+ requestBody: {
949
+ content: {
950
+ "application/json": components["schemas"]["CreateApiTokenRequest"];
951
+ };
952
+ };
953
+ responses: {
954
+ /** @description Token created successfully */
955
+ 201: {
956
+ headers: {
957
+ [name: string]: unknown;
958
+ };
959
+ content: {
960
+ "application/json": components["schemas"]["ApiResponse_TokenCreated"];
961
+ };
962
+ };
963
+ 400: components["responses"]["ValidationError"];
964
+ 401: components["responses"]["Unauthorized"];
965
+ 500: components["responses"]["InternalError"];
966
+ };
967
+ };
968
+ deleteApiToken: {
969
+ parameters: {
970
+ query?: never;
971
+ header?: never;
972
+ path: {
973
+ /** @description The token ID (hash) */
974
+ id: string;
975
+ };
976
+ cookie?: never;
977
+ };
978
+ requestBody?: never;
979
+ responses: {
980
+ /** @description Token deleted successfully */
981
+ 200: {
982
+ headers: {
983
+ [name: string]: unknown;
984
+ };
985
+ content: {
986
+ "application/json": components["schemas"]["ApiResponse_Message"];
987
+ };
988
+ };
989
+ 401: components["responses"]["Unauthorized"];
990
+ 404: components["responses"]["NotFound"];
991
+ 500: components["responses"]["InternalError"];
992
+ };
993
+ };
994
+ }
995
+
996
+ type ApiClient = Client<paths>;
997
+
998
+ type DiskResponse = components["schemas"]["DiskResponse"];
999
+ type MountResponse = components["schemas"]["MountResponse"];
1000
+ type MountConfigResponse = components["schemas"]["MountConfigResponse"];
1001
+ type DiskMetrics = components["schemas"]["DiskMetrics"];
1002
+ type ConnectedClient = components["schemas"]["ConnectedClient"];
1003
+ type AuthorizedUser = components["schemas"]["AuthorizedUser"];
1004
+ type CreateDiskRequest = components["schemas"]["CreateDiskRequest"];
1005
+ type MountConfig = components["schemas"]["MountConfig"];
1006
+ type S3Mount = components["schemas"]["S3Mount"];
1007
+ type GCSMount = components["schemas"]["GCSMount"];
1008
+ type R2Mount = components["schemas"]["R2Mount"];
1009
+ type S3CompatibleMount = components["schemas"]["S3CompatibleMount"];
1010
+ type AzureBlobMount = components["schemas"]["AzureBlobMount"];
1011
+ type DiskUser = components["schemas"]["DiskUser"];
1012
+ type TokenUser = components["schemas"]["TokenUser"];
1013
+ type AwsStsUser = components["schemas"]["AwsStsUser"];
1014
+ type CreateApiTokenRequest = components["schemas"]["CreateApiTokenRequest"];
1015
+ type ApiTokenResponse = components["schemas"]["ApiTokenResponse"];
1016
+ type ExecDiskResult = components["schemas"]["ExecDiskResult"];
1017
+ type DiskStatus = DiskResponse["status"];
1018
+
1019
+ interface MountOptions {
1020
+ authToken?: string;
1021
+ logLevel?: string;
1022
+ serverAddress?: string;
1023
+ insecure?: boolean;
1024
+ }
1025
+ type ExecResult = ExecDiskResult;
1026
+ declare class Disk {
1027
+ readonly id: string;
1028
+ readonly name: string;
1029
+ readonly organization: string;
1030
+ readonly status: DiskStatus;
1031
+ readonly provider: string;
1032
+ readonly region: string;
1033
+ readonly createdAt: string;
1034
+ readonly fsHandlerStatus?: string;
1035
+ readonly lastAccessed?: string;
1036
+ readonly dataSize?: number;
1037
+ readonly monthlyUsage?: string;
1038
+ readonly mounts?: MountResponse[];
1039
+ readonly metrics?: DiskMetrics;
1040
+ readonly connectedClients?: ConnectedClient[];
1041
+ readonly authorizedUsers?: AuthorizedUser[];
1042
+ /** @internal */
1043
+ private readonly _client;
1044
+ /** @internal */
1045
+ private readonly _archilRegion;
1046
+ /** @internal */
1047
+ constructor(data: DiskResponse, client: ApiClient, archilRegion: string);
1048
+ toJSON(): DiskResponse;
1049
+ addUser(user: DiskUser): Promise<AuthorizedUser>;
1050
+ removeUser(userType: "token" | "awssts", identifier: string): Promise<void>;
1051
+ createToken(nickname: string): Promise<AuthorizedUser & {
1052
+ token: string;
1053
+ identifier: string;
1054
+ }>;
1055
+ removeTokenUser(identifier: string): Promise<void>;
1056
+ delete(): Promise<void>;
1057
+ /**
1058
+ * Execute a command in a container with this disk mounted.
1059
+ * Blocks until the command completes and returns stdout, stderr, and exit code.
1060
+ */
1061
+ exec(command: string): Promise<ExecResult>;
1062
+ /**
1063
+ * Connect to this disk's data plane via the native ArchilClient.
1064
+ *
1065
+ * Requires the native module to be available (platform-specific .node binary).
1066
+ */
1067
+ mount(opts?: MountOptions): Promise<unknown>;
1068
+ }
1069
+
1070
+ interface ListDisksOptions {
1071
+ limit?: number;
1072
+ cursor?: string;
1073
+ name?: string;
1074
+ }
1075
+ interface CreateDiskResult {
1076
+ disk: Disk;
1077
+ token: string | null;
1078
+ tokenIdentifier: string | null;
1079
+ authorizedUsers: AuthorizedUser[];
1080
+ }
1081
+ declare class Disks {
1082
+ /** @internal */
1083
+ private readonly _client;
1084
+ /** @internal */
1085
+ private readonly _region;
1086
+ /** @internal */
1087
+ constructor(client: ApiClient, region: string);
1088
+ list(opts?: ListDisksOptions): Promise<Disk[]>;
1089
+ get(id: string): Promise<Disk>;
1090
+ /**
1091
+ * Create a new disk with an auto-generated mount token.
1092
+ *
1093
+ * Returns the Disk, the one-time token (save it — it cannot be retrieved
1094
+ * again), and the token identifier for later management.
1095
+ */
1096
+ create(req: CreateDiskRequest): Promise<CreateDiskResult>;
1097
+ }
1098
+
1099
+ interface ListTokensOptions {
1100
+ limit?: number;
1101
+ cursor?: string;
1102
+ }
1103
+ declare class Tokens {
1104
+ /** @internal */
1105
+ private readonly _client;
1106
+ /** @internal */
1107
+ constructor(client: ApiClient);
1108
+ list(opts?: ListTokensOptions): Promise<ApiTokenResponse[]>;
1109
+ create(req: CreateApiTokenRequest): Promise<ApiTokenResponse & {
1110
+ token?: string;
1111
+ }>;
1112
+ delete(id: string): Promise<void>;
1113
+ }
1114
+
1115
+ interface ArchilOptions {
1116
+ /** API key. Falls back to ARCHIL_API_KEY env var if not provided. */
1117
+ apiKey?: string;
1118
+ /** Region. Falls back to ARCHIL_REGION env var if not provided. */
1119
+ region?: string;
1120
+ /** Override the control plane base URL (useful for testing). */
1121
+ baseUrl?: string;
1122
+ }
1123
+ declare class Archil {
1124
+ readonly disks: Disks;
1125
+ readonly tokens: Tokens;
1126
+ constructor(opts?: ArchilOptions);
1127
+ }
1128
+
1129
+ declare class ArchilApiError extends Error {
1130
+ readonly status: number;
1131
+ readonly code?: string;
1132
+ constructor(message: string, status: number, code?: string);
1133
+ }
1134
+
1135
+ declare function configure(options: ArchilOptions): void;
1136
+ declare function createDisk(req: CreateDiskRequest): Promise<CreateDiskResult>;
1137
+ declare function listDisks(opts?: ListDisksOptions): Promise<Disk[]>;
1138
+ declare function getDisk(id: string): Promise<Disk>;
1139
+ declare function listApiKeys(opts?: ListTokensOptions): Promise<ApiTokenResponse[]>;
1140
+ declare function createApiKey(req: CreateApiTokenRequest): Promise<ApiTokenResponse & {
1141
+ token?: string;
1142
+ }>;
1143
+ declare function deleteApiKey(id: string): Promise<void>;
1144
+
1145
+ export { type ApiTokenResponse, Archil, ArchilApiError, type ArchilOptions, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type ConnectedClient, type CreateApiTokenRequest, type CreateDiskRequest, type CreateDiskResult, Disk, type DiskMetrics, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecResult, type GCSMount, type ListDisksOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type R2Mount, type S3CompatibleMount, type S3Mount, type TokenUser, Tokens, configure, createApiKey, createDisk, deleteApiKey, getDisk, listApiKeys, listDisks };