@vqnguyen1/piece-fis-horizon 0.0.2 → 0.0.4
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 +534 -0
- package/src/lib/actions/account-aggregation.ts +360 -0
- package/src/lib/actions/account-restrictions.ts +2427 -0
- package/src/lib/actions/bank-controls.ts +2328 -0
- package/src/lib/actions/card.ts +488 -0
- package/src/lib/actions/collateral.ts +696 -0
- package/src/lib/actions/customer.ts +1691 -0
- package/src/lib/actions/demand-deposit-savings.ts +731 -0
- package/src/lib/actions/get-authorization-token.ts +73 -0
- package/src/lib/actions/loans.ts +902 -0
- package/src/lib/actions/mortgage-loan.ts +1426 -0
- package/src/lib/actions/ready-reserve.ts +818 -0
- package/src/lib/actions/safe-deposit.ts +1506 -0
- package/src/lib/actions/search-customer-relationship-summary.ts +140 -0
- package/src/lib/actions/time-deposit.ts +2922 -0
- package/src/lib/actions/transactions.ts +1310 -0
- package/src/lib/actions/transfers.ts +1581 -0
- package/src/lib/actions/user-security.ts +1032 -0
- package/tsconfig.json +19 -0
- package/tsconfig.lib.json +10 -0
- package/src/index.d.ts +0 -12
- package/src/index.js +0 -62
- package/src/index.js.map +0 -1
- package/src/lib/actions/get-authorization-token.d.ts +0 -10
- package/src/lib/actions/get-authorization-token.js +0 -68
- package/src/lib/actions/get-authorization-token.js.map +0 -1
- package/src/lib/actions/search-customer-relationship-summary.d.ts +0 -15
- package/src/lib/actions/search-customer-relationship-summary.js +0 -122
- package/src/lib/actions/search-customer-relationship-summary.js.map +0 -1
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAction,
|
|
3
|
+
Property,
|
|
4
|
+
} from '@activepieces/pieces-framework';
|
|
5
|
+
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
|
|
6
|
+
import { fisHorizonAuth } from '../..';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Account Aggregation - Inquiry
|
|
10
|
+
* GET /accounts/{applicationCode}/{accountNumber}
|
|
11
|
+
* Fetch basic information for an account
|
|
12
|
+
*/
|
|
13
|
+
export const accountAggregationInquiry = createAction({
|
|
14
|
+
name: 'account_aggregation_inquiry',
|
|
15
|
+
auth: fisHorizonAuth,
|
|
16
|
+
displayName: 'Account Aggregation - Inquiry',
|
|
17
|
+
description: 'Fetch basic information for an account. This inquiry is designed to retrieve basic information relating to an account.',
|
|
18
|
+
props: {
|
|
19
|
+
xAuthorization: Property.ShortText({
|
|
20
|
+
displayName: 'Horizon Authorization Token',
|
|
21
|
+
description: 'JWT Bearer token for authorization (e.g., Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...)',
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
applicationCode: Property.ShortText({
|
|
25
|
+
displayName: 'Application Code',
|
|
26
|
+
description: 'Any Application beginning with X, Y or Z, excluding YE. Valid Values: Xx, Yx, Zx (where x = 0-9 or A-Z except YE). Max 2 characters.',
|
|
27
|
+
required: true,
|
|
28
|
+
}),
|
|
29
|
+
accountNumber: Property.ShortText({
|
|
30
|
+
displayName: 'Account Number',
|
|
31
|
+
description: 'Up to 20 digit zero filled account number.',
|
|
32
|
+
required: true,
|
|
33
|
+
}),
|
|
34
|
+
customerId: Property.ShortText({
|
|
35
|
+
displayName: 'Customer ID',
|
|
36
|
+
description: 'Optional: Specifies the unique identifier associated with a customer. Right-justified, zero filled, up to 14 digits.',
|
|
37
|
+
required: false,
|
|
38
|
+
}),
|
|
39
|
+
returnUppercase: Property.StaticDropdown({
|
|
40
|
+
displayName: 'Return Uppercase',
|
|
41
|
+
description: 'Optional: Whether to return data in uppercase.',
|
|
42
|
+
required: false,
|
|
43
|
+
options: {
|
|
44
|
+
options: [
|
|
45
|
+
{ label: 'Yes', value: 'Y' },
|
|
46
|
+
{ label: 'No', value: 'N' },
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
sourceId: Property.ShortText({
|
|
51
|
+
displayName: 'Source ID',
|
|
52
|
+
description: 'Optional: 6 character ID provided by FIS.',
|
|
53
|
+
required: false,
|
|
54
|
+
}),
|
|
55
|
+
},
|
|
56
|
+
async run(context) {
|
|
57
|
+
const auth = context.auth as any;
|
|
58
|
+
const baseUrl = auth.baseUrl;
|
|
59
|
+
const organizationId = auth.organizationId;
|
|
60
|
+
const { xAuthorization, applicationCode, accountNumber, customerId, returnUppercase, sourceId } = context.propsValue;
|
|
61
|
+
|
|
62
|
+
const uuid = crypto.randomUUID();
|
|
63
|
+
|
|
64
|
+
const headers: Record<string, string> = {
|
|
65
|
+
'accept': 'application/json',
|
|
66
|
+
'Content-Type': 'application/json',
|
|
67
|
+
'organization-id': organizationId,
|
|
68
|
+
'uuid': uuid,
|
|
69
|
+
'horizon-authorization': xAuthorization,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
if (sourceId) {
|
|
73
|
+
headers['source-id'] = sourceId;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
let url = `${baseUrl}/account-aggregation/v1/accounts/${encodeURIComponent(applicationCode)}/${encodeURIComponent(accountNumber)}`;
|
|
77
|
+
|
|
78
|
+
const queryParams: string[] = [];
|
|
79
|
+
if (customerId) {
|
|
80
|
+
queryParams.push(`customerId=${encodeURIComponent(customerId)}`);
|
|
81
|
+
}
|
|
82
|
+
if (returnUppercase) {
|
|
83
|
+
queryParams.push(`returnUppercase=${encodeURIComponent(returnUppercase)}`);
|
|
84
|
+
}
|
|
85
|
+
if (queryParams.length > 0) {
|
|
86
|
+
url += '?' + queryParams.join('&');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const response = await httpClient.sendRequest({
|
|
90
|
+
method: HttpMethod.GET,
|
|
91
|
+
url,
|
|
92
|
+
headers,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
return response.body;
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Account Aggregation - Get
|
|
101
|
+
* GET /accounts/{applicationCode}/{accountNumber}/aggregation
|
|
102
|
+
* Retrieve aggregate account data
|
|
103
|
+
*/
|
|
104
|
+
export const accountAggregationGet = createAction({
|
|
105
|
+
name: 'account_aggregation_get',
|
|
106
|
+
auth: fisHorizonAuth,
|
|
107
|
+
displayName: 'Account Aggregation - Get',
|
|
108
|
+
description: 'Retrieve aggregate account data. This transaction is designed to retrieve aggregate account data.',
|
|
109
|
+
props: {
|
|
110
|
+
xAuthorization: Property.ShortText({
|
|
111
|
+
displayName: 'Horizon Authorization Token',
|
|
112
|
+
description: 'JWT Bearer token for authorization (e.g., Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...)',
|
|
113
|
+
required: true,
|
|
114
|
+
}),
|
|
115
|
+
applicationCode: Property.ShortText({
|
|
116
|
+
displayName: 'Application Code',
|
|
117
|
+
description: 'Any Application beginning with X, Y or Z, excluding YE. Valid Values: Xx, Yx, Zx (where x = 0-9 or A-Z except YE). Max 2 characters.',
|
|
118
|
+
required: true,
|
|
119
|
+
}),
|
|
120
|
+
accountNumber: Property.ShortText({
|
|
121
|
+
displayName: 'Account Number',
|
|
122
|
+
description: 'Account number. To be able to find both numeric and alpha-numeric account number, do not zero fill with leading or trailing zeroes. Max 20 characters.',
|
|
123
|
+
required: true,
|
|
124
|
+
}),
|
|
125
|
+
sourceId: Property.ShortText({
|
|
126
|
+
displayName: 'Source ID',
|
|
127
|
+
description: 'Optional: 6 character ID provided by FIS.',
|
|
128
|
+
required: false,
|
|
129
|
+
}),
|
|
130
|
+
},
|
|
131
|
+
async run(context) {
|
|
132
|
+
const auth = context.auth as any;
|
|
133
|
+
const baseUrl = auth.baseUrl;
|
|
134
|
+
const organizationId = auth.organizationId;
|
|
135
|
+
const { xAuthorization, applicationCode, accountNumber, sourceId } = context.propsValue;
|
|
136
|
+
|
|
137
|
+
const uuid = crypto.randomUUID();
|
|
138
|
+
|
|
139
|
+
const headers: Record<string, string> = {
|
|
140
|
+
'accept': 'application/json',
|
|
141
|
+
'Content-Type': 'application/json',
|
|
142
|
+
'organization-id': organizationId,
|
|
143
|
+
'uuid': uuid,
|
|
144
|
+
'horizon-authorization': xAuthorization,
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
if (sourceId) {
|
|
148
|
+
headers['source-id'] = sourceId;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const url = `${baseUrl}/account-aggregation/v1/accounts/${encodeURIComponent(applicationCode)}/${encodeURIComponent(accountNumber)}/aggregation`;
|
|
152
|
+
|
|
153
|
+
const response = await httpClient.sendRequest({
|
|
154
|
+
method: HttpMethod.GET,
|
|
155
|
+
url,
|
|
156
|
+
headers,
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
return response.body;
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Account Aggregation - Transactions
|
|
165
|
+
* GET /accounts/{applicationCode}/{accountNumber}/transactions
|
|
166
|
+
* Fetch a list of historic transactions
|
|
167
|
+
*/
|
|
168
|
+
export const accountAggregationTransactions = createAction({
|
|
169
|
+
name: 'account_aggregation_transactions',
|
|
170
|
+
auth: fisHorizonAuth,
|
|
171
|
+
displayName: 'Account Aggregation - Transactions',
|
|
172
|
+
description: 'Fetch a list of historic transactions. This inquiry is designed to retrieve a list of transactions from history for a specific application and account.',
|
|
173
|
+
props: {
|
|
174
|
+
xAuthorization: Property.ShortText({
|
|
175
|
+
displayName: 'Horizon Authorization Token',
|
|
176
|
+
description: 'JWT Bearer token for authorization (e.g., Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...)',
|
|
177
|
+
required: true,
|
|
178
|
+
}),
|
|
179
|
+
applicationCode: Property.ShortText({
|
|
180
|
+
displayName: 'Application Code',
|
|
181
|
+
description: 'Any Application beginning with X, Y or Z, excluding YE. Valid Values: Xx, Yx, Zx (where x = 0-9 or A-Z except YE). Max 2 characters.',
|
|
182
|
+
required: true,
|
|
183
|
+
}),
|
|
184
|
+
accountNumber: Property.ShortText({
|
|
185
|
+
displayName: 'Account Number',
|
|
186
|
+
description: 'Up to 20 digit zero filled account number.',
|
|
187
|
+
required: true,
|
|
188
|
+
}),
|
|
189
|
+
dateSelectOption: Property.StaticDropdown({
|
|
190
|
+
displayName: 'Date Select Option',
|
|
191
|
+
description: 'Specifies how to select transactions by date.',
|
|
192
|
+
required: true,
|
|
193
|
+
options: {
|
|
194
|
+
options: [
|
|
195
|
+
{ label: 'M - Return only Today\'s memo posted transactions', value: 'M' },
|
|
196
|
+
{ label: 'P - All transactions posted during the last BOSS processing run', value: 'P' },
|
|
197
|
+
{ label: 'R - User specified date range (Effective Dates)', value: 'R' },
|
|
198
|
+
{ label: 'S - All transactions since the last statement date', value: 'S' },
|
|
199
|
+
{ label: 'T - User specified date range (Transaction Dates)', value: 'T' },
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
}),
|
|
203
|
+
firstNext: Property.StaticDropdown({
|
|
204
|
+
displayName: 'First/Next',
|
|
205
|
+
description: 'Indicates if this is the first request or a subsequent request for more data.',
|
|
206
|
+
required: true,
|
|
207
|
+
options: {
|
|
208
|
+
options: [
|
|
209
|
+
{ label: 'F - First request', value: 'F' },
|
|
210
|
+
{ label: 'N - Next request for additional transactions', value: 'N' },
|
|
211
|
+
],
|
|
212
|
+
},
|
|
213
|
+
}),
|
|
214
|
+
numberToReturn: Property.Number({
|
|
215
|
+
displayName: 'Number to Return',
|
|
216
|
+
description: 'Number of transactions to return at a time. A value of 999 returns as many records as can fit in the buffer.',
|
|
217
|
+
required: true,
|
|
218
|
+
defaultValue: 999,
|
|
219
|
+
}),
|
|
220
|
+
beginDate: Property.Number({
|
|
221
|
+
displayName: 'Begin Date',
|
|
222
|
+
description: 'Optional: Only valid when Date Select Option is R, T, or M. Retrieves all history transactions greater than or equal to this date. Format YYYYMMDD.',
|
|
223
|
+
required: false,
|
|
224
|
+
}),
|
|
225
|
+
endDate: Property.Number({
|
|
226
|
+
displayName: 'End Date',
|
|
227
|
+
description: 'Optional: Only valid when Date Select Option is R or T. Retrieves all history transactions ending with this date. Format YYYYMMDD. If zero, defaults to 99999999.',
|
|
228
|
+
required: false,
|
|
229
|
+
}),
|
|
230
|
+
sequenceOption: Property.StaticDropdown({
|
|
231
|
+
displayName: 'Sequence Option',
|
|
232
|
+
description: 'Optional: Order of returned transactions.',
|
|
233
|
+
required: false,
|
|
234
|
+
options: {
|
|
235
|
+
options: [
|
|
236
|
+
{ label: 'A - Ascending order', value: 'A' },
|
|
237
|
+
{ label: 'D - Descending order', value: 'D' },
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
}),
|
|
241
|
+
returnMemoPostTransaction: Property.StaticDropdown({
|
|
242
|
+
displayName: 'Return Memo Post Transaction',
|
|
243
|
+
description: 'Optional: Whether to return memo post transactions.',
|
|
244
|
+
required: false,
|
|
245
|
+
options: {
|
|
246
|
+
options: [
|
|
247
|
+
{ label: 'A - Return all of today\'s memo post transactions', value: 'A' },
|
|
248
|
+
{ label: 'Y - Return today\'s memo post transactions (excluding those not affecting available balance)', value: 'Y' },
|
|
249
|
+
{ label: 'N - Do not return memo post transactions', value: 'N' },
|
|
250
|
+
],
|
|
251
|
+
},
|
|
252
|
+
}),
|
|
253
|
+
returnPackagePostItems: Property.StaticDropdown({
|
|
254
|
+
displayName: 'Return Package Post Items',
|
|
255
|
+
description: 'Optional: Whether to return package post items.',
|
|
256
|
+
required: false,
|
|
257
|
+
options: {
|
|
258
|
+
options: [
|
|
259
|
+
{ label: 'A - Return all items (including PKPST)', value: 'A' },
|
|
260
|
+
{ label: 'P - Return history items and package posted check', value: 'P' },
|
|
261
|
+
],
|
|
262
|
+
},
|
|
263
|
+
}),
|
|
264
|
+
returnScheduledExternalTransfers: Property.StaticDropdown({
|
|
265
|
+
displayName: 'Return Scheduled External Transfers',
|
|
266
|
+
description: 'Optional: Whether to return scheduled Auto Transfers. Only works for LN and ML Internal Credit Auto Transfers.',
|
|
267
|
+
required: false,
|
|
268
|
+
options: {
|
|
269
|
+
options: [
|
|
270
|
+
{ label: 'Y - Return scheduled Auto Transfers', value: 'Y' },
|
|
271
|
+
{ label: 'N - Do not return scheduled Auto Transfers', value: 'N' },
|
|
272
|
+
],
|
|
273
|
+
},
|
|
274
|
+
}),
|
|
275
|
+
searchToken: Property.ShortText({
|
|
276
|
+
displayName: 'Search Token',
|
|
277
|
+
description: 'Optional: Search Token for stateless middleware processing. Max 20 characters.',
|
|
278
|
+
required: false,
|
|
279
|
+
}),
|
|
280
|
+
sourceId: Property.ShortText({
|
|
281
|
+
displayName: 'Source ID',
|
|
282
|
+
description: 'Optional: 6 character ID provided by FIS.',
|
|
283
|
+
required: false,
|
|
284
|
+
}),
|
|
285
|
+
},
|
|
286
|
+
async run(context) {
|
|
287
|
+
const auth = context.auth as any;
|
|
288
|
+
const baseUrl = auth.baseUrl;
|
|
289
|
+
const organizationId = auth.organizationId;
|
|
290
|
+
const {
|
|
291
|
+
xAuthorization,
|
|
292
|
+
applicationCode,
|
|
293
|
+
accountNumber,
|
|
294
|
+
dateSelectOption,
|
|
295
|
+
firstNext,
|
|
296
|
+
numberToReturn,
|
|
297
|
+
beginDate,
|
|
298
|
+
endDate,
|
|
299
|
+
sequenceOption,
|
|
300
|
+
returnMemoPostTransaction,
|
|
301
|
+
returnPackagePostItems,
|
|
302
|
+
returnScheduledExternalTransfers,
|
|
303
|
+
searchToken,
|
|
304
|
+
sourceId,
|
|
305
|
+
} = context.propsValue;
|
|
306
|
+
|
|
307
|
+
const uuid = crypto.randomUUID();
|
|
308
|
+
|
|
309
|
+
const headers: Record<string, string> = {
|
|
310
|
+
'accept': 'application/json',
|
|
311
|
+
'Content-Type': 'application/json',
|
|
312
|
+
'organization-id': organizationId,
|
|
313
|
+
'uuid': uuid,
|
|
314
|
+
'horizon-authorization': xAuthorization,
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
if (sourceId) {
|
|
318
|
+
headers['source-id'] = sourceId;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
let url = `${baseUrl}/account-aggregation/v1/accounts/${encodeURIComponent(applicationCode)}/${encodeURIComponent(accountNumber)}/transactions`;
|
|
322
|
+
|
|
323
|
+
const queryParams: string[] = [];
|
|
324
|
+
queryParams.push(`dateSelectOption=${encodeURIComponent(dateSelectOption)}`);
|
|
325
|
+
queryParams.push(`firstNext=${encodeURIComponent(firstNext)}`);
|
|
326
|
+
queryParams.push(`numberToReturn=${encodeURIComponent(String(numberToReturn))}`);
|
|
327
|
+
|
|
328
|
+
if (beginDate !== undefined && beginDate !== null) {
|
|
329
|
+
queryParams.push(`beginDate=${encodeURIComponent(String(beginDate))}`);
|
|
330
|
+
}
|
|
331
|
+
if (endDate !== undefined && endDate !== null) {
|
|
332
|
+
queryParams.push(`endDate=${encodeURIComponent(String(endDate))}`);
|
|
333
|
+
}
|
|
334
|
+
if (sequenceOption) {
|
|
335
|
+
queryParams.push(`sequenceOption=${encodeURIComponent(sequenceOption)}`);
|
|
336
|
+
}
|
|
337
|
+
if (returnMemoPostTransaction) {
|
|
338
|
+
queryParams.push(`returnMemoPostTransaction=${encodeURIComponent(returnMemoPostTransaction)}`);
|
|
339
|
+
}
|
|
340
|
+
if (returnPackagePostItems) {
|
|
341
|
+
queryParams.push(`returnPackagePostItems=${encodeURIComponent(returnPackagePostItems)}`);
|
|
342
|
+
}
|
|
343
|
+
if (returnScheduledExternalTransfers) {
|
|
344
|
+
queryParams.push(`returnScheduledExternalTransfers=${encodeURIComponent(returnScheduledExternalTransfers)}`);
|
|
345
|
+
}
|
|
346
|
+
if (searchToken) {
|
|
347
|
+
queryParams.push(`searchToken=${encodeURIComponent(searchToken)}`);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
url += '?' + queryParams.join('&');
|
|
351
|
+
|
|
352
|
+
const response = await httpClient.sendRequest({
|
|
353
|
+
method: HttpMethod.GET,
|
|
354
|
+
url,
|
|
355
|
+
headers,
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
return response.body;
|
|
359
|
+
},
|
|
360
|
+
});
|