diff --git a/apps/backoffice-v2/CHANGELOG.md b/apps/backoffice-v2/CHANGELOG.md index dd28e156fa..82a0e0e189 100644 --- a/apps/backoffice-v2/CHANGELOG.md +++ b/apps/backoffice-v2/CHANGELOG.md @@ -1,5 +1,31 @@ # @ballerine/backoffice-v2 +## 0.7.95 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/workflow-browser-sdk@0.6.87 + - @ballerine/workflow-node-sdk@0.6.87 + - @ballerine/blocks@0.2.34 + - @ballerine/common@0.9.68 + - @ballerine/ui@0.5.67 + - @ballerine/react-pdf-toolkit@1.2.67 + +## 0.7.94 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/react-pdf-toolkit@1.2.66 + - @ballerine/workflow-browser-sdk@0.6.86 + - @ballerine/workflow-node-sdk@0.6.86 + - @ballerine/blocks@0.2.33 + - @ballerine/common@0.9.67 + - @ballerine/ui@0.5.66 + ## 0.7.93 ### Patch Changes diff --git a/apps/backoffice-v2/package.json b/apps/backoffice-v2/package.json index 4ff78aa076..3c7b17fef7 100644 --- a/apps/backoffice-v2/package.json +++ b/apps/backoffice-v2/package.json @@ -1,6 +1,6 @@ { "name": "@ballerine/backoffice-v2", - "version": "0.7.93", + "version": "0.7.95", "description": "Ballerine - Backoffice", "homepage": "https://github.com/ballerine-io/ballerine", "type": "module", @@ -52,12 +52,12 @@ "preview": "vite preview" }, "dependencies": { - "@ballerine/blocks": "0.2.32", - "@ballerine/common": "0.9.66", - "@ballerine/workflow-browser-sdk": "0.6.85", - "@ballerine/workflow-node-sdk": "0.6.85", - "@ballerine/react-pdf-toolkit": "^1.2.62", - "@ballerine/ui": "^0.5.62", + "@ballerine/blocks": "0.2.34", + "@ballerine/common": "0.9.68", + "@ballerine/workflow-browser-sdk": "0.6.87", + "@ballerine/workflow-node-sdk": "0.6.87", + "@ballerine/react-pdf-toolkit": "^1.2.67", + "@ballerine/ui": "^0.5.67", "@botpress/webchat": "^2.1.10", "@botpress/webchat-generator": "^0.2.9", "@fontsource/inter": "^4.5.15", @@ -152,8 +152,8 @@ "zod": "^3.23.4" }, "devDependencies": { - "@ballerine/config": "^1.1.30", - "@ballerine/eslint-config-react": "^2.0.30", + "@ballerine/config": "^1.1.32", + "@ballerine/eslint-config-react": "^2.0.32", "@cspell/cspell-types": "^6.31.1", "@faker-js/faker": "^7.6.0", "@playwright/test": "^1.32.1", diff --git a/apps/backoffice-v2/src/lib/blocks/hooks/useKybRegistryInfoBlock/useKybRegistryInfoBlock.tsx b/apps/backoffice-v2/src/lib/blocks/hooks/useKybRegistryInfoBlock/useKybRegistryInfoBlock.tsx index d4caae4bc7..f6d0db9e24 100644 --- a/apps/backoffice-v2/src/lib/blocks/hooks/useKybRegistryInfoBlock/useKybRegistryInfoBlock.tsx +++ b/apps/backoffice-v2/src/lib/blocks/hooks/useKybRegistryInfoBlock/useKybRegistryInfoBlock.tsx @@ -4,6 +4,11 @@ import { createBlocksTyped } from '@/lib/blocks/create-blocks-typed/create-block import { WarningFilledSvg } from '@ballerine/ui'; export const useKybRegistryInfoBlock = ({ pluginsOutput, workflow }) => { + const isBankAccountVerification = useMemo( + () => !!pluginsOutput?.bankAccountVerification, + [pluginsOutput?.bankAccountVerification], + ); + const getCell = useCallback(() => { if (Object.keys(pluginsOutput?.businessInformation?.data?.[0] ?? {}).length) { return { @@ -28,6 +33,39 @@ export const useKybRegistryInfoBlock = ({ pluginsOutput, workflow }) => { >; } + if (Object.keys(pluginsOutput?.bankAccountVerification?.clientResponsePayload ?? {}).length) { + const data = { + ...pluginsOutput?.bankAccountVerification?.responseHeader.overallResponse, + decisionElements: + pluginsOutput?.bankAccountVerification?.clientResponsePayload.decisionElements, + orchestrationDecisions: + pluginsOutput?.bankAccountVerification?.clientResponsePayload.orchestrationDecisions, + }; + + return { + id: 'nested-details', + type: 'details', + hideSeparator: true, + value: { + data: Object.entries(data) + ?.filter(([property]) => { + console.log(property); + + return !['tenantID', 'clientReferenceId'].includes(property); + }) + .map(([title, value]) => ({ + title, + value, + })), + }, + } satisfies Extract< + Parameters['addCell']>[0], + { + type: 'details'; + } + >; + } + const message = pluginsOutput?.businessInformation?.message ?? pluginsOutput?.businessInformation?.data?.message; @@ -94,12 +132,12 @@ export const useKybRegistryInfoBlock = ({ pluginsOutput, workflow }) => { .addCell({ id: 'nested-details-heading', type: 'heading', - value: 'Registry Information', + value: isBankAccountVerification ? 'Bank Account Verification' : 'Registry Information', }) .addCell({ id: 'nested-details-subheading', type: 'subheading', - value: 'Registry-Provided Data', + value: `${isBankAccountVerification ? 'Experian' : 'Registry'}-Provided Data`, props: { className: 'mb-4', }, diff --git a/apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useDefaultBlocksLogic/useDefaultBlocksLogic.tsx b/apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useDefaultBlocksLogic/useDefaultBlocksLogic.tsx index b89381528c..7a46eaab6d 100644 --- a/apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useDefaultBlocksLogic/useDefaultBlocksLogic.tsx +++ b/apps/backoffice-v2/src/lib/blocks/variants/DefaultBlocks/hooks/useDefaultBlocksLogic/useDefaultBlocksLogic.tsx @@ -133,9 +133,7 @@ export const useDefaultBlocksLogic = () => { ...entityDataAdditionalInfo } = workflow?.context?.entity?.data?.additionalInfo ?? {}; const { website: websiteBasicRequirement, processingDetails, ...storeInfo } = store ?? {}; - const kycChildWorkflows = workflow?.childWorkflows?.filter( - childWorkflow => childWorkflow?.context?.entity?.type === 'individual', - ); + const kybChildWorkflows = workflow?.childWorkflows?.filter( childWorkflow => childWorkflow?.context?.entity?.type === 'business', ); diff --git a/apps/kyb-app/CHANGELOG.md b/apps/kyb-app/CHANGELOG.md index 0ac62969e7..66211e79c8 100644 --- a/apps/kyb-app/CHANGELOG.md +++ b/apps/kyb-app/CHANGELOG.md @@ -1,5 +1,15 @@ # kyb-app +## 0.3.114 + +### Patch Changes + +- Updated dependencies + - @ballerine/workflow-browser-sdk@0.6.87 + - @ballerine/blocks@0.2.34 + - @ballerine/common@0.9.68 + - @ballerine/ui@0.5.67 + ## 0.3.113 ### Patch Changes diff --git a/apps/kyb-app/package.json b/apps/kyb-app/package.json index 661aff39e1..2c9a38c4c3 100644 --- a/apps/kyb-app/package.json +++ b/apps/kyb-app/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/kyb-app", "private": true, - "version": "0.3.113", + "version": "0.3.114", "type": "module", "scripts": { "dev": "vite", @@ -16,10 +16,10 @@ "test:dev": "vitest" }, "dependencies": { - "@ballerine/blocks": "0.2.32", - "@ballerine/common": "^0.9.66", - "@ballerine/workflow-browser-sdk": "0.6.85", - "@ballerine/ui": "0.5.66", + "@ballerine/blocks": "0.2.34", + "@ballerine/common": "^0.9.68", + "@ballerine/workflow-browser-sdk": "0.6.87", + "@ballerine/ui": "0.5.67", "@lukemorales/query-key-factory": "^1.0.3", "@radix-ui/react-icons": "^1.3.0", "@rjsf/core": "^5.9.0", @@ -65,8 +65,8 @@ "zod": "^3.23.4" }, "devDependencies": { - "@ballerine/config": "^1.1.30", - "@ballerine/eslint-config-react": "^2.0.30", + "@ballerine/config": "^1.1.32", + "@ballerine/eslint-config-react": "^2.0.32", "@jest/globals": "^29.7.0", "@sentry/vite-plugin": "^2.9.0", "@testing-library/jest-dom": "^6.1.4", diff --git a/apps/workflows-dashboard/CHANGELOG.md b/apps/workflows-dashboard/CHANGELOG.md index 9a3c129d45..d4678ef829 100644 --- a/apps/workflows-dashboard/CHANGELOG.md +++ b/apps/workflows-dashboard/CHANGELOG.md @@ -1,5 +1,23 @@ # @ballerine/workflows-dashboard +## 0.2.32 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/common@0.9.68 + - @ballerine/ui@0.5.67 + +## 0.2.31 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/common@0.9.67 + - @ballerine/ui@0.5.66 + ## 0.2.30 ### Patch Changes diff --git a/apps/workflows-dashboard/package.json b/apps/workflows-dashboard/package.json index d809abe671..8a7a4f6cd3 100644 --- a/apps/workflows-dashboard/package.json +++ b/apps/workflows-dashboard/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/workflows-dashboard", "private": false, - "version": "0.2.30", + "version": "0.2.32", "type": "module", "scripts": { "spellcheck": "cspell \"*\"", @@ -16,8 +16,8 @@ "test": "NODE_ENV=test jest" }, "dependencies": { - "@ballerine/common": "^0.9.66", - "@ballerine/ui": "^0.5.62", + "@ballerine/common": "^0.9.68", + "@ballerine/ui": "^0.5.67", "@lukemorales/query-key-factory": "^1.0.3", "@radix-ui/react-avatar": "^1.0.3", "@radix-ui/react-dialog": "1.0.4", @@ -64,8 +64,8 @@ "zod": "^3.22.3" }, "devDependencies": { - "@ballerine/config": "^1.1.30", - "@ballerine/eslint-config-react": "^2.0.30", + "@ballerine/config": "^1.1.32", + "@ballerine/eslint-config-react": "^2.0.32", "@cspell/cspell-types": "^6.31.1", "@types/axios": "^0.14.0", "@types/classnames": "^2.3.1", diff --git a/examples/headless-example/CHANGELOG.md b/examples/headless-example/CHANGELOG.md index 495f767a2e..704624f77c 100644 --- a/examples/headless-example/CHANGELOG.md +++ b/examples/headless-example/CHANGELOG.md @@ -1,5 +1,23 @@ # @ballerine/headless-example +## 0.3.86 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/workflow-browser-sdk@0.6.87 + - @ballerine/common@0.9.68 + +## 0.3.85 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/workflow-browser-sdk@0.6.86 + - @ballerine/common@0.9.67 + ## 0.3.84 ### Patch Changes diff --git a/examples/headless-example/package.json b/examples/headless-example/package.json index 7ae317c9f1..75e19648f9 100644 --- a/examples/headless-example/package.json +++ b/examples/headless-example/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/headless-example", "private": true, - "version": "0.3.84", + "version": "0.3.86", "type": "module", "scripts": { "spellcheck": "cspell \"*\"", @@ -34,8 +34,8 @@ "vite": "^4.5.3" }, "dependencies": { - "@ballerine/common": "0.9.66", - "@ballerine/workflow-browser-sdk": "0.6.85", + "@ballerine/common": "0.9.68", + "@ballerine/workflow-browser-sdk": "0.6.87", "@felte/reporter-svelte": "^1.1.5", "@felte/validator-zod": "^1.0.13", "@fontsource/inter": "^4.5.15", diff --git a/examples/report-generation-example/CHANGELOG.md b/examples/report-generation-example/CHANGELOG.md index a48e5ebaad..3f6733e320 100644 --- a/examples/report-generation-example/CHANGELOG.md +++ b/examples/report-generation-example/CHANGELOG.md @@ -1,5 +1,20 @@ # @ballerine/report-generation-example +## 0.2.31 + +### Patch Changes + +- version bump + - @ballerine/react-pdf-toolkit@1.2.67 + +## 0.2.30 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/react-pdf-toolkit@1.2.66 + ## 0.2.29 ### Patch Changes diff --git a/examples/report-generation-example/package.json b/examples/report-generation-example/package.json index 67121b0cf7..1a266ddd1e 100644 --- a/examples/report-generation-example/package.json +++ b/examples/report-generation-example/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/report-generation-example", "private": false, - "version": "0.2.29", + "version": "0.2.31", "type": "module", "scripts": { "dev": "vite", @@ -10,7 +10,7 @@ "preview": "vite preview" }, "dependencies": { - "@ballerine/react-pdf-toolkit": "^1.2.62", + "@ballerine/react-pdf-toolkit": "^1.2.67", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/packages/blocks/CHANGELOG.md b/packages/blocks/CHANGELOG.md index 73c7077eeb..b20268faa3 100644 --- a/packages/blocks/CHANGELOG.md +++ b/packages/blocks/CHANGELOG.md @@ -1,5 +1,21 @@ # @ballerine/blocks +## 0.2.34 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/common@0.9.68 + +## 0.2.33 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/common@0.9.67 + ## 0.2.32 ### Patch Changes diff --git a/packages/blocks/package.json b/packages/blocks/package.json index cd1865f91f..02a176f5f6 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -2,7 +2,7 @@ "private": false, "name": "@ballerine/blocks", "author": "Ballerine ", - "version": "0.2.32", + "version": "0.2.34", "description": "blocks", "module": "./dist/esm/index.js", "main": "./dist/cjs/index.js", @@ -42,8 +42,8 @@ "@babel/preset-env": "7.16.11", "@babel/preset-react": "^7.22.5", "@babel/preset-typescript": "7.16.7", - "@ballerine/config": "^1.1.30", - "@ballerine/eslint-config": "^1.1.30", + "@ballerine/config": "^1.1.32", + "@ballerine/eslint-config": "^1.1.32", "@rollup/plugin-babel": "5.3.1", "@rollup/plugin-commonjs": "^24.0.1", "@rollup/plugin-json": "^6.0.0", @@ -91,6 +91,6 @@ "vitest": "^0.33.0" }, "dependencies": { - "@ballerine/common": "^0.9.66" + "@ballerine/common": "^0.9.68" } } diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md index 5a4e2f58b1..a6774e71ef 100644 --- a/packages/common/CHANGELOG.md +++ b/packages/common/CHANGELOG.md @@ -1,5 +1,17 @@ # @ballerine/common +## 0.9.68 + +### Patch Changes + +- version bump + +## 0.9.67 + +### Patch Changes + +- version bump + ## 0.9.66 ### Patch Changes diff --git a/packages/common/package.json b/packages/common/package.json index bb3343a6b3..255f727c7a 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -2,7 +2,7 @@ "private": false, "name": "@ballerine/common", "author": "Ballerine ", - "version": "0.9.66", + "version": "0.9.68", "description": "common", "module": "./dist/esm/index.js", "main": "./dist/cjs/index.js", @@ -38,8 +38,8 @@ "@babel/core": "7.17.9", "@babel/preset-env": "7.16.11", "@babel/preset-typescript": "7.16.7", - "@ballerine/config": "^1.1.30", - "@ballerine/eslint-config": "^1.1.30", + "@ballerine/config": "^1.1.32", + "@ballerine/eslint-config": "^1.1.32", "@cspell/cspell-types": "^6.31.1", "@rollup/plugin-babel": "5.3.1", "@rollup/plugin-commonjs": "^24.0.1", diff --git a/packages/config/CHANGELOG.md b/packages/config/CHANGELOG.md index ca280a1158..9fbde6fa25 100644 --- a/packages/config/CHANGELOG.md +++ b/packages/config/CHANGELOG.md @@ -1,5 +1,17 @@ # @ballerine/config +## 1.1.32 + +### Patch Changes + +- version bump + +## 1.1.31 + +### Patch Changes + +- version bump + ## 1.1.30 ### Patch Changes diff --git a/packages/config/package.json b/packages/config/package.json index ad87c1571b..6e9584fa2d 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,7 +1,7 @@ { "private": false, "name": "@ballerine/config", - "version": "1.1.30", + "version": "1.1.32", "description": "", "main": "index.js", "scripts": {}, diff --git a/packages/eslint-config-react/CHANGELOG.md b/packages/eslint-config-react/CHANGELOG.md index 53d3ddde0c..16b9607e83 100644 --- a/packages/eslint-config-react/CHANGELOG.md +++ b/packages/eslint-config-react/CHANGELOG.md @@ -1,5 +1,21 @@ # @ballerine/eslint-config-react +## 2.0.32 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/eslint-config@1.1.32 + +## 2.0.31 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/eslint-config@1.1.31 + ## 2.0.30 ### Patch Changes diff --git a/packages/eslint-config-react/package.json b/packages/eslint-config-react/package.json index 51213578b4..a596682b4d 100644 --- a/packages/eslint-config-react/package.json +++ b/packages/eslint-config-react/package.json @@ -1,7 +1,7 @@ { "private": false, "name": "@ballerine/eslint-config-react", - "version": "2.0.30", + "version": "2.0.32", "description": "", "main": "index.js", "scripts": {}, @@ -10,7 +10,7 @@ "license": "ISC", "peerDependencies": { "eslint-plugin-react": "^7.33.2", - "@ballerine/eslint-config": "^1.1.30", + "@ballerine/eslint-config": "^1.1.32", "eslint-plugin-react-hooks": "^4.6.0" } } diff --git a/packages/eslint-config/CHANGELOG.md b/packages/eslint-config/CHANGELOG.md index bf64b2d012..df3beea417 100644 --- a/packages/eslint-config/CHANGELOG.md +++ b/packages/eslint-config/CHANGELOG.md @@ -1,5 +1,17 @@ # @ballerine/eslint-config +## 1.1.32 + +### Patch Changes + +- version bump + +## 1.1.31 + +### Patch Changes + +- version bump + ## 1.1.30 ### Patch Changes diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index d93169ce2d..91c164ee0e 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -1,7 +1,7 @@ { "private": false, "name": "@ballerine/eslint-config", - "version": "1.1.30", + "version": "1.1.32", "description": "", "main": "index.js", "scripts": {}, diff --git a/packages/react-pdf-toolkit/CHANGELOG.md b/packages/react-pdf-toolkit/CHANGELOG.md index 71cc487478..f1a26da8b6 100644 --- a/packages/react-pdf-toolkit/CHANGELOG.md +++ b/packages/react-pdf-toolkit/CHANGELOG.md @@ -1,5 +1,13 @@ # @ballerine/react-pdf-toolkit +## 1.2.67 + +### Patch Changes + +- Updated dependencies + - @ballerine/config@1.1.32 + - @ballerine/ui@0.5.67 + ## 1.2.66 ### Patch Changes diff --git a/packages/react-pdf-toolkit/package.json b/packages/react-pdf-toolkit/package.json index bfc9431efe..17cc03ad68 100644 --- a/packages/react-pdf-toolkit/package.json +++ b/packages/react-pdf-toolkit/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/react-pdf-toolkit", "private": false, - "version": "1.2.66", + "version": "1.2.67", "types": "./dist/build.d.ts", "main": "./dist/react-pdf-toolkit.js", "module": "./dist/react-pdf-toolkit.mjs", @@ -26,8 +26,8 @@ "build-storybook": "storybook build" }, "dependencies": { - "@ballerine/config": "^1.1.30", - "@ballerine/ui": "0.5.66", + "@ballerine/config": "^1.1.32", + "@ballerine/ui": "0.5.67", "@react-pdf/renderer": "^3.1.14", "@sinclair/typebox": "^0.31.7", "ajv": "^8.12.0", diff --git a/packages/rules-engine/CHANGELOG.md b/packages/rules-engine/CHANGELOG.md index f08b0ce096..21f147ec91 100644 --- a/packages/rules-engine/CHANGELOG.md +++ b/packages/rules-engine/CHANGELOG.md @@ -1,5 +1,17 @@ # @ballerine/rules-engine-lib +## 0.5.32 + +### Patch Changes + +- version bump + +## 0.5.31 + +### Patch Changes + +- version bump + ## 0.5.30 ### Patch Changes diff --git a/packages/rules-engine/package.json b/packages/rules-engine/package.json index e4454422e0..209d318e16 100644 --- a/packages/rules-engine/package.json +++ b/packages/rules-engine/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/rules-engine-lib", "author": "Ballerine ", - "version": "0.5.30", + "version": "0.5.32", "description": "rules-engine-lib", "module": "./dist/esm/index.js", "main": "./dist/cjs/index.js", @@ -34,9 +34,9 @@ "@babel/core": "7.17.9", "@babel/preset-env": "7.16.11", "@babel/preset-typescript": "7.16.7", - "@ballerine/config": "^1.1.30", + "@ballerine/config": "^1.1.32", "@cspell/cspell-types": "^6.31.1", - "@ballerine/eslint-config": "^1.1.30", + "@ballerine/eslint-config": "^1.1.32", "@rollup/plugin-babel": "5.3.1", "@rollup/plugin-commonjs": "^24.0.1", "@rollup/plugin-node-resolve": "13.2.1", diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 3cd9da8440..32b7684f44 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,13 @@ # @ballerine/ui +## 0.5.67 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/common@0.9.68 + ## 0.5.66 ### Patch Changes diff --git a/packages/ui/package.json b/packages/ui/package.json index 573d5652fe..6085b2c635 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/ui", "private": false, - "version": "0.5.66", + "version": "0.5.67", "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -27,7 +27,7 @@ "test": "vitest run" }, "dependencies": { - "@ballerine/common": "^0.9.66", + "@ballerine/common": "^0.9.68", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@mui/material": "^5.14.2", @@ -68,8 +68,8 @@ "zod": "^3.23.4" }, "devDependencies": { - "@ballerine/config": "^1.1.30", - "@ballerine/eslint-config-react": "^2.0.30", + "@ballerine/config": "^1.1.32", + "@ballerine/eslint-config-react": "^2.0.32", "@cspell/cspell-types": "^6.31.1", "@storybook/addon-essentials": "^7.0.26", "@storybook/addon-interactions": "^7.0.26", diff --git a/packages/ui/src/components/atoms/Tooltip/Tooltip.tsx b/packages/ui/src/components/atoms/Tooltip/Tooltip.tsx index f5ebc914ca..5063be788b 100644 --- a/packages/ui/src/components/atoms/Tooltip/Tooltip.tsx +++ b/packages/ui/src/components/atoms/Tooltip/Tooltip.tsx @@ -18,7 +18,7 @@ const TooltipContent = React.forwardRef< ref={ref} sideOffset={sideOffset} className={ctw( - 'z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', + 'bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md px-3 py-1.5 text-xs', className, )} {...props} diff --git a/packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx b/packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx index 1d296ffe6e..a8168f35d0 100644 --- a/packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx +++ b/packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx @@ -277,7 +277,7 @@ export const WebsiteCredibility: FunctionComponent<{ ( - + {Intl.NumberFormat('en').format(Number(value))} )} diff --git a/packages/workflow-core/CHANGELOG.md b/packages/workflow-core/CHANGELOG.md index dadd4b45a8..f5ce815677 100644 --- a/packages/workflow-core/CHANGELOG.md +++ b/packages/workflow-core/CHANGELOG.md @@ -1,5 +1,21 @@ # @ballerine/workflow-core +## 0.6.87 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/common@0.9.68 + +## 0.6.86 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/common@0.9.67 + ## 0.6.85 ### Patch Changes diff --git a/packages/workflow-core/package.json b/packages/workflow-core/package.json index c6b888dcfc..50efaa154d 100644 --- a/packages/workflow-core/package.json +++ b/packages/workflow-core/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/workflow-core", "author": "Ballerine ", - "version": "0.6.85", + "version": "0.6.87", "description": "workflow-core", "module": "./dist/esm/index.js", "main": "./dist/cjs/index.js", @@ -31,7 +31,7 @@ "node": ">=12" }, "dependencies": { - "@ballerine/common": "0.9.66", + "@ballerine/common": "0.9.68", "ajv": "^8.12.0", "country-state-city": "^3.1.4", "i18n-iso-countries": "^7.6.0", @@ -48,8 +48,8 @@ "@babel/core": "7.17.9", "@babel/preset-env": "7.16.11", "@babel/preset-typescript": "7.16.7", - "@ballerine/config": "^1.1.30", - "@ballerine/eslint-config": "^1.1.30", + "@ballerine/config": "^1.1.32", + "@ballerine/eslint-config": "^1.1.32", "@cspell/cspell-types": "^6.31.1", "@rollup/plugin-babel": "5.3.1", "@rollup/plugin-commonjs": "^24.0.1", diff --git a/packages/workflow-core/src/lib/constants.ts b/packages/workflow-core/src/lib/constants.ts index a9a567b593..56ac2038cd 100644 --- a/packages/workflow-core/src/lib/constants.ts +++ b/packages/workflow-core/src/lib/constants.ts @@ -6,9 +6,10 @@ import { EmailPlugin } from './plugins/external-plugin/email-plugin'; import { MastercardMerchantScreeningPlugin } from './plugins/external-plugin/mastercard-merchant-screening-plugin'; import { ObjectValues } from './types'; import { BALLERINE_API_PLUGINS } from './plugins/external-plugin/vendor-consts'; -import { BallerineApiPlugin } from './plugins/external-plugin/ballerine-plugin'; +import { BallerineApiPlugin } from './plugins/external-plugin/ballerine-api-plugin'; import { BallerineEmailPlugin } from './plugins/external-plugin/ballerine-email-plugin'; import { IndividualsSanctionsV2Plugin } from './plugins/external-plugin/individuals-sanctions-v2-plugin/individuals-sanctions-v2-plugin'; +import { BankAccountVerificationPlugin } from './plugins/external-plugin/bank-account-verification-plugin/bank-account-verification-plugin'; export const PluginKind = { KYC: 'kyc', @@ -18,6 +19,7 @@ export const PluginKind = { EMAIL: 'email', MASTERCARD_MERCHANT_SCREENING: 'mastercard-merchant-screening', INDIVIDUAL_SANCTIONS_V2: 'individual-sanctions-v2', + BANK_ACCOUNT_VERIFICATION: 'bank-account-verification', } as const; export const pluginsRegistry = { @@ -28,6 +30,7 @@ export const pluginsRegistry = { [PluginKind.EMAIL]: EmailPlugin, [PluginKind.MASTERCARD_MERCHANT_SCREENING]: MastercardMerchantScreeningPlugin, [PluginKind.INDIVIDUAL_SANCTIONS_V2]: IndividualsSanctionsV2Plugin, + [PluginKind.BANK_ACCOUNT_VERIFICATION]: BankAccountVerificationPlugin, [BALLERINE_API_PLUGINS['individual-sanctions']]: BallerineApiPlugin, [BALLERINE_API_PLUGINS['company-sanctions']]: BallerineApiPlugin, [BALLERINE_API_PLUGINS['ubo']]: BallerineApiPlugin, diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/api-plugin.test.ts b/packages/workflow-core/src/lib/plugins/external-plugin/api-plugin.test.ts index aa314cd271..02f2574396 100644 --- a/packages/workflow-core/src/lib/plugins/external-plugin/api-plugin.test.ts +++ b/packages/workflow-core/src/lib/plugins/external-plugin/api-plugin.test.ts @@ -82,6 +82,7 @@ describe('workflow-runner', () => { ).pluginsOutput, ).toEqual({ ballerineEnrichment: { + invokedAt: expect.any(Number), result: { companyInfo: { companyName: 'TestCorp Ltd', diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/api-plugin.ts b/packages/workflow-core/src/lib/plugins/external-plugin/api-plugin.ts index c785776e35..ba4562215f 100644 --- a/packages/workflow-core/src/lib/plugins/external-plugin/api-plugin.ts +++ b/packages/workflow-core/src/lib/plugins/external-plugin/api-plugin.ts @@ -1,7 +1,23 @@ import { AnyRecord, isErrorWithMessage, isObject } from '@ballerine/common'; + import { logger } from '../../logger'; -import { TContext, Transformer, Transformers, Validator } from '../../utils'; import { IApiPluginParams } from './types'; +import { + HelpersTransformer, + TContext, + THelperFormatingLogic, + Transformer, + Transformers, + Validator, +} from '../../utils'; + +const invokedAtTransformer: HelpersTransformer = new HelpersTransformer([ + { + source: 'invokedAt', + target: 'invokedAt', + method: 'setTimeToRecordUTC', + }, +] as THelperFormatingLogic); export class ApiPlugin { public static pluginType = 'http'; @@ -86,11 +102,10 @@ export class ApiPlugin { if (apiResponse.ok) { const result = await apiResponse.json(); - let responseBody = result as AnyRecord; - if (this.response?.transformers) { - responseBody = await this.transformData(this.response.transformers, result as AnyRecord); - } + const responseTransformers = [...(this.response?.transformers || []), invokedAtTransformer]; + + const responseBody = await this.transformData(responseTransformers, result as AnyRecord); const { isValidResponse, errorMessage } = await this.validateContent( this.response!.schemaValidator, diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/ballerine-plugin.ts b/packages/workflow-core/src/lib/plugins/external-plugin/ballerine-api-plugin.ts similarity index 100% rename from packages/workflow-core/src/lib/plugins/external-plugin/ballerine-plugin.ts rename to packages/workflow-core/src/lib/plugins/external-plugin/ballerine-api-plugin.ts diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/ballerine-email-plugin.ts b/packages/workflow-core/src/lib/plugins/external-plugin/ballerine-email-plugin.ts index a3bee24e56..62303ec88b 100644 --- a/packages/workflow-core/src/lib/plugins/external-plugin/ballerine-email-plugin.ts +++ b/packages/workflow-core/src/lib/plugins/external-plugin/ballerine-email-plugin.ts @@ -3,7 +3,7 @@ import { logger } from '../../logger'; import { IApiPluginParams } from './types'; import { ApiPlugin } from './api-plugin'; import { ApiEmailTemplates } from './vendor-consts'; -import { BallerineApiPlugin, IBallerineApiPluginParams } from './ballerine-plugin'; +import { BallerineApiPlugin, IBallerineApiPluginParams } from './ballerine-api-plugin'; export interface IBallerineEmailPluginParams { pluginKind: 'template-email'; diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/bank-account-verification-plugin/bank-account-verification-plugin.ts b/packages/workflow-core/src/lib/plugins/external-plugin/bank-account-verification-plugin/bank-account-verification-plugin.ts new file mode 100644 index 0000000000..dfca0b6faa --- /dev/null +++ b/packages/workflow-core/src/lib/plugins/external-plugin/bank-account-verification-plugin/bank-account-verification-plugin.ts @@ -0,0 +1,166 @@ +import { z } from 'zod'; +import { invariant } from 'outvariant'; +import { isErrorWithMessage, ProcessStatus } from '@ballerine/common'; + +import { logger } from '../../../logger'; +import { ApiPlugin } from '../api-plugin'; +import { TContext } from '../../../utils/types'; +import { validateEnv } from '../shared/validate-env'; +import { IApiPluginParams, PluginPayloadProperty } from '../types'; +import { getPayloadPropertiesValue } from '../shared/get-payload-properties-value'; + +const BankAccountVerificationPluginPayloadSchema = z.object({ + clientId: z.string().min(1), + vendor: z.enum(['experian']), + address: z.object({ + streetNumber: z.string().min(1), + street: z.string().min(1), + city: z.string().min(1), + postcode: z.string().min(1), + }), + bankAccountDetails: z.object({ + holder: z.union([ + z.union([ + z.object({ + bankAccountName: z.string().min(1), + companyRegistrationNumber: z.string().min(1), + }), + z.object({ + bankAccountName: z.string().min(1), + registeredCharityNumber: z.string().min(1), + }), + ]), + z.object({ + firstName: z.string().min(1), + middleName: z.string().optional(), + lastName: z.string().min(1), + }), + ]), + sortCode: z.string().min(1), + bankAccountNumber: z.string().min(1), + }), +}); + +type TBankAccountVerificationPluginPayload = { + clientId: PluginPayloadProperty; + vendor: PluginPayloadProperty; + data: { + address: { + streetNumber: PluginPayloadProperty; + street: PluginPayloadProperty; + city: PluginPayloadProperty; + postcode: PluginPayloadProperty; + }; + bankAccountDetails: { + sortCode: PluginPayloadProperty; + bankAccountNumber: PluginPayloadProperty; + } & ( + | { + holder: { + firstName: PluginPayloadProperty; + middleName: PluginPayloadProperty; + lastName: PluginPayloadProperty; + }; + } + | ({ bankAccountName: PluginPayloadProperty } & ( + | { companyRegistrationNumber: PluginPayloadProperty } + | { registeredCharityNumber: PluginPayloadProperty } + )) + ); + }; +}; + +export class BankAccountVerificationPlugin extends ApiPlugin { + public static pluginType = 'http'; + public payload: TBankAccountVerificationPluginPayload; + + private pluginName = 'Bank Account Verification Plugin'; + + constructor({ + payload, + ...pluginParams + }: IApiPluginParams & { payload: BankAccountVerificationPlugin['payload'] }) { + const bankAccountVerificationPluginParams = { + ...pluginParams, + method: 'POST' as const, + }; + + super(bankAccountVerificationPluginParams); + + this.payload = payload; + } + + async invoke(context: TContext) { + const env = validateEnv(this.pluginName); + + try { + const url = `${env.UNIFIED_API_URL}/bank-account-verification/commercial`; + + const payload = getPayloadPropertiesValue({ + properties: this.payload, + context, + }); + + const validatedPayload = BankAccountVerificationPluginPayloadSchema.safeParse(payload); + + if (!validatedPayload.success) { + return this.returnErrorResponse( + `${this.pluginName} - Invalid payload: ${JSON.stringify(validatedPayload.error.errors)}`, + ); + } + + logger.log(`${this.pluginName} - Sending API request`, { + url, + method: this.method, + }); + + const apiResponse = await this.makeApiRequest(url, this.method, validatedPayload.data, { + ...this.headers, + Authorization: `Bearer ${env.UNIFIED_API_TOKEN}`, + }); + + logger.log(`${this.pluginName} - Received response`, { + status: apiResponse.statusText, + url, + }); + + const contentLength = apiResponse.headers.get('content-length'); + + invariant( + !contentLength || Number(contentLength) > 0, + `${this.pluginName} - Received an empty response`, + ); + + if (!apiResponse.ok) { + const errorResponse = await apiResponse.json(); + + return this.returnErrorResponse( + `${this.pluginName} - Request Failed: ${apiResponse.statusText} Error: ${JSON.stringify( + errorResponse, + )}`, + ); + } + + const res = await apiResponse.json(); + const responseBody = z.record(z.string(), z.unknown()).parse(res); + + if (this.successAction) { + return this.returnSuccessResponse(this.successAction, { + ...responseBody, + name: this.name, + status: ProcessStatus.SUCCESS, + }); + } + + return {}; + } catch (error) { + logger.error(`${this.pluginName} - Error occurred while sending an API request`, { error }); + + return this.returnErrorResponse( + isErrorWithMessage(error) + ? `${this.pluginName} - ${error.message}` + : `${this.pluginName} - Unknown error`, + ); + } + } +} diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/individuals-sanctions-v2-plugin/individuals-sanctions-v2-plugin.test.ts b/packages/workflow-core/src/lib/plugins/external-plugin/individuals-sanctions-v2-plugin/individuals-sanctions-v2-plugin.test.ts index 947593dc38..eec361679d 100644 --- a/packages/workflow-core/src/lib/plugins/external-plugin/individuals-sanctions-v2-plugin/individuals-sanctions-v2-plugin.test.ts +++ b/packages/workflow-core/src/lib/plugins/external-plugin/individuals-sanctions-v2-plugin/individuals-sanctions-v2-plugin.test.ts @@ -23,32 +23,20 @@ describe('IndividualsSanctionsV2Plugin', () => { errorAction: 'ONGOING_AML_FAILED', successAction: 'ONGOING_AML_SUCCESS', payload: { - clientId: { - type: 'literal', - value: 'clientId', - }, - vendor: { - type: 'literal', - value: 'dow-jones', - }, - ongoingMonitoring: { - type: 'literal', - value: true, - }, - immediateResults: { - type: 'literal', - value: true, - }, + clientId: 'clientId', + vendor: 'dow-jones', + ongoingMonitoring: true, + immediateResults: true, workflowRuntimeId: { - type: 'path', + __type: 'path', value: 'workflowRuntimeId', }, endUserId: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.mainRepresentative.ballerineEntityId', }, kycInformation: { - type: 'path', + __type: 'path', value: 'childWorkflows.kyc_email_session_example', }, }, @@ -86,32 +74,20 @@ describe('IndividualsSanctionsV2Plugin', () => { errorAction: 'ONGOING_AML_FAILED', successAction: 'ONGOING_AML_SUCCESS', payload: { - clientId: { - type: 'literal', - value: 'clientId', - }, - vendor: { - type: 'literal', - value: 'dow-jones', - }, - ongoingMonitoring: { - type: 'literal', - value: true, - }, - immediateResults: { - type: 'literal', - value: true, - }, + clientId: 'clientId', + vendor: 'dow-jones', + ongoingMonitoring: true, + immediateResults: true, workflowRuntimeId: { - type: 'path', + __type: 'path', value: 'workflowRuntimeId', }, endUserId: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.mainRepresentative.ballerineEntityId', }, kycInformation: { - type: 'path', + __type: 'path', value: 'childWorkflows.kyc_email_session_example', }, }, @@ -149,32 +125,20 @@ describe('IndividualsSanctionsV2Plugin', () => { errorAction: 'ONGOING_AML_FAILED', successAction: 'ONGOING_AML_SUCCESS', payload: { - clientId: { - type: 'literal', - value: 'clientId', - }, - vendor: { - type: 'literal', - value: 'dow-jones', - }, - ongoingMonitoring: { - type: 'literal', - value: true, - }, - immediateResults: { - type: 'literal', - value: true, - }, + clientId: 'clientId', + vendor: 'dow-jones', + ongoingMonitoring: true, + immediateResults: true, workflowRuntimeId: { - type: 'path', + __type: 'path', value: 'workflowRuntimeId', }, endUserId: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.mainRepresentative.ballerineEntityId', }, kycInformation: { - type: 'path', + __type: 'path', value: 'childWorkflows.kyc_email_session_example', }, }, @@ -212,32 +176,20 @@ describe('IndividualsSanctionsV2Plugin', () => { errorAction: 'ONGOING_AML_FAILED', successAction: 'ONGOING_AML_SUCCESS', payload: { - clientId: { - type: 'literal', - value: 'clientId', - }, - vendor: { - type: 'literal', - value: 'dow-jones', - }, - ongoingMonitoring: { - type: 'literal', - value: true, - }, - immediateResults: { - type: 'literal', - value: true, - }, + clientId: 'clientId', + vendor: 'dow-jones', + ongoingMonitoring: true, + immediateResults: true, workflowRuntimeId: { - type: 'path', + __type: 'path', value: 'workflowRuntimeId', }, endUserId: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.mainRepresentative.ballerineEntityId', }, kycInformation: { - type: 'path', + __type: 'path', value: 'childWorkflows.kyc_email_session_example', }, }, @@ -278,32 +230,20 @@ describe('IndividualsSanctionsV2Plugin', () => { errorAction: 'ONGOING_AML_FAILED', successAction: 'ONGOING_AML_SUCCESS', payload: { - clientId: { - type: 'literal', - value: 'clientId', - }, - vendor: { - type: 'literal', - value: 'dow-jones', - }, - ongoingMonitoring: { - type: 'literal', - value: true, - }, - immediateResults: { - type: 'literal', - value: true, - }, + clientId: 'clientId', + vendor: 'dow-jones', + ongoingMonitoring: true, + immediateResults: true, workflowRuntimeId: { - type: 'path', + __type: 'path', value: 'workflowRuntimeId', }, endUserId: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.mainRepresentative.ballerineEntityId', }, kycInformation: { - type: 'path', + __type: 'path', value: 'childWorkflows.kyc_email_session_example', }, }, @@ -336,15 +276,15 @@ describe('IndividualsSanctionsV2Plugin', () => { // @ts-expect-error -- testing invalid payload payload: { workflowRuntimeId: { - type: 'path', + __type: 'path', value: 'workflowRuntimeId', }, endUserId: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.mainRepresentative.ballerineEntityId', }, kycInformation: { - type: 'path', + __type: 'path', value: 'childWorkflows.kyc_email_session_example', }, }, @@ -411,22 +351,10 @@ describe('IndividualsSanctionsV2Plugin', () => { successAction: 'ONGOING_AML_SUCCESS', // @ts-expect-error -- testing invalid payload payload: { - clientId: { - type: 'literal', - value: 'clientId', - }, - vendor: { - type: 'literal', - value: 'dow-jones', - }, - ongoingMonitoring: { - type: 'literal', - value: true, - }, - immediateResults: { - type: 'literal', - value: false, - }, + clientId: 'clientId', + vendor: 'dow-jones', + ongoingMonitoring: true, + immediateResults: false, }, } satisfies ConstructorParameters[0]; const plugin = new IndividualsSanctionsV2Plugin( @@ -505,32 +433,20 @@ describe('IndividualsSanctionsV2Plugin', () => { errorAction: 'ONGOING_AML_FAILED', successAction: 'ONGOING_AML_SUCCESS', payload: { - clientId: { - type: 'literal', - value: 'clientId', - }, - vendor: { - type: 'literal', - value: 'dow-jones', - }, - ongoingMonitoring: { - type: 'literal', - value: true, - }, - immediateResults: { - type: 'literal', - value: false, - }, + clientId: 'clientId', + vendor: 'dow-jones', + ongoingMonitoring: true, + immediateResults: false, workflowRuntimeId: { - type: 'path', + __type: 'path', value: 'workflowRuntimeId', }, endUserId: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.mainRepresentative.ballerineEntityId', }, kycInformation: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.ubos', }, }, @@ -605,32 +521,20 @@ describe('IndividualsSanctionsV2Plugin', () => { errorAction: 'ONGOING_AML_FAILED', successAction: 'ONGOING_AML_SUCCESS', payload: { - clientId: { - type: 'literal', - value: 'clientId', - }, - vendor: { - type: 'literal', - value: 'dow-jones', - }, - ongoingMonitoring: { - type: 'literal', - value: true, - }, - immediateResults: { - type: 'literal', - value: false, - }, + clientId: 'clientId', + vendor: 'dow-jones', + ongoingMonitoring: true, + immediateResults: false, workflowRuntimeId: { - type: 'path', + __type: 'path', value: 'workflowRuntimeId', }, endUserId: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.mainRepresentative.ballerineEntityId', }, kycInformation: { - type: 'path', + __type: 'path', value: 'entity.data', }, }, @@ -699,32 +603,20 @@ describe('IndividualsSanctionsV2Plugin', () => { errorAction: 'ONGOING_AML_FAILED', successAction: 'ONGOING_AML_SUCCESS', payload: { - clientId: { - type: 'literal', - value: 'clientId', - }, - vendor: { - type: 'literal', - value: 'dow-jones', - }, - ongoingMonitoring: { - type: 'literal', - value: true, - }, - immediateResults: { - type: 'literal', - value: false, - }, + clientId: 'clientId', + vendor: 'dow-jones', + ongoingMonitoring: true, + immediateResults: false, workflowRuntimeId: { - type: 'path', + __type: 'path', value: 'workflowRuntimeId', }, endUserId: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.mainRepresentative.ballerineEntityId', }, kycInformation: { - type: 'path', + __type: 'path', value: 'childWorkflows.kyc_email_session_example', }, }, @@ -802,32 +694,20 @@ describe('IndividualsSanctionsV2Plugin', () => { errorAction: 'ONGOING_AML_FAILED', successAction: 'ONGOING_AML_SUCCESS', payload: { - clientId: { - type: 'literal', - value: 'clientId', - }, - vendor: { - type: 'literal', - value: 'dow-jones', - }, - ongoingMonitoring: { - type: 'literal', - value: true, - }, - immediateResults: { - type: 'literal', - value: false, - }, + clientId: 'clientId', + vendor: 'dow-jones', + ongoingMonitoring: true, + immediateResults: false, workflowRuntimeId: { - type: 'path', + __type: 'path', value: 'workflowRuntimeId', }, endUserId: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.mainRepresentative.ballerineEntityId', }, kycInformation: { - type: 'path', + __type: 'path', value: 'childWorkflows.kyc_email_session_example', }, }, @@ -876,8 +756,9 @@ describe('IndividualsSanctionsV2Plugin', () => { // See WorkflowRunner.__invokeApiPlugin for reference. callbackAction: 'ONGOING_AML_SUCCESS', responseBody: { + name: 'sanctionsScreening', + error: 'Something went wrong', status: ProcessStatus.ERROR, - invokedAt: expect.any(Number), }, }); }); @@ -909,32 +790,20 @@ describe('IndividualsSanctionsV2Plugin', () => { errorAction: 'ONGOING_AML_FAILED', successAction: 'ONGOING_AML_SUCCESS', payload: { - clientId: { - type: 'literal', - value: 'clientId', - }, - vendor: { - type: 'literal', - value: 'dow-jones', - }, - ongoingMonitoring: { - type: 'literal', - value: true, - }, - immediateResults: { - type: 'literal', - value: false, - }, + clientId: 'clientId', + vendor: 'dow-jones', + ongoingMonitoring: true, + immediateResults: false, workflowRuntimeId: { - type: 'path', + __type: 'path', value: 'workflowRuntimeId', }, endUserId: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.mainRepresentative.ballerineEntityId', }, kycInformation: { - type: 'path', + __type: 'path', value: 'childWorkflows.kyc_email_session_example', }, }, @@ -977,8 +846,9 @@ describe('IndividualsSanctionsV2Plugin', () => { expect(invokeResponse).toMatchObject({ callbackAction: 'ONGOING_AML_SUCCESS', responseBody: { + name: 'sanctionsScreening', + reason: 'NOT_IMPLEMENTED', status: ProcessStatus.CANCELED, - invokedAt: expect.any(Number), }, }); }); @@ -996,10 +866,12 @@ describe('IndividualsSanctionsV2Plugin', () => { return new Response( JSON.stringify({ data: {}, + invokedAt: Date.now(), }), ); }), ); + const pluginParams = { url: 'http://test.com', method: 'POST', @@ -1010,32 +882,20 @@ describe('IndividualsSanctionsV2Plugin', () => { errorAction: 'ONGOING_AML_FAILED', successAction: 'ONGOING_AML_SUCCESS', payload: { - clientId: { - type: 'literal', - value: 'clientId', - }, - vendor: { - type: 'literal', - value: 'dow-jones', - }, - ongoingMonitoring: { - type: 'literal', - value: true, - }, - immediateResults: { - type: 'literal', - value: false, - }, + clientId: 'clientId', + vendor: 'dow-jones', + ongoingMonitoring: true, + immediateResults: false, workflowRuntimeId: { - type: 'path', + __type: 'path', value: 'workflowRuntimeId', }, endUserId: { - type: 'path', + __type: 'path', value: 'entity.data.additionalInfo.mainRepresentative.ballerineEntityId', }, kycInformation: { - type: 'path', + __type: 'path', value: 'childWorkflows.kyc_email_session_example', }, }, @@ -1079,6 +939,7 @@ describe('IndividualsSanctionsV2Plugin', () => { callbackAction: 'ONGOING_AML_SUCCESS', responseBody: { data: {}, + name: 'sanctionsScreening', status: ProcessStatus.IN_PROGRESS, invokedAt: expect.any(Number), }, diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/individuals-sanctions-v2-plugin/individuals-sanctions-v2-plugin.ts b/packages/workflow-core/src/lib/plugins/external-plugin/individuals-sanctions-v2-plugin/individuals-sanctions-v2-plugin.ts index 754babb4fe..479548dc7f 100644 --- a/packages/workflow-core/src/lib/plugins/external-plugin/individuals-sanctions-v2-plugin/individuals-sanctions-v2-plugin.ts +++ b/packages/workflow-core/src/lib/plugins/external-plugin/individuals-sanctions-v2-plugin/individuals-sanctions-v2-plugin.ts @@ -1,3 +1,5 @@ +import { z } from 'zod'; +import { invariant } from 'outvariant'; import { isErrorWithMessage, isObject, @@ -5,74 +7,25 @@ import { ProcessStatus, UnifiedApiReason, } from '@ballerine/common'; + import { logger } from '../../../logger'; -import { TContext } from '../../../utils/types'; import { ApiPlugin } from '../api-plugin'; -import { IApiPluginParams } from '../types'; -import get from 'lodash.get'; -import { z } from 'zod'; -import { invariant } from 'outvariant'; -import { getTransformer } from '../../../workflow-runner-utils'; - -export type PluginPayloadProperty = - | { - type: 'literal'; - /** @example 10 */ - value: TValue; - } - | { - type: 'path'; - /** @example entity.data.address.country */ - value: string; - }; - -/** - * Get the value of the properties in the payload depending on the type of the property i.e. 'literal' or 'path' - * @param properties - * @param context - */ -export const getPayloadPropertiesValue = ({ - properties, - context, -}: { - properties: Record>; - context: TContext; -}) => { - return Object.entries(properties).reduce((acc, [key, property]) => { - if (property.type === 'literal') { - acc[key] = property.value; - - return acc; - } - - if (property.type === 'path') { - acc[key] = get(context, property.value); - - return acc; - } - - property['type'] satisfies never; - throw new Error(`Unknown property type: "${property['type']}"`); - }, {} as Record); -}; +import { TContext } from '../../../utils/types'; +import { validateEnv } from '../shared/validate-env'; +import { IApiPluginParams, PluginPayloadProperty } from '../types'; +import { getPayloadPropertiesValue } from '../shared/get-payload-properties-value'; +import { handleJmespathTransformers } from '../shared/handle-jmespath-transformers'; const isObjectWithKycInformation = (obj: unknown) => { return isType(KycInformationSchema)(obj); }; -const removeTrailSlash = (url: string) => { - return url.replace(/\/$/, ''); -}; -const EnvSchema = z.object({ - UNIFIED_API_URL: z.string().url().transform(removeTrailSlash), - UNIFIED_API_TOKEN: z.string().min(1), - APP_API_URL: z.string().url().transform(removeTrailSlash), -}); const KycInformationSchema = z.object({ firstName: z.string().min(1), lastName: z.string().min(1), dateOfBirth: z.string().date(), }); + const IndividualsSanctionsV2PluginPayloadSchema = z.object({ vendor: z.enum(['veriff', 'test', 'dow-jones']), ongoingMonitoring: z.boolean(), @@ -107,29 +60,6 @@ const IndividualsSanctionsV2PluginPayloadSchema = z.object({ clientId: z.string().min(1), }); -const validateEnv = () => { - const result = EnvSchema.safeParse(process.env); - - if (!result.success) { - const formattedErrors = Object.entries(result.error.format()).reduce((acc, [name, value]) => { - if (value && '_errors' in value) { - acc[name] = value._errors.join(', '); - } - - return acc; - }, {} as Record); - - logger.error( - '❌ Individuals Sanctions V2 Plugin - Invalid environment variables:\n', - formattedErrors, - ); - - throw new Error('Invalid environment variables'); - } - - return result.data; -}; - export class IndividualsSanctionsV2Plugin extends ApiPlugin { public static pluginType = 'http'; public payload: { @@ -143,55 +73,34 @@ export class IndividualsSanctionsV2Plugin extends ApiPlugin { lastName: PluginPayloadProperty; dateOfBirth: PluginPayloadProperty; }>, - { type: 'path' } + { __type: 'path' } >; endUserId: PluginPayloadProperty; clientId: PluginPayloadProperty; }; + private pluginName = 'Individuals Sanctions V2 Plugin'; + constructor({ payload, ...pluginParams }: IApiPluginParams & { payload: IndividualsSanctionsV2Plugin['payload'] }) { super({ ...pluginParams, - response: { - ...pluginParams.response, - transformers: [ - ...(pluginParams.response?.transformers ?? []), - getTransformer({ - mapping: [ - { - method: 'setTimeToRecordUTC', - source: 'invokedAt', - target: 'invokedAt', - }, - ], - transformer: 'helper', - }), - ], - }, method: 'POST' as const, }); + this.payload = payload; - // Deprecating JMESPath is in progress. - invariant( - (this.request?.transformers ?? []).every( - transformer => transformer.name !== 'jmespath-transformer', - ), - 'Individuals Sanctions V2 Plugin - JMESPath request transformers are not supported', - ); - invariant( - (this.response?.transformers ?? []).every( - transformer => transformer.name !== 'jmespath-transformer', - ), - 'Individuals Sanctions V2 Plugin - JMESPath response transformers are not supported', - ); + handleJmespathTransformers({ + pluginName: this.pluginName, + requestTransformers: this.request?.transformers, + responseTransformers: this.response?.transformers, + }); } async invoke(context: TContext) { - const env = validateEnv(); + const env = validateEnv('Individuals Sanctions V2'); let requestPayload; if (this.request?.transformers) { @@ -227,7 +136,7 @@ export class IndividualsSanctionsV2Plugin extends ApiPlugin { invariant( firstKycInformation, - `Individuals Sanctions V2 Plugin - no KYC information found at ${this.payload.kycInformation.value}`, + `${this.pluginName} - no KYC information found at ${this.payload.kycInformation.value}`, ); const { firstName, lastName, additionalInfo } = firstKycInformation; @@ -255,7 +164,7 @@ export class IndividualsSanctionsV2Plugin extends ApiPlugin { invariant( firstKey && kycInformation[firstKey], - `Individuals Sanctions V2 Plugin - no KYC information found at ${this.payload.kycInformation.value}`, + `${this.pluginName} - no KYC information found at ${this.payload.kycInformation.value}`, ); return kycInformation[firstKey].result.vendorResult.entity.data; @@ -263,18 +172,19 @@ export class IndividualsSanctionsV2Plugin extends ApiPlugin { // Should never reach this point. Will reach here if error handling or validation changes. throw new Error( - `Individuals Sanctions V2 Plugin - unexpected KYC information found at ${this.payload.kycInformation.value}`, + `${this.pluginName} - unexpected KYC information found at ${this.payload.kycInformation.value}`, ); }; const kycInformationByDataType = getKycInformationByDataType(kycInformation); requestPayload = { + ...requestPayload, ...validatedPayload, ...kycInformationByDataType, callbackUrl, }; - logger.log('Individuals Sanctions V2 Plugin - Sending API request', { + logger.log(`${this.pluginName} - Sending API request`, { url, method: this.method, }); @@ -284,7 +194,7 @@ export class IndividualsSanctionsV2Plugin extends ApiPlugin { Authorization: `Bearer ${env.UNIFIED_API_TOKEN}`, }); - logger.log('Individuals Sanctions V2 Plugin - Received response', { + logger.log(`${this.pluginName} - Received response`, { status: apiResponse.statusText, url, }); @@ -293,7 +203,7 @@ export class IndividualsSanctionsV2Plugin extends ApiPlugin { invariant( !contentLength || Number(contentLength) > 0, - 'Individuals Sanctions V2 Plugin - Received an empty response', + `${this.pluginName} - Received an empty response`, ); if (!apiResponse.ok) { diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/kyc-plugin.ts b/packages/workflow-core/src/lib/plugins/external-plugin/kyc-plugin.ts index d51176bf65..50d7ffc925 100644 --- a/packages/workflow-core/src/lib/plugins/external-plugin/kyc-plugin.ts +++ b/packages/workflow-core/src/lib/plugins/external-plugin/kyc-plugin.ts @@ -1,8 +1,7 @@ import { AnyRecord } from '@ballerine/common'; -import { ApiPlugin } from './api-plugin'; import { JsonSchemaValidator } from '../../utils/context-validator/json-schema-validator'; import { Validator } from '../../utils'; -import { BallerineApiPlugin } from './ballerine-plugin'; +import { BallerineApiPlugin } from './ballerine-api-plugin'; const kycIndividualRequestSchema = { $schema: 'http://json-schema.org/draft-07/schema#', diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/kyc-session-plugin.ts b/packages/workflow-core/src/lib/plugins/external-plugin/kyc-session-plugin.ts index 3b96702e6f..026e689ffc 100644 --- a/packages/workflow-core/src/lib/plugins/external-plugin/kyc-session-plugin.ts +++ b/packages/workflow-core/src/lib/plugins/external-plugin/kyc-session-plugin.ts @@ -2,7 +2,7 @@ import { AnyRecord } from '@ballerine/common'; import { ApiPlugin } from './api-plugin'; import { JsonSchemaValidator } from '../../utils/context-validator/json-schema-validator'; import { Validator } from '../../utils'; -import { BallerineApiPlugin } from './ballerine-plugin'; +import { BallerineApiPlugin } from './ballerine-api-plugin'; const kycSessionRequestSchema = { $schema: 'http://json-schema.org/draft-07/schema#', diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/shared/get-payload-properties-value.ts b/packages/workflow-core/src/lib/plugins/external-plugin/shared/get-payload-properties-value.ts new file mode 100644 index 0000000000..508b88d1c1 --- /dev/null +++ b/packages/workflow-core/src/lib/plugins/external-plugin/shared/get-payload-properties-value.ts @@ -0,0 +1,38 @@ +import get from 'lodash.get'; +import { isObject } from '@ballerine/common'; + +import { TContext } from '../../../utils/types'; +import { PluginPayloadProperty } from '../types'; + +/** + * Get the value of the properties in the payload depending on the type of the property i.e. 'literal' or 'path' + * @param properties + * @param context + */ +export const getPayloadPropertiesValue = ({ + properties, + context, +}: { + properties: Record>; + context: TContext; +}) => + Object.entries(properties).reduce((acc, [key, property]) => { + if (!isObject(property)) { + acc[key] = property; + + return acc; + } + + if ('__type' in property) { + acc[key] = get(context, property.value); + + return acc; + } + + acc[key] = getPayloadPropertiesValue({ + properties: property as Record>, + context, + }); + + return acc; + }, {} as Record); diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/shared/get-plugin-status.ts b/packages/workflow-core/src/lib/plugins/external-plugin/shared/get-plugin-status.ts new file mode 100644 index 0000000000..3efde498dc --- /dev/null +++ b/packages/workflow-core/src/lib/plugins/external-plugin/shared/get-plugin-status.ts @@ -0,0 +1,13 @@ +import { ProcessStatus, UnifiedApiReason } from '@ballerine/common'; + +export const getPluginStatus = (response: Record) => { + if (response.reason === UnifiedApiReason.NOT_IMPLEMENTED) { + return ProcessStatus.CANCELED; + } + + if (response.error) { + return ProcessStatus.ERROR; + } + + return ProcessStatus.IN_PROGRESS; +}; diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/shared/handle-jmespath-transformers.ts b/packages/workflow-core/src/lib/plugins/external-plugin/shared/handle-jmespath-transformers.ts new file mode 100644 index 0000000000..df2c198397 --- /dev/null +++ b/packages/workflow-core/src/lib/plugins/external-plugin/shared/handle-jmespath-transformers.ts @@ -0,0 +1,24 @@ +import { invariant } from 'outvariant'; + +import { Transformers } from '../../../utils'; + +// Deprecating JMESPath is in progress. +export const handleJmespathTransformers = ({ + pluginName, + responseTransformers, + requestTransformers, +}: { + pluginName: string; + requestTransformers: Transformers | undefined; + responseTransformers: Transformers | undefined; +}) => { + invariant( + (requestTransformers ?? []).every(transformer => transformer.name !== 'jmespath-transformer'), + `${pluginName} - JMESPath request transformers are not supported`, + ); + + invariant( + (responseTransformers ?? []).every(transformer => transformer.name !== 'jmespath-transformer'), + `${pluginName} - JMESPath response transformers are not supported`, + ); +}; diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/shared/remove-trailing-slash.ts b/packages/workflow-core/src/lib/plugins/external-plugin/shared/remove-trailing-slash.ts new file mode 100644 index 0000000000..fdb5201e6c --- /dev/null +++ b/packages/workflow-core/src/lib/plugins/external-plugin/shared/remove-trailing-slash.ts @@ -0,0 +1,3 @@ +export const removeTrailingSlash = (url: string) => { + return url.replace(/\/$/, ''); +}; diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/shared/validate-env.ts b/packages/workflow-core/src/lib/plugins/external-plugin/shared/validate-env.ts new file mode 100644 index 0000000000..61c76b9c41 --- /dev/null +++ b/packages/workflow-core/src/lib/plugins/external-plugin/shared/validate-env.ts @@ -0,0 +1,29 @@ +import { z } from 'zod'; +import { logger } from '../../../logger'; +import { removeTrailingSlash } from './remove-trailing-slash'; + +const EnvSchema = z.object({ + UNIFIED_API_TOKEN: z.string().min(1), + UNIFIED_API_URL: z.string().url().transform(removeTrailingSlash), + APP_API_URL: z.string().url().transform(removeTrailingSlash), +}); + +export const validateEnv = (pluginName: string) => { + const result = EnvSchema.safeParse(process.env); + + if (!result.success) { + const formattedErrors = Object.entries(result.error.format()).reduce((acc, [name, value]) => { + if (value && '_errors' in value) { + acc[name] = value._errors.join(', '); + } + + return acc; + }, {} as Record); + + logger.error(`❌ ${pluginName} - Invalid environment variables:\n`, formattedErrors); + + throw new Error('Invalid environment variables'); + } + + return result.data; +}; diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/types.ts b/packages/workflow-core/src/lib/plugins/external-plugin/types.ts index fe0249e371..f4d3a55057 100644 --- a/packages/workflow-core/src/lib/plugins/external-plugin/types.ts +++ b/packages/workflow-core/src/lib/plugins/external-plugin/types.ts @@ -94,3 +94,13 @@ export interface SerializableIterativePluginParams { invoke?(...args: any): void; } + +export type PluginPayloadProperty = + | TValue + | { + __type: 'path'; + value: string; + } + | { + [key: string]: PluginPayloadProperty; + }; diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/vendor-consts.ts b/packages/workflow-core/src/lib/plugins/external-plugin/vendor-consts.ts index 32351a169f..95dca1c87f 100644 --- a/packages/workflow-core/src/lib/plugins/external-plugin/vendor-consts.ts +++ b/packages/workflow-core/src/lib/plugins/external-plugin/vendor-consts.ts @@ -295,16 +295,6 @@ export const BALLERINE_API_PLUGIN_FACTORY = { "merge({ name: 'businessInformation', status: reason == 'NOT_IMPLEMENTED' && 'CANCELED' || error != `null` && 'ERROR' || jurisdictionCode == 'HK' && 'IN_PROGRESS' || 'SUCCESS' }, @)", transformer: 'jmespath', }, - { - mapping: [ - { - method: 'setTimeToRecordUTC', - source: 'invokedAt', - target: 'invokedAt', - }, - ], - transformer: 'helper', - }, ], }, }), @@ -344,16 +334,6 @@ export const BALLERINE_API_PLUGIN_FACTORY = { "merge({ name: 'businessInformation', status: reason == 'NOT_IMPLEMENTED' && 'CANCELED' || error != `null` && 'ERROR' || jurisdictionCode == 'HK' && 'IN_PROGRESS' || 'SUCCESS' }, @)", transformer: 'jmespath', }, - { - mapping: [ - { - method: 'setTimeToRecordUTC', - source: 'invokedAt', - target: 'invokedAt', - }, - ], - transformer: 'helper', - }, ], }, }), @@ -389,16 +369,6 @@ export const BALLERINE_API_PLUGIN_FACTORY = { "merge({ name: 'businessInformation', status: reason == 'NOT_IMPLEMENTED' && 'CANCELED' || error != `null` && 'ERROR' || jurisdictionCode == 'HK' && 'IN_PROGRESS' || 'SUCCESS' }, @)", transformer: 'jmespath', }, - { - mapping: [ - { - method: 'setTimeToRecordUTC', - source: 'invokedAt', - target: 'invokedAt', - }, - ], - transformer: 'helper', - }, ], }, }), @@ -436,16 +406,6 @@ export const BALLERINE_API_PLUGIN_FACTORY = { "merge({ name: 'sanctionsScreening', status: reason == 'NOT_IMPLEMENTED' && 'CANCELED' || error != `null` && 'ERROR' || 'IN_PROGRESS' }, @)", transformer: 'jmespath', }, - { - mapping: [ - { - method: 'setTimeToRecordUTC', - source: 'invokedAt', - target: 'invokedAt', - }, - ], - transformer: 'helper', - }, ], } as SerializableValidatableTransformer, }), @@ -478,16 +438,6 @@ export const BALLERINE_API_PLUGIN_FACTORY = { "merge({ name: 'sanctions_screening', status: reason == 'NOT_IMPLEMENTED' && 'CANCELED' || error != `null` && 'ERROR' || 'IN_PROGRESS' }, @)", transformer: 'jmespath', }, - { - mapping: [ - { - method: 'setTimeToRecordUTC', - source: 'invokedAt', - target: 'invokedAt', - }, - ], - transformer: 'helper', - }, ], } as SerializableValidatableTransformer, }), @@ -522,16 +472,6 @@ export const BALLERINE_API_PLUGIN_FACTORY = { "merge({ name: 'companySanctions', status: contains(['NOT_IMPLEMENTED', 'NOT_AVAILABLE'], reason) && 'CANCELED' || error != `null` && 'ERROR' || 'SUCCESS' }, @)", transformer: 'jmespath', }, - { - mapping: [ - { - method: 'setTimeToRecordUTC', - source: 'invokedAt', - target: 'invokedAt', - }, - ], - transformer: 'helper', - }, ], }, }), @@ -564,16 +504,6 @@ export const BALLERINE_API_PLUGIN_FACTORY = { "merge({ name: 'companySanctions', status: contains(['NOT_IMPLEMENTED', 'NOT_AVAILABLE'], reason) && 'CANCELED' || error != `null` && 'ERROR' || 'SUCCESS' }, @)", transformer: 'jmespath', }, - { - mapping: [ - { - method: 'setTimeToRecordUTC', - source: 'invokedAt', - target: 'invokedAt', - }, - ], - transformer: 'helper', - }, ], }, }), @@ -611,16 +541,6 @@ export const BALLERINE_API_PLUGIN_FACTORY = { "merge({ name: 'merchantMonitoring', status: contains(['NOT_IMPLEMENTED', 'NOT_AVAILABLE'], reason) && 'CANCELED' || error != `null` && 'ERROR' || 'IN_PROGRESS' }, @)", transformer: 'jmespath', }, - { - mapping: [ - { - method: 'setTimeToRecordUTC', - source: 'invokedAt', - target: 'invokedAt', - }, - ], - transformer: 'helper', - }, ], }, }), @@ -658,16 +578,6 @@ export const BALLERINE_API_PLUGIN_FACTORY = { "merge({ name: 'ubo', status: reason == 'NOT_IMPLEMENTED' && 'CANCELED' || error != `null` && 'ERROR' || 'IN_PROGRESS' }, @)", transformer: 'jmespath', }, - { - mapping: [ - { - method: 'setTimeToRecordUTC', - source: 'invokedAt', - target: 'invokedAt', - }, - ], - transformer: 'helper', - }, ], }, }), @@ -703,16 +613,6 @@ export const BALLERINE_API_PLUGIN_FACTORY = { "merge({ name: 'ubo', status: reason == 'NOT_IMPLEMENTED' && 'CANCELED' || error != `null` && 'ERROR' || 'IN_PROGRESS' }, @)", transformer: 'jmespath', }, - { - mapping: [ - { - method: 'setTimeToRecordUTC', - source: 'invokedAt', - target: 'invokedAt', - }, - ], - transformer: 'helper', - }, ], }, }), @@ -748,16 +648,6 @@ export const BALLERINE_API_PLUGIN_FACTORY = { "merge({ name: 'ubo', status: reason == 'NOT_IMPLEMENTED' && 'CANCELED' || error != `null` && 'ERROR' || 'IN_PROGRESS' }, @)", transformer: 'jmespath', }, - { - mapping: [ - { - method: 'setTimeToRecordUTC', - source: 'invokedAt', - target: 'invokedAt', - }, - ], - transformer: 'helper', - }, ], }, }), diff --git a/packages/workflow-core/src/lib/plugins/external-plugin/webhook-plugin.ts b/packages/workflow-core/src/lib/plugins/external-plugin/webhook-plugin.ts index 15a35dd588..441f114fc7 100644 --- a/packages/workflow-core/src/lib/plugins/external-plugin/webhook-plugin.ts +++ b/packages/workflow-core/src/lib/plugins/external-plugin/webhook-plugin.ts @@ -1,7 +1,7 @@ import { AnyRecord, isErrorWithMessage, sign } from '@ballerine/common'; import { logger } from '../../logger'; import { TContext } from '../../utils/types'; -import { IBallerineApiPluginParams } from './ballerine-plugin'; +import { IBallerineApiPluginParams } from './ballerine-api-plugin'; import { IApiPluginParams } from './types'; import { ApiPlugin } from '.'; diff --git a/packages/workflow-core/src/lib/workflow-runner.ts b/packages/workflow-core/src/lib/workflow-runner.ts index d63e3bdfae..22726ee9fe 100644 --- a/packages/workflow-core/src/lib/workflow-runner.ts +++ b/packages/workflow-core/src/lib/workflow-runner.ts @@ -29,7 +29,7 @@ import { import { WorkflowTokenPlugin } from './plugins/common-plugin/workflow-token-plugin'; import { ApiPlugin } from './plugins/external-plugin/api-plugin'; import { BallerineEmailPlugin } from './plugins/external-plugin/ballerine-email-plugin'; -import { BallerineApiPlugin } from './plugins/external-plugin/ballerine-plugin'; +import { BallerineApiPlugin } from './plugins/external-plugin/ballerine-api-plugin'; import { DispatchEventPlugin } from './plugins/external-plugin/dispatch-event-plugin'; import { KycPlugin } from './plugins/external-plugin/kyc-plugin'; import { KycSessionPlugin } from './plugins/external-plugin/kyc-session-plugin'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cc42090e01..b83602af1a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -73,22 +73,22 @@ importers: apps/backoffice-v2: dependencies: '@ballerine/blocks': - specifier: 0.2.32 + specifier: 0.2.34 version: link:../../packages/blocks '@ballerine/common': - specifier: 0.9.66 + specifier: 0.9.68 version: link:../../packages/common '@ballerine/react-pdf-toolkit': - specifier: ^1.2.62 + specifier: ^1.2.67 version: link:../../packages/react-pdf-toolkit '@ballerine/ui': - specifier: ^0.5.62 + specifier: ^0.5.67 version: link:../../packages/ui '@ballerine/workflow-browser-sdk': - specifier: 0.6.85 + specifier: 0.6.87 version: link:../../sdks/workflow-browser-sdk '@ballerine/workflow-node-sdk': - specifier: 0.6.85 + specifier: 0.6.87 version: link:../../sdks/workflow-node-sdk '@botpress/webchat': specifier: ^2.1.10 @@ -368,10 +368,10 @@ importers: version: 3.23.4 devDependencies: '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../../packages/config '@ballerine/eslint-config-react': - specifier: ^2.0.30 + specifier: ^2.0.32 version: link:../../packages/eslint-config-react '@cspell/cspell-types': specifier: ^6.31.1 @@ -530,16 +530,16 @@ importers: apps/kyb-app: dependencies: '@ballerine/blocks': - specifier: 0.2.32 + specifier: 0.2.34 version: link:../../packages/blocks '@ballerine/common': - specifier: ^0.9.66 + specifier: ^0.9.68 version: link:../../packages/common '@ballerine/ui': - specifier: 0.5.66 + specifier: 0.5.67 version: link:../../packages/ui '@ballerine/workflow-browser-sdk': - specifier: 0.6.85 + specifier: 0.6.87 version: link:../../sdks/workflow-browser-sdk '@lukemorales/query-key-factory': specifier: ^1.0.3 @@ -672,10 +672,10 @@ importers: version: 3.23.4 devDependencies: '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../../packages/config '@ballerine/eslint-config-react': - specifier: ^2.0.30 + specifier: ^2.0.32 version: link:../../packages/eslint-config-react '@jest/globals': specifier: ^29.7.0 @@ -780,10 +780,10 @@ importers: apps/workflows-dashboard: dependencies: '@ballerine/common': - specifier: ^0.9.66 + specifier: ^0.9.68 version: link:../../packages/common '@ballerine/ui': - specifier: ^0.5.62 + specifier: ^0.5.67 version: link:../../packages/ui '@lukemorales/query-key-factory': specifier: ^1.0.3 @@ -919,10 +919,10 @@ importers: version: 3.22.4 devDependencies: '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../../packages/config '@ballerine/eslint-config-react': - specifier: ^2.0.30 + specifier: ^2.0.32 version: link:../../packages/eslint-config-react '@cspell/cspell-types': specifier: ^6.31.1 @@ -1012,10 +1012,10 @@ importers: examples/headless-example: dependencies: '@ballerine/common': - specifier: 0.9.66 + specifier: 0.9.68 version: link:../../packages/common '@ballerine/workflow-browser-sdk': - specifier: 0.6.85 + specifier: 0.6.87 version: link:../../sdks/workflow-browser-sdk '@felte/reporter-svelte': specifier: ^1.1.5 @@ -1109,7 +1109,7 @@ importers: examples/report-generation-example: dependencies: '@ballerine/react-pdf-toolkit': - specifier: ^1.2.62 + specifier: ^1.2.67 version: link:../../packages/react-pdf-toolkit react: specifier: ^18.2.0 @@ -1152,7 +1152,7 @@ importers: packages/blocks: dependencies: '@ballerine/common': - specifier: ^0.9.66 + specifier: ^0.9.68 version: link:../common devDependencies: '@babel/core': @@ -1168,10 +1168,10 @@ importers: specifier: 7.16.7 version: 7.16.7(@babel/core@7.17.9) '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../config '@ballerine/eslint-config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../eslint-config '@rollup/plugin-babel': specifier: 5.3.1 @@ -1349,10 +1349,10 @@ importers: specifier: 7.16.7 version: 7.16.7(@babel/core@7.17.9) '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../config '@ballerine/eslint-config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../eslint-config '@cspell/cspell-types': specifier: ^6.31.1 @@ -1501,7 +1501,7 @@ importers: packages/eslint-config-react: dependencies: '@ballerine/eslint-config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../eslint-config eslint-plugin-react: specifier: ^7.33.2 @@ -1513,10 +1513,10 @@ importers: packages/react-pdf-toolkit: dependencies: '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../config '@ballerine/ui': - specifier: 0.5.66 + specifier: 0.5.67 version: link:../ui '@react-pdf/renderer': specifier: ^3.1.14 @@ -1635,10 +1635,10 @@ importers: specifier: 7.16.7 version: 7.16.7(@babel/core@7.17.9) '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../config '@ballerine/eslint-config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../eslint-config '@cspell/cspell-types': specifier: ^6.31.1 @@ -1740,7 +1740,7 @@ importers: packages/ui: dependencies: '@ballerine/common': - specifier: ^0.9.66 + specifier: ^0.9.68 version: link:../common '@emotion/react': specifier: ^11.11.1 @@ -1858,10 +1858,10 @@ importers: version: 3.23.4 devDependencies: '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../config '@ballerine/eslint-config-react': - specifier: ^2.0.30 + specifier: ^2.0.32 version: link:../eslint-config-react '@cspell/cspell-types': specifier: ^6.31.1 @@ -1969,7 +1969,7 @@ importers: packages/workflow-core: dependencies: '@ballerine/common': - specifier: 0.9.66 + specifier: 0.9.68 version: link:../common ajv: specifier: ^8.12.0 @@ -2015,10 +2015,10 @@ importers: specifier: 7.16.7 version: 7.16.7(@babel/core@7.17.9) '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../config '@ballerine/eslint-config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../eslint-config '@cspell/cspell-types': specifier: ^6.31.1 @@ -2159,7 +2159,7 @@ importers: sdks/web-ui-sdk: dependencies: '@ballerine/common': - specifier: 0.9.66 + specifier: 0.9.68 version: link:../../packages/common '@zerodevx/svelte-toast': specifier: ^0.8.0 @@ -2286,10 +2286,10 @@ importers: sdks/workflow-browser-sdk: dependencies: '@ballerine/common': - specifier: 0.9.66 + specifier: 0.9.68 version: link:../../packages/common '@ballerine/workflow-core': - specifier: 0.6.85 + specifier: 0.6.87 version: link:../../packages/workflow-core xstate: specifier: ^4.37.0 @@ -2305,10 +2305,10 @@ importers: specifier: 7.16.7 version: 7.16.7(@babel/core@7.17.9) '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../../packages/config '@ballerine/eslint-config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../../packages/eslint-config '@cspell/cspell-types': specifier: ^6.31.1 @@ -2428,7 +2428,7 @@ importers: sdks/workflow-node-sdk: dependencies: '@ballerine/workflow-core': - specifier: 0.6.85 + specifier: 0.6.87 version: link:../../packages/workflow-core json-logic-js: specifier: ^2.0.2 @@ -2447,10 +2447,10 @@ importers: specifier: 7.16.7 version: 7.16.7(@babel/core@7.17.9) '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../../packages/config '@ballerine/eslint-config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../../packages/eslint-config '@cspell/cspell-types': specifier: ^6.31.1 @@ -2673,13 +2673,13 @@ importers: specifier: 3.347.1 version: 3.347.1 '@ballerine/common': - specifier: 0.9.66 + specifier: 0.9.68 version: link:../../packages/common '@ballerine/workflow-core': - specifier: 0.6.85 + specifier: 0.6.87 version: link:../../packages/workflow-core '@ballerine/workflow-node-sdk': - specifier: 0.6.85 + specifier: 0.6.87 version: link:../../sdks/workflow-node-sdk '@faker-js/faker': specifier: ^7.6.0 @@ -2857,10 +2857,10 @@ importers: version: 3.23.4 devDependencies: '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../../packages/config '@ballerine/eslint-config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../../packages/eslint-config '@cspell/cspell-types': specifier: ^6.31.1 @@ -3022,7 +3022,7 @@ importers: specifier: ^4.0.0 version: 4.0.0(astro@3.3.3)(tailwindcss@3.3.5)(ts-node@10.9.1) '@ballerine/common': - specifier: ^0.9.66 + specifier: ^0.9.68 version: link:../../packages/common astro: specifier: 3.3.3 @@ -3035,10 +3035,10 @@ importers: version: 0.14.5 devDependencies: '@ballerine/config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../../packages/config '@ballerine/eslint-config': - specifier: ^1.1.30 + specifier: ^1.1.32 version: link:../../packages/eslint-config eslint: specifier: ^8.46.0 @@ -20306,7 +20306,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.23.3) '@types/babel__core': 7.20.4 react-refresh: 0.14.0 - vite: 4.5.3(@types/node@18.17.19) + vite: 4.5.3(@types/node@20.9.2) transitivePeerDependencies: - supports-color dev: true @@ -25455,7 +25455,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.3) + '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.5) debug: 3.2.7 eslint: 8.54.0 eslint-import-resolver-node: 0.3.9 @@ -25514,7 +25514,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@5.1.6) debug: 3.2.7 eslint: 8.54.0 eslint-import-resolver-node: 0.3.9 @@ -25620,7 +25620,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.3) + '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.5) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -25690,7 +25690,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.54.0)(typescript@5.1.6) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -26007,7 +26007,7 @@ packages: '@typescript-eslint/eslint-plugin': optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.54.0)(typescript@4.9.5) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.54.0)(typescript@5.1.6) eslint: 8.54.0 eslint-rule-composer: 0.3.0 dev: true @@ -38536,7 +38536,7 @@ packages: strip-ansi: 6.0.1 tiny-invariant: 1.3.1 typescript: 5.1.6 - vite: 4.5.3(@types/node@18.17.19) + vite: 4.5.3(@types/node@20.9.2) vscode-languageclient: 7.0.0 vscode-languageserver: 7.0.0 vscode-languageserver-textdocument: 1.0.11 @@ -38667,7 +38667,7 @@ packages: kolorist: 1.8.0 sirv: 2.0.3 ufo: 1.3.2 - vite: 4.5.3(@types/node@18.17.19) + vite: 4.5.3(@types/node@20.9.2) transitivePeerDependencies: - rollup - supports-color @@ -38746,7 +38746,7 @@ packages: debug: 4.3.4(supports-color@8.1.1) globrex: 0.1.2 tsconfck: 2.1.2(typescript@5.1.6) - vite: 4.5.3(@types/node@18.17.19) + vite: 4.5.3(@types/node@20.9.2) transitivePeerDependencies: - supports-color - typescript diff --git a/scripts/auto-commit.js b/scripts/auto-commit.js index bcdf6c5bfd..f20b306618 100755 --- a/scripts/auto-commit.js +++ b/scripts/auto-commit.js @@ -35,7 +35,7 @@ async function generateCommitMessage(diff) { "- Don't capitalize first letter\n" + '- No period at the end\n' + '- Keep first line under 72 chars\n' + - '- Body lines must not exceed 100 chars, including the roast - the roast shouldnt be longer than 100 chars\n' + + '- All lines must not exceed 100 chars, including the roast - the roast shouldnt be longer than 100 chars\n' + '- Must have blank line between title and body\n\n' + 'After analyzing the diff:\n' + '1. Write a concise conventional commit message\n' + diff --git a/sdks/web-ui-sdk/CHANGELOG.md b/sdks/web-ui-sdk/CHANGELOG.md index 1c1a9095d8..f9b40468f5 100644 --- a/sdks/web-ui-sdk/CHANGELOG.md +++ b/sdks/web-ui-sdk/CHANGELOG.md @@ -1,5 +1,21 @@ # web-ui-sdk +## 1.5.69 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/common@0.9.68 + +## 1.5.68 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/common@0.9.67 + ## 1.5.67 ### Patch Changes diff --git a/sdks/web-ui-sdk/package.json b/sdks/web-ui-sdk/package.json index 6bb75e31c4..4a075af917 100644 --- a/sdks/web-ui-sdk/package.json +++ b/sdks/web-ui-sdk/package.json @@ -21,7 +21,7 @@ "types": "dist/index.d.ts", "name": "@ballerine/web-ui-sdk", "private": false, - "version": "1.5.67", + "version": "1.5.69", "type": "module", "files": [ "dist" @@ -96,7 +96,7 @@ "vitest": "^0.24.5" }, "dependencies": { - "@ballerine/common": "0.9.66", + "@ballerine/common": "0.9.68", "@zerodevx/svelte-toast": "^0.8.0", "compressorjs": "^1.1.1", "deepmerge": "^4.3.0", diff --git a/sdks/workflow-browser-sdk/CHANGELOG.md b/sdks/workflow-browser-sdk/CHANGELOG.md index 3b8ff9a1f4..b786fef346 100644 --- a/sdks/workflow-browser-sdk/CHANGELOG.md +++ b/sdks/workflow-browser-sdk/CHANGELOG.md @@ -1,5 +1,23 @@ # @ballerine/workflow-browser-sdk +## 0.6.87 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/workflow-core@0.6.87 + - @ballerine/common@0.9.68 + +## 0.6.86 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/workflow-core@0.6.86 + - @ballerine/common@0.9.67 + ## 0.6.85 ### Patch Changes diff --git a/sdks/workflow-browser-sdk/package.json b/sdks/workflow-browser-sdk/package.json index 291a14de6a..48b96d09b5 100644 --- a/sdks/workflow-browser-sdk/package.json +++ b/sdks/workflow-browser-sdk/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/workflow-browser-sdk", "author": "Ballerine ", - "version": "0.6.85", + "version": "0.6.87", "description": "workflow-browser-sdk", "module": "./dist/esm/index.js", "main": "./dist/cjs/index.js", @@ -33,17 +33,17 @@ "node": ">=12" }, "dependencies": { - "@ballerine/common": "0.9.66", - "@ballerine/workflow-core": "0.6.85", + "@ballerine/common": "0.9.68", + "@ballerine/workflow-core": "0.6.87", "xstate": "^4.37.0" }, "devDependencies": { "@babel/core": "7.17.9", "@babel/preset-env": "7.16.11", "@babel/preset-typescript": "7.16.7", - "@ballerine/config": "^1.1.30", + "@ballerine/config": "^1.1.32", "@cspell/cspell-types": "^6.31.1", - "@ballerine/eslint-config": "^1.1.30", + "@ballerine/eslint-config": "^1.1.32", "@rollup/plugin-babel": "5.3.1", "@rollup/plugin-commonjs": "^24.0.1", "@rollup/plugin-json": "^6.0.0", diff --git a/sdks/workflow-node-sdk/CHANGELOG.md b/sdks/workflow-node-sdk/CHANGELOG.md index 901f37f438..0e3ee7eaf8 100644 --- a/sdks/workflow-node-sdk/CHANGELOG.md +++ b/sdks/workflow-node-sdk/CHANGELOG.md @@ -1,5 +1,21 @@ # @ballerine/workflow-node-sdk +## 0.6.87 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/workflow-core@0.6.87 + +## 0.6.86 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/workflow-core@0.6.86 + ## 0.6.85 ### Patch Changes diff --git a/sdks/workflow-node-sdk/package.json b/sdks/workflow-node-sdk/package.json index 943585de34..acb7d7341a 100644 --- a/sdks/workflow-node-sdk/package.json +++ b/sdks/workflow-node-sdk/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/workflow-node-sdk", "author": "Ballerine ", - "version": "0.6.85", + "version": "0.6.87", "description": "workflow-node-sdk", "module": "./dist/esm/index.js", "main": "./dist/cjs/index.js", @@ -28,7 +28,7 @@ "node": ">=12" }, "dependencies": { - "@ballerine/workflow-core": "0.6.85", + "@ballerine/workflow-core": "0.6.87", "json-logic-js": "^2.0.2", "xstate": "^4.36.0" }, @@ -36,9 +36,9 @@ "@babel/core": "7.17.9", "@babel/preset-env": "7.16.11", "@babel/preset-typescript": "7.16.7", - "@ballerine/config": "^1.1.30", + "@ballerine/config": "^1.1.32", "@cspell/cspell-types": "^6.31.1", - "@ballerine/eslint-config": "^1.1.30", + "@ballerine/eslint-config": "^1.1.32", "@rollup/plugin-babel": "5.3.1", "@rollup/plugin-commonjs": "^24.0.1", "@rollup/plugin-json": "^6.0.0", diff --git a/services/websocket-service/CHANGELOG.md b/services/websocket-service/CHANGELOG.md index 94ad8e937f..ac2eec17c7 100644 --- a/services/websocket-service/CHANGELOG.md +++ b/services/websocket-service/CHANGELOG.md @@ -1,5 +1,17 @@ # @ballerine/websocket-service +## 0.1.32 + +### Patch Changes + +- version bump + +## 0.1.31 + +### Patch Changes + +- version bump + ## 0.1.30 ### Patch Changes diff --git a/services/websocket-service/package.json b/services/websocket-service/package.json index 1b169760c6..0d70b5b57a 100644 --- a/services/websocket-service/package.json +++ b/services/websocket-service/package.json @@ -1,6 +1,6 @@ { "name": "@ballerine/websocket-service", - "version": "0.1.30", + "version": "0.1.32", "description": "websocket-service", "private": false, "scripts": { diff --git a/services/workflows-service/CHANGELOG.md b/services/workflows-service/CHANGELOG.md index 4747b9bf40..53c65b7712 100644 --- a/services/workflows-service/CHANGELOG.md +++ b/services/workflows-service/CHANGELOG.md @@ -1,5 +1,25 @@ # @ballerine/workflows-service +## 0.7.91 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/workflow-core@0.6.87 + - @ballerine/workflow-node-sdk@0.6.87 + - @ballerine/common@0.9.68 + +## 0.7.90 + +### Patch Changes + +- version bump +- Updated dependencies + - @ballerine/workflow-core@0.6.86 + - @ballerine/workflow-node-sdk@0.6.86 + - @ballerine/common@0.9.67 + ## 0.7.89 ### Patch Changes diff --git a/services/workflows-service/package.json b/services/workflows-service/package.json index 000080d032..2e9b602326 100644 --- a/services/workflows-service/package.json +++ b/services/workflows-service/package.json @@ -1,7 +1,7 @@ { "name": "@ballerine/workflows-service", "private": false, - "version": "0.7.89", + "version": "0.7.91", "description": "workflow-service", "scripts": { "spellcheck": "cspell \"*\"", @@ -50,9 +50,9 @@ "@aws-sdk/client-secrets-manager": "^3.620.1", "@aws-sdk/lib-storage": "3.347.1", "@aws-sdk/s3-request-presigner": "3.347.1", - "@ballerine/common": "0.9.66", - "@ballerine/workflow-core": "0.6.85", - "@ballerine/workflow-node-sdk": "0.6.85", + "@ballerine/common": "0.9.68", + "@ballerine/workflow-core": "0.6.87", + "@ballerine/workflow-node-sdk": "0.6.87", "@faker-js/faker": "^7.6.0", "@nestjs/axios": "^2.0.0", "@nestjs/common": "^9.3.12", @@ -113,8 +113,8 @@ "zod": "^3.23.4" }, "devDependencies": { - "@ballerine/config": "^1.1.30", - "@ballerine/eslint-config": "^1.1.30", + "@ballerine/config": "^1.1.32", + "@ballerine/eslint-config": "^1.1.32", "@cspell/cspell-types": "^6.31.1", "@nestjs/cli": "9.3.0", "@nestjs/swagger": "7.4.0", diff --git a/services/workflows-service/prisma/data-migrations b/services/workflows-service/prisma/data-migrations index fdebde93d1..cccba77231 160000 --- a/services/workflows-service/prisma/data-migrations +++ b/services/workflows-service/prisma/data-migrations @@ -1 +1 @@ -Subproject commit fdebde93d13e30b9687f29089bca141d00a7e852 +Subproject commit cccba77231119da4db772844cc83c55785d938de diff --git a/services/workflows-service/src/auth/workflow-token/workflow-token.repository.ts b/services/workflows-service/src/auth/workflow-token/workflow-token.repository.ts index 24122317ae..5c0a8cfd67 100644 --- a/services/workflows-service/src/auth/workflow-token/workflow-token.repository.ts +++ b/services/workflows-service/src/auth/workflow-token/workflow-token.repository.ts @@ -30,7 +30,7 @@ export class WorkflowTokenRepository { }); } - async findFirstByWorkflowruntimeDataIdUnscoped(workflowRuntimeDataId: string) { + async findFirstByWorkflowRuntimeDataIdUnscoped(workflowRuntimeDataId: string) { return await this.prismaService.workflowRuntimeDataToken.findFirst({ select: { token: true, diff --git a/services/workflows-service/src/auth/workflow-token/workflow-token.service.ts b/services/workflows-service/src/auth/workflow-token/workflow-token.service.ts index e6c37a79a9..3f2aacbed8 100644 --- a/services/workflows-service/src/auth/workflow-token/workflow-token.service.ts +++ b/services/workflows-service/src/auth/workflow-token/workflow-token.service.ts @@ -107,8 +107,8 @@ export class WorkflowTokenService { return await this.workflowTokenRepository.findByTokenUnscoped(token); } - async findFirstByWorkflowruntimeDataIdUnscoped(token: string) { - return await this.workflowTokenRepository.findFirstByWorkflowruntimeDataIdUnscoped(token); + async findFirstByWorkflowRuntimeDataIdUnscoped(token: string) { + return await this.workflowTokenRepository.findFirstByWorkflowRuntimeDataIdUnscoped(token); } async findByTokenWithExpiredUnscoped(token: string) { diff --git a/services/workflows-service/src/env.ts b/services/workflows-service/src/env.ts index c7fea92bd9..2ae6264b8a 100644 --- a/services/workflows-service/src/env.ts +++ b/services/workflows-service/src/env.ts @@ -5,8 +5,6 @@ import { Base64 } from 'js-base64'; const path = process.env.CI ? '.env.example' : '.env'; -console.log('Loading environment variables from', path); - config({ path }); const urlArrayTransformer = (value: string) => { diff --git a/services/workflows-service/src/workflow/workflow.controller.external.ts b/services/workflows-service/src/workflow/workflow.controller.external.ts index 0cb564ec60..8b92ec083f 100644 --- a/services/workflows-service/src/workflow/workflow.controller.external.ts +++ b/services/workflows-service/src/workflow/workflow.controller.external.ts @@ -399,10 +399,9 @@ export class WorkflowControllerExternal { @common.HttpCode(200) @swagger.ApiForbiddenResponse({ type: errors.ForbiddenException }) async createCollectionFlowUrl( - @common.Body() - { workflowRuntimeDataId }: CreateCollectionFlowUrlDto, + @common.Body() { workflowRuntimeDataId }: CreateCollectionFlowUrlDto, ) { - const result = await this.workflowTokenService.findFirstByWorkflowruntimeDataIdUnscoped( + const result = await this.workflowTokenService.findFirstByWorkflowRuntimeDataIdUnscoped( workflowRuntimeDataId, ); diff --git a/websites/docs/package.json b/websites/docs/package.json index f6d0e166b8..dccc5e27ef 100644 --- a/websites/docs/package.json +++ b/websites/docs/package.json @@ -17,14 +17,14 @@ "dependencies": { "@astrojs/starlight": "0.11.1", "@astrojs/tailwind": "^4.0.0", - "@ballerine/common": "^0.9.66", + "@ballerine/common": "^0.9.68", "astro": "3.3.3", "sharp": "^0.32.4", "shiki": "^0.14.3" }, "devDependencies": { - "@ballerine/config": "^1.1.30", - "@ballerine/eslint-config": "^1.1.30", + "@ballerine/config": "^1.1.32", + "@ballerine/eslint-config": "^1.1.32", "eslint": "^8.46.0", "eslint-config-prettier": "^9.0.0", "eslint-config-standard-with-typescript": "^37.0.0",