@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.
- package/README.md +28 -0
- package/dist/agent/index.d.ts +2 -2
- package/dist/auth/index.js +66 -25
- package/dist/{client-DWkQOg1k.d.ts → client-BgKAw8YA.d.ts} +22 -2
- package/dist/{client-BZSkXIEp.js → client-DeHvk634.js} +121 -83
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-BxlfZ2Uh.js → collaboration-D17lnOJX.js} +1 -1
- package/dist/core.d.ts +3 -3
- package/dist/core.js +3 -3
- package/dist/{errors-DZsfJUuc.js → errors-DSz87Rkk.js} +10 -1
- package/dist/{errors-1Se5ATyZ.d.ts → errors-H9268M_g.d.ts} +5 -1
- package/dist/{index-DLH5MBrq.d.ts → index-DS4SOkKG.d.ts} +9 -4
- package/dist/index.d.ts +470 -7
- package/dist/index.js +562 -10
- package/dist/intelligence/index.js +1 -1
- package/dist/{sandbox-B6qbvsur.d.ts → sandbox-Bm2C9Phd.d.ts} +843 -164
- package/dist/{sandbox-bDWrUu8i.js → sandbox-CeimsfC8.js} +682 -164
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-CMGJEZit.js → tangle-DayyZe-i.js} +115 -37
- package/package.json +3 -3
|
@@ -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 {
|
|
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 {
|
|
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 {
|
|
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:
|
|
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: "
|
|
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
|
*
|