@egose/n8n-client 0.2.1 → 0.3.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.
Files changed (121) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +8 -0
  3. package/{chunk-6JJ6RA5B.cjs → chunk-2T5KNPFX.cjs} +8 -1
  4. package/{chunk-RPB226OX.cjs → chunk-6MUNAE5L.cjs} +6 -6
  5. package/{chunk-3FDDCKAY.js → chunk-AS5WBSR3.js} +6 -6
  6. package/{chunk-TY76RTXQ.cjs → chunk-CWQXMALU.cjs} +7 -1
  7. package/{chunk-YSWBOCXJ.cjs → chunk-D4GV65GT.cjs} +10 -1
  8. package/{chunk-KRPRS2E5.cjs → chunk-DYUXQTFU.cjs} +6 -6
  9. package/{chunk-7H75UBMH.cjs → chunk-FB754K3A.cjs} +7 -1
  10. package/{chunk-4VK7K4IF.js → chunk-FOZHT2ZK.js} +7 -1
  11. package/{chunk-T62VHXNY.js → chunk-FSN23TT6.js} +7 -1
  12. package/{chunk-NBLW25ME.cjs → chunk-GUTI2M4U.cjs} +7 -1
  13. package/{chunk-GZ3POWDP.cjs → chunk-I2VZ7J4P.cjs} +6 -6
  14. package/{chunk-MMN2UKTI.cjs → chunk-JFTS6N3U.cjs} +11 -1
  15. package/{chunk-54N6YD4R.js → chunk-KBFYNP56.js} +2 -2
  16. package/{chunk-ETVDSJLY.js → chunk-KKFA5PJR.js} +2 -2
  17. package/{chunk-I4MMTW33.js → chunk-KMFHNXIH.js} +13 -1
  18. package/{chunk-W5P34RYO.cjs → chunk-O7AV3KS4.cjs} +31 -3
  19. package/{chunk-2R6A6NJE.js → chunk-PEUZAXIY.js} +10 -1
  20. package/{chunk-DTDNBA7W.cjs → chunk-TFMO4KWG.cjs} +4 -4
  21. package/{chunk-3YWWR6UD.cjs → chunk-TUWIRWCR.cjs} +14 -2
  22. package/{chunk-ZIIR24GM.cjs → chunk-U7CFNNJT.cjs} +11 -11
  23. package/{chunk-YE2OS2KS.js → chunk-UCSJX4UC.js} +8 -1
  24. package/{chunk-BQ2OTUXQ.js → chunk-UZYRG5OI.js} +2 -2
  25. package/{chunk-PT5DDLHC.js → chunk-VOCYFQYV.js} +2 -2
  26. package/{chunk-5DDMSYH2.js → chunk-W23TMDMQ.js} +2 -2
  27. package/{chunk-XJP6FPN3.js → chunk-WDO7B3R6.js} +11 -1
  28. package/{chunk-FTIVM52X.cjs → chunk-WO3YZAZT.cjs} +6 -6
  29. package/{chunk-YHSDCE3I.js → chunk-WQJUADC6.js} +7 -1
  30. package/{chunk-LQULSPET.cjs → chunk-WWVQNBTG.cjs} +6 -6
  31. package/{chunk-QJR4WFNV.js → chunk-YAYKWLOQ.js} +2 -2
  32. package/{chunk-GEWLPVNV.cjs → chunk-YWK563XR.cjs} +6 -6
  33. package/{chunk-LTYQTCHM.js → chunk-Z7XHC77E.js} +30 -2
  34. package/{chunk-HISH4ORK.js → chunk-ZPE32BQU.js} +2 -2
  35. package/clients/community-package.cjs +3 -3
  36. package/clients/community-package.d.cts +1 -1
  37. package/clients/community-package.d.ts +1 -1
  38. package/clients/community-package.js +2 -2
  39. package/clients/credential.cjs +3 -3
  40. package/clients/credential.d.cts +1 -1
  41. package/clients/credential.d.ts +1 -1
  42. package/clients/credential.js +2 -2
  43. package/clients/data-table.cjs +3 -3
  44. package/clients/data-table.d.cts +1 -1
  45. package/clients/data-table.d.ts +1 -1
  46. package/clients/data-table.js +2 -2
  47. package/clients/folder.cjs +3 -3
  48. package/clients/folder.d.cts +1 -1
  49. package/clients/folder.d.ts +1 -1
  50. package/clients/folder.js +2 -2
  51. package/clients/project.cjs +11 -11
  52. package/clients/project.d.cts +5 -5
  53. package/clients/project.d.ts +5 -5
  54. package/clients/project.js +10 -10
  55. package/clients/tag.cjs +3 -3
  56. package/clients/tag.d.cts +1 -1
  57. package/clients/tag.d.ts +1 -1
  58. package/clients/tag.js +2 -2
  59. package/clients/variable.cjs +3 -3
  60. package/clients/variable.d.cts +1 -1
  61. package/clients/variable.d.ts +1 -1
  62. package/clients/variable.js +2 -2
  63. package/clients/workflow.cjs +3 -3
  64. package/clients/workflow.d.cts +1 -1
  65. package/clients/workflow.d.ts +1 -1
  66. package/clients/workflow.js +2 -2
  67. package/{community-package-DBpReCPV.d.cts → community-package-BvmF_pP6.d.cts} +1 -0
  68. package/{community-package-CyzAqqwH.d.ts → community-package-xeQrLKme.d.ts} +1 -0
  69. package/{credential-CEH7XbGn.d.cts → credential-DPt1le6v.d.cts} +1 -0
  70. package/{credential-BWcrGfqd.d.ts → credential-Knm3Xhxp.d.ts} +1 -0
  71. package/{data-table-CHGUClGF.d.ts → data-table-Cg92UE2v.d.ts} +1 -0
  72. package/{data-table-CzR5kl9T.d.cts → data-table-ablBPGNU.d.cts} +1 -0
  73. package/{folder-DvgIxSea.d.cts → folder-DDe0xOyE.d.cts} +1 -0
  74. package/{folder-bjRPcy2j.d.ts → folder-JrOxuQPO.d.ts} +1 -0
  75. package/index.cjs +67 -26
  76. package/index.d.cts +74 -16
  77. package/index.d.ts +74 -16
  78. package/index.js +57 -16
  79. package/package.json +1 -1
  80. package/{project-BS1fXSLW.d.cts → project-CfXFXbv5.d.cts} +13 -4
  81. package/{project-uws9k24H.d.ts → project-DwqDoil4.d.ts} +13 -4
  82. package/resources/community-package.cjs +2 -2
  83. package/resources/community-package.d.cts +1 -1
  84. package/resources/community-package.d.ts +1 -1
  85. package/resources/community-package.js +1 -1
  86. package/resources/credential.cjs +2 -2
  87. package/resources/credential.d.cts +1 -1
  88. package/resources/credential.d.ts +1 -1
  89. package/resources/credential.js +1 -1
  90. package/resources/data-table.cjs +2 -2
  91. package/resources/data-table.d.cts +1 -1
  92. package/resources/data-table.d.ts +1 -1
  93. package/resources/data-table.js +1 -1
  94. package/resources/folder.cjs +2 -2
  95. package/resources/folder.d.cts +1 -1
  96. package/resources/folder.d.ts +1 -1
  97. package/resources/folder.js +1 -1
  98. package/resources/project.cjs +3 -3
  99. package/resources/project.d.cts +5 -5
  100. package/resources/project.d.ts +5 -5
  101. package/resources/project.js +2 -2
  102. package/resources/tag.cjs +2 -2
  103. package/resources/tag.d.cts +1 -1
  104. package/resources/tag.d.ts +1 -1
  105. package/resources/tag.js +1 -1
  106. package/resources/variable.cjs +2 -2
  107. package/resources/variable.d.cts +1 -1
  108. package/resources/variable.d.ts +1 -1
  109. package/resources/variable.js +1 -1
  110. package/resources/workflow.cjs +2 -2
  111. package/resources/workflow.d.cts +1 -1
  112. package/resources/workflow.d.ts +1 -1
  113. package/resources/workflow.js +1 -1
  114. package/{tag-lmf8obZe.d.ts → tag-5nOUYuYG.d.ts} +1 -0
  115. package/{tag-CzazpR40.d.cts → tag-DGGIqWix.d.cts} +1 -0
  116. package/types.d.cts +350 -0
  117. package/types.d.ts +350 -0
  118. package/{variable-CuCiwy0G.d.cts → variable-8kNQCTQx.d.cts} +1 -0
  119. package/{variable-C2LmlaTx.d.ts → variable-MVqhrcW-.d.ts} +1 -0
  120. package/{workflow-B2nxUmWq.d.cts → workflow-BD375xvs.d.cts} +1 -0
  121. package/{workflow-8pMj_fR_.d.ts → workflow-CLUVboDB.d.ts} +1 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [0.3.0](https://github.com/egose/n8n-client/compare/v0.2.1...v0.3.0) (2026-06-14)
2
+
3
+ ### Features
4
+
5
+ * expand and refine API type definitions ([2437e7b](https://github.com/egose/n8n-client/commit/2437e7b6e425e4900c453574904df7d408530031))
6
+ * **website:** add patch and patchResource for partial updates and improve documentation ([e916523](https://github.com/egose/n8n-client/commit/e916523b32b8c476849b65348983420172b7698b))
7
+
8
+ ### Docs
9
+
10
+ * add JSDoc to N8nClient and create coding agent guide ([28013b1](https://github.com/egose/n8n-client/commit/28013b127c4afe2c63e7c78e12a7d2f1ce02cb47))
11
+
1
12
  ## [0.2.1](https://github.com/egose/n8n-client/compare/v0.2.0...v0.2.1) (2026-06-14)
2
13
 
3
14
  ### Docs
package/README.md CHANGED
@@ -149,10 +149,13 @@ await workflows.data[0]?.archive();
149
149
 
150
150
  const folders = await project.folders().listResources({ take: '10' });
151
151
  await folders.data[0]?.update({ name: 'Archived Workflows' });
152
+ await folders.data[0]?.patch({ parentFolderId: 'archive-root' });
152
153
 
153
154
  const renamedFolder = await project.folders().updateResource('folder-id', { name: 'Archived Workflows' });
155
+ const movedFolder = await project.folders().patchResource('folder-id', { parentFolderId: 'archive-root' });
154
156
 
155
157
  await project.variables().create({ key: 'API_URL', value: 'https://example.com' });
158
+ await project.variables().patch('var-1', { value: 'https://api.example.com' });
156
159
 
157
160
  const createdWorkflow = await project.workflows().create({
158
161
  name: 'Sync',
@@ -185,6 +188,8 @@ const workflowResource = await project.workflows().getResource('wf-1');
185
188
 
186
189
  const rawFolder = await project.folders().update('folder-id', { name: 'Archive' });
187
190
  const folderResource = await project.folders().updateResource('folder-id', { name: 'Archive' });
191
+ const patchedWorkflow = await project.workflows().patch('wf-1', { name: 'Archive Sync' });
192
+ const patchedWorkflowResource = await project.workflows().patchResource('wf-1', { name: 'Archive Sync v2' });
188
193
  ```
189
194
 
190
195
  The same rule applies at the top-level clients: use `get()` for raw API objects and `getResource()` for bound instances.
@@ -210,6 +215,7 @@ await execution.stop();
210
215
 
211
216
  const variable = await client.variables().getResource('var-1');
212
217
  await variable.update({ key: 'API_URL', value: 'https://example.com' });
218
+ await variable.patch({ value: 'https://api.internal.example.com' });
213
219
 
214
220
  const dataTable = await client.dataTables().createResource({
215
221
  name: 'Users',
@@ -227,6 +233,7 @@ const pkg = await client.communityPackages().installResource({
227
233
  });
228
234
 
229
235
  await pkg.update({ version: '2.0.0' });
236
+ await pkg.patch({ verify: true });
230
237
  await pkg.uninstall();
231
238
  ```
232
239
 
@@ -252,6 +259,7 @@ Rule of thumb:
252
259
  - `create()` mirrors the underlying API/client return type
253
260
  - `createResource()` returns a bound resource instance when the API returns the created entity
254
261
  - `updateResource()` returns a bound resource instance when the updated result can be represented honestly, either from the update response itself or from a verified follow-up fetch
262
+ - `patch()` / `patchResource()` are convenience helpers on bound resources and nested collections that merge your partial fields over the current resource snapshot before calling the underlying update path
255
263
 
256
264
  `projects().createResource()` is intentionally not available because `POST /projects` returns no entity or identifier.
257
265
 
@@ -21,6 +21,13 @@ var FolderResource = class extends _chunkFIKGC2ELcjs.BaseResource {
21
21
  async update(data) {
22
22
  return this.replaceSnapshot(await this.folders.update(this.id, data));
23
23
  }
24
+ async patch(data) {
25
+ return this.update({
26
+ name: this.data.name,
27
+ parentFolderId: this.data.parentFolderId,
28
+ ...data
29
+ });
30
+ }
24
31
  async delete(transferToFolderId) {
25
32
  await this.folders.delete(this.id, transferToFolderId);
26
33
  }
@@ -29,4 +36,4 @@ var FolderResource = class extends _chunkFIKGC2ELcjs.BaseResource {
29
36
 
30
37
 
31
38
  exports.FolderResource = FolderResource;
32
- //# sourceMappingURL=chunk-6JJ6RA5B.cjs.map
39
+ //# sourceMappingURL=chunk-2T5KNPFX.cjs.map
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk6JJ6RA5Bcjs = require('./chunk-6JJ6RA5B.cjs');
3
+ var _chunk2T5KNPFXcjs = require('./chunk-2T5KNPFX.cjs');
4
4
 
5
5
 
6
6
  var _chunk4M2HGY3Fcjs = require('./chunk-4M2HGY3F.cjs');
@@ -19,12 +19,12 @@ var FolderClient = class extends _chunk4M2HGY3Fcjs.BaseClient {
19
19
  return this.http.get(`/projects/${this.projectId}/folders/${folderId}`);
20
20
  }
21
21
  async getResource(folderId) {
22
- return new (0, _chunk6JJ6RA5Bcjs.FolderResource)(this, await this.get(folderId));
22
+ return new (0, _chunk2T5KNPFXcjs.FolderResource)(this, await this.get(folderId));
23
23
  }
24
24
  async listResources(params) {
25
25
  const response = await this.list(params);
26
26
  return {
27
- data: response.data.map((folder) => new (0, _chunk6JJ6RA5Bcjs.FolderResource)(this, folder)),
27
+ data: response.data.map((folder) => new (0, _chunk2T5KNPFXcjs.FolderResource)(this, folder)),
28
28
  nextCursor: void 0
29
29
  };
30
30
  }
@@ -32,13 +32,13 @@ var FolderClient = class extends _chunk4M2HGY3Fcjs.BaseClient {
32
32
  return this.http.post(`/projects/${this.projectId}/folders`, data);
33
33
  }
34
34
  async createResource(data) {
35
- return new (0, _chunk6JJ6RA5Bcjs.FolderResource)(this, await this.create(data));
35
+ return new (0, _chunk2T5KNPFXcjs.FolderResource)(this, await this.create(data));
36
36
  }
37
37
  async update(folderId, data) {
38
38
  return this.http.patch(`/projects/${this.projectId}/folders/${folderId}`, data);
39
39
  }
40
40
  async updateResource(folderId, data) {
41
- return new (0, _chunk6JJ6RA5Bcjs.FolderResource)(this, await this.update(folderId, data));
41
+ return new (0, _chunk2T5KNPFXcjs.FolderResource)(this, await this.update(folderId, data));
42
42
  }
43
43
  async delete(folderId, transferToFolderId) {
44
44
  await this.http.delete(
@@ -51,4 +51,4 @@ var FolderClient = class extends _chunk4M2HGY3Fcjs.BaseClient {
51
51
 
52
52
 
53
53
  exports.FolderClient = FolderClient;
54
- //# sourceMappingURL=chunk-RPB226OX.cjs.map
54
+ //# sourceMappingURL=chunk-6MUNAE5L.cjs.map
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  ProjectResource
3
- } from "./chunk-LTYQTCHM.js";
3
+ } from "./chunk-Z7XHC77E.js";
4
4
  import {
5
5
  VariableClient
6
- } from "./chunk-HISH4ORK.js";
6
+ } from "./chunk-ZPE32BQU.js";
7
7
  import {
8
8
  WorkflowClient
9
- } from "./chunk-54N6YD4R.js";
9
+ } from "./chunk-KBFYNP56.js";
10
10
  import {
11
11
  DataTableClient
12
- } from "./chunk-BQ2OTUXQ.js";
12
+ } from "./chunk-UZYRG5OI.js";
13
13
  import {
14
14
  ExecutionClient
15
15
  } from "./chunk-C6W6ERQD.js";
16
16
  import {
17
17
  FolderClient
18
- } from "./chunk-5DDMSYH2.js";
18
+ } from "./chunk-W23TMDMQ.js";
19
19
  import {
20
20
  HttpError
21
21
  } from "./chunk-RMEH2UPX.js";
@@ -92,4 +92,4 @@ var ProjectClient = class extends BaseClient {
92
92
  export {
93
93
  ProjectClient
94
94
  };
95
- //# sourceMappingURL=chunk-3FDDCKAY.js.map
95
+ //# sourceMappingURL=chunk-AS5WBSR3.js.map
@@ -21,6 +21,12 @@ var CommunityPackageResource = class extends _chunkFIKGC2ELcjs.BaseResource {
21
21
  async update(data) {
22
22
  return this.replaceSnapshot(await this.communityPackages.update(this.packageName, data));
23
23
  }
24
+ async patch(data) {
25
+ return this.update({
26
+ version: this.data.installedVersion,
27
+ ...data
28
+ });
29
+ }
24
30
  async uninstall() {
25
31
  await this.communityPackages.uninstall(this.packageName);
26
32
  }
@@ -29,4 +35,4 @@ var CommunityPackageResource = class extends _chunkFIKGC2ELcjs.BaseResource {
29
35
 
30
36
 
31
37
  exports.CommunityPackageResource = CommunityPackageResource;
32
- //# sourceMappingURL=chunk-TY76RTXQ.cjs.map
38
+ //# sourceMappingURL=chunk-CWQXMALU.cjs.map
@@ -27,6 +27,15 @@ var VariableResource = class extends _chunkFIKGC2ELcjs.BaseResource {
27
27
  await this.variables.update(this.id, data);
28
28
  return this.mergeSnapshot(data);
29
29
  }
30
+ async patch(data) {
31
+ await this.variables.update(this.id, {
32
+ key: this.data.key,
33
+ value: this.data.value,
34
+ ...this.data.project ? { projectId: this.data.project.id } : {},
35
+ ...data
36
+ });
37
+ return this.mergeSnapshot(data);
38
+ }
30
39
  async delete() {
31
40
  await this.variables.delete(this.id);
32
41
  }
@@ -35,4 +44,4 @@ var VariableResource = class extends _chunkFIKGC2ELcjs.BaseResource {
35
44
 
36
45
 
37
46
  exports.VariableResource = VariableResource;
38
- //# sourceMappingURL=chunk-YSWBOCXJ.cjs.map
47
+ //# sourceMappingURL=chunk-D4GV65GT.cjs.map
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk7H75UBMHcjs = require('./chunk-7H75UBMH.cjs');
3
+ var _chunkFB754K3Acjs = require('./chunk-FB754K3A.cjs');
4
4
 
5
5
 
6
6
  var _chunk4M2HGY3Fcjs = require('./chunk-4M2HGY3F.cjs');
@@ -14,12 +14,12 @@ var TagClient = class extends _chunk4M2HGY3Fcjs.BaseClient {
14
14
  return this.http.get(`/tags/${id}`);
15
15
  }
16
16
  async getResource(id) {
17
- return new (0, _chunk7H75UBMHcjs.TagResource)(this, await this.get(id));
17
+ return new (0, _chunkFB754K3Acjs.TagResource)(this, await this.get(id));
18
18
  }
19
19
  async listResources(params) {
20
20
  const response = await this.list(params);
21
21
  return {
22
- data: response.data.map((tag) => new (0, _chunk7H75UBMHcjs.TagResource)(this, tag)),
22
+ data: response.data.map((tag) => new (0, _chunkFB754K3Acjs.TagResource)(this, tag)),
23
23
  nextCursor: response.nextCursor
24
24
  };
25
25
  }
@@ -27,13 +27,13 @@ var TagClient = class extends _chunk4M2HGY3Fcjs.BaseClient {
27
27
  return this.http.post("/tags", data);
28
28
  }
29
29
  async createResource(data) {
30
- return new (0, _chunk7H75UBMHcjs.TagResource)(this, await this.create(data));
30
+ return new (0, _chunkFB754K3Acjs.TagResource)(this, await this.create(data));
31
31
  }
32
32
  async update(id, data) {
33
33
  return this.http.put(`/tags/${id}`, data);
34
34
  }
35
35
  async updateResource(id, data) {
36
- return new (0, _chunk7H75UBMHcjs.TagResource)(this, await this.update(id, data));
36
+ return new (0, _chunkFB754K3Acjs.TagResource)(this, await this.update(id, data));
37
37
  }
38
38
  async delete(id) {
39
39
  return this.http.delete(`/tags/${id}`);
@@ -43,4 +43,4 @@ var TagClient = class extends _chunk4M2HGY3Fcjs.BaseClient {
43
43
 
44
44
 
45
45
  exports.TagClient = TagClient;
46
- //# sourceMappingURL=chunk-KRPRS2E5.cjs.map
46
+ //# sourceMappingURL=chunk-DYUXQTFU.cjs.map
@@ -18,6 +18,12 @@ var TagResource = class extends _chunkFIKGC2ELcjs.BaseResource {
18
18
  async update(data) {
19
19
  return this.replaceSnapshot(await this.tags.update(this.id, data));
20
20
  }
21
+ async patch(data) {
22
+ return this.update({
23
+ name: this.data.name,
24
+ ...data
25
+ });
26
+ }
21
27
  async delete() {
22
28
  return this.tags.delete(this.id);
23
29
  }
@@ -26,4 +32,4 @@ var TagResource = class extends _chunkFIKGC2ELcjs.BaseResource {
26
32
 
27
33
 
28
34
  exports.TagResource = TagResource;
29
- //# sourceMappingURL=chunk-7H75UBMH.cjs.map
35
+ //# sourceMappingURL=chunk-FB754K3A.cjs.map
@@ -18,6 +18,12 @@ var TagResource = class extends BaseResource {
18
18
  async update(data) {
19
19
  return this.replaceSnapshot(await this.tags.update(this.id, data));
20
20
  }
21
+ async patch(data) {
22
+ return this.update({
23
+ name: this.data.name,
24
+ ...data
25
+ });
26
+ }
21
27
  async delete() {
22
28
  return this.tags.delete(this.id);
23
29
  }
@@ -26,4 +32,4 @@ var TagResource = class extends BaseResource {
26
32
  export {
27
33
  TagResource
28
34
  };
29
- //# sourceMappingURL=chunk-4VK7K4IF.js.map
35
+ //# sourceMappingURL=chunk-FOZHT2ZK.js.map
@@ -21,6 +21,12 @@ var DataTableResource = class extends BaseResource {
21
21
  async update(data) {
22
22
  return this.replaceSnapshot(await this.dataTables.update(this.id, data));
23
23
  }
24
+ async patch(data) {
25
+ return this.update({
26
+ name: this.data.name,
27
+ ...data
28
+ });
29
+ }
24
30
  async delete() {
25
31
  await this.dataTables.delete(this.id);
26
32
  }
@@ -64,4 +70,4 @@ var DataTableResource = class extends BaseResource {
64
70
  export {
65
71
  DataTableResource
66
72
  };
67
- //# sourceMappingURL=chunk-T62VHXNY.js.map
73
+ //# sourceMappingURL=chunk-FSN23TT6.js.map
@@ -21,6 +21,12 @@ var DataTableResource = class extends _chunkFIKGC2ELcjs.BaseResource {
21
21
  async update(data) {
22
22
  return this.replaceSnapshot(await this.dataTables.update(this.id, data));
23
23
  }
24
+ async patch(data) {
25
+ return this.update({
26
+ name: this.data.name,
27
+ ...data
28
+ });
29
+ }
24
30
  async delete() {
25
31
  await this.dataTables.delete(this.id);
26
32
  }
@@ -64,4 +70,4 @@ var DataTableResource = class extends _chunkFIKGC2ELcjs.BaseResource {
64
70
 
65
71
 
66
72
  exports.DataTableResource = DataTableResource;
67
- //# sourceMappingURL=chunk-NBLW25ME.cjs.map
73
+ //# sourceMappingURL=chunk-GUTI2M4U.cjs.map
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3YWWR6UDcjs = require('./chunk-3YWWR6UD.cjs');
3
+ var _chunkTUWIRWCRcjs = require('./chunk-TUWIRWCR.cjs');
4
4
 
5
5
 
6
6
  var _chunkYBMEMKCNcjs = require('./chunk-YBMEMKCN.cjs');
@@ -17,12 +17,12 @@ var WorkflowClient = class extends _chunk4M2HGY3Fcjs.BaseClient {
17
17
  return this.http.get(`/workflows/${id}`, params);
18
18
  }
19
19
  async getResource(id, params) {
20
- return new (0, _chunk3YWWR6UDcjs.WorkflowResource)(this, new (0, _chunkYBMEMKCNcjs.ExecutionClient)(this.http), await this.get(id, params));
20
+ return new (0, _chunkTUWIRWCRcjs.WorkflowResource)(this, new (0, _chunkYBMEMKCNcjs.ExecutionClient)(this.http), await this.get(id, params));
21
21
  }
22
22
  async listResources(params) {
23
23
  const response = await this.list(params);
24
24
  return {
25
- data: response.data.map((workflow) => new (0, _chunk3YWWR6UDcjs.WorkflowResource)(this, new (0, _chunkYBMEMKCNcjs.ExecutionClient)(this.http), workflow)),
25
+ data: response.data.map((workflow) => new (0, _chunkTUWIRWCRcjs.WorkflowResource)(this, new (0, _chunkYBMEMKCNcjs.ExecutionClient)(this.http), workflow)),
26
26
  nextCursor: response.nextCursor
27
27
  };
28
28
  }
@@ -30,13 +30,13 @@ var WorkflowClient = class extends _chunk4M2HGY3Fcjs.BaseClient {
30
30
  return this.http.post("/workflows", data);
31
31
  }
32
32
  async createResource(data) {
33
- return new (0, _chunk3YWWR6UDcjs.WorkflowResource)(this, new (0, _chunkYBMEMKCNcjs.ExecutionClient)(this.http), await this.create(data));
33
+ return new (0, _chunkTUWIRWCRcjs.WorkflowResource)(this, new (0, _chunkYBMEMKCNcjs.ExecutionClient)(this.http), await this.create(data));
34
34
  }
35
35
  async update(id, data) {
36
36
  return this.http.put(`/workflows/${id}`, data);
37
37
  }
38
38
  async updateResource(id, data) {
39
- return new (0, _chunk3YWWR6UDcjs.WorkflowResource)(this, new (0, _chunkYBMEMKCNcjs.ExecutionClient)(this.http), await this.update(id, data));
39
+ return new (0, _chunkTUWIRWCRcjs.WorkflowResource)(this, new (0, _chunkYBMEMKCNcjs.ExecutionClient)(this.http), await this.update(id, data));
40
40
  }
41
41
  async delete(id) {
42
42
  return this.http.delete(`/workflows/${id}`);
@@ -70,4 +70,4 @@ var WorkflowClient = class extends _chunk4M2HGY3Fcjs.BaseClient {
70
70
 
71
71
 
72
72
  exports.WorkflowClient = WorkflowClient;
73
- //# sourceMappingURL=chunk-GZ3POWDP.cjs.map
73
+ //# sourceMappingURL=chunk-I2VZ7J4P.cjs.map
@@ -21,6 +21,16 @@ var CredentialResource = class extends _chunkFIKGC2ELcjs.BaseResource {
21
21
  async update(data) {
22
22
  return this.replaceSnapshot(await this.credentials.update(this.id, data));
23
23
  }
24
+ async patch(data) {
25
+ return this.update({
26
+ name: this.data.name,
27
+ type: this.data.type,
28
+ ..."data" in this.data && this.data.data ? { data: this.data.data } : {},
29
+ ..."isGlobal" in this.data ? { isGlobal: this.data.isGlobal } : {},
30
+ ...this.data.isResolvable !== void 0 ? { isResolvable: this.data.isResolvable } : {},
31
+ ...data
32
+ });
33
+ }
24
34
  async delete() {
25
35
  return this.credentials.delete(this.id);
26
36
  }
@@ -38,4 +48,4 @@ var CredentialResource = class extends _chunkFIKGC2ELcjs.BaseResource {
38
48
 
39
49
 
40
50
  exports.CredentialResource = CredentialResource;
41
- //# sourceMappingURL=chunk-MMN2UKTI.cjs.map
51
+ //# sourceMappingURL=chunk-JFTS6N3U.cjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  WorkflowResource
3
- } from "./chunk-I4MMTW33.js";
3
+ } from "./chunk-KMFHNXIH.js";
4
4
  import {
5
5
  ExecutionClient
6
6
  } from "./chunk-C6W6ERQD.js";
@@ -70,4 +70,4 @@ var WorkflowClient = class extends BaseClient {
70
70
  export {
71
71
  WorkflowClient
72
72
  };
73
- //# sourceMappingURL=chunk-54N6YD4R.js.map
73
+ //# sourceMappingURL=chunk-KBFYNP56.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommunityPackageResource
3
- } from "./chunk-YHSDCE3I.js";
3
+ } from "./chunk-WQJUADC6.js";
4
4
  import {
5
5
  HttpError
6
6
  } from "./chunk-RMEH2UPX.js";
@@ -45,4 +45,4 @@ var CommunityPackageClient = class extends BaseClient {
45
45
  export {
46
46
  CommunityPackageClient
47
47
  };
48
- //# sourceMappingURL=chunk-ETVDSJLY.js.map
48
+ //# sourceMappingURL=chunk-KKFA5PJR.js.map
@@ -32,6 +32,18 @@ var WorkflowResource = class extends BaseResource {
32
32
  async update(data) {
33
33
  return this.replaceSnapshot(await this.workflows.update(this.id, data));
34
34
  }
35
+ async patch(data) {
36
+ return this.update({
37
+ name: this.data.name,
38
+ description: this.data.description,
39
+ nodes: this.data.nodes,
40
+ connections: this.data.connections,
41
+ settings: this.data.settings ?? {},
42
+ staticData: this.data.staticData,
43
+ pinData: this.data.pinData,
44
+ ...data
45
+ });
46
+ }
35
47
  async delete() {
36
48
  return this.workflows.delete(this.id);
37
49
  }
@@ -95,4 +107,4 @@ var WorkflowResource = class extends BaseResource {
95
107
  export {
96
108
  WorkflowResource
97
109
  };
98
- //# sourceMappingURL=chunk-I4MMTW33.js.map
110
+ //# sourceMappingURL=chunk-KMFHNXIH.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkNBLW25MEcjs = require('./chunk-NBLW25ME.cjs');
3
+ var _chunkGUTI2M4Ucjs = require('./chunk-GUTI2M4U.cjs');
4
4
 
5
5
 
6
6
  var _chunkLC3TKRMXcjs = require('./chunk-LC3TKRMX.cjs');
@@ -36,6 +36,12 @@ var ProjectResource = class extends _chunkFIKGC2ELcjs.BaseResource {
36
36
  await this.projects.update(this.id, data);
37
37
  return this.mergeSnapshot(data);
38
38
  }
39
+ async patch(data) {
40
+ return this.update({
41
+ name: this.data.name,
42
+ ...data
43
+ });
44
+ }
39
45
  async delete() {
40
46
  await this.projects.delete(this.id);
41
47
  }
@@ -87,6 +93,7 @@ var ProjectResource = class extends _chunkFIKGC2ELcjs.BaseResource {
87
93
  }
88
94
  return this.relations.workflows.update(id, data);
89
95
  },
96
+ patch: async (id, data) => (await this.workflows().patchResource(id, data)).data,
90
97
  updateResource: async (id, data) => {
91
98
  if (!await this.hasResourceInProject({
92
99
  listPage: (cursor) => this.relations.workflows.list({ projectId: this.id, cursor }),
@@ -95,6 +102,10 @@ var ProjectResource = class extends _chunkFIKGC2ELcjs.BaseResource {
95
102
  throw new (0, _chunkLC3TKRMXcjs.HttpError)(404, `Workflow not found in project: ${id}`, { id, projectId: this.id });
96
103
  }
97
104
  return this.relations.workflows.updateResource(id, data);
105
+ },
106
+ patchResource: async (id, data) => {
107
+ const workflow = await this.workflows().getResource(id);
108
+ return workflow.patch(data);
98
109
  }
99
110
  };
100
111
  }
@@ -107,7 +118,12 @@ var ProjectResource = class extends _chunkFIKGC2ELcjs.BaseResource {
107
118
  create: (data) => this.relations.folders.create(data),
108
119
  get: (id) => this.relations.folders.get(id),
109
120
  update: (id, data) => this.relations.folders.update(id, data),
121
+ patch: async (id, data) => (await this.folders().patchResource(id, data)).data,
110
122
  updateResource: (id, data) => this.relations.folders.updateResource(id, data),
123
+ patchResource: async (id, data) => {
124
+ const folder = await this.relations.folders.getResource(id);
125
+ return folder.patch(data);
126
+ },
111
127
  delete: (id, transferToFolderId) => this.relations.folders.delete(id, transferToFolderId)
112
128
  };
113
129
  }
@@ -119,27 +135,39 @@ var ProjectResource = class extends _chunkFIKGC2ELcjs.BaseResource {
119
135
  getResource: (id) => this.relations.variables.getResource(id, { projectId: this.id }),
120
136
  create: (data) => this.relations.variables.create({ ...data, projectId: this.id }),
121
137
  update: (id, data) => this.relations.variables.update(id, { ...data, projectId: this.id }),
138
+ patch: async (id, data) => {
139
+ await (await this.variables().getResource(id)).patch(data);
140
+ },
122
141
  updateResource: async (id, data) => {
123
142
  await this.relations.variables.update(id, { ...data, projectId: this.id });
124
143
  return this.relations.variables.getResource(id, { projectId: this.id });
125
144
  },
145
+ patchResource: async (id, data) => {
146
+ const variable = await this.relations.variables.getResource(id, { projectId: this.id });
147
+ return variable.patch(data);
148
+ },
126
149
  delete: (id) => this.relations.variables.delete(id)
127
150
  };
128
151
  }
129
152
  dataTables() {
130
153
  return {
131
154
  get: (id) => this.getProjectDataTableOrThrow(id),
132
- getResource: async (id) => new (0, _chunkNBLW25MEcjs.DataTableResource)(this.relations.dataTables, await this.getProjectDataTableOrThrow(id)),
155
+ getResource: async (id) => new (0, _chunkGUTI2M4Ucjs.DataTableResource)(this.relations.dataTables, await this.getProjectDataTableOrThrow(id)),
133
156
  create: (data) => this.relations.dataTables.create({ ...data, projectId: this.id }),
134
157
  createResource: (data) => this.relations.dataTables.createResource({ ...data, projectId: this.id }),
135
158
  update: async (id, data) => {
136
159
  await this.getProjectDataTableOrThrow(id);
137
160
  return this.relations.dataTables.update(id, data);
138
161
  },
162
+ patch: async (id, data) => (await this.dataTables().patchResource(id, data)).data,
139
163
  updateResource: async (id, data) => {
140
164
  await this.getProjectDataTableOrThrow(id);
141
165
  return this.relations.dataTables.updateResource(id, data);
142
166
  },
167
+ patchResource: async (id, data) => {
168
+ const dataTable = await this.dataTables().getResource(id);
169
+ return dataTable.patch(data);
170
+ },
143
171
  delete: async (id) => {
144
172
  await this.getProjectDataTableOrThrow(id);
145
173
  await this.relations.dataTables.delete(id);
@@ -193,4 +221,4 @@ var ProjectResource = class extends _chunkFIKGC2ELcjs.BaseResource {
193
221
 
194
222
 
195
223
  exports.ProjectResource = ProjectResource;
196
- //# sourceMappingURL=chunk-W5P34RYO.cjs.map
224
+ //# sourceMappingURL=chunk-O7AV3KS4.cjs.map
@@ -27,6 +27,15 @@ var VariableResource = class extends BaseResource {
27
27
  await this.variables.update(this.id, data);
28
28
  return this.mergeSnapshot(data);
29
29
  }
30
+ async patch(data) {
31
+ await this.variables.update(this.id, {
32
+ key: this.data.key,
33
+ value: this.data.value,
34
+ ...this.data.project ? { projectId: this.data.project.id } : {},
35
+ ...data
36
+ });
37
+ return this.mergeSnapshot(data);
38
+ }
30
39
  async delete() {
31
40
  await this.variables.delete(this.id);
32
41
  }
@@ -35,4 +44,4 @@ var VariableResource = class extends BaseResource {
35
44
  export {
36
45
  VariableResource
37
46
  };
38
- //# sourceMappingURL=chunk-2R6A6NJE.js.map
47
+ //# sourceMappingURL=chunk-PEUZAXIY.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkYSWBOCXJcjs = require('./chunk-YSWBOCXJ.cjs');
3
+ var _chunkD4GV65GTcjs = require('./chunk-D4GV65GT.cjs');
4
4
 
5
5
 
6
6
  var _chunkLC3TKRMXcjs = require('./chunk-LC3TKRMX.cjs');
@@ -21,12 +21,12 @@ var VariableClient = class extends _chunk4M2HGY3Fcjs.BaseClient {
21
21
  return variable;
22
22
  }
23
23
  async getResource(id, params) {
24
- return new (0, _chunkYSWBOCXJcjs.VariableResource)(this, await this.get(id, params), params);
24
+ return new (0, _chunkD4GV65GTcjs.VariableResource)(this, await this.get(id, params), params);
25
25
  }
26
26
  async listResources(params) {
27
27
  const response = await this.list(params);
28
28
  return {
29
- data: response.data.map((variable) => new (0, _chunkYSWBOCXJcjs.VariableResource)(this, variable, params)),
29
+ data: response.data.map((variable) => new (0, _chunkD4GV65GTcjs.VariableResource)(this, variable, params)),
30
30
  nextCursor: response.nextCursor
31
31
  };
32
32
  }
@@ -56,4 +56,4 @@ var VariableClient = class extends _chunk4M2HGY3Fcjs.BaseClient {
56
56
 
57
57
 
58
58
  exports.VariableClient = VariableClient;
59
- //# sourceMappingURL=chunk-DTDNBA7W.cjs.map
59
+ //# sourceMappingURL=chunk-TFMO4KWG.cjs.map
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
  var _chunkLC3TKRMXcjs = require('./chunk-LC3TKRMX.cjs');
4
4
 
@@ -32,6 +32,18 @@ var WorkflowResource = class extends _chunkFIKGC2ELcjs.BaseResource {
32
32
  async update(data) {
33
33
  return this.replaceSnapshot(await this.workflows.update(this.id, data));
34
34
  }
35
+ async patch(data) {
36
+ return this.update({
37
+ name: this.data.name,
38
+ description: this.data.description,
39
+ nodes: this.data.nodes,
40
+ connections: this.data.connections,
41
+ settings: _nullishCoalesce(this.data.settings, () => ( {})),
42
+ staticData: this.data.staticData,
43
+ pinData: this.data.pinData,
44
+ ...data
45
+ });
46
+ }
35
47
  async delete() {
36
48
  return this.workflows.delete(this.id);
37
49
  }
@@ -95,4 +107,4 @@ var WorkflowResource = class extends _chunkFIKGC2ELcjs.BaseResource {
95
107
 
96
108
 
97
109
  exports.WorkflowResource = WorkflowResource;
98
- //# sourceMappingURL=chunk-3YWWR6UD.cjs.map
110
+ //# sourceMappingURL=chunk-TUWIRWCR.cjs.map