@vqnguyen1/piece-fis-horizon 0.0.2 → 0.0.3

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.
Files changed (31) hide show
  1. package/package.json +2 -2
  2. package/project.json +22 -0
  3. package/src/index.ts +534 -0
  4. package/src/lib/actions/account-aggregation.ts +360 -0
  5. package/src/lib/actions/account-restrictions.ts +2427 -0
  6. package/src/lib/actions/bank-controls.ts +2328 -0
  7. package/src/lib/actions/card.ts +488 -0
  8. package/src/lib/actions/collateral.ts +696 -0
  9. package/src/lib/actions/customer.ts +1691 -0
  10. package/src/lib/actions/demand-deposit-savings.ts +731 -0
  11. package/src/lib/actions/get-authorization-token.ts +73 -0
  12. package/src/lib/actions/loans.ts +902 -0
  13. package/src/lib/actions/mortgage-loan.ts +1426 -0
  14. package/src/lib/actions/ready-reserve.ts +818 -0
  15. package/src/lib/actions/safe-deposit.ts +1506 -0
  16. package/src/lib/actions/search-customer-relationship-summary.ts +140 -0
  17. package/src/lib/actions/time-deposit.ts +2922 -0
  18. package/src/lib/actions/transactions.ts +1310 -0
  19. package/src/lib/actions/transfers.ts +1581 -0
  20. package/src/lib/actions/user-security.ts +1032 -0
  21. package/tsconfig.json +19 -0
  22. package/tsconfig.lib.json +10 -0
  23. package/src/index.d.ts +0 -12
  24. package/src/index.js +0 -62
  25. package/src/index.js.map +0 -1
  26. package/src/lib/actions/get-authorization-token.d.ts +0 -10
  27. package/src/lib/actions/get-authorization-token.js +0 -68
  28. package/src/lib/actions/get-authorization-token.js.map +0 -1
  29. package/src/lib/actions/search-customer-relationship-summary.d.ts +0 -15
  30. package/src/lib/actions/search-customer-relationship-summary.js +0 -122
  31. package/src/lib/actions/search-customer-relationship-summary.js.map +0 -1
@@ -0,0 +1,488 @@
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
+ * Card - Inquiry
10
+ * POST /cards/inquiry
11
+ * Retrieve basic information relating to a card number.
12
+ */
13
+ export const card_inquiry = createAction({
14
+ name: 'card_inquiry',
15
+ auth: fisHorizonAuth,
16
+ displayName: 'Card - Inquiry',
17
+ description: 'Retrieve basic information relating to a card number. This endpoint supports card tokenization.',
18
+ props: {
19
+ xAuthorization: Property.ShortText({
20
+ displayName: 'Authorization Token',
21
+ description: 'The authorization token obtained from the Get Token endpoint',
22
+ required: true,
23
+ }),
24
+ sourceId: Property.ShortText({
25
+ displayName: 'Source ID',
26
+ description: 'Optional: 6 character ID provided by FIS',
27
+ required: false,
28
+ }),
29
+ customerId: Property.ShortText({
30
+ displayName: 'Customer ID',
31
+ description: 'Specifies the unique identifier associated with a customer. Right-justified, zero filled, up to 14 digits',
32
+ required: false,
33
+ }),
34
+ returnUppercase: Property.Checkbox({
35
+ displayName: 'Return Uppercase',
36
+ description: 'Return response in uppercase. Defaults to false if not sent',
37
+ required: false,
38
+ defaultValue: false,
39
+ }),
40
+ panPlainText: Property.ShortText({
41
+ displayName: 'PAN (Plain Text)',
42
+ description: 'Plain-text PAN. Should not be supplied for LIVE integration. Max 19 characters',
43
+ required: false,
44
+ }),
45
+ panCipherText: Property.ShortText({
46
+ displayName: 'PAN (Cipher Text)',
47
+ description: 'Cipher text holds encrypted card number (as JWE). Reserved for future use',
48
+ required: false,
49
+ }),
50
+ panAlias: Property.ShortText({
51
+ displayName: 'PAN (Alias)',
52
+ description: 'Tokenized representation of clear-text PAN. Max 19 characters',
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, sourceId, customerId, returnUppercase, panPlainText, panCipherText, panAlias } = 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
+ 'x-authorization': xAuthorization,
70
+ };
71
+
72
+ if (sourceId) {
73
+ headers['source-id'] = sourceId;
74
+ }
75
+
76
+ const queryParams: Record<string, string> = {};
77
+ if (customerId) {
78
+ queryParams['customerId'] = customerId;
79
+ }
80
+ if (returnUppercase !== undefined) {
81
+ queryParams['returnUppercase'] = String(returnUppercase);
82
+ }
83
+
84
+ const queryString = Object.keys(queryParams).length > 0
85
+ ? '?' + new URLSearchParams(queryParams).toString()
86
+ : '';
87
+
88
+ const body: Record<string, unknown> = {
89
+ pan: {
90
+ plainText: panPlainText || '',
91
+ cipherText: panCipherText || '',
92
+ alias: panAlias || '',
93
+ },
94
+ };
95
+
96
+ const response = await httpClient.sendRequest({
97
+ method: HttpMethod.POST,
98
+ url: `${baseUrl}/card/v2/cards/inquiry${queryString}`,
99
+ headers,
100
+ body,
101
+ });
102
+
103
+ return response.body;
104
+ },
105
+ });
106
+
107
+ /**
108
+ * Card - Inquiry by Account
109
+ * POST /cards/applications/{applicationCode}/accounts/{accountNumber}/inquiry
110
+ * Retrieve a list of cards attached to a given account.
111
+ */
112
+ export const card_inquiry_by_account = createAction({
113
+ name: 'card_inquiry_by_account',
114
+ auth: fisHorizonAuth,
115
+ displayName: 'Card - Inquiry by Account',
116
+ description: 'Retrieve a list of cards attached to a given account and basic card information. This endpoint supports card tokenization.',
117
+ props: {
118
+ xAuthorization: Property.ShortText({
119
+ displayName: 'Authorization Token',
120
+ description: 'The authorization token obtained from the Get Token endpoint',
121
+ required: true,
122
+ }),
123
+ sourceId: Property.ShortText({
124
+ displayName: 'Source ID',
125
+ description: 'Optional: 6 character ID provided by FIS',
126
+ required: false,
127
+ }),
128
+ applicationCode: Property.ShortText({
129
+ displayName: 'Application Code',
130
+ description: 'Application Code (e.g., DD for Demand Deposit, SV for Savings)',
131
+ required: true,
132
+ }),
133
+ accountNumber: Property.ShortText({
134
+ displayName: 'Account Number',
135
+ description: 'Account Number',
136
+ required: true,
137
+ }),
138
+ numberToReturn: Property.Number({
139
+ displayName: 'Number to Return',
140
+ description: 'Number of records to return (max 99)',
141
+ required: false,
142
+ }),
143
+ lastPanPlainText: Property.ShortText({
144
+ displayName: 'Last PAN (Plain Text)',
145
+ description: 'For pagination - Plain-text PAN of last record from previous request',
146
+ required: false,
147
+ }),
148
+ lastPanCipherText: Property.ShortText({
149
+ displayName: 'Last PAN (Cipher Text)',
150
+ description: 'For pagination - Cipher text of last record from previous request',
151
+ required: false,
152
+ }),
153
+ lastPanAlias: Property.ShortText({
154
+ displayName: 'Last PAN (Alias)',
155
+ description: 'For pagination - Tokenized PAN of last record from previous request',
156
+ required: false,
157
+ }),
158
+ },
159
+ async run(context) {
160
+ const auth = context.auth as any;
161
+ const baseUrl = auth['baseUrl'];
162
+ const organizationId = auth['organizationId'];
163
+ const { xAuthorization, sourceId, applicationCode, accountNumber, numberToReturn, lastPanPlainText, lastPanCipherText, lastPanAlias } = context.propsValue;
164
+
165
+ const uuid = crypto.randomUUID();
166
+
167
+ const headers: Record<string, string> = {
168
+ 'accept': 'application/json',
169
+ 'Content-Type': 'application/json',
170
+ 'organization-id': organizationId,
171
+ 'uuid': uuid,
172
+ 'x-authorization': xAuthorization,
173
+ };
174
+
175
+ if (sourceId) {
176
+ headers['source-id'] = sourceId;
177
+ }
178
+
179
+ const queryParams: Record<string, string> = {};
180
+ if (numberToReturn !== undefined) {
181
+ queryParams['numberToReturn'] = String(numberToReturn);
182
+ }
183
+
184
+ const queryString = Object.keys(queryParams).length > 0
185
+ ? '?' + new URLSearchParams(queryParams).toString()
186
+ : '';
187
+
188
+ const body: Record<string, unknown> = {};
189
+ if (lastPanPlainText || lastPanCipherText || lastPanAlias) {
190
+ body['lastPan'] = {
191
+ plainText: lastPanPlainText || '',
192
+ cipherText: lastPanCipherText || '',
193
+ alias: lastPanAlias || '',
194
+ };
195
+ }
196
+
197
+ const response = await httpClient.sendRequest({
198
+ method: HttpMethod.POST,
199
+ url: `${baseUrl}/card/v2/cards/applications/${applicationCode}/accounts/${accountNumber}/inquiry${queryString}`,
200
+ headers,
201
+ body,
202
+ });
203
+
204
+ return response.body;
205
+ },
206
+ });
207
+
208
+ /**
209
+ * Card - Maintain (Update)
210
+ * PUT /cards
211
+ * Maintain selected optional fields for a given card number.
212
+ */
213
+ export const card_maintain = createAction({
214
+ name: 'card_maintain',
215
+ auth: fisHorizonAuth,
216
+ displayName: 'Card - Maintain',
217
+ description: 'Maintain selected optional fields for a given card number. This endpoint supports card tokenization.',
218
+ props: {
219
+ xAuthorization: Property.ShortText({
220
+ displayName: 'Authorization Token',
221
+ description: 'The authorization token obtained from the Get Token endpoint',
222
+ required: true,
223
+ }),
224
+ sourceId: Property.ShortText({
225
+ displayName: 'Source ID',
226
+ description: 'Optional: 6 character ID provided by FIS',
227
+ required: false,
228
+ }),
229
+ panPlainText: Property.ShortText({
230
+ displayName: 'PAN (Plain Text)',
231
+ description: 'Plain-text PAN. Should not be supplied for LIVE integration. Max 19 characters',
232
+ required: false,
233
+ }),
234
+ panCipherText: Property.ShortText({
235
+ displayName: 'PAN (Cipher Text)',
236
+ description: 'Cipher text holds encrypted card number (as JWE). Reserved for future use',
237
+ required: false,
238
+ }),
239
+ panAlias: Property.ShortText({
240
+ displayName: 'PAN (Alias)',
241
+ description: 'Tokenized representation of clear-text PAN. Max 19 characters',
242
+ required: false,
243
+ }),
244
+ changeType: Property.StaticDropdown({
245
+ displayName: 'Change Type',
246
+ description: 'Type of card change to perform',
247
+ required: true,
248
+ options: {
249
+ options: [
250
+ { label: 'N - New Card', value: 'N' },
251
+ { label: 'I - Reissue Card', value: 'I' },
252
+ { label: 'P - Repin Card', value: 'P' },
253
+ { label: 'R - Repair Card', value: 'R' },
254
+ { label: 'S - Preselect PIN', value: 'S' },
255
+ ],
256
+ },
257
+ }),
258
+ cardMaintenanceOverrideSent: Property.Json({
259
+ displayName: 'Card Maintenance Override Fields',
260
+ description: 'Array of override fields. Each item should have: segmentId (OPTF), fieldName, fieldValue. Example: [{"segmentId":"OPTF","fieldName":"CCSTAT","fieldValue":"C"}]',
261
+ required: false,
262
+ }),
263
+ },
264
+ async run(context) {
265
+ const auth = context.auth as any;
266
+ const baseUrl = auth['baseUrl'];
267
+ const organizationId = auth['organizationId'];
268
+ const { xAuthorization, sourceId, panPlainText, panCipherText, panAlias, changeType, cardMaintenanceOverrideSent } = context.propsValue;
269
+
270
+ const uuid = crypto.randomUUID();
271
+
272
+ const headers: Record<string, string> = {
273
+ 'accept': 'application/json',
274
+ 'Content-Type': 'application/json',
275
+ 'organization-id': organizationId,
276
+ 'uuid': uuid,
277
+ 'x-authorization': xAuthorization,
278
+ };
279
+
280
+ if (sourceId) {
281
+ headers['source-id'] = sourceId;
282
+ }
283
+
284
+ const body: Record<string, unknown> = {
285
+ pan: {
286
+ plainText: panPlainText || '',
287
+ cipherText: panCipherText || '',
288
+ alias: panAlias || '',
289
+ },
290
+ changeType: changeType,
291
+ };
292
+
293
+ if (cardMaintenanceOverrideSent) {
294
+ body['cardMaintenanceOverrideSent'] = cardMaintenanceOverrideSent;
295
+ }
296
+
297
+ const response = await httpClient.sendRequest({
298
+ method: HttpMethod.PUT,
299
+ url: `${baseUrl}/card/v2/cards`,
300
+ headers,
301
+ body,
302
+ });
303
+
304
+ return response.body;
305
+ },
306
+ });
307
+
308
+ /**
309
+ * Card - Add
310
+ * POST /cards
311
+ * Add a new card record for the bank.
312
+ */
313
+ export const card_add = createAction({
314
+ name: 'card_add',
315
+ auth: fisHorizonAuth,
316
+ displayName: 'Card - Add',
317
+ description: 'Add a new card record for the bank. The transaction can generate a card number if a card number is not sent. This endpoint supports card tokenization.',
318
+ props: {
319
+ xAuthorization: Property.ShortText({
320
+ displayName: 'Authorization Token',
321
+ description: 'The authorization token obtained from the Get Token endpoint',
322
+ required: true,
323
+ }),
324
+ sourceId: Property.ShortText({
325
+ displayName: 'Source ID',
326
+ description: 'Optional: 6 character ID provided by FIS',
327
+ required: false,
328
+ }),
329
+ customerId: Property.ShortText({
330
+ displayName: 'Customer ID',
331
+ description: 'Card Holder Customer Key. Right-justified, zero filled, up to 14 digits',
332
+ required: true,
333
+ }),
334
+ productType: Property.ShortText({
335
+ displayName: 'Product Type',
336
+ description: 'Card Holder Product Type (e.g., ATM, VDR). Max 3 characters',
337
+ required: true,
338
+ }),
339
+ panPlainText: Property.ShortText({
340
+ displayName: 'PAN (Plain Text)',
341
+ description: 'Plain-text PAN. Should not be supplied for LIVE integration. Max 19 characters. If not provided, the system can generate one',
342
+ required: false,
343
+ }),
344
+ panCipherText: Property.ShortText({
345
+ displayName: 'PAN (Cipher Text)',
346
+ description: 'Cipher text holds encrypted card number (as JWE). Reserved for future use',
347
+ required: false,
348
+ }),
349
+ panAlias: Property.ShortText({
350
+ displayName: 'PAN (Alias)',
351
+ description: 'Tokenized representation of clear-text PAN. Max 19 characters',
352
+ required: false,
353
+ }),
354
+ relatedAccountSent: Property.Json({
355
+ displayName: 'Related Accounts',
356
+ description: 'Array of related accounts (required). Each item should have: application (e.g., DD), accountNumber, primaryAccount (Y/N). Example: [{"application":"DD","accountNumber":"21","primaryAccount":"Y"}]',
357
+ required: true,
358
+ }),
359
+ overrideAccountSent: Property.Json({
360
+ displayName: 'Override Fields',
361
+ description: 'Optional array of override fields. Each item should have: segmentId (OPTF), fieldName, fieldValue. Example: [{"segmentId":"OPTF","fieldName":"CCO1POSL","fieldValue":"1700"}]',
362
+ required: false,
363
+ }),
364
+ },
365
+ async run(context) {
366
+ const auth = context.auth as any;
367
+ const baseUrl = auth['baseUrl'];
368
+ const organizationId = auth['organizationId'];
369
+ const { xAuthorization, sourceId, customerId, productType, panPlainText, panCipherText, panAlias, relatedAccountSent, overrideAccountSent } = context.propsValue;
370
+
371
+ const uuid = crypto.randomUUID();
372
+
373
+ const headers: Record<string, string> = {
374
+ 'accept': 'application/json',
375
+ 'Content-Type': 'application/json',
376
+ 'organization-id': organizationId,
377
+ 'uuid': uuid,
378
+ 'x-authorization': xAuthorization,
379
+ };
380
+
381
+ if (sourceId) {
382
+ headers['source-id'] = sourceId;
383
+ }
384
+
385
+ const body: Record<string, unknown> = {
386
+ customerId: customerId,
387
+ productType: productType,
388
+ relatedAccountSent: relatedAccountSent,
389
+ };
390
+
391
+ if (panPlainText || panCipherText || panAlias) {
392
+ body['pan'] = {
393
+ plainText: panPlainText || '',
394
+ cipherText: panCipherText || '',
395
+ alias: panAlias || '',
396
+ };
397
+ }
398
+
399
+ if (overrideAccountSent) {
400
+ body['overrideAccountSent'] = overrideAccountSent;
401
+ }
402
+
403
+ const response = await httpClient.sendRequest({
404
+ method: HttpMethod.POST,
405
+ url: `${baseUrl}/card/v2/cards`,
406
+ headers,
407
+ body,
408
+ });
409
+
410
+ return response.body;
411
+ },
412
+ });
413
+
414
+ /**
415
+ * Card - Details Inquiry
416
+ * POST /cards/details-inquiry
417
+ * Retrieve card member details based on the input card number.
418
+ */
419
+ export const card_details_inquiry = createAction({
420
+ name: 'card_details_inquiry',
421
+ auth: fisHorizonAuth,
422
+ displayName: 'Card - Details Inquiry',
423
+ description: 'Retrieve card member details based on the input card number. Returns details of all the members for the requested card number. This endpoint supports card tokenization.',
424
+ props: {
425
+ xAuthorization: Property.ShortText({
426
+ displayName: 'Authorization Token',
427
+ description: 'The authorization token obtained from the Get Token endpoint',
428
+ required: true,
429
+ }),
430
+ sourceId: Property.ShortText({
431
+ displayName: 'Source ID',
432
+ description: 'Optional: 6 character ID provided by FIS',
433
+ required: false,
434
+ }),
435
+ panPlainText: Property.ShortText({
436
+ displayName: 'PAN (Plain Text)',
437
+ description: 'Plain-text PAN. Should not be supplied for LIVE integration. Max 19 characters',
438
+ required: false,
439
+ }),
440
+ panCipherText: Property.ShortText({
441
+ displayName: 'PAN (Cipher Text)',
442
+ description: 'Cipher text holds encrypted card number (as JWE). Reserved for future use',
443
+ required: false,
444
+ }),
445
+ panAlias: Property.ShortText({
446
+ displayName: 'PAN (Alias)',
447
+ description: 'Tokenized representation of clear-text PAN. Max 19 characters',
448
+ required: false,
449
+ }),
450
+ },
451
+ async run(context) {
452
+ const auth = context.auth as any;
453
+ const baseUrl = auth['baseUrl'];
454
+ const organizationId = auth['organizationId'];
455
+ const { xAuthorization, sourceId, panPlainText, panCipherText, panAlias } = context.propsValue;
456
+
457
+ const uuid = crypto.randomUUID();
458
+
459
+ const headers: Record<string, string> = {
460
+ 'accept': 'application/json',
461
+ 'Content-Type': 'application/json',
462
+ 'organization-id': organizationId,
463
+ 'uuid': uuid,
464
+ 'x-authorization': xAuthorization,
465
+ };
466
+
467
+ if (sourceId) {
468
+ headers['source-id'] = sourceId;
469
+ }
470
+
471
+ const body: Record<string, unknown> = {
472
+ pan: {
473
+ plainText: panPlainText || '',
474
+ cipherText: panCipherText || '',
475
+ alias: panAlias || '',
476
+ },
477
+ };
478
+
479
+ const response = await httpClient.sendRequest({
480
+ method: HttpMethod.POST,
481
+ url: `${baseUrl}/card/v2/cards/details-inquiry`,
482
+ headers,
483
+ body,
484
+ });
485
+
486
+ return response.body;
487
+ },
488
+ });