From 173a495babb27497f34e53d3efdf1e6edced44b3 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 20 Oct 2025 18:42:48 -0300 Subject: [PATCH 1/6] Implement CRUD operations for documents in Dart, including create, update, and delete functionalities. Add new properties for document management and update package version to 0.2.0. Enhance existing actions for task management with version updates. --- .../dart/actions/create-doc/create-doc.mjs | 50 +++++++++++++++ .../dart/actions/create-task/create-task.mjs | 2 +- .../dart/actions/delete-doc/delete-doc.mjs | 32 ++++++++++ .../find-or-create-task.mjs | 2 +- .../dart/actions/update-doc/update-doc.mjs | 58 +++++++++++++++++ .../dart/actions/update-task/update-task.mjs | 2 +- components/dart/dart.app.mjs | 63 ++++++++++++++++++- components/dart/package.json | 4 +- .../new-doc-created/new-doc-created.mjs | 2 +- .../new-doc-updated/new-doc-updated.mjs | 2 +- .../new-task-created/new-task-created.mjs | 2 +- 11 files changed, 209 insertions(+), 10 deletions(-) create mode 100644 components/dart/actions/create-doc/create-doc.mjs create mode 100644 components/dart/actions/delete-doc/delete-doc.mjs create mode 100644 components/dart/actions/update-doc/update-doc.mjs diff --git a/components/dart/actions/create-doc/create-doc.mjs b/components/dart/actions/create-doc/create-doc.mjs new file mode 100644 index 0000000000000..1d76af456e1d2 --- /dev/null +++ b/components/dart/actions/create-doc/create-doc.mjs @@ -0,0 +1,50 @@ +import dart from "../../dart.app.mjs"; + +export default { + key: "dart-create-doc", + name: "Create Doc", + description: "Record a new doc that the user intends to write down. This will save the doc in Dart for later access, search, etc. By default the created doc will be in the Docs folder. More information can be included in the text. [See the documentation](https://app.dartai.com/api/v0/public/docs/#/Doc/createDoc)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + dart, + title: { + propDefinition: [ + dart, + "title", + ], + }, + folder: { + propDefinition: [ + dart, + "folder", + ], + }, + text: { + propDefinition: [ + dart, + "text", + ], + }, + }, + async run({ $ }) { + const response = await this.dart.createDoc({ + $, + data: { + item: { + title: this.title, + folder: this.folder, + text: this.text, + }, + }, + }); + + $.export("$summary", `New doc successfully created with ID: ${response.item.id}`); + return response; + }, +}; diff --git a/components/dart/actions/create-task/create-task.mjs b/components/dart/actions/create-task/create-task.mjs index 7a80232be6ea1..b1bece01a79c4 100644 --- a/components/dart/actions/create-task/create-task.mjs +++ b/components/dart/actions/create-task/create-task.mjs @@ -4,7 +4,7 @@ export default { key: "dart-create-task", name: "Create Task", description: "Creates a new task within a dartboard. [See the documentation](https://app.itsdart.com/api/v0/docs/)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/dart/actions/delete-doc/delete-doc.mjs b/components/dart/actions/delete-doc/delete-doc.mjs new file mode 100644 index 0000000000000..0731ad8bc0b7c --- /dev/null +++ b/components/dart/actions/delete-doc/delete-doc.mjs @@ -0,0 +1,32 @@ +import dart from "../../dart.app.mjs"; + +export default { + key: "dart-delete-doc", + name: "Delete Doc", + description: "Move an existing doc to the trash, where it can be recovered if needed. Nothing else about the doc will be changed. [See the documentation](https://app.dartai.com/api/v0/public/docs/#/Doc/deleteDoc)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + dart, + docId: { + propDefinition: [ + dart, + "docId", + ], + }, + }, + async run({ $ }) { + const response = await this.dart.deleteDoc({ + $, + docId: this.docId, + }); + + $.export("$summary", `Successfully deleted doc with ID: ${this.docId}`); + return response; + }, +}; diff --git a/components/dart/actions/find-or-create-task/find-or-create-task.mjs b/components/dart/actions/find-or-create-task/find-or-create-task.mjs index d0fd9591561b1..e45c766f2cf53 100644 --- a/components/dart/actions/find-or-create-task/find-or-create-task.mjs +++ b/components/dart/actions/find-or-create-task/find-or-create-task.mjs @@ -4,7 +4,7 @@ export default { key: "dart-find-or-create-task", name: "Find or Create Task", description: "Checks for an existing task within a dartboard using the 'task-name'. If it doesn't exist, a new task is created. [See the documentation](https://app.itsdart.com/api/v0/docs/)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/dart/actions/update-doc/update-doc.mjs b/components/dart/actions/update-doc/update-doc.mjs new file mode 100644 index 0000000000000..bd0cdb9a808ab --- /dev/null +++ b/components/dart/actions/update-doc/update-doc.mjs @@ -0,0 +1,58 @@ +import dart from "../../dart.app.mjs"; + +export default { + key: "dart-update-doc", + name: "Update Doc", + description: "Update certain properties of an existing doc. This will save the doc in Dart for later access, search, etc. Any properties that are not specified will not be changed. [See the documentation](https://app.dartai.com/api/v0/public/docs/#/Doc/updateDoc)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + dart, + docId: { + propDefinition: [ + dart, + "docId", + ], + }, + title: { + propDefinition: [ + dart, + "title", + ], + optional: true, + }, + folder: { + propDefinition: [ + dart, + "folder", + ], + }, + text: { + propDefinition: [ + dart, + "text", + ], + }, + }, + async run({ $ }) { + const response = await this.dart.updateDoc({ + $, + data: { + item: { + id: this.docId, + title: this.title, + folder: this.folder, + text: this.text, + }, + }, + }); + + $.export("$summary", `Successfully updated doc with ID: ${this.docId}`); + return response; + }, +}; diff --git a/components/dart/actions/update-task/update-task.mjs b/components/dart/actions/update-task/update-task.mjs index 166ca6cad5f98..ff5c1de2a7967 100644 --- a/components/dart/actions/update-task/update-task.mjs +++ b/components/dart/actions/update-task/update-task.mjs @@ -4,7 +4,7 @@ export default { key: "dart-update-task", name: "Update Task", description: "Updates an existing task within a dartboard. [See the documentation](https://app.itsdart.com/api/v0/docs/)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/dart/dart.app.mjs b/components/dart/dart.app.mjs index 29a16be4fcddc..c718dcf187ba8 100644 --- a/components/dart/dart.app.mjs +++ b/components/dart/dart.app.mjs @@ -63,6 +63,25 @@ export default { })) || []; }, }, + docId: { + type: "string", + label: "Doc ID", + description: "The ID of the doc", + async options({ page }) { + const { results } = await this.listDocs({ + params: { + limit: constants.DEFAULT_LIMIT, + offset: page * constants.DEFAULT_LIMIT, + }, + }); + return results?.map(({ + id: value, title: label, + }) => ({ + value, + label, + })) || []; + }, + }, taskName: { type: "string", label: "Task Name", @@ -87,10 +106,27 @@ export default { optional: true, options: constants.TASK_PRIORITIES, }, + title: { + type: "string", + label: "Title", + description: "The title, which is a short description of the doc", + }, + folder: { + type: "string", + label: "Folder", + description: "The full title of the folder, which is a project or list of docs", + optional: true, + }, + text: { + type: "string", + label: "Text", + description: "The full content of the doc, which can include markdown formatting", + optional: true, + }, }, methods: { _baseUrl() { - return "https://app.itsdart.com/api/v0"; + return "https://app.dartai.com/api/v0/public"; }, _makeRequest(opts = {}) { const { @@ -108,7 +144,7 @@ export default { }, listDocs(opts = {}) { return this._makeRequest({ - path: "/docs", + path: "/docs/list", ...opts, }); }, @@ -137,6 +173,29 @@ export default { ...opts, }); }, + createDoc(opts = {}) { + return this._makeRequest({ + method: "POST", + path: "/docs", + ...opts, + }); + }, + updateDoc(opts = {}) { + return this._makeRequest({ + method: "PUT", + path: `/docs/${opts.data.item.id}`, + ...opts, + }); + }, + deleteDoc({ + docId, ...opts + }) { + return this._makeRequest({ + method: "DELETE", + path: `/docs/${docId}`, + ...opts, + }); + }, async *paginate({ resourceFn, params, max, }) { diff --git a/components/dart/package.json b/components/dart/package.json index b02d530bfb443..70909549cef60 100644 --- a/components/dart/package.json +++ b/components/dart/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/dart", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Dart Components", "main": "dart.app.mjs", "keywords": [ @@ -13,6 +13,6 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^3.0.0" + "@pipedream/platform": "^3.1.0" } } diff --git a/components/dart/sources/new-doc-created/new-doc-created.mjs b/components/dart/sources/new-doc-created/new-doc-created.mjs index bcacba8bf790d..1dc7fbe3b728c 100644 --- a/components/dart/sources/new-doc-created/new-doc-created.mjs +++ b/components/dart/sources/new-doc-created/new-doc-created.mjs @@ -6,7 +6,7 @@ export default { key: "dart-new-doc-created", name: "New Document Created", description: "Emit new event when a new document is created in Dart.", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: { diff --git a/components/dart/sources/new-doc-updated/new-doc-updated.mjs b/components/dart/sources/new-doc-updated/new-doc-updated.mjs index 2dc323e68d576..d1d66c1ee33a0 100644 --- a/components/dart/sources/new-doc-updated/new-doc-updated.mjs +++ b/components/dart/sources/new-doc-updated/new-doc-updated.mjs @@ -7,7 +7,7 @@ export default { key: "dart-new-doc-updated", name: "New Document Updated", description: "Emit new event when any document is updated.", - version: "0.0.1", + version: "0.0.2", dedupe: "unique", methods: { ...common.methods, diff --git a/components/dart/sources/new-task-created/new-task-created.mjs b/components/dart/sources/new-task-created/new-task-created.mjs index 16341d15be391..5a0e90dc15187 100644 --- a/components/dart/sources/new-task-created/new-task-created.mjs +++ b/components/dart/sources/new-task-created/new-task-created.mjs @@ -6,7 +6,7 @@ export default { key: "dart-new-task-created", name: "New Task Created", description: "Emit new event when a task is created.", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: { From 31bcfa6f236711687e959de131635141acb8b428 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 20 Oct 2025 19:02:55 -0300 Subject: [PATCH 2/6] pnpm update --- pnpm-lock.yaml | 200 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 162 insertions(+), 38 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f75421a991890..1829277c5a281 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -104,7 +104,7 @@ importers: version: 4.0.0 ts-jest: specifier: ^29.1.1 - version: 29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.6)(typescript@5.6.3)))(typescript@5.6.3) + version: 29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.6)(typescript@5.6.3)))(typescript@5.6.3) tsc-esm-fix: specifier: ^2.18.0 version: 2.20.27 @@ -629,8 +629,7 @@ importers: specifier: ^3.1.0 version: 3.1.0 - components/airweave: - specifiers: {} + components/airweave: {} components/aitable_ai: dependencies: @@ -2679,8 +2678,7 @@ importers: specifier: ^3.0.1 version: 3.0.1(web-streams-polyfill@3.3.3) - components/clarifai: - specifiers: {} + components/clarifai: {} components/clarify: {} @@ -2998,8 +2996,7 @@ importers: components/codeberg: {} - components/codefresh: - specifiers: {} + components/codefresh: {} components/codegpt: {} @@ -3112,8 +3109,7 @@ importers: specifier: ^0.0.6 version: 0.0.6 - components/cometapi: - specifiers: {} + components/cometapi: {} components/cometly: dependencies: @@ -3299,8 +3295,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/copicake: - specifiers: {} + components/copicake: {} components/copper: dependencies: @@ -3388,8 +3383,7 @@ importers: specifier: ^1.6.0 version: 1.6.6 - components/cronly: - specifiers: {} + components/cronly: {} components/crove_app: dependencies: @@ -3575,8 +3569,8 @@ importers: components/dart: dependencies: '@pipedream/platform': - specifier: ^3.0.0 - version: 3.0.3 + specifier: ^3.1.0 + version: 3.1.0 components/darwinbox: {} @@ -6594,8 +6588,7 @@ importers: specifier: ^3.0.3 version: 3.0.3 - components/hex: - specifiers: {} + components/hex: {} components/heygen: dependencies: @@ -10918,8 +10911,7 @@ importers: specifier: ^1.3.0 version: 1.6.6 - components/piwik_pro: - specifiers: {} + components/piwik_pro: {} components/pixelbin: dependencies: @@ -14775,8 +14767,7 @@ importers: specifier: ^0.1.4 version: 0.1.6 - components/topdesk: - specifiers: {} + components/topdesk: {} components/topmessage: dependencies: @@ -31377,22 +31368,22 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@4.1.0: resolution: {integrity: sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==} engines: {node: '>= 6.0'} - deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@5.3.1: resolution: {integrity: sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==} engines: {node: '>= 7.0.0'} - deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net superagent@7.1.6: resolution: {integrity: sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==} engines: {node: '>=6.4.0 <13 || >=14'} - deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net + deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net supports-color@10.0.0: resolution: {integrity: sha512-HRVVSbCCMbj7/kdWF9Q+bbckjBHLtHMEoJWlkmYzzdwhYMkjkOwubLM6t7NbWKjgKamGDrWL1++KrjUO1t9oAQ==} @@ -35794,7 +35785,7 @@ snapshots: '@babel/traverse': 7.25.9 '@babel/types': 7.26.0 convert-source-map: 2.0.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -36065,21 +36056,45 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-import-assertions@7.26.0(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -36090,16 +36105,34 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-import-attributes@7.26.0(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-jsx@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -36110,41 +36143,89 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 '@babel/helper-plugin-utils': 7.25.9 + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@8.0.0-alpha.13)': + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/helper-plugin-utils': 7.25.9 + optional: true + '@babel/plugin-syntax-typescript@7.25.9(@babel/core@7.26.0)': dependencies: '@babel/core': 7.26.0 @@ -37207,7 +37288,7 @@ snapshots: '@eslint/eslintrc@3.2.0': dependencies: ajv: 6.12.6 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 @@ -39713,6 +39794,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: @@ -42273,7 +42356,7 @@ snapshots: '@typescript-eslint/types': 8.15.0 '@typescript-eslint/typescript-estree': 8.15.0(typescript@5.6.3) '@typescript-eslint/visitor-keys': 8.15.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) eslint: 8.57.1 optionalDependencies: typescript: 5.6.3 @@ -43167,6 +43250,20 @@ snapshots: transitivePeerDependencies: - supports-color + babel-jest@29.7.0(@babel/core@8.0.0-alpha.13): + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@jest/transform': 29.7.0 + '@types/babel__core': 7.20.5 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 29.6.3(@babel/core@8.0.0-alpha.13) + chalk: 4.1.2 + graceful-fs: 4.2.11 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + optional: true + babel-plugin-istanbul@6.1.1: dependencies: '@babel/helper-plugin-utils': 7.25.9 @@ -43233,12 +43330,39 @@ snapshots: '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.26.0) '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.26.0) + babel-preset-current-node-syntax@1.1.0(@babel/core@8.0.0-alpha.13): + dependencies: + '@babel/core': 8.0.0-alpha.13 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-import-attributes': 7.26.0(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@8.0.0-alpha.13) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@8.0.0-alpha.13) + optional: true + babel-preset-jest@29.6.3(@babel/core@7.26.0): dependencies: '@babel/core': 7.26.0 babel-plugin-jest-hoist: 29.6.3 babel-preset-current-node-syntax: 1.1.0(@babel/core@7.26.0) + babel-preset-jest@29.6.3(@babel/core@8.0.0-alpha.13): + dependencies: + '@babel/core': 8.0.0-alpha.13 + babel-plugin-jest-hoist: 29.6.3 + babel-preset-current-node-syntax: 1.1.0(@babel/core@8.0.0-alpha.13) + optional: true + backoff@2.5.0: dependencies: precond: 0.2.3 @@ -45447,7 +45571,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -47308,7 +47432,7 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) transitivePeerDependencies: - supports-color @@ -49889,7 +50013,7 @@ snapshots: dependencies: '@tediousjs/connection-string': 0.5.0 commander: 11.1.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) rfdc: 1.4.1 tarn: 3.0.2 tedious: 16.7.1 @@ -51638,7 +51762,7 @@ snapshots: ajv: 8.17.1 chalk: 5.3.0 ci-info: 4.1.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) deepmerge: 4.3.1 escalade: 3.2.0 fast-glob: 3.3.2 @@ -53794,7 +53918,7 @@ snapshots: babel-jest: 29.7.0(@babel/core@7.26.0) esbuild: 0.24.2 - ts-jest@29.2.5(@babel/core@7.26.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.0))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.6)(typescript@5.6.3)))(typescript@5.6.3): + ts-jest@29.2.5(@babel/core@8.0.0-alpha.13)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@8.0.0-alpha.13))(jest@29.7.0(@types/node@20.17.6)(babel-plugin-macros@3.1.0)(ts-node@10.9.2(@types/node@20.17.6)(typescript@5.6.3)))(typescript@5.6.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 @@ -53808,10 +53932,10 @@ snapshots: typescript: 5.6.3 yargs-parser: 21.1.1 optionalDependencies: - '@babel/core': 7.26.0 + '@babel/core': 8.0.0-alpha.13 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.26.0) + babel-jest: 29.7.0(@babel/core@8.0.0-alpha.13) ts-node@10.9.2(@types/node@20.17.30)(typescript@5.7.2): dependencies: @@ -53983,7 +54107,7 @@ snapshots: cac: 6.7.14 chokidar: 4.0.3 consola: 3.4.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) esbuild: 0.24.2 joycon: 3.1.1 picocolors: 1.1.1 @@ -54011,7 +54135,7 @@ snapshots: cac: 6.7.14 chokidar: 4.0.3 consola: 3.4.0 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) esbuild: 0.24.2 joycon: 3.1.1 picocolors: 1.1.1 @@ -54635,7 +54759,7 @@ snapshots: '@volar/typescript': 2.4.10 '@vue/language-core': 2.1.6(typescript@5.9.2) compare-versions: 6.1.1 - debug: 4.3.7(supports-color@5.5.0) + debug: 4.3.7(supports-color@9.4.0) kolorist: 1.8.0 local-pkg: 0.5.1 magic-string: 0.30.13 From 0308a3002cc0ecb8959d279e10492b430c153b42 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 22 Oct 2025 16:39:19 -0300 Subject: [PATCH 3/6] Update API paths in Dart component and increment version numbers for task actions and document sources --- components/dart/actions/create-task/create-task.mjs | 2 +- .../find-or-create-task/find-or-create-task.mjs | 2 +- components/dart/actions/update-task/update-task.mjs | 2 +- components/dart/dart.app.mjs | 12 ++++++------ .../dart/sources/new-doc-created/new-doc-created.mjs | 2 +- .../dart/sources/new-doc-updated/new-doc-updated.mjs | 2 +- .../sources/new-task-created/new-task-created.mjs | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/components/dart/actions/create-task/create-task.mjs b/components/dart/actions/create-task/create-task.mjs index b1bece01a79c4..4183eea3300bc 100644 --- a/components/dart/actions/create-task/create-task.mjs +++ b/components/dart/actions/create-task/create-task.mjs @@ -4,7 +4,7 @@ export default { key: "dart-create-task", name: "Create Task", description: "Creates a new task within a dartboard. [See the documentation](https://app.itsdart.com/api/v0/docs/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/dart/actions/find-or-create-task/find-or-create-task.mjs b/components/dart/actions/find-or-create-task/find-or-create-task.mjs index e45c766f2cf53..eb73a52ad33d7 100644 --- a/components/dart/actions/find-or-create-task/find-or-create-task.mjs +++ b/components/dart/actions/find-or-create-task/find-or-create-task.mjs @@ -4,7 +4,7 @@ export default { key: "dart-find-or-create-task", name: "Find or Create Task", description: "Checks for an existing task within a dartboard using the 'task-name'. If it doesn't exist, a new task is created. [See the documentation](https://app.itsdart.com/api/v0/docs/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/dart/actions/update-task/update-task.mjs b/components/dart/actions/update-task/update-task.mjs index ff5c1de2a7967..00eafd854f9b1 100644 --- a/components/dart/actions/update-task/update-task.mjs +++ b/components/dart/actions/update-task/update-task.mjs @@ -4,7 +4,7 @@ export default { key: "dart-update-task", name: "Update Task", description: "Updates an existing task within a dartboard. [See the documentation](https://app.itsdart.com/api/v0/docs/)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/dart/dart.app.mjs b/components/dart/dart.app.mjs index c718dcf187ba8..c1f5eee7fe8d9 100644 --- a/components/dart/dart.app.mjs +++ b/components/dart/dart.app.mjs @@ -126,7 +126,7 @@ export default { }, methods: { _baseUrl() { - return "https://app.dartai.com/api/v0/public"; + return "https://app.dartai.com/api/v0"; }, _makeRequest(opts = {}) { const { @@ -144,7 +144,7 @@ export default { }, listDocs(opts = {}) { return this._makeRequest({ - path: "/docs/list", + path: "/docs", ...opts, }); }, @@ -169,21 +169,21 @@ export default { createTransaction(opts = {}) { return this._makeRequest({ method: "POST", - path: "/transactions/create", + path: "/public/transactions/create", ...opts, }); }, createDoc(opts = {}) { return this._makeRequest({ method: "POST", - path: "/docs", + path: "/public/docs", ...opts, }); }, updateDoc(opts = {}) { return this._makeRequest({ method: "PUT", - path: `/docs/${opts.data.item.id}`, + path: `/public/docs/${opts.data.item.id}`, ...opts, }); }, @@ -192,7 +192,7 @@ export default { }) { return this._makeRequest({ method: "DELETE", - path: `/docs/${docId}`, + path: `/public/docs/${docId}`, ...opts, }); }, diff --git a/components/dart/sources/new-doc-created/new-doc-created.mjs b/components/dart/sources/new-doc-created/new-doc-created.mjs index 1dc7fbe3b728c..d8bd7575d0ba4 100644 --- a/components/dart/sources/new-doc-created/new-doc-created.mjs +++ b/components/dart/sources/new-doc-created/new-doc-created.mjs @@ -6,7 +6,7 @@ export default { key: "dart-new-doc-created", name: "New Document Created", description: "Emit new event when a new document is created in Dart.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", methods: { diff --git a/components/dart/sources/new-doc-updated/new-doc-updated.mjs b/components/dart/sources/new-doc-updated/new-doc-updated.mjs index d1d66c1ee33a0..c7c0a670c5068 100644 --- a/components/dart/sources/new-doc-updated/new-doc-updated.mjs +++ b/components/dart/sources/new-doc-updated/new-doc-updated.mjs @@ -7,7 +7,7 @@ export default { key: "dart-new-doc-updated", name: "New Document Updated", description: "Emit new event when any document is updated.", - version: "0.0.2", + version: "0.0.3", dedupe: "unique", methods: { ...common.methods, diff --git a/components/dart/sources/new-task-created/new-task-created.mjs b/components/dart/sources/new-task-created/new-task-created.mjs index 5a0e90dc15187..2ed8de6d4f89d 100644 --- a/components/dart/sources/new-task-created/new-task-created.mjs +++ b/components/dart/sources/new-task-created/new-task-created.mjs @@ -6,7 +6,7 @@ export default { key: "dart-new-task-created", name: "New Task Created", description: "Emit new event when a task is created.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", methods: { From e04aeed9725c96750c39f15171fd9024cd334135 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 27 Oct 2025 19:39:22 -0300 Subject: [PATCH 4/6] Refactor Dart component to enhance task management features - Renamed and updated prop definitions for better clarity, including changing `dartboardId` to `dartboard`. - Introduced new optional properties: `tags`, `priority`, `size`, `status`, `type`, and `customProperties` to support enhanced task attributes. - Updated task creation and update methods to reflect new property structure and improved API paths. - Added utility function `parseObject` for better handling of input data formats. - Incremented version numbers for task-related actions to reflect changes. --- .../dart/actions/create-task/create-task.mjs | 130 +++++++++++----- .../find-or-create-task.mjs | 140 ++++++++++++------ .../dart/actions/update-task/update-task.mjs | 128 ++++++++++++---- components/dart/common/constants.mjs | 10 +- components/dart/common/utils.mjs | 24 +++ components/dart/dart.app.mjs | 119 +++++++++++---- 6 files changed, 394 insertions(+), 157 deletions(-) create mode 100644 components/dart/common/utils.mjs diff --git a/components/dart/actions/create-task/create-task.mjs b/components/dart/actions/create-task/create-task.mjs index 4183eea3300bc..d914405c517f2 100644 --- a/components/dart/actions/create-task/create-task.mjs +++ b/components/dart/actions/create-task/create-task.mjs @@ -1,10 +1,11 @@ +import { parseObject } from "../../common/utils.mjs"; import dart from "../../dart.app.mjs"; export default { key: "dart-create-task", name: "Create Task", - description: "Creates a new task within a dartboard. [See the documentation](https://app.itsdart.com/api/v0/docs/)", - version: "0.0.4", + description: "Creates a new task within a dartboard. [See the documentation](https://app.dartai.com/api/v0/public/docs/#/Task/createTask)", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -13,77 +14,128 @@ export default { type: "action", props: { dart, - dartboardId: { + title: { propDefinition: [ dart, - "dartboardId", + "title", ], }, - duid: { - type: "string", - label: "Task DUID", - description: "A unique identifier for the task. Must contain at least 12 characters.", + parentId: { + propDefinition: [ + dart, + "taskId", + ], + label: "Parent Task ID", + description: "The universal, unique ID of the parent task. These tasks have a parent-child relationship where the current task is the child and this task ID corresponds to the parent. Subtasks inherit context from their parent and are typically smaller units of work", }, - title: { + dartboard: { propDefinition: [ dart, - "taskName", + "dartboard", ], + label: "Dartboard", + description: "The full title of the dartboard, which is a project or list of tasks", }, - description: { + type: { propDefinition: [ dart, - "taskDescription", + "type", ], }, - dueAt: { + status: { propDefinition: [ dart, - "dueAt", + "status", + ], + label: "Status", + description: "The status from the list of available statuses", + }, + description: { + type: "string", + label: "Description", + description: "A longer description of the task, which can include markdown formatting", + }, + assignees: { + propDefinition: [ + dart, + "assigneeIds", ], + label: "Assignees", + description: "The names or emails of the users that the task is assigned to. Either this or assignee must be included, depending on whether the workspaces allows multiple assignees or not", }, - assigneeIds: { + assignee: { propDefinition: [ dart, "assigneeIds", ], + type: "string", + label: "Assignee", + description: "The name or email of the user that the task is assigned to. Either this or assignees must be included, depending on whether the workspaces allows multiple assignees or not", + }, + tags: { + propDefinition: [ + dart, + "tags", + ], + label: "Tags", + description: "Any tags that should be applied to the task, which can be used to filter and search for tasks. Tags are also known as labels or components and are strings that can be anything, but should be short and descriptive", }, priority: { propDefinition: [ dart, "priority", ], + label: "Priority", + description: "The priority, which is a string that can be one of the specified options. This is used to sort tasks and determine which tasks should be done first", + }, + startAt: { + propDefinition: [ + dart, + "startAt", + ], + }, + dueAt: { + propDefinition: [ + dart, + "dueAt", + ], + }, + size: { + propDefinition: [ + dart, + "size", + ], + }, + customProperties: { + propDefinition: [ + dart, + "customProperties", + ], }, }, async run({ $ }) { - const response = await this.dart.createTransaction({ + const { item: response } = await this.dart.createTask({ $, data: { - clientDuid: this.duid, - items: [ - { - duid: this.duid, - operations: [ - { - model: "task", - kind: "create", - data: { - duid: this.duid, - dartboardDuid: this.dartboardId, - title: this.title, - description: this.description, - dueAt: this.dueAt, - assigneeDuids: this.assigneeIds, - priority: this.priority, - }, - }, - ], - kind: "task_create", - }, - ], + item: { + title: this.title, + parentId: this.parentId, + dartboard: this.dartboard, + type: this.type, + status: this.status, + description: this.description, + assignees: parseObject(this.assignees), + assignee: this.assignee, + tags: parseObject(this.tags), + priority: this.priority, + startAt: this.startAt, + dueAt: this.dueAt, + size: this.size, + customProperties: parseObject(this.customProperties), + }, }, }); - $.export("$summary", `Created task "${this.title}"`); + $.export("$summary", `Successfully created task wiht ID: ${response.id}`); return response; }, }; diff --git a/components/dart/actions/find-or-create-task/find-or-create-task.mjs b/components/dart/actions/find-or-create-task/find-or-create-task.mjs index eb73a52ad33d7..7711e1c588167 100644 --- a/components/dart/actions/find-or-create-task/find-or-create-task.mjs +++ b/components/dart/actions/find-or-create-task/find-or-create-task.mjs @@ -1,10 +1,11 @@ +import { parseObject } from "../../common/utils.mjs"; import dart from "../../dart.app.mjs"; export default { key: "dart-find-or-create-task", name: "Find or Create Task", - description: "Checks for an existing task within a dartboard using the 'task-name'. If it doesn't exist, a new task is created. [See the documentation](https://app.itsdart.com/api/v0/docs/)", - version: "0.0.4", + description: "Checks for an existing task within a dartboard using the 'task-name'. If it doesn't exist, a new task is created. [See the documentation](https://app.dartai.com/api/v0/public/docs/#/Task/createTask)", + version: "1.0.0", annotations: { destructiveHint: false, openWorldHint: true, @@ -13,46 +14,102 @@ export default { type: "action", props: { dart, - dartboardId: { + dartboard: { propDefinition: [ dart, - "dartboardId", + "dartboard", ], + optional: false, }, - taskName: { + title: { propDefinition: [ dart, "taskName", ], }, - duid: { - type: "string", - label: "Task DUID", - description: "If the task is not found, a unique identifier to assign to the newly created task. Must contain at least 12 characters.", + parentId: { + propDefinition: [ + dart, + "taskId", + ], + label: "Parent Task ID", + description: "The universal, unique ID of the parent task. These tasks have a parent-child relationship where the current task is the child and this task ID corresponds to the parent. Subtasks inherit context from their parent and are typically smaller units of work", }, - description: { + type: { propDefinition: [ dart, - "taskDescription", + "type", ], }, - dueAt: { + status: { propDefinition: [ dart, - "dueAt", + "status", ], + label: "Status", + description: "The status from the list of available statuses", }, - assigneeIds: { + description: { + type: "string", + label: "Description", + description: "A longer description of the task, which can include markdown formatting", + }, + assignees: { propDefinition: [ dart, "assigneeIds", ], + label: "Assignees", + description: "The names or emails of the users that the task is assigned to. Either this or assignee must be included, depending on whether the workspaces allows multiple assignees or not", + }, + assignee: { + propDefinition: [ + dart, + "assigneeIds", + ], + type: "string", + label: "Assignee", + description: "The name or email of the user that the task is assigned to. Either this or assignees must be included, depending on whether the workspaces allows multiple assignees or not", + }, + tags: { + propDefinition: [ + dart, + "tags", + ], + label: "Tags", + description: "Any tags that should be applied to the task, which can be used to filter and search for tasks. Tags are also known as labels or components and are strings that can be anything, but should be short and descriptive", }, priority: { propDefinition: [ dart, "priority", ], + label: "Priority", + description: "The priority, which is a string that can be one of the specified options. This is used to sort tasks and determine which tasks should be done first", + }, + startAt: { + propDefinition: [ + dart, + "startAt", + ], + }, + dueAt: { + propDefinition: [ + dart, + "dueAt", + ], + }, + size: { + propDefinition: [ + dart, + "size", + ], + }, + customProperties: { + propDefinition: [ + dart, + "customProperties", + ], }, }, async run({ $ }) { @@ -60,49 +117,38 @@ export default { $, params: { title: this.taskName, + dartboard: this.dartboard, }, }); - const matchingTasks = results.filter(({ dartboardDuid }) => dartboardDuid === this.dartboardId); - - if (matchingTasks?.length) { - $.export("$summary", `Successfully found task "${this.taskName}"`); - return matchingTasks; + if (results?.length) { + $.export("$summary", `Successfully found task with ID: ${results[0].id}`); + return results; } - const response = await this.dart.createTransaction({ + const { item: response } = await this.dart.createTask({ $, data: { - clientDuid: this.duid, - items: [ - { - duid: this.duid, - operations: [ - { - model: "task", - kind: "create", - data: { - duid: this.duid, - dartboardDuid: this.dartboardId, - title: this.taskName, - description: this.description, - dueAt: this.dueAt, - assigneeDuids: this.assigneeIds, - priority: this.priority, - }, - }, - ], - kind: "task_create", - }, - ], + item: { + title: this.title, + parentId: this.parentId, + dartboard: this.dartboard, + type: this.type, + status: this.status, + description: this.description, + assignees: parseObject(this.assignees), + assignee: this.assignee, + tags: parseObject(this.tags), + priority: this.priority, + startAt: this.startAt, + dueAt: this.dueAt, + size: this.size, + customProperties: parseObject(this.customProperties), + }, }, }); - if (!response.results[0].success) { - throw new Error(response.results[0].message); - } - - $.export("$summary", `Created task: "${this.taskName}"`); + $.export("$summary", `Successfully created task with ID: ${response.duid || response.id}`); return response; }, }; diff --git a/components/dart/actions/update-task/update-task.mjs b/components/dart/actions/update-task/update-task.mjs index 00eafd854f9b1..95ca4e88c0696 100644 --- a/components/dart/actions/update-task/update-task.mjs +++ b/components/dart/actions/update-task/update-task.mjs @@ -1,10 +1,11 @@ +import { parseObject } from "../../common/utils.mjs"; import dart from "../../dart.app.mjs"; export default { key: "dart-update-task", name: "Update Task", - description: "Updates an existing task within a dartboard. [See the documentation](https://app.itsdart.com/api/v0/docs/)", - version: "0.0.4", + description: "Updates an existing task within a dartboard. [See the documentation](https://app.dartai.com/api/v0/public/docs/#/Task/updateTask)", + version: "1.0.0", annotations: { destructiveHint: true, openWorldHint: true, @@ -22,64 +23,127 @@ export default { title: { propDefinition: [ dart, - "taskName", + "title", ], optional: true, }, - description: { + parentId: { propDefinition: [ dart, - "taskDescription", + "taskId", ], + label: "Parent Task ID", + description: "The universal, unique ID of the parent task. These tasks have a parent-child relationship where the current task is the child and this task ID corresponds to the parent. Subtasks inherit context from their parent and are typically smaller units of work", }, - dueAt: { + dartboard: { propDefinition: [ dart, - "dueAt", + "dartboard", ], + label: "Dartboard", + description: "The full title of the dartboard, which is a project or list of tasks", }, - assigneeIds: { + type: { + propDefinition: [ + dart, + "type", + ], + }, + status: { + propDefinition: [ + dart, + "status", + ], + label: "Status", + description: "The status from the list of available statuses", + }, + description: { + type: "string", + label: "Description", + description: "A longer description of the task, which can include markdown formatting", + }, + assignees: { + propDefinition: [ + dart, + "assigneeIds", + ], + label: "Assignees", + description: "The names or emails of the users that the task is assigned to. Either this or assignee must be included, depending on whether the workspaces allows multiple assignees or not", + }, + assignee: { propDefinition: [ dart, "assigneeIds", ], + type: "string", + label: "Assignee", + description: "The name or email of the user that the task is assigned to. Either this or assignees must be included, depending on whether the workspaces allows multiple assignees or not", + }, + tags: { + propDefinition: [ + dart, + "tags", + ], + label: "Tags", + description: "Any tags that should be applied to the task, which can be used to filter and search for tasks. Tags are also known as labels or components and are strings that can be anything, but should be short and descriptive", }, priority: { propDefinition: [ dart, "priority", ], + label: "Priority", + description: "The priority, which is a string that can be one of the specified options. This is used to sort tasks and determine which tasks should be done first", + }, + startAt: { + propDefinition: [ + dart, + "startAt", + ], + }, + dueAt: { + propDefinition: [ + dart, + "dueAt", + ], + }, + size: { + propDefinition: [ + dart, + "size", + ], + }, + customProperties: { + propDefinition: [ + dart, + "customProperties", + ], }, }, async run({ $ }) { - const response = await this.dart.createTransaction({ + const response = await this.dart.updateTask({ $, data: { - clientDuid: this.taskId, - items: [ - { - duid: this.taskId, - operations: [ - { - model: "task", - kind: "update", - data: { - duid: this.taskId, - dartboardDuid: this.dartboardId, - title: this.title, - description: this.description, - dueAt: this.dueAt, - assigneeDuids: this.assigneeIds, - priority: this.priority, - }, - }, - ], - kind: "task_update", - }, - ], + item: { + id: this.taskId, + title: this.title, + parentId: this.parentId, + dartboard: this.dartboard, + type: this.type, + status: this.status, + description: this.description, + assignees: parseObject(this.assignees), + assignee: this.assignee, + tags: parseObject(this.tags), + priority: this.priority, + startAt: this.startAt, + dueAt: this.dueAt, + size: this.size, + customProperties: parseObject(this.customProperties), + }, }, }); - $.export("$summary", `Updated task with ID: "${this.taskId}"`); + $.export("$summary", `Successfully updated task with ID: ${this.taskId}`); return response; }, }; diff --git a/components/dart/common/constants.mjs b/components/dart/common/constants.mjs index 7535f7ede1bac..04b8ac8167611 100644 --- a/components/dart/common/constants.mjs +++ b/components/dart/common/constants.mjs @@ -1,13 +1,5 @@ -const DEFAULT_LIMIT = 50; - -const TASK_PRIORITIES = [ - "Critical", - "High", - "Medium", - "Low", -]; +const DEFAULT_LIMIT = 100; export default { DEFAULT_LIMIT, - TASK_PRIORITIES, }; diff --git a/components/dart/common/utils.mjs b/components/dart/common/utils.mjs new file mode 100644 index 0000000000000..dcc9cc61f6f41 --- /dev/null +++ b/components/dart/common/utils.mjs @@ -0,0 +1,24 @@ +export const parseObject = (obj) => { + if (!obj) return undefined; + + if (Array.isArray(obj)) { + return obj.map((item) => { + if (typeof item === "string") { + try { + return JSON.parse(item); + } catch (e) { + return item; + } + } + return item; + }); + } + if (typeof obj === "string") { + try { + return JSON.parse(obj); + } catch (e) { + return obj; + } + } + return obj; +}; diff --git a/components/dart/dart.app.mjs b/components/dart/dart.app.mjs index c1f5eee7fe8d9..9c2688edf5c62 100644 --- a/components/dart/dart.app.mjs +++ b/components/dart/dart.app.mjs @@ -5,23 +5,14 @@ export default { type: "app", app: "dart", propDefinitions: { - dartboardId: { + dartboard: { type: "string", - label: "Dartboard ID", + label: "Dartboard", description: "The dartboard where the task is or will be located", - async options({ page }) { - const { results } = await this.listDartboards({ - params: { - limit: constants.DEFAULT_LIMIT, - offset: page * constants.DEFAULT_LIMIT, - }, - }); - return results?.map(({ - duid: value, title: label, - }) => ({ - value, - label, - })) || []; + optional: true, + async options() { + const { dartboards } = await this.getConfig(); + return dartboards?.map((dartboard) => dartboard) || []; }, }, assigneeIds: { @@ -37,7 +28,7 @@ export default { }, }); return results?.map(({ - duid: value, name: label, + email: value, name: label, }) => ({ value, label, @@ -48,6 +39,7 @@ export default { type: "string", label: "Task ID", description: "The ID of the task", + optional: true, async options({ page }) { const { results } = await this.listTasks({ params: { @@ -82,34 +74,77 @@ export default { })) || []; }, }, + tags: { + type: "string[]", + label: "Tags", + description: "The tags of the task", + optional: true, + async options() { + const { tags } = await this.getConfig(); + return tags?.map((tag) => tag) || []; + }, + }, + priority: { + type: "string", + label: "Priority", + description: "The priority of the task", + optional: true, + async options() { + const { priorities } = await this.getConfig(); + return priorities?.map((priority) => priority) || []; + }, + }, + size: { + type: "string", + label: "Size", + description: "The size of the task", + optional: true, + async options() { + const { sizes } = await this.getConfig(); + return sizes?.map((size) => size) || []; + }, + }, + status: { + type: "string", + label: "Status", + description: "The status of the task", + optional: true, + async options() { + const { statuses } = await this.getConfig(); + return statuses?.map((status) => status) || []; + }, + }, + type: { + type: "string", + label: "Type", + description: "The title of the type of the task", + optional: true, + async options() { + const { types } = await this.getConfig(); + return types.map((type) => type); + }, + }, taskName: { type: "string", label: "Task Name", description: "The name of the task", }, - taskDescription: { + startAt: { type: "string", - label: "Description", - description: "The description of the task", + label: "Start At", + description: "The start date, which is a date that the task should be started by in ISO format, like YYYY-MM-DD", optional: true, }, dueAt: { type: "string", label: "Due Date", - description: "The due date for the task in ISO-8601 format. Example: `2024-06-25T15:43:49.214Z`", - optional: true, - }, - priority: { - type: "string", - label: "Priority", - description: "The priority of the task", + description: "The due date for the task in ISO format, like YYYY-MM-DD", optional: true, - options: constants.TASK_PRIORITIES, }, title: { type: "string", label: "Title", - description: "The title, which is a short description of the doc", + description: "The title, which is a short description of what needs to be done", }, folder: { type: "string", @@ -123,6 +158,12 @@ export default { description: "The full content of the doc, which can include markdown formatting", optional: true, }, + customProperties: { + type: "object", + label: "Custom Properties", + description: "The custom properties, which is an object of custom properties that are associated with the task", + optional: true, + }, }, methods: { _baseUrl() { @@ -166,13 +207,31 @@ export default { ...opts, }); }, - createTransaction(opts = {}) { + createTask(opts = {}) { return this._makeRequest({ method: "POST", - path: "/public/transactions/create", + path: "/public/tasks", + ...opts, + }); + }, + updateTask(opts = {}) { + return this._makeRequest({ + method: "PUT", + path: `/public/tasks/${opts.data.item.id}`, ...opts, }); }, + getConfig(opts = {}) { + return this._makeRequest({ + path: "/public/config", + ...opts, + }); + }, + getDartboard({ dartboardId }) { + return this._makeRequest({ + path: `/public/dartboards/${dartboardId}`, + }); + }, createDoc(opts = {}) { return this._makeRequest({ method: "POST", From eb51e24a395926f196e7371dc657b0d91dc66248 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 27 Oct 2025 19:44:13 -0300 Subject: [PATCH 5/6] Update components/dart/actions/create-task/create-task.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- components/dart/actions/create-task/create-task.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dart/actions/create-task/create-task.mjs b/components/dart/actions/create-task/create-task.mjs index d914405c517f2..434e398dcd265 100644 --- a/components/dart/actions/create-task/create-task.mjs +++ b/components/dart/actions/create-task/create-task.mjs @@ -135,7 +135,7 @@ export default { }, }, }); - $.export("$summary", `Successfully created task wiht ID: ${response.id}`); + $.export("$summary", `Successfully created task with ID: ${response.id}`); return response; }, }; From 033f60fdbda6ba6b501ed838549197124ca33990 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 27 Oct 2025 19:44:35 -0300 Subject: [PATCH 6/6] Update components/dart/actions/find-or-create-task/find-or-create-task.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../dart/actions/find-or-create-task/find-or-create-task.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dart/actions/find-or-create-task/find-or-create-task.mjs b/components/dart/actions/find-or-create-task/find-or-create-task.mjs index 7711e1c588167..a0db9c4f47b9f 100644 --- a/components/dart/actions/find-or-create-task/find-or-create-task.mjs +++ b/components/dart/actions/find-or-create-task/find-or-create-task.mjs @@ -116,7 +116,7 @@ export default { const { results } = await this.dart.listTasks({ $, params: { - title: this.taskName, + title: this.title, dartboard: this.dartboard, }, });