-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(wf): workflows endpoint models update * chore(versions): bump * chore(versions): bump * chore(versions): bump
- Loading branch information
Showing
9 changed files
with
210 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
packages/common/src/schemas/documents/workflow/config-schema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { Static, Type } from '@sinclair/typebox'; | ||
|
||
const SubscriptionSchema = Type.Object({ | ||
type: Type.String(), | ||
url: Type.String(), | ||
events: Type.Array(Type.String()), | ||
}); | ||
|
||
const CallbackResultSchema = Type.Object({ | ||
transformers: Type.Array(Type.Any()), | ||
action: Type.Optional(Type.String()), | ||
deliverEvent: Type.Optional(Type.String()), | ||
persistenceStates: Type.Optional(Type.Array(Type.String())), | ||
}); | ||
|
||
const ChildCallbackResultSchema = Type.Object({ | ||
definitionId: Type.String(), | ||
transformers: Type.Array(Type.Any()), | ||
action: Type.Optional(Type.String()), | ||
deliverEvent: Type.Optional(Type.String()), | ||
}); | ||
|
||
const MainRepresentativeSchema = Type.Object({ | ||
fullName: Type.String(), | ||
email: Type.String(), | ||
}); | ||
|
||
const AvailableDocumentSchema = Type.Object({ | ||
category: Type.String(), | ||
type: Type.String(), | ||
}); | ||
|
||
const language = Type.Optional(Type.String()); | ||
const initialEvent = Type.Optional(Type.String()); | ||
const subscriptions = Type.Optional(Type.Array(SubscriptionSchema)); | ||
|
||
export const WorkflowRuntimeConfigSchema = Type.Object({ | ||
language, | ||
initialEvent, | ||
subscriptions, | ||
}); | ||
|
||
export type TWorkflowRuntimeConfig = Static<typeof WorkflowRuntimeConfigSchema>; | ||
|
||
export const WorkflowConfigSchema = Type.Object({ | ||
language, | ||
initialEvent, | ||
subscriptions, | ||
isAssociatedCompanyKybEnabled: Type.Optional(Type.Boolean()), | ||
isCaseOverviewEnabled: Type.Optional(Type.Boolean()), | ||
isCaseRiskOverviewEnabled: Type.Optional(Type.Boolean()), | ||
isLegacyReject: Type.Optional(Type.Boolean()), | ||
isLockedDocumentCategoryAndType: Type.Optional(Type.Boolean()), | ||
isManualCreation: Type.Optional(Type.Boolean()), | ||
isDemo: Type.Optional(Type.Boolean()), | ||
isExample: Type.Optional(Type.Boolean()), | ||
supportedLanguages: Type.Optional(Type.Array(Type.String())), | ||
completedWhenTasksResolved: Type.Optional(Type.Boolean()), | ||
workflowLevelResolution: Type.Optional(Type.Boolean()), | ||
allowMultipleActiveWorkflows: Type.Optional(Type.Boolean()), | ||
availableDocuments: Type.Optional(Type.Array(AvailableDocumentSchema)), | ||
callbackResult: Type.Optional(CallbackResultSchema), | ||
childCallbackResults: Type.Optional(Type.Array(ChildCallbackResultSchema)), | ||
createCollectionFlowToken: Type.Optional(Type.Boolean()), | ||
mainRepresentative: Type.Optional(MainRepresentativeSchema), | ||
customerName: Type.Optional(Type.String()), | ||
enableManualCreation: Type.Optional(Type.Boolean()), | ||
kybOnExitAction: Type.Optional( | ||
Type.Union([Type.Literal('send-event'), Type.Literal('redirect-to-customer-portal')]), | ||
), | ||
reportConfig: Type.Optional(Type.Record(Type.String(), Type.Unknown())), | ||
hasUboOngoingMonitoring: Type.Optional(Type.Boolean()), | ||
maxBusinessReports: Type.Optional(Type.Number()), | ||
isMerchantMonitoringEnabled: Type.Optional(Type.Boolean()), | ||
isChatbotEnabled: Type.Optional(Type.Boolean()), | ||
}); | ||
|
||
export type TWorkflowConfig = Static<typeof WorkflowConfigSchema>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
services/workflows-service/src/workflow/schemas/workflow-run.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { defaultInputContextSchema, WorkflowRuntimeConfigSchema } from '@ballerine/common'; | ||
import { Type } from '@sinclair/typebox'; | ||
|
||
export const WorkflowRunSchema = Type.Object({ | ||
workflowId: Type.String(), | ||
context: defaultInputContextSchema, | ||
config: Type.Optional(WorkflowRuntimeConfigSchema), | ||
salesforceObjectName: Type.Optional(Type.String()), | ||
salesforceRecordId: Type.Optional(Type.String()), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters