From 9c4c43f02bb0235bc6203f177651a2ad492e0395 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Fri, 2 Sep 2022 14:45:18 -0400 Subject: [PATCH 1/4] paginate projectID prop --- components/jira/jira.app.mjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/jira/jira.app.mjs b/components/jira/jira.app.mjs index c2626c1522600..0e9444a487c98 100644 --- a/components/jira/jira.app.mjs +++ b/components/jira/jira.app.mjs @@ -9,7 +9,7 @@ export default { label: "Project ID", description: "The project ID.", async options({ prevContext }) { - const { startAt } = prevContext || {}; + let { startAt } = prevContext || {}; const pageSize = 50; const resp = await this.getAllProjects({ params: { @@ -17,13 +17,16 @@ export default { maxResults: pageSize, }, }); + startAt = startAt > 0 + ? startAt + pageSize + : pageSize; return { options: resp?.values.map((e) => ({ label: e.name, value: e.id, })), context: { - after: startAt, + startAt, }, }; }, From e03f8990af125a47cbdc33ab3149c2926dd480d0 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Fri, 2 Sep 2022 15:09:28 -0400 Subject: [PATCH 2/4] paginate props --- .../add-attachment-to-issue.mjs | 2 +- .../add-comment-to-issue.mjs | 2 +- .../add-multiple-attachments-to-issue.mjs | 2 +- .../add-watcher-to-issue.mjs | 2 +- .../actions/assign-issue/assign-issue.mjs | 2 +- .../actions/create-issue/create-issue.mjs | 2 +- .../actions/create-version/create-version.mjs | 2 +- .../actions/delete-project/delete-project.mjs | 2 +- .../jira/actions/get-issue/get-issue.mjs | 2 +- .../get-transitions/get-transitions.mjs | 2 +- components/jira/actions/get-user/get-user.mjs | 2 +- .../list-issue-comments.mjs | 2 +- .../transition-issue/transition-issue.mjs | 2 +- .../actions/update-comment/update-comment.mjs | 2 +- .../actions/update-issue/update-issue.mjs | 2 +- components/jira/jira.app.mjs | 22 ++++++++++++++----- 16 files changed, 31 insertions(+), 21 deletions(-) diff --git a/components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs b/components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs index b9caccac91ed5..2ea30b995a68f 100644 --- a/components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs +++ b/components/jira/actions/add-attachment-to-issue/add-attachment-to-issue.mjs @@ -8,7 +8,7 @@ export default { key: "jira-add-attachment-to-issue", name: "Add Attachment To Issue", description: "Adds an attachment to an issue, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-issue-issueidorkey-attachments-post)", - version: "0.2.4", + version: "0.2.5", type: "action", props: { jira, diff --git a/components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs b/components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs index 07ee5425c02cd..1266667d599a6 100644 --- a/components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs +++ b/components/jira/actions/add-comment-to-issue/add-comment-to-issue.mjs @@ -5,7 +5,7 @@ export default { key: "jira-add-comment-to-issue", name: "Add Comment To Issue", description: "Adds a new comment to an issue, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-post)", - version: "0.1.2", + version: "0.1.3", type: "action", props: { jira, diff --git a/components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs b/components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs index f1e4234a2df4b..1dbb5720baf7b 100644 --- a/components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs +++ b/components/jira/actions/add-multiple-attachments-to-issue/add-multiple-attachments-to-issue.mjs @@ -8,7 +8,7 @@ export default { key: "jira-add-multiple-attachments-to-issue", name: "Add Multiple Attachments To Issue", description: "Adds multiple attachments to an issue, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-rest-api-3-issue-issueidorkey-attachments-post)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { jira, diff --git a/components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs b/components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs index faa74c42aa535..0e0b714cfa1eb 100644 --- a/components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs +++ b/components/jira/actions/add-watcher-to-issue/add-watcher-to-issue.mjs @@ -3,7 +3,7 @@ import jira from "../../jira.app.mjs"; export default { key: "jira-add-watcher-to-issue", name: "Add Watcher To Issue", - version: "0.0.1", + version: "0.0.2", description: "Adds a user as a watcher of an issue by passing the account ID of the user, For example, `5b10ac8d82e05b22cc7d4ef5`, If no user is specified the calling user is added. [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-watchers/#api-rest-api-3-issue-issueidorkey-watchers-post)", type: "action", props: { diff --git a/components/jira/actions/assign-issue/assign-issue.mjs b/components/jira/actions/assign-issue/assign-issue.mjs index 0d0ab80b0f56d..b984766596e6e 100644 --- a/components/jira/actions/assign-issue/assign-issue.mjs +++ b/components/jira/actions/assign-issue/assign-issue.mjs @@ -3,7 +3,7 @@ import jira from "../../jira.app.mjs"; export default { key: "jira-assign-issue", name: "Assign Issue", - version: "0.0.1", + version: "0.0.2", description: "Assigns an issue to a user. [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-assignee-put)", type: "action", props: { diff --git a/components/jira/actions/create-issue/create-issue.mjs b/components/jira/actions/create-issue/create-issue.mjs index b225d5df845fa..c38ca7ce97d11 100644 --- a/components/jira/actions/create-issue/create-issue.mjs +++ b/components/jira/actions/create-issue/create-issue.mjs @@ -5,7 +5,7 @@ export default { key: "jira-create-issue", name: "Create Issue", description: "Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issue-post)", - version: "0.1.5", + version: "0.1.6", type: "action", props: { jira, diff --git a/components/jira/actions/create-version/create-version.mjs b/components/jira/actions/create-version/create-version.mjs index 36e2df3b6083b..09729acfe7338 100644 --- a/components/jira/actions/create-version/create-version.mjs +++ b/components/jira/actions/create-version/create-version.mjs @@ -4,7 +4,7 @@ export default { key: "jira-create-version", name: "Create Jira Version in project", description: "Creates a project version., [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/#api-rest-api-3-version-post)", - version: "0.1.2", + version: "0.1.3", type: "action", props: { jira, diff --git a/components/jira/actions/delete-project/delete-project.mjs b/components/jira/actions/delete-project/delete-project.mjs index 090e6f6114c28..ded329522b20c 100644 --- a/components/jira/actions/delete-project/delete-project.mjs +++ b/components/jira/actions/delete-project/delete-project.mjs @@ -4,7 +4,7 @@ export default { key: "jira-delete-project", name: "Delete Project", description: "Deletes a project, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-projectidorkey-delete)", - version: "0.1.2", + version: "0.1.3", type: "action", props: { jira, diff --git a/components/jira/actions/get-issue/get-issue.mjs b/components/jira/actions/get-issue/get-issue.mjs index bfcbda0f2054e..083cfe5d386a1 100644 --- a/components/jira/actions/get-issue/get-issue.mjs +++ b/components/jira/actions/get-issue/get-issue.mjs @@ -4,7 +4,7 @@ export default { key: "jira-get-issue", name: "Get Issue", description: "Gets the details for an issue. [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get)", - version: "0.1.2", + version: "0.1.3", type: "action", props: { jira, diff --git a/components/jira/actions/get-transitions/get-transitions.mjs b/components/jira/actions/get-transitions/get-transitions.mjs index dc64a778fd57d..019d08cf8a366 100644 --- a/components/jira/actions/get-transitions/get-transitions.mjs +++ b/components/jira/actions/get-transitions/get-transitions.mjs @@ -4,7 +4,7 @@ export default { key: "jira-get-transitions", name: "Get Transitions", description: "Gets either all transitions or a transition that can be performed by the user on an issue, based on the issue's status, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-transitions-get)", - version: "0.1.2", + version: "0.1.3", type: "action", props: { jira, diff --git a/components/jira/actions/get-user/get-user.mjs b/components/jira/actions/get-user/get-user.mjs index c041546cfa69c..992595df45f44 100644 --- a/components/jira/actions/get-user/get-user.mjs +++ b/components/jira/actions/get-user/get-user.mjs @@ -4,7 +4,7 @@ export default { key: "jira-get-user", name: "Get User", description: "Gets details of user, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-get)", - version: "0.1.2", + version: "0.1.3", type: "action", props: { jira, diff --git a/components/jira/actions/list-issue-comments/list-issue-comments.mjs b/components/jira/actions/list-issue-comments/list-issue-comments.mjs index 98ebc80660f39..deabead57289e 100644 --- a/components/jira/actions/list-issue-comments/list-issue-comments.mjs +++ b/components/jira/actions/list-issue-comments/list-issue-comments.mjs @@ -4,7 +4,7 @@ export default { key: "jira-list-issue-comments", name: "List Issue Comments", description: "Lists all comments for an issue, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-get)", - version: "0.1.2", + version: "0.1.3", type: "action", props: { jira, diff --git a/components/jira/actions/transition-issue/transition-issue.mjs b/components/jira/actions/transition-issue/transition-issue.mjs index fa107a9f621ce..c0a4da86e5f3b 100644 --- a/components/jira/actions/transition-issue/transition-issue.mjs +++ b/components/jira/actions/transition-issue/transition-issue.mjs @@ -5,7 +5,7 @@ export default { key: "jira-transition-issue", name: "Transition Issue", description: "Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-transitions-post)", - version: "0.1.4", + version: "0.1.5", type: "action", props: { jira, diff --git a/components/jira/actions/update-comment/update-comment.mjs b/components/jira/actions/update-comment/update-comment.mjs index 7c90a8c368e25..a34fd1d05bfb2 100644 --- a/components/jira/actions/update-comment/update-comment.mjs +++ b/components/jira/actions/update-comment/update-comment.mjs @@ -5,7 +5,7 @@ export default { key: "jira-update-comment", name: "Update Comment", description: "Updates a comment, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-id-put)", - version: "0.1.2", + version: "0.1.3", type: "action", props: { jira, diff --git a/components/jira/actions/update-issue/update-issue.mjs b/components/jira/actions/update-issue/update-issue.mjs index 3bb67ec571376..951f5a37b63a9 100644 --- a/components/jira/actions/update-issue/update-issue.mjs +++ b/components/jira/actions/update-issue/update-issue.mjs @@ -5,7 +5,7 @@ export default { key: "jira-update-issue", name: "Update Issue", description: "Updates an issue. A transition may be applied and issue properties updated as part of the edit, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-put)", - version: "0.2.0", + version: "0.2.1", type: "action", props: { jira, diff --git a/components/jira/jira.app.mjs b/components/jira/jira.app.mjs index 0e9444a487c98..bf71cc6aec293 100644 --- a/components/jira/jira.app.mjs +++ b/components/jira/jira.app.mjs @@ -8,6 +8,7 @@ export default { type: "string", label: "Project ID", description: "The project ID.", + useQuery: true, async options({ prevContext }) { let { startAt } = prevContext || {}; const pageSize = 50; @@ -61,7 +62,7 @@ export default { label: "Issue id or key", description: "The ID or key of the issue where the attachment will be added to.", async options({ prevContext }) { - const { startAt } = prevContext || {}; + let { startAt } = prevContext || {}; const pageSize = 50; const resp = await this.getIssues({ params: { @@ -69,13 +70,16 @@ export default { maxResults: pageSize, }, }); + startAt = startAt > 0 + ? startAt + pageSize + : pageSize; return { options: resp?.issues?.map((issue) => ({ value: issue.id, label: issue.key, })), context: { - after: startAt, + startAt, }, }; }, @@ -85,7 +89,7 @@ export default { label: "Assignee Id", description: "The account ID of the user, which uniquely identifies the user across all Atlassian products, For example, `5b10ac8d82e05b22cc7d4ef5`, ", async options({ prevContext }) { - const { startAt } = prevContext || {}; + let { startAt } = prevContext || {}; const pageSize = 50; const resp = await this.getUsers({ params: { @@ -93,13 +97,16 @@ export default { maxResults: pageSize, }, }); + startAt = startAt > 0 + ? startAt + pageSize + : pageSize; return { options: resp?.map((user) => ({ value: user.accountId, label: user.displayName, })), context: { - after: startAt, + startAt, }, }; }, @@ -135,7 +142,7 @@ export default { async options({ prevContext, issueIdOrKey, }) { - const { startAt } = prevContext || {}; + let { startAt } = prevContext || {}; const pageSize = 50; const resp = await this.getTransitions({ issueIdOrKey, @@ -144,13 +151,16 @@ export default { maxResults: pageSize, }, }); + startAt = startAt > 0 + ? startAt + pageSize + : pageSize; return { options: resp?.transitions?.map((issue) => ({ value: issue.id, label: issue.name, })), context: { - after: startAt, + startAt, }, }; }, From d8d40ee398ec7d716049b912d6db75d49e243aec Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Fri, 2 Sep 2022 15:53:22 -0400 Subject: [PATCH 3/4] add useQuery to props --- components/jira/jira.app.mjs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/components/jira/jira.app.mjs b/components/jira/jira.app.mjs index bf71cc6aec293..e02b8d66b0b3f 100644 --- a/components/jira/jira.app.mjs +++ b/components/jira/jira.app.mjs @@ -9,13 +9,16 @@ export default { label: "Project ID", description: "The project ID.", useQuery: true, - async options({ prevContext }) { + async options({ + prevContext, query, + }) { let { startAt } = prevContext || {}; const pageSize = 50; const resp = await this.getAllProjects({ params: { startAt, maxResults: pageSize, + query, }, }); startAt = startAt > 0 @@ -87,14 +90,18 @@ export default { accountId: { type: "string", label: "Assignee Id", - description: "The account ID of the user, which uniquely identifies the user across all Atlassian products, For example, `5b10ac8d82e05b22cc7d4ef5`, ", - async options({ prevContext }) { + description: "The account ID of the user, which uniquely identifies the user across all Atlassian products, For example, `5b10ac8d82e05b22cc7d4ef5`", + useQuery: true, + async options({ + prevContext, query, + }) { let { startAt } = prevContext || {}; const pageSize = 50; const resp = await this.getUsers({ params: { startAt, maxResults: pageSize, + query, }, }); startAt = startAt > 0 From c9565b3caca2d7b2a28e9a2feee24d7d41a84b5c Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Fri, 2 Sep 2022 16:09:17 -0400 Subject: [PATCH 4/4] versions --- components/jira/actions/get-all-projects/get-all-projects.mjs | 2 +- components/jira/actions/get-task/get-task.mjs | 2 +- components/jira/actions/make-api-call/make-api-call.mjs | 2 +- components/jira/sources/events/events.mjs | 2 +- components/jira/sources/issue-created/issue-created.mjs | 2 +- components/jira/sources/issue-deleted/issue-deleted.mjs | 2 +- components/jira/sources/issue-updated/issue-updated.mjs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/jira/actions/get-all-projects/get-all-projects.mjs b/components/jira/actions/get-all-projects/get-all-projects.mjs index c3e3dbc0ed1d4..4baae69a7a08e 100644 --- a/components/jira/actions/get-all-projects/get-all-projects.mjs +++ b/components/jira/actions/get-all-projects/get-all-projects.mjs @@ -4,7 +4,7 @@ export default { key: "jira-get-all-projects", name: "JIRA - Get All Projects", description: "Gets metadata on all projects, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-project-get)", - version: "0.1.2", + version: "0.1.3", type: "action", props: { jira, diff --git a/components/jira/actions/get-task/get-task.mjs b/components/jira/actions/get-task/get-task.mjs index e58d7b032c309..f8c069b5ba773 100644 --- a/components/jira/actions/get-task/get-task.mjs +++ b/components/jira/actions/get-task/get-task.mjs @@ -4,7 +4,7 @@ export default { key: "jira-get-task", name: "Get Task", description: "Gets the status of a long-running asynchronous task, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get)", - version: "0.1.2", + version: "0.1.3", type: "action", props: { jira, diff --git a/components/jira/actions/make-api-call/make-api-call.mjs b/components/jira/actions/make-api-call/make-api-call.mjs index bd5b71313a427..5f6b2d30411ee 100644 --- a/components/jira/actions/make-api-call/make-api-call.mjs +++ b/components/jira/actions/make-api-call/make-api-call.mjs @@ -4,7 +4,7 @@ export default { key: "jira-make-api-call", name: "Make API Call", description: "Makes an aribitrary call to Jira API, [See](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/) for all options.", - version: "0.1.2", + version: "0.1.3", type: "action", props: { jira, diff --git a/components/jira/sources/events/events.mjs b/components/jira/sources/events/events.mjs index 01eb48ed7403d..9734d7a8c1369 100644 --- a/components/jira/sources/events/events.mjs +++ b/components/jira/sources/events/events.mjs @@ -5,7 +5,7 @@ export default { key: "jira-events", name: "New Event", description: "Emit new event when an event with subscribed event source triggered, [See the docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-webhooks/#api-rest-api-3-webhook-post)", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", ...common, diff --git a/components/jira/sources/issue-created/issue-created.mjs b/components/jira/sources/issue-created/issue-created.mjs index 2f20d9df0ad31..a4327e127fee4 100644 --- a/components/jira/sources/issue-created/issue-created.mjs +++ b/components/jira/sources/issue-created/issue-created.mjs @@ -4,7 +4,7 @@ export default { key: "jira-issue-created", name: "New Issue Created Event", description: "Emit new event when an issue is created. Note that Jira supports only one webhook, if more sources are needed please use `New Event` source and select multiple events.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", ...common, diff --git a/components/jira/sources/issue-deleted/issue-deleted.mjs b/components/jira/sources/issue-deleted/issue-deleted.mjs index cf371c4ee7bfc..ca745584fa456 100644 --- a/components/jira/sources/issue-deleted/issue-deleted.mjs +++ b/components/jira/sources/issue-deleted/issue-deleted.mjs @@ -4,7 +4,7 @@ export default { key: "jira-issue-deleted", name: "New Issue Deleted Event", description: "Emit new event when an issue is deleted. Note that Jira supports only one webhook, if more sources are needed please use `New Event` source and select multiple events.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", ...common, diff --git a/components/jira/sources/issue-updated/issue-updated.mjs b/components/jira/sources/issue-updated/issue-updated.mjs index f42d5aa9b0451..edf162107feaf 100644 --- a/components/jira/sources/issue-updated/issue-updated.mjs +++ b/components/jira/sources/issue-updated/issue-updated.mjs @@ -4,7 +4,7 @@ export default { key: "jira-issue-updated", name: "New Issue Updated Event", description: "Emit new event when an issue is updated. Note that Jira supports only one webhook, if more sources are needed please use `New Event` source and select multiple events.", - version: "0.0.2", + version: "0.0.3", type: "source", dedupe: "unique", ...common,