@slicervm/sdk 0.1.7 → 0.1.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.
- package/README.md +29 -1
- package/dist/index.cjs +227 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +125 -5
- package/dist/index.d.ts +125 -5
- package/dist/index.js +225 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -63,6 +63,7 @@ interface AgentHealth {
|
|
|
63
63
|
agentVersion?: string;
|
|
64
64
|
systemUptime?: number;
|
|
65
65
|
userdataRan?: boolean;
|
|
66
|
+
userdataExitCode?: number;
|
|
66
67
|
}
|
|
67
68
|
interface VMLogs {
|
|
68
69
|
hostname: string;
|
|
@@ -277,6 +278,91 @@ interface FSWatchEvent {
|
|
|
277
278
|
interface ShutdownRequest {
|
|
278
279
|
action?: 'shutdown' | 'reboot';
|
|
279
280
|
}
|
|
281
|
+
interface VMCommitOptions {
|
|
282
|
+
tags?: string[];
|
|
283
|
+
labels?: Record<string, string>;
|
|
284
|
+
cacheKey?: string;
|
|
285
|
+
}
|
|
286
|
+
interface VMCommitResponse {
|
|
287
|
+
hostname: string;
|
|
288
|
+
commitId: string;
|
|
289
|
+
status: string;
|
|
290
|
+
parentStatus?: string;
|
|
291
|
+
mode: string;
|
|
292
|
+
tags?: string[];
|
|
293
|
+
labels?: Record<string, string>;
|
|
294
|
+
cacheKey?: string;
|
|
295
|
+
}
|
|
296
|
+
interface VMCommitListOptions {
|
|
297
|
+
tags?: string[];
|
|
298
|
+
cacheKey?: string;
|
|
299
|
+
source?: string;
|
|
300
|
+
mode?: string;
|
|
301
|
+
}
|
|
302
|
+
interface VMCommitInfo {
|
|
303
|
+
commitId: string;
|
|
304
|
+
sourceHostname: string;
|
|
305
|
+
sourceHostGroup: string;
|
|
306
|
+
createdAt: string;
|
|
307
|
+
mode: string;
|
|
308
|
+
tags?: string[];
|
|
309
|
+
labels?: Record<string, string>;
|
|
310
|
+
cacheKey?: string;
|
|
311
|
+
}
|
|
312
|
+
interface VMCommitDeleteResponse {
|
|
313
|
+
commitId: string;
|
|
314
|
+
status: string;
|
|
315
|
+
}
|
|
316
|
+
/** Isolated-network policy override for a forked VM. */
|
|
317
|
+
interface VMForkNetworkPolicy {
|
|
318
|
+
/** Omit to inherit; pass an empty array to clear the allow list. */
|
|
319
|
+
allow?: string[];
|
|
320
|
+
/** Omit to inherit; pass an empty array to clear the drop list. */
|
|
321
|
+
drop?: string[];
|
|
322
|
+
}
|
|
323
|
+
interface VMForkOptions {
|
|
324
|
+
/** Agent-readiness timeout in seconds. Forks always wait for the child agent. */
|
|
325
|
+
waitTimeoutSec?: number;
|
|
326
|
+
network?: VMForkNetworkPolicy;
|
|
327
|
+
tags?: string[];
|
|
328
|
+
}
|
|
329
|
+
interface VMForkResponse {
|
|
330
|
+
hostname: string;
|
|
331
|
+
sourceHostname: string;
|
|
332
|
+
commitId?: string;
|
|
333
|
+
status: string;
|
|
334
|
+
parentStatus?: string;
|
|
335
|
+
childStatus?: string;
|
|
336
|
+
mode: string;
|
|
337
|
+
}
|
|
338
|
+
interface VMNetworkPolicy {
|
|
339
|
+
allow: string[];
|
|
340
|
+
drop: string[];
|
|
341
|
+
}
|
|
342
|
+
interface VMNetworkDescription {
|
|
343
|
+
mode?: string;
|
|
344
|
+
policySource?: string;
|
|
345
|
+
hostGroup: VMNetworkPolicy;
|
|
346
|
+
override?: CreateVMNetworkPolicy;
|
|
347
|
+
effective: VMNetworkPolicy;
|
|
348
|
+
}
|
|
349
|
+
interface VMDescription {
|
|
350
|
+
hostname: string;
|
|
351
|
+
hostGroup?: string;
|
|
352
|
+
ip?: string;
|
|
353
|
+
ramBytes?: number;
|
|
354
|
+
cpus?: number;
|
|
355
|
+
createdAt?: string;
|
|
356
|
+
arch?: string;
|
|
357
|
+
tags?: string[];
|
|
358
|
+
status?: string;
|
|
359
|
+
persistent?: boolean;
|
|
360
|
+
storage?: string;
|
|
361
|
+
image?: string;
|
|
362
|
+
commitId?: string;
|
|
363
|
+
parentCommitId?: string;
|
|
364
|
+
network: VMNetworkDescription;
|
|
365
|
+
}
|
|
280
366
|
interface VMStat {
|
|
281
367
|
hostname: string;
|
|
282
368
|
ip: string;
|
|
@@ -544,6 +630,21 @@ interface VMInit {
|
|
|
544
630
|
createdAt?: string;
|
|
545
631
|
arch?: string;
|
|
546
632
|
}
|
|
633
|
+
declare class CommittedVM {
|
|
634
|
+
private readonly transport;
|
|
635
|
+
readonly hostname: string;
|
|
636
|
+
readonly hostGroup: string;
|
|
637
|
+
readonly commitId: string;
|
|
638
|
+
readonly status: string;
|
|
639
|
+
readonly parentStatus?: string;
|
|
640
|
+
readonly mode: VMCommitResponse['mode'];
|
|
641
|
+
readonly tags?: string[];
|
|
642
|
+
readonly labels?: Record<string, string>;
|
|
643
|
+
readonly cacheKey?: string;
|
|
644
|
+
constructor(transport: TransportClient, hostGroup: string, response: VMCommitResponse);
|
|
645
|
+
fork(opts?: VMForkOptions): Promise<VM>;
|
|
646
|
+
forkRaw(opts?: VMForkOptions): Promise<VMForkResponse>;
|
|
647
|
+
}
|
|
547
648
|
declare class VM {
|
|
548
649
|
readonly hostname: string;
|
|
549
650
|
readonly hostGroup: string;
|
|
@@ -557,6 +658,8 @@ declare class VM {
|
|
|
557
658
|
delete(): Promise<void>;
|
|
558
659
|
health(): Promise<AgentHealth>;
|
|
559
660
|
logs(): Promise<VMLogs>;
|
|
661
|
+
/** Return configuration, fork lineage, and effective network policy. */
|
|
662
|
+
describe(): Promise<VMDescription>;
|
|
560
663
|
waitForAgent(opts?: WaitOptions): Promise<AgentHealth>;
|
|
561
664
|
waitForUserdata(opts?: WaitOptions): Promise<AgentHealth>;
|
|
562
665
|
shutdown(req?: ShutdownRequest): Promise<void>;
|
|
@@ -567,6 +670,10 @@ declare class VM {
|
|
|
567
670
|
suspend(): Promise<void>;
|
|
568
671
|
/** Mac-only on current daemons. Throws `SlicerAPIError 404` on Linux. */
|
|
569
672
|
restore(): Promise<void>;
|
|
673
|
+
/**
|
|
674
|
+
* Commit a stopped persistent VM disk into an immutable parent.
|
|
675
|
+
*/
|
|
676
|
+
commit(opts?: VMCommitOptions): Promise<CommittedVM>;
|
|
570
677
|
/**
|
|
571
678
|
* Open one or more port forwards from the host to this VM. Each spec follows
|
|
572
679
|
* the same syntax as `slicer vm forward -L`:
|
|
@@ -654,7 +761,7 @@ declare class VMBg {
|
|
|
654
761
|
}
|
|
655
762
|
|
|
656
763
|
/**
|
|
657
|
-
* Top-level namespaces on SlicerClient: hostGroups, vms, secrets.
|
|
764
|
+
* Top-level namespaces on SlicerClient: hostGroups, vms, commits, secrets.
|
|
658
765
|
* Keep control-plane operations here; per-VM operations live on the VM handle.
|
|
659
766
|
*/
|
|
660
767
|
|
|
@@ -686,6 +793,13 @@ declare class VMsAPI {
|
|
|
686
793
|
*/
|
|
687
794
|
createRaw(hostGroup: string, req?: CreateVMRequest, opts?: CreateVMOptions): Promise<CreateVMResponse>;
|
|
688
795
|
}
|
|
796
|
+
declare class CommitsAPI {
|
|
797
|
+
private readonly transport;
|
|
798
|
+
constructor(transport: TransportClient);
|
|
799
|
+
list(opts?: VMCommitListOptions): Promise<VMCommitInfo[]>;
|
|
800
|
+
delete(commitId: string): Promise<VMCommitDeleteResponse>;
|
|
801
|
+
fork(commitId: string, opts?: VMForkOptions): Promise<VMForkResponse>;
|
|
802
|
+
}
|
|
689
803
|
declare class SecretsAPI {
|
|
690
804
|
private readonly transport;
|
|
691
805
|
constructor(transport: TransportClient);
|
|
@@ -719,10 +833,12 @@ declare class SecretsAPI {
|
|
|
719
833
|
*/
|
|
720
834
|
|
|
721
835
|
/** Credential type for upstream injection. */
|
|
722
|
-
type ProxySecretType = 'bearer' | 'basic';
|
|
836
|
+
type ProxySecretType = 'bearer' | 'basic' | 'oauth-client-creds';
|
|
723
837
|
declare const ProxySecretBearer: ProxySecretType;
|
|
724
838
|
/** For basic auth, the secret value must be in `user:pass` form. */
|
|
725
839
|
declare const ProxySecretBasic: ProxySecretType;
|
|
840
|
+
/** OAuth 2.0 client credentials exchanged and renewed by the proxy host. */
|
|
841
|
+
declare const ProxySecretOAuthClientCredentials: ProxySecretType;
|
|
726
842
|
/** A registered proxy client. Tokens are never returned by list/get. */
|
|
727
843
|
interface ProxyClient {
|
|
728
844
|
name: string;
|
|
@@ -762,7 +878,9 @@ interface CreateProxySecretRequest {
|
|
|
762
878
|
/**
|
|
763
879
|
* Plaintext credential. For `bearer`, the raw token. For `basic`,
|
|
764
880
|
* must be in `user:pass` form (the proxy base64-encodes it on the
|
|
765
|
-
* inner request).
|
|
881
|
+
* inner request). For `oauth-client-creds`, pass top-level JSON containing
|
|
882
|
+
* `token_endpoint`, `client_id`, and `client_secret`; optional `scope` is
|
|
883
|
+
* supported. The proxy obtains, caches, and renews the bearer host-side.
|
|
766
884
|
*/
|
|
767
885
|
value: string;
|
|
768
886
|
}
|
|
@@ -880,12 +998,13 @@ declare class ProxyAllowsAPI {
|
|
|
880
998
|
* Shape:
|
|
881
999
|
* client.hostGroups.list() / find(name) / listVMs(name)
|
|
882
1000
|
* client.vms.create(group, req, opts) → VM / get(name) / list() / stats() / attach(group, name)
|
|
1001
|
+
* client.commits.list() / fork(id) / delete(id)
|
|
883
1002
|
* client.secrets.list / create / patch / delete
|
|
884
1003
|
* client.getInfo()
|
|
885
1004
|
*
|
|
886
1005
|
* Per-VM operations live on the `VM` handle returned from `client.vms.create`
|
|
887
1006
|
* or `client.vms.attach`: `vm.exec`, `vm.execBuffered`, `vm.fs.*`,
|
|
888
|
-
* `vm.pause/resume/suspend/restore/shutdown/relaunch`, `vm.health/logs`,
|
|
1007
|
+
* `vm.pause/resume/suspend/restore/shutdown/relaunch`, `vm.commit/describe`, `vm.health/logs`,
|
|
889
1008
|
* `vm.waitForAgent/waitForUserdata`, `vm.delete`.
|
|
890
1009
|
*/
|
|
891
1010
|
|
|
@@ -895,6 +1014,7 @@ declare class SlicerClient {
|
|
|
895
1014
|
readonly transport: TransportClient;
|
|
896
1015
|
readonly hostGroups: HostGroupsAPI;
|
|
897
1016
|
readonly vms: VMsAPI;
|
|
1017
|
+
readonly commits: CommitsAPI;
|
|
898
1018
|
readonly secrets: SecretsAPI;
|
|
899
1019
|
readonly proxy: ProxyAPI;
|
|
900
1020
|
constructor(opts: SlicerClientOptions);
|
|
@@ -968,4 +1088,4 @@ declare class SlicerShellSession {
|
|
|
968
1088
|
private teardown;
|
|
969
1089
|
}
|
|
970
1090
|
|
|
971
|
-
export { type AddProxyAllowRequest, type AddressMapping, type AgentHealth, type BgDeleteResponse, type BgExecInfo, type BgExecRequest, type BgExecResponse, type BgKillOptions, type BgKillResponse, type BgLogOptions, type BgWaitExitResponse, 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, type ProxySecretType, ProxySecretsAPI, type RemoveProxyAllowByTupleRequest, type Secret, SecretExistsError, SecretsAPI, type ShellSessionOptions, type ShutdownRequest, SlicerAPIError, SlicerClient, type SlicerClientOptions, type SlicerInfo, SlicerShellSession, type UpdateSecretRequest, VM, VMBg, VMFileSystem, type VMInfo, type VMInit, type VMLogs, type VMSnapshot, type VMStat, VMsAPI, type WaitOptions, type XTermLike, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
|
1091
|
+
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 VMForkNetworkPolicy, type VMForkOptions, type VMForkResponse, type VMInfo, type VMInit, type VMLogs, type VMNetworkDescription, type VMNetworkPolicy, type VMSnapshot, type VMStat, VMsAPI, type WaitOptions, type XTermLike, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ interface AgentHealth {
|
|
|
63
63
|
agentVersion?: string;
|
|
64
64
|
systemUptime?: number;
|
|
65
65
|
userdataRan?: boolean;
|
|
66
|
+
userdataExitCode?: number;
|
|
66
67
|
}
|
|
67
68
|
interface VMLogs {
|
|
68
69
|
hostname: string;
|
|
@@ -277,6 +278,91 @@ interface FSWatchEvent {
|
|
|
277
278
|
interface ShutdownRequest {
|
|
278
279
|
action?: 'shutdown' | 'reboot';
|
|
279
280
|
}
|
|
281
|
+
interface VMCommitOptions {
|
|
282
|
+
tags?: string[];
|
|
283
|
+
labels?: Record<string, string>;
|
|
284
|
+
cacheKey?: string;
|
|
285
|
+
}
|
|
286
|
+
interface VMCommitResponse {
|
|
287
|
+
hostname: string;
|
|
288
|
+
commitId: string;
|
|
289
|
+
status: string;
|
|
290
|
+
parentStatus?: string;
|
|
291
|
+
mode: string;
|
|
292
|
+
tags?: string[];
|
|
293
|
+
labels?: Record<string, string>;
|
|
294
|
+
cacheKey?: string;
|
|
295
|
+
}
|
|
296
|
+
interface VMCommitListOptions {
|
|
297
|
+
tags?: string[];
|
|
298
|
+
cacheKey?: string;
|
|
299
|
+
source?: string;
|
|
300
|
+
mode?: string;
|
|
301
|
+
}
|
|
302
|
+
interface VMCommitInfo {
|
|
303
|
+
commitId: string;
|
|
304
|
+
sourceHostname: string;
|
|
305
|
+
sourceHostGroup: string;
|
|
306
|
+
createdAt: string;
|
|
307
|
+
mode: string;
|
|
308
|
+
tags?: string[];
|
|
309
|
+
labels?: Record<string, string>;
|
|
310
|
+
cacheKey?: string;
|
|
311
|
+
}
|
|
312
|
+
interface VMCommitDeleteResponse {
|
|
313
|
+
commitId: string;
|
|
314
|
+
status: string;
|
|
315
|
+
}
|
|
316
|
+
/** Isolated-network policy override for a forked VM. */
|
|
317
|
+
interface VMForkNetworkPolicy {
|
|
318
|
+
/** Omit to inherit; pass an empty array to clear the allow list. */
|
|
319
|
+
allow?: string[];
|
|
320
|
+
/** Omit to inherit; pass an empty array to clear the drop list. */
|
|
321
|
+
drop?: string[];
|
|
322
|
+
}
|
|
323
|
+
interface VMForkOptions {
|
|
324
|
+
/** Agent-readiness timeout in seconds. Forks always wait for the child agent. */
|
|
325
|
+
waitTimeoutSec?: number;
|
|
326
|
+
network?: VMForkNetworkPolicy;
|
|
327
|
+
tags?: string[];
|
|
328
|
+
}
|
|
329
|
+
interface VMForkResponse {
|
|
330
|
+
hostname: string;
|
|
331
|
+
sourceHostname: string;
|
|
332
|
+
commitId?: string;
|
|
333
|
+
status: string;
|
|
334
|
+
parentStatus?: string;
|
|
335
|
+
childStatus?: string;
|
|
336
|
+
mode: string;
|
|
337
|
+
}
|
|
338
|
+
interface VMNetworkPolicy {
|
|
339
|
+
allow: string[];
|
|
340
|
+
drop: string[];
|
|
341
|
+
}
|
|
342
|
+
interface VMNetworkDescription {
|
|
343
|
+
mode?: string;
|
|
344
|
+
policySource?: string;
|
|
345
|
+
hostGroup: VMNetworkPolicy;
|
|
346
|
+
override?: CreateVMNetworkPolicy;
|
|
347
|
+
effective: VMNetworkPolicy;
|
|
348
|
+
}
|
|
349
|
+
interface VMDescription {
|
|
350
|
+
hostname: string;
|
|
351
|
+
hostGroup?: string;
|
|
352
|
+
ip?: string;
|
|
353
|
+
ramBytes?: number;
|
|
354
|
+
cpus?: number;
|
|
355
|
+
createdAt?: string;
|
|
356
|
+
arch?: string;
|
|
357
|
+
tags?: string[];
|
|
358
|
+
status?: string;
|
|
359
|
+
persistent?: boolean;
|
|
360
|
+
storage?: string;
|
|
361
|
+
image?: string;
|
|
362
|
+
commitId?: string;
|
|
363
|
+
parentCommitId?: string;
|
|
364
|
+
network: VMNetworkDescription;
|
|
365
|
+
}
|
|
280
366
|
interface VMStat {
|
|
281
367
|
hostname: string;
|
|
282
368
|
ip: string;
|
|
@@ -544,6 +630,21 @@ interface VMInit {
|
|
|
544
630
|
createdAt?: string;
|
|
545
631
|
arch?: string;
|
|
546
632
|
}
|
|
633
|
+
declare class CommittedVM {
|
|
634
|
+
private readonly transport;
|
|
635
|
+
readonly hostname: string;
|
|
636
|
+
readonly hostGroup: string;
|
|
637
|
+
readonly commitId: string;
|
|
638
|
+
readonly status: string;
|
|
639
|
+
readonly parentStatus?: string;
|
|
640
|
+
readonly mode: VMCommitResponse['mode'];
|
|
641
|
+
readonly tags?: string[];
|
|
642
|
+
readonly labels?: Record<string, string>;
|
|
643
|
+
readonly cacheKey?: string;
|
|
644
|
+
constructor(transport: TransportClient, hostGroup: string, response: VMCommitResponse);
|
|
645
|
+
fork(opts?: VMForkOptions): Promise<VM>;
|
|
646
|
+
forkRaw(opts?: VMForkOptions): Promise<VMForkResponse>;
|
|
647
|
+
}
|
|
547
648
|
declare class VM {
|
|
548
649
|
readonly hostname: string;
|
|
549
650
|
readonly hostGroup: string;
|
|
@@ -557,6 +658,8 @@ declare class VM {
|
|
|
557
658
|
delete(): Promise<void>;
|
|
558
659
|
health(): Promise<AgentHealth>;
|
|
559
660
|
logs(): Promise<VMLogs>;
|
|
661
|
+
/** Return configuration, fork lineage, and effective network policy. */
|
|
662
|
+
describe(): Promise<VMDescription>;
|
|
560
663
|
waitForAgent(opts?: WaitOptions): Promise<AgentHealth>;
|
|
561
664
|
waitForUserdata(opts?: WaitOptions): Promise<AgentHealth>;
|
|
562
665
|
shutdown(req?: ShutdownRequest): Promise<void>;
|
|
@@ -567,6 +670,10 @@ declare class VM {
|
|
|
567
670
|
suspend(): Promise<void>;
|
|
568
671
|
/** Mac-only on current daemons. Throws `SlicerAPIError 404` on Linux. */
|
|
569
672
|
restore(): Promise<void>;
|
|
673
|
+
/**
|
|
674
|
+
* Commit a stopped persistent VM disk into an immutable parent.
|
|
675
|
+
*/
|
|
676
|
+
commit(opts?: VMCommitOptions): Promise<CommittedVM>;
|
|
570
677
|
/**
|
|
571
678
|
* Open one or more port forwards from the host to this VM. Each spec follows
|
|
572
679
|
* the same syntax as `slicer vm forward -L`:
|
|
@@ -654,7 +761,7 @@ declare class VMBg {
|
|
|
654
761
|
}
|
|
655
762
|
|
|
656
763
|
/**
|
|
657
|
-
* Top-level namespaces on SlicerClient: hostGroups, vms, secrets.
|
|
764
|
+
* Top-level namespaces on SlicerClient: hostGroups, vms, commits, secrets.
|
|
658
765
|
* Keep control-plane operations here; per-VM operations live on the VM handle.
|
|
659
766
|
*/
|
|
660
767
|
|
|
@@ -686,6 +793,13 @@ declare class VMsAPI {
|
|
|
686
793
|
*/
|
|
687
794
|
createRaw(hostGroup: string, req?: CreateVMRequest, opts?: CreateVMOptions): Promise<CreateVMResponse>;
|
|
688
795
|
}
|
|
796
|
+
declare class CommitsAPI {
|
|
797
|
+
private readonly transport;
|
|
798
|
+
constructor(transport: TransportClient);
|
|
799
|
+
list(opts?: VMCommitListOptions): Promise<VMCommitInfo[]>;
|
|
800
|
+
delete(commitId: string): Promise<VMCommitDeleteResponse>;
|
|
801
|
+
fork(commitId: string, opts?: VMForkOptions): Promise<VMForkResponse>;
|
|
802
|
+
}
|
|
689
803
|
declare class SecretsAPI {
|
|
690
804
|
private readonly transport;
|
|
691
805
|
constructor(transport: TransportClient);
|
|
@@ -719,10 +833,12 @@ declare class SecretsAPI {
|
|
|
719
833
|
*/
|
|
720
834
|
|
|
721
835
|
/** Credential type for upstream injection. */
|
|
722
|
-
type ProxySecretType = 'bearer' | 'basic';
|
|
836
|
+
type ProxySecretType = 'bearer' | 'basic' | 'oauth-client-creds';
|
|
723
837
|
declare const ProxySecretBearer: ProxySecretType;
|
|
724
838
|
/** For basic auth, the secret value must be in `user:pass` form. */
|
|
725
839
|
declare const ProxySecretBasic: ProxySecretType;
|
|
840
|
+
/** OAuth 2.0 client credentials exchanged and renewed by the proxy host. */
|
|
841
|
+
declare const ProxySecretOAuthClientCredentials: ProxySecretType;
|
|
726
842
|
/** A registered proxy client. Tokens are never returned by list/get. */
|
|
727
843
|
interface ProxyClient {
|
|
728
844
|
name: string;
|
|
@@ -762,7 +878,9 @@ interface CreateProxySecretRequest {
|
|
|
762
878
|
/**
|
|
763
879
|
* Plaintext credential. For `bearer`, the raw token. For `basic`,
|
|
764
880
|
* must be in `user:pass` form (the proxy base64-encodes it on the
|
|
765
|
-
* inner request).
|
|
881
|
+
* inner request). For `oauth-client-creds`, pass top-level JSON containing
|
|
882
|
+
* `token_endpoint`, `client_id`, and `client_secret`; optional `scope` is
|
|
883
|
+
* supported. The proxy obtains, caches, and renews the bearer host-side.
|
|
766
884
|
*/
|
|
767
885
|
value: string;
|
|
768
886
|
}
|
|
@@ -880,12 +998,13 @@ declare class ProxyAllowsAPI {
|
|
|
880
998
|
* Shape:
|
|
881
999
|
* client.hostGroups.list() / find(name) / listVMs(name)
|
|
882
1000
|
* client.vms.create(group, req, opts) → VM / get(name) / list() / stats() / attach(group, name)
|
|
1001
|
+
* client.commits.list() / fork(id) / delete(id)
|
|
883
1002
|
* client.secrets.list / create / patch / delete
|
|
884
1003
|
* client.getInfo()
|
|
885
1004
|
*
|
|
886
1005
|
* Per-VM operations live on the `VM` handle returned from `client.vms.create`
|
|
887
1006
|
* or `client.vms.attach`: `vm.exec`, `vm.execBuffered`, `vm.fs.*`,
|
|
888
|
-
* `vm.pause/resume/suspend/restore/shutdown/relaunch`, `vm.health/logs`,
|
|
1007
|
+
* `vm.pause/resume/suspend/restore/shutdown/relaunch`, `vm.commit/describe`, `vm.health/logs`,
|
|
889
1008
|
* `vm.waitForAgent/waitForUserdata`, `vm.delete`.
|
|
890
1009
|
*/
|
|
891
1010
|
|
|
@@ -895,6 +1014,7 @@ declare class SlicerClient {
|
|
|
895
1014
|
readonly transport: TransportClient;
|
|
896
1015
|
readonly hostGroups: HostGroupsAPI;
|
|
897
1016
|
readonly vms: VMsAPI;
|
|
1017
|
+
readonly commits: CommitsAPI;
|
|
898
1018
|
readonly secrets: SecretsAPI;
|
|
899
1019
|
readonly proxy: ProxyAPI;
|
|
900
1020
|
constructor(opts: SlicerClientOptions);
|
|
@@ -968,4 +1088,4 @@ declare class SlicerShellSession {
|
|
|
968
1088
|
private teardown;
|
|
969
1089
|
}
|
|
970
1090
|
|
|
971
|
-
export { type AddProxyAllowRequest, type AddressMapping, type AgentHealth, type BgDeleteResponse, type BgExecInfo, type BgExecRequest, type BgExecResponse, type BgKillOptions, type BgKillResponse, type BgLogOptions, type BgWaitExitResponse, 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, type ProxySecretType, ProxySecretsAPI, type RemoveProxyAllowByTupleRequest, type Secret, SecretExistsError, SecretsAPI, type ShellSessionOptions, type ShutdownRequest, SlicerAPIError, SlicerClient, type SlicerClientOptions, type SlicerInfo, SlicerShellSession, type UpdateSecretRequest, VM, VMBg, VMFileSystem, type VMInfo, type VMInit, type VMLogs, type VMSnapshot, type VMStat, VMsAPI, type WaitOptions, type XTermLike, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|
|
1091
|
+
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 VMForkNetworkPolicy, type VMForkOptions, type VMForkResponse, type VMInfo, type VMInit, type VMLogs, type VMNetworkDescription, type VMNetworkPolicy, type VMSnapshot, type VMStat, VMsAPI, type WaitOptions, type XTermLike, encodeFrame, parseAddressMapping, parseFrame, resolveTransport };
|