@solarisdk/runloop-compat 0.0.0-stage → 0.1.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/COMPAT.md +110 -0
- package/LICENSE +17 -0
- package/LICENSE-RUNLOOP +7 -0
- package/NOTICE +14 -0
- package/README.md +46 -2
- package/dist/blueprint-types.d.ts +522 -0
- package/dist/blueprint-types.d.ts.map +1 -0
- package/dist/blueprint-types.js +4 -0
- package/dist/blueprint-types.js.map +1 -0
- package/dist/blueprints.d.ts +71 -0
- package/dist/blueprints.d.ts.map +1 -0
- package/dist/blueprints.js +233 -0
- package/dist/blueprints.js.map +1 -0
- package/dist/client.d.ts +290 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +924 -0
- package/dist/client.js.map +1 -0
- package/dist/context.d.ts +42 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +198 -0
- package/dist/context.js.map +1 -0
- package/dist/dockerfile.d.ts +36 -0
- package/dist/dockerfile.d.ts.map +1 -0
- package/dist/dockerfile.js +338 -0
- package/dist/dockerfile.js.map +1 -0
- package/dist/errors.d.ts +67 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +171 -0
- package/dist/errors.js.map +1 -0
- package/dist/image-ref.d.ts +35 -0
- package/dist/image-ref.d.ts.map +1 -0
- package/dist/image-ref.js +97 -0
- package/dist/image-ref.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/mapping.d.ts +49 -0
- package/dist/mapping.d.ts.map +1 -0
- package/dist/mapping.js +204 -0
- package/dist/mapping.js.map +1 -0
- package/dist/sdk.d.ts +182 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/sdk.js +356 -0
- package/dist/sdk.js.map +1 -0
- package/dist/secrets.d.ts +41 -0
- package/dist/secrets.d.ts.map +1 -0
- package/dist/secrets.js +58 -0
- package/dist/secrets.js.map +1 -0
- package/dist/shared-types.d.ts +440 -0
- package/dist/shared-types.d.ts.map +1 -0
- package/dist/shared-types.js +4 -0
- package/dist/shared-types.js.map +1 -0
- package/dist/types.d.ts +920 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/package.json +48 -4
package/dist/sdk.js
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
// Object layer: `new RunloopSDK()` → `sdk.devbox.create()`, `devbox.cmd.exec()`,
|
|
2
|
+
// `devbox.file.read()` … mirrors @runloop/api-client 2.0.0 `sdk.d.ts`, on top of {@link Runloop}.
|
|
3
|
+
import * as Errors from "./errors.js";
|
|
4
|
+
import { BlueprintOps } from "./blueprints.js";
|
|
5
|
+
import { StorageObjectOps } from "./context.js";
|
|
6
|
+
import { SolariCompatUnsupported, unsupportedNamespace } from "./errors.js";
|
|
7
|
+
import { Runloop, } from "./client.js";
|
|
8
|
+
function lastNLines(text, n) {
|
|
9
|
+
const ls = text.split("\n");
|
|
10
|
+
if (ls.at(-1) === "")
|
|
11
|
+
ls.pop();
|
|
12
|
+
return ls.slice(-n).join("\n");
|
|
13
|
+
}
|
|
14
|
+
/** Terminal result of a command (`devbox.cmd.exec`). */
|
|
15
|
+
export class ExecutionResult {
|
|
16
|
+
_devboxId;
|
|
17
|
+
_executionId;
|
|
18
|
+
_result;
|
|
19
|
+
constructor(_devboxId, _executionId, _result) {
|
|
20
|
+
this._devboxId = _devboxId;
|
|
21
|
+
this._executionId = _executionId;
|
|
22
|
+
this._result = _result;
|
|
23
|
+
}
|
|
24
|
+
get exitCode() {
|
|
25
|
+
return this._result.exit_status ?? null;
|
|
26
|
+
}
|
|
27
|
+
get executionId() {
|
|
28
|
+
return this._executionId;
|
|
29
|
+
}
|
|
30
|
+
get devboxId() {
|
|
31
|
+
return this._devboxId;
|
|
32
|
+
}
|
|
33
|
+
async stdout(numLines) {
|
|
34
|
+
const s = this._result.stdout ?? "";
|
|
35
|
+
return numLines === undefined ? s : lastNLines(s, numLines);
|
|
36
|
+
}
|
|
37
|
+
async stderr(numLines) {
|
|
38
|
+
const s = this._result.stderr ?? "";
|
|
39
|
+
return numLines === undefined ? s : lastNLines(s, numLines);
|
|
40
|
+
}
|
|
41
|
+
get result() {
|
|
42
|
+
return this._result;
|
|
43
|
+
}
|
|
44
|
+
get success() {
|
|
45
|
+
return this.exitCode === 0;
|
|
46
|
+
}
|
|
47
|
+
get failed() {
|
|
48
|
+
return this.exitCode !== null && this.exitCode !== 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** A running command started with `devbox.cmd.execAsync`. Live-handle only (see COMPAT.md). */
|
|
52
|
+
export class Execution {
|
|
53
|
+
client;
|
|
54
|
+
rec;
|
|
55
|
+
constructor(client, rec) {
|
|
56
|
+
this.client = client;
|
|
57
|
+
this.rec = rec;
|
|
58
|
+
}
|
|
59
|
+
get executionId() {
|
|
60
|
+
return this.rec.executionId;
|
|
61
|
+
}
|
|
62
|
+
get devboxId() {
|
|
63
|
+
return this.rec.devboxId;
|
|
64
|
+
}
|
|
65
|
+
async sendStdIn(input, _options) {
|
|
66
|
+
if (!this.rec.handle)
|
|
67
|
+
throw new SolariCompatUnsupported("sendStdIn on a finished execution");
|
|
68
|
+
await this.rec.handle.stdin(input);
|
|
69
|
+
}
|
|
70
|
+
async closeStdIn(_options) {
|
|
71
|
+
throw new SolariCompatUnsupported("closeStdIn", "Solari command handles cannot close stdin; end the program with an in-band EOF (for example Ctrl-D) instead");
|
|
72
|
+
}
|
|
73
|
+
async result(_options) {
|
|
74
|
+
await this.rec.done;
|
|
75
|
+
return new ExecutionResult(this.rec.devboxId, this.rec.executionId, this.client.devboxes.view(this.rec));
|
|
76
|
+
}
|
|
77
|
+
async getState(_options) {
|
|
78
|
+
return this.client.devboxes.view(this.rec);
|
|
79
|
+
}
|
|
80
|
+
async kill(_options) {
|
|
81
|
+
await this.rec.handle?.kill();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export class DevboxCmdOps {
|
|
85
|
+
client;
|
|
86
|
+
devboxId;
|
|
87
|
+
constructor(client, devboxId) {
|
|
88
|
+
this.client = client;
|
|
89
|
+
this.devboxId = devboxId;
|
|
90
|
+
}
|
|
91
|
+
async exec(command, params = {}, _options) {
|
|
92
|
+
const { shell_name, ...cbs } = params;
|
|
93
|
+
if (shell_name)
|
|
94
|
+
throw new SolariCompatUnsupported("named shells (shell_name)");
|
|
95
|
+
const rec = await this.client.devboxes.startExecution(this.devboxId, command, cbs);
|
|
96
|
+
await rec.done;
|
|
97
|
+
return new ExecutionResult(this.devboxId, rec.executionId, this.client.devboxes.view(rec));
|
|
98
|
+
}
|
|
99
|
+
async execAsync(command, params = {}, _options) {
|
|
100
|
+
const { shell_name, ...cbs } = params;
|
|
101
|
+
if (shell_name)
|
|
102
|
+
throw new SolariCompatUnsupported("named shells (shell_name)");
|
|
103
|
+
const rec = await this.client.devboxes.startExecution(this.devboxId, command, cbs);
|
|
104
|
+
return new Execution(this.client, rec);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
export class DevboxFileOps {
|
|
108
|
+
client;
|
|
109
|
+
devboxId;
|
|
110
|
+
constructor(client, devboxId) {
|
|
111
|
+
this.client = client;
|
|
112
|
+
this.devboxId = devboxId;
|
|
113
|
+
}
|
|
114
|
+
read(params, options) {
|
|
115
|
+
return this.client.devboxes.readFileContents(this.devboxId, params, options);
|
|
116
|
+
}
|
|
117
|
+
write(params, options) {
|
|
118
|
+
return this.client.devboxes.writeFileContents(this.devboxId, params, options);
|
|
119
|
+
}
|
|
120
|
+
download(params, options) {
|
|
121
|
+
return this.client.devboxes.downloadFile(this.devboxId, params, options);
|
|
122
|
+
}
|
|
123
|
+
upload(params, options) {
|
|
124
|
+
return this.client.devboxes.uploadFile(this.devboxId, params, options);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export class DevboxNetOps {
|
|
128
|
+
client;
|
|
129
|
+
devboxId;
|
|
130
|
+
constructor(client, devboxId) {
|
|
131
|
+
this.client = client;
|
|
132
|
+
this.devboxId = devboxId;
|
|
133
|
+
}
|
|
134
|
+
createSSHKey() {
|
|
135
|
+
throw new SolariCompatUnsupported("devbox.net.createSSHKey");
|
|
136
|
+
}
|
|
137
|
+
/** `authenticated` (default, returns `auth_token`) or `open`; `wake_on_http` needs `authenticated`. */
|
|
138
|
+
enableTunnel(params = {}, options) {
|
|
139
|
+
return this.client.devboxes.enableTunnel(this.devboxId, params, options);
|
|
140
|
+
}
|
|
141
|
+
removeTunnel(options) {
|
|
142
|
+
return this.client.devboxes.removeTunnel(this.devboxId, options);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export class Devbox {
|
|
146
|
+
client;
|
|
147
|
+
_id;
|
|
148
|
+
net;
|
|
149
|
+
cmd;
|
|
150
|
+
file;
|
|
151
|
+
constructor(client, _id) {
|
|
152
|
+
this.client = client;
|
|
153
|
+
this._id = _id;
|
|
154
|
+
this.net = new DevboxNetOps(client, _id);
|
|
155
|
+
this.cmd = new DevboxCmdOps(client, _id);
|
|
156
|
+
this.file = new DevboxFileOps(client, _id);
|
|
157
|
+
}
|
|
158
|
+
static async create(client, params = {}, options) {
|
|
159
|
+
const v = await client.devboxes.create(params, options);
|
|
160
|
+
await client.devboxes.awaitRunning(v.id, options);
|
|
161
|
+
return new Devbox(client, v.id);
|
|
162
|
+
}
|
|
163
|
+
static createFromBlueprintId(client, blueprintId, params = {}, options) {
|
|
164
|
+
return Devbox.create(client, { ...params, blueprint_id: blueprintId }, options);
|
|
165
|
+
}
|
|
166
|
+
/** `blueprintName` is a Solari template: a built-in (`base`) or a blueprint built with `blueprint.create`. */
|
|
167
|
+
static createFromBlueprintName(client, blueprintName, params = {}, options) {
|
|
168
|
+
return Devbox.create(client, { ...params, blueprint_name: blueprintName }, options);
|
|
169
|
+
}
|
|
170
|
+
static createFromSnapshot(client, snapshotId, params = {}, options) {
|
|
171
|
+
return Devbox.create(client, { ...params, snapshot_id: snapshotId }, options);
|
|
172
|
+
}
|
|
173
|
+
static fromId(client, id) {
|
|
174
|
+
if (!id)
|
|
175
|
+
throw new Error("Devbox.fromId requires an id");
|
|
176
|
+
return new Devbox(client, id);
|
|
177
|
+
}
|
|
178
|
+
get id() {
|
|
179
|
+
return this._id;
|
|
180
|
+
}
|
|
181
|
+
shell(_name) {
|
|
182
|
+
throw new SolariCompatUnsupported("named shells (devbox.shell)");
|
|
183
|
+
}
|
|
184
|
+
getInfo(options) {
|
|
185
|
+
return this.client.devboxes.retrieve(this._id, options);
|
|
186
|
+
}
|
|
187
|
+
/** The devbox's tunnel, or `null` when none is enabled. */
|
|
188
|
+
getTunnel(_options) {
|
|
189
|
+
return this.client.devboxes.tunnelOrNull(this._id);
|
|
190
|
+
}
|
|
191
|
+
/** Returns Solari's public preview URL for the port. */
|
|
192
|
+
getTunnelUrl(port, _options) {
|
|
193
|
+
return this.client.devboxes.previewUrl(this._id, port);
|
|
194
|
+
}
|
|
195
|
+
logs(params = {}, options) {
|
|
196
|
+
return this.client.devboxes.logs(this._id, params, options);
|
|
197
|
+
}
|
|
198
|
+
update(params, options) {
|
|
199
|
+
return this.client.devboxes.update(this._id, params, options);
|
|
200
|
+
}
|
|
201
|
+
awaitRunning(options) {
|
|
202
|
+
return this.client.devboxes.awaitRunning(this._id, options);
|
|
203
|
+
}
|
|
204
|
+
awaitSuspended(options) {
|
|
205
|
+
return this.client.devboxes.awaitSuspended(this._id, options);
|
|
206
|
+
}
|
|
207
|
+
async snapshotDisk(params = {}, options) {
|
|
208
|
+
const s = await this.client.devboxes.snapshotDisk(this._id, params, options);
|
|
209
|
+
return Snapshot.fromId(this.client, s.id);
|
|
210
|
+
}
|
|
211
|
+
snapshotDiskAsync(params = {}, options) {
|
|
212
|
+
return this.snapshotDisk(params, options);
|
|
213
|
+
}
|
|
214
|
+
shutdown(options) {
|
|
215
|
+
return this.client.devboxes.shutdown(this._id, undefined, options);
|
|
216
|
+
}
|
|
217
|
+
suspend(options) {
|
|
218
|
+
return this.client.devboxes.suspend(this._id, options);
|
|
219
|
+
}
|
|
220
|
+
resume(options) {
|
|
221
|
+
return this.client.devboxes.resume(this._id, options);
|
|
222
|
+
}
|
|
223
|
+
resumeAsync(options) {
|
|
224
|
+
return this.client.devboxes.resumeAsync(this._id, options);
|
|
225
|
+
}
|
|
226
|
+
keepAlive(options) {
|
|
227
|
+
return this.client.devboxes.keepAlive(this._id, options);
|
|
228
|
+
}
|
|
229
|
+
onEvict() {
|
|
230
|
+
throw new SolariCompatUnsupported("devbox.onEvict");
|
|
231
|
+
}
|
|
232
|
+
cancelOnEvict() {
|
|
233
|
+
throw new SolariCompatUnsupported("devbox.cancelOnEvict");
|
|
234
|
+
}
|
|
235
|
+
/** Stop local resources (closes the control channel). Does not shut the devbox down. */
|
|
236
|
+
close() {
|
|
237
|
+
this.client.dropHandle(this._id);
|
|
238
|
+
}
|
|
239
|
+
async [Symbol.asyncDispose]() {
|
|
240
|
+
await this.shutdown();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
export class Snapshot {
|
|
244
|
+
client;
|
|
245
|
+
_id;
|
|
246
|
+
constructor(client, _id) {
|
|
247
|
+
this.client = client;
|
|
248
|
+
this._id = _id;
|
|
249
|
+
}
|
|
250
|
+
static fromId(client, id) {
|
|
251
|
+
return new Snapshot(client, id);
|
|
252
|
+
}
|
|
253
|
+
static async list(client, params = {}) {
|
|
254
|
+
const r = await client.devboxes.diskSnapshots.list(params);
|
|
255
|
+
return r.snapshots.map((s) => new Snapshot(client, s.id));
|
|
256
|
+
}
|
|
257
|
+
get id() {
|
|
258
|
+
return this._id;
|
|
259
|
+
}
|
|
260
|
+
getInfo(_options) {
|
|
261
|
+
return this.client.devboxes.diskSnapshots.retrieve(this._id);
|
|
262
|
+
}
|
|
263
|
+
/** Same as {@link getInfo}: Solari snapshots are complete when created. */
|
|
264
|
+
queryStatus() {
|
|
265
|
+
return this.getInfo();
|
|
266
|
+
}
|
|
267
|
+
awaitCompleted() {
|
|
268
|
+
return this.getInfo();
|
|
269
|
+
}
|
|
270
|
+
async update(params = {}, _options) {
|
|
271
|
+
await this.client.devboxes.diskSnapshots.update(this._id, params);
|
|
272
|
+
}
|
|
273
|
+
delete(_options) {
|
|
274
|
+
return this.client.devboxes.diskSnapshots.delete(this._id);
|
|
275
|
+
}
|
|
276
|
+
createDevbox(params = {}, options) {
|
|
277
|
+
return Devbox.createFromSnapshot(this.client, this._id, params, options);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
export class DevboxOps {
|
|
281
|
+
client;
|
|
282
|
+
constructor(client) {
|
|
283
|
+
this.client = client;
|
|
284
|
+
}
|
|
285
|
+
create(params = {}, options) {
|
|
286
|
+
return Devbox.create(this.client, params, options);
|
|
287
|
+
}
|
|
288
|
+
createFromBlueprintId(blueprintId, params = {}, options) {
|
|
289
|
+
return Devbox.createFromBlueprintId(this.client, blueprintId, params, options);
|
|
290
|
+
}
|
|
291
|
+
createFromBlueprintName(blueprintName, params = {}, options) {
|
|
292
|
+
return Devbox.createFromBlueprintName(this.client, blueprintName, params, options);
|
|
293
|
+
}
|
|
294
|
+
createFromSnapshot(snapshotId, params = {}, options) {
|
|
295
|
+
return Devbox.createFromSnapshot(this.client, snapshotId, params, options);
|
|
296
|
+
}
|
|
297
|
+
fromId(id) {
|
|
298
|
+
return Devbox.fromId(this.client, id);
|
|
299
|
+
}
|
|
300
|
+
async list(params = {}, options) {
|
|
301
|
+
void options;
|
|
302
|
+
const out = [];
|
|
303
|
+
const page = await this.client.devboxes.list(params);
|
|
304
|
+
for (const v of page.getPaginatedItems())
|
|
305
|
+
out.push(Devbox.fromId(this.client, v.id));
|
|
306
|
+
return out;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
export class SnapshotOps {
|
|
310
|
+
client;
|
|
311
|
+
constructor(client) {
|
|
312
|
+
this.client = client;
|
|
313
|
+
}
|
|
314
|
+
list(params = {}) {
|
|
315
|
+
return Snapshot.list(this.client, params);
|
|
316
|
+
}
|
|
317
|
+
fromId(id) {
|
|
318
|
+
return Snapshot.fromId(this.client, id);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
export class RunloopSDK {
|
|
322
|
+
// Error classes hang off the class, as in Runloop's SDK (`RunloopSDK.APIError`).
|
|
323
|
+
static RunloopError = Errors.RunloopError;
|
|
324
|
+
static APIError = Errors.APIError;
|
|
325
|
+
static APIConnectionError = Errors.APIConnectionError;
|
|
326
|
+
static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
327
|
+
static APIUserAbortError = Errors.APIUserAbortError;
|
|
328
|
+
static NotFoundError = Errors.NotFoundError;
|
|
329
|
+
static ConflictError = Errors.ConflictError;
|
|
330
|
+
static RateLimitError = Errors.RateLimitError;
|
|
331
|
+
static BadRequestError = Errors.BadRequestError;
|
|
332
|
+
static AuthenticationError = Errors.AuthenticationError;
|
|
333
|
+
static PermissionDeniedError = Errors.PermissionDeniedError;
|
|
334
|
+
static UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
335
|
+
static InternalServerError = Errors.InternalServerError;
|
|
336
|
+
static SolariCompatUnsupported = Errors.SolariCompatUnsupported;
|
|
337
|
+
api;
|
|
338
|
+
devbox;
|
|
339
|
+
snapshot;
|
|
340
|
+
blueprint;
|
|
341
|
+
storageObject;
|
|
342
|
+
agent = unsupportedNamespace("agent");
|
|
343
|
+
axon = unsupportedNamespace("axon");
|
|
344
|
+
networkPolicy = unsupportedNamespace("networkPolicy");
|
|
345
|
+
gatewayConfig = unsupportedNamespace("gatewayConfig");
|
|
346
|
+
mcpConfig = unsupportedNamespace("mcpConfig");
|
|
347
|
+
secret = unsupportedNamespace("secret");
|
|
348
|
+
constructor(options = {}) {
|
|
349
|
+
this.api = new Runloop(options);
|
|
350
|
+
this.devbox = new DevboxOps(this.api);
|
|
351
|
+
this.snapshot = new SnapshotOps(this.api);
|
|
352
|
+
this.blueprint = new BlueprintOps(this.api, (p) => Devbox.create(this.api, p));
|
|
353
|
+
this.storageObject = new StorageObjectOps(this.api.contexts);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
//# sourceMappingURL=sdk.js.map
|
package/dist/sdk.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,kGAAkG;AAElG,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EACL,OAAO,GAMR,MAAM,aAAa,CAAC;AAqBrB,SAAS,UAAU,CAAC,IAAY,EAAE,CAAS;IACzC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;QAAE,EAAE,CAAC,GAAG,EAAE,CAAC;IAC/B,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,wDAAwD;AACxD,MAAM,OAAO,eAAe;IAEP;IACA;IACA;IAHnB,YACmB,SAAiB,EACjB,YAAoB,EACpB,OAAuC;QAFvC,cAAS,GAAT,SAAS,CAAQ;QACjB,iBAAY,GAAZ,YAAY,CAAQ;QACpB,YAAO,GAAP,OAAO,CAAgC;IACvD,CAAC;IACJ,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,IAAI,CAAC;IAC1C,CAAC;IACD,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IACD,IAAI,QAAQ;QACV,OAAO,IAAI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,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/D,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Runloop, RequestOptions } from "./client.js";
|
|
2
|
+
/** Runloop's `SecretView`. Solari secrets have no ids: `id` is the name. */
|
|
3
|
+
export interface SecretView {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
create_time_ms: number;
|
|
7
|
+
update_time_ms: number;
|
|
8
|
+
}
|
|
9
|
+
export interface SecretCreateParams {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SecretUpdateParams {
|
|
14
|
+
value: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SecretListParams {
|
|
17
|
+
limit?: number;
|
|
18
|
+
starting_after?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface SecretListView {
|
|
21
|
+
secrets: SecretView[];
|
|
22
|
+
has_more: boolean;
|
|
23
|
+
total_count: number;
|
|
24
|
+
/** @internal Pass back as `starting_after` for the next page. */
|
|
25
|
+
next_cursor?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare class Secrets {
|
|
28
|
+
private readonly client;
|
|
29
|
+
constructor(client: Runloop);
|
|
30
|
+
/** `POST /secrets`: 409 (`ConflictError`) if the name exists. */
|
|
31
|
+
create(params: SecretCreateParams, _options?: RequestOptions): Promise<SecretView>;
|
|
32
|
+
/** Metadata only; the value is never returned. */
|
|
33
|
+
retrieve(name: string, _options?: RequestOptions): Promise<SecretView>;
|
|
34
|
+
/** `PUT /secrets/:name`: replaces the value. Sandboxes that already received the old value keep it. */
|
|
35
|
+
update(name: string, params: SecretUpdateParams, _options?: RequestOptions): Promise<SecretView>;
|
|
36
|
+
/** One page (`limit` up to 100). `starting_after` is the previous page's `next_cursor`. */
|
|
37
|
+
list(params?: SecretListParams, _options?: RequestOptions): Promise<SecretListView>;
|
|
38
|
+
/** Idempotent. Returns the view the secret had (Runloop returns the deleted secret); name only when it was already gone. */
|
|
39
|
+
delete(name: string, _options?: RequestOptions): Promise<SecretView>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=secrets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG3D,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAmBD,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,OAAO;IAE5C,iEAAiE;IAC3D,MAAM,CAAC,MAAM,EAAE,kBAAkB,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAKxF,kDAAkD;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAI5E,uGAAuG;IACjG,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAKtG,2FAA2F;IACrF,IAAI,CAAC,MAAM,GAAE,gBAAqB,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAY7F,4HAA4H;IACtH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;CAU3E"}
|
package/dist/secrets.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// `client.secrets`: Runloop's secret store on Solari account secrets (`/secrets`, desktop#583).
|
|
2
|
+
// Write-only on the gateway: no call returns a value. Secret values never appear in an error
|
|
3
|
+
// message, a log line or a return value produced here.
|
|
4
|
+
import { translating } from "./errors.js";
|
|
5
|
+
function toView(s) {
|
|
6
|
+
return {
|
|
7
|
+
id: s.name,
|
|
8
|
+
name: s.name,
|
|
9
|
+
create_time_ms: Date.parse(s.createdAt ?? "") || 0,
|
|
10
|
+
update_time_ms: Date.parse(s.updatedAt ?? "") || 0,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
const path = (name) => `/secrets/${encodeURIComponent(name)}`;
|
|
14
|
+
export class Secrets {
|
|
15
|
+
client;
|
|
16
|
+
constructor(client) {
|
|
17
|
+
this.client = client;
|
|
18
|
+
}
|
|
19
|
+
/** `POST /secrets`: 409 (`ConflictError`) if the name exists. */
|
|
20
|
+
async create(params, _options) {
|
|
21
|
+
const body = { name: params.name, value: params.value };
|
|
22
|
+
return toView(await translating(() => this.client.http.request("POST", "/secrets", body)));
|
|
23
|
+
}
|
|
24
|
+
/** Metadata only; the value is never returned. */
|
|
25
|
+
async retrieve(name, _options) {
|
|
26
|
+
return toView(await translating(() => this.client.http.request("GET", path(name))));
|
|
27
|
+
}
|
|
28
|
+
/** `PUT /secrets/:name`: replaces the value. Sandboxes that already received the old value keep it. */
|
|
29
|
+
async update(name, params, _options) {
|
|
30
|
+
const body = { value: params.value };
|
|
31
|
+
return toView(await translating(() => this.client.http.request("PUT", path(name), body)));
|
|
32
|
+
}
|
|
33
|
+
/** One page (`limit` up to 100). `starting_after` is the previous page's `next_cursor`. */
|
|
34
|
+
async list(params = {}, _options) {
|
|
35
|
+
const q = new URLSearchParams();
|
|
36
|
+
if (params.limit)
|
|
37
|
+
q.set("limit", String(Math.min(100, Math.trunc(params.limit))));
|
|
38
|
+
if (params.starting_after)
|
|
39
|
+
q.set("cursor", params.starting_after);
|
|
40
|
+
const qs = q.toString();
|
|
41
|
+
const r = await translating(() => this.client.http.request("GET", `/secrets${qs ? `?${qs}` : ""}`));
|
|
42
|
+
const secrets = (r.secrets ?? []).map(toView);
|
|
43
|
+
return { secrets, has_more: !!r.nextCursor, total_count: secrets.length, ...(r.nextCursor ? { next_cursor: r.nextCursor } : {}) };
|
|
44
|
+
}
|
|
45
|
+
/** Idempotent. Returns the view the secret had (Runloop returns the deleted secret); name only when it was already gone. */
|
|
46
|
+
async delete(name, _options) {
|
|
47
|
+
let view = { id: name, name, create_time_ms: 0, update_time_ms: 0 };
|
|
48
|
+
try {
|
|
49
|
+
view = await this.retrieve(name);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
/* already gone: delete is idempotent */
|
|
53
|
+
}
|
|
54
|
+
await translating(() => this.client.http.request("DELETE", path(name)));
|
|
55
|
+
return view;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=secrets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,6FAA6F;AAC7F,uDAAuD;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAsC1C,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