@vqnguyen1/piece-fis-horizon 0.0.1 → 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 +12 -7
  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,1691 @@
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
+ // Helper function to create common headers
9
+ function createHeaders(
10
+ organizationId: string,
11
+ xAuthorization: string,
12
+ sourceId?: string
13
+ ): Record<string, string> {
14
+ const uuid = crypto.randomUUID();
15
+ const headers: Record<string, string> = {
16
+ 'accept': 'application/json',
17
+ 'Content-Type': 'application/json',
18
+ 'organization-id': organizationId,
19
+ 'uuid': uuid,
20
+ 'x-authorization': xAuthorization,
21
+ };
22
+
23
+ if (sourceId) {
24
+ headers['source-id'] = sourceId;
25
+ }
26
+
27
+ return headers;
28
+ }
29
+
30
+ // ==================== CUSTOMER CREATE ====================
31
+
32
+ export const customer_create = createAction({
33
+ name: 'customer_create',
34
+ auth: fisHorizonAuth,
35
+ displayName: 'Customer - Create',
36
+ description: 'Creates a new customer record in the Relationship Management database.',
37
+ props: {
38
+ xAuthorization: Property.ShortText({
39
+ displayName: 'Authorization Token (JWT)',
40
+ description: 'The JWT token obtained from the Authorization - Get Token action',
41
+ required: true,
42
+ }),
43
+ customerData: Property.Json({
44
+ displayName: 'Customer Data',
45
+ description: 'JSON object containing customer information to create',
46
+ required: true,
47
+ }),
48
+ sourceId: Property.ShortText({
49
+ displayName: 'Source ID',
50
+ description: 'Optional: 6 character ID provided by FIS',
51
+ required: false,
52
+ }),
53
+ },
54
+ async run(context) {
55
+ const auth = context.auth as any;
56
+ const baseUrl = auth['baseUrl'];
57
+ const organizationId = auth['organizationId'];
58
+ const { xAuthorization, customerData, sourceId } = context.propsValue;
59
+
60
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
61
+
62
+ const response = await httpClient.sendRequest({
63
+ method: HttpMethod.POST,
64
+ url: `${baseUrl}/customer/v2/customers`,
65
+ headers,
66
+ body: customerData,
67
+ });
68
+
69
+ return response.body;
70
+ },
71
+ });
72
+
73
+ // ==================== PORTFOLIO INQUIRY ====================
74
+
75
+ export const customer_portfolio_inquiry = createAction({
76
+ name: 'customer_portfolio_inquiry',
77
+ auth: fisHorizonAuth,
78
+ displayName: 'Customer - Portfolio - Inquiry',
79
+ description: 'Retrieve a list of customer portfolio details based on tax ID number or customer key.',
80
+ props: {
81
+ xAuthorization: Property.ShortText({
82
+ displayName: 'Authorization Token (JWT)',
83
+ description: 'The JWT token obtained from the Authorization - Get Token action',
84
+ required: true,
85
+ }),
86
+ taxId: Property.ShortText({
87
+ displayName: 'Tax ID',
88
+ description: 'Tax Identification Number',
89
+ required: false,
90
+ }),
91
+ customerId: Property.ShortText({
92
+ displayName: 'Customer ID',
93
+ description: 'Customer ID (14 characters)',
94
+ required: false,
95
+ }),
96
+ tinAggregation: Property.StaticDropdown({
97
+ displayName: 'TIN Aggregation',
98
+ description: 'Whether to aggregate by TIN',
99
+ required: false,
100
+ options: {
101
+ options: [
102
+ { label: 'Yes', value: 'Y' },
103
+ { label: 'No', value: 'N' },
104
+ ],
105
+ },
106
+ }),
107
+ interfaceFlag: Property.StaticDropdown({
108
+ displayName: 'Interface Flag',
109
+ description: 'Interface flag for the request',
110
+ required: false,
111
+ options: {
112
+ options: [
113
+ { label: 'IN - Internal', value: 'IN' },
114
+ { label: 'EX - External', value: 'EX' },
115
+ ],
116
+ },
117
+ }),
118
+ ownershipType: Property.StaticDropdown({
119
+ displayName: 'Ownership Type',
120
+ description: 'The ownership type to filter by',
121
+ required: false,
122
+ options: {
123
+ options: [
124
+ { label: 'D - Direct', value: 'D' },
125
+ { label: 'I - Indirect', value: 'I' },
126
+ { label: 'S - Signer', value: 'S' },
127
+ ],
128
+ },
129
+ }),
130
+ returnUppercase: Property.StaticDropdown({
131
+ displayName: 'Return Uppercase',
132
+ description: 'Return data in uppercase',
133
+ required: false,
134
+ options: {
135
+ options: [
136
+ { label: 'Yes', value: 'Y' },
137
+ { label: 'No', value: 'N' },
138
+ ],
139
+ },
140
+ }),
141
+ viewUndisplayedRelationships: Property.StaticDropdown({
142
+ displayName: 'View Undisplayed Relationships',
143
+ description: 'Whether to include undisplayed relationships',
144
+ required: false,
145
+ options: {
146
+ options: [
147
+ { label: 'Yes', value: 'Y' },
148
+ { label: 'No', value: 'N' },
149
+ ],
150
+ },
151
+ }),
152
+ searchDirection: Property.StaticDropdown({
153
+ displayName: 'Search Direction',
154
+ description: 'Direction for searching',
155
+ required: false,
156
+ options: {
157
+ options: [
158
+ { label: 'B - Both', value: 'B' },
159
+ { label: 'F - Forward', value: 'F' },
160
+ { label: 'R - Reverse', value: 'R' },
161
+ ],
162
+ },
163
+ }),
164
+ numberOfAccountsToReturn: Property.Number({
165
+ displayName: 'Number of Accounts to Return',
166
+ description: 'Maximum number of accounts to return',
167
+ required: false,
168
+ defaultValue: 10,
169
+ }),
170
+ numberOfPhoneNumbersToReturn: Property.Number({
171
+ displayName: 'Number of Phone Numbers to Return',
172
+ description: 'Maximum number of phone numbers to return',
173
+ required: false,
174
+ defaultValue: 10,
175
+ }),
176
+ numberOfEmailAddressesToReturn: Property.Number({
177
+ displayName: 'Number of Email Addresses to Return',
178
+ description: 'Maximum number of email addresses to return',
179
+ required: false,
180
+ defaultValue: 10,
181
+ }),
182
+ returnCustomerInformation: Property.Checkbox({
183
+ displayName: 'Return Customer Information',
184
+ description: 'Whether to return customer information',
185
+ required: false,
186
+ defaultValue: true,
187
+ }),
188
+ includeReadyReserveOD: Property.Checkbox({
189
+ displayName: 'Include Ready Reserve Overdraft',
190
+ description: 'Whether to include ready reserve overdraft',
191
+ required: false,
192
+ defaultValue: false,
193
+ }),
194
+ sourceId: Property.ShortText({
195
+ displayName: 'Source ID',
196
+ description: 'Optional: 6 character ID provided by FIS',
197
+ required: false,
198
+ }),
199
+ },
200
+ async run(context) {
201
+ const auth = context.auth as any;
202
+ const baseUrl = auth['baseUrl'];
203
+ const organizationId = auth['organizationId'];
204
+ const {
205
+ xAuthorization,
206
+ taxId,
207
+ customerId,
208
+ tinAggregation,
209
+ interfaceFlag,
210
+ ownershipType,
211
+ returnUppercase,
212
+ viewUndisplayedRelationships,
213
+ searchDirection,
214
+ numberOfAccountsToReturn,
215
+ numberOfPhoneNumbersToReturn,
216
+ numberOfEmailAddressesToReturn,
217
+ returnCustomerInformation,
218
+ includeReadyReserveOD,
219
+ sourceId,
220
+ } = context.propsValue;
221
+
222
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
223
+
224
+ const body: Record<string, unknown> = {};
225
+
226
+ if (taxId) body['taxId'] = taxId;
227
+ if (customerId) body['customerId'] = customerId;
228
+ if (tinAggregation) body['tinAggregation'] = tinAggregation;
229
+ if (interfaceFlag) body['interfaceFlag'] = interfaceFlag;
230
+ if (ownershipType) body['ownershipType'] = ownershipType;
231
+ if (returnUppercase) body['returnUppercase'] = returnUppercase;
232
+ if (viewUndisplayedRelationships) body['viewUndisplayedRelationships'] = viewUndisplayedRelationships;
233
+ if (searchDirection) body['searchDirection'] = searchDirection;
234
+ if (numberOfAccountsToReturn) body['numberOfAccountsToReturn'] = numberOfAccountsToReturn;
235
+ if (numberOfPhoneNumbersToReturn) body['numberOfPhoneNumbersToReturn'] = numberOfPhoneNumbersToReturn;
236
+ if (numberOfEmailAddressesToReturn) body['numberOfEmailAddressesToReturn'] = numberOfEmailAddressesToReturn;
237
+ if (returnCustomerInformation !== undefined) body['returnCustomerInformation'] = returnCustomerInformation;
238
+ if (includeReadyReserveOD !== undefined) body['includeReadyReserveOD'] = includeReadyReserveOD;
239
+
240
+ const response = await httpClient.sendRequest({
241
+ method: HttpMethod.POST,
242
+ url: `${baseUrl}/customer/v2/customers/portfolio-inquiry`,
243
+ headers,
244
+ body,
245
+ });
246
+
247
+ return response.body;
248
+ },
249
+ });
250
+
251
+ // ==================== RELATIONSHIP SUMMARY ====================
252
+
253
+ export const customer_relationship_summary_search = createAction({
254
+ name: 'customer_relationship_summary_search',
255
+ auth: fisHorizonAuth,
256
+ displayName: 'Customer - Relationship Summary - Search',
257
+ description: 'Retrieve a list of accounts for a specific customer.',
258
+ props: {
259
+ xAuthorization: Property.ShortText({
260
+ displayName: 'Authorization Token (JWT)',
261
+ description: 'The JWT token obtained from the Authorization - Get Token action',
262
+ required: true,
263
+ }),
264
+ customerId: Property.ShortText({
265
+ displayName: 'Customer ID',
266
+ description: 'Customer ID (14 characters)',
267
+ required: true,
268
+ }),
269
+ interfaceFlag: Property.StaticDropdown({
270
+ displayName: 'Interface Flag',
271
+ description: 'Interface flag for the request',
272
+ required: false,
273
+ options: {
274
+ options: [
275
+ { label: 'IN - Internal', value: 'IN' },
276
+ { label: 'EX - External', value: 'EX' },
277
+ ],
278
+ },
279
+ }),
280
+ ownershipType: Property.StaticDropdown({
281
+ displayName: 'Ownership Type',
282
+ description: 'The ownership type to filter by',
283
+ required: false,
284
+ options: {
285
+ options: [
286
+ { label: 'D - Direct', value: 'D' },
287
+ { label: 'I - Indirect', value: 'I' },
288
+ { label: 'S - Signer', value: 'S' },
289
+ ],
290
+ },
291
+ }),
292
+ returnUppercase: Property.StaticDropdown({
293
+ displayName: 'Return Uppercase',
294
+ description: 'Return data in uppercase',
295
+ required: false,
296
+ options: {
297
+ options: [
298
+ { label: 'Yes', value: 'Y' },
299
+ { label: 'No', value: 'N' },
300
+ ],
301
+ },
302
+ }),
303
+ viewUndisplayedRelationships: Property.StaticDropdown({
304
+ displayName: 'View Undisplayed Relationships',
305
+ description: 'Whether to include undisplayed relationships',
306
+ required: false,
307
+ options: {
308
+ options: [
309
+ { label: 'Yes', value: 'Y' },
310
+ { label: 'No', value: 'N' },
311
+ ],
312
+ },
313
+ }),
314
+ searchDirection: Property.StaticDropdown({
315
+ displayName: 'Search Direction',
316
+ description: 'Direction for searching',
317
+ required: false,
318
+ options: {
319
+ options: [
320
+ { label: 'B - Both', value: 'B' },
321
+ { label: 'F - Forward', value: 'F' },
322
+ { label: 'R - Reverse', value: 'R' },
323
+ ],
324
+ },
325
+ }),
326
+ searchFromApplication: Property.ShortText({
327
+ displayName: 'Search From Application',
328
+ description: 'Application code to search from (e.g., LN, DD)',
329
+ required: false,
330
+ }),
331
+ searchFromAccountNumber: Property.ShortText({
332
+ displayName: 'Search From Account Number',
333
+ description: 'Account number to search from',
334
+ required: false,
335
+ }),
336
+ sourceId: Property.ShortText({
337
+ displayName: 'Source ID',
338
+ description: 'Optional: 6 character ID provided by FIS',
339
+ required: false,
340
+ }),
341
+ },
342
+ async run(context) {
343
+ const auth = context.auth as any;
344
+ const baseUrl = auth['baseUrl'];
345
+ const organizationId = auth['organizationId'];
346
+ const {
347
+ xAuthorization,
348
+ customerId,
349
+ interfaceFlag,
350
+ ownershipType,
351
+ returnUppercase,
352
+ viewUndisplayedRelationships,
353
+ searchDirection,
354
+ searchFromApplication,
355
+ searchFromAccountNumber,
356
+ sourceId,
357
+ } = context.propsValue;
358
+
359
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
360
+
361
+ // Build query params
362
+ let url = `${baseUrl}/customer/v2/customers/${customerId}/relationship-summary/search`;
363
+ const queryParams: string[] = [];
364
+ if (interfaceFlag) queryParams.push(`interfaceFlag=${interfaceFlag}`);
365
+ if (ownershipType) queryParams.push(`ownershipType=${ownershipType}`);
366
+ if (returnUppercase) queryParams.push(`returnUppercase=${returnUppercase}`);
367
+ if (viewUndisplayedRelationships) queryParams.push(`viewUndisplayedRelationships=${viewUndisplayedRelationships}`);
368
+ if (searchDirection) queryParams.push(`searchDirection=${searchDirection}`);
369
+ if (queryParams.length > 0) {
370
+ url += `?${queryParams.join('&')}`;
371
+ }
372
+
373
+ const body: Record<string, unknown> = {};
374
+ if (searchFromApplication) body['searchFromApplication'] = searchFromApplication;
375
+ if (searchFromAccountNumber) {
376
+ body['searchFromAccountNumber'] = {
377
+ plainText: searchFromAccountNumber,
378
+ cipherText: '',
379
+ alias: '',
380
+ };
381
+ }
382
+
383
+ const response = await httpClient.sendRequest({
384
+ method: HttpMethod.POST,
385
+ url,
386
+ headers,
387
+ body,
388
+ });
389
+
390
+ return response.body;
391
+ },
392
+ });
393
+
394
+ // ==================== PHONES ====================
395
+
396
+ export const customer_phones_inquiry = createAction({
397
+ name: 'customer_phones_inquiry',
398
+ auth: fisHorizonAuth,
399
+ displayName: 'Customer - Phones - Inquiry',
400
+ description: 'Retrieve a customer\'s phone number records.',
401
+ props: {
402
+ xAuthorization: Property.ShortText({
403
+ displayName: 'Authorization Token (JWT)',
404
+ description: 'The JWT token obtained from the Authorization - Get Token action',
405
+ required: true,
406
+ }),
407
+ customerId: Property.ShortText({
408
+ displayName: 'Customer ID',
409
+ description: 'Customer ID (14 characters)',
410
+ required: true,
411
+ }),
412
+ numberOfRecords: Property.Number({
413
+ displayName: 'Number of Records',
414
+ description: 'Number of records to return (1-999)',
415
+ required: false,
416
+ defaultValue: 999,
417
+ }),
418
+ phoneType: Property.ShortText({
419
+ displayName: 'Phone Type',
420
+ description: 'Type of phone to filter by',
421
+ required: false,
422
+ }),
423
+ firstNextDefault: Property.StaticDropdown({
424
+ displayName: 'First/Next/Default',
425
+ description: 'Pagination control',
426
+ required: false,
427
+ options: {
428
+ options: [
429
+ { label: 'F - First', value: 'F' },
430
+ { label: 'N - Next', value: 'N' },
431
+ { label: 'D - Default', value: 'D' },
432
+ ],
433
+ },
434
+ }),
435
+ sourceId: Property.ShortText({
436
+ displayName: 'Source ID',
437
+ description: 'Optional: 6 character ID provided by FIS',
438
+ required: false,
439
+ }),
440
+ },
441
+ async run(context) {
442
+ const auth = context.auth as any;
443
+ const baseUrl = auth['baseUrl'];
444
+ const organizationId = auth['organizationId'];
445
+ const { xAuthorization, customerId, numberOfRecords, phoneType, firstNextDefault, sourceId } = context.propsValue;
446
+
447
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
448
+
449
+ let url = `${baseUrl}/customer/v2/customers/${customerId}/contact-info/phone-numbers`;
450
+ const queryParams: string[] = [];
451
+ if (numberOfRecords) queryParams.push(`numberOfRecords=${numberOfRecords}`);
452
+ if (phoneType) queryParams.push(`phoneType=${phoneType}`);
453
+ if (firstNextDefault) queryParams.push(`firstNextDefault=${firstNextDefault}`);
454
+ if (queryParams.length > 0) {
455
+ url += `?${queryParams.join('&')}`;
456
+ }
457
+
458
+ const response = await httpClient.sendRequest({
459
+ method: HttpMethod.GET,
460
+ url,
461
+ headers,
462
+ });
463
+
464
+ return response.body;
465
+ },
466
+ });
467
+
468
+ export const customer_phones_add = createAction({
469
+ name: 'customer_phones_add',
470
+ auth: fisHorizonAuth,
471
+ displayName: 'Customer - Phones - Add',
472
+ description: 'Add a phone number record for a given customer.',
473
+ props: {
474
+ xAuthorization: Property.ShortText({
475
+ displayName: 'Authorization Token (JWT)',
476
+ description: 'The JWT token obtained from the Authorization - Get Token action',
477
+ required: true,
478
+ }),
479
+ customerId: Property.ShortText({
480
+ displayName: 'Customer ID',
481
+ description: 'Customer ID (14 characters)',
482
+ required: true,
483
+ }),
484
+ phoneData: Property.Json({
485
+ displayName: 'Phone Data',
486
+ description: 'JSON object containing phone number information',
487
+ required: true,
488
+ }),
489
+ sourceId: Property.ShortText({
490
+ displayName: 'Source ID',
491
+ description: 'Optional: 6 character ID provided by FIS',
492
+ required: false,
493
+ }),
494
+ },
495
+ async run(context) {
496
+ const auth = context.auth as any;
497
+ const baseUrl = auth['baseUrl'];
498
+ const organizationId = auth['organizationId'];
499
+ const { xAuthorization, customerId, phoneData, sourceId } = context.propsValue;
500
+
501
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
502
+
503
+ const response = await httpClient.sendRequest({
504
+ method: HttpMethod.POST,
505
+ url: `${baseUrl}/customer/v2/customers/${customerId}/contact-info/phone-numbers`,
506
+ headers,
507
+ body: phoneData,
508
+ });
509
+
510
+ return response.body;
511
+ },
512
+ });
513
+
514
+ export const customer_phones_update = createAction({
515
+ name: 'customer_phones_update',
516
+ auth: fisHorizonAuth,
517
+ displayName: 'Customer - Phones - Update',
518
+ description: 'Maintain a phone number record for a given customer.',
519
+ props: {
520
+ xAuthorization: Property.ShortText({
521
+ displayName: 'Authorization Token (JWT)',
522
+ description: 'The JWT token obtained from the Authorization - Get Token action',
523
+ required: true,
524
+ }),
525
+ customerId: Property.ShortText({
526
+ displayName: 'Customer ID',
527
+ description: 'Customer ID (14 characters)',
528
+ required: true,
529
+ }),
530
+ preferenceSequence: Property.ShortText({
531
+ displayName: 'Preference Sequence',
532
+ description: 'The preference sequence number of the phone record to update',
533
+ required: true,
534
+ }),
535
+ phoneData: Property.Json({
536
+ displayName: 'Phone Data',
537
+ description: 'JSON object containing updated phone number information',
538
+ required: true,
539
+ }),
540
+ sourceId: Property.ShortText({
541
+ displayName: 'Source ID',
542
+ description: 'Optional: 6 character ID provided by FIS',
543
+ required: false,
544
+ }),
545
+ },
546
+ async run(context) {
547
+ const auth = context.auth as any;
548
+ const baseUrl = auth['baseUrl'];
549
+ const organizationId = auth['organizationId'];
550
+ const { xAuthorization, customerId, preferenceSequence, phoneData, sourceId } = context.propsValue;
551
+
552
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
553
+
554
+ const response = await httpClient.sendRequest({
555
+ method: HttpMethod.PUT,
556
+ url: `${baseUrl}/customer/v2/customers/${customerId}/contact-info/phone-numbers/${preferenceSequence}`,
557
+ headers,
558
+ body: phoneData,
559
+ });
560
+
561
+ return response.body;
562
+ },
563
+ });
564
+
565
+ export const customer_phones_delete = createAction({
566
+ name: 'customer_phones_delete',
567
+ auth: fisHorizonAuth,
568
+ displayName: 'Customer - Phones - Delete',
569
+ description: 'Delete a phone number record for a given customer.',
570
+ props: {
571
+ xAuthorization: Property.ShortText({
572
+ displayName: 'Authorization Token (JWT)',
573
+ description: 'The JWT token obtained from the Authorization - Get Token action',
574
+ required: true,
575
+ }),
576
+ customerId: Property.ShortText({
577
+ displayName: 'Customer ID',
578
+ description: 'Customer ID (14 characters)',
579
+ required: true,
580
+ }),
581
+ preferenceSequence: Property.ShortText({
582
+ displayName: 'Preference Sequence',
583
+ description: 'The preference sequence number of the phone record to delete',
584
+ required: true,
585
+ }),
586
+ sourceId: Property.ShortText({
587
+ displayName: 'Source ID',
588
+ description: 'Optional: 6 character ID provided by FIS',
589
+ required: false,
590
+ }),
591
+ },
592
+ async run(context) {
593
+ const auth = context.auth as any;
594
+ const baseUrl = auth['baseUrl'];
595
+ const organizationId = auth['organizationId'];
596
+ const { xAuthorization, customerId, preferenceSequence, sourceId } = context.propsValue;
597
+
598
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
599
+
600
+ const response = await httpClient.sendRequest({
601
+ method: HttpMethod.DELETE,
602
+ url: `${baseUrl}/customer/v2/customers/${customerId}/contact-info/phone-numbers/${preferenceSequence}`,
603
+ headers,
604
+ });
605
+
606
+ return response.body;
607
+ },
608
+ });
609
+
610
+ // ==================== ADDRESSES ====================
611
+
612
+ export const customer_addresses_inquiry = createAction({
613
+ name: 'customer_addresses_inquiry',
614
+ auth: fisHorizonAuth,
615
+ displayName: 'Customer - Addresses - Inquiry',
616
+ description: 'Retrieve a list of customer address records.',
617
+ props: {
618
+ xAuthorization: Property.ShortText({
619
+ displayName: 'Authorization Token (JWT)',
620
+ description: 'The JWT token obtained from the Authorization - Get Token action',
621
+ required: true,
622
+ }),
623
+ customerId: Property.ShortText({
624
+ displayName: 'Customer ID',
625
+ description: 'Customer ID (14 characters)',
626
+ required: true,
627
+ }),
628
+ addressSequence: Property.Number({
629
+ displayName: 'Address Sequence',
630
+ description: 'Address sequence number to start from',
631
+ required: false,
632
+ }),
633
+ maxNumberOfRecords: Property.Number({
634
+ displayName: 'Max Number of Records',
635
+ description: 'Maximum number of records to return',
636
+ required: false,
637
+ defaultValue: 999,
638
+ }),
639
+ sourceId: Property.ShortText({
640
+ displayName: 'Source ID',
641
+ description: 'Optional: 6 character ID provided by FIS',
642
+ required: false,
643
+ }),
644
+ },
645
+ async run(context) {
646
+ const auth = context.auth as any;
647
+ const baseUrl = auth['baseUrl'];
648
+ const organizationId = auth['organizationId'];
649
+ const { xAuthorization, customerId, addressSequence, maxNumberOfRecords, sourceId } = context.propsValue;
650
+
651
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
652
+
653
+ let url = `${baseUrl}/customer/v2/customers/${customerId}/contact-info/addresses`;
654
+ const queryParams: string[] = [];
655
+ if (addressSequence) queryParams.push(`addressSequence=${addressSequence}`);
656
+ if (maxNumberOfRecords) queryParams.push(`maxNumberOfRecords=${maxNumberOfRecords}`);
657
+ if (queryParams.length > 0) {
658
+ url += `?${queryParams.join('&')}`;
659
+ }
660
+
661
+ const response = await httpClient.sendRequest({
662
+ method: HttpMethod.GET,
663
+ url,
664
+ headers,
665
+ });
666
+
667
+ return response.body;
668
+ },
669
+ });
670
+
671
+ export const customer_addresses_add = createAction({
672
+ name: 'customer_addresses_add',
673
+ auth: fisHorizonAuth,
674
+ displayName: 'Customer - Addresses - Add',
675
+ description: 'Add an address record for a given customer.',
676
+ props: {
677
+ xAuthorization: Property.ShortText({
678
+ displayName: 'Authorization Token (JWT)',
679
+ description: 'The JWT token obtained from the Authorization - Get Token action',
680
+ required: true,
681
+ }),
682
+ customerId: Property.ShortText({
683
+ displayName: 'Customer ID',
684
+ description: 'Customer ID (14 characters)',
685
+ required: true,
686
+ }),
687
+ addressData: Property.Json({
688
+ displayName: 'Address Data',
689
+ description: 'JSON object containing address information',
690
+ required: true,
691
+ }),
692
+ sourceId: Property.ShortText({
693
+ displayName: 'Source ID',
694
+ description: 'Optional: 6 character ID provided by FIS',
695
+ required: false,
696
+ }),
697
+ },
698
+ async run(context) {
699
+ const auth = context.auth as any;
700
+ const baseUrl = auth['baseUrl'];
701
+ const organizationId = auth['organizationId'];
702
+ const { xAuthorization, customerId, addressData, sourceId } = context.propsValue;
703
+
704
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
705
+
706
+ const response = await httpClient.sendRequest({
707
+ method: HttpMethod.POST,
708
+ url: `${baseUrl}/customer/v2/customers/${customerId}/contact-info/addresses`,
709
+ headers,
710
+ body: addressData,
711
+ });
712
+
713
+ return response.body;
714
+ },
715
+ });
716
+
717
+ export const customer_addresses_update = createAction({
718
+ name: 'customer_addresses_update',
719
+ auth: fisHorizonAuth,
720
+ displayName: 'Customer - Addresses - Update',
721
+ description: 'Update an address record for a given customer.',
722
+ props: {
723
+ xAuthorization: Property.ShortText({
724
+ displayName: 'Authorization Token (JWT)',
725
+ description: 'The JWT token obtained from the Authorization - Get Token action',
726
+ required: true,
727
+ }),
728
+ customerId: Property.ShortText({
729
+ displayName: 'Customer ID',
730
+ description: 'Customer ID (14 characters)',
731
+ required: true,
732
+ }),
733
+ addressSequenceNumber: Property.ShortText({
734
+ displayName: 'Address Sequence Number',
735
+ description: 'The sequence number of the address to update',
736
+ required: true,
737
+ }),
738
+ addressData: Property.Json({
739
+ displayName: 'Address Data',
740
+ description: 'JSON object containing updated address information',
741
+ required: true,
742
+ }),
743
+ sourceId: Property.ShortText({
744
+ displayName: 'Source ID',
745
+ description: 'Optional: 6 character ID provided by FIS',
746
+ required: false,
747
+ }),
748
+ },
749
+ async run(context) {
750
+ const auth = context.auth as any;
751
+ const baseUrl = auth['baseUrl'];
752
+ const organizationId = auth['organizationId'];
753
+ const { xAuthorization, customerId, addressSequenceNumber, addressData, sourceId } = context.propsValue;
754
+
755
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
756
+
757
+ const response = await httpClient.sendRequest({
758
+ method: HttpMethod.PUT,
759
+ url: `${baseUrl}/customer/v2/customers/${customerId}/contact-info/addresses/${addressSequenceNumber}`,
760
+ headers,
761
+ body: addressData,
762
+ });
763
+
764
+ return response.body;
765
+ },
766
+ });
767
+
768
+ export const customer_addresses_delete = createAction({
769
+ name: 'customer_addresses_delete',
770
+ auth: fisHorizonAuth,
771
+ displayName: 'Customer - Addresses - Delete',
772
+ description: 'Delete an address record for a given customer.',
773
+ props: {
774
+ xAuthorization: Property.ShortText({
775
+ displayName: 'Authorization Token (JWT)',
776
+ description: 'The JWT token obtained from the Authorization - Get Token action',
777
+ required: true,
778
+ }),
779
+ customerId: Property.ShortText({
780
+ displayName: 'Customer ID',
781
+ description: 'Customer ID (14 characters)',
782
+ required: true,
783
+ }),
784
+ addressSequenceNumber: Property.ShortText({
785
+ displayName: 'Address Sequence Number',
786
+ description: 'The sequence number of the address to delete',
787
+ required: true,
788
+ }),
789
+ sourceId: Property.ShortText({
790
+ displayName: 'Source ID',
791
+ description: 'Optional: 6 character ID provided by FIS',
792
+ required: false,
793
+ }),
794
+ },
795
+ async run(context) {
796
+ const auth = context.auth as any;
797
+ const baseUrl = auth['baseUrl'];
798
+ const organizationId = auth['organizationId'];
799
+ const { xAuthorization, customerId, addressSequenceNumber, sourceId } = context.propsValue;
800
+
801
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
802
+
803
+ const response = await httpClient.sendRequest({
804
+ method: HttpMethod.DELETE,
805
+ url: `${baseUrl}/customer/v2/customers/${customerId}/contact-info/addresses/${addressSequenceNumber}`,
806
+ headers,
807
+ });
808
+
809
+ return response.body;
810
+ },
811
+ });
812
+
813
+ // ==================== INTERNET ADDRESSES ====================
814
+
815
+ export const customer_internet_addresses_inquiry = createAction({
816
+ name: 'customer_internet_addresses_inquiry',
817
+ auth: fisHorizonAuth,
818
+ displayName: 'Customer - Internet Addresses - Inquiry',
819
+ description: 'Retrieve a customer\'s Internet Address records.',
820
+ props: {
821
+ xAuthorization: Property.ShortText({
822
+ displayName: 'Authorization Token (JWT)',
823
+ description: 'The JWT token obtained from the Authorization - Get Token action',
824
+ required: true,
825
+ }),
826
+ customerId: Property.ShortText({
827
+ displayName: 'Customer ID',
828
+ description: 'Customer ID (14 characters)',
829
+ required: true,
830
+ }),
831
+ addressType: Property.ShortText({
832
+ displayName: 'Address Type',
833
+ description: 'Type of internet address to filter by',
834
+ required: false,
835
+ }),
836
+ numberOfRecords: Property.Number({
837
+ displayName: 'Number of Records',
838
+ description: 'Number of records to return (1-999)',
839
+ required: false,
840
+ defaultValue: 999,
841
+ }),
842
+ firstNextDefault: Property.StaticDropdown({
843
+ displayName: 'First/Next/Default',
844
+ description: 'Pagination control',
845
+ required: false,
846
+ options: {
847
+ options: [
848
+ { label: 'F - First', value: 'F' },
849
+ { label: 'N - Next', value: 'N' },
850
+ { label: 'D - Default', value: 'D' },
851
+ ],
852
+ },
853
+ }),
854
+ sourceId: Property.ShortText({
855
+ displayName: 'Source ID',
856
+ description: 'Optional: 6 character ID provided by FIS',
857
+ required: false,
858
+ }),
859
+ },
860
+ async run(context) {
861
+ const auth = context.auth as any;
862
+ const baseUrl = auth['baseUrl'];
863
+ const organizationId = auth['organizationId'];
864
+ const { xAuthorization, customerId, addressType, numberOfRecords, firstNextDefault, sourceId } = context.propsValue;
865
+
866
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
867
+
868
+ let url = `${baseUrl}/customer/v2/customers/${customerId}/contact-info/internet-addresses`;
869
+ const queryParams: string[] = [];
870
+ if (addressType) queryParams.push(`addressType=${addressType}`);
871
+ if (numberOfRecords) queryParams.push(`numberOfRecords=${numberOfRecords}`);
872
+ if (firstNextDefault) queryParams.push(`firstNextDefault=${firstNextDefault}`);
873
+ if (queryParams.length > 0) {
874
+ url += `?${queryParams.join('&')}`;
875
+ }
876
+
877
+ const response = await httpClient.sendRequest({
878
+ method: HttpMethod.GET,
879
+ url,
880
+ headers,
881
+ });
882
+
883
+ return response.body;
884
+ },
885
+ });
886
+
887
+ export const customer_internet_addresses_add = createAction({
888
+ name: 'customer_internet_addresses_add',
889
+ auth: fisHorizonAuth,
890
+ displayName: 'Customer - Internet Addresses - Add',
891
+ description: 'Add an internet address record for a given customer.',
892
+ props: {
893
+ xAuthorization: Property.ShortText({
894
+ displayName: 'Authorization Token (JWT)',
895
+ description: 'The JWT token obtained from the Authorization - Get Token action',
896
+ required: true,
897
+ }),
898
+ customerId: Property.ShortText({
899
+ displayName: 'Customer ID',
900
+ description: 'Customer ID (14 characters)',
901
+ required: true,
902
+ }),
903
+ internetAddressData: Property.Json({
904
+ displayName: 'Internet Address Data',
905
+ description: 'JSON object containing internet address information',
906
+ required: true,
907
+ }),
908
+ sourceId: Property.ShortText({
909
+ displayName: 'Source ID',
910
+ description: 'Optional: 6 character ID provided by FIS',
911
+ required: false,
912
+ }),
913
+ },
914
+ async run(context) {
915
+ const auth = context.auth as any;
916
+ const baseUrl = auth['baseUrl'];
917
+ const organizationId = auth['organizationId'];
918
+ const { xAuthorization, customerId, internetAddressData, sourceId } = context.propsValue;
919
+
920
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
921
+
922
+ const response = await httpClient.sendRequest({
923
+ method: HttpMethod.POST,
924
+ url: `${baseUrl}/customer/v2/customers/${customerId}/contact-info/internet-addresses`,
925
+ headers,
926
+ body: internetAddressData,
927
+ });
928
+
929
+ return response.body;
930
+ },
931
+ });
932
+
933
+ // ==================== DUE DILIGENCE - NON-PERSONAL ====================
934
+
935
+ export const customer_due_diligence_non_personal_inquiry = createAction({
936
+ name: 'customer_due_diligence_non_personal_inquiry',
937
+ auth: fisHorizonAuth,
938
+ displayName: 'Customer - Due Diligence Non-Personal - Inquiry',
939
+ description: 'Retrieve a list of enhanced due diligence records for a given non-personal customer.',
940
+ props: {
941
+ xAuthorization: Property.ShortText({
942
+ displayName: 'Authorization Token (JWT)',
943
+ description: 'The JWT token obtained from the Authorization - Get Token action',
944
+ required: true,
945
+ }),
946
+ customerId: Property.ShortText({
947
+ displayName: 'Customer ID',
948
+ description: 'Customer ID (14 characters)',
949
+ required: true,
950
+ }),
951
+ sourceId: Property.ShortText({
952
+ displayName: 'Source ID',
953
+ description: 'Optional: 6 character ID provided by FIS',
954
+ required: false,
955
+ }),
956
+ },
957
+ async run(context) {
958
+ const auth = context.auth as any;
959
+ const baseUrl = auth['baseUrl'];
960
+ const organizationId = auth['organizationId'];
961
+ const { xAuthorization, customerId, sourceId } = context.propsValue;
962
+
963
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
964
+
965
+ const response = await httpClient.sendRequest({
966
+ method: HttpMethod.GET,
967
+ url: `${baseUrl}/customer/v2/customers/${customerId}/due-diligence/non-personal`,
968
+ headers,
969
+ });
970
+
971
+ return response.body;
972
+ },
973
+ });
974
+
975
+ export const customer_due_diligence_non_personal_add = createAction({
976
+ name: 'customer_due_diligence_non_personal_add',
977
+ auth: fisHorizonAuth,
978
+ displayName: 'Customer - Due Diligence Non-Personal - Add',
979
+ description: 'Add an enhanced due diligence record for a given non-personal customer.',
980
+ props: {
981
+ xAuthorization: Property.ShortText({
982
+ displayName: 'Authorization Token (JWT)',
983
+ description: 'The JWT token obtained from the Authorization - Get Token action',
984
+ required: true,
985
+ }),
986
+ customerId: Property.ShortText({
987
+ displayName: 'Customer ID',
988
+ description: 'Customer ID (14 characters)',
989
+ required: true,
990
+ }),
991
+ dueDiligenceData: Property.Json({
992
+ displayName: 'Due Diligence Data',
993
+ description: 'JSON object containing due diligence information',
994
+ required: true,
995
+ }),
996
+ sourceId: Property.ShortText({
997
+ displayName: 'Source ID',
998
+ description: 'Optional: 6 character ID provided by FIS',
999
+ required: false,
1000
+ }),
1001
+ },
1002
+ async run(context) {
1003
+ const auth = context.auth as any;
1004
+ const baseUrl = auth['baseUrl'];
1005
+ const organizationId = auth['organizationId'];
1006
+ const { xAuthorization, customerId, dueDiligenceData, sourceId } = context.propsValue;
1007
+
1008
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1009
+
1010
+ const response = await httpClient.sendRequest({
1011
+ method: HttpMethod.POST,
1012
+ url: `${baseUrl}/customer/v2/customers/${customerId}/due-diligence/non-personal`,
1013
+ headers,
1014
+ body: dueDiligenceData,
1015
+ });
1016
+
1017
+ return response.body;
1018
+ },
1019
+ });
1020
+
1021
+ export const customer_due_diligence_non_personal_update = createAction({
1022
+ name: 'customer_due_diligence_non_personal_update',
1023
+ auth: fisHorizonAuth,
1024
+ displayName: 'Customer - Due Diligence Non-Personal - Update',
1025
+ description: 'Maintain an enhanced due diligence record for a given non-personal customer.',
1026
+ props: {
1027
+ xAuthorization: Property.ShortText({
1028
+ displayName: 'Authorization Token (JWT)',
1029
+ description: 'The JWT token obtained from the Authorization - Get Token action',
1030
+ required: true,
1031
+ }),
1032
+ customerId: Property.ShortText({
1033
+ displayName: 'Customer ID',
1034
+ description: 'Customer ID (14 characters)',
1035
+ required: true,
1036
+ }),
1037
+ dueDiligenceData: Property.Json({
1038
+ displayName: 'Due Diligence Data',
1039
+ description: 'JSON object containing updated due diligence information',
1040
+ required: true,
1041
+ }),
1042
+ sourceId: Property.ShortText({
1043
+ displayName: 'Source ID',
1044
+ description: 'Optional: 6 character ID provided by FIS',
1045
+ required: false,
1046
+ }),
1047
+ },
1048
+ async run(context) {
1049
+ const auth = context.auth as any;
1050
+ const baseUrl = auth['baseUrl'];
1051
+ const organizationId = auth['organizationId'];
1052
+ const { xAuthorization, customerId, dueDiligenceData, sourceId } = context.propsValue;
1053
+
1054
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1055
+
1056
+ const response = await httpClient.sendRequest({
1057
+ method: HttpMethod.PUT,
1058
+ url: `${baseUrl}/customer/v2/customers/${customerId}/due-diligence/non-personal`,
1059
+ headers,
1060
+ body: dueDiligenceData,
1061
+ });
1062
+
1063
+ return response.body;
1064
+ },
1065
+ });
1066
+
1067
+ export const customer_due_diligence_non_personal_delete = createAction({
1068
+ name: 'customer_due_diligence_non_personal_delete',
1069
+ auth: fisHorizonAuth,
1070
+ displayName: 'Customer - Due Diligence Non-Personal - Delete',
1071
+ description: 'Delete an enhanced due diligence record for a given non-personal customer.',
1072
+ props: {
1073
+ xAuthorization: Property.ShortText({
1074
+ displayName: 'Authorization Token (JWT)',
1075
+ description: 'The JWT token obtained from the Authorization - Get Token action',
1076
+ required: true,
1077
+ }),
1078
+ customerId: Property.ShortText({
1079
+ displayName: 'Customer ID',
1080
+ description: 'Customer ID (14 characters)',
1081
+ required: true,
1082
+ }),
1083
+ sourceId: Property.ShortText({
1084
+ displayName: 'Source ID',
1085
+ description: 'Optional: 6 character ID provided by FIS',
1086
+ required: false,
1087
+ }),
1088
+ },
1089
+ async run(context) {
1090
+ const auth = context.auth as any;
1091
+ const baseUrl = auth['baseUrl'];
1092
+ const organizationId = auth['organizationId'];
1093
+ const { xAuthorization, customerId, sourceId } = context.propsValue;
1094
+
1095
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1096
+
1097
+ const response = await httpClient.sendRequest({
1098
+ method: HttpMethod.DELETE,
1099
+ url: `${baseUrl}/customer/v2/customers/${customerId}/due-diligence/non-personal`,
1100
+ headers,
1101
+ });
1102
+
1103
+ return response.body;
1104
+ },
1105
+ });
1106
+
1107
+ // ==================== DUE DILIGENCE - PERSONAL ====================
1108
+
1109
+ export const customer_due_diligence_personal_inquiry = createAction({
1110
+ name: 'customer_due_diligence_personal_inquiry',
1111
+ auth: fisHorizonAuth,
1112
+ displayName: 'Customer - Due Diligence Personal - Inquiry',
1113
+ description: 'Retrieve a list of enhanced due diligence records for a given personal customer.',
1114
+ props: {
1115
+ xAuthorization: Property.ShortText({
1116
+ displayName: 'Authorization Token (JWT)',
1117
+ description: 'The JWT token obtained from the Authorization - Get Token action',
1118
+ required: true,
1119
+ }),
1120
+ customerId: Property.ShortText({
1121
+ displayName: 'Customer ID',
1122
+ description: 'Customer ID (14 characters)',
1123
+ required: true,
1124
+ }),
1125
+ sourceId: Property.ShortText({
1126
+ displayName: 'Source ID',
1127
+ description: 'Optional: 6 character ID provided by FIS',
1128
+ required: false,
1129
+ }),
1130
+ },
1131
+ async run(context) {
1132
+ const auth = context.auth as any;
1133
+ const baseUrl = auth['baseUrl'];
1134
+ const organizationId = auth['organizationId'];
1135
+ const { xAuthorization, customerId, sourceId } = context.propsValue;
1136
+
1137
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1138
+
1139
+ const response = await httpClient.sendRequest({
1140
+ method: HttpMethod.GET,
1141
+ url: `${baseUrl}/customer/v2/customers/${customerId}/due-diligence/personal`,
1142
+ headers,
1143
+ });
1144
+
1145
+ return response.body;
1146
+ },
1147
+ });
1148
+
1149
+ export const customer_due_diligence_personal_add = createAction({
1150
+ name: 'customer_due_diligence_personal_add',
1151
+ auth: fisHorizonAuth,
1152
+ displayName: 'Customer - Due Diligence Personal - Add',
1153
+ description: 'Add an enhanced due diligence record for a given personal customer.',
1154
+ props: {
1155
+ xAuthorization: Property.ShortText({
1156
+ displayName: 'Authorization Token (JWT)',
1157
+ description: 'The JWT token obtained from the Authorization - Get Token action',
1158
+ required: true,
1159
+ }),
1160
+ customerId: Property.ShortText({
1161
+ displayName: 'Customer ID',
1162
+ description: 'Customer ID (14 characters)',
1163
+ required: true,
1164
+ }),
1165
+ dueDiligenceData: Property.Json({
1166
+ displayName: 'Due Diligence Data',
1167
+ description: 'JSON object containing due diligence information',
1168
+ required: true,
1169
+ }),
1170
+ sourceId: Property.ShortText({
1171
+ displayName: 'Source ID',
1172
+ description: 'Optional: 6 character ID provided by FIS',
1173
+ required: false,
1174
+ }),
1175
+ },
1176
+ async run(context) {
1177
+ const auth = context.auth as any;
1178
+ const baseUrl = auth['baseUrl'];
1179
+ const organizationId = auth['organizationId'];
1180
+ const { xAuthorization, customerId, dueDiligenceData, sourceId } = context.propsValue;
1181
+
1182
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1183
+
1184
+ const response = await httpClient.sendRequest({
1185
+ method: HttpMethod.POST,
1186
+ url: `${baseUrl}/customer/v2/customers/${customerId}/due-diligence/personal`,
1187
+ headers,
1188
+ body: dueDiligenceData,
1189
+ });
1190
+
1191
+ return response.body;
1192
+ },
1193
+ });
1194
+
1195
+ export const customer_due_diligence_personal_update = createAction({
1196
+ name: 'customer_due_diligence_personal_update',
1197
+ auth: fisHorizonAuth,
1198
+ displayName: 'Customer - Due Diligence Personal - Update',
1199
+ description: 'Maintain an enhanced due diligence record for a given personal customer.',
1200
+ props: {
1201
+ xAuthorization: Property.ShortText({
1202
+ displayName: 'Authorization Token (JWT)',
1203
+ description: 'The JWT token obtained from the Authorization - Get Token action',
1204
+ required: true,
1205
+ }),
1206
+ customerId: Property.ShortText({
1207
+ displayName: 'Customer ID',
1208
+ description: 'Customer ID (14 characters)',
1209
+ required: true,
1210
+ }),
1211
+ dueDiligenceData: Property.Json({
1212
+ displayName: 'Due Diligence Data',
1213
+ description: 'JSON object containing updated due diligence information',
1214
+ required: true,
1215
+ }),
1216
+ sourceId: Property.ShortText({
1217
+ displayName: 'Source ID',
1218
+ description: 'Optional: 6 character ID provided by FIS',
1219
+ required: false,
1220
+ }),
1221
+ },
1222
+ async run(context) {
1223
+ const auth = context.auth as any;
1224
+ const baseUrl = auth['baseUrl'];
1225
+ const organizationId = auth['organizationId'];
1226
+ const { xAuthorization, customerId, dueDiligenceData, sourceId } = context.propsValue;
1227
+
1228
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1229
+
1230
+ const response = await httpClient.sendRequest({
1231
+ method: HttpMethod.PUT,
1232
+ url: `${baseUrl}/customer/v2/customers/${customerId}/due-diligence/personal`,
1233
+ headers,
1234
+ body: dueDiligenceData,
1235
+ });
1236
+
1237
+ return response.body;
1238
+ },
1239
+ });
1240
+
1241
+ export const customer_due_diligence_personal_delete = createAction({
1242
+ name: 'customer_due_diligence_personal_delete',
1243
+ auth: fisHorizonAuth,
1244
+ displayName: 'Customer - Due Diligence Personal - Delete',
1245
+ description: 'Delete an enhanced due diligence record for a given personal customer.',
1246
+ props: {
1247
+ xAuthorization: Property.ShortText({
1248
+ displayName: 'Authorization Token (JWT)',
1249
+ description: 'The JWT token obtained from the Authorization - Get Token action',
1250
+ required: true,
1251
+ }),
1252
+ customerId: Property.ShortText({
1253
+ displayName: 'Customer ID',
1254
+ description: 'Customer ID (14 characters)',
1255
+ required: true,
1256
+ }),
1257
+ sourceId: Property.ShortText({
1258
+ displayName: 'Source ID',
1259
+ description: 'Optional: 6 character ID provided by FIS',
1260
+ required: false,
1261
+ }),
1262
+ },
1263
+ async run(context) {
1264
+ const auth = context.auth as any;
1265
+ const baseUrl = auth['baseUrl'];
1266
+ const organizationId = auth['organizationId'];
1267
+ const { xAuthorization, customerId, sourceId } = context.propsValue;
1268
+
1269
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1270
+
1271
+ const response = await httpClient.sendRequest({
1272
+ method: HttpMethod.DELETE,
1273
+ url: `${baseUrl}/customer/v2/customers/${customerId}/due-diligence/personal`,
1274
+ headers,
1275
+ });
1276
+
1277
+ return response.body;
1278
+ },
1279
+ });
1280
+
1281
+ // ==================== ACCOUNT RELATIONSHIPS ====================
1282
+
1283
+ export const customer_account_relationships_add = createAction({
1284
+ name: 'customer_account_relationships_add',
1285
+ auth: fisHorizonAuth,
1286
+ displayName: 'Customer - Account Relationships - Add',
1287
+ description: 'Add a customer to account relationships in the customer database.',
1288
+ props: {
1289
+ xAuthorization: Property.ShortText({
1290
+ displayName: 'Authorization Token (JWT)',
1291
+ description: 'The JWT token obtained from the Authorization - Get Token action',
1292
+ required: true,
1293
+ }),
1294
+ applicationCode: Property.ShortText({
1295
+ displayName: 'Application Code',
1296
+ description: 'Application code (e.g., DD, LN, CD)',
1297
+ required: true,
1298
+ }),
1299
+ accountNumber: Property.ShortText({
1300
+ displayName: 'Account Number',
1301
+ description: 'Account number',
1302
+ required: true,
1303
+ }),
1304
+ relationshipData: Property.Json({
1305
+ displayName: 'Relationship Data',
1306
+ description: 'JSON object containing account relationship information',
1307
+ required: true,
1308
+ }),
1309
+ sourceId: Property.ShortText({
1310
+ displayName: 'Source ID',
1311
+ description: 'Optional: 6 character ID provided by FIS',
1312
+ required: false,
1313
+ }),
1314
+ },
1315
+ async run(context) {
1316
+ const auth = context.auth as any;
1317
+ const baseUrl = auth['baseUrl'];
1318
+ const organizationId = auth['organizationId'];
1319
+ const { xAuthorization, applicationCode, accountNumber, relationshipData, sourceId } = context.propsValue;
1320
+
1321
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1322
+
1323
+ const response = await httpClient.sendRequest({
1324
+ method: HttpMethod.POST,
1325
+ url: `${baseUrl}/customer/v2/accounts/${applicationCode}/${accountNumber}/relationships/accounts`,
1326
+ headers,
1327
+ body: relationshipData,
1328
+ });
1329
+
1330
+ return response.body;
1331
+ },
1332
+ });
1333
+
1334
+ // ==================== EMAIL FORMS ====================
1335
+
1336
+ export const customer_email_forms_inquiry = createAction({
1337
+ name: 'customer_email_forms_inquiry',
1338
+ auth: fisHorizonAuth,
1339
+ displayName: 'Customer - Email Forms - Inquiry',
1340
+ description: 'Retrieve the status for each primary document form in alternate delivery that is eligible to be delivered.',
1341
+ props: {
1342
+ xAuthorization: Property.ShortText({
1343
+ displayName: 'Authorization Token (JWT)',
1344
+ description: 'The JWT token obtained from the Authorization - Get Token action',
1345
+ required: true,
1346
+ }),
1347
+ applicationCode: Property.ShortText({
1348
+ displayName: 'Application Code',
1349
+ description: 'Application code (e.g., DD, LN, CD)',
1350
+ required: true,
1351
+ }),
1352
+ accountNumber: Property.ShortText({
1353
+ displayName: 'Account Number',
1354
+ description: 'Account number',
1355
+ required: true,
1356
+ }),
1357
+ formType: Property.ShortText({
1358
+ displayName: 'Form Type',
1359
+ description: 'Form type to filter by',
1360
+ required: false,
1361
+ }),
1362
+ rmKey: Property.ShortText({
1363
+ displayName: 'RM Key',
1364
+ description: 'Relationship Management key',
1365
+ required: false,
1366
+ }),
1367
+ sourceId: Property.ShortText({
1368
+ displayName: 'Source ID',
1369
+ description: 'Optional: 6 character ID provided by FIS',
1370
+ required: false,
1371
+ }),
1372
+ },
1373
+ async run(context) {
1374
+ const auth = context.auth as any;
1375
+ const baseUrl = auth['baseUrl'];
1376
+ const organizationId = auth['organizationId'];
1377
+ const { xAuthorization, applicationCode, accountNumber, formType, rmKey, sourceId } = context.propsValue;
1378
+
1379
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1380
+
1381
+ let url = `${baseUrl}/customer/v2/accounts/${applicationCode}/${accountNumber}/email-forms`;
1382
+ const queryParams: string[] = [];
1383
+ if (formType) queryParams.push(`formType=${formType}`);
1384
+ if (rmKey) queryParams.push(`rmKey=${rmKey}`);
1385
+ if (queryParams.length > 0) {
1386
+ url += `?${queryParams.join('&')}`;
1387
+ }
1388
+
1389
+ const response = await httpClient.sendRequest({
1390
+ method: HttpMethod.GET,
1391
+ url,
1392
+ headers,
1393
+ });
1394
+
1395
+ return response.body;
1396
+ },
1397
+ });
1398
+
1399
+ // ==================== DYNAMIC QUERIES ====================
1400
+
1401
+ export const customer_dynamic_signature_create = createAction({
1402
+ name: 'customer_dynamic_signature_create',
1403
+ auth: fisHorizonAuth,
1404
+ displayName: 'Customer - Dynamic Query - Create Signature',
1405
+ description: 'Generate a digital signature for the Customer information inquiry.',
1406
+ props: {
1407
+ xAuthorization: Property.ShortText({
1408
+ displayName: 'Authorization Token (JWT)',
1409
+ description: 'The JWT token obtained from the Authorization - Get Token action',
1410
+ required: true,
1411
+ }),
1412
+ signatureRequest: Property.Json({
1413
+ displayName: 'Signature Request',
1414
+ description: 'JSON object specifying the fields to include in the digital signature',
1415
+ required: true,
1416
+ }),
1417
+ sourceId: Property.ShortText({
1418
+ displayName: 'Source ID',
1419
+ description: 'Optional: 6 character ID provided by FIS',
1420
+ required: false,
1421
+ }),
1422
+ },
1423
+ async run(context) {
1424
+ const auth = context.auth as any;
1425
+ const baseUrl = auth['baseUrl'];
1426
+ const organizationId = auth['organizationId'];
1427
+ const { xAuthorization, signatureRequest, sourceId } = context.propsValue;
1428
+
1429
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1430
+
1431
+ const response = await httpClient.sendRequest({
1432
+ method: HttpMethod.POST,
1433
+ url: `${baseUrl}/customer/v2/dynamic/customers/signature`,
1434
+ headers,
1435
+ body: signatureRequest,
1436
+ });
1437
+
1438
+ return response.body;
1439
+ },
1440
+ });
1441
+
1442
+ export const customer_dynamic_fields_inquiry = createAction({
1443
+ name: 'customer_dynamic_fields_inquiry',
1444
+ auth: fisHorizonAuth,
1445
+ displayName: 'Customer - Dynamic Query - Fields Inquiry',
1446
+ description: 'Return a list of fields for the given digital signature.',
1447
+ props: {
1448
+ xAuthorization: Property.ShortText({
1449
+ displayName: 'Authorization Token (JWT)',
1450
+ description: 'The JWT token obtained from the Authorization - Get Token action',
1451
+ required: true,
1452
+ }),
1453
+ fieldsRequest: Property.Json({
1454
+ displayName: 'Fields Request',
1455
+ description: 'JSON object containing the digital signature to retrieve fields for',
1456
+ required: true,
1457
+ }),
1458
+ sourceId: Property.ShortText({
1459
+ displayName: 'Source ID',
1460
+ description: 'Optional: 6 character ID provided by FIS',
1461
+ required: false,
1462
+ }),
1463
+ },
1464
+ async run(context) {
1465
+ const auth = context.auth as any;
1466
+ const baseUrl = auth['baseUrl'];
1467
+ const organizationId = auth['organizationId'];
1468
+ const { xAuthorization, fieldsRequest, sourceId } = context.propsValue;
1469
+
1470
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1471
+
1472
+ const response = await httpClient.sendRequest({
1473
+ method: HttpMethod.POST,
1474
+ url: `${baseUrl}/customer/v2/dynamic/customers/fields`,
1475
+ headers,
1476
+ body: fieldsRequest,
1477
+ });
1478
+
1479
+ return response.body;
1480
+ },
1481
+ });
1482
+
1483
+ export const customer_dynamic_inquiry = createAction({
1484
+ name: 'customer_dynamic_inquiry',
1485
+ auth: fisHorizonAuth,
1486
+ displayName: 'Customer - Dynamic Query - Inquiry',
1487
+ description: 'Return customer information represented by the given digital signature.',
1488
+ props: {
1489
+ xAuthorization: Property.ShortText({
1490
+ displayName: 'Authorization Token (JWT)',
1491
+ description: 'The JWT token obtained from the Authorization - Get Token action',
1492
+ required: true,
1493
+ }),
1494
+ inquiryRequest: Property.Json({
1495
+ displayName: 'Inquiry Request',
1496
+ description: 'JSON object containing the digital signature and customer ID for the inquiry',
1497
+ required: true,
1498
+ }),
1499
+ sourceId: Property.ShortText({
1500
+ displayName: 'Source ID',
1501
+ description: 'Optional: 6 character ID provided by FIS',
1502
+ required: false,
1503
+ }),
1504
+ },
1505
+ async run(context) {
1506
+ const auth = context.auth as any;
1507
+ const baseUrl = auth['baseUrl'];
1508
+ const organizationId = auth['organizationId'];
1509
+ const { xAuthorization, inquiryRequest, sourceId } = context.propsValue;
1510
+
1511
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1512
+
1513
+ const response = await httpClient.sendRequest({
1514
+ method: HttpMethod.POST,
1515
+ url: `${baseUrl}/customer/v2/dynamic/customers/inquiry`,
1516
+ headers,
1517
+ body: inquiryRequest,
1518
+ });
1519
+
1520
+ return response.body;
1521
+ },
1522
+ });
1523
+
1524
+ // ==================== RELATIONSHIP SUMMARY WITH ACCOUNT DETAILS ====================
1525
+
1526
+ export const customer_relationship_summary_account_details_search = createAction({
1527
+ name: 'customer_relationship_summary_account_details_search',
1528
+ auth: fisHorizonAuth,
1529
+ displayName: 'Customer - Relationship Summary Account Details - Search',
1530
+ description: 'Retrieve a list of applications/accounts along with account details for a specific customer.',
1531
+ props: {
1532
+ xAuthorization: Property.ShortText({
1533
+ displayName: 'Authorization Token (JWT)',
1534
+ description: 'The JWT token obtained from the Authorization - Get Token action',
1535
+ required: true,
1536
+ }),
1537
+ customerId: Property.ShortText({
1538
+ displayName: 'Customer ID',
1539
+ description: 'The customer ID to search for',
1540
+ required: false,
1541
+ }),
1542
+ tin: Property.ShortText({
1543
+ displayName: 'TIN (Tax ID)',
1544
+ description: 'The Tax Identification Number',
1545
+ required: false,
1546
+ }),
1547
+ interfaceFlag: Property.StaticDropdown({
1548
+ displayName: 'Interface Flag',
1549
+ description: 'Interface flag for the request',
1550
+ required: false,
1551
+ options: {
1552
+ options: [
1553
+ { label: 'IN - Internal', value: 'IN' },
1554
+ { label: 'EX - External', value: 'EX' },
1555
+ ],
1556
+ },
1557
+ }),
1558
+ ownershipType: Property.StaticDropdown({
1559
+ displayName: 'Ownership Type',
1560
+ description: 'The ownership type to filter by',
1561
+ required: false,
1562
+ options: {
1563
+ options: [
1564
+ { label: 'D - Direct', value: 'D' },
1565
+ { label: 'I - Indirect', value: 'I' },
1566
+ { label: 'S - Signer', value: 'S' },
1567
+ ],
1568
+ },
1569
+ }),
1570
+ numberOfAccountsToReturn: Property.Number({
1571
+ displayName: 'Number of Accounts to Return',
1572
+ description: 'Maximum number of accounts to return',
1573
+ required: false,
1574
+ defaultValue: 999,
1575
+ }),
1576
+ viewUndisplayedRelationships: Property.StaticDropdown({
1577
+ displayName: 'View Undisplayed Relationships',
1578
+ description: 'Whether to include undisplayed relationships',
1579
+ required: false,
1580
+ options: {
1581
+ options: [
1582
+ { label: 'Yes', value: 'Y' },
1583
+ { label: 'No', value: 'N' },
1584
+ ],
1585
+ },
1586
+ defaultValue: 'Y',
1587
+ }),
1588
+ returnUppercase: Property.StaticDropdown({
1589
+ displayName: 'Return Uppercase',
1590
+ description: 'Return data in uppercase',
1591
+ required: false,
1592
+ options: {
1593
+ options: [
1594
+ { label: 'Yes', value: 'Y' },
1595
+ { label: 'No', value: 'N' },
1596
+ ],
1597
+ },
1598
+ }),
1599
+ searchDirection: Property.StaticDropdown({
1600
+ displayName: 'Search Direction',
1601
+ description: 'Direction for searching',
1602
+ required: false,
1603
+ options: {
1604
+ options: [
1605
+ { label: 'B - Both', value: 'B' },
1606
+ { label: 'F - Forward', value: 'F' },
1607
+ { label: 'R - Reverse', value: 'R' },
1608
+ ],
1609
+ },
1610
+ }),
1611
+ onlineBankingUserId: Property.ShortText({
1612
+ displayName: 'Online Banking User ID',
1613
+ description: 'Online banking user ID',
1614
+ required: false,
1615
+ }),
1616
+ availableBalanceDDA: Property.ShortText({
1617
+ displayName: 'Available Balance DDA',
1618
+ description: 'Available balance calculation type for DDA',
1619
+ required: false,
1620
+ }),
1621
+ savingsAvailableBalance: Property.ShortText({
1622
+ displayName: 'Savings Available Balance',
1623
+ description: 'Available balance calculation type for Savings',
1624
+ required: false,
1625
+ }),
1626
+ includeReadyReserveOverdraft: Property.Checkbox({
1627
+ displayName: 'Include Ready Reserve Overdraft',
1628
+ description: 'Whether to include ready reserve overdraft',
1629
+ required: false,
1630
+ defaultValue: false,
1631
+ }),
1632
+ sourceId: Property.ShortText({
1633
+ displayName: 'Source ID',
1634
+ description: 'Optional: 6 character ID provided by FIS',
1635
+ required: false,
1636
+ }),
1637
+ },
1638
+ async run(context) {
1639
+ const auth = context.auth as any;
1640
+ const baseUrl = auth['baseUrl'];
1641
+ const organizationId = auth['organizationId'];
1642
+ const {
1643
+ xAuthorization,
1644
+ customerId,
1645
+ tin,
1646
+ interfaceFlag,
1647
+ ownershipType,
1648
+ numberOfAccountsToReturn,
1649
+ viewUndisplayedRelationships,
1650
+ returnUppercase,
1651
+ searchDirection,
1652
+ onlineBankingUserId,
1653
+ availableBalanceDDA,
1654
+ savingsAvailableBalance,
1655
+ includeReadyReserveOverdraft,
1656
+ sourceId,
1657
+ } = context.propsValue;
1658
+
1659
+ const headers = createHeaders(organizationId, xAuthorization, sourceId);
1660
+
1661
+ // Add optional header params
1662
+ if (returnUppercase) {
1663
+ headers['returnUppercase'] = returnUppercase;
1664
+ }
1665
+ if (searchDirection) {
1666
+ headers['searchDirection'] = searchDirection;
1667
+ }
1668
+
1669
+ const body: Record<string, unknown> = {};
1670
+
1671
+ if (customerId) body['customerId'] = customerId;
1672
+ if (tin) body['tin'] = tin;
1673
+ if (interfaceFlag) body['interfaceFlag'] = interfaceFlag;
1674
+ if (ownershipType) body['ownershipType'] = ownershipType;
1675
+ if (numberOfAccountsToReturn) body['numberOfAccountsToReturn'] = numberOfAccountsToReturn;
1676
+ if (viewUndisplayedRelationships) body['viewUndisplayedRelationships'] = viewUndisplayedRelationships;
1677
+ if (onlineBankingUserId) body['onlineBankingUserId'] = onlineBankingUserId;
1678
+ if (availableBalanceDDA) body['availableBalanceDDA'] = availableBalanceDDA;
1679
+ if (savingsAvailableBalance) body['savingsAvailableBalance'] = savingsAvailableBalance;
1680
+ if (includeReadyReserveOverdraft !== undefined) body['includeReadyReserveOverdraft'] = includeReadyReserveOverdraft;
1681
+
1682
+ const response = await httpClient.sendRequest({
1683
+ method: HttpMethod.POST,
1684
+ url: `${baseUrl}/customer/v2/customers/relationship-summary/account-details/search`,
1685
+ headers,
1686
+ body,
1687
+ });
1688
+
1689
+ return response.body;
1690
+ },
1691
+ });