disk 1.10.0 → 1.11.0
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/cli.mjs +2 -2
- package/dist/{disk-DZkPOSQD.d.cts → disk-BmBSYT8h.d.cts} +15 -2
- package/dist/{disk-DZkPOSQD.d.mts → disk-BmBSYT8h.d.mts} +15 -2
- package/dist/index.cjs +18 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/internal/tools.d.cts +1 -1
- package/dist/internal/tools.d.mts +1 -1
- package/dist/sandbox-cli.mjs +2 -2
- package/dist/{sandbox-options-DV7SSadf.mjs → sandbox-options-VBQ-AsOP.mjs} +1 -1
- package/dist/{src-BND_QqPx.mjs → src-BbjR-spO.mjs} +18 -1
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as deleteApiKey, k as ArchilApiError, l as listApiKeys, n as createApiKey, r as createDisk, s as getDisk, t as configure, u as listDisks } from "./src-
|
|
3
|
-
import { a as addGlobalOptions, c as resolveProgramCredentials, l as renderTable, o as addProfileCommands, s as isProfileCommand, t as optionalInteger } from "./sandbox-options-
|
|
2
|
+
import { a as deleteApiKey, k as ArchilApiError, l as listApiKeys, n as createApiKey, r as createDisk, s as getDisk, t as configure, u as listDisks } from "./src-BbjR-spO.mjs";
|
|
3
|
+
import { a as addGlobalOptions, c as resolveProgramCredentials, l as renderTable, o as addProfileCommands, s as isProfileCommand, t as optionalInteger } from "./sandbox-options-VBQ-AsOP.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { Command } from "commander";
|
|
6
6
|
//#region bin/cli.ts
|
|
@@ -65,6 +65,7 @@ type Branch = components["schemas"]["BranchResponse"];
|
|
|
65
65
|
type DiskUser = components["schemas"]["DiskUser"];
|
|
66
66
|
type TokenUser = components["schemas"]["TokenUser"];
|
|
67
67
|
type AwsStsUser = components["schemas"]["AwsStsUser"];
|
|
68
|
+
type S3User = components["schemas"]["S3User"];
|
|
68
69
|
type CreateApiTokenRequest = components["schemas"]["CreateApiTokenRequest"];
|
|
69
70
|
type ApiTokenResponse = components["schemas"]["ApiTokenResponse"];
|
|
70
71
|
type ExecDiskResult = components["schemas"]["ExecDiskResult"];
|
|
@@ -459,12 +460,24 @@ declare class Disk implements FileSystem {
|
|
|
459
460
|
constructor(data: DiskResponse, client: ApiClient, archilRegion: string, s3BaseUrl?: string);
|
|
460
461
|
toJSON(): DiskResponse;
|
|
461
462
|
addUser(user: DiskUser): Promise<AuthorizedUser>;
|
|
462
|
-
removeUser(userType: "token" | "awssts", identifier: string): Promise<void>;
|
|
463
|
+
removeUser(userType: "token" | "awssts" | "s3", identifier: string): Promise<void>;
|
|
463
464
|
createToken(nickname: string): Promise<AuthorizedUser & {
|
|
464
465
|
token: string;
|
|
465
466
|
identifier: string;
|
|
466
467
|
}>;
|
|
467
468
|
removeTokenUser(identifier: string): Promise<void>;
|
|
469
|
+
/**
|
|
470
|
+
* Create an S3 access key pair for this disk's S3 API. The secret key is
|
|
471
|
+
* returned only here. The keys reach the whole disk, read-write unless
|
|
472
|
+
* `readOnly` is set, so keep them server-side and give browsers presigned
|
|
473
|
+
* URLs instead.
|
|
474
|
+
*/
|
|
475
|
+
createS3Credentials(options?: Omit<S3User, "type">): Promise<AuthorizedUser & {
|
|
476
|
+
s3AccessKeyId: string;
|
|
477
|
+
s3SecretKey: string;
|
|
478
|
+
identifier: string;
|
|
479
|
+
}>;
|
|
480
|
+
removeS3Credentials(accessKeyId: string): Promise<void>;
|
|
468
481
|
/**
|
|
469
482
|
* List all delegations currently held on this disk. A delegation grants a
|
|
470
483
|
* client exclusive write access to an inode; it has no ID of its own and is
|
|
@@ -781,4 +794,4 @@ declare class DiskMultipart {
|
|
|
781
794
|
*/
|
|
782
795
|
declare function effectiveUploadPartSize(totalBytes: number, requestedPartSize: number): number;
|
|
783
796
|
//#endregion
|
|
784
|
-
export { MountResponse as $, effectiveUploadPartSize as A, DiskMetrics as B, PosixCreateAttrs as C, ShareUrlOptions as D, S3Object as E, Branch as F, ExecRequest as G, DiskStatus as H, ConnectedClient as I, GrepGroupLine as J, GCSMount as K, CreateApiTokenRequest as L, AuthorizedUser as M, AwsStsUser as N, ShareUrlResult as O, AzureBlobMount as P, MountConfigResponse as Q, CreateDiskRequest as R, PartListing as S, PutObjectResult as T, DiskUser as U, DiskResponse as V, ExecDiskResult as W, GrepStoppedReason as X, GrepMatch as Y, MountConfig as Z, MultipartUpload as _, DeleteObjectsOptions as a,
|
|
797
|
+
export { MountResponse as $, effectiveUploadPartSize as A, DiskMetrics as B, PosixCreateAttrs as C, ShareUrlOptions as D, S3Object as E, Branch as F, ExecRequest as G, DiskStatus as H, ConnectedClient as I, GrepGroupLine as J, GCSMount as K, CreateApiTokenRequest as L, AuthorizedUser as M, AwsStsUser as N, ShareUrlResult as O, AzureBlobMount as P, MountConfigResponse as Q, CreateDiskRequest as R, PartListing as S, PutObjectResult as T, DiskUser as U, DiskResponse as V, ExecDiskResult as W, GrepStoppedReason as X, GrepMatch as Y, MountConfig as Z, MultipartUpload as _, DeleteObjectsOptions as a, TokenUser as at, ObjectMetadata as b, DiskMultipart as c, ArchilTlsOptions as ct, GrepResult as d, R2Mount as et, ListMultipartUploadsOptions as f, MountOptions as g, ListPartsOptions as h, DeleteObjectsError as i, S3User as it, ApiTokenResponse as j, UploadPart as k, ExecResult as l, ListObjectsResult as m, CompletedMultipartUpload as n, S3CompatibleMount as nt, DeleteObjectsResult as o, FileSystem as ot, ListObjectsOptions as p, GrepGroup as q, CreateBranchOptions as r, S3Mount as rt, Disk as s, ApiClient as st, AppendObjectOptions as t, RootAttrs as tt, GrepOptions as u, MultipartUploadListing as v, PutObjectOptions as w, PartInfo as x, MultipartUploadSummary as y, Delegation as z };
|
|
@@ -65,6 +65,7 @@ type Branch = components["schemas"]["BranchResponse"];
|
|
|
65
65
|
type DiskUser = components["schemas"]["DiskUser"];
|
|
66
66
|
type TokenUser = components["schemas"]["TokenUser"];
|
|
67
67
|
type AwsStsUser = components["schemas"]["AwsStsUser"];
|
|
68
|
+
type S3User = components["schemas"]["S3User"];
|
|
68
69
|
type CreateApiTokenRequest = components["schemas"]["CreateApiTokenRequest"];
|
|
69
70
|
type ApiTokenResponse = components["schemas"]["ApiTokenResponse"];
|
|
70
71
|
type ExecDiskResult = components["schemas"]["ExecDiskResult"];
|
|
@@ -459,12 +460,24 @@ declare class Disk implements FileSystem {
|
|
|
459
460
|
constructor(data: DiskResponse, client: ApiClient, archilRegion: string, s3BaseUrl?: string);
|
|
460
461
|
toJSON(): DiskResponse;
|
|
461
462
|
addUser(user: DiskUser): Promise<AuthorizedUser>;
|
|
462
|
-
removeUser(userType: "token" | "awssts", identifier: string): Promise<void>;
|
|
463
|
+
removeUser(userType: "token" | "awssts" | "s3", identifier: string): Promise<void>;
|
|
463
464
|
createToken(nickname: string): Promise<AuthorizedUser & {
|
|
464
465
|
token: string;
|
|
465
466
|
identifier: string;
|
|
466
467
|
}>;
|
|
467
468
|
removeTokenUser(identifier: string): Promise<void>;
|
|
469
|
+
/**
|
|
470
|
+
* Create an S3 access key pair for this disk's S3 API. The secret key is
|
|
471
|
+
* returned only here. The keys reach the whole disk, read-write unless
|
|
472
|
+
* `readOnly` is set, so keep them server-side and give browsers presigned
|
|
473
|
+
* URLs instead.
|
|
474
|
+
*/
|
|
475
|
+
createS3Credentials(options?: Omit<S3User, "type">): Promise<AuthorizedUser & {
|
|
476
|
+
s3AccessKeyId: string;
|
|
477
|
+
s3SecretKey: string;
|
|
478
|
+
identifier: string;
|
|
479
|
+
}>;
|
|
480
|
+
removeS3Credentials(accessKeyId: string): Promise<void>;
|
|
468
481
|
/**
|
|
469
482
|
* List all delegations currently held on this disk. A delegation grants a
|
|
470
483
|
* client exclusive write access to an inode; it has no ID of its own and is
|
|
@@ -781,4 +794,4 @@ declare class DiskMultipart {
|
|
|
781
794
|
*/
|
|
782
795
|
declare function effectiveUploadPartSize(totalBytes: number, requestedPartSize: number): number;
|
|
783
796
|
//#endregion
|
|
784
|
-
export { MountResponse as $, effectiveUploadPartSize as A, DiskMetrics as B, PosixCreateAttrs as C, ShareUrlOptions as D, S3Object as E, Branch as F, ExecRequest as G, DiskStatus as H, ConnectedClient as I, GrepGroupLine as J, GCSMount as K, CreateApiTokenRequest as L, AuthorizedUser as M, AwsStsUser as N, ShareUrlResult as O, AzureBlobMount as P, MountConfigResponse as Q, CreateDiskRequest as R, PartListing as S, PutObjectResult as T, DiskUser as U, DiskResponse as V, ExecDiskResult as W, GrepStoppedReason as X, GrepMatch as Y, MountConfig as Z, MultipartUpload as _, DeleteObjectsOptions as a,
|
|
797
|
+
export { MountResponse as $, effectiveUploadPartSize as A, DiskMetrics as B, PosixCreateAttrs as C, ShareUrlOptions as D, S3Object as E, Branch as F, ExecRequest as G, DiskStatus as H, ConnectedClient as I, GrepGroupLine as J, GCSMount as K, CreateApiTokenRequest as L, AuthorizedUser as M, AwsStsUser as N, ShareUrlResult as O, AzureBlobMount as P, MountConfigResponse as Q, CreateDiskRequest as R, PartListing as S, PutObjectResult as T, DiskUser as U, DiskResponse as V, ExecDiskResult as W, GrepStoppedReason as X, GrepMatch as Y, MountConfig as Z, MultipartUpload as _, DeleteObjectsOptions as a, TokenUser as at, ObjectMetadata as b, DiskMultipart as c, ArchilTlsOptions as ct, GrepResult as d, R2Mount as et, ListMultipartUploadsOptions as f, MountOptions as g, ListPartsOptions as h, DeleteObjectsError as i, S3User as it, ApiTokenResponse as j, UploadPart as k, ExecResult as l, ListObjectsResult as m, CompletedMultipartUpload as n, S3CompatibleMount as nt, DeleteObjectsResult as o, FileSystem as ot, ListObjectsOptions as p, GrepGroup as q, CreateBranchOptions as r, S3Mount as rt, Disk as s, ApiClient as st, AppendObjectOptions as t, RootAttrs as tt, GrepOptions as u, MultipartUploadListing as v, PutObjectOptions as w, PartInfo as x, MultipartUploadSummary as y, Delegation as z };
|
package/dist/index.cjs
CHANGED
|
@@ -163,7 +163,7 @@ function deriveS3BaseUrl(controlBaseUrl) {
|
|
|
163
163
|
}
|
|
164
164
|
//#endregion
|
|
165
165
|
//#region src/version.ts
|
|
166
|
-
const VERSION = "1.
|
|
166
|
+
const VERSION = "1.11.0";
|
|
167
167
|
const USER_AGENT = `archil-js/${VERSION}`;
|
|
168
168
|
//#endregion
|
|
169
169
|
//#region src/client.ts
|
|
@@ -465,6 +465,23 @@ var Disk = class {
|
|
|
465
465
|
await this.removeUser("token", identifier);
|
|
466
466
|
}
|
|
467
467
|
/**
|
|
468
|
+
* Create an S3 access key pair for this disk's S3 API. The secret key is
|
|
469
|
+
* returned only here. The keys reach the whole disk, read-write unless
|
|
470
|
+
* `readOnly` is set, so keep them server-side and give browsers presigned
|
|
471
|
+
* URLs instead.
|
|
472
|
+
*/
|
|
473
|
+
async createS3Credentials(options = {}) {
|
|
474
|
+
const user = await this.addUser({
|
|
475
|
+
...options,
|
|
476
|
+
type: "s3"
|
|
477
|
+
});
|
|
478
|
+
if (!user.s3AccessKeyId || !user.s3SecretKey || !user.identifier) throw new Error("Server did not return generated S3 credentials");
|
|
479
|
+
return user;
|
|
480
|
+
}
|
|
481
|
+
async removeS3Credentials(accessKeyId) {
|
|
482
|
+
await this.removeUser("s3", accessKeyId);
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
468
485
|
* List all delegations currently held on this disk. A delegation grants a
|
|
469
486
|
* client exclusive write access to an inode; it has no ID of its own and is
|
|
470
487
|
* identified by the (clientId, inodeId) pair — pass those to
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as MountResponse, A as effectiveUploadPartSize, B as DiskMetrics, C as PosixCreateAttrs, D as ShareUrlOptions, E as S3Object, F as Branch, G as ExecRequest, H as DiskStatus, I as ConnectedClient, J as GrepGroupLine, K as GCSMount, L as CreateApiTokenRequest, M as AuthorizedUser, N as AwsStsUser, O as ShareUrlResult, P as AzureBlobMount, Q as MountConfigResponse, R as CreateDiskRequest, S as PartListing, T as PutObjectResult, U as DiskUser, V as DiskResponse, W as ExecDiskResult, X as GrepStoppedReason, Y as GrepMatch, Z as MountConfig, _ as MultipartUpload, a as DeleteObjectsOptions, at as
|
|
1
|
+
import { $ as MountResponse, A as effectiveUploadPartSize, B as DiskMetrics, C as PosixCreateAttrs, D as ShareUrlOptions, E as S3Object, F as Branch, G as ExecRequest, H as DiskStatus, I as ConnectedClient, J as GrepGroupLine, K as GCSMount, L as CreateApiTokenRequest, M as AuthorizedUser, N as AwsStsUser, O as ShareUrlResult, P as AzureBlobMount, Q as MountConfigResponse, R as CreateDiskRequest, S as PartListing, T as PutObjectResult, U as DiskUser, V as DiskResponse, W as ExecDiskResult, X as GrepStoppedReason, Y as GrepMatch, Z as MountConfig, _ as MultipartUpload, a as DeleteObjectsOptions, at as TokenUser, b as ObjectMetadata, c as DiskMultipart, ct as ArchilTlsOptions, d as GrepResult, et as R2Mount, f as ListMultipartUploadsOptions, g as MountOptions, h as ListPartsOptions, i as DeleteObjectsError, it as S3User, j as ApiTokenResponse, k as UploadPart, l as ExecResult, m as ListObjectsResult, n as CompletedMultipartUpload, nt as S3CompatibleMount, o as DeleteObjectsResult, ot as FileSystem, p as ListObjectsOptions, q as GrepGroup, r as CreateBranchOptions, rt as S3Mount, s as Disk, st as ApiClient, t as AppendObjectOptions, tt as RootAttrs, u as GrepOptions, v as MultipartUploadListing, w as PutObjectOptions, x as PartInfo, y as MultipartUploadSummary, z as Delegation } from "./disk-BmBSYT8h.cjs";
|
|
2
2
|
import { components } from "@archildata/api-types";
|
|
3
3
|
|
|
4
4
|
//#region src/disks.d.ts
|
|
@@ -775,4 +775,4 @@ declare function exec(opts: ExecOptions): Promise<ExecDiskResult>;
|
|
|
775
775
|
*/
|
|
776
776
|
declare function workspace(mounts: Record<string, ExecMount>): Workspace;
|
|
777
777
|
//#endregion
|
|
778
|
-
export { type ApiTokenResponse, type AppendObjectOptions, Archil, ArchilApiError, ArchilError, type ArchilOptions, ArchilS3Error, type ArchilTlsOptions, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type Branch, type BuildImageOptions, type BuildImageRequest, type CompletedMultipartUpload, type ConnectedClient, type CreateApiTokenRequest, type CreateBranchOptions, type CreateDiskRequest, type CreateDiskResult, type CreateSandboxPortTokenOptions, type CreateSandboxRequest, type CreatedSandboxPortToken, type Delegation, type DeleteObjectsError, type DeleteObjectsOptions, type DeleteObjectsResult, Disk, type DiskListPage, type DiskMetrics, DiskMultipart, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecMount, type ExecMountSpec, type ExecOptions, type ExecRequest, type ExecResult, type FileSystem, type GCSMount, type GrepGroup, type GrepGroupLine, type GrepMatch, type GrepOptions, type GrepResult, type GrepStoppedReason, type Image, ImageBuildError, type ImageFailureReason, type ImageStatus, Images, type ListDisksOptions, type ListMultipartUploadsOptions, type ListObjectsOptions, type ListObjectsResult, type ListPartsOptions, type ListSandboxPortTokensOptions, type ListSandboxesOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type MultipartUpload, type MultipartUploadListing, type MultipartUploadSummary, type ObjectMetadata, type PartInfo, type PartListing, type PosixCreateAttrs, type PutObjectOptions, type PutObjectResult, type R2Mount, type RegistryAuth, type RootAttrs, type S3CompatibleMount, type S3Mount, type S3Object, Sandbox, type SandboxEgressPolicy, type SandboxEgressRule, type SandboxEgressTransform, type SandboxEndpoint, type SandboxFileSource, SandboxFileTransferError, type SandboxFileUploadOptions, type SandboxFileWriter, SandboxFiles, type SandboxForkOptions, type SandboxMount, type SandboxMountSpec, type SandboxNetwork, type SandboxNetworkAction, SandboxPauseError, type SandboxPortToken, type SandboxPortTokenPage, SandboxProcess, type SandboxProcessConnectOptions, type SandboxProcessOutput, type SandboxProcessOutputHandler, type SandboxProcessResult, type SandboxProcessStartOptions, type SandboxProcessStatus, type SandboxProcessStream, SandboxProcesses, type SandboxResponse, type SandboxStartOptions, type SandboxStatus, type SandboxTerminalOptions, type SandboxTimeoutOptions, type SandboxWaitOptions, Sandboxes, type ShareUrlOptions, type ShareUrlResult, type TokenUser, Tokens, USER_AGENT, type UploadPart, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|
|
778
|
+
export { type ApiTokenResponse, type AppendObjectOptions, Archil, ArchilApiError, ArchilError, type ArchilOptions, ArchilS3Error, type ArchilTlsOptions, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type Branch, type BuildImageOptions, type BuildImageRequest, type CompletedMultipartUpload, type ConnectedClient, type CreateApiTokenRequest, type CreateBranchOptions, type CreateDiskRequest, type CreateDiskResult, type CreateSandboxPortTokenOptions, type CreateSandboxRequest, type CreatedSandboxPortToken, type Delegation, type DeleteObjectsError, type DeleteObjectsOptions, type DeleteObjectsResult, Disk, type DiskListPage, type DiskMetrics, DiskMultipart, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecMount, type ExecMountSpec, type ExecOptions, type ExecRequest, type ExecResult, type FileSystem, type GCSMount, type GrepGroup, type GrepGroupLine, type GrepMatch, type GrepOptions, type GrepResult, type GrepStoppedReason, type Image, ImageBuildError, type ImageFailureReason, type ImageStatus, Images, type ListDisksOptions, type ListMultipartUploadsOptions, type ListObjectsOptions, type ListObjectsResult, type ListPartsOptions, type ListSandboxPortTokensOptions, type ListSandboxesOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type MultipartUpload, type MultipartUploadListing, type MultipartUploadSummary, type ObjectMetadata, type PartInfo, type PartListing, type PosixCreateAttrs, type PutObjectOptions, type PutObjectResult, type R2Mount, type RegistryAuth, type RootAttrs, type S3CompatibleMount, type S3Mount, type S3Object, type S3User, Sandbox, type SandboxEgressPolicy, type SandboxEgressRule, type SandboxEgressTransform, type SandboxEndpoint, type SandboxFileSource, SandboxFileTransferError, type SandboxFileUploadOptions, type SandboxFileWriter, SandboxFiles, type SandboxForkOptions, type SandboxMount, type SandboxMountSpec, type SandboxNetwork, type SandboxNetworkAction, SandboxPauseError, type SandboxPortToken, type SandboxPortTokenPage, SandboxProcess, type SandboxProcessConnectOptions, type SandboxProcessOutput, type SandboxProcessOutputHandler, type SandboxProcessResult, type SandboxProcessStartOptions, type SandboxProcessStatus, type SandboxProcessStream, SandboxProcesses, type SandboxResponse, type SandboxStartOptions, type SandboxStatus, type SandboxTerminalOptions, type SandboxTimeoutOptions, type SandboxWaitOptions, Sandboxes, type ShareUrlOptions, type ShareUrlResult, type TokenUser, Tokens, USER_AGENT, type UploadPart, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as MountResponse, A as effectiveUploadPartSize, B as DiskMetrics, C as PosixCreateAttrs, D as ShareUrlOptions, E as S3Object, F as Branch, G as ExecRequest, H as DiskStatus, I as ConnectedClient, J as GrepGroupLine, K as GCSMount, L as CreateApiTokenRequest, M as AuthorizedUser, N as AwsStsUser, O as ShareUrlResult, P as AzureBlobMount, Q as MountConfigResponse, R as CreateDiskRequest, S as PartListing, T as PutObjectResult, U as DiskUser, V as DiskResponse, W as ExecDiskResult, X as GrepStoppedReason, Y as GrepMatch, Z as MountConfig, _ as MultipartUpload, a as DeleteObjectsOptions, at as
|
|
1
|
+
import { $ as MountResponse, A as effectiveUploadPartSize, B as DiskMetrics, C as PosixCreateAttrs, D as ShareUrlOptions, E as S3Object, F as Branch, G as ExecRequest, H as DiskStatus, I as ConnectedClient, J as GrepGroupLine, K as GCSMount, L as CreateApiTokenRequest, M as AuthorizedUser, N as AwsStsUser, O as ShareUrlResult, P as AzureBlobMount, Q as MountConfigResponse, R as CreateDiskRequest, S as PartListing, T as PutObjectResult, U as DiskUser, V as DiskResponse, W as ExecDiskResult, X as GrepStoppedReason, Y as GrepMatch, Z as MountConfig, _ as MultipartUpload, a as DeleteObjectsOptions, at as TokenUser, b as ObjectMetadata, c as DiskMultipart, ct as ArchilTlsOptions, d as GrepResult, et as R2Mount, f as ListMultipartUploadsOptions, g as MountOptions, h as ListPartsOptions, i as DeleteObjectsError, it as S3User, j as ApiTokenResponse, k as UploadPart, l as ExecResult, m as ListObjectsResult, n as CompletedMultipartUpload, nt as S3CompatibleMount, o as DeleteObjectsResult, ot as FileSystem, p as ListObjectsOptions, q as GrepGroup, r as CreateBranchOptions, rt as S3Mount, s as Disk, st as ApiClient, t as AppendObjectOptions, tt as RootAttrs, u as GrepOptions, v as MultipartUploadListing, w as PutObjectOptions, x as PartInfo, y as MultipartUploadSummary, z as Delegation } from "./disk-BmBSYT8h.mjs";
|
|
2
2
|
import { components } from "@archildata/api-types";
|
|
3
3
|
|
|
4
4
|
//#region src/disks.d.ts
|
|
@@ -775,4 +775,4 @@ declare function exec(opts: ExecOptions): Promise<ExecDiskResult>;
|
|
|
775
775
|
*/
|
|
776
776
|
declare function workspace(mounts: Record<string, ExecMount>): Workspace;
|
|
777
777
|
//#endregion
|
|
778
|
-
export { type ApiTokenResponse, type AppendObjectOptions, Archil, ArchilApiError, ArchilError, type ArchilOptions, ArchilS3Error, type ArchilTlsOptions, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type Branch, type BuildImageOptions, type BuildImageRequest, type CompletedMultipartUpload, type ConnectedClient, type CreateApiTokenRequest, type CreateBranchOptions, type CreateDiskRequest, type CreateDiskResult, type CreateSandboxPortTokenOptions, type CreateSandboxRequest, type CreatedSandboxPortToken, type Delegation, type DeleteObjectsError, type DeleteObjectsOptions, type DeleteObjectsResult, Disk, type DiskListPage, type DiskMetrics, DiskMultipart, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecMount, type ExecMountSpec, type ExecOptions, type ExecRequest, type ExecResult, type FileSystem, type GCSMount, type GrepGroup, type GrepGroupLine, type GrepMatch, type GrepOptions, type GrepResult, type GrepStoppedReason, type Image, ImageBuildError, type ImageFailureReason, type ImageStatus, Images, type ListDisksOptions, type ListMultipartUploadsOptions, type ListObjectsOptions, type ListObjectsResult, type ListPartsOptions, type ListSandboxPortTokensOptions, type ListSandboxesOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type MultipartUpload, type MultipartUploadListing, type MultipartUploadSummary, type ObjectMetadata, type PartInfo, type PartListing, type PosixCreateAttrs, type PutObjectOptions, type PutObjectResult, type R2Mount, type RegistryAuth, type RootAttrs, type S3CompatibleMount, type S3Mount, type S3Object, Sandbox, type SandboxEgressPolicy, type SandboxEgressRule, type SandboxEgressTransform, type SandboxEndpoint, type SandboxFileSource, SandboxFileTransferError, type SandboxFileUploadOptions, type SandboxFileWriter, SandboxFiles, type SandboxForkOptions, type SandboxMount, type SandboxMountSpec, type SandboxNetwork, type SandboxNetworkAction, SandboxPauseError, type SandboxPortToken, type SandboxPortTokenPage, SandboxProcess, type SandboxProcessConnectOptions, type SandboxProcessOutput, type SandboxProcessOutputHandler, type SandboxProcessResult, type SandboxProcessStartOptions, type SandboxProcessStatus, type SandboxProcessStream, SandboxProcesses, type SandboxResponse, type SandboxStartOptions, type SandboxStatus, type SandboxTerminalOptions, type SandboxTimeoutOptions, type SandboxWaitOptions, Sandboxes, type ShareUrlOptions, type ShareUrlResult, type TokenUser, Tokens, USER_AGENT, type UploadPart, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|
|
778
|
+
export { type ApiTokenResponse, type AppendObjectOptions, Archil, ArchilApiError, ArchilError, type ArchilOptions, ArchilS3Error, type ArchilTlsOptions, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type Branch, type BuildImageOptions, type BuildImageRequest, type CompletedMultipartUpload, type ConnectedClient, type CreateApiTokenRequest, type CreateBranchOptions, type CreateDiskRequest, type CreateDiskResult, type CreateSandboxPortTokenOptions, type CreateSandboxRequest, type CreatedSandboxPortToken, type Delegation, type DeleteObjectsError, type DeleteObjectsOptions, type DeleteObjectsResult, Disk, type DiskListPage, type DiskMetrics, DiskMultipart, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecMount, type ExecMountSpec, type ExecOptions, type ExecRequest, type ExecResult, type FileSystem, type GCSMount, type GrepGroup, type GrepGroupLine, type GrepMatch, type GrepOptions, type GrepResult, type GrepStoppedReason, type Image, ImageBuildError, type ImageFailureReason, type ImageStatus, Images, type ListDisksOptions, type ListMultipartUploadsOptions, type ListObjectsOptions, type ListObjectsResult, type ListPartsOptions, type ListSandboxPortTokensOptions, type ListSandboxesOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type MultipartUpload, type MultipartUploadListing, type MultipartUploadSummary, type ObjectMetadata, type PartInfo, type PartListing, type PosixCreateAttrs, type PutObjectOptions, type PutObjectResult, type R2Mount, type RegistryAuth, type RootAttrs, type S3CompatibleMount, type S3Mount, type S3Object, type S3User, Sandbox, type SandboxEgressPolicy, type SandboxEgressRule, type SandboxEgressTransform, type SandboxEndpoint, type SandboxFileSource, SandboxFileTransferError, type SandboxFileUploadOptions, type SandboxFileWriter, SandboxFiles, type SandboxForkOptions, type SandboxMount, type SandboxMountSpec, type SandboxNetwork, type SandboxNetworkAction, SandboxPauseError, type SandboxPortToken, type SandboxPortTokenPage, SandboxProcess, type SandboxProcessConnectOptions, type SandboxProcessOutput, type SandboxProcessOutputHandler, type SandboxProcessResult, type SandboxProcessStartOptions, type SandboxProcessStatus, type SandboxProcessStream, SandboxProcesses, type SandboxResponse, type SandboxStartOptions, type SandboxStatus, type SandboxTerminalOptions, type SandboxTimeoutOptions, type SandboxWaitOptions, Sandboxes, type ShareUrlOptions, type ShareUrlResult, type TokenUser, Tokens, USER_AGENT, type UploadPart, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as ArchilError, C as Disk, D as VERSION, E as USER_AGENT, M as ImageBuildError, N as SandboxFileTransferError, P as SandboxPauseError, S as Disks, T as effectiveUploadPartSize, _ as Sandbox, a as deleteApiKey, b as SandboxProcesses, c as getSandbox, d as listSandboxes, f as workspace, g as Sandboxes, h as Tokens, i as createSandbox, j as ArchilS3Error, k as ArchilApiError, l as listApiKeys, m as Workspace, n as createApiKey, o as exec, p as Archil, r as createDisk, s as getDisk, t as configure, u as listDisks, v as SandboxFiles, w as DiskMultipart, x as Images, y as SandboxProcess } from "./src-
|
|
1
|
+
import { A as ArchilError, C as Disk, D as VERSION, E as USER_AGENT, M as ImageBuildError, N as SandboxFileTransferError, P as SandboxPauseError, S as Disks, T as effectiveUploadPartSize, _ as Sandbox, a as deleteApiKey, b as SandboxProcesses, c as getSandbox, d as listSandboxes, f as workspace, g as Sandboxes, h as Tokens, i as createSandbox, j as ArchilS3Error, k as ArchilApiError, l as listApiKeys, m as Workspace, n as createApiKey, o as exec, p as Archil, r as createDisk, s as getDisk, t as configure, u as listDisks, v as SandboxFiles, w as DiskMultipart, x as Images, y as SandboxProcess } from "./src-BbjR-spO.mjs";
|
|
2
2
|
export { Archil, ArchilApiError, ArchilError, ArchilS3Error, Disk, DiskMultipart, Disks, ImageBuildError, Images, Sandbox, SandboxFileTransferError, SandboxFiles, SandboxPauseError, SandboxProcess, SandboxProcesses, Sandboxes, Tokens, USER_AGENT, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|
package/dist/sandbox-cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { k as ArchilApiError, p as Archil } from "./src-
|
|
3
|
-
import { a as addGlobalOptions, c as resolveProgramCredentials, i as validateSandboxName, l as renderTable, n as parseCreateSandboxOptions, o as addProfileCommands, r as parseRunOptions, s as isProfileCommand } from "./sandbox-options-
|
|
2
|
+
import { k as ArchilApiError, p as Archil } from "./src-BbjR-spO.mjs";
|
|
3
|
+
import { a as addGlobalOptions, c as resolveProgramCredentials, i as validateSandboxName, l as renderTable, n as parseCreateSandboxOptions, o as addProfileCommands, r as parseRunOptions, s as isProfileCommand } from "./sandbox-options-VBQ-AsOP.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { Command } from "commander";
|
|
6
6
|
import { spinner } from "@clack/prompts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as REGION_URLS, p as Archil } from "./src-
|
|
1
|
+
import { O as REGION_URLS, p as Archil } from "./src-BbjR-spO.mjs";
|
|
2
2
|
import { Option } from "commander";
|
|
3
3
|
import { isCancel, password, spinner } from "@clack/prompts";
|
|
4
4
|
import { chmod, mkdir, open, readFile, rename, rm, stat } from "node:fs/promises";
|
|
@@ -140,7 +140,7 @@ function deriveS3BaseUrl(controlBaseUrl) {
|
|
|
140
140
|
}
|
|
141
141
|
//#endregion
|
|
142
142
|
//#region src/version.ts
|
|
143
|
-
const VERSION = "1.
|
|
143
|
+
const VERSION = "1.11.0";
|
|
144
144
|
const USER_AGENT = `archil-js/${VERSION}`;
|
|
145
145
|
//#endregion
|
|
146
146
|
//#region src/client.ts
|
|
@@ -442,6 +442,23 @@ var Disk = class {
|
|
|
442
442
|
await this.removeUser("token", identifier);
|
|
443
443
|
}
|
|
444
444
|
/**
|
|
445
|
+
* Create an S3 access key pair for this disk's S3 API. The secret key is
|
|
446
|
+
* returned only here. The keys reach the whole disk, read-write unless
|
|
447
|
+
* `readOnly` is set, so keep them server-side and give browsers presigned
|
|
448
|
+
* URLs instead.
|
|
449
|
+
*/
|
|
450
|
+
async createS3Credentials(options = {}) {
|
|
451
|
+
const user = await this.addUser({
|
|
452
|
+
...options,
|
|
453
|
+
type: "s3"
|
|
454
|
+
});
|
|
455
|
+
if (!user.s3AccessKeyId || !user.s3SecretKey || !user.identifier) throw new Error("Server did not return generated S3 credentials");
|
|
456
|
+
return user;
|
|
457
|
+
}
|
|
458
|
+
async removeS3Credentials(accessKeyId) {
|
|
459
|
+
await this.removeUser("s3", accessKeyId);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
445
462
|
* List all delegations currently held on this disk. A delegation grants a
|
|
446
463
|
* client exclusive write access to an inode; it has no ID of its own and is
|
|
447
464
|
* identified by the (clientId, inodeId) pair — pass those to
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "disk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Pure-JS client and CLIs for Archil disks and sandboxes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"archil",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"LICENSE"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@archildata/api-types": "^0.0.
|
|
43
|
+
"@archildata/api-types": "^0.0.78",
|
|
44
44
|
"@clack/prompts": "^1.7.0",
|
|
45
45
|
"commander": "^14.0.3",
|
|
46
46
|
"fast-xml-parser": "^5.7.0",
|