@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.
- package/package.json +12 -7
- 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,73 @@
|
|
|
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 getAuthorizationToken = createAction({
|
|
9
|
+
name: 'authorization_get_token',
|
|
10
|
+
auth: fisHorizonAuth,
|
|
11
|
+
displayName: 'Authorization - Get Token',
|
|
12
|
+
description: 'Retrieve an authorization token using user credentials. This token is required for all other API calls.',
|
|
13
|
+
props: {
|
|
14
|
+
newUserSecret: Property.ShortText({
|
|
15
|
+
displayName: 'New User Secret',
|
|
16
|
+
description: 'Optional: Provide a new user secret to update the password',
|
|
17
|
+
required: false,
|
|
18
|
+
}),
|
|
19
|
+
token: Property.ShortText({
|
|
20
|
+
displayName: 'SSO Token',
|
|
21
|
+
description: 'Optional: SSO Token for single sign-on authentication',
|
|
22
|
+
required: false,
|
|
23
|
+
}),
|
|
24
|
+
sourceId: Property.ShortText({
|
|
25
|
+
displayName: 'Source ID',
|
|
26
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
27
|
+
required: false,
|
|
28
|
+
}),
|
|
29
|
+
},
|
|
30
|
+
async run(context) {
|
|
31
|
+
const auth = context.auth as any;
|
|
32
|
+
const baseUrl = auth.baseUrl;
|
|
33
|
+
const organizationId = auth.organizationId;
|
|
34
|
+
const userId = auth.userId;
|
|
35
|
+
const userSecret = auth.userSecret;
|
|
36
|
+
const { newUserSecret, token, sourceId } = context.propsValue;
|
|
37
|
+
|
|
38
|
+
const uuid = crypto.randomUUID();
|
|
39
|
+
|
|
40
|
+
const headers: Record<string, string> = {
|
|
41
|
+
'accept': 'application/json',
|
|
42
|
+
'Content-Type': 'application/json',
|
|
43
|
+
'organization-id': organizationId,
|
|
44
|
+
'uuid': uuid,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
if (sourceId) {
|
|
48
|
+
headers['source-id'] = sourceId;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const body: Record<string, string> = {
|
|
52
|
+
userId: userId,
|
|
53
|
+
userSecret: userSecret,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
if (newUserSecret) {
|
|
57
|
+
body['newUserSecret'] = newUserSecret;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (token) {
|
|
61
|
+
body['token'] = token;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const response = await httpClient.sendRequest({
|
|
65
|
+
method: HttpMethod.PUT,
|
|
66
|
+
url: `${baseUrl}/authorization/v2/authorization`,
|
|
67
|
+
headers,
|
|
68
|
+
body,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return response.body;
|
|
72
|
+
},
|
|
73
|
+
});
|