Skip to content

Commit 8a04ed5

Browse files
committed
feat(workflow-definition): add configuration examples for vendors
- Include detailed configuration examples for various vendors - Improve clarity on vendor integration and usage (These examples are so detailed, they could serve as a user manual for a rocket)
1 parent 6cf48a8 commit 8a04ed5

File tree

2 files changed

+244
-7
lines changed

2 files changed

+244
-7
lines changed

apps/workflows-dashboard/src/pages/WorkflowDefinition/WorkflowDefinition.tsx

Lines changed: 243 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,41 @@ export const VENDOR_DETAILS = {
2727
logoUrl: 'https://cdn.ballerine.io/logos/AsiaVerify_Logo.png',
2828
description:
2929
'Company screening, UBO verification and registry information services focused on APAC region',
30+
configExample: {
31+
name: 'asiaVerifyRegistryInfo',
32+
vendor: 'asia-verify',
33+
pluginKind: 'registry-information',
34+
stateNames: ['run_vendor_data'],
35+
displayName: 'Asia Verify Registry Information',
36+
errorAction: 'VENDOR_DONE',
37+
successAction: 'VENDOR_DONE',
38+
},
3039
},
3140
kyckr: {
3241
logoUrl: 'https://cdn.ballerine.io/logos/kyckr-logo.png',
3342
description: 'UBO verification and company registry information services',
43+
configExample: {
44+
name: 'kyckrRegistryInfo',
45+
vendor: 'kyckr',
46+
pluginKind: 'registry-information',
47+
stateNames: ['run_vendor_data'],
48+
displayName: 'Kyckr Registry Information',
49+
errorAction: 'VENDOR_DONE',
50+
successAction: 'VENDOR_DONE',
51+
},
3452
},
3553
test: {
3654
logoUrl: 'https://cdn.ballerine.io/logos/ballerine-logo.png',
3755
description: 'Test vendor for development purposes',
56+
configExample: {
57+
name: 'testRegistryInfo',
58+
vendor: 'test',
59+
pluginKind: 'registry-information',
60+
stateNames: ['run_vendor_data'],
61+
displayName: 'Test Registry Information',
62+
errorAction: 'VENDOR_DONE',
63+
successAction: 'VENDOR_DONE',
64+
},
3865
},
3966
},
4067
},
@@ -45,10 +72,28 @@ export const VENDOR_DETAILS = {
4572
'dow-jones': {
4673
logoUrl: 'https://cdn.ballerine.io/logos/Dow_Jones_Logo.png',
4774
description: 'Sanctions screening and risk data for individuals',
75+
configExample: {
76+
name: 'dowJonesSanctions',
77+
vendor: 'dow-jones',
78+
pluginKind: 'individual-sanctions',
79+
stateNames: ['run_vendor_data'],
80+
displayName: 'Dow Jones Individual Sanctions',
81+
errorAction: 'VENDOR_DONE',
82+
successAction: 'VENDOR_DONE',
83+
},
4884
},
4985
'comply-advantage': {
5086
logoUrl: 'https://cdn.ballerine.io/logos/comply-advantage-logo.png',
5187
description: 'AI-driven sanctions screening and monitoring for individuals',
88+
configExample: {
89+
name: 'complyAdvantageSanctions',
90+
vendor: 'comply-advantage',
91+
pluginKind: 'individual-sanctions',
92+
stateNames: ['run_vendor_data'],
93+
displayName: 'ComplyAdvantage Individual Sanctions',
94+
errorAction: 'VENDOR_DONE',
95+
successAction: 'VENDOR_DONE',
96+
},
5297
},
5398
},
5499
},
@@ -59,6 +104,15 @@ export const VENDOR_DETAILS = {
59104
test: {
60105
logoUrl: 'https://cdn.ballerine.io/logos/ballerine-logo.png',
61106
description: 'Test vendor for company sanctions screening',
107+
configExample: {
108+
name: 'companySanctions',
109+
vendor: 'test',
110+
pluginKind: 'company-sanctions',
111+
stateNames: ['run_vendor_data'],
112+
displayName: 'Company Sanctions',
113+
errorAction: 'VENDOR_DONE',
114+
successAction: 'VENDOR_DONE',
115+
},
62116
},
63117
},
64118
},
@@ -69,6 +123,15 @@ export const VENDOR_DETAILS = {
69123
test: {
70124
logoUrl: 'https://cdn.ballerine.io/logos/ballerine-logo.png',
71125
description: 'Test vendor for UBO verification',
126+
configExample: {
127+
name: 'uboVerification',
128+
vendor: 'test',
129+
pluginKind: 'ubo',
130+
stateNames: ['run_vendor_data'],
131+
displayName: 'UBO Check',
132+
errorAction: 'VENDOR_DONE',
133+
successAction: 'VENDOR_DONE',
134+
},
72135
},
73136
},
74137
},
@@ -79,6 +142,16 @@ export const VENDOR_DETAILS = {
79142
ballerine: {
80143
logoUrl: 'https://cdn.ballerine.io/logos/ballerine-logo.png',
81144
description: 'Merchant monitoring and risk assessment service',
145+
configExample: {
146+
name: 'merchantMonitoring',
147+
vendor: 'ballerine',
148+
pluginKind: 'merchant-monitoring',
149+
stateNames: ['run_merchant_monitoring'],
150+
displayName: 'Merchant Monitoring',
151+
errorAction: 'MERCHANT_MONITORING_FAILED',
152+
successAction: 'MERCHANT_MONITORING_SUCCESS',
153+
merchantMonitoringQualityControl: false,
154+
},
82155
},
83156
},
84157
},
@@ -89,6 +162,15 @@ export const VENDOR_DETAILS = {
89162
mastercard: {
90163
logoUrl: 'https://cdn.ballerine.io/logos/Mastercard%20logo.svg',
91164
description: 'Mastercard merchant screening service',
165+
configExample: {
166+
name: 'merchantScreening',
167+
vendor: 'mastercard',
168+
pluginKind: 'mastercard-merchant-screening',
169+
stateNames: ['run_vendor_data'],
170+
displayName: 'Merchant Screening',
171+
errorAction: 'VENDOR_DONE',
172+
successAction: 'VENDOR_DONE',
173+
},
92174
},
93175
},
94176
},
@@ -99,6 +181,15 @@ export const VENDOR_DETAILS = {
99181
veriff: {
100182
logoUrl: 'https://cdn.ballerine.io/logos/Veriff_logo.svg.png',
101183
description: 'KYC verification and identity proofing services',
184+
configExample: {
185+
name: 'veriffKyc',
186+
vendor: 'veriff',
187+
pluginKind: 'kyc-session',
188+
stateNames: ['run_kyc'],
189+
displayName: 'Veriff KYC Session',
190+
errorAction: 'KYC_FAILED',
191+
successAction: 'KYC_SUCCESS',
192+
},
102193
},
103194
},
104195
},
@@ -111,6 +202,14 @@ export const VENDOR_DETAILS = {
111202
ballerine: {
112203
logoUrl: 'https://cdn.ballerine.io/logos/ballerine-logo.png',
113204
description: 'Email template service',
205+
configExample: {
206+
name: 'invitation-email',
207+
template: 'invitation',
208+
pluginKind: 'template-email',
209+
stateNames: ['collection_invite'],
210+
errorAction: 'INVITATION_FAILURE',
211+
successAction: 'INVITATION_SENT',
212+
},
114213
},
115214
},
116215
},
@@ -121,6 +220,15 @@ export const VENDOR_DETAILS = {
121220
ballerine: {
122221
logoUrl: 'https://cdn.ballerine.io/logos/ballerine-logo.png',
123222
description: 'Risk rules engine service',
223+
configExample: {
224+
name: 'riskEvaluation',
225+
pluginKind: 'riskRules',
226+
stateNames: ['manual_review', 'run_vendor_data'],
227+
rulesSource: {
228+
source: 'notion',
229+
databaseId: 'd29390ac964b45b1a79ef45eed735a77',
230+
},
231+
},
124232
},
125233
},
126234
},
@@ -131,6 +239,12 @@ export const VENDOR_DETAILS = {
131239
ballerine: {
132240
logoUrl: 'https://cdn.ballerine.io/logos/ballerine-logo.png',
133241
description: 'Child workflow service',
242+
configExample: {
243+
name: 'veriff_kyc_child_plugin',
244+
initEvent: 'start',
245+
pluginKind: 'child',
246+
definitionId: 'kyc_email_session_example',
247+
},
134248
},
135249
},
136250
},
@@ -141,6 +255,12 @@ export const VENDOR_DETAILS = {
141255
ballerine: {
142256
logoUrl: 'https://cdn.ballerine.io/logos/ballerine-logo.png',
143257
description: 'Event dispatch service',
258+
configExample: {
259+
name: 'dispatchEvent',
260+
pluginKind: 'dispatch-event',
261+
stateNames: ['dispatch_event'],
262+
eventName: 'CUSTOM_EVENT',
263+
},
144264
},
145265
},
146266
},
@@ -151,6 +271,19 @@ export const VENDOR_DETAILS = {
151271
ballerine: {
152272
logoUrl: 'https://cdn.ballerine.io/logos/ballerine-logo.png',
153273
description: 'Iterative plugin service',
274+
configExample: {
275+
name: 'ubos_iterative',
276+
pluginKind: 'iterative',
277+
stateNames: ['run_ubos'],
278+
iterateOn: [
279+
{
280+
mapping: 'entity.data.additionalInfo.contacts',
281+
transformer: 'jmespath',
282+
},
283+
],
284+
errorAction: 'FAILED_EMAIL_SENT_TO_UBOS',
285+
successAction: 'EMAIL_SENT_TO_UBOS',
286+
},
154287
},
155288
},
156289
},
@@ -161,6 +294,17 @@ export const VENDOR_DETAILS = {
161294
ballerine: {
162295
logoUrl: 'https://cdn.ballerine.io/logos/ballerine-logo.png',
163296
description: 'Data transformation service',
297+
configExample: {
298+
name: 'transformData',
299+
pluginKind: 'transformer',
300+
stateNames: ['transform_data'],
301+
transformers: [
302+
{
303+
mapping: '{transformed: @}',
304+
transformer: 'jmespath',
305+
},
306+
],
307+
},
164308
},
165309
},
166310
},
@@ -171,6 +315,14 @@ export const VENDOR_DETAILS = {
171315
ballerine: {
172316
logoUrl: 'https://cdn.ballerine.io/logos/ballerine-logo.png',
173317
description: 'UI definition attachment service',
318+
configExample: {
319+
name: 'Attach APAC Flow UI',
320+
pluginKind: 'attach-ui-definition',
321+
stateNames: ['collection_flow'],
322+
errorAction: 'INVITATION_FAILURE',
323+
uiDefinitionId: 'cm500fmsi000grukeo31qdigh',
324+
expireInMinutes: 21600,
325+
},
174326
},
175327
},
176328
},
@@ -339,7 +491,7 @@ export const WorkflowDefinition = () => {
339491
([vendorKey, vendorInfo]) => (
340492
<div
341493
key={vendorKey}
342-
className="flex flex-col gap-4 rounded-xl border border-slate-200 p-6 shadow-sm"
494+
className="flex flex-col gap-4 rounded-xl border border-slate-200 p-6 shadow-sm transition-all hover:border-blue-200 hover:shadow-lg"
343495
>
344496
<div className="flex items-center gap-4">
345497
<div className="h-16 w-16 overflow-hidden rounded-lg border border-slate-100 bg-white p-2">
@@ -397,6 +549,93 @@ export const WorkflowDefinition = () => {
397549
</p>
398550
</div>
399551
</div>
552+
553+
<div className="flex flex-col gap-4">
554+
<div className="flex items-center justify-between">
555+
<span className="text-sm font-medium text-slate-700">
556+
Configuration Example
557+
</span>
558+
<Button
559+
variant="ghost"
560+
size="sm"
561+
onClick={() =>
562+
copyToClipboard(
563+
JSON.stringify(
564+
vendorInfo.configExample,
565+
null,
566+
2,
567+
),
568+
)
569+
}
570+
className="flex items-center gap-2 text-blue-600 hover:text-blue-700"
571+
>
572+
<svg
573+
xmlns="http://www.w3.org/2000/svg"
574+
className="h-4 w-4"
575+
fill="none"
576+
viewBox="0 0 24 24"
577+
stroke="currentColor"
578+
>
579+
<path
580+
strokeLinecap="round"
581+
strokeLinejoin="round"
582+
strokeWidth={2}
583+
d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"
584+
/>
585+
</svg>
586+
Copy Config
587+
</Button>
588+
</div>
589+
<pre className="overflow-x-auto rounded-lg bg-slate-50 p-4 text-sm text-slate-800">
590+
<code>
591+
{JSON.stringify(
592+
vendorInfo.configExample,
593+
null,
594+
2,
595+
)}
596+
</code>
597+
</pre>
598+
</div>
599+
600+
{vendorInfo.configExample.stateNames?.length >
601+
0 && (
602+
<div className="flex flex-wrap gap-2">
603+
{vendorInfo.configExample.stateNames?.map(
604+
(state: string) => (
605+
<span
606+
key={state}
607+
className="rounded-full border border-blue-100 bg-blue-50 px-3 py-1 text-xs font-semibold text-blue-600 shadow-sm"
608+
>
609+
{state}
610+
</span>
611+
),
612+
)}
613+
</div>
614+
)}
615+
616+
<div className="mt-auto flex flex-col gap-2 border-t border-slate-100 pt-4">
617+
{vendorInfo.configExample.successAction && (
618+
<div className="flex items-center gap-2 text-sm">
619+
<span className="font-medium text-slate-600">
620+
Success:
621+
</span>
622+
<span className="rounded-md bg-emerald-50 px-2 py-0.5 font-medium text-emerald-600">
623+
{vendorInfo.configExample.successAction}
624+
</span>
625+
</div>
626+
)}
627+
628+
{vendorInfo.configExample.errorAction && (
629+
<div className="flex items-center gap-2 text-sm">
630+
<span className="font-medium text-slate-600">
631+
Error:
632+
</span>
633+
<span className="rounded-md bg-red-50 px-2 py-0.5 font-medium text-red-600">
634+
{vendorInfo.configExample.errorAction}
635+
</span>
636+
</div>
637+
)}
638+
</div>
400639
</div>
401640
),
402641
)}
@@ -443,11 +682,9 @@ export const WorkflowDefinition = () => {
443682
) : plugin.vendor ? (
444683
<img
445684
src={
446-
// (VENDOR_DETAILS?.['api-plugins']?.[
447-
// plugin.pluginKind as keyof typeof VENDOR_DETAILS['api-plugins']
448-
// ]?.vendors?.[
449-
// plugin.vendor
450-
// ]?.logoUrl) ||
685+
// @ts-expect-error -- TODO: fix this
686+
(VENDOR_DETAILS?.['api-plugins']?.[plugin.pluginKind]
687+
?.vendors?.[plugin.vendor]?.logoUrl as string) ||
451688
`https://cdn.ballerine.io/logos/${plugin.vendor.toLowerCase()}-logo.png`
452689
}
453690
alt={plugin.vendor}

0 commit comments

Comments
 (0)