@vqnguyen1/piece-fis-ibs 0.0.2 → 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 -88
- package/src/index.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/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
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.searchCustomers = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const __1 = require("../..");
|
|
8
|
-
exports.searchCustomers = (0, pieces_framework_1.createAction)({
|
|
9
|
-
name: 'customer_search',
|
|
10
|
-
auth: __1.fisIbsAuth,
|
|
11
|
-
displayName: 'Customer - Search',
|
|
12
|
-
description: 'Search for customers using various criteria.',
|
|
13
|
-
props: {
|
|
14
|
-
searchType: pieces_framework_1.Property.StaticDropdown({
|
|
15
|
-
displayName: 'Search Type',
|
|
16
|
-
description: 'Type of search to perform',
|
|
17
|
-
required: true,
|
|
18
|
-
options: {
|
|
19
|
-
options: [
|
|
20
|
-
{ label: 'By Name', value: 'name' },
|
|
21
|
-
{ label: 'By TIN (Tax ID)', value: 'tin' },
|
|
22
|
-
{ label: 'By Phone', value: 'phone' },
|
|
23
|
-
{ label: 'By Account Number', value: 'account' },
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
defaultValue: 'name',
|
|
27
|
-
}),
|
|
28
|
-
lastName: pieces_framework_1.Property.ShortText({
|
|
29
|
-
displayName: 'Last Name',
|
|
30
|
-
description: 'Customer last name (for name search)',
|
|
31
|
-
required: false,
|
|
32
|
-
}),
|
|
33
|
-
firstName: pieces_framework_1.Property.ShortText({
|
|
34
|
-
displayName: 'First Name',
|
|
35
|
-
description: 'Customer first name (for name search)',
|
|
36
|
-
required: false,
|
|
37
|
-
}),
|
|
38
|
-
tin: pieces_framework_1.Property.ShortText({
|
|
39
|
-
displayName: 'TIN (Tax ID)',
|
|
40
|
-
description: 'Tax Identification Number (for TIN search)',
|
|
41
|
-
required: false,
|
|
42
|
-
}),
|
|
43
|
-
phoneNumber: pieces_framework_1.Property.ShortText({
|
|
44
|
-
displayName: 'Phone Number',
|
|
45
|
-
description: 'Phone number (for phone search)',
|
|
46
|
-
required: false,
|
|
47
|
-
}),
|
|
48
|
-
accountNumber: pieces_framework_1.Property.ShortText({
|
|
49
|
-
displayName: 'Account Number',
|
|
50
|
-
description: 'Account number (for account search)',
|
|
51
|
-
required: false,
|
|
52
|
-
}),
|
|
53
|
-
maxRecords: pieces_framework_1.Property.Number({
|
|
54
|
-
displayName: 'Max Records',
|
|
55
|
-
description: 'Maximum number of records to return',
|
|
56
|
-
required: false,
|
|
57
|
-
defaultValue: 25,
|
|
58
|
-
}),
|
|
59
|
-
effectiveUserId: pieces_framework_1.Property.ShortText({
|
|
60
|
-
displayName: 'Effective User ID',
|
|
61
|
-
description: 'Optional: User ID for audit purposes',
|
|
62
|
-
required: false,
|
|
63
|
-
}),
|
|
64
|
-
},
|
|
65
|
-
run(context) {
|
|
66
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
const auth = context.auth;
|
|
68
|
-
const baseUrl = auth.baseUrl;
|
|
69
|
-
const { searchType, lastName, firstName, tin, phoneNumber, accountNumber, maxRecords, effectiveUserId, } = context.propsValue;
|
|
70
|
-
const uuid = crypto.randomUUID();
|
|
71
|
-
const headers = {
|
|
72
|
-
'accept': 'application/json',
|
|
73
|
-
'Content-Type': 'application/json',
|
|
74
|
-
'organization-id': auth.organizationId,
|
|
75
|
-
'source-id': auth.sourceId,
|
|
76
|
-
'application-id': auth.applicationId,
|
|
77
|
-
'uuid': uuid,
|
|
78
|
-
'ibs-authorization': auth.ibsAuthorization,
|
|
79
|
-
};
|
|
80
|
-
if (auth.securityTokenType) {
|
|
81
|
-
headers['security-token-type'] = auth.securityTokenType;
|
|
82
|
-
}
|
|
83
|
-
if (effectiveUserId) {
|
|
84
|
-
headers['effective-user-id'] = effectiveUserId;
|
|
85
|
-
}
|
|
86
|
-
// Build query parameters based on search type
|
|
87
|
-
const queryParams = {};
|
|
88
|
-
if (maxRecords) {
|
|
89
|
-
queryParams['maxRecs'] = String(maxRecords);
|
|
90
|
-
}
|
|
91
|
-
switch (searchType) {
|
|
92
|
-
case 'name':
|
|
93
|
-
if (lastName) {
|
|
94
|
-
queryParams['lastName'] = lastName;
|
|
95
|
-
}
|
|
96
|
-
if (firstName) {
|
|
97
|
-
queryParams['firstName'] = firstName;
|
|
98
|
-
}
|
|
99
|
-
break;
|
|
100
|
-
case 'tin':
|
|
101
|
-
if (tin) {
|
|
102
|
-
queryParams['tin'] = tin;
|
|
103
|
-
}
|
|
104
|
-
break;
|
|
105
|
-
case 'phone':
|
|
106
|
-
if (phoneNumber) {
|
|
107
|
-
queryParams['phone'] = phoneNumber;
|
|
108
|
-
}
|
|
109
|
-
break;
|
|
110
|
-
case 'account':
|
|
111
|
-
if (accountNumber) {
|
|
112
|
-
queryParams['acctNbr'] = accountNumber;
|
|
113
|
-
}
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
const queryString = new URLSearchParams(queryParams).toString();
|
|
117
|
-
const url = `${baseUrl}/IBSCISRCH/v4/customers${queryString ? '?' + queryString : ''}`;
|
|
118
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
119
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
120
|
-
url,
|
|
121
|
-
headers,
|
|
122
|
-
});
|
|
123
|
-
return response.body;
|
|
124
|
-
});
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
|
-
//# sourceMappingURL=search-customers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search-customers.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/fis-ibs/src/lib/actions/search-customers.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,+DAAqE;AACrE,6BAAmC;AAEtB,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,8CAA8C;IAC3D,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAClC,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE;oBACnC,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC1C,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE;oBACrC,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,SAAS,EAAE;iBACjD;aACF;YACD,YAAY,EAAE,MAAM;SACrB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,sCAAsC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