@miosa/sdk 1.2.4 → 1.2.6

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.
Files changed (100) hide show
  1. package/README.md +75 -3
  2. package/dist/index.d.ts +323 -175
  3. package/dist/index.js +441 -386
  4. package/dist/index.js.map +1 -1
  5. package/package.json +1 -2
  6. package/src/client.ts +0 -293
  7. package/src/errors.ts +0 -136
  8. package/src/http.test.ts +0 -374
  9. package/src/http.ts +0 -390
  10. package/src/index.ts +0 -564
  11. package/src/resources/admin.ts +0 -359
  12. package/src/resources/analytics.ts +0 -60
  13. package/src/resources/api-keys.ts +0 -135
  14. package/src/resources/audit-log.ts +0 -64
  15. package/src/resources/benchmarks.ts +0 -104
  16. package/src/resources/builder-sessions.ts +0 -75
  17. package/src/resources/channels.ts +0 -143
  18. package/src/resources/checkpoints.ts +0 -225
  19. package/src/resources/command-center.ts +0 -73
  20. package/src/resources/community.ts +0 -103
  21. package/src/resources/completions.ts +0 -104
  22. package/src/resources/computer-auto-stop.ts +0 -43
  23. package/src/resources/computer-env.ts +0 -76
  24. package/src/resources/computer-logs.ts +0 -50
  25. package/src/resources/computer-osa.ts +0 -76
  26. package/src/resources/computer-ports.ts +0 -91
  27. package/src/resources/computer-terminal.ts +0 -61
  28. package/src/resources/computer-volumes.ts +0 -64
  29. package/src/resources/computer.ts +0 -551
  30. package/src/resources/computers.ts +0 -75
  31. package/src/resources/credits.ts +0 -43
  32. package/src/resources/cron-jobs.ts +0 -191
  33. package/src/resources/custom_domains.ts +0 -123
  34. package/src/resources/dashboard.ts +0 -49
  35. package/src/resources/databases.ts +0 -218
  36. package/src/resources/deployments.test.ts +0 -194
  37. package/src/resources/deployments.ts +0 -1060
  38. package/src/resources/desktop.ts +0 -134
  39. package/src/resources/docker-deploy.test.ts +0 -102
  40. package/src/resources/docker-deploy.ts +0 -183
  41. package/src/resources/egress.test.ts +0 -318
  42. package/src/resources/egressAudit.ts +0 -245
  43. package/src/resources/egressNetwork.ts +0 -450
  44. package/src/resources/egressSecrets.ts +0 -577
  45. package/src/resources/email.ts +0 -212
  46. package/src/resources/embeddings.ts +0 -36
  47. package/src/resources/events.ts +0 -296
  48. package/src/resources/exec.ts +0 -319
  49. package/src/resources/external-keys.ts +0 -79
  50. package/src/resources/files.test.ts +0 -339
  51. package/src/resources/files.ts +0 -220
  52. package/src/resources/flat-custom-domains.ts +0 -127
  53. package/src/resources/functions.ts +0 -178
  54. package/src/resources/governance.test.ts +0 -355
  55. package/src/resources/governance.ts +0 -528
  56. package/src/resources/health-checks.ts +0 -165
  57. package/src/resources/integrations.ts +0 -183
  58. package/src/resources/mcp.ts +0 -70
  59. package/src/resources/models.ts +0 -45
  60. package/src/resources/network_policy.ts +0 -73
  61. package/src/resources/open-computers/agents.ts +0 -91
  62. package/src/resources/open-computers/apps.ts +0 -102
  63. package/src/resources/open-computers/clusters.ts +0 -88
  64. package/src/resources/open-computers/desktop.ts +0 -34
  65. package/src/resources/open-computers/files.ts +0 -97
  66. package/src/resources/open-computers/hosts.ts +0 -85
  67. package/src/resources/open-computers/index.ts +0 -98
  68. package/src/resources/open-computers/jobs.ts +0 -75
  69. package/src/resources/open-computers/open_computers.test.ts +0 -288
  70. package/src/resources/open-computers/secrets.ts +0 -115
  71. package/src/resources/open-computers/terminal.ts +0 -33
  72. package/src/resources/open-computers/tunnels.ts +0 -87
  73. package/src/resources/open-computers/types.ts +0 -343
  74. package/src/resources/open-computers/workspaces.ts +0 -135
  75. package/src/resources/org-invites.ts +0 -189
  76. package/src/resources/phase1.test.ts +0 -187
  77. package/src/resources/project-auth.ts +0 -142
  78. package/src/resources/project-integrations.ts +0 -133
  79. package/src/resources/provider-defaults.ts +0 -89
  80. package/src/resources/quotas.ts +0 -77
  81. package/src/resources/regions.ts +0 -94
  82. package/src/resources/sandbox-processes.ts +0 -112
  83. package/src/resources/sandbox-shares.ts +0 -83
  84. package/src/resources/sandbox-templates.ts +0 -195
  85. package/src/resources/sandboxes.live.test.ts +0 -92
  86. package/src/resources/sandboxes.test.ts +0 -653
  87. package/src/resources/sandboxes.ts +0 -1433
  88. package/src/resources/settings.ts +0 -143
  89. package/src/resources/snapshots-standalone.ts +0 -51
  90. package/src/resources/storage.ts +0 -221
  91. package/src/resources/tenant-events.ts +0 -32
  92. package/src/resources/tenant.ts +0 -148
  93. package/src/resources/usage.ts +0 -85
  94. package/src/resources/volumes.ts +0 -117
  95. package/src/resources/webhooks.ts +0 -224
  96. package/src/resources/workspace-invites.ts +0 -188
  97. package/src/resources/workspace-members.test.ts +0 -121
  98. package/src/resources/workspace-members.ts +0 -143
  99. package/src/resources/workspaces.ts +0 -285
  100. package/src/types.ts +0 -463
@@ -1,577 +0,0 @@
1
- /**
2
- * Egress secrets — encrypted API key + OAuth credential vault.
3
- *
4
- * Backed by:
5
- * POST /api/v1/egress/secrets
6
- * GET /api/v1/egress/secrets
7
- * GET /api/v1/egress/secrets/:id
8
- * PATCH /api/v1/egress/secrets/:id (rotate)
9
- * DELETE /api/v1/egress/secrets/:id
10
- *
11
- * POST /api/v1/egress/bindings
12
- * GET /api/v1/egress/bindings
13
- * DELETE /api/v1/egress/bindings/:id
14
- *
15
- * GET /api/v1/egress/oauth/providers
16
- * POST /api/v1/egress/oauth/start
17
- * GET /api/v1/egress/oauth/status?state=...
18
- */
19
-
20
- import type { HttpClient } from "../http.js";
21
-
22
- // ── Resource shapes ──────────────────────────────────────────────────────────
23
-
24
- export type EgressSecretType =
25
- | "api_key"
26
- | "oauth_token"
27
- | "bearer"
28
- | "basic"
29
- | "generic";
30
-
31
- export type EgressSecretScope =
32
- | "user"
33
- | "workspace"
34
- | "tenant"
35
- | "external_user"
36
- | "external_workspace";
37
-
38
- export interface EgressSecretData {
39
- id: string;
40
- name?: string;
41
- type?: EgressSecretType | string;
42
- scope?: EgressSecretScope | string;
43
- workspace_id?: string | null;
44
- owner_user_id?: string | null;
45
- external_user_id?: string | null;
46
- external_workspace_id?: string | null;
47
- resource_id?: string | null;
48
- resource_type?: string | null;
49
- masked_value?: string | null;
50
- expires_at?: string | null;
51
- metadata?: Record<string, unknown>;
52
- created_at?: string;
53
- updated_at?: string;
54
- [key: string]: unknown;
55
- }
56
-
57
- export interface EgressBindingData {
58
- id: string;
59
- secret_id: string;
60
- resource_id: string;
61
- resource_type: string;
62
- expose_as_env: string;
63
- created_at?: string;
64
- [key: string]: unknown;
65
- }
66
-
67
- export interface OauthProvider {
68
- name: string;
69
- display_name?: string;
70
- scopes?: string[];
71
- [key: string]: unknown;
72
- }
73
-
74
- // ── Request payloads ─────────────────────────────────────────────────────────
75
-
76
- export interface SecretSetParams {
77
- name: string;
78
- value: string;
79
- type?: EgressSecretType | string;
80
- scope?: EgressSecretScope | string;
81
- exposeAsEnv?: string;
82
- expose_as_env?: string;
83
- workspaceId?: string;
84
- workspace_id?: string;
85
- ownerUserId?: string;
86
- owner_user_id?: string;
87
- externalUserId?: string;
88
- external_user_id?: string;
89
- externalWorkspaceId?: string;
90
- external_workspace_id?: string;
91
- resourceId?: string;
92
- resource_id?: string;
93
- resourceType?: string;
94
- resource_type?: string;
95
- refreshToken?: string;
96
- refresh_token?: string;
97
- expiresAt?: string;
98
- expires_at?: string;
99
- metadata?: Record<string, unknown>;
100
- }
101
-
102
- export interface SecretListParams {
103
- scope?: string;
104
- type?: string;
105
- workspaceId?: string;
106
- workspace_id?: string;
107
- ownerUserId?: string;
108
- owner_user_id?: string;
109
- externalUserId?: string;
110
- external_user_id?: string;
111
- externalWorkspaceId?: string;
112
- external_workspace_id?: string;
113
- resourceId?: string;
114
- resource_id?: string;
115
- resourceType?: string;
116
- resource_type?: string;
117
- }
118
-
119
- export interface SecretRotateParams {
120
- newValue?: string;
121
- new_value?: string;
122
- value?: string;
123
- refreshToken?: string;
124
- refresh_token?: string;
125
- expiresAt?: string;
126
- expires_at?: string;
127
- }
128
-
129
- export interface BindingCreateParams {
130
- secretId?: string;
131
- secret_id?: string;
132
- resourceId?: string;
133
- resource_id?: string;
134
- resourceType?: string;
135
- resource_type?: string;
136
- exposeAsEnv?: string;
137
- expose_as_env?: string;
138
- }
139
-
140
- export interface BindingListParams {
141
- resourceId?: string;
142
- resource_id?: string;
143
- resourceType?: string;
144
- resource_type?: string;
145
- secretId?: string;
146
- secret_id?: string;
147
- }
148
-
149
- export interface OauthConnectParams {
150
- provider: string;
151
- exposeAsEnv?: string;
152
- expose_as_env?: string;
153
- scope?: string;
154
- ownerUserId?: string;
155
- owner_user_id?: string;
156
- externalUserId?: string;
157
- external_user_id?: string;
158
- externalWorkspaceId?: string;
159
- external_workspace_id?: string;
160
- resourceId?: string;
161
- resource_id?: string;
162
- resourceType?: string;
163
- resource_type?: string;
164
- redirectUri?: string;
165
- redirect_uri?: string;
166
- }
167
-
168
- export interface OauthStartResult {
169
- authorize_url: string;
170
- authorizeUrl?: string;
171
- state: string;
172
- provider?: string;
173
- expires_at?: string;
174
- [key: string]: unknown;
175
- }
176
-
177
- export interface OauthStatusResult {
178
- status: string;
179
- state?: string;
180
- secret_id?: string;
181
- error?: string;
182
- message?: string;
183
- [key: string]: unknown;
184
- }
185
-
186
- // ── Helpers ───────────────────────────────────────────────────────────────────
187
-
188
- interface WireEnvelope<T> {
189
- data?: T;
190
- secret?: T;
191
- binding?: T;
192
- items?: T;
193
- }
194
-
195
- function unwrap<T>(payload: unknown): T {
196
- if (payload && typeof payload === "object") {
197
- const p = payload as Record<string, unknown>;
198
- for (const k of ["data", "secret", "binding", "items"]) {
199
- if (k in p) return p[k] as T;
200
- }
201
- }
202
- return payload as T;
203
- }
204
-
205
- function unwrapList<T>(payload: unknown): T[] {
206
- if (Array.isArray(payload)) return payload as T[];
207
- if (payload && typeof payload === "object") {
208
- const p = payload as Record<string, unknown>;
209
- for (const k of ["data", "secrets", "bindings", "providers", "items"]) {
210
- if (Array.isArray(p[k])) return p[k] as T[];
211
- }
212
- }
213
- return [];
214
- }
215
-
216
- function stripUndefined(
217
- input: Record<string, unknown>,
218
- ): Record<string, unknown> {
219
- return Object.fromEntries(
220
- Object.entries(input).filter(([, v]) => v !== undefined),
221
- );
222
- }
223
-
224
- function pickFirst<T>(...values: Array<T | undefined>): T | undefined {
225
- for (const v of values) if (v !== undefined) return v;
226
- return undefined;
227
- }
228
-
229
- function setBody(params: SecretSetParams): Record<string, unknown> {
230
- return stripUndefined({
231
- name: params.name,
232
- value: params.value,
233
- type: params.type ?? "api_key",
234
- scope: params.scope ?? "user",
235
- expose_as_env: pickFirst(params.exposeAsEnv, params.expose_as_env),
236
- workspace_id: pickFirst(params.workspaceId, params.workspace_id),
237
- owner_user_id: pickFirst(params.ownerUserId, params.owner_user_id),
238
- external_user_id: pickFirst(params.externalUserId, params.external_user_id),
239
- external_workspace_id: pickFirst(
240
- params.externalWorkspaceId,
241
- params.external_workspace_id,
242
- ),
243
- resource_id: pickFirst(params.resourceId, params.resource_id),
244
- resource_type: pickFirst(params.resourceType, params.resource_type),
245
- refresh_token: pickFirst(params.refreshToken, params.refresh_token),
246
- expires_at: pickFirst(params.expiresAt, params.expires_at),
247
- metadata: params.metadata,
248
- });
249
- }
250
-
251
- function listQuery(
252
- params: SecretListParams,
253
- ): Record<string, string | number | boolean | undefined> {
254
- return stripUndefined({
255
- scope: params.scope,
256
- type: params.type,
257
- workspace_id: pickFirst(params.workspaceId, params.workspace_id),
258
- owner_user_id: pickFirst(params.ownerUserId, params.owner_user_id),
259
- external_user_id: pickFirst(params.externalUserId, params.external_user_id),
260
- external_workspace_id: pickFirst(
261
- params.externalWorkspaceId,
262
- params.external_workspace_id,
263
- ),
264
- resource_id: pickFirst(params.resourceId, params.resource_id),
265
- resource_type: pickFirst(params.resourceType, params.resource_type),
266
- }) as Record<string, string | number | boolean | undefined>;
267
- }
268
-
269
- function rotateBody(params: SecretRotateParams): Record<string, unknown> {
270
- return stripUndefined({
271
- value: pickFirst(params.newValue, params.new_value, params.value),
272
- refresh_token: pickFirst(params.refreshToken, params.refresh_token),
273
- expires_at: pickFirst(params.expiresAt, params.expires_at),
274
- });
275
- }
276
-
277
- function bindingBody(params: BindingCreateParams): Record<string, unknown> {
278
- return stripUndefined({
279
- secret_id: pickFirst(params.secretId, params.secret_id),
280
- resource_id: pickFirst(params.resourceId, params.resource_id),
281
- resource_type: pickFirst(params.resourceType, params.resource_type),
282
- expose_as_env: pickFirst(params.exposeAsEnv, params.expose_as_env),
283
- });
284
- }
285
-
286
- function bindingQuery(
287
- params: BindingListParams,
288
- ): Record<string, string | number | boolean | undefined> {
289
- return stripUndefined({
290
- resource_id: pickFirst(params.resourceId, params.resource_id),
291
- resource_type: pickFirst(params.resourceType, params.resource_type),
292
- secret_id: pickFirst(params.secretId, params.secret_id),
293
- }) as Record<string, string | number | boolean | undefined>;
294
- }
295
-
296
- function oauthBody(params: OauthConnectParams): Record<string, unknown> {
297
- return stripUndefined({
298
- provider: params.provider,
299
- expose_as_env: pickFirst(params.exposeAsEnv, params.expose_as_env),
300
- scope: params.scope,
301
- owner_user_id: pickFirst(params.ownerUserId, params.owner_user_id),
302
- external_user_id: pickFirst(params.externalUserId, params.external_user_id),
303
- external_workspace_id: pickFirst(
304
- params.externalWorkspaceId,
305
- params.external_workspace_id,
306
- ),
307
- resource_id: pickFirst(params.resourceId, params.resource_id),
308
- resource_type: pickFirst(params.resourceType, params.resource_type),
309
- redirect_uri: pickFirst(params.redirectUri, params.redirect_uri),
310
- });
311
- }
312
-
313
- function sleep(ms: number): Promise<void> {
314
- return new Promise((resolve) => setTimeout(resolve, ms));
315
- }
316
-
317
- // ── OAuth flow handle ────────────────────────────────────────────────────────
318
-
319
- /**
320
- * A pending OAuth flow.
321
- *
322
- * The SDK does NOT auto-open a browser — the caller is responsible for
323
- * surfacing `authorizeUrl` to the end user. Once the user grants
324
- * consent, call `waitForCompletion()` to poll the upstream provider
325
- * status.
326
- */
327
- export class OAuthFlow {
328
- readonly authorizeUrl: string;
329
- readonly state: string;
330
- readonly provider?: string;
331
- readonly data: OauthStartResult;
332
- private readonly http: HttpClient;
333
-
334
- constructor(http: HttpClient, payload: OauthStartResult, provider?: string) {
335
- this.http = http;
336
- this.authorizeUrl = payload.authorize_url ?? payload.authorizeUrl ?? "";
337
- this.state = payload.state ?? "";
338
- if (provider !== undefined) {
339
- this.provider = provider;
340
- }
341
- this.data = payload;
342
- }
343
-
344
- /**
345
- * Poll `GET /egress/oauth/status?state=...` until the flow completes.
346
- *
347
- * Returns the status payload once the upstream provider issues
348
- * tokens. Rejects with a `TimeoutError`-style Error if the flow does
349
- * not complete within `timeoutSec` seconds, or if the upstream
350
- * returns a failed status.
351
- */
352
- async waitForCompletion(
353
- options: { timeoutSec?: number; pollIntervalMs?: number } = {},
354
- ): Promise<OauthStatusResult> {
355
- const timeoutSec = options.timeoutSec ?? 300;
356
- const pollMs = options.pollIntervalMs ?? 2000;
357
- const deadline = Date.now() + timeoutSec * 1000;
358
- while (Date.now() < deadline) {
359
- const data = await this.http.get<unknown>("/egress/oauth/status", {
360
- state: this.state,
361
- });
362
- const payload = unwrap<OauthStatusResult>(data) ?? {};
363
- const status = (payload as OauthStatusResult).status;
364
- if (
365
- status === "completed" ||
366
- status === "ready" ||
367
- status === "succeeded"
368
- ) {
369
- return payload as OauthStatusResult;
370
- }
371
- if (status === "failed" || status === "error" || status === "denied") {
372
- throw new Error(
373
- `OAuth flow ${this.state} ended in status=${status}: ${
374
- payload.error ?? payload.message ?? "no detail"
375
- }`,
376
- );
377
- }
378
- await sleep(pollMs);
379
- }
380
- throw new Error(
381
- `OAuth flow ${this.state} did not complete within ${timeoutSec}s`,
382
- );
383
- }
384
- }
385
-
386
- // ── Main resource ─────────────────────────────────────────────────────────────
387
-
388
- export class EgressSecrets {
389
- constructor(protected readonly http: HttpClient) {}
390
-
391
- /**
392
- * Create a secret. When `exposeAsEnv` is provided together with
393
- * `resourceId` the backend also creates a binding so the value is
394
- * injected as an env-var on that resource.
395
- */
396
- async set(params: SecretSetParams): Promise<EgressSecretData> {
397
- const data = await this.http.post<WireEnvelope<EgressSecretData>>(
398
- "/egress/secrets",
399
- setBody(params),
400
- );
401
- return unwrap<EgressSecretData>(data);
402
- }
403
-
404
- /** List secrets. */
405
- async list(params: SecretListParams = {}): Promise<EgressSecretData[]> {
406
- const data = await this.http.get<unknown>(
407
- "/egress/secrets",
408
- listQuery(params),
409
- );
410
- return unwrapList<EgressSecretData>(data);
411
- }
412
-
413
- /** Get a single secret by id. */
414
- async get(id: string): Promise<EgressSecretData> {
415
- const data = await this.http.get<WireEnvelope<EgressSecretData>>(
416
- `/egress/secrets/${id}`,
417
- );
418
- return unwrap<EgressSecretData>(data);
419
- }
420
-
421
- /** Rotate the secret's value. */
422
- async rotate(
423
- id: string,
424
- params: SecretRotateParams | string,
425
- ): Promise<EgressSecretData> {
426
- const body =
427
- typeof params === "string"
428
- ? rotateBody({ newValue: params })
429
- : rotateBody(params);
430
- const data = await this.http.patch<WireEnvelope<EgressSecretData>>(
431
- `/egress/secrets/${id}`,
432
- body,
433
- );
434
- return unwrap<EgressSecretData>(data);
435
- }
436
-
437
- /** Delete a secret. */
438
- async delete(id: string): Promise<void> {
439
- await this.http.delete<unknown>(`/egress/secrets/${id}`);
440
- }
441
-
442
- // ── bindings ───────────────────────────────────────────────────────────────
443
-
444
- /** Bind a secret to a resource as an env var. */
445
- async createBinding(params: BindingCreateParams): Promise<EgressBindingData> {
446
- const data = await this.http.post<WireEnvelope<EgressBindingData>>(
447
- "/egress/bindings",
448
- bindingBody(params),
449
- );
450
- return unwrap<EgressBindingData>(data);
451
- }
452
-
453
- /** List secret bindings. */
454
- async listBindings(
455
- params: BindingListParams = {},
456
- ): Promise<EgressBindingData[]> {
457
- const data = await this.http.get<unknown>(
458
- "/egress/bindings",
459
- bindingQuery(params),
460
- );
461
- return unwrapList<EgressBindingData>(data);
462
- }
463
-
464
- /** Delete a binding. */
465
- async deleteBinding(id: string): Promise<void> {
466
- await this.http.delete<unknown>(`/egress/bindings/${id}`);
467
- }
468
-
469
- // ── OAuth Connect ──────────────────────────────────────────────────────────
470
-
471
- /** List OAuth providers visible to the current tenant. */
472
- async providers(): Promise<OauthProvider[]> {
473
- const data = await this.http.get<unknown>("/egress/oauth/providers");
474
- return unwrapList<OauthProvider>(data);
475
- }
476
-
477
- /**
478
- * Start an OAuth Connect flow.
479
- *
480
- * Returns an {@link OAuthFlow} — the caller must surface
481
- * `flow.authorizeUrl` to the end user (the SDK does NOT open the
482
- * browser) and then call `flow.waitForCompletion()` to receive the
483
- * resulting secret id.
484
- */
485
- async connect(params: OauthConnectParams): Promise<OAuthFlow> {
486
- const data = await this.http.post<WireEnvelope<OauthStartResult>>(
487
- "/egress/oauth/start",
488
- oauthBody(params),
489
- );
490
- const payload = unwrap<OauthStartResult>(data) ?? ({} as OauthStartResult);
491
- return new OAuthFlow(this.http, payload, params.provider);
492
- }
493
- }
494
-
495
- // ── Resource-scoped wrappers ─────────────────────────────────────────────────
496
-
497
- /**
498
- * Sandbox-bound view of {@link EgressSecrets}. Pre-scopes
499
- * `resource_id` + `resource_type="sandbox"` on every call.
500
- */
501
- export class SandboxSecrets {
502
- protected readonly resourceType: string = "sandbox";
503
- private readonly delegate: EgressSecrets;
504
-
505
- constructor(
506
- http: HttpClient,
507
- protected readonly resourceId: string,
508
- ) {
509
- this.delegate = new EgressSecrets(http);
510
- }
511
-
512
- private resolvedResourceId(params: {
513
- resourceId?: string;
514
- resource_id?: string;
515
- }): string {
516
- return params.resourceId ?? params.resource_id ?? this.resourceId;
517
- }
518
-
519
- private resolvedResourceType(params: {
520
- resourceType?: string;
521
- resource_type?: string;
522
- }): string {
523
- return params.resourceType ?? params.resource_type ?? this.resourceType;
524
- }
525
-
526
- set(params: SecretSetParams): Promise<EgressSecretData> {
527
- return this.delegate.set({
528
- ...params,
529
- resource_id: this.resolvedResourceId(params),
530
- resource_type: this.resolvedResourceType(params),
531
- });
532
- }
533
-
534
- list(params: SecretListParams = {}): Promise<EgressSecretData[]> {
535
- return this.delegate.list({
536
- ...params,
537
- resource_id: this.resolvedResourceId(params),
538
- resource_type: this.resolvedResourceType(params),
539
- });
540
- }
541
-
542
- get(id: string): Promise<EgressSecretData> {
543
- return this.delegate.get(id);
544
- }
545
-
546
- rotate(
547
- id: string,
548
- params: SecretRotateParams | string,
549
- ): Promise<EgressSecretData> {
550
- return this.delegate.rotate(id, params);
551
- }
552
-
553
- delete(id: string): Promise<void> {
554
- return this.delegate.delete(id);
555
- }
556
-
557
- connect(params: OauthConnectParams): Promise<OAuthFlow> {
558
- return this.delegate.connect({
559
- ...params,
560
- resource_id: this.resolvedResourceId(params),
561
- resource_type: this.resolvedResourceType(params),
562
- });
563
- }
564
-
565
- listBindings(params: BindingListParams = {}): Promise<EgressBindingData[]> {
566
- return this.delegate.listBindings({
567
- ...params,
568
- resource_id: this.resolvedResourceId(params),
569
- resource_type: this.resolvedResourceType(params),
570
- });
571
- }
572
- }
573
-
574
- /** Computer-bound secrets — same shape, `resource_type="computer"`. */
575
- export class ComputerSecrets extends SandboxSecrets {
576
- protected readonly resourceType: string = "computer";
577
- }