@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,140 @@
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
+ export const searchCustomerRelationshipSummary = createAction({
9
+ name: 'customer_search_relationship_summary',
10
+ auth: fisHorizonAuth,
11
+ displayName: 'Customer - Search Relationship Summary',
12
+ description: 'Retrieve a list of applications/accounts along with account details for a specific customer.',
13
+ props: {
14
+ xAuthorization: Property.ShortText({
15
+ displayName: 'Authorization Token (JWT)',
16
+ description: 'The JWT token obtained from the Authorization - Get Token action',
17
+ required: true,
18
+ }),
19
+ customerId: Property.ShortText({
20
+ displayName: 'Customer ID',
21
+ description: 'The customer ID to search for',
22
+ required: false,
23
+ }),
24
+ tin: Property.ShortText({
25
+ displayName: 'TIN (Tax ID)',
26
+ description: 'The Tax Identification Number',
27
+ required: false,
28
+ }),
29
+ interfaceFlag: Property.StaticDropdown({
30
+ displayName: 'Interface Flag',
31
+ description: 'Interface flag for the request',
32
+ required: false,
33
+ options: {
34
+ options: [
35
+ { label: 'IN - Internal', value: 'IN' },
36
+ { label: 'EX - External', value: 'EX' },
37
+ ],
38
+ },
39
+ }),
40
+ ownershipType: Property.StaticDropdown({
41
+ displayName: 'Ownership Type',
42
+ description: 'The ownership type to filter by',
43
+ required: false,
44
+ options: {
45
+ options: [
46
+ { label: 'D - Direct', value: 'D' },
47
+ { label: 'I - Indirect', value: 'I' },
48
+ { label: 'S - Signer', value: 'S' },
49
+ ],
50
+ },
51
+ }),
52
+ numberOfAccountsToReturn: Property.Number({
53
+ displayName: 'Number of Accounts to Return',
54
+ description: 'Maximum number of accounts to return',
55
+ required: false,
56
+ defaultValue: 999,
57
+ }),
58
+ viewUndisplayedRelationships: Property.StaticDropdown({
59
+ displayName: 'View Undisplayed Relationships',
60
+ description: 'Whether to include undisplayed relationships',
61
+ required: false,
62
+ options: {
63
+ options: [
64
+ { label: 'Yes', value: 'Y' },
65
+ { label: 'No', value: 'N' },
66
+ ],
67
+ },
68
+ defaultValue: 'Y',
69
+ }),
70
+ sourceId: Property.ShortText({
71
+ displayName: 'Source ID',
72
+ description: 'Optional: 6 character ID provided by FIS',
73
+ required: false,
74
+ }),
75
+ },
76
+ async run(context) {
77
+ const auth = context.auth as any;
78
+ const baseUrl = auth.baseUrl;
79
+ const organizationId = auth.organizationId;
80
+ const {
81
+ xAuthorization,
82
+ customerId,
83
+ tin,
84
+ interfaceFlag,
85
+ ownershipType,
86
+ numberOfAccountsToReturn,
87
+ viewUndisplayedRelationships,
88
+ sourceId,
89
+ } = context.propsValue;
90
+
91
+ const uuid = crypto.randomUUID();
92
+
93
+ const headers: Record<string, string> = {
94
+ 'accept': 'application/json',
95
+ 'Content-Type': 'application/json',
96
+ 'organization-id': organizationId,
97
+ 'uuid': uuid,
98
+ 'x-authorization': xAuthorization,
99
+ };
100
+
101
+ if (sourceId) {
102
+ headers['source-id'] = sourceId;
103
+ }
104
+
105
+ const body: Record<string, unknown> = {};
106
+
107
+ if (customerId) {
108
+ body['customerId'] = customerId;
109
+ }
110
+
111
+ if (tin) {
112
+ body['tin'] = tin;
113
+ }
114
+
115
+ if (interfaceFlag) {
116
+ body['interfaceFlag'] = interfaceFlag;
117
+ }
118
+
119
+ if (ownershipType) {
120
+ body['ownershipType'] = ownershipType;
121
+ }
122
+
123
+ if (numberOfAccountsToReturn) {
124
+ body['numberOfAccountsToReturn'] = numberOfAccountsToReturn;
125
+ }
126
+
127
+ if (viewUndisplayedRelationships) {
128
+ body['viewUndisplayedRelationships'] = viewUndisplayedRelationships;
129
+ }
130
+
131
+ const response = await httpClient.sendRequest({
132
+ method: HttpMethod.POST,
133
+ url: `${baseUrl}/customer/v2/customers/relationship-summary/account-details/search`,
134
+ headers,
135
+ body,
136
+ });
137
+
138
+ return response.body;
139
+ },
140
+ });