@slicervm/sdk 0.1.9 → 0.1.10
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/index.cjs +32 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +32 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -27,6 +27,15 @@ interface VMInfo {
|
|
|
27
27
|
status?: string;
|
|
28
28
|
persistent?: boolean;
|
|
29
29
|
}
|
|
30
|
+
interface VMTagResponse {
|
|
31
|
+
hostname: string;
|
|
32
|
+
tags: string[];
|
|
33
|
+
}
|
|
34
|
+
interface VMTagUpdate {
|
|
35
|
+
add?: string[];
|
|
36
|
+
remove?: string[];
|
|
37
|
+
replace?: string[];
|
|
38
|
+
}
|
|
30
39
|
/**
|
|
31
40
|
* Per-launch network policy override for isolated host groups.
|
|
32
41
|
* Omitted lists inherit the host group's policy. Empty lists intentionally
|
|
@@ -650,6 +659,7 @@ interface VMInit {
|
|
|
650
659
|
ip?: string;
|
|
651
660
|
createdAt?: string;
|
|
652
661
|
arch?: string;
|
|
662
|
+
tags?: string[];
|
|
653
663
|
}
|
|
654
664
|
declare class CommittedVM {
|
|
655
665
|
private readonly transport;
|
|
@@ -672,10 +682,16 @@ declare class VM {
|
|
|
672
682
|
readonly ip?: string;
|
|
673
683
|
readonly createdAt?: string;
|
|
674
684
|
readonly arch?: string;
|
|
685
|
+
tags?: string[];
|
|
675
686
|
readonly fs: VMFileSystem;
|
|
676
687
|
readonly bg: VMBg;
|
|
677
688
|
private readonly transport;
|
|
678
689
|
constructor(transport: TransportClient, init: VMInit);
|
|
690
|
+
getTags(): Promise<string[]>;
|
|
691
|
+
updateTags(update: VMTagUpdate): Promise<string[]>;
|
|
692
|
+
addTags(...tags: string[]): Promise<string[]>;
|
|
693
|
+
removeTags(...tags: string[]): Promise<string[]>;
|
|
694
|
+
replaceTags(tags: string[]): Promise<string[]>;
|
|
679
695
|
delete(): Promise<void>;
|
|
680
696
|
health(): Promise<AgentHealth>;
|
|
681
697
|
logs(): Promise<VMLogs>;
|
|
@@ -1109,4 +1125,4 @@ declare class SlicerShellSession {
|
|
|
1109
1125
|
private teardown;
|
|
1110
1126
|
}
|
|
1111
1127
|
|
|
1112
|
-
export { type AddProxyAllowRequest, type AddressMapping, type AgentHealth, type BgDeleteResponse, type BgExecInfo, type BgExecRequest, type BgExecResponse, type BgKillOptions, type BgKillResponse, type BgLogOptions, type BgWaitExitResponse, CommitsAPI, CommittedVM, type CreateProxyClientOptions, type CreateProxySecretRequest, type CreateSecretRequest, type CreateVMNetworkPolicy, type CreateVMOptions, type CreateVMRequest, type CreateVMResponse, type DeleteResponse, type ExecFrame, type ExecRequest, type ExecResult, type ExecResultBinary, type ExecStdio, ExecStdioBase64, ExecStdioText, FRAME_TYPE_DATA, FRAME_TYPE_HEARTBEAT, FRAME_TYPE_SESSION_CLOSE, FRAME_TYPE_SHUTDOWN, FRAME_TYPE_WINDOW_SIZE, type FSEntry, type FSMkdirRequest, type FSWatchEvent, type FSWatchEventType, type FSWatchRequest, Forwarder, type ForwarderListener, type ForwarderOptions, GiB, type HostGroup, HostGroupsAPI, type ListOptions, MiB, NonRootUser, ProxyAPI, type ProxyAllowRule, ProxyAllowsAPI, type ProxyClient, type ProxyClientCreated, ProxyClientsAPI, type ProxySecret, ProxySecretBasic, ProxySecretBearer, ProxySecretOAuthClientCredentials, type ProxySecretType, ProxySecretsAPI, type RemoveProxyAllowByTupleRequest, type Secret, SecretExistsError, SecretsAPI, type ShellSessionOptions, type ShutdownRequest, SlicerAPIError, SlicerClient, type SlicerClientOptions, type SlicerInfo, SlicerShellSession, type UpdateSecretRequest, VM, VMBg, type VMCommitDeleteResponse, type VMCommitInfo, type VMCommitListOptions, type VMCommitOptions, type VMCommitResponse, type VMDescription, VMFileSystem, type VMForkFixup, type VMForkNetworkPolicy, type VMForkOptions, type VMForkResponse, type VMForkTagMode, type VMForkWait, type VMInfo, type VMInit, type VMLogs, type VMNetworkDescription, type VMNetworkPolicy, type VMSnapshot, type VMStat, VMsAPI, type WaitOptions, type XTermLike, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
|
1128
|
+
export { type AddProxyAllowRequest, type AddressMapping, type AgentHealth, type BgDeleteResponse, type BgExecInfo, type BgExecRequest, type BgExecResponse, type BgKillOptions, type BgKillResponse, type BgLogOptions, type BgWaitExitResponse, CommitsAPI, CommittedVM, type CreateProxyClientOptions, type CreateProxySecretRequest, type CreateSecretRequest, type CreateVMNetworkPolicy, type CreateVMOptions, type CreateVMRequest, type CreateVMResponse, type DeleteResponse, type ExecFrame, type ExecRequest, type ExecResult, type ExecResultBinary, type ExecStdio, ExecStdioBase64, ExecStdioText, FRAME_TYPE_DATA, FRAME_TYPE_HEARTBEAT, FRAME_TYPE_SESSION_CLOSE, FRAME_TYPE_SHUTDOWN, FRAME_TYPE_WINDOW_SIZE, type FSEntry, type FSMkdirRequest, type FSWatchEvent, type FSWatchEventType, type FSWatchRequest, Forwarder, type ForwarderListener, type ForwarderOptions, GiB, type HostGroup, HostGroupsAPI, type ListOptions, MiB, NonRootUser, ProxyAPI, type ProxyAllowRule, ProxyAllowsAPI, type ProxyClient, type ProxyClientCreated, ProxyClientsAPI, type ProxySecret, ProxySecretBasic, ProxySecretBearer, ProxySecretOAuthClientCredentials, type ProxySecretType, ProxySecretsAPI, type RemoveProxyAllowByTupleRequest, type Secret, SecretExistsError, SecretsAPI, type ShellSessionOptions, type ShutdownRequest, SlicerAPIError, SlicerClient, type SlicerClientOptions, type SlicerInfo, SlicerShellSession, type UpdateSecretRequest, VM, VMBg, type VMCommitDeleteResponse, type VMCommitInfo, type VMCommitListOptions, type VMCommitOptions, type VMCommitResponse, type VMDescription, VMFileSystem, type VMForkFixup, type VMForkNetworkPolicy, type VMForkOptions, type VMForkResponse, type VMForkTagMode, type VMForkWait, type VMInfo, type VMInit, type VMLogs, type VMNetworkDescription, type VMNetworkPolicy, type VMSnapshot, type VMStat, type VMTagResponse, type VMTagUpdate, VMsAPI, type WaitOptions, type XTermLike, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,15 @@ interface VMInfo {
|
|
|
27
27
|
status?: string;
|
|
28
28
|
persistent?: boolean;
|
|
29
29
|
}
|
|
30
|
+
interface VMTagResponse {
|
|
31
|
+
hostname: string;
|
|
32
|
+
tags: string[];
|
|
33
|
+
}
|
|
34
|
+
interface VMTagUpdate {
|
|
35
|
+
add?: string[];
|
|
36
|
+
remove?: string[];
|
|
37
|
+
replace?: string[];
|
|
38
|
+
}
|
|
30
39
|
/**
|
|
31
40
|
* Per-launch network policy override for isolated host groups.
|
|
32
41
|
* Omitted lists inherit the host group's policy. Empty lists intentionally
|
|
@@ -650,6 +659,7 @@ interface VMInit {
|
|
|
650
659
|
ip?: string;
|
|
651
660
|
createdAt?: string;
|
|
652
661
|
arch?: string;
|
|
662
|
+
tags?: string[];
|
|
653
663
|
}
|
|
654
664
|
declare class CommittedVM {
|
|
655
665
|
private readonly transport;
|
|
@@ -672,10 +682,16 @@ declare class VM {
|
|
|
672
682
|
readonly ip?: string;
|
|
673
683
|
readonly createdAt?: string;
|
|
674
684
|
readonly arch?: string;
|
|
685
|
+
tags?: string[];
|
|
675
686
|
readonly fs: VMFileSystem;
|
|
676
687
|
readonly bg: VMBg;
|
|
677
688
|
private readonly transport;
|
|
678
689
|
constructor(transport: TransportClient, init: VMInit);
|
|
690
|
+
getTags(): Promise<string[]>;
|
|
691
|
+
updateTags(update: VMTagUpdate): Promise<string[]>;
|
|
692
|
+
addTags(...tags: string[]): Promise<string[]>;
|
|
693
|
+
removeTags(...tags: string[]): Promise<string[]>;
|
|
694
|
+
replaceTags(tags: string[]): Promise<string[]>;
|
|
679
695
|
delete(): Promise<void>;
|
|
680
696
|
health(): Promise<AgentHealth>;
|
|
681
697
|
logs(): Promise<VMLogs>;
|
|
@@ -1109,4 +1125,4 @@ declare class SlicerShellSession {
|
|
|
1109
1125
|
private teardown;
|
|
1110
1126
|
}
|
|
1111
1127
|
|
|
1112
|
-
export { type AddProxyAllowRequest, type AddressMapping, type AgentHealth, type BgDeleteResponse, type BgExecInfo, type BgExecRequest, type BgExecResponse, type BgKillOptions, type BgKillResponse, type BgLogOptions, type BgWaitExitResponse, CommitsAPI, CommittedVM, type CreateProxyClientOptions, type CreateProxySecretRequest, type CreateSecretRequest, type CreateVMNetworkPolicy, type CreateVMOptions, type CreateVMRequest, type CreateVMResponse, type DeleteResponse, type ExecFrame, type ExecRequest, type ExecResult, type ExecResultBinary, type ExecStdio, ExecStdioBase64, ExecStdioText, FRAME_TYPE_DATA, FRAME_TYPE_HEARTBEAT, FRAME_TYPE_SESSION_CLOSE, FRAME_TYPE_SHUTDOWN, FRAME_TYPE_WINDOW_SIZE, type FSEntry, type FSMkdirRequest, type FSWatchEvent, type FSWatchEventType, type FSWatchRequest, Forwarder, type ForwarderListener, type ForwarderOptions, GiB, type HostGroup, HostGroupsAPI, type ListOptions, MiB, NonRootUser, ProxyAPI, type ProxyAllowRule, ProxyAllowsAPI, type ProxyClient, type ProxyClientCreated, ProxyClientsAPI, type ProxySecret, ProxySecretBasic, ProxySecretBearer, ProxySecretOAuthClientCredentials, type ProxySecretType, ProxySecretsAPI, type RemoveProxyAllowByTupleRequest, type Secret, SecretExistsError, SecretsAPI, type ShellSessionOptions, type ShutdownRequest, SlicerAPIError, SlicerClient, type SlicerClientOptions, type SlicerInfo, SlicerShellSession, type UpdateSecretRequest, VM, VMBg, type VMCommitDeleteResponse, type VMCommitInfo, type VMCommitListOptions, type VMCommitOptions, type VMCommitResponse, type VMDescription, VMFileSystem, type VMForkFixup, type VMForkNetworkPolicy, type VMForkOptions, type VMForkResponse, type VMForkTagMode, type VMForkWait, type VMInfo, type VMInit, type VMLogs, type VMNetworkDescription, type VMNetworkPolicy, type VMSnapshot, type VMStat, VMsAPI, type WaitOptions, type XTermLike, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
|
1128
|
+
export { type AddProxyAllowRequest, type AddressMapping, type AgentHealth, type BgDeleteResponse, type BgExecInfo, type BgExecRequest, type BgExecResponse, type BgKillOptions, type BgKillResponse, type BgLogOptions, type BgWaitExitResponse, CommitsAPI, CommittedVM, type CreateProxyClientOptions, type CreateProxySecretRequest, type CreateSecretRequest, type CreateVMNetworkPolicy, type CreateVMOptions, type CreateVMRequest, type CreateVMResponse, type DeleteResponse, type ExecFrame, type ExecRequest, type ExecResult, type ExecResultBinary, type ExecStdio, ExecStdioBase64, ExecStdioText, FRAME_TYPE_DATA, FRAME_TYPE_HEARTBEAT, FRAME_TYPE_SESSION_CLOSE, FRAME_TYPE_SHUTDOWN, FRAME_TYPE_WINDOW_SIZE, type FSEntry, type FSMkdirRequest, type FSWatchEvent, type FSWatchEventType, type FSWatchRequest, Forwarder, type ForwarderListener, type ForwarderOptions, GiB, type HostGroup, HostGroupsAPI, type ListOptions, MiB, NonRootUser, ProxyAPI, type ProxyAllowRule, ProxyAllowsAPI, type ProxyClient, type ProxyClientCreated, ProxyClientsAPI, type ProxySecret, ProxySecretBasic, ProxySecretBearer, ProxySecretOAuthClientCredentials, type ProxySecretType, ProxySecretsAPI, type RemoveProxyAllowByTupleRequest, type Secret, SecretExistsError, SecretsAPI, type ShellSessionOptions, type ShutdownRequest, SlicerAPIError, SlicerClient, type SlicerClientOptions, type SlicerInfo, SlicerShellSession, type UpdateSecretRequest, VM, VMBg, type VMCommitDeleteResponse, type VMCommitInfo, type VMCommitListOptions, type VMCommitOptions, type VMCommitResponse, type VMDescription, VMFileSystem, type VMForkFixup, type VMForkNetworkPolicy, type VMForkOptions, type VMForkResponse, type VMForkTagMode, type VMForkWait, type VMInfo, type VMInit, type VMLogs, type VMNetworkDescription, type VMNetworkPolicy, type VMSnapshot, type VMStat, type VMTagResponse, type VMTagUpdate, VMsAPI, type WaitOptions, type XTermLike, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
package/dist/index.js
CHANGED
|
@@ -866,6 +866,7 @@ var VM = class {
|
|
|
866
866
|
ip;
|
|
867
867
|
createdAt;
|
|
868
868
|
arch;
|
|
869
|
+
tags;
|
|
869
870
|
fs;
|
|
870
871
|
bg;
|
|
871
872
|
transport;
|
|
@@ -876,10 +877,37 @@ var VM = class {
|
|
|
876
877
|
if (init.ip !== void 0) this.ip = init.ip;
|
|
877
878
|
if (init.createdAt !== void 0) this.createdAt = init.createdAt;
|
|
878
879
|
if (init.arch !== void 0) this.arch = init.arch;
|
|
880
|
+
if (init.tags !== void 0) this.tags = init.tags;
|
|
879
881
|
this.fs = new VMFileSystem(transport, this.hostname);
|
|
880
882
|
this.bg = new VMBg(transport, this.hostname);
|
|
881
883
|
}
|
|
882
884
|
// --- lifecycle --------------------------------------------------------
|
|
885
|
+
async getTags() {
|
|
886
|
+
const response = await this.transport.request(
|
|
887
|
+
"GET",
|
|
888
|
+
`/vm/${encodeURIComponent(this.hostname)}/tags`
|
|
889
|
+
);
|
|
890
|
+
this.tags = response.tags;
|
|
891
|
+
return response.tags;
|
|
892
|
+
}
|
|
893
|
+
async updateTags(update) {
|
|
894
|
+
const response = await this.transport.request(
|
|
895
|
+
"PATCH",
|
|
896
|
+
`/vm/${encodeURIComponent(this.hostname)}/tags`,
|
|
897
|
+
update
|
|
898
|
+
);
|
|
899
|
+
this.tags = response.tags;
|
|
900
|
+
return response.tags;
|
|
901
|
+
}
|
|
902
|
+
async addTags(...tags) {
|
|
903
|
+
return this.updateTags({ add: tags });
|
|
904
|
+
}
|
|
905
|
+
async removeTags(...tags) {
|
|
906
|
+
return this.updateTags({ remove: tags });
|
|
907
|
+
}
|
|
908
|
+
async replaceTags(tags) {
|
|
909
|
+
return this.updateTags({ replace: tags });
|
|
910
|
+
}
|
|
883
911
|
async delete() {
|
|
884
912
|
await this.transport.request(
|
|
885
913
|
"DELETE",
|
|
@@ -1336,7 +1364,8 @@ var VMsAPI = class {
|
|
|
1336
1364
|
hostGroup: res.hostGroup ?? hostGroup,
|
|
1337
1365
|
...res.ip !== void 0 && { ip: res.ip },
|
|
1338
1366
|
...res.createdAt !== void 0 && { createdAt: res.createdAt },
|
|
1339
|
-
...res.arch !== void 0 && { arch: res.arch }
|
|
1367
|
+
...res.arch !== void 0 && { arch: res.arch },
|
|
1368
|
+
...req.tags !== void 0 && { tags: [...req.tags] }
|
|
1340
1369
|
});
|
|
1341
1370
|
}
|
|
1342
1371
|
/**
|
|
@@ -1356,7 +1385,8 @@ var VMsAPI = class {
|
|
|
1356
1385
|
hostGroup: found.hostGroup ?? "",
|
|
1357
1386
|
...found.ip !== void 0 && { ip: found.ip },
|
|
1358
1387
|
...found.createdAt !== void 0 && { createdAt: found.createdAt },
|
|
1359
|
-
...found.arch !== void 0 && { arch: found.arch }
|
|
1388
|
+
...found.arch !== void 0 && { arch: found.arch },
|
|
1389
|
+
...found.tags !== void 0 && { tags: found.tags }
|
|
1360
1390
|
});
|
|
1361
1391
|
}
|
|
1362
1392
|
/** Return raw VM metadata across all host groups. */
|