diff --git a/components/jira/actions/common/issue.mjs b/components/jira/actions/common/issue.mjs index be1cc39f0085e..98bcb223f684e 100644 --- a/components/jira/actions/common/issue.mjs +++ b/components/jira/actions/common/issue.mjs @@ -43,56 +43,76 @@ export default { ...args, }); }, - getResourcesInfo(key) { - const { - app, - cloudId, - } = this; + getOptions(key) { switch (key) { case constants.FIELD_KEY.PARENT: - return { - fn: app.getIssues, - args: { + return async ({ prevContext: { startAt = 0 } }) => { + const { + app, + cloudId, + } = this; + const maxResults = 50; + const { issues } = await app.getIssues({ cloudId, params: { - maxResults: 100, + maxResults, + startAt, }, - }, - map: ({ issues }) => - issues?.map(({ + }); + return { + options: issues.map(({ id: value, key: label, }) => ({ value, label, })), + context: { + startAt: startAt + maxResults, + }, + }; }; case constants.FIELD_KEY.LABELS: - return { - fn: app.getLabels, - args: { + return async ({ prevContext: { startAt = 0 } }) => { + const { + app, + cloudId, + } = this; + const maxResults = 50; + const { values } = await app.getLabels({ cloudId, params: { - maxResults: 100, + maxResults, + startAt, }, - }, - map: ({ values }) => values, + }); + return { + options: values, + context: { + startAt: startAt + maxResults, + }, + }; }; case constants.FIELD_KEY.ISSUETYPE: - return { - fn: this.getIssueTypes, - args: { + return async () => { + const { + getIssueTypes, cloudId, - }, - map: (issueTypes) => - issueTypes?.map(({ + } = this; + + const issueTypes = await getIssueTypes({ + cloudId, + }); + return { + options: issueTypes.map(({ id: value, name: label, }) => ({ value, label, })), + }; }; default: - return {}; + return []; } }, async getDynamicFields({ @@ -153,19 +173,11 @@ export default { // Requests by Resource if (keysForResourceRequest.includes(key)) { - const { - fn: resourcesFn, - args: resourcesFnArgs, - map: resourcesFnMap, - } = this.getResourcesInfo(key); - - const response = await resourcesFn(resourcesFnArgs); - return Promise.resolve({ ...reduction, [newKey]: { ...value, - options: resourcesFnMap(response), + options: this.getOptions(key), }, }); } diff --git a/components/jira/actions/create-issue/create-issue.mjs b/components/jira/actions/create-issue/create-issue.mjs index 641a4018d95ea..5ab771376c15c 100644 --- a/components/jira/actions/create-issue/create-issue.mjs +++ b/components/jira/actions/create-issue/create-issue.mjs @@ -7,7 +7,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.17", + version: "0.1.18", type: "action", props: { ...common.props, diff --git a/components/jira/actions/update-issue/update-issue.mjs b/components/jira/actions/update-issue/update-issue.mjs index 51b0009f8f541..18a7492736145 100644 --- a/components/jira/actions/update-issue/update-issue.mjs +++ b/components/jira/actions/update-issue/update-issue.mjs @@ -8,29 +8,29 @@ 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.11", + version: "0.2.12", type: "action", props: { ...common.props, - issueIdOrKey: { - reloadProps: true, + projectId: { propDefinition: [ common.props.app, - "issueIdOrKey", + "projectID", ({ cloudId }) => ({ cloudId, }), ], + optional: true, }, - projectId: { + issueIdOrKey: { + reloadProps: true, propDefinition: [ common.props.app, - "projectID", + "issueIdOrKey", ({ cloudId }) => ({ cloudId, }), ], - optional: true, }, issueTypeId: { reloadProps: true, diff --git a/components/jira/package.json b/components/jira/package.json index bf79ab58616a8..276f3a2dd1911 100644 --- a/components/jira/package.json +++ b/components/jira/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/jira", - "version": "0.1.0", + "version": "0.1.1", "description": "Pipedream Jira Components", "main": "jira.app.mjs", "keywords": [ @@ -10,7 +10,7 @@ "homepage": "https://pipedream.com/apps/jira", "author": "Pipedream (https://pipedream.com/)", "dependencies": { - "@pipedream/platform": "^0.10.0", + "@pipedream/platform": "^3.0.1", "form-data": "^4.0.0" }, "publishConfig": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 07cdb3f7dd659..1ce4dfae6becc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4863,10 +4863,10 @@ importers: components/jira: specifiers: - '@pipedream/platform': ^0.10.0 + '@pipedream/platform': ^3.0.1 form-data: ^4.0.0 dependencies: - '@pipedream/platform': 0.10.0 + '@pipedream/platform': 3.0.1 form-data: 4.0.0 components/jira_service_desk: @@ -17640,7 +17640,7 @@ packages: /@pipedream/platform/3.0.1: resolution: {integrity: sha512-xja1ZHUR/DpOQZZJY39daml8q1ZMzg8wKYwYbyxVPs7MiMqneHM7Bz+Lgj/QrjbNissIKsRSGXmkXbT+Y10L0w==} dependencies: - axios: 1.7.5 + axios: 1.7.7 fp-ts: 2.16.9 io-ts: 2.2.21_fp-ts@2.16.9 querystring: 0.2.1 @@ -22546,6 +22546,16 @@ packages: - debug dev: false + /axios/1.7.7: + resolution: {integrity: sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==} + dependencies: + follow-redirects: 1.15.9 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + /axobject-query/3.1.1: resolution: {integrity: sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==} dependencies: @@ -26089,6 +26099,16 @@ packages: debug: 3.2.7 dev: false + /follow-redirects/1.15.9: + resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + /follow-redirects/1.5.10: resolution: {integrity: sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==} engines: {node: '>=4.0'}