-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "feat: email plugins support (#2611)"
This reverts commit d8b55d3.
- Loading branch information
1 parent
224283c
commit e49806f
Showing
35 changed files
with
1,085 additions
and
1,367 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
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
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
50 changes: 50 additions & 0 deletions
50
packages/workflow-core/src/lib/plugins/common-plugin/ballerine-plugin.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,50 @@ | ||
import { WorkflowRunner } from '../../workflow-runner'; | ||
import { ApiPlugin, IApiPluginParams } from '../external-plugin'; | ||
import { ApiBallerinePlugins, BALLERINE_API_PLUGIN_FACTORY } from './vendor-consts'; | ||
|
||
export interface IBallerineApiPluginParams { | ||
pluginKind: ApiBallerinePlugins; | ||
vendor?: string; | ||
displayName: string | undefined; | ||
stateNames: string[]; | ||
} | ||
|
||
export class BallerineApiPlugin extends ApiPlugin { | ||
public static pluginType = 'http'; | ||
|
||
constructor(params: IBallerineApiPluginParams & IApiPluginParams) { | ||
let optionsFactoryFn: any = BALLERINE_API_PLUGIN_FACTORY[params.pluginKind]; | ||
|
||
if (!optionsFactoryFn) { | ||
throw new Error(`Unknown plugin kind: ${params.pluginKind}`); | ||
} | ||
|
||
if ( | ||
params.pluginKind === 'individual-sanctions' || | ||
params.pluginKind === 'company-sanctions' || | ||
params.pluginKind === 'ubo' | ||
) { | ||
if (!params.vendor) { | ||
throw new Error(`Missed vendor for: ${params.pluginKind}`); | ||
} | ||
|
||
optionsFactoryFn = (optionsFactoryFn as any)[params.vendor]; | ||
} | ||
|
||
const options = optionsFactoryFn(params as any); | ||
|
||
let { requestTransformer, requestValidator, responseTransformer, responseValidator } = | ||
WorkflowRunner.reqResTransformersObj({ | ||
params, | ||
...options, | ||
}); | ||
|
||
super({ | ||
persistResponseDestination: undefined, | ||
...params, | ||
...options, | ||
request: { transformers: requestTransformer, schemaValidator: requestValidator } as any, | ||
response: { transformers: responseTransformer, schemaValidator: responseValidator } as any, | ||
}); | ||
} | ||
} |
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
Oops, something went wrong.