@egose/n8n-client 0.1.2 → 0.2.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/CHANGELOG.md +12 -0
- package/README.md +188 -46
- package/chunk-2R6A6NJE.js +38 -0
- package/chunk-3FDDCKAY.js +95 -0
- package/chunk-3YWWR6UD.cjs +98 -0
- package/chunk-4M2HGY3F.cjs +12 -0
- package/chunk-4VK7K4IF.js +29 -0
- package/chunk-54MX3Y2M.cjs +15 -0
- package/{chunk-NMKH2J77.js → chunk-54N6YD4R.js} +28 -6
- package/{chunk-2H3GEKKO.js → chunk-5DDMSYH2.js} +25 -6
- package/chunk-5ZRUF6XZ.cjs +15 -0
- package/chunk-6JJ6RA5B.cjs +32 -0
- package/chunk-7H75UBMH.cjs +29 -0
- package/chunk-B7CINZ27.cjs +43 -0
- package/chunk-BA4KTRMX.cjs +15 -0
- package/{chunk-DO5OI6ZU.js → chunk-BQ2OTUXQ.js} +25 -6
- package/chunk-C3JBYESS.cjs +35 -0
- package/chunk-C6W6ERQD.js +53 -0
- package/{chunk-5WH4FOE2.cjs → chunk-CCS5ALTN.cjs} +5 -5
- package/chunk-DTDNBA7W.cjs +59 -0
- package/chunk-ETVDSJLY.js +48 -0
- package/chunk-F5RPJMNK.js +15 -0
- package/chunk-FIKGC2EL.cjs +29 -0
- package/{chunk-YONLN7XM.cjs → chunk-FTIVM52X.cjs} +24 -5
- package/chunk-GEWLPVNV.cjs +48 -0
- package/{chunk-75AXCCWF.cjs → chunk-GZ3POWDP.cjs} +27 -5
- package/chunk-HISH4ORK.js +59 -0
- package/chunk-I4MMTW33.js +98 -0
- package/chunk-KRPRS2E5.cjs +46 -0
- package/chunk-L2FFL3BY.js +35 -0
- package/chunk-LQULSPET.cjs +55 -0
- package/chunk-LTYQTCHM.js +196 -0
- package/chunk-MMN2UKTI.cjs +41 -0
- package/chunk-NBLW25ME.cjs +67 -0
- package/chunk-NS2RDZ7W.js +15 -0
- package/chunk-OUOWDGL7.js +15 -0
- package/chunk-PT5DDLHC.js +46 -0
- package/chunk-Q6FSREKN.js +12 -0
- package/chunk-QJR4WFNV.js +55 -0
- package/chunk-RPB226OX.cjs +54 -0
- package/chunk-S4ZASMBT.js +43 -0
- package/chunk-T62VHXNY.js +67 -0
- package/chunk-TLBDBRPJ.js +29 -0
- package/chunk-TY76RTXQ.cjs +32 -0
- package/chunk-USTEEQQG.js +43 -0
- package/chunk-W5P34RYO.cjs +196 -0
- package/chunk-XJP6FPN3.js +41 -0
- package/chunk-YBMEMKCN.cjs +53 -0
- package/chunk-YE2OS2KS.js +32 -0
- package/chunk-YHSDCE3I.js +32 -0
- package/chunk-YSWBOCXJ.cjs +38 -0
- package/chunk-YUCX7HE3.js +15 -0
- package/chunk-Z3D4URRD.cjs +43 -0
- package/chunk-ZIIR24GM.cjs +95 -0
- package/chunk-ZPU6PQES.cjs +15 -0
- package/{chunk-6L3JVMUK.js → chunk-ZVZIMJRM.js} +6 -6
- package/clients/audit.cjs +8 -0
- package/{handles → clients}/audit.d.cts +3 -3
- package/{handles → clients}/audit.d.ts +3 -3
- package/clients/audit.js +8 -0
- package/clients/base.cjs +7 -0
- package/{handles → clients}/base.d.cts +2 -2
- package/{handles → clients}/base.d.ts +2 -2
- package/clients/base.js +7 -0
- package/clients/community-package.cjs +12 -0
- package/clients/community-package.d.cts +6 -0
- package/clients/community-package.d.ts +6 -0
- package/clients/community-package.js +12 -0
- package/clients/credential.cjs +10 -0
- package/clients/credential.d.cts +6 -0
- package/clients/credential.d.ts +6 -0
- package/clients/credential.js +10 -0
- package/clients/data-table.cjs +10 -0
- package/clients/data-table.d.cts +6 -0
- package/clients/data-table.d.ts +6 -0
- package/clients/data-table.js +10 -0
- package/clients/discover.cjs +8 -0
- package/{handles → clients}/discover.d.cts +3 -3
- package/{handles → clients}/discover.d.ts +3 -3
- package/clients/discover.js +8 -0
- package/clients/execution.cjs +10 -0
- package/clients/execution.d.cts +6 -0
- package/clients/execution.d.ts +6 -0
- package/clients/execution.js +10 -0
- package/clients/folder.cjs +10 -0
- package/clients/folder.d.cts +6 -0
- package/clients/folder.d.ts +6 -0
- package/clients/folder.js +10 -0
- package/clients/insights.cjs +8 -0
- package/{handles → clients}/insights.d.cts +3 -3
- package/{handles → clients}/insights.d.ts +3 -3
- package/clients/insights.js +8 -0
- package/clients/n8n-package.cjs +8 -0
- package/{handles → clients}/n8n-package.d.cts +3 -3
- package/{handles → clients}/n8n-package.d.ts +3 -3
- package/clients/n8n-package.js +8 -0
- package/clients/project.cjs +22 -0
- package/clients/project.d.cts +11 -0
- package/clients/project.d.ts +11 -0
- package/clients/project.js +22 -0
- package/clients/source-control.cjs +8 -0
- package/{handles → clients}/source-control.d.cts +3 -3
- package/{handles → clients}/source-control.d.ts +3 -3
- package/clients/source-control.js +8 -0
- package/clients/tag.cjs +10 -0
- package/clients/tag.d.cts +6 -0
- package/clients/tag.d.ts +6 -0
- package/clients/tag.js +10 -0
- package/clients/user.cjs +10 -0
- package/clients/user.d.cts +6 -0
- package/clients/user.d.ts +6 -0
- package/clients/user.js +10 -0
- package/clients/variable.cjs +12 -0
- package/clients/variable.d.cts +6 -0
- package/clients/variable.d.ts +6 -0
- package/clients/variable.js +12 -0
- package/clients/workflow.cjs +14 -0
- package/clients/workflow.d.cts +7 -0
- package/clients/workflow.d.ts +7 -0
- package/clients/workflow.js +14 -0
- package/community-package-CyzAqqwH.d.ts +26 -0
- package/community-package-DBpReCPV.d.cts +26 -0
- package/credential-BWcrGfqd.d.ts +34 -0
- package/credential-CEH7XbGn.d.cts +34 -0
- package/data-table-CHGUClGF.d.ts +60 -0
- package/data-table-CzR5kl9T.d.cts +60 -0
- package/execution-BjR6z5Vu.d.ts +33 -0
- package/execution-C0c9utwa.d.cts +33 -0
- package/folder-DvgIxSea.d.cts +31 -0
- package/folder-bjRPcy2j.d.ts +31 -0
- package/index.cjs +85 -44
- package/index.d.cts +42 -31
- package/index.d.ts +42 -31
- package/index.js +98 -57
- package/package.json +1 -1
- package/project-BS1fXSLW.d.cts +94 -0
- package/project-uws9k24H.d.ts +94 -0
- package/resources/base.cjs +7 -0
- package/resources/base.d.cts +11 -0
- package/resources/base.d.ts +11 -0
- package/resources/base.js +7 -0
- package/resources/community-package.cjs +8 -0
- package/resources/community-package.d.cts +6 -0
- package/resources/community-package.d.ts +6 -0
- package/resources/community-package.js +8 -0
- package/resources/credential.cjs +8 -0
- package/resources/credential.d.cts +6 -0
- package/resources/credential.d.ts +6 -0
- package/resources/credential.js +8 -0
- package/resources/data-table.cjs +8 -0
- package/resources/data-table.d.cts +6 -0
- package/resources/data-table.d.ts +6 -0
- package/resources/data-table.js +8 -0
- package/resources/execution.cjs +8 -0
- package/resources/execution.d.cts +6 -0
- package/resources/execution.d.ts +6 -0
- package/resources/execution.js +8 -0
- package/resources/folder.cjs +8 -0
- package/resources/folder.d.cts +6 -0
- package/resources/folder.d.ts +6 -0
- package/resources/folder.js +8 -0
- package/resources/project.cjs +11 -0
- package/resources/project.d.cts +11 -0
- package/resources/project.d.ts +11 -0
- package/resources/project.js +11 -0
- package/resources/tag.cjs +8 -0
- package/resources/tag.d.cts +6 -0
- package/resources/tag.d.ts +6 -0
- package/resources/tag.js +8 -0
- package/resources/user.cjs +8 -0
- package/resources/user.d.cts +6 -0
- package/resources/user.d.ts +6 -0
- package/resources/user.js +8 -0
- package/resources/variable.cjs +8 -0
- package/resources/variable.d.cts +6 -0
- package/resources/variable.d.ts +6 -0
- package/resources/variable.js +8 -0
- package/resources/workflow.cjs +10 -0
- package/resources/workflow.d.cts +7 -0
- package/resources/workflow.d.ts +7 -0
- package/resources/workflow.js +10 -0
- package/tag-CzazpR40.d.cts +27 -0
- package/tag-lmf8obZe.d.ts +27 -0
- package/user-B0WdVahA.d.ts +27 -0
- package/user-CBa2VjYj.d.cts +27 -0
- package/variable-C2LmlaTx.d.ts +29 -0
- package/variable-CuCiwy0G.d.cts +29 -0
- package/workflow-8pMj_fR_.d.ts +56 -0
- package/workflow-B2nxUmWq.d.cts +56 -0
- package/chunk-2DSU5F3J.js +0 -37
- package/chunk-2JBRCS53.js +0 -27
- package/chunk-4QPHBRTA.js +0 -15
- package/chunk-ACVK7R2L.cjs +0 -12
- package/chunk-BI6R6RFB.js +0 -36
- package/chunk-CDYFI72K.js +0 -28
- package/chunk-FKHPF5R5.cjs +0 -37
- package/chunk-GYCE5P4Y.js +0 -24
- package/chunk-HDN3VTQ4.cjs +0 -15
- package/chunk-HYJ7KYNG.cjs +0 -35
- package/chunk-IDD662MQ.js +0 -15
- package/chunk-JUWY746V.cjs +0 -15
- package/chunk-JWSD43W3.js +0 -36
- package/chunk-L36NK3EC.cjs +0 -27
- package/chunk-LBBJ6MTN.cjs +0 -36
- package/chunk-OHQBXLTJ.js +0 -12
- package/chunk-ONBMQHLH.cjs +0 -28
- package/chunk-R3HQQ6JP.cjs +0 -15
- package/chunk-RXHHER7R.js +0 -24
- package/chunk-THVPKRZ6.js +0 -15
- package/chunk-UKWCRX4F.cjs +0 -36
- package/chunk-UPL3BYDO.js +0 -15
- package/chunk-UU6H6FNY.cjs +0 -15
- package/chunk-VS6V3PD6.cjs +0 -24
- package/chunk-XHPNV55G.cjs +0 -24
- package/handles/audit.cjs +0 -8
- package/handles/audit.js +0 -8
- package/handles/base.cjs +0 -7
- package/handles/base.js +0 -7
- package/handles/community-package.cjs +0 -8
- package/handles/community-package.d.cts +0 -13
- package/handles/community-package.d.ts +0 -13
- package/handles/community-package.js +0 -8
- package/handles/credential.cjs +0 -8
- package/handles/credential.d.cts +0 -17
- package/handles/credential.d.ts +0 -17
- package/handles/credential.js +0 -8
- package/handles/data-table.cjs +0 -8
- package/handles/data-table.d.cts +0 -30
- package/handles/data-table.d.ts +0 -30
- package/handles/data-table.js +0 -8
- package/handles/discover.cjs +0 -8
- package/handles/discover.js +0 -8
- package/handles/execution.cjs +0 -8
- package/handles/execution.d.cts +0 -17
- package/handles/execution.d.ts +0 -17
- package/handles/execution.js +0 -8
- package/handles/folder.cjs +0 -8
- package/handles/folder.d.cts +0 -16
- package/handles/folder.d.ts +0 -16
- package/handles/folder.js +0 -8
- package/handles/insights.cjs +0 -8
- package/handles/insights.js +0 -8
- package/handles/n8n-package.cjs +0 -8
- package/handles/n8n-package.js +0 -8
- package/handles/project.cjs +0 -8
- package/handles/project.d.cts +0 -17
- package/handles/project.d.ts +0 -17
- package/handles/project.js +0 -8
- package/handles/source-control.cjs +0 -8
- package/handles/source-control.js +0 -8
- package/handles/tag.cjs +0 -8
- package/handles/tag.d.cts +0 -14
- package/handles/tag.d.ts +0 -14
- package/handles/tag.js +0 -8
- package/handles/user.cjs +0 -8
- package/handles/user.d.cts +0 -14
- package/handles/user.d.ts +0 -14
- package/handles/user.js +0 -8
- package/handles/variable.cjs +0 -8
- package/handles/variable.d.cts +0 -13
- package/handles/variable.d.ts +0 -13
- package/handles/variable.js +0 -8
- package/handles/workflow.cjs +0 -8
- package/handles/workflow.d.cts +0 -22
- package/handles/workflow.d.ts +0 -22
- package/handles/workflow.js +0 -8
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkFIKGC2ELcjs = require('./chunk-FIKGC2EL.cjs');
|
|
4
|
+
|
|
5
|
+
// src/resources/data-table.ts
|
|
6
|
+
var DataTableResource = class extends _chunkFIKGC2ELcjs.BaseResource {
|
|
7
|
+
constructor(dataTables, dataTable) {
|
|
8
|
+
super(dataTable);
|
|
9
|
+
this.dataTables = dataTables;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get id() {
|
|
13
|
+
return this.data.id;
|
|
14
|
+
}
|
|
15
|
+
get name() {
|
|
16
|
+
return this.data.name;
|
|
17
|
+
}
|
|
18
|
+
async refresh() {
|
|
19
|
+
return this.replaceSnapshot(await this.dataTables.get(this.id));
|
|
20
|
+
}
|
|
21
|
+
async update(data) {
|
|
22
|
+
return this.replaceSnapshot(await this.dataTables.update(this.id, data));
|
|
23
|
+
}
|
|
24
|
+
async delete() {
|
|
25
|
+
await this.dataTables.delete(this.id);
|
|
26
|
+
}
|
|
27
|
+
async listRows(params) {
|
|
28
|
+
return this.dataTables.listRows(this.id, params);
|
|
29
|
+
}
|
|
30
|
+
async insertRows(data) {
|
|
31
|
+
return this.dataTables.insertRows(
|
|
32
|
+
this.id,
|
|
33
|
+
data
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
async updateRows(data) {
|
|
37
|
+
return this.dataTables.updateRows(this.id, data);
|
|
38
|
+
}
|
|
39
|
+
async upsertRow(data) {
|
|
40
|
+
return this.dataTables.upsertRow(this.id, data);
|
|
41
|
+
}
|
|
42
|
+
async deleteRows(params) {
|
|
43
|
+
return this.dataTables.deleteRows(this.id, params);
|
|
44
|
+
}
|
|
45
|
+
async listColumns() {
|
|
46
|
+
return this.dataTables.listColumns(this.id);
|
|
47
|
+
}
|
|
48
|
+
async createColumn(data) {
|
|
49
|
+
const column = await this.dataTables.createColumn(this.id, data);
|
|
50
|
+
this.mergeSnapshot({ columns: [...this.data.columns, column] });
|
|
51
|
+
return column;
|
|
52
|
+
}
|
|
53
|
+
async updateColumn(columnId, data) {
|
|
54
|
+
const column = await this.dataTables.updateColumn(this.id, columnId, data);
|
|
55
|
+
this.mergeSnapshot({ columns: this.data.columns.map((entry) => entry.id === columnId ? column : entry) });
|
|
56
|
+
return column;
|
|
57
|
+
}
|
|
58
|
+
async deleteColumn(columnId) {
|
|
59
|
+
await this.dataTables.deleteColumn(this.id, columnId);
|
|
60
|
+
this.mergeSnapshot({ columns: this.data.columns.filter((entry) => entry.id !== columnId) });
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
exports.DataTableResource = DataTableResource;
|
|
67
|
+
//# sourceMappingURL=chunk-NBLW25ME.cjs.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseClient
|
|
3
|
+
} from "./chunk-Q6FSREKN.js";
|
|
4
|
+
|
|
5
|
+
// src/clients/insights.ts
|
|
6
|
+
var InsightsClient = class extends BaseClient {
|
|
7
|
+
async getSummary(params) {
|
|
8
|
+
return this.http.get("/insights/summary", params);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
InsightsClient
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=chunk-NS2RDZ7W.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseClient
|
|
3
|
+
} from "./chunk-Q6FSREKN.js";
|
|
4
|
+
|
|
5
|
+
// src/clients/source-control.ts
|
|
6
|
+
var SourceControlClient = class extends BaseClient {
|
|
7
|
+
async pull(data) {
|
|
8
|
+
return this.http.post("/source-control/pull", data);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
SourceControlClient
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=chunk-OUOWDGL7.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TagResource
|
|
3
|
+
} from "./chunk-4VK7K4IF.js";
|
|
4
|
+
import {
|
|
5
|
+
BaseClient
|
|
6
|
+
} from "./chunk-Q6FSREKN.js";
|
|
7
|
+
|
|
8
|
+
// src/clients/tag.ts
|
|
9
|
+
var TagClient = class extends BaseClient {
|
|
10
|
+
async list(params) {
|
|
11
|
+
return this.http.get("/tags", params);
|
|
12
|
+
}
|
|
13
|
+
async get(id) {
|
|
14
|
+
return this.http.get(`/tags/${id}`);
|
|
15
|
+
}
|
|
16
|
+
async getResource(id) {
|
|
17
|
+
return new TagResource(this, await this.get(id));
|
|
18
|
+
}
|
|
19
|
+
async listResources(params) {
|
|
20
|
+
const response = await this.list(params);
|
|
21
|
+
return {
|
|
22
|
+
data: response.data.map((tag) => new TagResource(this, tag)),
|
|
23
|
+
nextCursor: response.nextCursor
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
async create(data) {
|
|
27
|
+
return this.http.post("/tags", data);
|
|
28
|
+
}
|
|
29
|
+
async createResource(data) {
|
|
30
|
+
return new TagResource(this, await this.create(data));
|
|
31
|
+
}
|
|
32
|
+
async update(id, data) {
|
|
33
|
+
return this.http.put(`/tags/${id}`, data);
|
|
34
|
+
}
|
|
35
|
+
async updateResource(id, data) {
|
|
36
|
+
return new TagResource(this, await this.update(id, data));
|
|
37
|
+
}
|
|
38
|
+
async delete(id) {
|
|
39
|
+
return this.http.delete(`/tags/${id}`);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
TagClient
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=chunk-PT5DDLHC.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CredentialResource
|
|
3
|
+
} from "./chunk-XJP6FPN3.js";
|
|
4
|
+
import {
|
|
5
|
+
BaseClient
|
|
6
|
+
} from "./chunk-Q6FSREKN.js";
|
|
7
|
+
|
|
8
|
+
// src/clients/credential.ts
|
|
9
|
+
var CredentialClient = class extends BaseClient {
|
|
10
|
+
async list(params) {
|
|
11
|
+
return this.http.get("/credentials", params);
|
|
12
|
+
}
|
|
13
|
+
async get(id) {
|
|
14
|
+
return this.http.get(`/credentials/${id}`);
|
|
15
|
+
}
|
|
16
|
+
async getResource(id) {
|
|
17
|
+
return new CredentialResource(this, await this.get(id));
|
|
18
|
+
}
|
|
19
|
+
async listResources(params) {
|
|
20
|
+
const response = await this.list(params);
|
|
21
|
+
return {
|
|
22
|
+
data: response.data.map((credential) => new CredentialResource(this, credential)),
|
|
23
|
+
nextCursor: response.nextCursor
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
async create(data) {
|
|
27
|
+
return this.http.post("/credentials", data);
|
|
28
|
+
}
|
|
29
|
+
async createResource(data) {
|
|
30
|
+
return new CredentialResource(this, await this.create(data));
|
|
31
|
+
}
|
|
32
|
+
async update(id, data) {
|
|
33
|
+
return this.http.patch(`/credentials/${id}`, data);
|
|
34
|
+
}
|
|
35
|
+
async updateResource(id, data) {
|
|
36
|
+
return new CredentialResource(this, await this.update(id, data));
|
|
37
|
+
}
|
|
38
|
+
async delete(id) {
|
|
39
|
+
return this.http.delete(`/credentials/${id}`);
|
|
40
|
+
}
|
|
41
|
+
async test(id) {
|
|
42
|
+
return this.http.post(`/credentials/${id}/test`);
|
|
43
|
+
}
|
|
44
|
+
async transfer(id, destinationProjectId) {
|
|
45
|
+
await this.http.put(`/credentials/${id}/transfer`, { destinationProjectId });
|
|
46
|
+
}
|
|
47
|
+
async getSchema(credentialTypeName) {
|
|
48
|
+
return this.http.get(`/credentials/schema/${credentialTypeName}`);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
CredentialClient
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=chunk-QJR4WFNV.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk6JJ6RA5Bcjs = require('./chunk-6JJ6RA5B.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk4M2HGY3Fcjs = require('./chunk-4M2HGY3F.cjs');
|
|
7
|
+
|
|
8
|
+
// src/clients/folder.ts
|
|
9
|
+
var FolderClient = class extends _chunk4M2HGY3Fcjs.BaseClient {
|
|
10
|
+
|
|
11
|
+
constructor(http, projectId) {
|
|
12
|
+
super(http);
|
|
13
|
+
this.projectId = projectId;
|
|
14
|
+
}
|
|
15
|
+
async list(params) {
|
|
16
|
+
return this.http.get(`/projects/${this.projectId}/folders`, params);
|
|
17
|
+
}
|
|
18
|
+
async get(folderId) {
|
|
19
|
+
return this.http.get(`/projects/${this.projectId}/folders/${folderId}`);
|
|
20
|
+
}
|
|
21
|
+
async getResource(folderId) {
|
|
22
|
+
return new (0, _chunk6JJ6RA5Bcjs.FolderResource)(this, await this.get(folderId));
|
|
23
|
+
}
|
|
24
|
+
async listResources(params) {
|
|
25
|
+
const response = await this.list(params);
|
|
26
|
+
return {
|
|
27
|
+
data: response.data.map((folder) => new (0, _chunk6JJ6RA5Bcjs.FolderResource)(this, folder)),
|
|
28
|
+
nextCursor: void 0
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async create(data) {
|
|
32
|
+
return this.http.post(`/projects/${this.projectId}/folders`, data);
|
|
33
|
+
}
|
|
34
|
+
async createResource(data) {
|
|
35
|
+
return new (0, _chunk6JJ6RA5Bcjs.FolderResource)(this, await this.create(data));
|
|
36
|
+
}
|
|
37
|
+
async update(folderId, data) {
|
|
38
|
+
return this.http.patch(`/projects/${this.projectId}/folders/${folderId}`, data);
|
|
39
|
+
}
|
|
40
|
+
async updateResource(folderId, data) {
|
|
41
|
+
return new (0, _chunk6JJ6RA5Bcjs.FolderResource)(this, await this.update(folderId, data));
|
|
42
|
+
}
|
|
43
|
+
async delete(folderId, transferToFolderId) {
|
|
44
|
+
await this.http.delete(
|
|
45
|
+
`/projects/${this.projectId}/folders/${folderId}`,
|
|
46
|
+
transferToFolderId ? { transferToFolderId } : void 0
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
exports.FolderClient = FolderClient;
|
|
54
|
+
//# sourceMappingURL=chunk-RPB226OX.cjs.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseResource
|
|
3
|
+
} from "./chunk-TLBDBRPJ.js";
|
|
4
|
+
|
|
5
|
+
// src/resources/execution.ts
|
|
6
|
+
var ExecutionResource = class extends BaseResource {
|
|
7
|
+
constructor(executions, execution, params) {
|
|
8
|
+
super(execution);
|
|
9
|
+
this.executions = executions;
|
|
10
|
+
this.params = params;
|
|
11
|
+
}
|
|
12
|
+
executions;
|
|
13
|
+
params;
|
|
14
|
+
get id() {
|
|
15
|
+
return this.data.id;
|
|
16
|
+
}
|
|
17
|
+
get status() {
|
|
18
|
+
return this.data.status;
|
|
19
|
+
}
|
|
20
|
+
async refresh() {
|
|
21
|
+
return this.replaceSnapshot(await this.executions.get(this.id, this.params));
|
|
22
|
+
}
|
|
23
|
+
async delete() {
|
|
24
|
+
return this.executions.delete(this.id);
|
|
25
|
+
}
|
|
26
|
+
async retry(data) {
|
|
27
|
+
return this.replaceSnapshot(await this.executions.retry(this.id, data));
|
|
28
|
+
}
|
|
29
|
+
async stop() {
|
|
30
|
+
return this.replaceSnapshot(await this.executions.stop(this.id));
|
|
31
|
+
}
|
|
32
|
+
async getTags() {
|
|
33
|
+
return this.executions.getTags(this.id);
|
|
34
|
+
}
|
|
35
|
+
async updateTags(tags) {
|
|
36
|
+
return this.executions.updateTags(this.id, tags);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
ExecutionResource
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=chunk-S4ZASMBT.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseResource
|
|
3
|
+
} from "./chunk-TLBDBRPJ.js";
|
|
4
|
+
|
|
5
|
+
// src/resources/data-table.ts
|
|
6
|
+
var DataTableResource = class extends BaseResource {
|
|
7
|
+
constructor(dataTables, dataTable) {
|
|
8
|
+
super(dataTable);
|
|
9
|
+
this.dataTables = dataTables;
|
|
10
|
+
}
|
|
11
|
+
dataTables;
|
|
12
|
+
get id() {
|
|
13
|
+
return this.data.id;
|
|
14
|
+
}
|
|
15
|
+
get name() {
|
|
16
|
+
return this.data.name;
|
|
17
|
+
}
|
|
18
|
+
async refresh() {
|
|
19
|
+
return this.replaceSnapshot(await this.dataTables.get(this.id));
|
|
20
|
+
}
|
|
21
|
+
async update(data) {
|
|
22
|
+
return this.replaceSnapshot(await this.dataTables.update(this.id, data));
|
|
23
|
+
}
|
|
24
|
+
async delete() {
|
|
25
|
+
await this.dataTables.delete(this.id);
|
|
26
|
+
}
|
|
27
|
+
async listRows(params) {
|
|
28
|
+
return this.dataTables.listRows(this.id, params);
|
|
29
|
+
}
|
|
30
|
+
async insertRows(data) {
|
|
31
|
+
return this.dataTables.insertRows(
|
|
32
|
+
this.id,
|
|
33
|
+
data
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
async updateRows(data) {
|
|
37
|
+
return this.dataTables.updateRows(this.id, data);
|
|
38
|
+
}
|
|
39
|
+
async upsertRow(data) {
|
|
40
|
+
return this.dataTables.upsertRow(this.id, data);
|
|
41
|
+
}
|
|
42
|
+
async deleteRows(params) {
|
|
43
|
+
return this.dataTables.deleteRows(this.id, params);
|
|
44
|
+
}
|
|
45
|
+
async listColumns() {
|
|
46
|
+
return this.dataTables.listColumns(this.id);
|
|
47
|
+
}
|
|
48
|
+
async createColumn(data) {
|
|
49
|
+
const column = await this.dataTables.createColumn(this.id, data);
|
|
50
|
+
this.mergeSnapshot({ columns: [...this.data.columns, column] });
|
|
51
|
+
return column;
|
|
52
|
+
}
|
|
53
|
+
async updateColumn(columnId, data) {
|
|
54
|
+
const column = await this.dataTables.updateColumn(this.id, columnId, data);
|
|
55
|
+
this.mergeSnapshot({ columns: this.data.columns.map((entry) => entry.id === columnId ? column : entry) });
|
|
56
|
+
return column;
|
|
57
|
+
}
|
|
58
|
+
async deleteColumn(columnId) {
|
|
59
|
+
await this.dataTables.deleteColumn(this.id, columnId);
|
|
60
|
+
this.mergeSnapshot({ columns: this.data.columns.filter((entry) => entry.id !== columnId) });
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
DataTableResource
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=chunk-T62VHXNY.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// src/resources/base.ts
|
|
2
|
+
var BaseResource = class {
|
|
3
|
+
constructor(snapshot) {
|
|
4
|
+
this.snapshot = snapshot;
|
|
5
|
+
}
|
|
6
|
+
snapshot;
|
|
7
|
+
get data() {
|
|
8
|
+
return this.snapshot;
|
|
9
|
+
}
|
|
10
|
+
toObject() {
|
|
11
|
+
return this.snapshot;
|
|
12
|
+
}
|
|
13
|
+
toJSON() {
|
|
14
|
+
return this.toObject();
|
|
15
|
+
}
|
|
16
|
+
replaceSnapshot(data) {
|
|
17
|
+
this.snapshot = data;
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
mergeSnapshot(data) {
|
|
21
|
+
this.snapshot = { ...this.snapshot, ...data };
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
BaseResource
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-TLBDBRPJ.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkFIKGC2ELcjs = require('./chunk-FIKGC2EL.cjs');
|
|
4
|
+
|
|
5
|
+
// src/resources/community-package.ts
|
|
6
|
+
var CommunityPackageResource = class extends _chunkFIKGC2ELcjs.BaseResource {
|
|
7
|
+
constructor(communityPackages, communityPackage) {
|
|
8
|
+
super(communityPackage);
|
|
9
|
+
this.communityPackages = communityPackages;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get packageName() {
|
|
13
|
+
return this.data.packageName;
|
|
14
|
+
}
|
|
15
|
+
get installedVersion() {
|
|
16
|
+
return this.data.installedVersion;
|
|
17
|
+
}
|
|
18
|
+
async refresh() {
|
|
19
|
+
return this.replaceSnapshot((await this.communityPackages.getResource(this.packageName)).data);
|
|
20
|
+
}
|
|
21
|
+
async update(data) {
|
|
22
|
+
return this.replaceSnapshot(await this.communityPackages.update(this.packageName, data));
|
|
23
|
+
}
|
|
24
|
+
async uninstall() {
|
|
25
|
+
await this.communityPackages.uninstall(this.packageName);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
exports.CommunityPackageResource = CommunityPackageResource;
|
|
32
|
+
//# sourceMappingURL=chunk-TY76RTXQ.cjs.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UserResource
|
|
3
|
+
} from "./chunk-L2FFL3BY.js";
|
|
4
|
+
import {
|
|
5
|
+
BaseClient
|
|
6
|
+
} from "./chunk-Q6FSREKN.js";
|
|
7
|
+
|
|
8
|
+
// src/clients/user.ts
|
|
9
|
+
var UserClient = class extends BaseClient {
|
|
10
|
+
async list(params) {
|
|
11
|
+
return this.http.get("/users", params);
|
|
12
|
+
}
|
|
13
|
+
async get(id, params) {
|
|
14
|
+
return this.http.get(`/users/${id}`, params);
|
|
15
|
+
}
|
|
16
|
+
async getResource(id, params) {
|
|
17
|
+
return new UserResource(this, await this.get(id, params), params);
|
|
18
|
+
}
|
|
19
|
+
async listResources(params) {
|
|
20
|
+
const response = await this.list(params);
|
|
21
|
+
return {
|
|
22
|
+
data: response.data.map(
|
|
23
|
+
(user) => new UserResource(this, user, params?.includeRole ? { includeRole: true } : void 0)
|
|
24
|
+
),
|
|
25
|
+
nextCursor: response.nextCursor
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async create(data) {
|
|
29
|
+
return this.http.post("/users", data);
|
|
30
|
+
}
|
|
31
|
+
async delete(id) {
|
|
32
|
+
await this.http.delete(`/users/${id}`);
|
|
33
|
+
}
|
|
34
|
+
async changeRole(id, newRoleName) {
|
|
35
|
+
const data = { newRoleName };
|
|
36
|
+
await this.http.patch(`/users/${id}/role`, data);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
UserClient
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=chunk-USTEEQQG.js.map
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkNBLW25MEcjs = require('./chunk-NBLW25ME.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkLC3TKRMXcjs = require('./chunk-LC3TKRMX.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkFIKGC2ELcjs = require('./chunk-FIKGC2EL.cjs');
|
|
10
|
+
|
|
11
|
+
// src/resources/project.ts
|
|
12
|
+
var ProjectResource = class extends _chunkFIKGC2ELcjs.BaseResource {
|
|
13
|
+
constructor(projects, workflowsClient, foldersClient, variablesClient, dataTablesClient, executionsClient, project) {
|
|
14
|
+
super(project);
|
|
15
|
+
this.projects = projects;
|
|
16
|
+
this.relations = {
|
|
17
|
+
workflows: workflowsClient,
|
|
18
|
+
folders: foldersClient,
|
|
19
|
+
variables: variablesClient,
|
|
20
|
+
dataTables: dataTablesClient,
|
|
21
|
+
executions: executionsClient
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
get id() {
|
|
27
|
+
return this.data.id;
|
|
28
|
+
}
|
|
29
|
+
get name() {
|
|
30
|
+
return this.data.name;
|
|
31
|
+
}
|
|
32
|
+
get type() {
|
|
33
|
+
return this.data.type;
|
|
34
|
+
}
|
|
35
|
+
async update(data) {
|
|
36
|
+
await this.projects.update(this.id, data);
|
|
37
|
+
return this.mergeSnapshot(data);
|
|
38
|
+
}
|
|
39
|
+
async delete() {
|
|
40
|
+
await this.projects.delete(this.id);
|
|
41
|
+
}
|
|
42
|
+
async listMembers(params) {
|
|
43
|
+
return this.projects.listMembers(this.id, params);
|
|
44
|
+
}
|
|
45
|
+
async addMembers(relations) {
|
|
46
|
+
await this.projects.addMembers(this.id, relations);
|
|
47
|
+
}
|
|
48
|
+
async removeMember(userId) {
|
|
49
|
+
await this.projects.removeMember(this.id, userId);
|
|
50
|
+
}
|
|
51
|
+
async changeMemberRole(userId, role) {
|
|
52
|
+
await this.projects.changeMemberRole(this.id, userId, role);
|
|
53
|
+
}
|
|
54
|
+
workflows() {
|
|
55
|
+
return {
|
|
56
|
+
list: (params) => this.relations.workflows.list({ ...params, projectId: this.id }),
|
|
57
|
+
listResources: async (params) => {
|
|
58
|
+
const response = await this.relations.workflows.listResources({ ...params, projectId: this.id });
|
|
59
|
+
return response;
|
|
60
|
+
},
|
|
61
|
+
get: async (id) => {
|
|
62
|
+
if (!await this.hasResourceInProject({
|
|
63
|
+
listPage: (cursor) => this.relations.workflows.list({ projectId: this.id, cursor }),
|
|
64
|
+
matches: (workflow) => workflow.id === id
|
|
65
|
+
})) {
|
|
66
|
+
throw new (0, _chunkLC3TKRMXcjs.HttpError)(404, `Workflow not found in project: ${id}`, { id, projectId: this.id });
|
|
67
|
+
}
|
|
68
|
+
return this.relations.workflows.get(id);
|
|
69
|
+
},
|
|
70
|
+
getResource: async (id) => {
|
|
71
|
+
if (!await this.hasResourceInProject({
|
|
72
|
+
listPage: (cursor) => this.relations.workflows.list({ projectId: this.id, cursor }),
|
|
73
|
+
matches: (workflow) => workflow.id === id
|
|
74
|
+
})) {
|
|
75
|
+
throw new (0, _chunkLC3TKRMXcjs.HttpError)(404, `Workflow not found in project: ${id}`, { id, projectId: this.id });
|
|
76
|
+
}
|
|
77
|
+
return this.relations.workflows.getResource(id);
|
|
78
|
+
},
|
|
79
|
+
createResource: (data) => this.relations.workflows.createResource({ ...data, projectId: this.id }),
|
|
80
|
+
create: (data) => this.relations.workflows.create({ ...data, projectId: this.id }),
|
|
81
|
+
update: async (id, data) => {
|
|
82
|
+
if (!await this.hasResourceInProject({
|
|
83
|
+
listPage: (cursor) => this.relations.workflows.list({ projectId: this.id, cursor }),
|
|
84
|
+
matches: (workflow) => workflow.id === id
|
|
85
|
+
})) {
|
|
86
|
+
throw new (0, _chunkLC3TKRMXcjs.HttpError)(404, `Workflow not found in project: ${id}`, { id, projectId: this.id });
|
|
87
|
+
}
|
|
88
|
+
return this.relations.workflows.update(id, data);
|
|
89
|
+
},
|
|
90
|
+
updateResource: async (id, data) => {
|
|
91
|
+
if (!await this.hasResourceInProject({
|
|
92
|
+
listPage: (cursor) => this.relations.workflows.list({ projectId: this.id, cursor }),
|
|
93
|
+
matches: (workflow) => workflow.id === id
|
|
94
|
+
})) {
|
|
95
|
+
throw new (0, _chunkLC3TKRMXcjs.HttpError)(404, `Workflow not found in project: ${id}`, { id, projectId: this.id });
|
|
96
|
+
}
|
|
97
|
+
return this.relations.workflows.updateResource(id, data);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
folders() {
|
|
102
|
+
return {
|
|
103
|
+
list: (params) => this.relations.folders.list(params),
|
|
104
|
+
listResources: (params) => this.relations.folders.listResources(params),
|
|
105
|
+
getResource: (id) => this.relations.folders.getResource(id),
|
|
106
|
+
createResource: (data) => this.relations.folders.createResource(data),
|
|
107
|
+
create: (data) => this.relations.folders.create(data),
|
|
108
|
+
get: (id) => this.relations.folders.get(id),
|
|
109
|
+
update: (id, data) => this.relations.folders.update(id, data),
|
|
110
|
+
updateResource: (id, data) => this.relations.folders.updateResource(id, data),
|
|
111
|
+
delete: (id, transferToFolderId) => this.relations.folders.delete(id, transferToFolderId)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
variables() {
|
|
115
|
+
return {
|
|
116
|
+
list: (params) => this.relations.variables.list({ ...params, projectId: this.id }),
|
|
117
|
+
listResources: (params) => this.relations.variables.listResources({ ...params, projectId: this.id }),
|
|
118
|
+
get: (id) => this.relations.variables.get(id, { projectId: this.id }),
|
|
119
|
+
getResource: (id) => this.relations.variables.getResource(id, { projectId: this.id }),
|
|
120
|
+
create: (data) => this.relations.variables.create({ ...data, projectId: this.id }),
|
|
121
|
+
update: (id, data) => this.relations.variables.update(id, { ...data, projectId: this.id }),
|
|
122
|
+
updateResource: async (id, data) => {
|
|
123
|
+
await this.relations.variables.update(id, { ...data, projectId: this.id });
|
|
124
|
+
return this.relations.variables.getResource(id, { projectId: this.id });
|
|
125
|
+
},
|
|
126
|
+
delete: (id) => this.relations.variables.delete(id)
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
dataTables() {
|
|
130
|
+
return {
|
|
131
|
+
get: (id) => this.getProjectDataTableOrThrow(id),
|
|
132
|
+
getResource: async (id) => new (0, _chunkNBLW25MEcjs.DataTableResource)(this.relations.dataTables, await this.getProjectDataTableOrThrow(id)),
|
|
133
|
+
create: (data) => this.relations.dataTables.create({ ...data, projectId: this.id }),
|
|
134
|
+
createResource: (data) => this.relations.dataTables.createResource({ ...data, projectId: this.id }),
|
|
135
|
+
update: async (id, data) => {
|
|
136
|
+
await this.getProjectDataTableOrThrow(id);
|
|
137
|
+
return this.relations.dataTables.update(id, data);
|
|
138
|
+
},
|
|
139
|
+
updateResource: async (id, data) => {
|
|
140
|
+
await this.getProjectDataTableOrThrow(id);
|
|
141
|
+
return this.relations.dataTables.updateResource(id, data);
|
|
142
|
+
},
|
|
143
|
+
delete: async (id) => {
|
|
144
|
+
await this.getProjectDataTableOrThrow(id);
|
|
145
|
+
await this.relations.dataTables.delete(id);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
executions() {
|
|
150
|
+
return {
|
|
151
|
+
list: (params) => this.relations.executions.list({ ...params, projectId: this.id }),
|
|
152
|
+
listResources: (params) => this.relations.executions.listResources({ ...params, projectId: this.id }),
|
|
153
|
+
get: async (id, params) => {
|
|
154
|
+
if (!await this.hasResourceInProject({
|
|
155
|
+
listPage: (cursor) => this.relations.executions.list({ projectId: this.id, cursor }),
|
|
156
|
+
matches: (execution) => execution.id === id
|
|
157
|
+
})) {
|
|
158
|
+
throw new (0, _chunkLC3TKRMXcjs.HttpError)(404, `Execution not found in project: ${id}`, { id, projectId: this.id });
|
|
159
|
+
}
|
|
160
|
+
return this.relations.executions.get(id, params);
|
|
161
|
+
},
|
|
162
|
+
getResource: async (id, params) => {
|
|
163
|
+
if (!await this.hasResourceInProject({
|
|
164
|
+
listPage: (cursor) => this.relations.executions.list({ projectId: this.id, cursor }),
|
|
165
|
+
matches: (execution) => execution.id === id
|
|
166
|
+
})) {
|
|
167
|
+
throw new (0, _chunkLC3TKRMXcjs.HttpError)(404, `Execution not found in project: ${id}`, { id, projectId: this.id });
|
|
168
|
+
}
|
|
169
|
+
return this.relations.executions.getResource(id, params);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
async getProjectDataTableOrThrow(id) {
|
|
174
|
+
const dataTable = await this.relations.dataTables.get(id);
|
|
175
|
+
if (dataTable.projectId !== this.id) {
|
|
176
|
+
throw new (0, _chunkLC3TKRMXcjs.HttpError)(404, `Data table not found in project: ${id}`, { id, projectId: this.id });
|
|
177
|
+
}
|
|
178
|
+
return dataTable;
|
|
179
|
+
}
|
|
180
|
+
async hasResourceInProject(options) {
|
|
181
|
+
let cursor;
|
|
182
|
+
do {
|
|
183
|
+
const response = await options.listPage(cursor);
|
|
184
|
+
if (response.data.some(options.matches)) {
|
|
185
|
+
return true;
|
|
186
|
+
}
|
|
187
|
+
cursor = response.nextCursor;
|
|
188
|
+
} while (cursor);
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
exports.ProjectResource = ProjectResource;
|
|
196
|
+
//# sourceMappingURL=chunk-W5P34RYO.cjs.map
|