@e2b/n8n-nodes-e2b 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/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/credentials/E2BApi.credentials.d.ts +13 -0
- package/dist/credentials/E2BApi.credentials.js +58 -0
- package/dist/credentials/E2BApi.credentials.js.map +1 -0
- package/dist/credentials/e2b.dark.svg +1 -0
- package/dist/credentials/e2b.svg +1 -0
- package/dist/nodes/E2B/E2b.node.d.ts +5 -0
- package/dist/nodes/E2B/E2b.node.js +2901 -0
- package/dist/nodes/E2B/E2b.node.js.map +7 -0
- package/dist/nodes/E2B/E2b.node.json +20 -0
- package/dist/nodes/E2B/actions/code.operations.d.ts +8 -0
- package/dist/nodes/E2B/actions/code.operations.js +67 -0
- package/dist/nodes/E2B/actions/code.operations.js.map +1 -0
- package/dist/nodes/E2B/actions/file.operations.d.ts +95 -0
- package/dist/nodes/E2B/actions/file.operations.js +183 -0
- package/dist/nodes/E2B/actions/file.operations.js.map +1 -0
- package/dist/nodes/E2B/actions/git.operations.d.ts +48 -0
- package/dist/nodes/E2B/actions/git.operations.js +554 -0
- package/dist/nodes/E2B/actions/git.operations.js.map +1 -0
- package/dist/nodes/E2B/actions/index.d.ts +2 -0
- package/dist/nodes/E2B/actions/index.js +95 -0
- package/dist/nodes/E2B/actions/index.js.map +1 -0
- package/dist/nodes/E2B/actions/sandbox.operations.d.ts +48 -0
- package/dist/nodes/E2B/actions/sandbox.operations.js +93 -0
- package/dist/nodes/E2B/actions/sandbox.operations.js.map +1 -0
- package/dist/nodes/E2B/actions/snapshot.operations.d.ts +22 -0
- package/dist/nodes/E2B/actions/snapshot.operations.js +46 -0
- package/dist/nodes/E2B/actions/snapshot.operations.js.map +1 -0
- package/dist/nodes/E2B/actions/volume.operations.d.ts +28 -0
- package/dist/nodes/E2B/actions/volume.operations.js +57 -0
- package/dist/nodes/E2B/actions/volume.operations.js.map +1 -0
- package/dist/nodes/E2B/client.d.ts +97 -0
- package/dist/nodes/E2B/client.js +546 -0
- package/dist/nodes/E2B/client.js.map +1 -0
- package/dist/nodes/E2B/e2b.dark.svg +1 -0
- package/dist/nodes/E2B/e2b.svg +1 -0
- package/dist/nodes/E2B/helpers.d.ts +22 -0
- package/dist/nodes/E2B/helpers.js +224 -0
- package/dist/nodes/E2B/helpers.js.map +1 -0
- package/dist/nodes/E2B/types.d.ts +21 -0
- package/dist/nodes/E2B/types.js +21 -0
- package/dist/nodes/E2B/types.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getOperationHandler = getOperationHandler;
|
|
37
|
+
const code = __importStar(require("./code.operations"));
|
|
38
|
+
const file = __importStar(require("./file.operations"));
|
|
39
|
+
const git = __importStar(require("./git.operations"));
|
|
40
|
+
const sandbox = __importStar(require("./sandbox.operations"));
|
|
41
|
+
const snapshot = __importStar(require("./snapshot.operations"));
|
|
42
|
+
const volume = __importStar(require("./volume.operations"));
|
|
43
|
+
const operationHandlers = {
|
|
44
|
+
code: {
|
|
45
|
+
runCommand: code.runCommand,
|
|
46
|
+
},
|
|
47
|
+
file: {
|
|
48
|
+
createFolder: file.createFolder,
|
|
49
|
+
delete: file.deleteFile,
|
|
50
|
+
download: file.download,
|
|
51
|
+
info: file.info,
|
|
52
|
+
list: file.list,
|
|
53
|
+
move: file.move,
|
|
54
|
+
read: file.read,
|
|
55
|
+
upload: file.upload,
|
|
56
|
+
write: file.write,
|
|
57
|
+
},
|
|
58
|
+
git: {
|
|
59
|
+
add: git.add,
|
|
60
|
+
checkout: git.checkout,
|
|
61
|
+
clone: git.clone,
|
|
62
|
+
commit: git.commit,
|
|
63
|
+
pull: git.pull,
|
|
64
|
+
push: git.push,
|
|
65
|
+
status: git.status,
|
|
66
|
+
},
|
|
67
|
+
sandbox: {
|
|
68
|
+
create: sandbox.create,
|
|
69
|
+
get: sandbox.get,
|
|
70
|
+
getMany: sandbox.getMany,
|
|
71
|
+
getPreviewUrl: sandbox.getPreviewUrl,
|
|
72
|
+
kill: sandbox.kill,
|
|
73
|
+
pause: sandbox.pause,
|
|
74
|
+
},
|
|
75
|
+
snapshot: {
|
|
76
|
+
create: snapshot.create,
|
|
77
|
+
delete: snapshot.deleteSnapshot,
|
|
78
|
+
getMany: snapshot.getMany,
|
|
79
|
+
},
|
|
80
|
+
volume: {
|
|
81
|
+
create: volume.create,
|
|
82
|
+
delete: volume.deleteVolume,
|
|
83
|
+
get: volume.get,
|
|
84
|
+
getMany: volume.getMany,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
function getOperationHandler(resource, operation) {
|
|
88
|
+
const resourceHandlers = operationHandlers[resource];
|
|
89
|
+
const handler = resourceHandlers[operation];
|
|
90
|
+
if (!handler) {
|
|
91
|
+
throw new Error(`Operation "${operation}" is not implemented for resource "${resource}"`);
|
|
92
|
+
}
|
|
93
|
+
return handler;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../nodes/E2B/actions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,kDAaC;AApED,wDAA0C;AAC1C,wDAA0C;AAC1C,sDAAwC;AACxC,8DAAgD;AAChD,gEAAkD;AAClD,4DAA8C;AAG9C,MAAM,iBAAiB,GAAG;IACzB,IAAI,EAAE;QACL,UAAU,EAAE,IAAI,CAAC,UAAU;KAC3B;IACD,IAAI,EAAE;QACL,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,MAAM,EAAE,IAAI,CAAC,UAAU;QACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,IAAI,CAAC,KAAK;KACjB;IACD,GAAG,EAAE;QACJ,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,MAAM,EAAE,GAAG,CAAC,MAAM;KAClB;IACD,OAAO,EAAE;QACR,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;KACpB;IACD,QAAQ,EAAE;QACT,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,MAAM,EAAE,QAAQ,CAAC,cAAc;QAC/B,OAAO,EAAE,QAAQ,CAAC,OAAO;KACzB;IACD,MAAM,EAAE;QACP,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,YAAY;QAC3B,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,OAAO,EAAE,MAAM,CAAC,OAAO;KACvB;CAGD,CAAC;AAEF,SAAgB,mBAAmB,CAClC,QAAkB,EAClB,SAAoB;IAEpB,MAAM,gBAAgB,GACrB,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7B,MAAM,OAAO,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAE5C,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,cAAc,SAAS,sCAAsC,QAAQ,GAAG,CAAC,CAAC;IAC3F,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { E2BOperationContext } from '../types';
|
|
2
|
+
export declare function create(context: E2BOperationContext): Promise<{
|
|
3
|
+
json: import("n8n-workflow").IDataObject;
|
|
4
|
+
pairedItem: {
|
|
5
|
+
item: number;
|
|
6
|
+
};
|
|
7
|
+
}[]>;
|
|
8
|
+
export declare function get(context: E2BOperationContext): Promise<{
|
|
9
|
+
json: import("n8n-workflow").IDataObject;
|
|
10
|
+
pairedItem: {
|
|
11
|
+
item: number;
|
|
12
|
+
};
|
|
13
|
+
}[]>;
|
|
14
|
+
export declare function getMany(context: E2BOperationContext): Promise<{
|
|
15
|
+
json: import("n8n-workflow").IDataObject;
|
|
16
|
+
pairedItem: {
|
|
17
|
+
item: number;
|
|
18
|
+
};
|
|
19
|
+
}[]>;
|
|
20
|
+
export declare function getPreviewUrl(context: E2BOperationContext): Promise<{
|
|
21
|
+
json: {
|
|
22
|
+
sandboxId: string;
|
|
23
|
+
port: number;
|
|
24
|
+
host: string;
|
|
25
|
+
url: string;
|
|
26
|
+
};
|
|
27
|
+
pairedItem: {
|
|
28
|
+
item: number;
|
|
29
|
+
};
|
|
30
|
+
}[]>;
|
|
31
|
+
export declare function kill(context: E2BOperationContext): Promise<{
|
|
32
|
+
json: {
|
|
33
|
+
sandboxId: string;
|
|
34
|
+
killed: boolean;
|
|
35
|
+
};
|
|
36
|
+
pairedItem: {
|
|
37
|
+
item: number;
|
|
38
|
+
};
|
|
39
|
+
}[]>;
|
|
40
|
+
export declare function pause(context: E2BOperationContext): Promise<{
|
|
41
|
+
json: {
|
|
42
|
+
sandboxId: string;
|
|
43
|
+
paused: boolean;
|
|
44
|
+
};
|
|
45
|
+
pairedItem: {
|
|
46
|
+
item: number;
|
|
47
|
+
};
|
|
48
|
+
}[]>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.create = create;
|
|
4
|
+
exports.get = get;
|
|
5
|
+
exports.getMany = getMany;
|
|
6
|
+
exports.getPreviewUrl = getPreviewUrl;
|
|
7
|
+
exports.kill = kill;
|
|
8
|
+
exports.pause = pause;
|
|
9
|
+
const client_1 = require("../client");
|
|
10
|
+
const helpers_1 = require("../helpers");
|
|
11
|
+
async function create(context) {
|
|
12
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
13
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
14
|
+
const sandbox = await (0, client_1.createSandbox)(connection, (0, helpers_1.getSandboxCreateOptions)(executeFunctions, itemIndex));
|
|
15
|
+
const info = await (0, client_1.getSandboxInfo)(connection, sandbox.sandboxId);
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
json: (0, helpers_1.toSandboxInfoData)(info, sandbox.sandboxDomain),
|
|
19
|
+
pairedItem: { item: itemIndex },
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
async function get(context) {
|
|
24
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
25
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
26
|
+
const sandboxId = (0, helpers_1.getRequiredStringParameter)(executeFunctions, 'sandboxId', 'Sandbox ID', itemIndex);
|
|
27
|
+
const info = await (0, client_1.getSandboxInfo)(connection, sandboxId);
|
|
28
|
+
return [
|
|
29
|
+
{
|
|
30
|
+
json: (0, helpers_1.toSandboxInfoData)(info),
|
|
31
|
+
pairedItem: { item: itemIndex },
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
async function getMany(context) {
|
|
36
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
37
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
38
|
+
const sandboxes = await (0, client_1.listSandboxes)(connection, (0, helpers_1.getLimit)(executeFunctions, itemIndex));
|
|
39
|
+
return sandboxes.map((sandbox) => ({
|
|
40
|
+
json: (0, helpers_1.toSandboxInfoData)(sandbox),
|
|
41
|
+
pairedItem: { item: itemIndex },
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
async function getPreviewUrl(context) {
|
|
45
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
46
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
47
|
+
const sandboxId = (0, helpers_1.getRequiredStringParameter)(executeFunctions, 'sandboxId', 'Sandbox ID', itemIndex);
|
|
48
|
+
const port = (0, helpers_1.getPort)(executeFunctions, itemIndex);
|
|
49
|
+
const sandbox = await (0, client_1.connectSandbox)(connection, sandboxId);
|
|
50
|
+
const host = (0, client_1.getPreviewHost)(connection, sandbox, port);
|
|
51
|
+
return [
|
|
52
|
+
{
|
|
53
|
+
json: {
|
|
54
|
+
sandboxId,
|
|
55
|
+
port,
|
|
56
|
+
host,
|
|
57
|
+
url: `https://${host}`,
|
|
58
|
+
},
|
|
59
|
+
pairedItem: { item: itemIndex },
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
async function kill(context) {
|
|
64
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
65
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
66
|
+
const sandboxId = (0, helpers_1.getRequiredStringParameter)(executeFunctions, 'sandboxId', 'Sandbox ID', itemIndex);
|
|
67
|
+
const killed = await (0, client_1.killSandbox)(connection, sandboxId);
|
|
68
|
+
return [
|
|
69
|
+
{
|
|
70
|
+
json: {
|
|
71
|
+
sandboxId,
|
|
72
|
+
killed,
|
|
73
|
+
},
|
|
74
|
+
pairedItem: { item: itemIndex },
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
async function pause(context) {
|
|
79
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
80
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
81
|
+
const sandboxId = (0, helpers_1.getRequiredStringParameter)(executeFunctions, 'sandboxId', 'Sandbox ID', itemIndex);
|
|
82
|
+
const paused = await (0, client_1.pauseSandbox)(connection, sandboxId);
|
|
83
|
+
return [
|
|
84
|
+
{
|
|
85
|
+
json: {
|
|
86
|
+
sandboxId,
|
|
87
|
+
paused,
|
|
88
|
+
},
|
|
89
|
+
pairedItem: { item: itemIndex },
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=sandbox.operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox.operations.js","sourceRoot":"","sources":["../../../../nodes/E2B/actions/sandbox.operations.ts"],"names":[],"mappings":";;AAkBA,wBAeC;AAED,kBAiBC;AAED,0BASC;AAED,sCAwBC;AAED,oBAoBC;AAED,sBAoBC;AArID,sCAQmB;AACnB,wCAMoB;AAGb,KAAK,UAAU,MAAM,CAAC,OAA4B;IACxD,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IACxE,MAAM,UAAU,GAAG,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;IAChE,MAAM,OAAO,GAAG,MAAM,IAAA,sBAAa,EAClC,UAAU,EACV,IAAA,iCAAuB,EAAC,gBAAgB,EAAE,SAAS,CAAC,CACpD,CAAC;IACF,MAAM,IAAI,GAAG,MAAM,IAAA,uBAAc,EAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAEjE,OAAO;QACN;YACC,IAAI,EAAE,IAAA,2BAAiB,EAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC;YACpD,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SAC/B;KACD,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,GAAG,CAAC,OAA4B;IACrD,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IACxE,MAAM,UAAU,GAAG,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;IAChE,MAAM,SAAS,GAAG,IAAA,oCAA0B,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EAAE;gBACL,SAAS;gBACT,MAAM;aACN;YACD,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SAC/B;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { E2BOperationContext } from '../types';
|
|
2
|
+
export declare function create(context: E2BOperationContext): Promise<{
|
|
3
|
+
json: import("n8n-workflow").IDataObject;
|
|
4
|
+
pairedItem: {
|
|
5
|
+
item: number;
|
|
6
|
+
};
|
|
7
|
+
}[]>;
|
|
8
|
+
export declare function getMany(context: E2BOperationContext): Promise<{
|
|
9
|
+
json: import("n8n-workflow").IDataObject;
|
|
10
|
+
pairedItem: {
|
|
11
|
+
item: number;
|
|
12
|
+
};
|
|
13
|
+
}[]>;
|
|
14
|
+
export declare function deleteSnapshot(context: E2BOperationContext): Promise<{
|
|
15
|
+
json: {
|
|
16
|
+
snapshotId: string;
|
|
17
|
+
deleted: boolean;
|
|
18
|
+
};
|
|
19
|
+
pairedItem: {
|
|
20
|
+
item: number;
|
|
21
|
+
};
|
|
22
|
+
}[]>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.create = create;
|
|
4
|
+
exports.getMany = getMany;
|
|
5
|
+
exports.deleteSnapshot = deleteSnapshot;
|
|
6
|
+
const client_1 = require("../client");
|
|
7
|
+
const helpers_1 = require("../helpers");
|
|
8
|
+
async function create(context) {
|
|
9
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
10
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
11
|
+
const sandboxId = (0, helpers_1.getRequiredStringParameter)(executeFunctions, 'sandboxId', 'Sandbox ID', itemIndex);
|
|
12
|
+
const snapshotName = (0, helpers_1.asNonEmptyString)(executeFunctions.getNodeParameter('snapshotName', itemIndex, ''));
|
|
13
|
+
const snapshot = await (0, client_1.createSnapshot)(connection, sandboxId, snapshotName);
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
json: (0, helpers_1.toSnapshotInfoData)(snapshot),
|
|
17
|
+
pairedItem: { item: itemIndex },
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
async function getMany(context) {
|
|
22
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
23
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
24
|
+
const sandboxId = (0, helpers_1.asNonEmptyString)(executeFunctions.getNodeParameter('sandboxId', itemIndex, ''));
|
|
25
|
+
const snapshots = await (0, client_1.listSnapshots)(connection, (0, helpers_1.getLimit)(executeFunctions, itemIndex), sandboxId);
|
|
26
|
+
return snapshots.map((snapshot) => ({
|
|
27
|
+
json: (0, helpers_1.toSnapshotInfoData)(snapshot),
|
|
28
|
+
pairedItem: { item: itemIndex },
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
async function deleteSnapshot(context) {
|
|
32
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
33
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
34
|
+
const snapshotId = (0, helpers_1.getRequiredStringParameter)(executeFunctions, 'snapshotId', 'Snapshot ID', itemIndex);
|
|
35
|
+
const deleted = await (0, client_1.deleteSnapshot)(connection, snapshotId);
|
|
36
|
+
return [
|
|
37
|
+
{
|
|
38
|
+
json: {
|
|
39
|
+
snapshotId,
|
|
40
|
+
deleted,
|
|
41
|
+
},
|
|
42
|
+
pairedItem: { item: itemIndex },
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=snapshot.operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.operations.js","sourceRoot":"","sources":["../../../../nodes/E2B/actions/snapshot.operations.ts"],"names":[],"mappings":";;AASA,wBAoBC;AAED,0BAcC;AAED,wCAoBC;AAnED,sCAAgG;AAChG,wCAKoB;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AClC,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B,CAAC,CAAC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,cAAc,CAAC,OAA4B;IAChE,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IACxE,MAAM,UAAU,GAAG,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;IAChE,MAAM,UAAU,GAAG,IAAA,oCAA0B,EAC5C,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,SAAS,CACT,CAAC;IACF,MAAM,OAAO,GAAG,MAAM,IAAA,uBAAkB,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAEjE,OAAO;QACN;YACC,IAAI,EAAE;gBACL,UAAU;gBACV,OAAO;aACP;YACD,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SAC/B;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { E2BOperationContext } from '../types';
|
|
2
|
+
export declare function create(context: E2BOperationContext): Promise<{
|
|
3
|
+
json: import("n8n-workflow").IDataObject;
|
|
4
|
+
pairedItem: {
|
|
5
|
+
item: number;
|
|
6
|
+
};
|
|
7
|
+
}[]>;
|
|
8
|
+
export declare function get(context: E2BOperationContext): Promise<{
|
|
9
|
+
json: import("n8n-workflow").IDataObject;
|
|
10
|
+
pairedItem: {
|
|
11
|
+
item: number;
|
|
12
|
+
};
|
|
13
|
+
}[]>;
|
|
14
|
+
export declare function getMany(context: E2BOperationContext): Promise<{
|
|
15
|
+
json: import("n8n-workflow").IDataObject;
|
|
16
|
+
pairedItem: {
|
|
17
|
+
item: number;
|
|
18
|
+
};
|
|
19
|
+
}[]>;
|
|
20
|
+
export declare function deleteVolume(context: E2BOperationContext): Promise<{
|
|
21
|
+
json: {
|
|
22
|
+
volumeId: string;
|
|
23
|
+
deleted: boolean;
|
|
24
|
+
};
|
|
25
|
+
pairedItem: {
|
|
26
|
+
item: number;
|
|
27
|
+
};
|
|
28
|
+
}[]>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.create = create;
|
|
4
|
+
exports.get = get;
|
|
5
|
+
exports.getMany = getMany;
|
|
6
|
+
exports.deleteVolume = deleteVolume;
|
|
7
|
+
const client_1 = require("../client");
|
|
8
|
+
const helpers_1 = require("../helpers");
|
|
9
|
+
async function create(context) {
|
|
10
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
11
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
12
|
+
const name = (0, helpers_1.getRequiredStringParameter)(executeFunctions, 'volumeName', 'Volume Name', itemIndex);
|
|
13
|
+
const volume = await (0, client_1.createVolume)(connection, name);
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
json: (0, helpers_1.toVolumeInfoData)(volume),
|
|
17
|
+
pairedItem: { item: itemIndex },
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
async function get(context) {
|
|
22
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
23
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
24
|
+
const volumeId = (0, helpers_1.getRequiredStringParameter)(executeFunctions, 'volumeId', 'Volume ID', itemIndex);
|
|
25
|
+
const volume = await (0, client_1.getVolume)(connection, volumeId);
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
json: (0, helpers_1.toVolumeInfoData)(volume),
|
|
29
|
+
pairedItem: { item: itemIndex },
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
async function getMany(context) {
|
|
34
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
35
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
36
|
+
const volumes = await (0, client_1.listVolumes)(connection);
|
|
37
|
+
return volumes.slice(0, (0, helpers_1.getLimit)(executeFunctions, itemIndex)).map((volume) => ({
|
|
38
|
+
json: (0, helpers_1.toVolumeInfoData)(volume),
|
|
39
|
+
pairedItem: { item: itemIndex },
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
async function deleteVolume(context) {
|
|
43
|
+
const { executeFunctions, credentials, itemIndex, timeoutMs } = context;
|
|
44
|
+
const connection = { executeFunctions, credentials, timeoutMs };
|
|
45
|
+
const volumeId = (0, helpers_1.getRequiredStringParameter)(executeFunctions, 'volumeId', 'Volume ID', itemIndex);
|
|
46
|
+
const deleted = await (0, client_1.deleteVolume)(connection, volumeId);
|
|
47
|
+
return [
|
|
48
|
+
{
|
|
49
|
+
json: {
|
|
50
|
+
volumeId,
|
|
51
|
+
deleted,
|
|
52
|
+
},
|
|
53
|
+
pairedItem: { item: itemIndex },
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=volume.operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"volume.operations.js","sourceRoot":"","sources":["../../../../nodes/E2B/actions/volume.operations.ts"],"names":[],"mappings":";;AAIA,wBAiBC;AAED,kBAYC;AAED,0BASC;AAED,oCAeC;AA/DD,sCAAmG;AACnG,wCAAoF;AAG7E,KAAK,UAAU,MAAM,CAAC,OAA4B;IACxD,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IACxE,MAAM,UAAU,GAAG,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;IAChE,MAAM,IAAI,GAAG,IAAA,oCAA0B,EACtC,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,SAAS,CACT,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAY,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAEpD,OAAO;QACN;YACC,IAAI,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OAA4B;IAC9D,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IACxE,MAAM,UAAU,GAAG,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;IAChE,MAAM,QAAQ,GAAG,IAAA,oCAA0B,EAAC,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IAClG,MAAM,OAAO,GAAG,MAAM,IAAA,qBAAgB,EAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAE7D,OAAO;QACN;YACC,IAAI,EAAE;gBACL,QAAQ;gBACR,OAAO;aACP;YACD,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SAC/B;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { ICredentialDataDecryptedObject, IDataObject, IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export interface E2BConnection {
|
|
3
|
+
executeFunctions: IExecuteFunctions;
|
|
4
|
+
credentials: ICredentialDataDecryptedObject;
|
|
5
|
+
timeoutMs: number;
|
|
6
|
+
}
|
|
7
|
+
export interface SandboxCreateOptions {
|
|
8
|
+
template?: string;
|
|
9
|
+
metadata?: Record<string, string>;
|
|
10
|
+
envs?: Record<string, string>;
|
|
11
|
+
volumeMounts?: Record<string, string>;
|
|
12
|
+
allowInternetAccess: boolean;
|
|
13
|
+
timeoutMs: number;
|
|
14
|
+
}
|
|
15
|
+
export interface SandboxInfo {
|
|
16
|
+
sandboxId: string;
|
|
17
|
+
templateId: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
metadata: Record<string, string>;
|
|
20
|
+
startedAt?: string;
|
|
21
|
+
endAt?: string;
|
|
22
|
+
state?: string;
|
|
23
|
+
cpuCount?: number;
|
|
24
|
+
memoryMB?: number;
|
|
25
|
+
envdVersion?: string;
|
|
26
|
+
allowInternetAccess?: boolean;
|
|
27
|
+
network?: IDataObject;
|
|
28
|
+
lifecycle?: IDataObject;
|
|
29
|
+
volumeMounts?: IDataObject[];
|
|
30
|
+
sandboxDomain?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ConnectedSandbox {
|
|
33
|
+
sandboxId: string;
|
|
34
|
+
sandboxDomain?: string;
|
|
35
|
+
envdVersion: string;
|
|
36
|
+
envdAccessToken?: string;
|
|
37
|
+
trafficAccessToken?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface SnapshotInfo {
|
|
40
|
+
snapshotId: string;
|
|
41
|
+
names: string[];
|
|
42
|
+
}
|
|
43
|
+
export interface VolumeInfo {
|
|
44
|
+
volumeId: string;
|
|
45
|
+
name: string;
|
|
46
|
+
token?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface FileInfo {
|
|
49
|
+
name: string;
|
|
50
|
+
type?: 'file' | 'dir';
|
|
51
|
+
path: string;
|
|
52
|
+
metadata?: Record<string, string>;
|
|
53
|
+
size?: number;
|
|
54
|
+
mode?: number;
|
|
55
|
+
permissions?: string;
|
|
56
|
+
owner?: string;
|
|
57
|
+
group?: string;
|
|
58
|
+
modifiedTime?: string;
|
|
59
|
+
symlinkTarget?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface WriteInfo {
|
|
62
|
+
name: string;
|
|
63
|
+
type?: 'file' | 'dir';
|
|
64
|
+
path: string;
|
|
65
|
+
metadata?: Record<string, string>;
|
|
66
|
+
}
|
|
67
|
+
export interface CommandResult {
|
|
68
|
+
exitCode: number;
|
|
69
|
+
error?: string;
|
|
70
|
+
stdout: string;
|
|
71
|
+
stderr: string;
|
|
72
|
+
}
|
|
73
|
+
export declare function createSandbox(connection: E2BConnection, options: SandboxCreateOptions): Promise<ConnectedSandbox>;
|
|
74
|
+
export declare function connectSandbox(connection: E2BConnection, sandboxId: string): Promise<ConnectedSandbox>;
|
|
75
|
+
export declare function getSandboxInfo(connection: E2BConnection, sandboxId: string): Promise<SandboxInfo>;
|
|
76
|
+
export declare function listSandboxes(connection: E2BConnection, limit: number): Promise<SandboxInfo[]>;
|
|
77
|
+
export declare function killSandbox(connection: E2BConnection, sandboxId: string): Promise<boolean>;
|
|
78
|
+
export declare function pauseSandbox(connection: E2BConnection, sandboxId: string): Promise<boolean>;
|
|
79
|
+
export declare function createSnapshot(connection: E2BConnection, sandboxId: string, name?: string): Promise<SnapshotInfo>;
|
|
80
|
+
export declare function listSnapshots(connection: E2BConnection, limit: number, sandboxId?: string): Promise<SnapshotInfo[]>;
|
|
81
|
+
export declare function deleteSnapshot(connection: E2BConnection, snapshotId: string): Promise<boolean>;
|
|
82
|
+
export declare function createVolume(connection: E2BConnection, name: string): Promise<VolumeInfo>;
|
|
83
|
+
export declare function getVolume(connection: E2BConnection, volumeId: string): Promise<VolumeInfo>;
|
|
84
|
+
export declare function listVolumes(connection: E2BConnection): Promise<VolumeInfo[]>;
|
|
85
|
+
export declare function deleteVolume(connection: E2BConnection, volumeId: string): Promise<boolean>;
|
|
86
|
+
export declare function getPreviewHost(connection: E2BConnection, sandbox: ConnectedSandbox, port: number): string;
|
|
87
|
+
export declare function readSandboxFile(connection: E2BConnection, sandbox: ConnectedSandbox, path: string, format: 'text' | 'bytes'): Promise<string | Buffer>;
|
|
88
|
+
export declare function writeSandboxFile(connection: E2BConnection, sandbox: ConnectedSandbox, path: string, content: string | Buffer): Promise<WriteInfo>;
|
|
89
|
+
export declare function listSandboxFiles(connection: E2BConnection, sandbox: ConnectedSandbox, path: string, depth: number): Promise<FileInfo[]>;
|
|
90
|
+
export declare function createSandboxFolder(connection: E2BConnection, sandbox: ConnectedSandbox, path: string): Promise<boolean>;
|
|
91
|
+
export declare function deleteSandboxFile(connection: E2BConnection, sandbox: ConnectedSandbox, path: string): Promise<void>;
|
|
92
|
+
export declare function getSandboxFileInfo(connection: E2BConnection, sandbox: ConnectedSandbox, path: string): Promise<FileInfo>;
|
|
93
|
+
export declare function moveSandboxFile(connection: E2BConnection, sandbox: ConnectedSandbox, source: string, destination: string): Promise<FileInfo>;
|
|
94
|
+
export declare function runSandboxCommand(connection: E2BConnection, sandbox: ConnectedSandbox, command: string, options?: {
|
|
95
|
+
cwd?: string;
|
|
96
|
+
envs?: Record<string, string>;
|
|
97
|
+
}): Promise<CommandResult>;
|