@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.
- 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,1032 @@
|
|
|
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
|
+
* User Security - Template Inquiry
|
|
10
|
+
* GET /users/templates
|
|
11
|
+
* Retrieve a list of user profile templates
|
|
12
|
+
*/
|
|
13
|
+
export const user_security_template_inquiry = createAction({
|
|
14
|
+
name: 'user_security_template_inquiry',
|
|
15
|
+
auth: fisHorizonAuth,
|
|
16
|
+
displayName: 'User Security - Template Inquiry',
|
|
17
|
+
description: 'Retrieve a list of user profile templates',
|
|
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
|
+
},
|
|
30
|
+
async run(context) {
|
|
31
|
+
const auth = context.auth as any;
|
|
32
|
+
const baseUrl = auth['baseUrl'];
|
|
33
|
+
const organizationId = auth['organizationId'];
|
|
34
|
+
const { xAuthorization, sourceId } = context.propsValue;
|
|
35
|
+
|
|
36
|
+
const uuid = crypto.randomUUID();
|
|
37
|
+
|
|
38
|
+
const headers: Record<string, string> = {
|
|
39
|
+
'accept': 'application/json',
|
|
40
|
+
'Content-Type': 'application/json',
|
|
41
|
+
'organization-id': organizationId,
|
|
42
|
+
'uuid': uuid,
|
|
43
|
+
'horizon-authorization': xAuthorization,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
if (sourceId) {
|
|
47
|
+
headers['source-id'] = sourceId;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const response = await httpClient.sendRequest({
|
|
51
|
+
method: HttpMethod.GET,
|
|
52
|
+
url: `${baseUrl}/user-security/v1/users/templates`,
|
|
53
|
+
headers,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return response.body;
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* User Security - Generate User ID
|
|
62
|
+
* GET /users/generate-user-id
|
|
63
|
+
* Generate a user id and return a user template
|
|
64
|
+
*/
|
|
65
|
+
export const user_security_generate_user_id = createAction({
|
|
66
|
+
name: 'user_security_generate_user_id',
|
|
67
|
+
auth: fisHorizonAuth,
|
|
68
|
+
displayName: 'User Security - Generate User ID',
|
|
69
|
+
description: 'Generate a user id and return a user template',
|
|
70
|
+
props: {
|
|
71
|
+
xAuthorization: Property.ShortText({
|
|
72
|
+
displayName: 'Authorization Token',
|
|
73
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
74
|
+
required: true,
|
|
75
|
+
}),
|
|
76
|
+
sourceId: Property.ShortText({
|
|
77
|
+
displayName: 'Source ID',
|
|
78
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
79
|
+
required: false,
|
|
80
|
+
}),
|
|
81
|
+
firstName: Property.ShortText({
|
|
82
|
+
displayName: 'First Name',
|
|
83
|
+
description: 'First name of the user (max 15 characters)',
|
|
84
|
+
required: true,
|
|
85
|
+
}),
|
|
86
|
+
lastName: Property.ShortText({
|
|
87
|
+
displayName: 'Last Name',
|
|
88
|
+
description: 'Last name of the user (max 15 characters)',
|
|
89
|
+
required: true,
|
|
90
|
+
}),
|
|
91
|
+
templateUserId: Property.ShortText({
|
|
92
|
+
displayName: 'Template User ID',
|
|
93
|
+
description: 'Template user profile to base the new user on (max 10 characters)',
|
|
94
|
+
required: true,
|
|
95
|
+
}),
|
|
96
|
+
middleInitial: Property.ShortText({
|
|
97
|
+
displayName: 'Middle Initial',
|
|
98
|
+
description: 'Optional: Middle initial (max 1 character)',
|
|
99
|
+
required: false,
|
|
100
|
+
}),
|
|
101
|
+
employeeNumber: Property.ShortText({
|
|
102
|
+
displayName: 'Employee Number',
|
|
103
|
+
description: 'Optional: Employee identification number (max 10 characters)',
|
|
104
|
+
required: false,
|
|
105
|
+
}),
|
|
106
|
+
},
|
|
107
|
+
async run(context) {
|
|
108
|
+
const auth = context.auth as any;
|
|
109
|
+
const baseUrl = auth['baseUrl'];
|
|
110
|
+
const organizationId = auth['organizationId'];
|
|
111
|
+
const { xAuthorization, sourceId, firstName, lastName, templateUserId, middleInitial, employeeNumber } = context.propsValue;
|
|
112
|
+
|
|
113
|
+
const uuid = crypto.randomUUID();
|
|
114
|
+
|
|
115
|
+
const headers: Record<string, string> = {
|
|
116
|
+
'accept': 'application/json',
|
|
117
|
+
'Content-Type': 'application/json',
|
|
118
|
+
'organization-id': organizationId,
|
|
119
|
+
'uuid': uuid,
|
|
120
|
+
'horizon-authorization': xAuthorization,
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
if (sourceId) {
|
|
124
|
+
headers['source-id'] = sourceId;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const queryParams: Record<string, string> = {
|
|
128
|
+
firstName: firstName,
|
|
129
|
+
lastName: lastName,
|
|
130
|
+
templateUserId: templateUserId,
|
|
131
|
+
}
|
|
132
|
+
if (middleInitial) {
|
|
133
|
+
queryParams['middleInitial'] = middleInitial;
|
|
134
|
+
}
|
|
135
|
+
if (employeeNumber) {
|
|
136
|
+
queryParams['employeeNumber'] = employeeNumber;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const queryString = '?' + new URLSearchParams(queryParams).toString();
|
|
140
|
+
|
|
141
|
+
const response = await httpClient.sendRequest({
|
|
142
|
+
method: HttpMethod.GET,
|
|
143
|
+
url: `${baseUrl}/user-security/v1/users/generate-user-id${queryString}`,
|
|
144
|
+
headers,
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
return response.body;
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* User Security - Search Users
|
|
153
|
+
* GET /users
|
|
154
|
+
* Retrieve a list of existing users using filters
|
|
155
|
+
*/
|
|
156
|
+
export const user_security_search_users = createAction({
|
|
157
|
+
name: 'user_security_search_users',
|
|
158
|
+
auth: fisHorizonAuth,
|
|
159
|
+
displayName: 'User Security - Search Users',
|
|
160
|
+
description: 'Retrieve a list of existing users using filters. Wildcard (*) is permitted for userId, firstName, and lastName.',
|
|
161
|
+
props: {
|
|
162
|
+
xAuthorization: Property.ShortText({
|
|
163
|
+
displayName: 'Authorization Token',
|
|
164
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
165
|
+
required: true,
|
|
166
|
+
}),
|
|
167
|
+
sourceId: Property.ShortText({
|
|
168
|
+
displayName: 'Source ID',
|
|
169
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
170
|
+
required: false,
|
|
171
|
+
}),
|
|
172
|
+
userId: Property.ShortText({
|
|
173
|
+
displayName: 'User ID',
|
|
174
|
+
description: 'Optional: Filter by userId (wildcard * permitted, max 10 characters)',
|
|
175
|
+
required: false,
|
|
176
|
+
}),
|
|
177
|
+
firstName: Property.ShortText({
|
|
178
|
+
displayName: 'First Name',
|
|
179
|
+
description: 'Optional: Filter by first name (wildcard * permitted, max 15 characters)',
|
|
180
|
+
required: false,
|
|
181
|
+
}),
|
|
182
|
+
lastName: Property.ShortText({
|
|
183
|
+
displayName: 'Last Name',
|
|
184
|
+
description: 'Optional: Filter by last name (wildcard * permitted, max 15 characters)',
|
|
185
|
+
required: false,
|
|
186
|
+
}),
|
|
187
|
+
bankNumber: Property.Number({
|
|
188
|
+
displayName: 'Bank Number',
|
|
189
|
+
description: 'Optional: Filter by bank number (max 3 digits)',
|
|
190
|
+
required: false,
|
|
191
|
+
}),
|
|
192
|
+
},
|
|
193
|
+
async run(context) {
|
|
194
|
+
const auth = context.auth as any;
|
|
195
|
+
const baseUrl = auth['baseUrl'];
|
|
196
|
+
const organizationId = auth['organizationId'];
|
|
197
|
+
const { xAuthorization, sourceId, userId, firstName, lastName, bankNumber } = context.propsValue;
|
|
198
|
+
|
|
199
|
+
const uuid = crypto.randomUUID();
|
|
200
|
+
|
|
201
|
+
const headers: Record<string, string> = {
|
|
202
|
+
'accept': 'application/json',
|
|
203
|
+
'Content-Type': 'application/json',
|
|
204
|
+
'organization-id': organizationId,
|
|
205
|
+
'uuid': uuid,
|
|
206
|
+
'horizon-authorization': xAuthorization,
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
if (sourceId) {
|
|
210
|
+
headers['source-id'] = sourceId;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const queryParams: Record<string, string> = {};
|
|
214
|
+
if (userId) {
|
|
215
|
+
queryParams['userId'] = userId;
|
|
216
|
+
}
|
|
217
|
+
if (firstName) {
|
|
218
|
+
queryParams['firstName'] = firstName;
|
|
219
|
+
}
|
|
220
|
+
if (lastName) {
|
|
221
|
+
queryParams['lastName'] = lastName;
|
|
222
|
+
}
|
|
223
|
+
if (bankNumber !== undefined && bankNumber !== null) {
|
|
224
|
+
queryParams['bankNumber'] = String(bankNumber);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const queryString = Object.keys(queryParams).length > 0
|
|
228
|
+
? '?' + new URLSearchParams(queryParams).toString()
|
|
229
|
+
: '';
|
|
230
|
+
|
|
231
|
+
const response = await httpClient.sendRequest({
|
|
232
|
+
method: HttpMethod.GET,
|
|
233
|
+
url: `${baseUrl}/user-security/v1/users${queryString}`,
|
|
234
|
+
headers,
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
return response.body;
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* User Security - Create User
|
|
243
|
+
* POST /users
|
|
244
|
+
* Create a user profile (orchestrated call to finalize HORIZON profile and IBMi profile)
|
|
245
|
+
*/
|
|
246
|
+
export const user_security_create_user = createAction({
|
|
247
|
+
name: 'user_security_create_user',
|
|
248
|
+
auth: fisHorizonAuth,
|
|
249
|
+
displayName: 'User Security - Create User',
|
|
250
|
+
description: 'Create a user profile. This is an orchestrated call to finalize HORIZON profile and IBMi profile.',
|
|
251
|
+
props: {
|
|
252
|
+
xAuthorization: Property.ShortText({
|
|
253
|
+
displayName: 'Authorization Token',
|
|
254
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
255
|
+
required: true,
|
|
256
|
+
}),
|
|
257
|
+
sourceId: Property.ShortText({
|
|
258
|
+
displayName: 'Source ID',
|
|
259
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
260
|
+
required: false,
|
|
261
|
+
}),
|
|
262
|
+
generalInformation: Property.Json({
|
|
263
|
+
displayName: 'General Information',
|
|
264
|
+
description: 'General information object containing userId, userName, firstName, middleInitial, lastName, employeeNumber, templateUserId, etc.',
|
|
265
|
+
required: true,
|
|
266
|
+
}),
|
|
267
|
+
accessControls: Property.Json({
|
|
268
|
+
displayName: 'Access Controls',
|
|
269
|
+
description: 'Access controls object containing settings like bankControl, primaryGroupCode, etc.',
|
|
270
|
+
required: true,
|
|
271
|
+
}),
|
|
272
|
+
defaultBankNumber: Property.ShortText({
|
|
273
|
+
displayName: 'Default Bank Number',
|
|
274
|
+
description: 'Default bank number (max 3 characters)',
|
|
275
|
+
required: true,
|
|
276
|
+
}),
|
|
277
|
+
defaultBranchNumber: Property.ShortText({
|
|
278
|
+
displayName: 'Default Branch Number',
|
|
279
|
+
description: 'Default branch number (max 4 characters)',
|
|
280
|
+
required: true,
|
|
281
|
+
}),
|
|
282
|
+
bankAssignment: Property.Json({
|
|
283
|
+
displayName: 'Bank Assignment',
|
|
284
|
+
description: 'Optional: Bank assignment object',
|
|
285
|
+
required: false,
|
|
286
|
+
}),
|
|
287
|
+
contactInformation: Property.Json({
|
|
288
|
+
displayName: 'Contact Information',
|
|
289
|
+
description: 'Optional: Contact information object containing emailAddress, phone, etc.',
|
|
290
|
+
required: false,
|
|
291
|
+
}),
|
|
292
|
+
secondarySecurityGroups: Property.Json({
|
|
293
|
+
displayName: 'Secondary Security Groups',
|
|
294
|
+
description: 'Optional: Array of secondary security groups',
|
|
295
|
+
required: false,
|
|
296
|
+
}),
|
|
297
|
+
},
|
|
298
|
+
async run(context) {
|
|
299
|
+
const auth = context.auth as any;
|
|
300
|
+
const baseUrl = auth['baseUrl'];
|
|
301
|
+
const organizationId = auth['organizationId'];
|
|
302
|
+
const { xAuthorization, sourceId, generalInformation, accessControls, defaultBankNumber, defaultBranchNumber, bankAssignment, contactInformation, secondarySecurityGroups } = context.propsValue;
|
|
303
|
+
|
|
304
|
+
const uuid = crypto.randomUUID();
|
|
305
|
+
|
|
306
|
+
const headers: Record<string, string> = {
|
|
307
|
+
'accept': 'application/json',
|
|
308
|
+
'Content-Type': 'application/json',
|
|
309
|
+
'organization-id': organizationId,
|
|
310
|
+
'uuid': uuid,
|
|
311
|
+
'horizon-authorization': xAuthorization,
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
if (sourceId) {
|
|
315
|
+
headers['source-id'] = sourceId;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const body: Record<string, unknown> = {
|
|
319
|
+
generalInformation: generalInformation,
|
|
320
|
+
accessControls: accessControls,
|
|
321
|
+
defaultBankNumber: defaultBankNumber,
|
|
322
|
+
defaultBranchNumber: defaultBranchNumber,
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
if (bankAssignment) {
|
|
326
|
+
body['bankAssignment'] = bankAssignment;
|
|
327
|
+
}
|
|
328
|
+
if (contactInformation) {
|
|
329
|
+
body['contactInformation'] = contactInformation;
|
|
330
|
+
}
|
|
331
|
+
if (secondarySecurityGroups) {
|
|
332
|
+
body['secondarySecurityGroups'] = secondarySecurityGroups;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const response = await httpClient.sendRequest({
|
|
336
|
+
method: HttpMethod.POST,
|
|
337
|
+
url: `${baseUrl}/user-security/v1/users`,
|
|
338
|
+
headers,
|
|
339
|
+
body,
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
return response.body;
|
|
343
|
+
},
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* User Security - User Inquiry
|
|
348
|
+
* GET /users/{userId}
|
|
349
|
+
* Retrieve a user profile from HORIZON and the IBMi system
|
|
350
|
+
*/
|
|
351
|
+
export const user_security_user_inquiry = createAction({
|
|
352
|
+
name: 'user_security_user_inquiry',
|
|
353
|
+
auth: fisHorizonAuth,
|
|
354
|
+
displayName: 'User Security - User Inquiry',
|
|
355
|
+
description: 'Retrieve a user profile from HORIZON and the IBMi system',
|
|
356
|
+
props: {
|
|
357
|
+
xAuthorization: Property.ShortText({
|
|
358
|
+
displayName: 'Authorization Token',
|
|
359
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
360
|
+
required: true,
|
|
361
|
+
}),
|
|
362
|
+
sourceId: Property.ShortText({
|
|
363
|
+
displayName: 'Source ID',
|
|
364
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
365
|
+
required: false,
|
|
366
|
+
}),
|
|
367
|
+
userId: Property.ShortText({
|
|
368
|
+
displayName: 'User ID',
|
|
369
|
+
description: 'The user ID to retrieve (max 10 characters)',
|
|
370
|
+
required: true,
|
|
371
|
+
}),
|
|
372
|
+
},
|
|
373
|
+
async run(context) {
|
|
374
|
+
const auth = context.auth as any;
|
|
375
|
+
const baseUrl = auth['baseUrl'];
|
|
376
|
+
const organizationId = auth['organizationId'];
|
|
377
|
+
const { xAuthorization, sourceId, userId } = context.propsValue;
|
|
378
|
+
|
|
379
|
+
const uuid = crypto.randomUUID();
|
|
380
|
+
|
|
381
|
+
const headers: Record<string, string> = {
|
|
382
|
+
'accept': 'application/json',
|
|
383
|
+
'Content-Type': 'application/json',
|
|
384
|
+
'organization-id': organizationId,
|
|
385
|
+
'uuid': uuid,
|
|
386
|
+
'horizon-authorization': xAuthorization,
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
if (sourceId) {
|
|
390
|
+
headers['source-id'] = sourceId;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
const response = await httpClient.sendRequest({
|
|
394
|
+
method: HttpMethod.GET,
|
|
395
|
+
url: `${baseUrl}/user-security/v1/users/${encodeURIComponent(userId)}`,
|
|
396
|
+
headers,
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
return response.body;
|
|
400
|
+
},
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* User Security - Maintain User
|
|
405
|
+
* PUT /users/{userId}
|
|
406
|
+
* Maintain a user profile from HORIZON and the IBMi system
|
|
407
|
+
*/
|
|
408
|
+
export const user_security_maintain_user = createAction({
|
|
409
|
+
name: 'user_security_maintain_user',
|
|
410
|
+
auth: fisHorizonAuth,
|
|
411
|
+
displayName: 'User Security - Maintain User',
|
|
412
|
+
description: 'Maintain a user profile from HORIZON and the IBMi system',
|
|
413
|
+
props: {
|
|
414
|
+
xAuthorization: Property.ShortText({
|
|
415
|
+
displayName: 'Authorization Token',
|
|
416
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
417
|
+
required: true,
|
|
418
|
+
}),
|
|
419
|
+
sourceId: Property.ShortText({
|
|
420
|
+
displayName: 'Source ID',
|
|
421
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
422
|
+
required: false,
|
|
423
|
+
}),
|
|
424
|
+
userId: Property.ShortText({
|
|
425
|
+
displayName: 'User ID',
|
|
426
|
+
description: 'The user ID to maintain (max 10 characters)',
|
|
427
|
+
required: true,
|
|
428
|
+
}),
|
|
429
|
+
generalInformation: Property.Json({
|
|
430
|
+
displayName: 'General Information',
|
|
431
|
+
description: 'General information object containing userName, employeeNumber, firstName, middleInitial, lastName, etc.',
|
|
432
|
+
required: true,
|
|
433
|
+
}),
|
|
434
|
+
accessControls: Property.Json({
|
|
435
|
+
displayName: 'Access Controls',
|
|
436
|
+
description: 'Access controls object containing settings like bankControl, primaryGroupCode, etc.',
|
|
437
|
+
required: true,
|
|
438
|
+
}),
|
|
439
|
+
defaultBankNumber: Property.ShortText({
|
|
440
|
+
displayName: 'Default Bank Number',
|
|
441
|
+
description: 'Default bank number (max 3 characters)',
|
|
442
|
+
required: true,
|
|
443
|
+
}),
|
|
444
|
+
defaultBranchNumber: Property.ShortText({
|
|
445
|
+
displayName: 'Default Branch Number',
|
|
446
|
+
description: 'Default branch number (max 4 characters)',
|
|
447
|
+
required: true,
|
|
448
|
+
}),
|
|
449
|
+
bankAssignment: Property.Json({
|
|
450
|
+
displayName: 'Bank Assignment',
|
|
451
|
+
description: 'Optional: Bank assignment object',
|
|
452
|
+
required: false,
|
|
453
|
+
}),
|
|
454
|
+
contactInformation: Property.Json({
|
|
455
|
+
displayName: 'Contact Information',
|
|
456
|
+
description: 'Optional: Contact information object containing emailAddress, phone, etc.',
|
|
457
|
+
required: false,
|
|
458
|
+
}),
|
|
459
|
+
secondarySecurityGroups: Property.Json({
|
|
460
|
+
displayName: 'Secondary Security Groups',
|
|
461
|
+
description: 'Optional: Array of secondary security groups',
|
|
462
|
+
required: false,
|
|
463
|
+
}),
|
|
464
|
+
},
|
|
465
|
+
async run(context) {
|
|
466
|
+
const auth = context.auth as any;
|
|
467
|
+
const baseUrl = auth['baseUrl'];
|
|
468
|
+
const organizationId = auth['organizationId'];
|
|
469
|
+
const { xAuthorization, sourceId, userId, generalInformation, accessControls, defaultBankNumber, defaultBranchNumber, bankAssignment, contactInformation, secondarySecurityGroups } = context.propsValue;
|
|
470
|
+
|
|
471
|
+
const uuid = crypto.randomUUID();
|
|
472
|
+
|
|
473
|
+
const headers: Record<string, string> = {
|
|
474
|
+
'accept': 'application/json',
|
|
475
|
+
'Content-Type': 'application/json',
|
|
476
|
+
'organization-id': organizationId,
|
|
477
|
+
'uuid': uuid,
|
|
478
|
+
'horizon-authorization': xAuthorization,
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
if (sourceId) {
|
|
482
|
+
headers['source-id'] = sourceId;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
const body: Record<string, unknown> = {
|
|
486
|
+
generalInformation: generalInformation,
|
|
487
|
+
accessControls: accessControls,
|
|
488
|
+
defaultBankNumber: defaultBankNumber,
|
|
489
|
+
defaultBranchNumber: defaultBranchNumber,
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
if (bankAssignment) {
|
|
493
|
+
body['bankAssignment'] = bankAssignment;
|
|
494
|
+
}
|
|
495
|
+
if (contactInformation) {
|
|
496
|
+
body['contactInformation'] = contactInformation;
|
|
497
|
+
}
|
|
498
|
+
if (secondarySecurityGroups) {
|
|
499
|
+
body['secondarySecurityGroups'] = secondarySecurityGroups;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
const response = await httpClient.sendRequest({
|
|
503
|
+
method: HttpMethod.PUT,
|
|
504
|
+
url: `${baseUrl}/user-security/v1/users/${encodeURIComponent(userId)}`,
|
|
505
|
+
headers,
|
|
506
|
+
body,
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
return response.body;
|
|
510
|
+
},
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* User Security - Delete User
|
|
515
|
+
* DELETE /users/{userId}
|
|
516
|
+
* Delete a user profile from HORIZON and the IBMi system
|
|
517
|
+
*/
|
|
518
|
+
export const user_security_delete_user = createAction({
|
|
519
|
+
name: 'user_security_delete_user',
|
|
520
|
+
auth: fisHorizonAuth,
|
|
521
|
+
displayName: 'User Security - Delete User',
|
|
522
|
+
description: 'Delete a user profile from HORIZON and the IBMi system',
|
|
523
|
+
props: {
|
|
524
|
+
xAuthorization: Property.ShortText({
|
|
525
|
+
displayName: 'Authorization Token',
|
|
526
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
527
|
+
required: true,
|
|
528
|
+
}),
|
|
529
|
+
sourceId: Property.ShortText({
|
|
530
|
+
displayName: 'Source ID',
|
|
531
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
532
|
+
required: false,
|
|
533
|
+
}),
|
|
534
|
+
userId: Property.ShortText({
|
|
535
|
+
displayName: 'User ID',
|
|
536
|
+
description: 'The user ID to delete (max 10 characters)',
|
|
537
|
+
required: true,
|
|
538
|
+
}),
|
|
539
|
+
newOwnerUserId: Property.ShortText({
|
|
540
|
+
displayName: 'New Owner User ID',
|
|
541
|
+
description: 'New owner for the objects owned by the deleted user profile (max 30 characters)',
|
|
542
|
+
required: true,
|
|
543
|
+
}),
|
|
544
|
+
},
|
|
545
|
+
async run(context) {
|
|
546
|
+
const auth = context.auth as any;
|
|
547
|
+
const baseUrl = auth['baseUrl'];
|
|
548
|
+
const organizationId = auth['organizationId'];
|
|
549
|
+
const { xAuthorization, sourceId, userId, newOwnerUserId } = context.propsValue;
|
|
550
|
+
|
|
551
|
+
const uuid = crypto.randomUUID();
|
|
552
|
+
|
|
553
|
+
const headers: Record<string, string> = {
|
|
554
|
+
'accept': 'application/json',
|
|
555
|
+
'Content-Type': 'application/json',
|
|
556
|
+
'organization-id': organizationId,
|
|
557
|
+
'uuid': uuid,
|
|
558
|
+
'horizon-authorization': xAuthorization,
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
if (sourceId) {
|
|
562
|
+
headers['source-id'] = sourceId;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
const queryParams: Record<string, string> = {
|
|
566
|
+
newOwnerUserId: newOwnerUserId,
|
|
567
|
+
};
|
|
568
|
+
const queryString = '?' + new URLSearchParams(queryParams).toString();
|
|
569
|
+
|
|
570
|
+
const response = await httpClient.sendRequest({
|
|
571
|
+
method: HttpMethod.DELETE,
|
|
572
|
+
url: `${baseUrl}/user-security/v1/users/${encodeURIComponent(userId)}${queryString}`,
|
|
573
|
+
headers,
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
return response.body;
|
|
577
|
+
},
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* User Security - Enable User
|
|
582
|
+
* POST /users/{userId}/enable
|
|
583
|
+
* Enable net server access for a HORIZON User Profile and enable a IBMi User Profile
|
|
584
|
+
*/
|
|
585
|
+
export const user_security_enable_user = createAction({
|
|
586
|
+
name: 'user_security_enable_user',
|
|
587
|
+
auth: fisHorizonAuth,
|
|
588
|
+
displayName: 'User Security - Enable User',
|
|
589
|
+
description: 'Enable net server access for a HORIZON User Profile and enable a IBMi User Profile',
|
|
590
|
+
props: {
|
|
591
|
+
xAuthorization: Property.ShortText({
|
|
592
|
+
displayName: 'Authorization Token',
|
|
593
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
594
|
+
required: true,
|
|
595
|
+
}),
|
|
596
|
+
sourceId: Property.ShortText({
|
|
597
|
+
displayName: 'Source ID',
|
|
598
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
599
|
+
required: false,
|
|
600
|
+
}),
|
|
601
|
+
userId: Property.ShortText({
|
|
602
|
+
displayName: 'User ID',
|
|
603
|
+
description: 'The user ID to enable (max 10 characters)',
|
|
604
|
+
required: true,
|
|
605
|
+
}),
|
|
606
|
+
},
|
|
607
|
+
async run(context) {
|
|
608
|
+
const auth = context.auth as any;
|
|
609
|
+
const baseUrl = auth['baseUrl'];
|
|
610
|
+
const organizationId = auth['organizationId'];
|
|
611
|
+
const { xAuthorization, sourceId, userId } = context.propsValue;
|
|
612
|
+
|
|
613
|
+
const uuid = crypto.randomUUID();
|
|
614
|
+
|
|
615
|
+
const headers: Record<string, string> = {
|
|
616
|
+
'accept': 'application/json',
|
|
617
|
+
'Content-Type': 'application/json',
|
|
618
|
+
'organization-id': organizationId,
|
|
619
|
+
'uuid': uuid,
|
|
620
|
+
'horizon-authorization': xAuthorization,
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
if (sourceId) {
|
|
624
|
+
headers['source-id'] = sourceId;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
const response = await httpClient.sendRequest({
|
|
628
|
+
method: HttpMethod.POST,
|
|
629
|
+
url: `${baseUrl}/user-security/v1/users/${encodeURIComponent(userId)}/enable`,
|
|
630
|
+
headers,
|
|
631
|
+
body: {},
|
|
632
|
+
});
|
|
633
|
+
|
|
634
|
+
return response.body;
|
|
635
|
+
},
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* User Security - Groups Inquiry
|
|
640
|
+
* GET /groups
|
|
641
|
+
* Retrieve a list of all available security groups for the bank(s) to which the given user is authorized
|
|
642
|
+
*/
|
|
643
|
+
export const user_security_groups_inquiry = createAction({
|
|
644
|
+
name: 'user_security_groups_inquiry',
|
|
645
|
+
auth: fisHorizonAuth,
|
|
646
|
+
displayName: 'User Security - Groups Inquiry',
|
|
647
|
+
description: 'Retrieve a list of all available security groups for the bank(s) to which the given user is authorized',
|
|
648
|
+
props: {
|
|
649
|
+
xAuthorization: Property.ShortText({
|
|
650
|
+
displayName: 'Authorization Token',
|
|
651
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
652
|
+
required: true,
|
|
653
|
+
}),
|
|
654
|
+
sourceId: Property.ShortText({
|
|
655
|
+
displayName: 'Source ID',
|
|
656
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
657
|
+
required: false,
|
|
658
|
+
}),
|
|
659
|
+
},
|
|
660
|
+
async run(context) {
|
|
661
|
+
const auth = context.auth as any;
|
|
662
|
+
const baseUrl = auth['baseUrl'];
|
|
663
|
+
const organizationId = auth['organizationId'];
|
|
664
|
+
const { xAuthorization, sourceId } = context.propsValue;
|
|
665
|
+
|
|
666
|
+
const uuid = crypto.randomUUID();
|
|
667
|
+
|
|
668
|
+
const headers: Record<string, string> = {
|
|
669
|
+
'accept': 'application/json',
|
|
670
|
+
'Content-Type': 'application/json',
|
|
671
|
+
'organization-id': organizationId,
|
|
672
|
+
'uuid': uuid,
|
|
673
|
+
'horizon-authorization': xAuthorization,
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
if (sourceId) {
|
|
677
|
+
headers['source-id'] = sourceId;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
const response = await httpClient.sendRequest({
|
|
681
|
+
method: HttpMethod.GET,
|
|
682
|
+
url: `${baseUrl}/user-security/v1/groups`,
|
|
683
|
+
headers,
|
|
684
|
+
});
|
|
685
|
+
|
|
686
|
+
return response.body;
|
|
687
|
+
},
|
|
688
|
+
});
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* User Security - User Groups Inquiry
|
|
692
|
+
* GET /users/{userId}/groups
|
|
693
|
+
* Retrieve a primary user group and a list of secondary groups assigned to a specific user id
|
|
694
|
+
*/
|
|
695
|
+
export const user_security_user_groups_inquiry = createAction({
|
|
696
|
+
name: 'user_security_user_groups_inquiry',
|
|
697
|
+
auth: fisHorizonAuth,
|
|
698
|
+
displayName: 'User Security - User Groups Inquiry',
|
|
699
|
+
description: 'Retrieve a primary user group and a list of secondary groups assigned to a specific user id',
|
|
700
|
+
props: {
|
|
701
|
+
xAuthorization: Property.ShortText({
|
|
702
|
+
displayName: 'Authorization Token',
|
|
703
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
704
|
+
required: true,
|
|
705
|
+
}),
|
|
706
|
+
sourceId: Property.ShortText({
|
|
707
|
+
displayName: 'Source ID',
|
|
708
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
709
|
+
required: false,
|
|
710
|
+
}),
|
|
711
|
+
userId: Property.ShortText({
|
|
712
|
+
displayName: 'User ID',
|
|
713
|
+
description: 'The user ID to retrieve groups for (max 10 characters)',
|
|
714
|
+
required: true,
|
|
715
|
+
}),
|
|
716
|
+
},
|
|
717
|
+
async run(context) {
|
|
718
|
+
const auth = context.auth as any;
|
|
719
|
+
const baseUrl = auth['baseUrl'];
|
|
720
|
+
const organizationId = auth['organizationId'];
|
|
721
|
+
const { xAuthorization, sourceId, userId } = context.propsValue;
|
|
722
|
+
|
|
723
|
+
const uuid = crypto.randomUUID();
|
|
724
|
+
|
|
725
|
+
const headers: Record<string, string> = {
|
|
726
|
+
'accept': 'application/json',
|
|
727
|
+
'Content-Type': 'application/json',
|
|
728
|
+
'organization-id': organizationId,
|
|
729
|
+
'uuid': uuid,
|
|
730
|
+
'horizon-authorization': xAuthorization,
|
|
731
|
+
};
|
|
732
|
+
|
|
733
|
+
if (sourceId) {
|
|
734
|
+
headers['source-id'] = sourceId;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
const response = await httpClient.sendRequest({
|
|
738
|
+
method: HttpMethod.GET,
|
|
739
|
+
url: `${baseUrl}/user-security/v1/users/${encodeURIComponent(userId)}/groups`,
|
|
740
|
+
headers,
|
|
741
|
+
});
|
|
742
|
+
|
|
743
|
+
return response.body;
|
|
744
|
+
},
|
|
745
|
+
});
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* User Security - Maintain User Groups
|
|
749
|
+
* PUT /users/{userId}/groups
|
|
750
|
+
* Maintain a list of secondary groups assigned to a specific user id
|
|
751
|
+
*/
|
|
752
|
+
export const user_security_maintain_user_groups = createAction({
|
|
753
|
+
name: 'user_security_maintain_user_groups',
|
|
754
|
+
auth: fisHorizonAuth,
|
|
755
|
+
displayName: 'User Security - Maintain User Groups',
|
|
756
|
+
description: 'Maintain a list of secondary groups assigned to a specific user id',
|
|
757
|
+
props: {
|
|
758
|
+
xAuthorization: Property.ShortText({
|
|
759
|
+
displayName: 'Authorization Token',
|
|
760
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
761
|
+
required: true,
|
|
762
|
+
}),
|
|
763
|
+
sourceId: Property.ShortText({
|
|
764
|
+
displayName: 'Source ID',
|
|
765
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
766
|
+
required: false,
|
|
767
|
+
}),
|
|
768
|
+
userId: Property.ShortText({
|
|
769
|
+
displayName: 'User ID',
|
|
770
|
+
description: 'The user ID to maintain groups for (max 10 characters)',
|
|
771
|
+
required: true,
|
|
772
|
+
}),
|
|
773
|
+
assignSecondaryGroups: Property.Json({
|
|
774
|
+
displayName: 'Assign Secondary Groups',
|
|
775
|
+
description: 'Optional: Array of group codes to assign (max 10 characters each). Example: ["TEST32487", "TEST32488"]',
|
|
776
|
+
required: false,
|
|
777
|
+
}),
|
|
778
|
+
removeSecondaryGroups: Property.Json({
|
|
779
|
+
displayName: 'Remove Secondary Groups',
|
|
780
|
+
description: 'Optional: Array of group codes to remove (max 10 characters each). Note: The primary groupCode cannot be removed. Example: ["TEST32489"]',
|
|
781
|
+
required: false,
|
|
782
|
+
}),
|
|
783
|
+
},
|
|
784
|
+
async run(context) {
|
|
785
|
+
const auth = context.auth as any;
|
|
786
|
+
const baseUrl = auth['baseUrl'];
|
|
787
|
+
const organizationId = auth['organizationId'];
|
|
788
|
+
const { xAuthorization, sourceId, userId, assignSecondaryGroups, removeSecondaryGroups } = context.propsValue;
|
|
789
|
+
|
|
790
|
+
const uuid = crypto.randomUUID();
|
|
791
|
+
|
|
792
|
+
const headers: Record<string, string> = {
|
|
793
|
+
'accept': 'application/json',
|
|
794
|
+
'Content-Type': 'application/json',
|
|
795
|
+
'organization-id': organizationId,
|
|
796
|
+
'uuid': uuid,
|
|
797
|
+
'horizon-authorization': xAuthorization,
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
if (sourceId) {
|
|
801
|
+
headers['source-id'] = sourceId;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
const body: Record<string, unknown> = {};
|
|
805
|
+
if (assignSecondaryGroups) {
|
|
806
|
+
body['assignSecondaryGroups'] = assignSecondaryGroups;
|
|
807
|
+
}
|
|
808
|
+
if (removeSecondaryGroups) {
|
|
809
|
+
body['removeSecondaryGroups'] = removeSecondaryGroups;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
const response = await httpClient.sendRequest({
|
|
813
|
+
method: HttpMethod.PUT,
|
|
814
|
+
url: `${baseUrl}/user-security/v1/users/${encodeURIComponent(userId)}/groups`,
|
|
815
|
+
headers,
|
|
816
|
+
body,
|
|
817
|
+
});
|
|
818
|
+
|
|
819
|
+
return response.body;
|
|
820
|
+
},
|
|
821
|
+
});
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* User Security - Group Inquiry
|
|
825
|
+
* GET /groups/{groupCode}
|
|
826
|
+
* Retrieve group details information for a specific group code
|
|
827
|
+
*/
|
|
828
|
+
export const user_security_group_inquiry = createAction({
|
|
829
|
+
name: 'user_security_group_inquiry',
|
|
830
|
+
auth: fisHorizonAuth,
|
|
831
|
+
displayName: 'User Security - Group Inquiry',
|
|
832
|
+
description: 'Retrieve group details information for a specific group code',
|
|
833
|
+
props: {
|
|
834
|
+
xAuthorization: Property.ShortText({
|
|
835
|
+
displayName: 'Authorization Token',
|
|
836
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
837
|
+
required: true,
|
|
838
|
+
}),
|
|
839
|
+
sourceId: Property.ShortText({
|
|
840
|
+
displayName: 'Source ID',
|
|
841
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
842
|
+
required: false,
|
|
843
|
+
}),
|
|
844
|
+
groupCode: Property.ShortText({
|
|
845
|
+
displayName: 'Group Code',
|
|
846
|
+
description: 'The group code to retrieve details for (max 10 characters)',
|
|
847
|
+
required: true,
|
|
848
|
+
}),
|
|
849
|
+
},
|
|
850
|
+
async run(context) {
|
|
851
|
+
const auth = context.auth as any;
|
|
852
|
+
const baseUrl = auth['baseUrl'];
|
|
853
|
+
const organizationId = auth['organizationId'];
|
|
854
|
+
const { xAuthorization, sourceId, groupCode } = context.propsValue;
|
|
855
|
+
|
|
856
|
+
const uuid = crypto.randomUUID();
|
|
857
|
+
|
|
858
|
+
const headers: Record<string, string> = {
|
|
859
|
+
'accept': 'application/json',
|
|
860
|
+
'Content-Type': 'application/json',
|
|
861
|
+
'organization-id': organizationId,
|
|
862
|
+
'uuid': uuid,
|
|
863
|
+
'horizon-authorization': xAuthorization,
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
if (sourceId) {
|
|
867
|
+
headers['source-id'] = sourceId;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
const response = await httpClient.sendRequest({
|
|
871
|
+
method: HttpMethod.GET,
|
|
872
|
+
url: `${baseUrl}/user-security/v1/groups/${encodeURIComponent(groupCode)}`,
|
|
873
|
+
headers,
|
|
874
|
+
});
|
|
875
|
+
|
|
876
|
+
return response.body;
|
|
877
|
+
},
|
|
878
|
+
});
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* User Security - Group Permissions Inquiry
|
|
882
|
+
* GET /groups/{groupCode}/permissions
|
|
883
|
+
* Retrieve a list of permissions for a specific group code
|
|
884
|
+
*/
|
|
885
|
+
export const user_security_group_permissions_inquiry = createAction({
|
|
886
|
+
name: 'user_security_group_permissions_inquiry',
|
|
887
|
+
auth: fisHorizonAuth,
|
|
888
|
+
displayName: 'User Security - Group Permissions Inquiry',
|
|
889
|
+
description: 'Retrieve a list of permissions for a specific group code',
|
|
890
|
+
props: {
|
|
891
|
+
xAuthorization: Property.ShortText({
|
|
892
|
+
displayName: 'Authorization Token',
|
|
893
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
894
|
+
required: true,
|
|
895
|
+
}),
|
|
896
|
+
sourceId: Property.ShortText({
|
|
897
|
+
displayName: 'Source ID',
|
|
898
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
899
|
+
required: false,
|
|
900
|
+
}),
|
|
901
|
+
groupCode: Property.ShortText({
|
|
902
|
+
displayName: 'Group Code',
|
|
903
|
+
description: 'The group code to retrieve permissions for (max 10 characters)',
|
|
904
|
+
required: true,
|
|
905
|
+
}),
|
|
906
|
+
category: Property.ShortText({
|
|
907
|
+
displayName: 'Category',
|
|
908
|
+
description: 'Optional: Filter by category (max 50 characters)',
|
|
909
|
+
required: false,
|
|
910
|
+
}),
|
|
911
|
+
heading: Property.ShortText({
|
|
912
|
+
displayName: 'Heading',
|
|
913
|
+
description: 'Optional: Filter by heading (max 50 characters)',
|
|
914
|
+
required: false,
|
|
915
|
+
}),
|
|
916
|
+
homePageName: Property.ShortText({
|
|
917
|
+
displayName: 'Home Page Name',
|
|
918
|
+
description: 'Optional: Filter by home page name (max 50 characters)',
|
|
919
|
+
required: false,
|
|
920
|
+
}),
|
|
921
|
+
},
|
|
922
|
+
async run(context) {
|
|
923
|
+
const auth = context.auth as any;
|
|
924
|
+
const baseUrl = auth['baseUrl'];
|
|
925
|
+
const organizationId = auth['organizationId'];
|
|
926
|
+
const { xAuthorization, sourceId, groupCode, category, heading, homePageName } = context.propsValue;
|
|
927
|
+
|
|
928
|
+
const uuid = crypto.randomUUID();
|
|
929
|
+
|
|
930
|
+
const headers: Record<string, string> = {
|
|
931
|
+
'accept': 'application/json',
|
|
932
|
+
'Content-Type': 'application/json',
|
|
933
|
+
'organization-id': organizationId,
|
|
934
|
+
'uuid': uuid,
|
|
935
|
+
'horizon-authorization': xAuthorization,
|
|
936
|
+
};
|
|
937
|
+
|
|
938
|
+
if (sourceId) {
|
|
939
|
+
headers['source-id'] = sourceId;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
const queryParams: Record<string, string> = {};
|
|
943
|
+
if (category) {
|
|
944
|
+
queryParams['category'] = category;
|
|
945
|
+
}
|
|
946
|
+
if (heading) {
|
|
947
|
+
queryParams['heading'] = heading;
|
|
948
|
+
}
|
|
949
|
+
if (homePageName) {
|
|
950
|
+
queryParams['homePageName'] = homePageName;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
const queryString = Object.keys(queryParams).length > 0
|
|
954
|
+
? '?' + new URLSearchParams(queryParams).toString()
|
|
955
|
+
: '';
|
|
956
|
+
|
|
957
|
+
const response = await httpClient.sendRequest({
|
|
958
|
+
method: HttpMethod.GET,
|
|
959
|
+
url: `${baseUrl}/user-security/v1/groups/${encodeURIComponent(groupCode)}/permissions${queryString}`,
|
|
960
|
+
headers,
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
return response.body;
|
|
964
|
+
},
|
|
965
|
+
});
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
* User Security - Change Password
|
|
969
|
+
* PUT /users/{userId}/change-passwords
|
|
970
|
+
* Change a password for a user profile on IBMi system
|
|
971
|
+
*/
|
|
972
|
+
export const user_security_change_password = createAction({
|
|
973
|
+
name: 'user_security_change_password',
|
|
974
|
+
auth: fisHorizonAuth,
|
|
975
|
+
displayName: 'User Security - Change Password',
|
|
976
|
+
description: 'Change a password for a user profile on IBMi system',
|
|
977
|
+
props: {
|
|
978
|
+
xAuthorization: Property.ShortText({
|
|
979
|
+
displayName: 'Authorization Token',
|
|
980
|
+
description: 'The authorization token obtained from the Get Token endpoint',
|
|
981
|
+
required: true,
|
|
982
|
+
}),
|
|
983
|
+
sourceId: Property.ShortText({
|
|
984
|
+
displayName: 'Source ID',
|
|
985
|
+
description: 'Optional: 6 character ID provided by FIS',
|
|
986
|
+
required: false,
|
|
987
|
+
}),
|
|
988
|
+
userId: Property.ShortText({
|
|
989
|
+
displayName: 'User ID',
|
|
990
|
+
description: 'The user ID to change password for (max 10 characters)',
|
|
991
|
+
required: true,
|
|
992
|
+
}),
|
|
993
|
+
newPassword: Property.ShortText({
|
|
994
|
+
displayName: 'New Password',
|
|
995
|
+
description: 'The new password (min 15 characters, max 128 characters)',
|
|
996
|
+
required: true,
|
|
997
|
+
}),
|
|
998
|
+
},
|
|
999
|
+
async run(context) {
|
|
1000
|
+
const auth = context.auth as any;
|
|
1001
|
+
const baseUrl = auth['baseUrl'];
|
|
1002
|
+
const organizationId = auth['organizationId'];
|
|
1003
|
+
const { xAuthorization, sourceId, userId, newPassword } = context.propsValue;
|
|
1004
|
+
|
|
1005
|
+
const uuid = crypto.randomUUID();
|
|
1006
|
+
|
|
1007
|
+
const headers: Record<string, string> = {
|
|
1008
|
+
'accept': 'application/json',
|
|
1009
|
+
'Content-Type': 'application/json',
|
|
1010
|
+
'organization-id': organizationId,
|
|
1011
|
+
'uuid': uuid,
|
|
1012
|
+
'horizon-authorization': xAuthorization,
|
|
1013
|
+
};
|
|
1014
|
+
|
|
1015
|
+
if (sourceId) {
|
|
1016
|
+
headers['source-id'] = sourceId;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
const body: Record<string, unknown> = {
|
|
1020
|
+
newPassword: newPassword,
|
|
1021
|
+
};
|
|
1022
|
+
|
|
1023
|
+
const response = await httpClient.sendRequest({
|
|
1024
|
+
method: HttpMethod.PUT,
|
|
1025
|
+
url: `${baseUrl}/user-security/v1/users/${encodeURIComponent(userId)}/change-passwords`,
|
|
1026
|
+
headers,
|
|
1027
|
+
body,
|
|
1028
|
+
});
|
|
1029
|
+
|
|
1030
|
+
return response.body;
|
|
1031
|
+
},
|
|
1032
|
+
});
|