@unikraft/cloud-plugin-sandbox-api 1.0.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/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # @unikraft/cloud-plugin-sandbox-api
2
+
3
+ The generated client for the Unikraft Cloud `sandbox` plugin API. It is
4
+ generated from the plugin's OpenAPI specification, so **do not edit it by
5
+ hand**.
6
+
7
+ This package is the raw ("plumbing") layer. Methods are named after their
8
+ `operationId` and return the response envelope exactly as the specification
9
+ describes it. If you want the idiomatic layer, use
10
+ [`@unikraft/cloud`](https://www.npmjs.com/package/@unikraft/cloud), which wraps
11
+ this package and creates the instance for you.
12
+
13
+ ## Install
14
+
15
+ ```sh
16
+ npm install @unikraft/cloud-plugin-sandbox-api @unikraft/cloud
17
+ ```
18
+
19
+ `@unikraft/cloud` is a peer dependency, because the generated classes extend
20
+ its `ApiClient` transport.
21
+
22
+ ## Usage
23
+
24
+ The plugin runs inside a single instance and answers on that instance's plugin
25
+ route, so `baseUrl` is the full plugin endpoint rather than a metro root.
26
+
27
+ ```ts
28
+ import { SandboxPluginApi } from "@unikraft/cloud-plugin-sandbox-api";
29
+
30
+ const api = new SandboxPluginApi({
31
+ baseUrl: `https://api.fra.unikraft.cloud/v1/instances/${uuid}/plugins/sandbox`,
32
+ token: process.env.UKC_TOKEN,
33
+ });
34
+ ```
35
+
36
+ The last path segment is whatever name the plugin was attached under in the
37
+ instance's `plugins` array, so it is not necessarily `sandbox`. To let the
38
+ SDK build that URL for you, use `@unikraft/cloud` instead.
39
+
40
+ ## Exports
41
+
42
+ | Import | Carries |
43
+ | --- | --- |
44
+ | `@unikraft/cloud-plugin-sandbox-api` | `SandboxPluginApi`, `CommandsApi`, `FsApi`, `models` |
45
+ | `@unikraft/cloud-plugin-sandbox-api/models` | The wire types |
46
+
47
+ `SandboxPluginApi` groups one client per resource:
48
+
49
+ - `api.commands` — the `commands` resource
50
+ - `api.fs` — the `fs` resource
@@ -0,0 +1,63 @@
1
+ import { ApiClient, type CallOptions } from "@unikraft/cloud/core/http";
2
+ import type * as models from "./models.gen.js";
3
+ /**
4
+ * Low-level "plumbing" client for the {@link https://unikraft.com|Unikraft
5
+ * Cloud} `commands` resource. Methods return the raw response envelope.
6
+ */
7
+ export declare class CommandsApi extends ApiClient {
8
+ /**
9
+ * Delete Command by UUID
10
+ */
11
+ deleteCommandByUuid(uuid: string, params?: CallOptions): Promise<models.EmptyResponse>;
12
+ /**
13
+ * Delete Command Logs
14
+ */
15
+ deleteCommandLogsByUuid(uuid: string, params?: CallOptions): Promise<models.EmptyResponse>;
16
+ /**
17
+ * Get Command by UUID
18
+ */
19
+ getCommandByUuid(uuid: string, params?: CallOptions): Promise<models.GetCommandResponse>;
20
+ /**
21
+ * Get Command Logs
22
+ */
23
+ getCommandLogs(uuid: string, params?: CallOptions): Promise<models.CommandLogsResponse>;
24
+ /**
25
+ * Get Raw Command Log
26
+ */
27
+ getRawCommandLog(uuid: string, stream: models.CommandLogStream, params?: {
28
+ Range?: string;
29
+ } & CallOptions): Promise<Uint8Array>;
30
+ /**
31
+ * List Commands
32
+ */
33
+ listCommands(params?: CallOptions): Promise<models.ListCommandsResponse>;
34
+ /**
35
+ * Start Command
36
+ */
37
+ runCommand(params: {
38
+ body: models.RunCommandRequest;
39
+ } & CallOptions): Promise<models.RunCommandResponse>;
40
+ /**
41
+ * Signal Command
42
+ */
43
+ signalCommand(uuid: string, params: {
44
+ body: models.CommandSignalRequest;
45
+ } & CallOptions): Promise<models.EmptyResponse>;
46
+ /**
47
+ * Wait for Command
48
+ */
49
+ waitForCommand(uuid: string, params?: CallOptions): Promise<models.EmptyResponse>;
50
+ /**
51
+ * Wait for Command with Timeout
52
+ */
53
+ waitForCommandWithTimeout(uuid: string, params: {
54
+ body: models.CommandWaitTimeoutRequest;
55
+ } & CallOptions): Promise<models.EmptyResponse>;
56
+ /**
57
+ * Write Command Stdin
58
+ */
59
+ writeCommandStdin(uuid: string, params: {
60
+ body: models.CommandStdinRequest;
61
+ } & CallOptions): Promise<models.EmptyResponse>;
62
+ }
63
+ //# sourceMappingURL=commands.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.gen.d.ts","sourceRoot":"","sources":["../../src/api/commands.gen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE/C;;;GAGG;AACH,qBAAa,WAAY,SAAQ,SAAS;IACxC;;OAEG;IACH,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAQzF;IAED;;OAEG;IACH,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAQ7F;IAED;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAQ3F;IAED;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAQ1F;IAED;;OAEG;IACH,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,gBAAgB,EAC/B,MAAM,GAAE;QACN,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,WAAgB,GACnB,OAAO,CAAC,UAAU,CAAC,CAcrB;IAED;;OAEG;IACH,YAAY,CAAC,MAAM,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAQ3E;IAED;;OAEG;IACH,UAAU,CACR,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC,iBAAiB,CAAC;KAChC,GAAG,WAAW,GACd,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,CASpC;IAED;;OAEG;IACH,aAAa,CACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC,oBAAoB,CAAC;KACnC,GAAG,WAAW,GACd,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAS/B;IAED;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAQpF;IAED;;OAEG;IACH,yBAAyB,CACvB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC,yBAAyB,CAAC;KACxC,GAAG,WAAW,GACd,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAS/B;IAED;;OAEG;IACH,iBAAiB,CACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC,mBAAmB,CAAC;KAClC,GAAG,WAAW,GACd,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAS/B;CACF"}
@@ -0,0 +1,118 @@
1
+ // Code generated by openapi-gen; DO NOT EDIT.
2
+ import { ApiClient } from "@unikraft/cloud/core/http";
3
+ /**
4
+ * Low-level "plumbing" client for the {@link https://unikraft.com|Unikraft
5
+ * Cloud} `commands` resource. Methods return the raw response envelope.
6
+ */
7
+ export class CommandsApi extends ApiClient {
8
+ /**
9
+ * Delete Command by UUID
10
+ */
11
+ deleteCommandByUuid(uuid, params = {}) {
12
+ return this.request({
13
+ method: "DELETE",
14
+ path: `/commands/${encodeURIComponent(uuid)}`,
15
+ }, params);
16
+ }
17
+ /**
18
+ * Delete Command Logs
19
+ */
20
+ deleteCommandLogsByUuid(uuid, params = {}) {
21
+ return this.request({
22
+ method: "DELETE",
23
+ path: `/commands/${encodeURIComponent(uuid)}/logs`,
24
+ }, params);
25
+ }
26
+ /**
27
+ * Get Command by UUID
28
+ */
29
+ getCommandByUuid(uuid, params = {}) {
30
+ return this.request({
31
+ method: "GET",
32
+ path: `/commands/${encodeURIComponent(uuid)}`,
33
+ }, params);
34
+ }
35
+ /**
36
+ * Get Command Logs
37
+ */
38
+ getCommandLogs(uuid, params = {}) {
39
+ return this.request({
40
+ method: "GET",
41
+ path: `/commands/${encodeURIComponent(uuid)}/logs`,
42
+ }, params);
43
+ }
44
+ /**
45
+ * Get Raw Command Log
46
+ */
47
+ getRawCommandLog(uuid, stream, params = {}) {
48
+ return this.bytes({
49
+ method: "GET",
50
+ path: `/commands/${encodeURIComponent(uuid)}/logs/raw/${encodeURIComponent(stream)}`,
51
+ }, {
52
+ ...params,
53
+ headers: {
54
+ ...(params["Range"] !== undefined ? { Range: String(params["Range"]) } : {}),
55
+ ...params.headers,
56
+ },
57
+ });
58
+ }
59
+ /**
60
+ * List Commands
61
+ */
62
+ listCommands(params = {}) {
63
+ return this.request({
64
+ method: "GET",
65
+ path: `/commands`,
66
+ }, params);
67
+ }
68
+ /**
69
+ * Start Command
70
+ */
71
+ runCommand(params) {
72
+ return this.request({
73
+ method: "POST",
74
+ path: `/commands`,
75
+ body: params.body,
76
+ }, params);
77
+ }
78
+ /**
79
+ * Signal Command
80
+ */
81
+ signalCommand(uuid, params) {
82
+ return this.request({
83
+ method: "POST",
84
+ path: `/commands/${encodeURIComponent(uuid)}/signal`,
85
+ body: params.body,
86
+ }, params);
87
+ }
88
+ /**
89
+ * Wait for Command
90
+ */
91
+ waitForCommand(uuid, params = {}) {
92
+ return this.request({
93
+ method: "POST",
94
+ path: `/commands/${encodeURIComponent(uuid)}/wait`,
95
+ }, params);
96
+ }
97
+ /**
98
+ * Wait for Command with Timeout
99
+ */
100
+ waitForCommandWithTimeout(uuid, params) {
101
+ return this.request({
102
+ method: "POST",
103
+ path: `/commands/${encodeURIComponent(uuid)}/wait_timeout`,
104
+ body: params.body,
105
+ }, params);
106
+ }
107
+ /**
108
+ * Write Command Stdin
109
+ */
110
+ writeCommandStdin(uuid, params) {
111
+ return this.request({
112
+ method: "POST",
113
+ path: `/commands/${encodeURIComponent(uuid)}/stdin`,
114
+ body: params.body,
115
+ }, params);
116
+ }
117
+ }
118
+ //# sourceMappingURL=commands.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.gen.js","sourceRoot":"","sources":["../../src/api/commands.gen.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,SAAS,EAAoB,MAAM,2BAA2B,CAAC;AAGxE;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,SAAS;IACxC;;OAEG;IACH,mBAAmB,CAAC,IAAY,EAAE,MAAM,GAAgB,EAAE;QACxD,OAAO,IAAI,CAAC,OAAO,CACjB;YACE,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,aAAa,kBAAkB,CAAC,IAAI,CAAC,EAAE;SAC9C,EACD,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,uBAAuB,CAAC,IAAY,EAAE,MAAM,GAAgB,EAAE;QAC5D,OAAO,IAAI,CAAC,OAAO,CACjB;YACE,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,aAAa,kBAAkB,CAAC,IAAI,CAAC,OAAO;SACnD,EACD,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,gBAAgB,CAAC,IAAY,EAAE,MAAM,GAAgB,EAAE;QACrD,OAAO,IAAI,CAAC,OAAO,CACjB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,aAAa,kBAAkB,CAAC,IAAI,CAAC,EAAE;SAC9C,EACD,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,IAAY,EAAE,MAAM,GAAgB,EAAE;QACnD,OAAO,IAAI,CAAC,OAAO,CACjB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,aAAa,kBAAkB,CAAC,IAAI,CAAC,O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CACjB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,aAAa,kBAAkB,CAAC,IAAI,CAAC,OAAO;SACnD,EACD,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,yBAAyB,CACvB,IAAY,EACZ,MAEe;QAEf,OAAO,IAAI,CAAC,OAAO,CACjB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,aAAa,kBAAkB,CAAC,IAAI,CAAC,eAAe;YAC1D,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,iBAAiB,CACf,IAAY,EACZ,MAEe;QAEf,OAAO,IAAI,CAAC,OAAO,CACjB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,aAAa,kBAAkB,CAAC,IAAI,CAAC,QAAQ;YACnD,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,39 @@
1
+ import { ApiClient, type CallOptions } from "@unikraft/cloud/core/http";
2
+ import type * as models from "./models.gen.js";
3
+ /**
4
+ * Low-level "plumbing" client for the {@link https://unikraft.com|Unikraft
5
+ * Cloud} `fs` resource. Methods return the raw response envelope.
6
+ */
7
+ export declare class FsApi extends ApiClient {
8
+ /**
9
+ * Create Directory
10
+ */
11
+ createDirectory(params: {
12
+ body: models.MkdirRequest;
13
+ } & CallOptions): Promise<models.EmptyResponse>;
14
+ /**
15
+ * Read File
16
+ */
17
+ readFile(params: {
18
+ body: models.ReadFileRequest;
19
+ } & CallOptions): Promise<models.ReadFileResponse>;
20
+ /**
21
+ * Read Raw File
22
+ */
23
+ readRawFile(params: {
24
+ body: models.ReadFileRequest;
25
+ } & CallOptions): Promise<Uint8Array>;
26
+ /**
27
+ * Upload File
28
+ */
29
+ uploadFile(params: {
30
+ body: models.UploadFileRequest;
31
+ } & CallOptions): Promise<models.EmptyResponse>;
32
+ /**
33
+ * Write File
34
+ */
35
+ writeFile(params: {
36
+ body: models.WriteFileRequest;
37
+ } & CallOptions): Promise<models.EmptyResponse>;
38
+ }
39
+ //# sourceMappingURL=fs.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.gen.d.ts","sourceRoot":"","sources":["../../src/api/fs.gen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE/C;;;GAGG;AACH,qBAAa,KAAM,SAAQ,SAAS;IAClC;;OAEG;IACH,eAAe,CACb,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC;KAC3B,GAAG,WAAW,GACd,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAS/B;IAED;;OAEG;IACH,QAAQ,CACN,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC;KAC9B,GAAG,WAAW,GACd,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CASlC;IAED;;OAEG;IACH,WAAW,CACT,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC,eAAe,CAAC;KAC9B,GAAG,WAAW,GACd,OAAO,CAAC,UAAU,CAAC,CASrB;IAED;;OAEG;IACH,UAAU,CACR,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC,iBAAiB,CAAC;KAChC,GAAG,WAAW,GACd,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAS/B;IAED;;OAEG;IACH,SAAS,CACP,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC;KAC/B,GAAG,WAAW,GACd,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAS/B;CACF"}
@@ -0,0 +1,59 @@
1
+ // Code generated by openapi-gen; DO NOT EDIT.
2
+ import { ApiClient } from "@unikraft/cloud/core/http";
3
+ /**
4
+ * Low-level "plumbing" client for the {@link https://unikraft.com|Unikraft
5
+ * Cloud} `fs` resource. Methods return the raw response envelope.
6
+ */
7
+ export class FsApi extends ApiClient {
8
+ /**
9
+ * Create Directory
10
+ */
11
+ createDirectory(params) {
12
+ return this.request({
13
+ method: "POST",
14
+ path: `/fs/mkdir`,
15
+ body: params.body,
16
+ }, params);
17
+ }
18
+ /**
19
+ * Read File
20
+ */
21
+ readFile(params) {
22
+ return this.request({
23
+ method: "POST",
24
+ path: `/fs/read`,
25
+ body: params.body,
26
+ }, params);
27
+ }
28
+ /**
29
+ * Read Raw File
30
+ */
31
+ readRawFile(params) {
32
+ return this.bytes({
33
+ method: "POST",
34
+ path: `/fs/read_raw`,
35
+ body: params.body,
36
+ }, params);
37
+ }
38
+ /**
39
+ * Upload File
40
+ */
41
+ uploadFile(params) {
42
+ return this.request({
43
+ method: "POST",
44
+ path: `/fs/upload`,
45
+ body: params.body,
46
+ }, params);
47
+ }
48
+ /**
49
+ * Write File
50
+ */
51
+ writeFile(params) {
52
+ return this.request({
53
+ method: "POST",
54
+ path: `/fs/write`,
55
+ body: params.body,
56
+ }, params);
57
+ }
58
+ }
59
+ //# sourceMappingURL=fs.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.gen.js","sourceRoot":"","sources":["../../src/api/fs.gen.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,SAAS,EAAoB,MAAM,2BAA2B,CAAC;AAGxE;;;GAGG;AACH,MAAM,OAAO,KAAM,SAAQ,SAAS;IAClC;;OAEG;IACH,eAAe,CACb,MAEe;QAEf,OAAO,IAAI,CAAC,OAAO,CACjB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,QAAQ,CACN,MAEe;QAEf,OAAO,IAAI,CAAC,OAAO,CACjB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,WAAW,CACT,MAEe;QAEf,OAAO,IAAI,CAAC,KAAK,CACf;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,UAAU,CACR,MAEe;QAEf,OAAO,IAAI,CAAC,OAAO,CACjB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,SAAS,CACP,MAEe;QAEf,OAAO,IAAI,CAAC,OAAO,CACjB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ export type { ApiClient, CallOptions } from "@unikraft/cloud/core/http";
2
+ export * as models from "./models.gen.js";
3
+ export { CommandsApi } from "./commands.gen.js";
4
+ export { FsApi } from "./fs.gen.js";
5
+ //# sourceMappingURL=index.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.gen.d.ts","sourceRoot":"","sources":["../../src/api/index.gen.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * as models from "./models.gen.js";
2
+ export { CommandsApi } from "./commands.gen.js";
3
+ export { FsApi } from "./fs.gen.js";
4
+ //# sourceMappingURL=index.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.gen.js","sourceRoot":"","sources":["../../src/api/index.gen.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,399 @@
1
+ /**
2
+ * The output stream to read raw bytes from.
3
+ */
4
+ export type CommandLogStream = "stdout" | "stderr";
5
+ /**
6
+ * The collected output of a command.
7
+ */
8
+ export interface CommandLogsData {
9
+ /**
10
+ * The requested part of the standard output stream, base64-encoded.
11
+ */
12
+ stdout: string;
13
+ /**
14
+ * The requested part of the standard error stream, base64-encoded.
15
+ */
16
+ stderr: string;
17
+ /**
18
+ * The total number of bytes available in the standard output stream.
19
+ */
20
+ stdout_available: number;
21
+ /**
22
+ * The total number of bytes available in the standard error stream.
23
+ */
24
+ stderr_available: number;
25
+ }
26
+ /**
27
+ * The byte range of a single output stream to return.
28
+ */
29
+ export interface CommandLogsRange {
30
+ /**
31
+ * The first byte of the stream to return.
32
+ */
33
+ offset: number;
34
+ /**
35
+ * The maximum number of bytes to return. When omitted, everything from
36
+ * `offset` to the end of the stream is returned.
37
+ */
38
+ limit?: number;
39
+ }
40
+ /**
41
+ * The (optional) request body limiting which parts of the output streams are
42
+ * returned. When omitted, both streams are returned in their entirety.
43
+ */
44
+ export interface CommandLogsRequest {
45
+ /**
46
+ * The part of the standard output stream to return.
47
+ */
48
+ stdout: CommandLogsRange;
49
+ /**
50
+ * The part of the standard error stream to return.
51
+ */
52
+ stderr: CommandLogsRange;
53
+ }
54
+ /**
55
+ * The response to fetching the output of a command. `404` is returned, with an
56
+ * empty body, when no command with the given UUID exists. `410` is returned,
57
+ * with an
58
+ * empty body, if the command's logs have been deleted.
59
+ */
60
+ export interface CommandLogsResponse {
61
+ /**
62
+ * The status of the response.
63
+ */
64
+ status: ResponseStatus;
65
+ /**
66
+ * An optional message providing additional information about the status.
67
+ */
68
+ message?: string;
69
+ /**
70
+ * The response data for this request.
71
+ */
72
+ data: CommandLogsData;
73
+ /**
74
+ * A list of errors which may have occurred during the request.
75
+ */
76
+ errors?: ResponseError[];
77
+ /**
78
+ * The operation time in microseconds.
79
+ */
80
+ op_time_us: number;
81
+ }
82
+ /**
83
+ * The request to send a signal to a command.
84
+ */
85
+ export interface CommandSignalRequest {
86
+ /**
87
+ * The signal to send, either as a number or as a name, with or without the
88
+ * `SIG` prefix, e.g. `15`, `TERM` or `SIGTERM`.
89
+ */
90
+ signal: number | string;
91
+ }
92
+ /**
93
+ * The request to feed data into a command's standard input.
94
+ */
95
+ export interface CommandStdinRequest {
96
+ /**
97
+ * The bytes to feed into standard input, base64-encoded.
98
+ */
99
+ data: string;
100
+ /**
101
+ * Whether to close standard input after injecting `data`.
102
+ */
103
+ eof?: boolean;
104
+ }
105
+ /**
106
+ * The request to wait for a command to finish, up to a timeout.
107
+ */
108
+ export interface CommandWaitTimeoutRequest {
109
+ /**
110
+ * The maximum time to wait, in seconds. Decimals are accepted.
111
+ */
112
+ timeout_s: number;
113
+ }
114
+ /**
115
+ * A response which carries no data of its own. `data` is `null`; the outcome
116
+ * of
117
+ * the request is the HTTP status code.
118
+ */
119
+ export interface EmptyResponse {
120
+ /**
121
+ * The status of the response.
122
+ */
123
+ status: ResponseStatus;
124
+ /**
125
+ * An optional message providing additional information about the status.
126
+ */
127
+ message?: string;
128
+ /**
129
+ * The response data for this request.
130
+ */
131
+ data: unknown;
132
+ /**
133
+ * A list of errors which may have occurred during the request.
134
+ */
135
+ errors?: ResponseError[];
136
+ /**
137
+ * The operation time in microseconds.
138
+ */
139
+ op_time_us: number;
140
+ }
141
+ /**
142
+ * The encoding of the data written to a file.
143
+ */
144
+ export type FileEncoding = "utf-8" | "base64";
145
+ /**
146
+ * The state of a single command.
147
+ */
148
+ export interface GetCommandData {
149
+ /**
150
+ * The UUID of the command.
151
+ */
152
+ uuid: string;
153
+ /**
154
+ * The command line the command was started with.
155
+ */
156
+ cmdline: string;
157
+ /**
158
+ * The current working directory, if supplied at startup, else null
159
+ */
160
+ cwd: string | null;
161
+ /**
162
+ * Environment variables, if supplied at startup, else null
163
+ */
164
+ env: Record<string, string> | null;
165
+ /**
166
+ * The exit code of the command. It is `null` while the command is still
167
+ * running.
168
+ */
169
+ exitcode: number | null;
170
+ }
171
+ /**
172
+ * The response to inspecting a command. `404` is returned, with an empty body,
173
+ * when no command with the given UUID exists.
174
+ */
175
+ export interface GetCommandResponse {
176
+ /**
177
+ * The status of the response.
178
+ */
179
+ status: ResponseStatus;
180
+ /**
181
+ * An optional message providing additional information about the status.
182
+ */
183
+ message?: string;
184
+ /**
185
+ * The response data for this request.
186
+ */
187
+ data: GetCommandData;
188
+ /**
189
+ * A list of errors which may have occurred during the request.
190
+ */
191
+ errors?: ResponseError[];
192
+ /**
193
+ * The operation time in microseconds.
194
+ */
195
+ op_time_us: number;
196
+ }
197
+ /**
198
+ * The known commands.
199
+ */
200
+ export interface ListCommandsData {
201
+ /**
202
+ * The UUIDs of all known commands, in the order they were started.
203
+ */
204
+ commands: string[];
205
+ }
206
+ /**
207
+ * The response to listing the commands known to the sandbox.
208
+ */
209
+ export interface ListCommandsResponse {
210
+ /**
211
+ * The status of the response.
212
+ */
213
+ status: ResponseStatus;
214
+ /**
215
+ * An optional message providing additional information about the status.
216
+ */
217
+ message?: string;
218
+ /**
219
+ * The response data for this request.
220
+ */
221
+ data: ListCommandsData;
222
+ /**
223
+ * A list of errors which may have occurred during the request.
224
+ */
225
+ errors?: ResponseError[];
226
+ /**
227
+ * The operation time in microseconds.
228
+ */
229
+ op_time_us: number;
230
+ }
231
+ /**
232
+ * The request to create a directory in the sandbox filesystem.
233
+ */
234
+ export interface MkdirRequest {
235
+ /**
236
+ * The absolute path of the directory to create.
237
+ */
238
+ path: string;
239
+ /**
240
+ * Whether to create missing parent directories.
241
+ */
242
+ parents: boolean;
243
+ }
244
+ /**
245
+ * The contents of a file.
246
+ */
247
+ export interface ReadFileData {
248
+ /**
249
+ * The contents of the file, base64-encoded.
250
+ */
251
+ contents: string;
252
+ }
253
+ /**
254
+ * The request to read a file from the sandbox filesystem.
255
+ */
256
+ export interface ReadFileRequest {
257
+ /**
258
+ * The absolute path of the file to read.
259
+ */
260
+ path: string;
261
+ }
262
+ /**
263
+ * The response to reading a file. `500` is returned when the file could not be
264
+ * read.
265
+ */
266
+ export interface ReadFileResponse {
267
+ /**
268
+ * The status of the response.
269
+ */
270
+ status: ResponseStatus;
271
+ /**
272
+ * An optional message providing additional information about the status.
273
+ */
274
+ message?: string;
275
+ /**
276
+ * The response data for this request.
277
+ */
278
+ data: ReadFileData;
279
+ /**
280
+ * A list of errors which may have occurred during the request.
281
+ */
282
+ errors?: ResponseError[];
283
+ /**
284
+ * The operation time in microseconds.
285
+ */
286
+ op_time_us: number;
287
+ }
288
+ /**
289
+ * The error response message for an API request.
290
+ */
291
+ export interface ResponseError {
292
+ /**
293
+ * The HTTP status code of the error.
294
+ */
295
+ status: number;
296
+ }
297
+ /**
298
+ * The response status of an API request.
299
+ */
300
+ export type ResponseStatus = "success" | "error" | "partial_success";
301
+ /**
302
+ * The identity of a newly started command.
303
+ */
304
+ export interface RunCommandData {
305
+ /**
306
+ * The UUID assigned to the newly started command.
307
+ */
308
+ uuid: string;
309
+ }
310
+ /**
311
+ * The request to start a command in the sandbox.
312
+ */
313
+ export interface RunCommandRequest {
314
+ /**
315
+ * The command line to run, as passed to the shell.
316
+ */
317
+ cmd: string;
318
+ /**
319
+ * (OPTIONAL) Current working directory
320
+ */
321
+ cwd?: string;
322
+ /**
323
+ * (OPTIONAL) Environment variables
324
+ */
325
+ env?: Record<string, string>;
326
+ }
327
+ /**
328
+ * The response to starting a command. `500` is returned when the command could
329
+ * not be spawned.
330
+ */
331
+ export interface RunCommandResponse {
332
+ /**
333
+ * The status of the response.
334
+ */
335
+ status: ResponseStatus;
336
+ /**
337
+ * An optional message providing additional information about the status.
338
+ */
339
+ message?: string;
340
+ /**
341
+ * The response data for this request.
342
+ */
343
+ data: RunCommandData;
344
+ /**
345
+ * A list of errors which may have occurred during the request.
346
+ */
347
+ errors?: ResponseError[];
348
+ /**
349
+ * The operation time in microseconds.
350
+ */
351
+ op_time_us: number;
352
+ }
353
+ /**
354
+ * The request to upload a file to the sandbox filesystem.
355
+ */
356
+ export interface UploadFileRequest {
357
+ /**
358
+ * Path where to upload the file.
359
+ */
360
+ path: string;
361
+ /**
362
+ * Name of uploaded file; will be used if `path` is a directory.
363
+ */
364
+ filename: string;
365
+ /**
366
+ * Whether to create parent directories of `path`.
367
+ */
368
+ parents: boolean;
369
+ /**
370
+ * The encoding of `data`.
371
+ */
372
+ encoding: FileEncoding;
373
+ /**
374
+ * The data to write, in the given encoding
375
+ */
376
+ data: string;
377
+ }
378
+ /**
379
+ * The request to write a file in the sandbox filesystem.
380
+ */
381
+ export interface WriteFileRequest {
382
+ /**
383
+ * The absolute path of the file to write. It is created if missing.
384
+ */
385
+ path: string;
386
+ /**
387
+ * Whether to append to the file instead of truncating it.
388
+ */
389
+ append: boolean;
390
+ /**
391
+ * The encoding of `data`.
392
+ */
393
+ encoding: FileEncoding;
394
+ /**
395
+ * The data to write, in the given encoding.
396
+ */
397
+ data: string;
398
+ }
399
+ //# sourceMappingURL=models.gen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.gen.d.ts","sourceRoot":"","sources":["../../src/api/models.gen.ts"],"names":[],"mappings":"AAMA;;GAEG;AAEH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD;;GAEG;AAEH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAE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jB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AAEH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,7 @@
1
+ // Code generated by openapi-gen; DO NOT EDIT.
2
+ //
3
+ // Type definitions for the Unikraft Cloud `sandbox`
4
+ // plugin API, generated from its OpenAPI specification. These mirror the wire
5
+ // format exactly.
6
+ export {};
7
+ //# sourceMappingURL=models.gen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.gen.js","sourceRoot":"","sources":["../../src/api/models.gen.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,oDAAoD;AACpD,8EAA8E;AAC9E,kBAAkB"}
@@ -0,0 +1,25 @@
1
+ import { CommandsApi } from "./api/commands.gen.js";
2
+ import { FsApi } from "./api/fs.gen.js";
3
+ import type { ApiClientConfig } from "@unikraft/cloud/core/http";
4
+ /**
5
+ * Deriving the URL is the porcelain layer's job, in `@unikraft/cloud`. Reach
6
+ * for this class only when you want the raw envelopes against an instance you
7
+ * already have.
8
+ *
9
+ * @example
10
+ * import { SandboxPluginApi } from "@unikraft/cloud-plugin-sandbox-api";
11
+ *
12
+ * const api = new SandboxPluginApi({
13
+ * baseUrl: `https://api.fra.unikraft.cloud/v1/instances/${uuid}/plugins/sandbox`,
14
+ * token: process.env.UKC_TOKEN,
15
+ * });
16
+ */
17
+ export declare class SandboxPluginApi {
18
+ /** The `commands` resource of this plugin. */
19
+ readonly commands: CommandsApi;
20
+ /** The `fs` resource of this plugin. */
21
+ readonly fs: FsApi;
22
+ constructor(config: ApiClientConfig);
23
+ }
24
+ export * from "./api/index.gen.js";
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;;;;;;;;GAYG;AACH,qBAAa,gBAAgB;IAC3B,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,wCAAwC;IACxC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAEnB,YAAY,MAAM,EAAE,eAAe,EAGlC;CACF;AAED,cAAc,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,33 @@
1
+ // Code generated by openapi-gen; DO NOT EDIT.
2
+ //
3
+ // The `sandbox` plugin API's "plumbing" layer: the generated clients, plus a
4
+ // container that groups them behind one transport config. Everything here
5
+ // returns the response envelope exactly as the OpenAPI specification describes
6
+ // it.
7
+ import { CommandsApi } from "./api/commands.gen.js";
8
+ import { FsApi } from "./api/fs.gen.js";
9
+ /**
10
+ * Deriving the URL is the porcelain layer's job, in `@unikraft/cloud`. Reach
11
+ * for this class only when you want the raw envelopes against an instance you
12
+ * already have.
13
+ *
14
+ * @example
15
+ * import { SandboxPluginApi } from "@unikraft/cloud-plugin-sandbox-api";
16
+ *
17
+ * const api = new SandboxPluginApi({
18
+ * baseUrl: `https://api.fra.unikraft.cloud/v1/instances/${uuid}/plugins/sandbox`,
19
+ * token: process.env.UKC_TOKEN,
20
+ * });
21
+ */
22
+ export class SandboxPluginApi {
23
+ /** The `commands` resource of this plugin. */
24
+ commands;
25
+ /** The `fs` resource of this plugin. */
26
+ fs;
27
+ constructor(config) {
28
+ this.commands = new CommandsApi(config);
29
+ this.fs = new FsApi(config);
30
+ }
31
+ }
32
+ export * from "./api/index.gen.js";
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,6EAA6E;AAC7E,0EAA0E;AAC1E,+EAA+E;AAC/E,MAAM;AACN,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAIxC;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,gBAAgB;IAC3B,8CAA8C;IACrC,QAAQ,CAAc;IAC/B,wCAAwC;IAC/B,EAAE,CAAQ;IAEnB,YAAY,MAAuB;QACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,EAAE,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACF;AAED,cAAc,oBAAoB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@unikraft/cloud-plugin-sandbox-api",
3
+ "version": "1.0.0",
4
+ "description": "Generated TypeScript client for the Unikraft Cloud `sandbox` plugin API",
5
+ "license": "BSD-3-Clause",
6
+ "author": "Unikraft GmbH",
7
+ "homepage": "https://unikraft.com",
8
+ "keywords": ["unikraft", "unikraft-cloud", "plugin", "sandbox", "sdk"],
9
+ "type": "module",
10
+ "engines": {
11
+ "node": ">=22.12.0"
12
+ },
13
+ "sideEffects": false,
14
+ "types": "./dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ },
20
+ "./models": {
21
+ "types": "./dist/api/models.gen.d.ts",
22
+ "default": "./dist/api/models.gen.js"
23
+ },
24
+ "./package.json": "./package.json"
25
+ },
26
+ "files": ["dist", "README.md"],
27
+ "scripts": {
28
+ "build": "tsc",
29
+ "clean": "rm -rf dist",
30
+ "typecheck": "tsc --noEmit",
31
+ "format": "biome format --write src"
32
+ },
33
+ "peerDependencies": {
34
+ "@unikraft/cloud": ">=0.1.1-0 <0.2.0"
35
+ },
36
+ "devDependencies": {
37
+ "@biomejs/biome": "^2.5.13",
38
+ "typescript": "^7.0.2"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "unikraft": {
44
+ "specHash": "af5b738a14b97a6b56d74602c9850d52b84cc57e8f77dc432e17d2f4af1b0dd2",
45
+ "templatesHash": "7865c58d814ce655eabe8df6b301d244eda8068c58a49017352f276a7cee00dd",
46
+ "configHash": "f4ba903b05eddea30718814df4f755822c424fa41761507559e1bba262dffa1a"
47
+ }
48
+ }