@vqnguyen1/piece-fis-ibs 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/project.json +22 -0
- package/src/index.ts +320 -0
- package/src/lib/actions/bank-control.ts +378 -0
- package/src/lib/actions/customer.ts +1574 -0
- package/src/lib/actions/deposit.ts +749 -0
- package/src/lib/actions/get-customer.ts +73 -0
- package/src/lib/actions/loan.ts +925 -0
- package/src/lib/actions/search-customers.ts +143 -0
- package/src/lib/actions/security.ts +170 -0
- package/tsconfig.json +19 -0
- package/tsconfig.lib.json +10 -0
- package/src/index.d.ts +0 -16
- package/src/index.js +0 -204
- package/src/index.js.map +0 -1
- package/src/lib/actions/bank-control.d.ts +0 -110
- package/src/lib/actions/bank-control.js +0 -371
- package/src/lib/actions/bank-control.js.map +0 -1
- package/src/lib/actions/customer.d.ts +0 -888
- package/src/lib/actions/customer.js +0 -1563
- package/src/lib/actions/customer.js.map +0 -1
- package/src/lib/actions/deposit.d.ts +0 -406
- package/src/lib/actions/deposit.js +0 -739
- package/src/lib/actions/deposit.js.map +0 -1
- package/src/lib/actions/get-customer.d.ts +0 -12
- package/src/lib/actions/get-customer.js +0 -69
- package/src/lib/actions/get-customer.js.map +0 -1
- package/src/lib/actions/loan.d.ts +0 -506
- package/src/lib/actions/loan.js +0 -910
- package/src/lib/actions/loan.js.map +0 -1
- package/src/lib/actions/search-customers.d.ts +0 -17
- package/src/lib/actions/search-customers.js +0 -127
- package/src/lib/actions/search-customers.js.map +0 -1
- package/src/lib/actions/security.d.ts +0 -38
- package/src/lib/actions/security.js +0 -173
- package/src/lib/actions/security.js.map +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAction,
|
|
3
|
+
Property,
|
|
4
|
+
} from '@activepieces/pieces-framework';
|
|
5
|
+
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
|
|
6
|
+
import { fisIbsAuth } from '../..';
|
|
7
|
+
|
|
8
|
+
export const getCustomer = createAction({
|
|
9
|
+
name: 'customer_get',
|
|
10
|
+
auth: fisIbsAuth,
|
|
11
|
+
displayName: 'Customer - Get',
|
|
12
|
+
description: 'Retrieve customer information by customer number.',
|
|
13
|
+
props: {
|
|
14
|
+
customerNumber: Property.ShortText({
|
|
15
|
+
displayName: 'Customer Number',
|
|
16
|
+
description: 'The customer number to retrieve',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
effectiveUserId: Property.ShortText({
|
|
20
|
+
displayName: 'Effective User ID',
|
|
21
|
+
description: 'Optional: User ID for audit purposes',
|
|
22
|
+
required: false,
|
|
23
|
+
}),
|
|
24
|
+
safIndicator: Property.StaticDropdown({
|
|
25
|
+
displayName: 'SAF Indicator',
|
|
26
|
+
description: 'Store and forward indicator',
|
|
27
|
+
required: false,
|
|
28
|
+
options: {
|
|
29
|
+
options: [
|
|
30
|
+
{ label: 'Yes', value: 'Y' },
|
|
31
|
+
{ label: 'No', value: 'N' },
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
},
|
|
36
|
+
async run(context) {
|
|
37
|
+
const auth = context.auth as any;
|
|
38
|
+
const baseUrl = auth.baseUrl;
|
|
39
|
+
const { customerNumber, effectiveUserId, safIndicator } = context.propsValue;
|
|
40
|
+
|
|
41
|
+
const uuid = crypto.randomUUID();
|
|
42
|
+
|
|
43
|
+
const headers: Record<string, string> = {
|
|
44
|
+
'accept': 'application/json',
|
|
45
|
+
'Content-Type': 'application/json',
|
|
46
|
+
'organization-id': auth.organizationId,
|
|
47
|
+
'source-id': auth.sourceId,
|
|
48
|
+
'application-id': auth.applicationId,
|
|
49
|
+
'uuid': uuid,
|
|
50
|
+
'ibs-authorization': auth.ibsAuthorization,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
if (auth.securityTokenType) {
|
|
54
|
+
headers['security-token-type'] = auth.securityTokenType;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (effectiveUserId) {
|
|
58
|
+
headers['effective-user-id'] = effectiveUserId;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (safIndicator) {
|
|
62
|
+
headers['saf-indicator'] = safIndicator;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const response = await httpClient.sendRequest({
|
|
66
|
+
method: HttpMethod.GET,
|
|
67
|
+
url: `${baseUrl}/IBSCICUST/v4/customers/${customerNumber}`,
|
|
68
|
+
headers,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return response.body;
|
|
72
|
+
},
|
|
73
|
+
});
|