diff --git a/integrations/intercom-hitl/pnpm-lock.yaml b/integrations/intercom-hitl/pnpm-lock.yaml index 9bb749d1..f4560ae0 100644 --- a/integrations/intercom-hitl/pnpm-lock.yaml +++ b/integrations/intercom-hitl/pnpm-lock.yaml @@ -17,9 +17,9 @@ importers: axios: specifier: ^1.8.1 version: 1.13.2 - html-to-text: - specifier: ^9.0.5 - version: 9.0.5 + turndown: + specifier: ^7.2.2 + version: 7.2.2 zod: specifier: ^3.24.2 version: 3.25.76 @@ -27,12 +27,12 @@ importers: '@botpress/cli': specifier: ^4.12.1 version: 4.21.0(@bpinternal/zui@1.2.1) - '@types/html-to-text': - specifier: ^9.0.4 - version: 9.0.4 '@types/node': specifier: ^18.19.76 version: 18.19.130 + '@types/turndown': + specifier: ^5.0.6 + version: 5.0.6 ts-node: specifier: ^10.9.2 version: 10.9.2(@types/node@18.19.130)(typescript@5.9.3) @@ -293,6 +293,9 @@ packages: peerDependencies: jsep: ^0.4.0||^1.0.0 + '@mixmark-io/domino@2.2.0': + resolution: {integrity: sha512-Y28PR25bHXUg88kCV7nivXrP2Nj2RueZ3/l/jdx6J9f8J4nsEGcgX0Qe6lt7Pa+J79+kPiJU3LguR6O/6zrLOw==} + '@parcel/watcher-android-arm64@2.5.1': resolution: {integrity: sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==} engines: {node: '>= 10.0.0'} @@ -375,9 +378,6 @@ packages: resolution: {integrity: sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==} engines: {node: '>= 10.0.0'} - '@selderee/plugin-htmlparser2@0.11.0': - resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==} - '@sindresorhus/is@0.14.0': resolution: {integrity: sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==} engines: {node: '>=6'} @@ -470,9 +470,6 @@ packages: '@types/es-aggregate-error@1.0.6': resolution: {integrity: sha512-qJ7LIFp06h1QE1aVxbVd+zJP2wdaugYXYfd6JxsyRMrYHaxb6itXPogW2tz+ylUJ1n1b+JF1PHyYCfYHm0dvUg==} - '@types/html-to-text@9.0.4': - resolution: {integrity: sha512-pUY3cKH/Nm2yYrEmDlPR1mR7yszjGx4DrwPjQ702C4/D5CwHuZTgZdIdwPkRbcuhs7BAh2L5rg3CL5cbRiGTCQ==} - '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -488,6 +485,9 @@ packages: '@types/responselike@1.0.3': resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} + '@types/turndown@5.0.6': + resolution: {integrity: sha512-ru00MoyeeouE5BX4gRL+6m/BsDfbRayOskWqUvh7CLGW+UXxHQItqALa38kKnOiZPqJrtzJUgAC2+F0rL1S4Pg==} + '@types/urijs@1.19.26': resolution: {integrity: sha512-wkXrVzX5yoqLnndOwFsieJA7oKM8cNkOKJtf/3vVGSUFkWDKZvFHpIl9Pvqb/T9UsawBBFMTTD8xu7sK5MWuvg==} @@ -697,10 +697,6 @@ packages: resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} engines: {node: '>=4.0.0'} - deepmerge@4.3.1: - resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} - engines: {node: '>=0.10.0'} - defer-to-connect@1.1.3: resolution: {integrity: sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==} @@ -729,19 +725,6 @@ packages: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} - dom-serializer@2.0.0: - resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} - - domelementtype@2.3.0: - resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} - - domhandler@5.0.3: - resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} - engines: {node: '>= 4'} - - domutils@3.2.2: - resolution: {integrity: sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==} - dotenv@16.6.1: resolution: {integrity: sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==} engines: {node: '>=12'} @@ -762,10 +745,6 @@ packages: end-of-stream@1.4.5: resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} - entities@4.5.0: - resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} - engines: {node: '>=0.12'} - es-abstract@1.24.0: resolution: {integrity: sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==} engines: {node: '>= 0.4'} @@ -930,13 +909,6 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} - html-to-text@9.0.5: - resolution: {integrity: sha512-qY60FjREgVZL03vJU6IfMV4GDjGBIoOyvuFdpBDIX9yTlDw0TjxVBQp+P8NvpdIXNJvfWBTNul7fsAQJq2FNpg==} - engines: {node: '>=14'} - - htmlparser2@8.0.2: - resolution: {integrity: sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==} - http-cache-semantics@4.2.0: resolution: {integrity: sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==} @@ -1112,9 +1084,6 @@ packages: resolution: {integrity: sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==} engines: {node: '>=8'} - leac@0.6.0: - resolution: {integrity: sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg==} - leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -1236,12 +1205,6 @@ packages: resolution: {integrity: sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==} engines: {node: '>=8'} - parseley@0.12.1: - resolution: {integrity: sha512-e6qHKe3a9HWr0oMRVDTRhKce+bRO8VGQR3NyVwcjwrbhMmFCX9KszEV35+rn4AdilFAq9VPxP/Fe1wC9Qjd2lw==} - - peberminta@0.9.0: - resolution: {integrity: sha512-XIxfHpEuSJbITd1H3EeQwpcZbTLHc+VVr8ANI9t5sit565tsI4/xK3KWTUFE2e6QiangUkh3B0jihzmGnNrRsQ==} - picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} @@ -1326,9 +1289,6 @@ packages: safe-stable-stringify@1.1.1: resolution: {integrity: sha512-ERq4hUjKDbJfE4+XtZLFPCDi8Vb1JqaxAPTxWFLBx8XcAlf9Bda/ZJdVezs/NAfsMQScyIlUMx+Yeu7P7rx5jw==} - selderee@0.11.0: - resolution: {integrity: sha512-5TF+l7p4+OsnP8BCCvSyZiSPc4x4//p5uPwK8TCnVPJYRmU2aYKMpOXvw8zM5a5JvuuCGN1jmsMwuU2W02ukfA==} - semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -1440,6 +1400,9 @@ packages: tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + turndown@7.2.2: + resolution: {integrity: sha512-1F7db8BiExOKxjSMU2b7if62D/XOyQyZbPKq/nUwopfgnHlqXHqQ0lvfUTeUIr1lZJzOPFn43dODyMSIfvWRKQ==} + type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} @@ -1800,6 +1763,8 @@ snapshots: dependencies: jsep: 1.4.0 + '@mixmark-io/domino@2.2.0': {} + '@parcel/watcher-android-arm64@2.5.1': optional: true @@ -1860,11 +1825,6 @@ snapshots: '@parcel/watcher-win32-ia32': 2.5.1 '@parcel/watcher-win32-x64': 2.5.1 - '@selderee/plugin-htmlparser2@0.11.0': - dependencies: - domhandler: 5.0.3 - selderee: 0.11.0 - '@sindresorhus/is@0.14.0': {} '@stoplight/better-ajv-errors@1.0.3(ajv@8.17.1)': @@ -2026,8 +1986,6 @@ snapshots: dependencies: '@types/node': 18.19.130 - '@types/html-to-text@9.0.4': {} - '@types/json-schema@7.0.15': {} '@types/keyv@3.1.4': @@ -2044,6 +2002,8 @@ snapshots: dependencies: '@types/node': 18.19.130 + '@types/turndown@5.0.6': {} + '@types/urijs@1.19.26': {} '@types/verror@1.10.11': {} @@ -2265,8 +2225,6 @@ snapshots: deep-extend@0.6.0: {} - deepmerge@4.3.1: {} - defer-to-connect@1.1.3: {} define-data-property@1.1.4: @@ -2289,24 +2247,6 @@ snapshots: diff@4.0.2: {} - dom-serializer@2.0.0: - dependencies: - domelementtype: 2.3.0 - domhandler: 5.0.3 - entities: 4.5.0 - - domelementtype@2.3.0: {} - - domhandler@5.0.3: - dependencies: - domelementtype: 2.3.0 - - domutils@3.2.2: - dependencies: - dom-serializer: 2.0.0 - domelementtype: 2.3.0 - domhandler: 5.0.3 - dotenv@16.6.1: {} dunder-proto@1.0.1: @@ -2327,8 +2267,6 @@ snapshots: dependencies: once: 1.4.0 - entities@4.5.0: {} - es-abstract@1.24.0: dependencies: array-buffer-byte-length: 1.0.2 @@ -2584,21 +2522,6 @@ snapshots: dependencies: function-bind: 1.1.2 - html-to-text@9.0.5: - dependencies: - '@selderee/plugin-htmlparser2': 0.11.0 - deepmerge: 4.3.1 - dom-serializer: 2.0.0 - htmlparser2: 8.0.2 - selderee: 0.11.0 - - htmlparser2@8.0.2: - dependencies: - domelementtype: 2.3.0 - domhandler: 5.0.3 - domutils: 3.2.2 - entities: 4.5.0 - http-cache-semantics@4.2.0: {} immer@9.0.21: {} @@ -2781,8 +2704,6 @@ snapshots: dependencies: package-json: 6.5.0 - leac@0.6.0: {} - leven@3.1.0: {} lodash.includes@4.3.0: {} @@ -2884,13 +2805,6 @@ snapshots: registry-url: 5.1.0 semver: 6.3.1 - parseley@0.12.1: - dependencies: - leac: 0.6.0 - peberminta: 0.9.0 - - peberminta@0.9.0: {} - picomatch@2.3.1: {} pony-cause@1.1.1: {} @@ -2983,10 +2897,6 @@ snapshots: safe-stable-stringify@1.1.1: {} - selderee@0.11.0: - dependencies: - parseley: 0.12.1 - semver@6.3.1: {} semver@7.7.3: {} @@ -3123,6 +3033,10 @@ snapshots: tslib@2.8.1: {} + turndown@7.2.2: + dependencies: + '@mixmark-io/domino': 2.2.0 + type-fest@0.20.2: {} typed-array-buffer@1.0.3: diff --git a/integrations/jira/hub.md b/integrations/jira/hub.md new file mode 100644 index 00000000..3f2d11ae --- /dev/null +++ b/integrations/jira/hub.md @@ -0,0 +1,11 @@ +# Botpress Jira Software Integration + +This integration allows you to connect your Botpress chatbot with Jira Software, a popular platform for project management and issue tracking. With this integration, you can easily manage your projects and tasks directly from your chatbot. + +## Actions + +- **Find User** - Find user by Account ID +- **New Issue** - Create a new issue in Jira +- **Update Issue** - Update an issue in Jira +- **Add Comment To Issue** - Add comment to issue in Jira +- **Find All Users** - Find all users in Jira diff --git a/integrations/jira/integration.definition.ts b/integrations/jira/integration.definition.ts index 376227d0..37acc0bb 100644 --- a/integrations/jira/integration.definition.ts +++ b/integrations/jira/integration.definition.ts @@ -1,24 +1,15 @@ import { IntegrationDefinition } from '@botpress/sdk' -import { - configuration, - states, - user, - channels, - actions, -} from './src/definitions' +import { configuration, actions } from './src/definitions' export default new IntegrationDefinition({ - name: "plus/jira", - title: "Jira", - description: "This integration allows you to manipulate Jira issues and users.", - version: '0.2.3', - readme: 'readme.md', + name: 'plus/jira', + title: 'Jira', + description: 'This integration allows you to manipulate Jira issues and users.', + version: '1.0.0', + readme: 'hub.md', icon: 'icon.svg', configuration, - channels, - user, actions, events: {}, - states, }) diff --git a/integrations/jira/package.json b/integrations/jira/package.json index 23ff8026..8f8075c7 100644 --- a/integrations/jira/package.json +++ b/integrations/jira/package.json @@ -18,14 +18,14 @@ "author": "", "license": "MIT", "dependencies": { - "@botpress/client": "^0.14.0", - "@botpress/sdk": "^0.6.15", + "@botpress/client": "1.27.1", + "@botpress/sdk": "4.15.6", "jira.js": "^2.19.1", - "zod": "^3.20.6" + "zod": "^3.24.1" }, "devDependencies": { - "@types/node": "^18.11.17", - "ts-node": "^10.9.1", - "typescript": "^4.9.4" + "@types/node": "^18.19.74", + "ts-node": "^10.9.2", + "typescript": "^5.7.3" } } diff --git a/integrations/jira/readme.md b/integrations/jira/readme.md deleted file mode 100644 index 0d7d3c98..00000000 --- a/integrations/jira/readme.md +++ /dev/null @@ -1,41 +0,0 @@ -# Botpress Jira Software Integration - -This integration allows you to connect your Botpress chatbot with Jira Software, a popular platform for project management and issue tracking. With this integration, you can easily manage your projects and tasks directly from your chatbot. - -To set up the integration, you will need to provide your **host**, and **email** and **API token** credentials. Once the integration is set up, you can use the built-in actions to create and update tasks, add comments to tasks, and more. - -For more detailed instructions on how to set up and use the Botpress Jira Software integration, please refer to our documentation. - -## Prerequisites - -Before enabling the Botpress Jira Software Integration, please ensure that you have the following: - -- A Botpress cloud account. -- Access to a Jira Software account. -- API token generated from your Jira Software account. - -## Enable Integration - -To enable the Jira Software integration in Botpress, follow these steps: - -- Access your Botpress admin panel. -- Navigate to the “Integrations” section. -- Locate the Jira Software integration and click on “Enable” or “Configure.” -- Provide the required API token, host, email configurations and etails. -- Save the configuration. - -## Usage - -Once the integration is enabled, you can start sending and receiving information within your Botpress chatbot. The integration offers actions such as `findUser`, `newIssue`, `updateIssue`, and `addCommentToIssue` that can be used to interact with your Jira Software account. - -For more detailed information and examples, refer to the Botpress documentation or the Jira Software documentation for configuring the integration. - -## Limitations - -Remember that Jira's administrative limits also apply to the use of the API. - -## Contributing - -Contributions are welcome! If you encounter any issues or have suggestions for improvement, please submit them via the project’s issue tracker. Pull requests are also appreciated. - -Enjoy the seamless project management integration between Botpress and Jira Software! diff --git a/integrations/jira/src/actions/add-comment-to-issue.ts b/integrations/jira/src/actions/add-comment-to-issue.ts index 41303951..c233fd15 100644 --- a/integrations/jira/src/actions/add-comment-to-issue.ts +++ b/integrations/jira/src/actions/add-comment-to-issue.ts @@ -1,29 +1,28 @@ -import { addCommentToIssueInputSchema } from '../misc/custom-schemas' -import type { Implementation } from '../misc/types' - +import * as bp from '.botpress' +import { RuntimeError } from '@botpress/sdk' import { getClient } from '../utils' +import { getErrorMessage } from '../utils/error-handler' -export const addCommentToIssue: Implementation['actions']['addCommentToIssue'] = - async ({ ctx, input, logger }) => { - const validatedInput = addCommentToIssueInputSchema.parse(input) +export const addCommentToIssue: bp.IntegrationProps['actions']['addCommentToIssue'] = async ({ + ctx, + input, + logger, +}) => { + try { const jiraClient = getClient(ctx.configuration) const comment = { - issueIdOrKey: validatedInput.issueKey, - body: validatedInput.body, - } - let response - try { - response = await jiraClient.addCommentToIssue(comment) - logger - .forBot() - .info( - `Successful - Add Comment to Issue - with issueKey: ${validatedInput.issueKey} - id: ${response}` - ) - } catch (error) { - response = '' - logger - .forBot() - .debug(`'Add Comment to Issue' exception ${JSON.stringify(error)}`) + issueIdOrKey: input.issueKey, + body: input.body, } + const response = await jiraClient.addCommentToIssue(comment) + logger.forBot().info(`Successful - Add Comment to Issue - with issueKey: ${input.issueKey} - id: ${response}`) return { id: response } + } catch (error) { + const errorMessage = getErrorMessage(error) + logger.forBot().error(`'Add Comment to Issue' exception: ${errorMessage}`, error) + if (error instanceof RuntimeError) { + throw error + } + throw new RuntimeError(`Failed to add comment to Jira issue: ${errorMessage}`) } +} diff --git a/integrations/jira/src/actions/find-all-users.ts b/integrations/jira/src/actions/find-all-users.ts index f48d261e..dbe32e65 100644 --- a/integrations/jira/src/actions/find-all-users.ts +++ b/integrations/jira/src/actions/find-all-users.ts @@ -1,33 +1,30 @@ -import { Version3Models } from 'jira.js' - -import { - findAllUsersInputSchema, - findAllUsersOutputSchema, -} from '../misc/custom-schemas' -import type { Implementation } from '../misc/types' - +import * as bp from '.botpress' +import { RuntimeError } from '@botpress/sdk' +import { findAllUsersOutputSchema } from '../misc/custom-schemas' import { getClient } from '../utils' +import { getErrorMessage } from '../utils/error-handler' -export const findAllUsers: Implementation['actions']['findAllUsers'] = async ({ - ctx, - input, - logger, -}) => { - const validatedInput = findAllUsersInputSchema.parse(input) - const jiraClient = getClient(ctx.configuration) - const addParams = { - startAt: Number(validatedInput?.startAt || undefined) || undefined, - maxResults: Number(validatedInput?.maxResults || undefined) || undefined, - } - let response +export const findAllUsers: bp.IntegrationProps['actions']['findAllUsers'] = async ({ ctx, input, logger }) => { try { - response = await jiraClient.findAllUser(addParams) - logger - .forBot() - .info(`Successful - Find All User - Total Users ${response.length}`) + const jiraClient = getClient(ctx.configuration) + + // Only include parameters if they're provided + const addParams: { startAt?: number; maxResults?: number } = {} + if (input.startAt !== undefined) { + addParams.startAt = input.startAt + } + if (input.maxResults !== undefined) { + addParams.maxResults = input.maxResults + } + const response = await jiraClient.findAllUser(addParams) + logger.forBot().info(`Successful - Find All User - Total Users ${response.length}`) + return findAllUsersOutputSchema.parse({ users: response }) } catch (error) { - logger.forBot().debug(`'Find All User' exception ${JSON.stringify(error)}`) - response = [] as Version3Models.User[] + const errorMessage = getErrorMessage(error) + logger.forBot().error(`'Find All Users' exception: ${errorMessage}`, error) + if (error instanceof RuntimeError) { + throw error + } + throw new RuntimeError(`Failed to find all Jira users: ${errorMessage}`) } - return findAllUsersOutputSchema.parse({ users: response }) } diff --git a/integrations/jira/src/actions/find-user.ts b/integrations/jira/src/actions/find-user.ts index f8092063..1adebb60 100644 --- a/integrations/jira/src/actions/find-user.ts +++ b/integrations/jira/src/actions/find-user.ts @@ -1,31 +1,21 @@ -import { - findUserInputSchema, - findUserOutputSchema, -} from '../misc/custom-schemas' -import type { Implementation } from '../misc/types' - +import * as bp from '.botpress' +import { RuntimeError } from '@botpress/sdk' +import { findUserOutputSchema } from '../misc/custom-schemas' import { getClient } from '../utils' +import { getErrorMessage } from '../utils/error-handler' -export const findUser: Implementation['actions']['findUser'] = async ({ - ctx, - input, - logger, -}) => { - const validatedInput = findUserInputSchema.parse(input) - const jiraClient = getClient(ctx.configuration) - let response +export const findUser: bp.IntegrationProps['actions']['findUser'] = async ({ ctx, input, logger }) => { try { - response = await jiraClient.findUser(validatedInput.accountId) - logger - .forBot() - .info( - `Successful - Find User - ${ - response?.displayName || 'Unknown' - } - with ID: ${validatedInput.accountId}` - ) + const jiraClient = getClient(ctx.configuration) + const response = await jiraClient.findUser(input.accountId) + logger.forBot().info(`Successful - Find User - ${response?.displayName || 'Unknown'} - with ID: ${input.accountId}`) + return findUserOutputSchema.parse(response) } catch (error) { - logger.forBot().debug(`'Find User' exception ${JSON.stringify(error)}`) - response = {} + const errorMessage = getErrorMessage(error) + logger.forBot().error(`'Find User' exception: ${errorMessage}`, error) + if (error instanceof RuntimeError) { + throw error + } + throw new RuntimeError(`Failed to find Jira user: ${errorMessage}`) } - return findUserOutputSchema.parse(response) } diff --git a/integrations/jira/src/actions/index.ts b/integrations/jira/src/actions/index.ts index 54f2c891..547aac74 100644 --- a/integrations/jira/src/actions/index.ts +++ b/integrations/jira/src/actions/index.ts @@ -1,13 +1,14 @@ import { addCommentToIssue } from './add-comment-to-issue' -// import { findAllUsers } from './find-all-users' +import { findAllUsers } from './find-all-users' import { findUser } from './find-user' import { newIssue } from './new-issue' import { updateIssue } from './update-issue' +import * as bp from '.botpress' export default { findUser, newIssue, updateIssue, addCommentToIssue, - // findAllUsers, -} + findAllUsers, +} satisfies bp.IntegrationProps['actions'] diff --git a/integrations/jira/src/actions/new-issue.ts b/integrations/jira/src/actions/new-issue.ts index 6999c56f..a3f022fb 100644 --- a/integrations/jira/src/actions/new-issue.ts +++ b/integrations/jira/src/actions/new-issue.ts @@ -1,40 +1,47 @@ -import { newIssueInputSchema } from '../misc/custom-schemas' -import type { Implementation } from '../misc/types' - +import * as bp from '.botpress' +import { RuntimeError } from '@botpress/sdk' +import { Version3Parameters } from 'jira.js' import { getClient } from '../utils' +import { getErrorMessage } from '../utils/error-handler' + +export const newIssue: bp.IntegrationProps['actions']['newIssue'] = async ({ ctx, input, logger }) => { + try { + const jiraClient = getClient(ctx.configuration) -export const newIssue: Implementation['actions']['newIssue'] = async ({ - ctx, - input, - logger, -}) => { - const validatedInput = newIssueInputSchema.parse(input) - const jiraClient = getClient(ctx.configuration) - const issue = { - fields: { - summary: validatedInput.summary, - description: validatedInput.description, + const fields: Version3Parameters.CreateIssue['fields'] = { + summary: input.summary, issuetype: { - name: validatedInput.issueType, + name: input.issueType, }, project: { - key: validatedInput.projectKey, - }, - parent: { - key: validatedInput.parentKey || undefined, - }, - assignee: { - id: validatedInput.assigneeId || undefined, + key: input.projectKey, }, - }, - } - let response - try { - response = await jiraClient.newIssue(issue) + } + + // Only include optional fields if they're provided + if (input.description !== undefined) { + fields.description = input.description + } + if (input.parentKey !== undefined) { + fields.parent = { key: input.parentKey } + } + if (input.assigneeId !== undefined) { + fields.assignee = { id: input.assigneeId } + } + + const issue: Version3Parameters.CreateIssue = { + fields, + } + + const response = await jiraClient.newIssue(issue) logger.forBot().info(`Successful - New Issue - ${response}`) + return { issueKey: response } } catch (error) { - logger.forBot().debug(`'New Issue' exception ${JSON.stringify(error)}`) - response = '' + const errorMessage = getErrorMessage(error) + logger.forBot().error(`'New Issue' exception: ${errorMessage}`, error) + if (error instanceof RuntimeError) { + throw error + } + throw new RuntimeError(`Failed to create Jira issue: ${errorMessage}`) } - return { issueKey: response } } diff --git a/integrations/jira/src/actions/update-issue.ts b/integrations/jira/src/actions/update-issue.ts index 5fc31974..d5d0dfe0 100644 --- a/integrations/jira/src/actions/update-issue.ts +++ b/integrations/jira/src/actions/update-issue.ts @@ -1,41 +1,49 @@ -import { updateIssueInputSchema } from '../misc/custom-schemas' -import type { Implementation } from '../misc/types' - +import * as bp from '.botpress' +import { RuntimeError } from '@botpress/sdk' +import { Version3Parameters } from 'jira.js' import { getClient } from '../utils' +import { getErrorMessage } from '../utils/error-handler' -export const updateIssue: Implementation['actions']['updateIssue'] = async ({ - ctx, - input, - logger, -}) => { - const validatedInput = updateIssueInputSchema.parse(input) - const jiraClient = getClient(ctx.configuration) - const issueUpdate = { - issueIdOrKey: validatedInput.issueKey, - fields: { - summary: validatedInput.summary || undefined, - description: validatedInput.description || undefined, - issuetype: { - name: validatedInput.issueType || undefined, - }, - project: { - key: validatedInput.projectKey || undefined, - }, - parent: { - key: validatedInput.parentKey || undefined, - }, - assignee: { - id: validatedInput.assigneeId || undefined, - }, - }, - } - let issueKey = validatedInput.issueKey +export const updateIssue: bp.IntegrationProps['actions']['updateIssue'] = async ({ ctx, input, logger }) => { try { + const jiraClient = getClient(ctx.configuration) + + // Only include fields that are actually provided (not undefined) + const fields: Partial = {} + + if (input.summary !== undefined) { + fields.summary = input.summary + } + if (input.description !== undefined) { + fields.description = input.description + } + if (input.issueType !== undefined) { + fields.issuetype = { name: input.issueType } + } + if (input.projectKey !== undefined) { + fields.project = { key: input.projectKey } + } + if (input.parentKey !== undefined) { + fields.parent = { key: input.parentKey } + } + if (input.assigneeId !== undefined) { + fields.assignee = { id: input.assigneeId } + } + + const issueUpdate = { + issueIdOrKey: input.issueKey, + fields, + } + await jiraClient.updateIssue(issueUpdate) - logger.forBot().info(`Successful - Update Issue - ${issueKey}`) + logger.forBot().info(`Successful - Update Issue - ${input.issueKey}`) + return { issueKey: input.issueKey } } catch (error) { - issueKey = '' - logger.forBot().debug(`'Update Issue' exception ${JSON.stringify(error)}`) + const errorMessage = getErrorMessage(error) + logger.forBot().error(`'Update Issue' exception: ${errorMessage}`, error) + if (error instanceof RuntimeError) { + throw error + } + throw new RuntimeError(`Failed to update Jira issue: ${errorMessage}`) } - return { issueKey } } diff --git a/integrations/jira/src/client/index.ts b/integrations/jira/src/client/index.ts index 1cb32534..4680aa92 100644 --- a/integrations/jira/src/client/index.ts +++ b/integrations/jira/src/client/index.ts @@ -25,15 +25,12 @@ export class JiraApi { await this.client.issues.editIssue(issueUpdate) } - async addCommentToIssue( - comment: Version3Parameters.AddComment - ): Promise { + async addCommentToIssue(comment: Version3Parameters.AddComment): Promise { const { id } = await this.client.issueComments.addComment({ issueIdOrKey: comment.issueIdOrKey, body: comment.body, - expand: comment?.expand, }) - return id || '' + return id ?? '' } async findUser(accountId: string): Promise { @@ -42,9 +39,7 @@ export class JiraApi { }) } - async findAllUser( - addParams?: Version3Parameters.GetAllUsers - ): Promise { + async findAllUser(addParams?: Version3Parameters.GetAllUsers): Promise { return await this.client.users.getAllUsers(addParams) } } diff --git a/integrations/jira/src/definitions/actions.ts b/integrations/jira/src/definitions/actions.ts index d9207964..b9087554 100644 --- a/integrations/jira/src/definitions/actions.ts +++ b/integrations/jira/src/definitions/actions.ts @@ -10,20 +10,12 @@ import { findAllUsersInputSchema, findAllUsersOutputSchema, } from '../misc/custom-schemas' -import { - findUserUi, - newIssueUi, - updateIssueUi, - addCommentToIssueUi, - findAllUsersUi, -} from '../misc/custom-uis' const findUser = { title: 'Find User', description: 'Find user by Account ID', input: { schema: findUserInputSchema, - ui: findUserUi, }, output: { schema: findUserOutputSchema, @@ -35,7 +27,11 @@ const newIssue = { description: 'Create a new issue in Jira', input: { schema: newIssueInputSchema, - ui: newIssueUi, + ui: { + issueType: { + examples: ['Bug', 'Task', 'Story', 'Subtask', 'Epic'], + }, + }, }, output: { schema: newIssueOutputSchema, @@ -47,7 +43,11 @@ const updateIssue = { description: 'Update a issue in Jira', input: { schema: updateIssueInputSchema, - ui: updateIssueUi, + ui: { + issueType: { + examples: ['Bug', 'Task', 'Story', 'Subtask', 'Epic'], + }, + }, }, output: { schema: updateIssueOutputSchema, @@ -59,7 +59,6 @@ const addCommentToIssue = { description: 'Add comment to issue in Jira', input: { schema: addCommentToIssueInputSchema, - ui: addCommentToIssueUi, }, output: { schema: addCommentToIssueOutputSchema, @@ -71,7 +70,6 @@ const findAllUsers = { description: 'Find All Users', input: { schema: findAllUsersInputSchema, - ui: findAllUsersUi, }, output: { schema: findAllUsersOutputSchema, @@ -83,5 +81,5 @@ export const actions = { newIssue, updateIssue, addCommentToIssue, - // findAllUsers, + findAllUsers, } diff --git a/integrations/jira/src/definitions/channels.ts b/integrations/jira/src/definitions/channels.ts deleted file mode 100644 index 7503e93c..00000000 --- a/integrations/jira/src/definitions/channels.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IntegrationDefinitionProps, messages } from '@botpress/sdk' - -export const channels = { - channel: { - messages: { ...messages.defaults }, - }, -} satisfies IntegrationDefinitionProps['channels'] diff --git a/integrations/jira/src/definitions/index.ts b/integrations/jira/src/definitions/index.ts index b8fbb31a..47bb5eba 100644 --- a/integrations/jira/src/definitions/index.ts +++ b/integrations/jira/src/definitions/index.ts @@ -1,34 +1,12 @@ import type { IntegrationDefinitionProps } from '@botpress/sdk' -import z from 'zod' +import { z } from '@botpress/sdk' export { actions } from './actions' -export { channels } from './channels' export const configuration = { schema: z.object({ - host: z.string().describe('Atlassian Host Domain'), - email: z.string().describe('Email in Atlassian Account'), - apiToken: z.string().describe('API Token'), + host: z.string().title('Host').describe('Atlassian Host Domain (e.g. https://yourcompany.atlassian.net/)'), + email: z.string().title('Email').describe('Email in Atlassian Account'), + apiToken: z.string().title('API Token').describe('API Token'), }), } satisfies IntegrationDefinitionProps['configuration'] - -export const states = { - // voidStateOne: { - // type: 'integration', - // schema: z.object({ - // dataField: z.string(), - // }), - // }, - // voidStateTwo: { - // type: 'conversation', - // schema: z.object({ - // otherDataField: z.string(), - // }), - // }, -} satisfies IntegrationDefinitionProps['states'] - -export const user = { - tags: { - // id: {}, - }, -} satisfies IntegrationDefinitionProps['user'] diff --git a/integrations/jira/src/index.ts b/integrations/jira/src/index.ts index 2ceb6fa9..50294d1d 100644 --- a/integrations/jira/src/index.ts +++ b/integrations/jira/src/index.ts @@ -1,13 +1,11 @@ import actions from './actions' -import { register, unregister, channels, handler } from './setup' -import * as botpress from '.botpress' +import { register, unregister } from './setup' +import * as bp from '.botpress' -console.info('starting integration') - -export default new botpress.Integration({ +export default new bp.Integration({ register, unregister, actions, - channels, - handler, + channels: {}, + handler: async () => {}, }) diff --git a/integrations/jira/src/misc/custom-schemas.ts b/integrations/jira/src/misc/custom-schemas.ts index 63608cc4..6dcfd150 100644 --- a/integrations/jira/src/misc/custom-schemas.ts +++ b/integrations/jira/src/misc/custom-schemas.ts @@ -1,4 +1,4 @@ -import z from 'zod' +import { z } from '@botpress/sdk' import { AvatarUrlsSchema, SimpleListWrapperApplicationRoleSchema, @@ -6,99 +6,99 @@ import { } from './sub-schemas' export const newIssueInputSchema = z.object({ + // All Jira instances require a summary, issue type, project key. summary: z .string() - .describe( - 'The summary of the issue, providing a brief description (e.g. My Issue)' - ), + .title('Summary') + .describe('The summary of the issue, providing a brief description (e.g. My Issue)'), + issueType: z + .string() + .title('Issue Type') + .describe('The type of the issue (e.g. "Bug", "Task", "Subtask", "Story" or "Epic")'), + projectKey: z.string().title('Project Key').describe('The key of the project to which the issue belongs (e.g. TEST)'), description: z .string() .optional() + .title('Description') .describe( 'The detailed description of the issue (Optional) (e.g. This is an example issue for demonstration purposes)' ), - issueType: z - .string() - .describe( - 'The type of the issue (e.g. "Bug", "Task", "Subtask", "Story" or "Epic")' - ), - projectKey: z - .string() - .describe('The key of the project to which the issue belongs (e.g. TEST)'), parentKey: z .string() .optional() - .describe( - 'The key of the parent issue, if this issue is a sub-task (Optional) (e.g. TEST-1)' - ), + .title('Parent Key') + .describe('The key of the parent issue, if this issue is a sub-task (Optional) (e.g. TEST-1)'), assigneeId: z .string() .optional() - .describe( - 'The ID of the user to whom the issue is assigned (Optional) (e.g. 5b10ac8d82e05b22cc7d4ef5)' - ), + .title('Assignee ID') + .describe('The ID of the user to whom the issue is assigned (Optional) (e.g. 5b10ac8d82e05b22cc7d4ef5)'), }) export const newIssueOutputSchema = z.object({ - issueKey: z.string(), + issueKey: z.string().title('Issue Key').describe('The key of the created issue'), }) export const findUserInputSchema = z.object({ accountId: z .string() - .describe( - 'Account ID (e.g. 5b10a2844c20165700ede21g or 747474:a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890)' - ), + .title('Account ID') + .describe('Account ID (e.g. 5b10a2844c20165700ede21g or 747474:a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890)'), }) export const findUserOutputSchema = z.object({ - self: z.string().optional(), - key: z.string().optional(), - accountId: z.string(), - accountType: z.string().optional(), - name: z.string().optional(), - emailAddress: z.string().optional(), - avatarUrls: AvatarUrlsSchema.optional(), - displayName: z.string().optional(), - active: z.boolean(), - timeZone: z.string().optional(), - locale: z.string().optional(), - groups: SimpleListWrapperGroupNameSchema.optional(), - applicationRoles: SimpleListWrapperApplicationRoleSchema.optional(), - expand: z.string().optional(), + self: z.string().optional().title('Self').describe('The URL of the user'), + key: z.string().optional().title('Key').describe('The key of the user'), + accountId: z.string().title('Account ID').describe('The account ID of the user'), + accountType: z.string().optional().title('Account Type').describe('The type of the account'), + name: z.string().optional().title('Name').describe('The name of the user'), + emailAddress: z.string().optional().title('Email Address').describe('The email address of the user'), + avatarUrls: AvatarUrlsSchema.optional().title('Avatar URLs').describe('The avatar URLs of the user'), + displayName: z.string().optional().title('Display Name').describe('The display name of the user'), + active: z.boolean().title('Active').describe('Whether the user is active'), + timeZone: z.string().optional().title('Time Zone').describe('The time zone of the user'), + locale: z.string().optional().title('Locale').describe('The locale of the user'), + groups: SimpleListWrapperGroupNameSchema.optional().title('Groups').describe('The groups the user belongs to'), + applicationRoles: SimpleListWrapperApplicationRoleSchema.optional() + .title('Application Roles') + .describe('The application roles of the user'), + expand: z.string().optional().title('Expand').describe('The expand parameter'), }) export const updateIssueInputSchema = newIssueInputSchema.partial().extend({ - issueKey: z.string().describe('The Key for Issue (e.g. TASK-185)'), + // All Jira instances for updating an issue require an issue key. + issueKey: z.string().title('Issue Key').describe('The Key for Issue (e.g. TASK-185)'), issueType: z .string() - .describe( - 'The type of the issue (e.g. "Bug", "Task", "Subtask", "Story" or "Epic")' - ), + .optional() + .title('Issue Type') + .describe('The type of the issue (e.g. "Bug", "Task", "Subtask", "Story" or "Epic")'), }) export const updateIssueOutputSchema = newIssueOutputSchema export const addCommentToIssueInputSchema = z.object({ - issueKey: z.string().describe('The Key for Issue (e.g. TASK-185)'), - body: z.string().describe('Message content in text format'), + issueKey: z.string().title('Issue Key').describe('The Key for Issue (e.g. TASK-185)'), + body: z.string().title('Body').describe('Message content in text format'), }) export const addCommentToIssueOutputSchema = z.object({ - id: z.string().optional(), + id: z.string().optional().title('ID').describe('The ID of the created comment'), }) export const findAllUsersInputSchema = z.object({ startAt: z .number() .optional() + .title('Start At') .describe('The index of the first item to return (Default: 0) (Optional)'), maxResults: z .number() .optional() + .title('Max Results') .describe('The maximum number of items to return (Default: 50) (Optional)'), }) export const findAllUsersOutputSchema = z.object({ - users: z.array(findUserOutputSchema), + users: z.array(findUserOutputSchema).title('Users').describe('The list of users'), }) diff --git a/integrations/jira/src/misc/custom-types.ts b/integrations/jira/src/misc/custom-types.ts deleted file mode 100644 index 336ce12b..00000000 --- a/integrations/jira/src/misc/custom-types.ts +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/integrations/jira/src/misc/custom-uis.ts b/integrations/jira/src/misc/custom-uis.ts deleted file mode 100644 index 69569695..00000000 --- a/integrations/jira/src/misc/custom-uis.ts +++ /dev/null @@ -1,82 +0,0 @@ -export const findUserUi = { - accountId: { - title: 'A Account ID', - }, -} - -export const newIssueUi = { - summary: { - title: - 'The summary of the issue, providing a brief description (e.g. My Issue)', - }, - description: { - title: - 'The detailed description of the issue (Optional) (e.g. This is an example issue for demonstration purposes)', - }, - issueType: { - title: - 'The type of the issue (e.g. "Bug", "Task", "Subtask", "Story" or "Epic")', - examples: ['Bug', 'Task', 'Story', 'Subtask', 'Epic'], - }, - projectKey: { - title: 'The key of the project to which the issue belongs (e.g. TEST)', - }, - parentKey: { - title: - 'The key of the parent issue, if this issue is a sub-task (Optional) (e.g. TEST-1)', - }, - assigneeId: { - title: - 'The ID of the user to whom the issue is assigned (Optional) (e.g. 5b10ac8d82e05b22cc7d4ef5)', - }, -} - -export const updateIssueUi = { - issueKey: { - title: 'The Key for Issue (Required) (e.g. TASK-185)', - }, - summary: { - title: - 'The summary of the issue, providing a brief description (Optional) (e.g. My Issue)', - }, - description: { - title: - 'The detailed description of the issue (Optional) (e.g. This is an example issue for demonstration purposes)', - }, - issueType: { - title: - 'The type of the issue (Required) (e.g. "Bug", "Task", "Subtask", "Story" or "Epic")', - examples: ['Bug', 'Task', 'Story', 'Subtask', 'Epic'], - }, - projectKey: { - title: - 'The key of the project to which the issue belongs (Optional) (e.g. TEST)', - }, - parentKey: { - title: - 'The key of the parent issue, if this issue is a sub-task (Optional) (e.g. TEST-1)', - }, - assigneeId: { - title: - 'The ID of the user to whom the issue is assigned (Optional) (e.g. 5b10ac8d82e05b22cc7d4ef5)', - }, -} - -export const addCommentToIssueUi = { - issueKey: { - title: 'The Key for Issue (Required) (e.g. TASK-185)', - }, - body: { - title: 'Message content in text format', - }, -} - -export const findAllUsersUi = { - startAt: { - title: 'The index of the first item to return (Default: 0) (Optional)', - }, - maxResults: { - title: - ' The maximum number of items to return per page (Default: 50) (Optional)', - }, -} diff --git a/integrations/jira/src/misc/sub-schemas/index.ts b/integrations/jira/src/misc/sub-schemas/index.ts index ac0fbeec..61cf8c85 100644 --- a/integrations/jira/src/misc/sub-schemas/index.ts +++ b/integrations/jira/src/misc/sub-schemas/index.ts @@ -1,4 +1,4 @@ -import z from 'zod' +import { z } from '@botpress/sdk' const AvatarUrlsSchema = z.object({ '16x16': z.string().optional(), diff --git a/integrations/jira/src/misc/types.ts b/integrations/jira/src/misc/types.ts deleted file mode 100644 index fc2ccc80..00000000 --- a/integrations/jira/src/misc/types.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { IntegrationContext } from '@botpress/sdk' -import type * as botpress from '.botpress' -import type { Configuration } from '.botpress/implementation/configuration' - -export type Config = botpress.configuration.Configuration -export type Implementation = ConstructorParameters< - typeof botpress.Integration ->[0] -export type IntegrationCtx = IntegrationContext - -export type RegisterFunction = Implementation['register'] -export type UnregisterFunction = Implementation['unregister'] -export type Channels = Implementation['channels'] -export type Handler = Implementation['handler'] diff --git a/integrations/jira/src/setup.ts b/integrations/jira/src/setup.ts new file mode 100644 index 00000000..d80b125d --- /dev/null +++ b/integrations/jira/src/setup.ts @@ -0,0 +1,18 @@ +import * as bp from '.botpress' +import { getClient } from './utils' +import { RuntimeError } from '@botpress/sdk' + +export const register: bp.IntegrationProps['register'] = async ({ ctx, logger }) => { + const jiraClient = getClient(ctx.configuration) + try { + await jiraClient.findAllUser() + logger.forBot().info('Jira integration registered successfully') + } catch (error) { + logger.forBot().error('Failed to register Jira integration', error) + throw new RuntimeError('Failed to register Jira integration') + } +} + +export const unregister: bp.IntegrationProps['unregister'] = async ({ logger }) => { + logger.forBot().info('Jira integration unregistered') +} diff --git a/integrations/jira/src/setup/channels.ts b/integrations/jira/src/setup/channels.ts deleted file mode 100644 index 47c29f52..00000000 --- a/integrations/jira/src/setup/channels.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { Channels } from '../misc/types' - -class NotImplementedError extends Error { - constructor() { - super('Not implemented') - } -} - -export const channels: Channels = { - channel: { - messages: { - text: async () => { - throw new NotImplementedError() - }, - image: async () => { - throw new NotImplementedError() - }, - markdown: async () => { - throw new NotImplementedError() - }, - audio: async () => { - throw new NotImplementedError() - }, - video: async () => { - throw new NotImplementedError() - }, - file: async () => { - throw new NotImplementedError() - }, - location: async () => { - throw new NotImplementedError() - }, - carousel: async () => { - throw new NotImplementedError() - }, - card: async () => { - throw new NotImplementedError() - }, - choice: async () => { - throw new NotImplementedError() - }, - dropdown: async () => { - throw new NotImplementedError() - }, - }, - }, -} diff --git a/integrations/jira/src/setup/handler.ts b/integrations/jira/src/setup/handler.ts deleted file mode 100644 index 01d0e2aa..00000000 --- a/integrations/jira/src/setup/handler.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Handler } from '../misc/types' - -class NotImplementedError extends Error { - constructor() { - super('Not implemented') - } -} - -export const handler: Handler = async () => { - throw new NotImplementedError() -} diff --git a/integrations/jira/src/setup/index.ts b/integrations/jira/src/setup/index.ts deleted file mode 100644 index 942ecedd..00000000 --- a/integrations/jira/src/setup/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { register } from './register' -export { unregister } from './unregister' -export { channels } from './channels' -export { handler } from './handler' diff --git a/integrations/jira/src/setup/register.ts b/integrations/jira/src/setup/register.ts deleted file mode 100644 index 1fde01b2..00000000 --- a/integrations/jira/src/setup/register.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { RegisterFunction } from '../misc/types' -import { getClient } from '../utils' - - -export const register: RegisterFunction = async ({ctx}) => { - /** - * This is called when a bot installs the integration. - * You should use this handler to instanciate ressources in the external service and ensure that the configuration is valid. - */ - - const jiraClient = getClient(ctx.configuration) - try { - await jiraClient.findAllUser() - } catch (error) { - throw new Error('Invalid configuration') - } - - return true; - -} diff --git a/integrations/jira/src/setup/unregister.ts b/integrations/jira/src/setup/unregister.ts deleted file mode 100644 index 3eb23972..00000000 --- a/integrations/jira/src/setup/unregister.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { UnregisterFunction } from '../misc/types' - -export const unregister: UnregisterFunction = async () => { - /** - * This is called when a bot removes the integration. - * You should use this handler to instanciate ressources in the external service and ensure that the configuration is valid. - */ -} diff --git a/integrations/jira/src/utils/error-handler.ts b/integrations/jira/src/utils/error-handler.ts new file mode 100644 index 00000000..3dd45f88 --- /dev/null +++ b/integrations/jira/src/utils/error-handler.ts @@ -0,0 +1,50 @@ +import { ZodError, ZodIssue } from '@botpress/sdk' + +const formatZodErrors = (issues: ZodIssue[]) => + 'Validation Error: ' + + issues + .map((issue) => { + const path = issue.path?.length ? `${issue.path.join('.')}: ` : '' + return path ? `${path}${issue.message}` : issue.message + }) + .join('\n') + +export const getErrorMessage = (err: unknown): string => { + if (err && typeof err === 'object') { + const error = err as Record + + if ('statusCode' in error || 'response' in error) { + const status = error.statusCode as number | undefined + const response = error.response as { body?: unknown; data?: unknown } | undefined + const message = error.message as string | undefined + + const data = response?.body || response?.data + + if (typeof data === 'string' && data.trim()) { + return status ? `${data} (Status: ${status})` : data + } + return status ? `${message || 'Jira API error'} (Status: ${status})` : message || 'Jira API error' + } + } + + if (err instanceof ZodError) { + return formatZodErrors(err.errors) + } + + if (err instanceof Error) { + return err.message + } + + if (typeof err === 'string') { + return err + } + + if (err && typeof err === 'object' && 'message' in err) { + const message = (err as { message: unknown }).message + if (typeof message === 'string') { + return message + } + } + + return 'An unexpected error occurred' +} diff --git a/integrations/jira/src/utils/index.ts b/integrations/jira/src/utils/index.ts index abf2cc6b..f6aa526f 100644 --- a/integrations/jira/src/utils/index.ts +++ b/integrations/jira/src/utils/index.ts @@ -1,5 +1,5 @@ import { JiraApi } from '../client' -import type { Config } from '../misc/types' +import type * as bp from '../../.botpress' -export const getClient = (config: Config) => +export const getClient = (config: bp.configuration.Configuration) => new JiraApi(config.host, config.email, config.apiToken) diff --git a/integrations/segment/pnpm-lock.yaml b/integrations/segment/pnpm-lock.yaml index 8d12c862..a7ce00a4 100644 --- a/integrations/segment/pnpm-lock.yaml +++ b/integrations/segment/pnpm-lock.yaml @@ -9,11 +9,11 @@ importers: .: dependencies: '@botpress/client': - specifier: 1.16.1 - version: 1.16.1 + specifier: 1.24.1 + version: 1.24.1 '@botpress/sdk': - specifier: 4.13.0 - version: 4.13.0(@bpinternal/zui@1.1.1) + specifier: 4.15.8 + version: 4.15.8(@bpinternal/zui@1.1.1) analytics: specifier: ^0.8.11 version: 0.8.19(@types/dlv@1.1.5) @@ -66,15 +66,19 @@ packages: '@analytics/type-utils@0.6.4': resolution: {integrity: sha512-Ou1gQxFakOWLcPnbFVsrPb8g1wLLUZYYJXDPjHkG07+5mustGs5yqACx42UAu4A6NszNN6Z5gGxhyH45zPWRxw==} - '@botpress/client@1.16.1': - resolution: {integrity: sha512-amkqZKYAZRe7ocQearb6dNJgfrUWrLqUeb06g2KWoJfBCp+a71T7dE/Asleie0TRVqkogZn1Nv0dZ5PAZqcGKg==} + '@botpress/client@1.24.1': + resolution: {integrity: sha512-QRBVCl+ra5zFIrK9ISyPkDPc+yH057fnGsKbzbtNj+HXVC2sfI16g4p4CzvnlIsX/qEV8UcN20ebxGfRnjQqnQ==} engines: {node: '>=18.0.0'} - '@botpress/sdk@4.13.0': - resolution: {integrity: sha512-qhw5r/0XvXVk99l461O6vFpKqX3spcp9zNLtiz2/yUiz2ECoMGiT74zv32nMDZH9EIYNIiz/458WRhKQ6AH6dA==} + '@botpress/client@1.24.2': + resolution: {integrity: sha512-tl9nMjPN7Ia5VP3Z351FWd5HiwhUrqTbWuamXo1s1DjJ7WhKBDK1dSId+tLSnh53N/xZb83MDA+4fUAUc6nJQw==} + engines: {node: '>=18.0.0'} + + '@botpress/sdk@4.15.8': + resolution: {integrity: sha512-8dEsRySWCsgsYEKDzkhWT37/XbMBVULM+ppsjqfvR14P29hF4yGJFa7jTdPKg+r4YjBa2TrEf8PNvoFKXgdKwA==} engines: {node: '>=18.0.0'} peerDependencies: - '@bpinternal/zui': ^1.0.0 + '@bpinternal/zui': ^1.0.1 esbuild: ^0.16.12 peerDependenciesMeta: esbuild: @@ -518,7 +522,16 @@ snapshots: '@analytics/type-utils@0.6.4': {} - '@botpress/client@1.16.1': + '@botpress/client@1.24.1': + dependencies: + axios: 1.12.2 + axios-retry: 4.5.0(axios@1.12.2) + browser-or-node: 2.1.1 + qs: 6.14.0 + transitivePeerDependencies: + - debug + + '@botpress/client@1.24.2': dependencies: axios: 1.12.2 axios-retry: 4.5.0(axios@1.12.2) @@ -527,9 +540,9 @@ snapshots: transitivePeerDependencies: - debug - '@botpress/sdk@4.13.0(@bpinternal/zui@1.1.1)': + '@botpress/sdk@4.15.8(@bpinternal/zui@1.1.1)': dependencies: - '@botpress/client': 1.16.1 + '@botpress/client': 1.24.2 '@bpinternal/zui': 1.1.1 browser-or-node: 2.1.1 transitivePeerDependencies: diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 761f9947..8000be40 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -55,7 +55,7 @@ importers: version: 51.4.1(eslint@9.39.1) eslint-plugin-oxlint: specifier: ^1.5.0 - version: 1.25.0 + version: 1.30.0 eslint-plugin-prettier: specifier: ^5.5.1 version: 5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1))(eslint@9.39.1)(prettier@3.6.2) @@ -70,13 +70,13 @@ importers: version: 9.1.7 lint-staged: specifier: ^16.1.2 - version: 16.2.6 + version: 16.2.7 npm-check-updates: specifier: ^18.0.1 version: 18.3.1 oxlint: specifier: ^1.5.0 - version: 1.25.0 + version: 1.30.0 prettier: specifier: ^3.6.2 version: 3.6.2 @@ -140,17 +140,17 @@ importers: version: 1.27.1 '@botpress/sdk': specifier: ^4.17.2 - version: 4.20.0(@bpinternal/zui@1.2.2)(esbuild@0.25.12) + version: 4.20.2(@bpinternal/zui@1.2.2)(esbuild@0.25.12) axios: specifier: ^1.8.1 - version: 1.13.1 + version: 1.13.2 zod: specifier: ^3.24.2 version: 3.25.76 devDependencies: '@botpress/cli': specifier: ^4.17.2 - version: 4.26.0(@bpinternal/zui@1.2.2) + version: 4.27.3(@bpinternal/zui@1.2.2) '@types/node': specifier: ^18.19.76 version: 18.19.130 @@ -161,6 +161,31 @@ importers: specifier: ^5.8.2 version: 5.9.3 + integrations/jira: + dependencies: + '@botpress/client': + specifier: 1.27.1 + version: 1.27.1 + '@botpress/sdk': + specifier: 4.15.6 + version: 4.15.6(@bpinternal/zui@1.2.2)(esbuild@0.16.17) + jira.js: + specifier: ^2.19.1 + version: 2.20.1 + zod: + specifier: ^3.24.1 + version: 3.25.76 + devDependencies: + '@types/node': + specifier: ^18.19.74 + version: 18.19.130 + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@types/node@18.19.130)(typescript@5.9.3) + typescript: + specifier: ^5.7.3 + version: 5.9.3 + integrations/zoom: dependencies: '@botpress/client': @@ -362,8 +387,8 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - '@botpress/cli@4.26.0': - resolution: {integrity: sha512-OmqiBVPmZwR8E2AwOqrwW8qH3Lbvx770D8oXJS6Z2noC4tm3knRs4PQQDZz2EH7Q+nSM0ogQ7fNicqbPKm00oQ==} + '@botpress/cli@4.27.3': + resolution: {integrity: sha512-ylkM13ZCFZm2VuiExX8Q81prDgbf7LNoOPuebOdjhG9briuz7784Gri2r9sfsrO+CPgJF7KO9RRNIXKSVYSMKA==} engines: {node: '>=18.0.0'} hasBin: true @@ -386,10 +411,18 @@ packages: resolution: {integrity: sha512-21tDe0mKbrYW1AgPM4nfAEfpML5tZiI1FGHpOjwcFEDZiNgU+YAPdZsAvwXv57bkNxzhI9oISq9qgCZ6YBFR4A==} engines: {node: '>=18.0.0'} + '@botpress/client@1.24.1': + resolution: {integrity: sha512-QRBVCl+ra5zFIrK9ISyPkDPc+yH057fnGsKbzbtNj+HXVC2sfI16g4p4CzvnlIsX/qEV8UcN20ebxGfRnjQqnQ==} + engines: {node: '>=18.0.0'} + '@botpress/client@1.27.1': resolution: {integrity: sha512-c6EDjUphVehm6WIZse4qTHaYL0oudObrdGnRg6r2040lNIF+nFl7e24EvbO5fB4pxp1/ApoQMPJaPA5nJVOVLg==} engines: {node: '>=18.0.0'} + '@botpress/client@1.27.2': + resolution: {integrity: sha512-fTP42EDRnhRZDdRFAUQlMUDQ0CxMYchnhDsT/4Luubz6n8gKea9eBz5t0UngCzD98Eat5D+UbnfkAR89IQDWpA==} + engines: {node: '>=18.0.0'} + '@botpress/sdk@4.13.0': resolution: {integrity: sha512-qhw5r/0XvXVk99l461O6vFpKqX3spcp9zNLtiz2/yUiz2ECoMGiT74zv32nMDZH9EIYNIiz/458WRhKQ6AH6dA==} engines: {node: '>=18.0.0'} @@ -410,8 +443,18 @@ packages: esbuild: optional: true - '@botpress/sdk@4.20.0': - resolution: {integrity: sha512-2K0Fn9BXJFKRBg6wA2/Uh+eRiwAzkBoKsFNkYwrua2bdri/HraXdZ3iX7JAxUwKFOTzmJrNnVKydCClnLdmBvw==} + '@botpress/sdk@4.15.6': + resolution: {integrity: sha512-MFgIYW22pRL9lmMg6aLeb6nrvMyGs8FXAQ6pqSxboBSK3zuBxSbRbVmnc4OGLOLH6uI9+ECtOkggTGKX1KbptA==} + engines: {node: '>=18.0.0'} + peerDependencies: + '@bpinternal/zui': ^1.0.1 + esbuild: ^0.16.12 + peerDependenciesMeta: + esbuild: + optional: true + + '@botpress/sdk@4.20.2': + resolution: {integrity: sha512-x4H1GlHBybBGjcd14oxW5jDnSdB/J57+U7X71toPG6nfFrzS3+FdJY0sklL/tCJAEsnRoYMaPkUKk4/l+GQgmg==} engines: {node: '>=18.0.0'} peerDependencies: '@bpinternal/zui': 1.2.1 @@ -898,43 +941,43 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@oxlint/darwin-arm64@1.25.0': - resolution: {integrity: sha512-OLx4XyUv5SO7k8y5FzJIoTKan+iKK53T1Ws8fBIl4zblUIWI66ZIqSVG2A2rxOBA7XfINqCz8UipGzOW9yzKcg==} + '@oxlint/darwin-arm64@1.30.0': + resolution: {integrity: sha512-vIiTk1FBObXHvaG3WK/SpwCZP06fuHhSrn8mK2hEs2uSFWG63WgvLAHSGhI4U1X29JGf36zhfUzuKirDIVdKBQ==} cpu: [arm64] os: [darwin] - '@oxlint/darwin-x64@1.25.0': - resolution: {integrity: sha512-srndNPiliA0rchYKqYfOdqA9kqyVQ6YChK3XJe9Lxo/YG8tTJ5K65g2A5SHTT2s1Nm5DnQa5AKZH7w+7KI/m8A==} + '@oxlint/darwin-x64@1.30.0': + resolution: {integrity: sha512-DP4ueul8Vza52gJX1/+jyXQjUsgjmPe4Pq5uYOVa8k2V8cKRb2JzBls+DugbeP7yzKNTmlSp3J2mUnHQXuntLA==} cpu: [x64] os: [darwin] - '@oxlint/linux-arm64-gnu@1.25.0': - resolution: {integrity: sha512-W9+DnHDbygprpGV586BolwWES+o2raOcSJv404nOFPQjWZ09efG24nuXrg/fpyoMQb4YoW2W1fvlnyMVU+ADcw==} + '@oxlint/linux-arm64-gnu@1.30.0': + resolution: {integrity: sha512-1e9NvTvjzG6t1tnUzNU9HZTVwNwhZw2BDQxwIsXV743g54BIkvyZNNXOEGic/Jw4IuIXHzpX3ztVWZaSzvDopg==} cpu: [arm64] os: [linux] - '@oxlint/linux-arm64-musl@1.25.0': - resolution: {integrity: sha512-1tIMpQhKlItm7uKzs3lluG7KorZR5ItoNKd1iFYF/IPmZ+i0/iuZ7MVWXRjBcgQMhMYSdfZpSVEdFKcFz2HDxA==} + '@oxlint/linux-arm64-musl@1.30.0': + resolution: {integrity: sha512-szb5RB8Tbk756/z/GAdmUn+H1E2815BbcM7s6JZYQgyCJxR0RCL1yFXgKyz3BjIDqzR98Tw8H3g4TeJbN2etAg==} cpu: [arm64] os: [linux] - '@oxlint/linux-x64-gnu@1.25.0': - resolution: {integrity: sha512-xVkmk/zkIulc5o0OUWY04DyBfKotnq9+60O9I5c0DpdKAELVLhZkLmct0apx3jAX6Z/3yYPzhc6Lw1Ia3jU3VQ==} + '@oxlint/linux-x64-gnu@1.30.0': + resolution: {integrity: sha512-yOWGu4a82yA8xLusaznW41IF5ZkvBNz/U++M2/tCYAQUoJKSfJuAS5AhApRMKZLKeX0Vmdagh0YwvC+e98QG0w==} cpu: [x64] os: [linux] - '@oxlint/linux-x64-musl@1.25.0': - resolution: {integrity: sha512-IeO10dZosJV58YzN0gckhRYac+FM9s5VCKUx2ghgbKR91z/bpSRcRl8Sy5cWTkcVwu3ZTikhK8aXC6j7XIqKNw==} + '@oxlint/linux-x64-musl@1.30.0': + resolution: {integrity: sha512-qL1902VF4EMTZTZdJEIzzUQ+UD0IbH+IW6dhYZXbP9nTXJnItW1fk4cyJq5zfUVu1IoVwKK2FP1jUMqEsBlWTw==} cpu: [x64] os: [linux] - '@oxlint/win32-arm64@1.25.0': - resolution: {integrity: sha512-mpdiXZm2oNuSQAbTEPRDuSeR6v1DCD7Cl/xouR2ggHZu3AKZ4XYmm29hyrzIxrYVoQ/5j+182TGdOpGYn9xQJg==} + '@oxlint/win32-arm64@1.30.0': + resolution: {integrity: sha512-QK6C1djHKI7g1l5g6W9vkz9sd+sn1QJe6PbaV2sWFjVVoT0tO6LWygVWaci09ZHYVJ+lnCbbaFEgZ9jQhIs05A==} cpu: [arm64] os: [win32] - '@oxlint/win32-x64@1.25.0': - resolution: {integrity: sha512-opoIACOkcFloWQO6dubBLbcWwW52ML8+3deFdr0WE0PeM9UXdLB0jRMuLsEnplmBoy9TRvmxDJ+Pw8xc2PsOfQ==} + '@oxlint/win32-x64@1.30.0': + resolution: {integrity: sha512-tbPnJIBUKke9KpceV+DpGyfN3LdhGaEPJHSuD4/mUEwP9Kk6IKSoDNih681RVGhgvaEZg3uHmQr6n9Uh0P3Yrg==} cpu: [x64] os: [win32] @@ -1770,6 +1813,11 @@ packages: asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + atlassian-jwt@2.0.3: + resolution: {integrity: sha512-G9oO3HHS1UKgsLRXj6nNKv2TY6g3PleBCdzHwbFeVKg+18GBFIMRz+ApxuOuWAgcL7RngNFF5rGNtw1Ss3hvTg==} + engines: {node: '>= 0.4.0'} + deprecated: 'DEPRECATED: atlassian-jwt has moved to @atlassian/atlassian-jwt. The latest version is 2.1.1. Please update your dependency.' + available-typed-arrays@1.0.7: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} @@ -2297,8 +2345,8 @@ packages: peerDependencies: eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 - eslint-plugin-oxlint@1.25.0: - resolution: {integrity: sha512-grS4KdR9FAxoQC+wMkepeQHL4osMhoYfUI11Pot6Gitqr4wWi+JZrX0Shr8Bs9fjdWhEjtaZIV6cr4mbfytmyw==} + eslint-plugin-oxlint@1.30.0: + resolution: {integrity: sha512-agkV2OauZuFWLFNuG5/EunH4IwUcd/eyUbBE/Y9SAKvvvdMmY066IX09Uz2/3a/qdQ00LaL+lEAbP12eA19qJQ==} eslint-plugin-prettier@5.5.4: resolution: {integrity: sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==} @@ -2911,6 +2959,9 @@ packages: peerDependencies: ws: '*' + jira.js@2.20.1: + resolution: {integrity: sha512-ZFlFAVTEaw86OemQ8BVyVSV0YDZqMI6WVc08Th5GgqVEODW4gmhXLOxqSmCasRJMMVAtI1LrFlFFTf9GnFaUhg==} + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -2997,6 +3048,9 @@ packages: resolution: {integrity: sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==} engines: {node: '>=12', npm: '>=6'} + jsuri@1.3.1: + resolution: {integrity: sha512-LLdAeqOf88/X0hylAI7oSir6QUsz/8kOW0FcJzzu/SJRfORA/oPHycAOthkNp7eLPlTAbqVDFbqNRHkRVzEA3g==} + jwa@1.4.2: resolution: {integrity: sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==} @@ -3028,8 +3082,8 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} - lint-staged@16.2.6: - resolution: {integrity: sha512-s1gphtDbV4bmW1eylXpVMk2u7is7YsrLl8hzrtvC70h4ByhcMLZFY01Fx05ZUDNuv1H8HO4E+e2zgejV1jVwNw==} + lint-staged@16.2.7: + resolution: {integrity: sha512-lDIj4RnYmK7/kXMya+qJsmkRFkGolciXjrsZ6PC25GdTfWOAWetR0ZbsNXRAj1EHHImRSalc+whZFg56F5DVow==} engines: {node: '>=20.17'} hasBin: true @@ -3289,6 +3343,9 @@ packages: resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + oauth@0.10.2: + resolution: {integrity: sha512-JtFnB+8nxDEXgNyniwz573xxbKSOu3R8D40xQKqcjwJ2CDkYqUDI53o6IuzDJBx60Z8VKCm271+t8iFjakrl8Q==} + object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -3360,12 +3417,12 @@ packages: resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} engines: {node: '>= 0.4'} - oxlint@1.25.0: - resolution: {integrity: sha512-O6iJ9xeuy9eQCi8/EghvsNO6lzSaUPs0FR1uLy51Exp3RkVpjvJKyPPhd9qv65KLnfG/BNd2HE/rH0NbEfVVzA==} + oxlint@1.30.0: + resolution: {integrity: sha512-6Mcpj7Gn26QNRUpue9kRZKQg623mH10kLPl597sNCOfXeUZHTglrc2O54eskHMRA+tR7c0u73nW4GPwSFePLkA==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: - oxlint-tsgolint: '>=0.4.0' + oxlint-tsgolint: '>=0.8.1' peerDependenciesMeta: oxlint-tsgolint: optional: true @@ -4907,12 +4964,12 @@ snapshots: - encoding - utf-8-validate - '@botpress/cli@4.26.0(@bpinternal/zui@1.2.2)': + '@botpress/cli@4.27.3(@bpinternal/zui@1.2.2)': dependencies: '@apidevtools/json-schema-ref-parser': 11.9.3 '@botpress/chat': 0.5.4 - '@botpress/client': 1.27.1 - '@botpress/sdk': 4.20.0(@bpinternal/zui@1.2.2)(esbuild@0.25.12) + '@botpress/client': 1.27.2 + '@botpress/sdk': 4.20.2(@bpinternal/zui@1.2.2)(esbuild@0.25.12) '@bpinternal/const': 0.1.2 '@bpinternal/tunnel': 0.1.25 '@bpinternal/verel': 0.2.0 @@ -4923,7 +4980,7 @@ snapshots: '@stoplight/spectral-parsers': 1.0.5 '@types/lodash': 4.17.20 '@types/verror': 1.10.11 - axios: 1.13.1 + axios: 1.13.2 bluebird: 3.7.2 boxen: 5.1.2 chalk: 4.1.2 @@ -4947,8 +5004,8 @@ snapshots: '@botpress/client@0.41.0': dependencies: - axios: 1.13.1 - axios-retry: 4.5.0(axios@1.13.1) + axios: 1.13.2 + axios-retry: 4.5.0(axios@1.13.2) browser-or-node: 2.1.1 qs: 6.14.0 type-fest: 3.13.1 @@ -4957,8 +5014,8 @@ snapshots: '@botpress/client@1.15.2': dependencies: - axios: 1.13.1 - axios-retry: 4.5.0(axios@1.13.1) + axios: 1.13.2 + axios-retry: 4.5.0(axios@1.13.2) browser-or-node: 2.1.1 qs: 6.14.0 transitivePeerDependencies: @@ -4991,6 +5048,15 @@ snapshots: transitivePeerDependencies: - debug + '@botpress/client@1.24.1': + dependencies: + axios: 1.13.2 + axios-retry: 4.5.0(axios@1.13.2) + browser-or-node: 2.1.1 + qs: 6.14.0 + transitivePeerDependencies: + - debug + '@botpress/client@1.27.1': dependencies: axios: 1.13.2 @@ -5000,6 +5066,15 @@ snapshots: transitivePeerDependencies: - debug + '@botpress/client@1.27.2': + dependencies: + axios: 1.13.2 + axios-retry: 4.5.0(axios@1.13.2) + browser-or-node: 2.1.1 + qs: 6.14.0 + transitivePeerDependencies: + - debug + '@botpress/sdk@4.13.0(@bpinternal/zui@1.2.2)(esbuild@0.16.17)': dependencies: '@botpress/client': 1.16.1 @@ -5020,9 +5095,19 @@ snapshots: transitivePeerDependencies: - debug - '@botpress/sdk@4.20.0(@bpinternal/zui@1.2.2)(esbuild@0.25.12)': + '@botpress/sdk@4.15.6(@bpinternal/zui@1.2.2)(esbuild@0.16.17)': + dependencies: + '@botpress/client': 1.24.1 + '@bpinternal/zui': 1.2.2 + browser-or-node: 2.1.1 + optionalDependencies: + esbuild: 0.16.17 + transitivePeerDependencies: + - debug + + '@botpress/sdk@4.20.2(@bpinternal/zui@1.2.2)(esbuild@0.25.12)': dependencies: - '@botpress/client': 1.27.1 + '@botpress/client': 1.27.2 '@bpinternal/zui': 1.2.2 browser-or-node: 2.1.1 semver: 7.7.3 @@ -5408,28 +5493,28 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.19.1 - '@oxlint/darwin-arm64@1.25.0': + '@oxlint/darwin-arm64@1.30.0': optional: true - '@oxlint/darwin-x64@1.25.0': + '@oxlint/darwin-x64@1.30.0': optional: true - '@oxlint/linux-arm64-gnu@1.25.0': + '@oxlint/linux-arm64-gnu@1.30.0': optional: true - '@oxlint/linux-arm64-musl@1.25.0': + '@oxlint/linux-arm64-musl@1.30.0': optional: true - '@oxlint/linux-x64-gnu@1.25.0': + '@oxlint/linux-x64-gnu@1.30.0': optional: true - '@oxlint/linux-x64-musl@1.25.0': + '@oxlint/linux-x64-musl@1.30.0': optional: true - '@oxlint/win32-arm64@1.25.0': + '@oxlint/win32-arm64@1.30.0': optional: true - '@oxlint/win32-x64@1.25.0': + '@oxlint/win32-x64@1.30.0': optional: true '@paralleldrive/cuid2@2.3.1': @@ -6354,7 +6439,7 @@ snapshots: '@crawlee/types': 3.15.2 agentkeepalive: 4.6.0 async-retry: 1.3.3 - axios: 1.13.1 + axios: 1.13.2 content-type: 1.0.5 ow: 0.28.2 tslib: 2.8.1 @@ -6442,6 +6527,11 @@ snapshots: asynckit@0.4.0: {} + atlassian-jwt@2.0.3: + dependencies: + jsuri: 1.3.1 + lodash: 4.17.21 + available-typed-arrays@1.0.7: dependencies: possible-typed-array-names: 1.1.0 @@ -7117,7 +7207,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-oxlint@1.25.0: + eslint-plugin-oxlint@1.30.0: dependencies: jsonc-parser: 3.3.1 @@ -7774,6 +7864,16 @@ snapshots: dependencies: ws: 8.18.3 + jira.js@2.20.1: + dependencies: + atlassian-jwt: 2.0.3 + axios: 1.13.2 + form-data: 4.0.4 + oauth: 0.10.2 + tslib: 2.8.1 + transitivePeerDependencies: + - debug + js-tokens@4.0.0: {} js-tokens@9.0.1: {} @@ -7877,6 +7977,8 @@ snapshots: ms: 2.1.3 semver: 7.7.3 + jsuri@1.3.1: {} + jwa@1.4.2: dependencies: buffer-equal-constant-time: 1.0.1 @@ -7911,7 +8013,7 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - lint-staged@16.2.6: + lint-staged@16.2.7: dependencies: commander: 14.0.2 listr2: 9.0.5 @@ -8131,6 +8233,8 @@ snapshots: dependencies: path-key: 4.0.0 + oauth@0.10.2: {} + object-assign@4.1.1: {} object-inspect@1.13.4: {} @@ -8226,16 +8330,16 @@ snapshots: object-keys: 1.1.1 safe-push-apply: 1.0.0 - oxlint@1.25.0: + oxlint@1.30.0: optionalDependencies: - '@oxlint/darwin-arm64': 1.25.0 - '@oxlint/darwin-x64': 1.25.0 - '@oxlint/linux-arm64-gnu': 1.25.0 - '@oxlint/linux-arm64-musl': 1.25.0 - '@oxlint/linux-x64-gnu': 1.25.0 - '@oxlint/linux-x64-musl': 1.25.0 - '@oxlint/win32-arm64': 1.25.0 - '@oxlint/win32-x64': 1.25.0 + '@oxlint/darwin-arm64': 1.30.0 + '@oxlint/darwin-x64': 1.30.0 + '@oxlint/linux-arm64-gnu': 1.30.0 + '@oxlint/linux-arm64-musl': 1.30.0 + '@oxlint/linux-x64-gnu': 1.30.0 + '@oxlint/linux-x64-musl': 1.30.0 + '@oxlint/win32-arm64': 1.30.0 + '@oxlint/win32-x64': 1.30.0 p-cancelable@1.1.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 779fd1d9..e15c2db5 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,3 +3,4 @@ packages: - 'integrations/apify' - 'integrations/zoom' - 'integrations/hubspot-help-desk-hitl' + - 'integrations/jira'