@archildata/client 0.8.7 → 0.8.8

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.
Binary file
@@ -102,6 +102,28 @@ interface paths {
102
102
  patch?: never;
103
103
  trace?: never;
104
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
+ };
105
127
  "/api/tokens": {
106
128
  parameters: {
107
129
  query?: never;
@@ -552,6 +574,29 @@ interface components {
552
574
  token?: string;
553
575
  };
554
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
+ };
595
+ ApiResponse_ExecDisk: {
596
+ /** @example true */
597
+ success: boolean;
598
+ data: components["schemas"]["ExecDiskResult"];
599
+ };
555
600
  };
556
601
  responses: {
557
602
  /** @description Invalid or missing authentication credentials */
@@ -807,6 +852,46 @@ interface operations {
807
852
  500: components["responses"]["InternalError"];
808
853
  };
809
854
  };
855
+ execDisk: {
856
+ parameters: {
857
+ query?: never;
858
+ header?: never;
859
+ path: {
860
+ /** @description Disk ID (format `dsk-{16 hex chars}`) */
861
+ id: components["parameters"]["DiskId"];
862
+ };
863
+ cookie?: never;
864
+ };
865
+ requestBody: {
866
+ content: {
867
+ "application/json": components["schemas"]["ExecDiskRequest"];
868
+ };
869
+ };
870
+ responses: {
871
+ /** @description Command completed */
872
+ 200: {
873
+ headers: {
874
+ [name: string]: unknown;
875
+ };
876
+ content: {
877
+ "application/json": components["schemas"]["ApiResponse_ExecDisk"];
878
+ };
879
+ };
880
+ 400: components["responses"]["ValidationError"];
881
+ 401: components["responses"]["Unauthorized"];
882
+ 404: components["responses"]["NotFound"];
883
+ 500: components["responses"]["InternalError"];
884
+ /** @description Command timed out */
885
+ 504: {
886
+ headers: {
887
+ [name: string]: unknown;
888
+ };
889
+ content: {
890
+ "application/json": components["schemas"]["ErrorResponse"];
891
+ };
892
+ };
893
+ };
894
+ };
810
895
  listApiTokens: {
811
896
  parameters: {
812
897
  query?: {
@@ -917,6 +1002,20 @@ interface MountOptions {
917
1002
  serverAddress?: string;
918
1003
  insecure?: boolean;
919
1004
  }
1005
+ interface ExecTiming {
1006
+ /** End-to-end wall-clock measured on the server (from request arrival to response). */
1007
+ totalMs: number;
1008
+ /** Time spent queueing, scheduling, booting/claiming a VM, and mounting the filesystem. */
1009
+ queueMs: number;
1010
+ /** Time the user's command itself ran, measured by the runtime. */
1011
+ executeMs: number;
1012
+ }
1013
+ interface ExecResult {
1014
+ exitCode: number;
1015
+ stdout: string;
1016
+ stderr: string;
1017
+ timing: ExecTiming;
1018
+ }
920
1019
  declare class Disk {
921
1020
  readonly id: string;
922
1021
  readonly name: string;
@@ -947,6 +1046,11 @@ declare class Disk {
947
1046
  }>;
948
1047
  removeTokenUser(identifier: string): Promise<void>;
949
1048
  delete(): Promise<void>;
1049
+ /**
1050
+ * Execute a command in a container with this disk mounted.
1051
+ * Blocks until the command completes and returns stdout, stderr, and exit code.
1052
+ */
1053
+ exec(command: string): Promise<ExecResult>;
950
1054
  /**
951
1055
  * Connect to this disk's data plane via the native ArchilClient.
952
1056
  *
@@ -1019,4 +1123,4 @@ declare class ArchilApiError extends Error {
1019
1123
  constructor(message: string, status: number, code?: string);
1020
1124
  }
1021
1125
 
1022
- 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 GCSMount, type ListDisksOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type R2Mount, type S3CompatibleMount, type S3Mount, type TokenUser, Tokens };
1126
+ 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 };
@@ -102,6 +102,28 @@ interface paths {
102
102
  patch?: never;
103
103
  trace?: never;
104
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
+ };
105
127
  "/api/tokens": {
106
128
  parameters: {
107
129
  query?: never;
@@ -552,6 +574,29 @@ interface components {
552
574
  token?: string;
553
575
  };
554
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
+ };
595
+ ApiResponse_ExecDisk: {
596
+ /** @example true */
597
+ success: boolean;
598
+ data: components["schemas"]["ExecDiskResult"];
599
+ };
555
600
  };
556
601
  responses: {
557
602
  /** @description Invalid or missing authentication credentials */
@@ -807,6 +852,46 @@ interface operations {
807
852
  500: components["responses"]["InternalError"];
808
853
  };
809
854
  };
855
+ execDisk: {
856
+ parameters: {
857
+ query?: never;
858
+ header?: never;
859
+ path: {
860
+ /** @description Disk ID (format `dsk-{16 hex chars}`) */
861
+ id: components["parameters"]["DiskId"];
862
+ };
863
+ cookie?: never;
864
+ };
865
+ requestBody: {
866
+ content: {
867
+ "application/json": components["schemas"]["ExecDiskRequest"];
868
+ };
869
+ };
870
+ responses: {
871
+ /** @description Command completed */
872
+ 200: {
873
+ headers: {
874
+ [name: string]: unknown;
875
+ };
876
+ content: {
877
+ "application/json": components["schemas"]["ApiResponse_ExecDisk"];
878
+ };
879
+ };
880
+ 400: components["responses"]["ValidationError"];
881
+ 401: components["responses"]["Unauthorized"];
882
+ 404: components["responses"]["NotFound"];
883
+ 500: components["responses"]["InternalError"];
884
+ /** @description Command timed out */
885
+ 504: {
886
+ headers: {
887
+ [name: string]: unknown;
888
+ };
889
+ content: {
890
+ "application/json": components["schemas"]["ErrorResponse"];
891
+ };
892
+ };
893
+ };
894
+ };
810
895
  listApiTokens: {
811
896
  parameters: {
812
897
  query?: {
@@ -917,6 +1002,20 @@ interface MountOptions {
917
1002
  serverAddress?: string;
918
1003
  insecure?: boolean;
919
1004
  }
1005
+ interface ExecTiming {
1006
+ /** End-to-end wall-clock measured on the server (from request arrival to response). */
1007
+ totalMs: number;
1008
+ /** Time spent queueing, scheduling, booting/claiming a VM, and mounting the filesystem. */
1009
+ queueMs: number;
1010
+ /** Time the user's command itself ran, measured by the runtime. */
1011
+ executeMs: number;
1012
+ }
1013
+ interface ExecResult {
1014
+ exitCode: number;
1015
+ stdout: string;
1016
+ stderr: string;
1017
+ timing: ExecTiming;
1018
+ }
920
1019
  declare class Disk {
921
1020
  readonly id: string;
922
1021
  readonly name: string;
@@ -947,6 +1046,11 @@ declare class Disk {
947
1046
  }>;
948
1047
  removeTokenUser(identifier: string): Promise<void>;
949
1048
  delete(): Promise<void>;
1049
+ /**
1050
+ * Execute a command in a container with this disk mounted.
1051
+ * Blocks until the command completes and returns stdout, stderr, and exit code.
1052
+ */
1053
+ exec(command: string): Promise<ExecResult>;
950
1054
  /**
951
1055
  * Connect to this disk's data plane via the native ArchilClient.
952
1056
  *
@@ -1019,4 +1123,4 @@ declare class ArchilApiError extends Error {
1019
1123
  constructor(message: string, status: number, code?: string);
1020
1124
  }
1021
1125
 
1022
- 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 GCSMount, type ListDisksOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type R2Mount, type S3CompatibleMount, type S3Mount, type TokenUser, Tokens };
1126
+ 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 };
package/dist/api/index.js CHANGED
@@ -198,6 +198,21 @@ var Disk = class {
198
198
  })
199
199
  );
200
200
  }
201
+ /**
202
+ * Execute a command in a container with this disk mounted.
203
+ * Blocks until the command completes and returns stdout, stderr, and exit code.
204
+ */
205
+ async exec(command) {
206
+ return unwrap(
207
+ this._client.POST(
208
+ "/api/disks/{id}/exec",
209
+ {
210
+ params: { path: { id: this.id } },
211
+ body: { command }
212
+ }
213
+ )
214
+ );
215
+ }
201
216
  /**
202
217
  * Connect to this disk's data plane via the native ArchilClient.
203
218
  *
@@ -157,6 +157,21 @@ var Disk = class {
157
157
  })
158
158
  );
159
159
  }
160
+ /**
161
+ * Execute a command in a container with this disk mounted.
162
+ * Blocks until the command completes and returns stdout, stderr, and exit code.
163
+ */
164
+ async exec(command) {
165
+ return unwrap(
166
+ this._client.POST(
167
+ "/api/disks/{id}/exec",
168
+ {
169
+ params: { path: { id: this.id } },
170
+ body: { command }
171
+ }
172
+ )
173
+ );
174
+ }
160
175
  /**
161
176
  * Connect to this disk's data plane via the native ArchilClient.
162
177
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archildata/client",
3
- "version": "0.8.7",
3
+ "version": "0.8.8",
4
4
  "description": "High-performance Node.js client for Archil distributed filesystem",
5
5
  "main": "main.js",
6
6
  "types": "main.d.ts",