Skip to content

Commit

Permalink
feat: added theme schemas to common & updated imports & bump (#2309)
Browse files Browse the repository at this point in the history
* feat: added theme schemas to common & updated imports & bump

* fix: lock fix

* chore(stam): trigger workflow

* Update ci.yml

---------

Co-authored-by: Alon Peretz <Alonp99@gmail.com>
  • Loading branch information
chesterkmr and alonp99 committed Apr 18, 2024
1 parent 038c346 commit 9e4f4aa
Show file tree
Hide file tree
Showing 29 changed files with 212 additions and 437 deletions.
10 changes: 10 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @ballerine/backoffice-v2

## 0.7.5

### Patch Changes

- Added workflow definition theme schemas
- Updated dependencies
- @ballerine/common@0.9.3
- @ballerine/workflow-browser-sdk@0.6.6
- @ballerine/workflow-node-sdk@0.6.6

## 0.7.4

### Patch Changes
Expand Down
8 changes: 4 additions & 4 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.4",
"version": "0.7.5",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"repository": {
Expand Down Expand Up @@ -51,10 +51,10 @@
},
"dependencies": {
"@ballerine/blocks": "0.2.2",
"@ballerine/common": "0.9.2",
"@ballerine/common": "0.9.3",
"@ballerine/ui": "^0.5.1",
"@ballerine/workflow-browser-sdk": "0.6.5",
"@ballerine/workflow-node-sdk": "0.6.5",
"@ballerine/workflow-browser-sdk": "0.6.6",
"@ballerine/workflow-node-sdk": "0.6.6",
"@fontsource/inter": "^4.5.15",
"@formkit/auto-animate": "1.0.0-beta.5",
"@hookform/resolvers": "^3.1.0",
Expand Down

This file was deleted.

17 changes: 6 additions & 11 deletions apps/backoffice-v2/src/domains/workflow-definitions/fetchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { Method } from '@/common/enums';
import { env } from '@/common/env/env';
import { getOriginUrl } from '@/common/utils/get-origin-url/get-url-origin';
import { handleZodError } from '@/common/utils/handle-zod-error/handle-zod-error';
import { ObjectWithIdSchema } from '@/lib/zod/utils/object-with-id/object-with-id';
import {
WorkflowDefinitionConfigThemeEnum,
WorkflowDefinitionConfigThemes,
} from '@/domains/workflow-definitions/enums/workflow-definition-config-theme';
import { ObjectWithIdSchema } from '@/lib/zod/utils/object-with-id/object-with-id';
import { WorkflowDefinitionVariant } from '@ballerine/common';
WorkflowDefinitionConfigThemeSchema,
WorkflowDefinitionVariant,
} from '@ballerine/common';
import { z } from 'zod';

export const PluginSchema = z.object({
Expand All @@ -18,19 +18,14 @@ export const PluginSchema = z.object({

export type TPlugin = z.infer<typeof PluginSchema>;

export const WorkflowDefinitionConfigTheme = z.object({
type: z.enum(WorkflowDefinitionConfigThemes).default(WorkflowDefinitionConfigThemeEnum.KYB),
tabsOverride: z.array(z.string()).optional(),
});

export type WorkflowDefinitionConfigTheme = z.infer<typeof WorkflowDefinitionConfigTheme>;
export type WorkflowDefinitionConfigTheme = z.infer<typeof WorkflowDefinitionConfigThemeSchema>;

export const WorkflowDefinitionConfigSchema = z
.object({
enableManualCreation: z.boolean().default(false),
isManualCreation: z.boolean().default(false),
isAssociatedCompanyKybEnabled: z.boolean().default(false),
theme: WorkflowDefinitionConfigTheme.default({
theme: WorkflowDefinitionConfigThemeSchema.default({
type: WorkflowDefinitionConfigThemeEnum.KYB,
}),
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { WorkflowDefinitionConfigThemeEnum } from '@/domains/workflow-definitions/enums/workflow-definition-config-theme';
import { WorkflowDefinitionConfigTheme } from '@/domains/workflow-definitions/fetchers';
import { TWorkflowById } from '@/domains/workflows/fetchers';
import { createAssociatedCompanyDocumentBlocks } from '@/lib/blocks/variants/DefaultBlocks/hooks/useCaseBlocksLogic/utils/create-assosiacted-company-document-blocks';
import { createKycBlocks } from '@/lib/blocks/variants/DefaultBlocks/hooks/useCaseBlocksLogic/utils/create-kyc-blocks';
import { Blocks } from '@ballerine/blocks';
import { WorkflowDefinitionConfigThemeEnum } from '@ballerine/common';

export type TCaseBlocksCreationProps = {
workflow: TWorkflowById;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { WorkflowDefinitionConfigThemeEnum } from '@/domains/workflow-definitions/enums/workflow-definition-config-theme';
import { WorkflowDefinitionConfigTheme } from '@/domains/workflow-definitions/fetchers';
import { applyTabsOverride } from '@/lib/blocks/variants/DefaultBlocks/hooks/useCaseBlocksLogic/utils/apply-tabs-override';
import { TCaseTabDefinition } from '@/lib/blocks/variants/DefaultBlocks/types/case-tab';
import { WorkflowDefinitionConfigThemeEnum } from '@ballerine/common';

export const Tab = {
SUMMARY: 'summary',
Expand Down
8 changes: 8 additions & 0 deletions apps/kyb-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# kyb-app

## 0.3.6

### Patch Changes

- Updated dependencies
- @ballerine/common@0.9.3
- @ballerine/workflow-browser-sdk@0.6.6

## 0.3.5

### Patch Changes
Expand Down
6 changes: 3 additions & 3 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.5",
"version": "0.3.6",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -15,9 +15,9 @@
},
"dependencies": {
"@ballerine/blocks": "0.2.2",
"@ballerine/common": "^0.9.2",
"@ballerine/common": "^0.9.3",
"@ballerine/ui": "0.5.2",
"@ballerine/workflow-browser-sdk": "0.6.5",
"@ballerine/workflow-browser-sdk": "0.6.6",
"@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.5

### Patch Changes

- Updated dependencies
- @ballerine/common@0.9.3
- @ballerine/workflow-browser-sdk@0.6.6

## 0.3.4

### 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.4",
"version": "0.3.5",
"type": "module",
"scripts": {
"spellcheck": "cspell \"*\"",
Expand Down Expand Up @@ -34,8 +34,8 @@
"vite": "^4.5.3"
},
"dependencies": {
"@ballerine/common": "0.9.2",
"@ballerine/workflow-browser-sdk": "0.6.5",
"@ballerine/common": "0.9.3",
"@ballerine/workflow-browser-sdk": "0.6.6",
"@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.3

### Patch Changes

- Added workflow definition theme schemas

## 0.9.2

### Patch Changes
Expand Down
8 changes: 4 additions & 4 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 <dev@ballerine.com>",
"version": "0.9.2",
"version": "0.9.3",
"description": "common",
"module": "./dist/esm/index.js",
"main": "./dist/cjs/index.js",
Expand Down Expand Up @@ -74,12 +74,12 @@
"ts-node": "^10.9.1",
"typescript": "4.9.5",
"vite": "^4.5.3",
"vitest": "^0.28.4",
"zod": "^3.22.3"
"vitest": "^0.28.4"
},
"dependencies": {
"@sinclair/typebox": "^0.31.7",
"ajv": "^8.12.0",
"json-schema-to-zod": "^0.6.3"
"json-schema-to-zod": "^0.6.3",
"zod": "^3.22.4"
}
}
14 changes: 14 additions & 0 deletions packages/common/src/consts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,17 @@ export const UnifiedApiReasons = [
export type TUnifiedApiReason = (typeof UnifiedApiReasons)[number];

export type TUnifiedApiReasons = typeof UnifiedApiReasons;

export const WorkflowDefinitionConfigThemeEnum = {
KYC: 'kyc',
KYB: 'kyb',
DOCUMENTS_REVIEW: 'documents-review',
} as const;

export const WorkflowDefinitionConfigThemes = [
WorkflowDefinitionConfigThemeEnum.KYB,
WorkflowDefinitionConfigThemeEnum.KYC,
WorkflowDefinitionConfigThemeEnum.DOCUMENTS_REVIEW,
] as const;

export type TWorkflowDefinitionConfigTheme = (typeof WorkflowDefinitionConfigThemes)[number];
17 changes: 9 additions & 8 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
export {
dump,
everyDocumentDecisionStatus,
handlePromise,
isEmptyObject,
isErrorWithCode,
isErrorWithMessage,
isErrorWithName,
isFunction,
isNonEmptyArray,
isNullish,
isObject,
everyDocumentDecisionStatus,
replaceNullsWithUndefined,
isType,
log,
noNullish,
raise,
replaceNullsWithUndefined,
safeEvery,
sleep,
someDocumentDecisionStatus,
uniqueArray,
zodErrorToReadable,
isNonEmptyArray,
isType,
zodBuilder,
zodErrorToReadable,
} from './utils';

export type { IErrorWithMessage } from './utils';

export type { Serializable, AnyRecord, LoggerInterface } from './types';
export type {
DefaultContextSchema,
TAvailableDocuments,
TDefaultSchemaDocumentPage,
TDocument,
TAvailableDocuments,
} from './schemas';
export type { AnyRecord, LoggerInterface, Serializable } from './types';

export {
getDocumentSchemaByCountry,
WorkflowDefinitionConfigThemeSchema,
defaultContextSchema,
findDocumentSchemaByTypeAndCategory,
getDocumentId,
getDocumentSchemaByCountry,
getDocumentsByCountry,
getGhanaDocuments,
} from './schemas';
Expand Down
6 changes: 3 additions & 3 deletions packages/common/src/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export { getGhanaDocuments } from './documents/workflow/documents/schemas/GH';
export {
findDocumentSchemaByTypeAndCategory,
getDocumentId,
getDocumentSchemaByCountry,
getDocumentsByCountry,
} from './documents/workflow/documents/schemas/index';
export { type TDocument } from './documents/workflow/documents/types';
export { type TAvailableDocuments } from './documents/workflow/documents/types';
export { getDocumentSchemaByCountry } from './documents/workflow/documents/schemas/index';
export { type TAvailableDocuments, type TDocument } from './documents/workflow/documents/types';
export { WorkflowDefinitionConfigThemeSchema } from './workflow/workflow-config-theme';
7 changes: 7 additions & 0 deletions packages/common/src/schemas/workflow/workflow-config-theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { WorkflowDefinitionConfigThemeEnum, WorkflowDefinitionConfigThemes } from '@/consts';
import { z } from 'zod';

export const WorkflowDefinitionConfigThemeSchema = z.object({
type: z.enum(WorkflowDefinitionConfigThemes).default(WorkflowDefinitionConfigThemeEnum.KYB),
tabsOverride: z.array(z.string()).optional(),
});
7 changes: 7 additions & 0 deletions packages/workflow-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @ballerine/workflow-core

## 0.6.6

### Patch Changes

- Updated dependencies
- @ballerine/common@0.9.3

## 0.6.5

### Patch Changes
Expand Down
4 changes: 2 additions & 2 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 <dev@ballerine.com>",
"version": "0.6.5",
"version": "0.6.6",
"description": "workflow-core",
"module": "./dist/esm/index.js",
"main": "./dist/cjs/index.js",
Expand Down Expand Up @@ -31,7 +31,7 @@
"node": ">=12"
},
"dependencies": {
"@ballerine/common": "0.9.2",
"@ballerine/common": "0.9.3",
"ajv": "^8.12.0",
"i18n-iso-countries": "^7.6.0",
"jmespath": "^0.16.0",
Expand Down

0 comments on commit 9e4f4aa

Please sign in to comment.