Skip to content

Commit

Permalink
Created JS individuals screening plugin (#2855)
Browse files Browse the repository at this point in the history
* test(workflow-core): added remaining tests

* fix(workflow-core): fixed missing clientId

* fix(*): fixed issues

* fix(workflow-core): fixed log for transformer

* chore(*): updated packages
  • Loading branch information
Omri-Levy authored Nov 25, 2024
1 parent ca5299c commit d73a9bb
Show file tree
Hide file tree
Showing 35 changed files with 1,967 additions and 622 deletions.
11 changes: 11 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @ballerine/backoffice-v2

## 0.7.71

### Patch Changes

- Updated dependencies
- @ballerine/common@0.9.53
- @ballerine/ui@0.5.46
- @ballerine/workflow-browser-sdk@0.6.67
- @ballerine/workflow-node-sdk@0.6.67
- @ballerine/react-pdf-toolkit@1.2.46

## 0.7.70

### Patch Changes
Expand Down
12 changes: 6 additions & 6 deletions apps/backoffice-v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ballerine/backoffice-v2",
"version": "0.7.70",
"version": "0.7.71",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"type": "module",
Expand Down Expand Up @@ -52,11 +52,11 @@
},
"dependencies": {
"@ballerine/blocks": "0.2.27",
"@ballerine/common": "0.9.52",
"@ballerine/react-pdf-toolkit": "^1.2.45",
"@ballerine/ui": "^0.5.45",
"@ballerine/workflow-browser-sdk": "0.6.66",
"@ballerine/workflow-node-sdk": "0.6.66",
"@ballerine/common": "0.9.53",
"@ballerine/react-pdf-toolkit": "^1.2.46",
"@ballerine/ui": "^0.5.46",
"@ballerine/workflow-browser-sdk": "0.6.67",
"@ballerine/workflow-node-sdk": "0.6.67",
"@botpress/webchat": "^2.1.10",
"@botpress/webchat-generator": "^0.2.9",
"@fontsource/inter": "^4.5.15",
Expand Down
2 changes: 1 addition & 1 deletion apps/backoffice-v2/src/common/utils/fetcher/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const fetcher: IFetcher = async ({
return await handlePromise(res.blob());
}

if (!res.headers.get('content-length') || res.headers.get('content-length') > '0') {
if (!res.headers.get('content-length') || Number(res.headers.get('content-length')) > 0) {
// TODO: make sure its json by checking the content-type in order to safe access to json method
return await handlePromise(res.json());
}
Expand Down
9 changes: 9 additions & 0 deletions apps/kyb-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# kyb-app

## 0.3.82

### Patch Changes

- Updated dependencies
- @ballerine/common@0.9.53
- @ballerine/ui@0.5.46
- @ballerine/workflow-browser-sdk@0.6.67

## 0.3.81

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions apps/kyb-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/kyb-app",
"private": true,
"version": "0.3.81",
"version": "0.3.82",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -16,9 +16,9 @@
},
"dependencies": {
"@ballerine/blocks": "0.2.27",
"@ballerine/common": "^0.9.52",
"@ballerine/ui": "0.5.45",
"@ballerine/workflow-browser-sdk": "0.6.66",
"@ballerine/common": "^0.9.53",
"@ballerine/ui": "0.5.46",
"@ballerine/workflow-browser-sdk": "0.6.67",
"@lukemorales/query-key-factory": "^1.0.3",
"@radix-ui/react-icons": "^1.3.0",
"@rjsf/core": "^5.9.0",
Expand Down
8 changes: 8 additions & 0 deletions examples/headless-example/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @ballerine/headless-example

## 0.3.66

### Patch Changes

- Updated dependencies
- @ballerine/common@0.9.53
- @ballerine/workflow-browser-sdk@0.6.67

## 0.3.65

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions examples/headless-example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/headless-example",
"private": true,
"version": "0.3.65",
"version": "0.3.66",
"type": "module",
"scripts": {
"spellcheck": "cspell \"*\"",
Expand Down Expand Up @@ -34,8 +34,8 @@
"vite": "^4.5.3"
},
"dependencies": {
"@ballerine/common": "0.9.52",
"@ballerine/workflow-browser-sdk": "0.6.66",
"@ballerine/common": "0.9.53",
"@ballerine/workflow-browser-sdk": "0.6.67",
"@felte/reporter-svelte": "^1.1.5",
"@felte/validator-zod": "^1.0.13",
"@fontsource/inter": "^4.5.15",
Expand Down
6 changes: 6 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @ballerine/common

## 0.9.53

### Patch Changes

- Created a non JMESPath sanctions plugin using JS

## 0.9.52

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": false,
"name": "@ballerine/common",
"author": "Ballerine <[email protected]>",
"version": "0.9.52",
"version": "0.9.53",
"description": "common",
"module": "./dist/esm/index.js",
"main": "./dist/cjs/index.js",
Expand Down Expand Up @@ -89,6 +89,6 @@
"lodash.get": "^4.4.2",
"lodash.isempty": "^4.4.0",
"xstate": "^5.18.2",
"zod": "^3.22.4"
"zod": "^3.23.4"
}
}
5 changes: 4 additions & 1 deletion packages/common/src/utils/safe-every/safe-every.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export const safeEvery = <TItem>(array: Array<TItem>, predicate: (item: TItem) => boolean) => {
export const safeEvery = <TItem>(
array: TItem[] | readonly TItem[],
predicate: (item: TItem) => boolean,
) => {
if (!Array.isArray(array) || !array?.length) return false;

return array.every(predicate);
Expand Down
7 changes: 7 additions & 0 deletions packages/react-pdf-toolkit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @ballerine/react-pdf-toolkit

## 1.2.46

### Patch Changes

- Updated dependencies
- @ballerine/ui@0.5.46

## 1.2.45

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/react-pdf-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/react-pdf-toolkit",
"private": false,
"version": "1.2.45",
"version": "1.2.46",
"types": "./dist/build.d.ts",
"main": "./dist/react-pdf-toolkit.js",
"module": "./dist/react-pdf-toolkit.mjs",
Expand All @@ -27,7 +27,7 @@
},
"dependencies": {
"@ballerine/config": "^1.1.25",
"@ballerine/ui": "0.5.45",
"@ballerine/ui": "0.5.46",
"@react-pdf/renderer": "^3.1.14",
"@sinclair/typebox": "^0.31.7",
"ajv": "^8.12.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @ballerine/ui

## 0.5.46

### Patch Changes

- Created a non JMESPath sanctions plugin using JS
- Updated dependencies
- @ballerine/common@0.9.53

## 0.5.45

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/ui",
"private": false,
"version": "0.5.45",
"version": "0.5.46",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -26,7 +26,7 @@
"test": "vitest run"
},
"dependencies": {
"@ballerine/common": "^0.9.52",
"@ballerine/common": "^0.9.53",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.14.2",
Expand Down Expand Up @@ -62,7 +62,7 @@
"react-phone-input-2": "^2.15.1",
"string-ts": "^1.2.0",
"tailwind-merge": "^1.10.0",
"zod": "^3.22.4"
"zod": "^3.23.4"
},
"devDependencies": {
"@ballerine/config": "^1.1.25",
Expand Down
8 changes: 8 additions & 0 deletions packages/workflow-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @ballerine/workflow-core

## 0.6.67

### Patch Changes

- Created a non JMESPath sanctions plugin using JS
- Updated dependencies
- @ballerine/common@0.9.53

## 0.6.66

### Patch Changes
Expand Down
10 changes: 7 additions & 3 deletions packages/workflow-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/workflow-core",
"author": "Ballerine <[email protected]>",
"version": "0.6.66",
"version": "0.6.67",
"description": "workflow-core",
"module": "./dist/esm/index.js",
"main": "./dist/cjs/index.js",
Expand Down Expand Up @@ -31,15 +31,18 @@
"node": ">=12"
},
"dependencies": {
"@ballerine/common": "0.9.52",
"@ballerine/common": "0.9.53",
"ajv": "^8.12.0",
"country-state-city": "^3.1.4",
"i18n-iso-countries": "^7.6.0",
"jmespath": "^0.16.0",
"json-logic-js": "^2.0.2",
"lodash.get": "^4.4.2",
"lodash.groupby": "^4.6.0",
"lodash.maxby": "^4.6.0",
"xstate": "^4.35.2"
"outvariant": "^1.4.3",
"xstate": "^4.35.2",
"zod": "3.23.4"
},
"devDependencies": {
"@babel/core": "7.17.9",
Expand All @@ -58,6 +61,7 @@
"@types/fs-extra": "^11.0.1",
"@types/jmespath": "^0.15.0",
"@types/json-logic-js": "^2.0.1",
"@types/lodash.get": "^4.4.9",
"@types/lodash.groupby": "^4.6.9",
"@types/lodash.maxby": "^4.6.9",
"@types/lodash.merge": "^4.6.9",
Expand Down
3 changes: 3 additions & 0 deletions packages/workflow-core/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ObjectValues } from './types';
import { BALLERINE_API_PLUGINS } from './plugins/external-plugin/vendor-consts';
import { BallerineApiPlugin } from './plugins/external-plugin/ballerine-plugin';
import { BallerineEmailPlugin } from './plugins/external-plugin/ballerine-email-plugin';
import { IndividualsSanctionsV2Plugin } from './plugins/external-plugin/individuals-sanctions-v2-plugin/individuals-sanctions-v2-plugin';

export const PluginKind = {
KYC: 'kyc',
Expand All @@ -16,6 +17,7 @@ export const PluginKind = {
API: 'api',
EMAIL: 'email',
MASTERCARD_MERCHANT_SCREENING: 'mastercard-merchant-screening',
INDIVIDUAL_SANCTIONS_V2: 'individual-sanctions-v2',
} as const;

export const pluginsRegistry = {
Expand All @@ -25,6 +27,7 @@ export const pluginsRegistry = {
[PluginKind.API]: ApiPlugin,
[PluginKind.EMAIL]: EmailPlugin,
[PluginKind.MASTERCARD_MERCHANT_SCREENING]: MastercardMerchantScreeningPlugin,
[PluginKind.INDIVIDUAL_SANCTIONS_V2]: IndividualsSanctionsV2Plugin,
[BALLERINE_API_PLUGINS['individual-sanctions']]: BallerineApiPlugin,
[BALLERINE_API_PLUGINS['company-sanctions']]: BallerineApiPlugin,
[BALLERINE_API_PLUGINS['ubo']]: BallerineApiPlugin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export class ApiPlugin {
ok: boolean;
json: () => Promise<unknown>;
statusText: string;
headers: Headers;
}> {
let _url: string = url;

Expand Down Expand Up @@ -189,6 +190,7 @@ export class ApiPlugin {
ok: true,
json: () => Promise.resolve({ statusCode: res.status }),
statusText: 'OK',
headers: res.headers,
};
}

Expand Down
Loading

0 comments on commit d73a9bb

Please sign in to comment.