@tangle-network/sandbox 0.9.7 → 0.10.1

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.
@@ -130,6 +130,14 @@ var StateError = class extends SandboxError {
130
130
  this.requiredState = requiredState;
131
131
  }
132
132
  };
133
+ var EgressProxyRecoveryError = class extends SandboxError {
134
+ phase;
135
+ constructor(message, metadata) {
136
+ super(message, "EGRESS_PROXY_RECOVERY_REQUIRED", 409, metadata);
137
+ this.name = "EgressProxyRecoveryError";
138
+ this.phase = "egress_proxy_recovery";
139
+ }
140
+ };
133
141
  /**
134
142
  * The request timed out.
135
143
  */
@@ -245,6 +253,7 @@ function parseErrorResponse(status, body, context, headers) {
245
253
  if (isQuotaCode(code)) return new QuotaError(data.quotaType || "rate_limit", message, data.current, data.limit, metadata, status);
246
254
  if (isCapabilityCode(code)) return new CapabilityError(message, code, status, metadata, readCapability(data, errorObj));
247
255
  if (isPartialFailureCode(code)) return new PartialFailureError(message, code, status, metadata, readFailures(data, errorObj));
256
+ if (code === "EGRESS_PROXY_RECOVERY_REQUIRED") return new EgressProxyRecoveryError(message, metadata);
248
257
  switch (status) {
249
258
  case 400: return new ValidationError(message, data.fields, metadata);
250
259
  case 401: return new AuthError(message, metadata);
@@ -259,4 +268,4 @@ function parseErrorResponse(status, body, context, headers) {
259
268
  }
260
269
  }
261
270
  //#endregion
262
- export { PartialFailureError as a, ServerError as c, ValidationError as d, parseErrorResponse as f, NotFoundError as i, StateError as l, CapabilityError as n, QuotaError as o, NetworkError as r, SandboxError as s, AuthError as t, TimeoutError as u };
271
+ export { NotFoundError as a, SandboxError as c, TimeoutError as d, ValidationError as f, NetworkError as i, ServerError as l, CapabilityError as n, PartialFailureError as o, parseErrorResponse as p, EgressProxyRecoveryError as r, QuotaError as s, AuthError as t, StateError as u };
@@ -102,6 +102,10 @@ declare class StateError extends SandboxError {
102
102
  readonly requiredState?: string;
103
103
  constructor(message: string, currentState: string, requiredState?: string, metadata?: SandboxErrorMetadata);
104
104
  }
105
+ declare class EgressProxyRecoveryError extends SandboxError {
106
+ readonly phase: "egress_proxy_recovery";
107
+ constructor(message: string, metadata?: SandboxErrorMetadata);
108
+ }
105
109
  /**
106
110
  * The request timed out.
107
111
  */
@@ -125,4 +129,4 @@ declare class ServerError extends SandboxError {
125
129
  constructor(message: string, status?: number, metadata?: SandboxErrorMetadata);
126
130
  }
127
131
  //#endregion
128
- export { PartialFailureError as a, SandboxErrorJson as c, StateError as d, TimeoutError as f, NotFoundError as i, SandboxFailureDetail as l, CapabilityError as n, QuotaError as o, ValidationError as p, NetworkError as r, SandboxError as s, AuthError as t, ServerError as u };
132
+ export { NotFoundError as a, SandboxError as c, ServerError as d, StateError as f, NetworkError as i, SandboxErrorJson as l, ValidationError as m, CapabilityError as n, PartialFailureError as o, TimeoutError as p, EgressProxyRecoveryError as r, QuotaError as s, AuthError as t, SandboxFailureDetail as u };
@@ -1,4 +1,4 @@
1
- import { n as SandboxInstance, nt as CreateSandboxOptions, t as HttpClient } from "./sandbox-B6qbvsur.js";
1
+ import { dt as CreateSandboxOptions, n as SandboxInstance, t as HttpClient } from "./sandbox-Bm2C9Phd.js";
2
2
 
3
3
  //#region src/tangle/abi.d.ts
4
4
  /**
@@ -74,7 +74,7 @@ declare const ITangleJobsAbi: readonly [{
74
74
  }, {
75
75
  readonly name: "jobIndex";
76
76
  readonly type: "uint8";
77
- readonly indexed: true;
77
+ readonly indexed: false;
78
78
  }, {
79
79
  readonly name: "caller";
80
80
  readonly type: "address";
@@ -127,8 +127,8 @@ declare const SandboxCreateParamTypes: readonly [{
127
127
  readonly name: "ssh_enabled";
128
128
  readonly type: "bool";
129
129
  }, {
130
- readonly name: "ssh_public_keys";
131
- readonly type: "string[]";
130
+ readonly name: "ssh_public_key";
131
+ readonly type: "string";
132
132
  }, {
133
133
  readonly name: "web_terminal_enabled";
134
134
  readonly type: "bool";
@@ -341,6 +341,11 @@ declare class TangleSandboxClient implements HttpClient {
341
341
  * Create a sandbox via on-chain job submission.
342
342
  */
343
343
  create(options?: CreateSandboxOptions): Promise<SandboxInstance>;
344
+ /**
345
+ * Get a sandbox by id. Rehydrates from the operator API when configured so
346
+ * app servers can resolve sandboxes created by earlier requests.
347
+ */
348
+ get(id: string): Promise<SandboxInstance | null>;
344
349
  /**
345
350
  * Route interception for SandboxInstance lifecycle calls.
346
351
  *