@code.store/arcxp-sdk-ts 4.8.0 → 4.10.0
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.
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ArcAbstractAPI, ArcAPIOptions } from '../abstract-api';
|
|
2
|
-
import { MigrateBatchUsersPayload, MigrateBatchUsersResponse } from './types';
|
|
2
|
+
import { GetUserResponse, MigrateBatchUsersPayload, MigrateBatchUsersResponse, UserProfile } from './types';
|
|
3
3
|
export declare class ArcIdentity extends ArcAbstractAPI {
|
|
4
4
|
constructor(options: ArcAPIOptions);
|
|
5
5
|
migrateBatch(payload: MigrateBatchUsersPayload): Promise<MigrateBatchUsersResponse>;
|
|
6
|
+
getUser(id: string): Promise<GetUserResponse>;
|
|
7
|
+
getUserByEmail(email: string): Promise<GetUserResponse>;
|
|
8
|
+
updateUserProfile(id: string, payload: Partial<UserProfile>): Promise<UserProfile>;
|
|
6
9
|
}
|
|
@@ -10,6 +10,18 @@ class ArcIdentity extends abstract_api_1.ArcAbstractAPI {
|
|
|
10
10
|
const { data } = await this.client.post('/migrate', payload);
|
|
11
11
|
return data;
|
|
12
12
|
}
|
|
13
|
+
async getUser(id) {
|
|
14
|
+
const { data } = await this.client.get(`/user?search=uuid=${id}`);
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
async getUserByEmail(email) {
|
|
18
|
+
const { data } = await this.client.get(`/user?search=email=${email}`);
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
async updateUserProfile(id, payload) {
|
|
22
|
+
const { data } = await this.client.patch(`/profile/${id}`, payload);
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
13
25
|
}
|
|
14
26
|
exports.ArcIdentity = ArcIdentity;
|
|
15
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/identity/index.ts"],"names":[],"m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IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;QAEpE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA5BD,kCA4BC"}
|
|
@@ -1,44 +1,6 @@
|
|
|
1
|
-
export type MigrateIdentityCustomAttributeType = {
|
|
2
|
-
name: string;
|
|
3
|
-
value: string;
|
|
4
|
-
type: 'String' | 'Number' | 'Date' | 'Boolean';
|
|
5
|
-
};
|
|
6
1
|
export type MigrateUserPayload = {
|
|
7
|
-
identities:
|
|
8
|
-
|
|
9
|
-
credentials: string;
|
|
10
|
-
grantType: 'password';
|
|
11
|
-
lastLoginDate?: string;
|
|
12
|
-
}[];
|
|
13
|
-
profile: {
|
|
14
|
-
firstName?: string;
|
|
15
|
-
lastName?: string;
|
|
16
|
-
secondLastName?: string;
|
|
17
|
-
displayName?: string;
|
|
18
|
-
gender?: 'MALE' | 'FEMALE';
|
|
19
|
-
email: string;
|
|
20
|
-
birthYear?: string;
|
|
21
|
-
birthMonth?: string;
|
|
22
|
-
birthDay?: string;
|
|
23
|
-
contacts: {
|
|
24
|
-
phone: string;
|
|
25
|
-
type: 'WORK' | 'HOME' | 'PRIMARY' | 'OTHER';
|
|
26
|
-
}[];
|
|
27
|
-
addresses: {
|
|
28
|
-
line1: string;
|
|
29
|
-
line2?: string;
|
|
30
|
-
locality: string;
|
|
31
|
-
region?: string;
|
|
32
|
-
postal?: string;
|
|
33
|
-
country?: string;
|
|
34
|
-
type: 'WORK' | 'HOME' | 'PRIMARY' | 'OTHER';
|
|
35
|
-
}[];
|
|
36
|
-
attributes: MigrateIdentityCustomAttributeType[];
|
|
37
|
-
legacyId: string;
|
|
38
|
-
deletionRule?: 1;
|
|
39
|
-
emailVerified?: boolean;
|
|
40
|
-
createdOn: string;
|
|
41
|
-
};
|
|
2
|
+
identities: IdentityRequestMigration[];
|
|
3
|
+
profile: UserProfile;
|
|
42
4
|
uuid?: string;
|
|
43
5
|
};
|
|
44
6
|
export type MigrateBatchUsersPayload = {
|
|
@@ -56,3 +18,326 @@ export type MigrateBatchUsersResponse = {
|
|
|
56
18
|
errorCount: number;
|
|
57
19
|
successCount: number;
|
|
58
20
|
};
|
|
21
|
+
export type GetUserResponse = {
|
|
22
|
+
page: number;
|
|
23
|
+
size: number;
|
|
24
|
+
lastPage: number;
|
|
25
|
+
totalCount: number;
|
|
26
|
+
sort: string;
|
|
27
|
+
sortDirection: string;
|
|
28
|
+
result: {
|
|
29
|
+
uuid: string;
|
|
30
|
+
userState: boolean;
|
|
31
|
+
identities: UserIdentity[];
|
|
32
|
+
profile: UserProfile;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
export interface IdentityRequestMigration {
|
|
36
|
+
/**
|
|
37
|
+
* The login username for this user
|
|
38
|
+
* userName can be set up equal to email
|
|
39
|
+
* @minLength 5
|
|
40
|
+
* @maxLength 100
|
|
41
|
+
* @example "john.doe@donotreply.com"
|
|
42
|
+
*/
|
|
43
|
+
userName: string;
|
|
44
|
+
credentials: string;
|
|
45
|
+
/** The grantType of this request */
|
|
46
|
+
grantType?: 'password' | 'facebook' | 'google' | 'apple';
|
|
47
|
+
/**
|
|
48
|
+
* The date the user last logged on for this identity, Timestamp in milliseconds.
|
|
49
|
+
* @format date-time
|
|
50
|
+
* @example "1680779480000"
|
|
51
|
+
*/
|
|
52
|
+
lastLoginDate?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface UserIdentity {
|
|
55
|
+
/**
|
|
56
|
+
* Format: date-time
|
|
57
|
+
* @description Date this was created
|
|
58
|
+
*/
|
|
59
|
+
createdOn?: string;
|
|
60
|
+
/** @description User that created this */
|
|
61
|
+
createdBy?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Format: date-time
|
|
64
|
+
* @description Date this was modified
|
|
65
|
+
*/
|
|
66
|
+
modifiedOn?: string;
|
|
67
|
+
/** @description User that modified this */
|
|
68
|
+
modifiedBy?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Format: int64
|
|
71
|
+
* @description The id of this identity
|
|
72
|
+
* @example 1
|
|
73
|
+
*/
|
|
74
|
+
id?: number;
|
|
75
|
+
/**
|
|
76
|
+
* @description The login userName for this user
|
|
77
|
+
* @example jdoe123
|
|
78
|
+
*/
|
|
79
|
+
userName: string;
|
|
80
|
+
/** @description Flag indicating if a password reset is required */
|
|
81
|
+
passwordReset: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* @description The type of identity
|
|
84
|
+
* @example Identity
|
|
85
|
+
*/
|
|
86
|
+
type: string;
|
|
87
|
+
/**
|
|
88
|
+
* Format: date-time
|
|
89
|
+
* @description The date that this identity last logged on
|
|
90
|
+
*/
|
|
91
|
+
lastLoginDate?: string;
|
|
92
|
+
/** @description Flag indicating if this identity is locked */
|
|
93
|
+
locked?: boolean;
|
|
94
|
+
/** @description Flag indicating if this identity is of oidc */
|
|
95
|
+
oidc?: boolean;
|
|
96
|
+
}
|
|
97
|
+
export interface UserProfile {
|
|
98
|
+
/**
|
|
99
|
+
* Format: date-time
|
|
100
|
+
* @description Date this was created
|
|
101
|
+
*/
|
|
102
|
+
createdOn?: string;
|
|
103
|
+
/** @description User that created this */
|
|
104
|
+
createdBy?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Format: date-time
|
|
107
|
+
* @description Date this was modified
|
|
108
|
+
*/
|
|
109
|
+
modifiedOn?: string;
|
|
110
|
+
/** @description User that modified this */
|
|
111
|
+
modifiedBy?: string;
|
|
112
|
+
/**
|
|
113
|
+
* @description First Name
|
|
114
|
+
* @example John
|
|
115
|
+
*/
|
|
116
|
+
firstName?: string;
|
|
117
|
+
/**
|
|
118
|
+
* @description Last Name
|
|
119
|
+
* @example Doe
|
|
120
|
+
*/
|
|
121
|
+
lastName?: string;
|
|
122
|
+
/**
|
|
123
|
+
* @description Second Last Name
|
|
124
|
+
* @example Doey
|
|
125
|
+
*/
|
|
126
|
+
secondLastName?: string;
|
|
127
|
+
/**
|
|
128
|
+
* @description Display Name
|
|
129
|
+
* @example john_doe
|
|
130
|
+
*/
|
|
131
|
+
displayName?: string;
|
|
132
|
+
/**
|
|
133
|
+
* @description Gender
|
|
134
|
+
* @example MALE, FEMALE
|
|
135
|
+
* @enum string
|
|
136
|
+
*/
|
|
137
|
+
gender?: 'MALE' | 'FEMALE' | 'NON_CONFORMING' | 'PREFER_NOT_TO_SAY';
|
|
138
|
+
/**
|
|
139
|
+
* @description Email
|
|
140
|
+
* @example john.doe@donotreply.com
|
|
141
|
+
*/
|
|
142
|
+
email?: string;
|
|
143
|
+
/**
|
|
144
|
+
* @description Unverified Email
|
|
145
|
+
* @example john.doe2@donotreply.com
|
|
146
|
+
*/
|
|
147
|
+
unverifiedEmail?: string;
|
|
148
|
+
/** @description Flag indicating if this email is verified */
|
|
149
|
+
emailVerified?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* @description Year of Birth (YYYY)
|
|
152
|
+
* @example 1999
|
|
153
|
+
*/
|
|
154
|
+
birthYear?: string;
|
|
155
|
+
/**
|
|
156
|
+
* @description Month of Birth (MM)
|
|
157
|
+
* @example 11
|
|
158
|
+
*/
|
|
159
|
+
birthMonth?: string;
|
|
160
|
+
/**
|
|
161
|
+
* @description Day of Month of Birth (DD)
|
|
162
|
+
* @example 15
|
|
163
|
+
*/
|
|
164
|
+
birthDay?: string;
|
|
165
|
+
/**
|
|
166
|
+
* @description The legacy id of this profile
|
|
167
|
+
* @example FGE234UIR184
|
|
168
|
+
*/
|
|
169
|
+
legacyId?: string;
|
|
170
|
+
/** @description List of contacts */
|
|
171
|
+
contacts?: UserContact[];
|
|
172
|
+
/** @description List of addresses */
|
|
173
|
+
addresses?: UserAddress[];
|
|
174
|
+
/** @description List of attributes to hold name, value pairs */
|
|
175
|
+
attributes?: UserAttribute[];
|
|
176
|
+
/** @description The identitities associated with this profile */
|
|
177
|
+
identities?: UserIdentity[];
|
|
178
|
+
/**
|
|
179
|
+
* @description The status of this profile
|
|
180
|
+
* @example Active/Disabled
|
|
181
|
+
* @enum {string}
|
|
182
|
+
*/
|
|
183
|
+
status?: 'Active' | 'Disabled' | 'Anonymized' | 'PendingAnonymize';
|
|
184
|
+
/**
|
|
185
|
+
* Format: int32
|
|
186
|
+
* @description Profile Deletion Rule Id
|
|
187
|
+
* @example 1
|
|
188
|
+
*/
|
|
189
|
+
deletionRule?: number;
|
|
190
|
+
profileNotificationEventResponse?: UserProfileNotificationEvent;
|
|
191
|
+
}
|
|
192
|
+
export interface UserAddress {
|
|
193
|
+
/**
|
|
194
|
+
* @description Address line one
|
|
195
|
+
* @example 123 Main St.
|
|
196
|
+
*/
|
|
197
|
+
line1?: string;
|
|
198
|
+
line2: string;
|
|
199
|
+
locality: string;
|
|
200
|
+
region?: string;
|
|
201
|
+
postal?: string;
|
|
202
|
+
country?: string;
|
|
203
|
+
/**
|
|
204
|
+
* @description Type of address
|
|
205
|
+
* @example WORK, HOME, PRIMARY, OTHER
|
|
206
|
+
* @enum string
|
|
207
|
+
*/
|
|
208
|
+
type?: 'WORK' | 'HOME' | 'PRIMARY' | 'OTHER';
|
|
209
|
+
}
|
|
210
|
+
export interface UserAttribute {
|
|
211
|
+
/**
|
|
212
|
+
* @description Name of the attribute
|
|
213
|
+
* @example KEY1
|
|
214
|
+
*/
|
|
215
|
+
name: string;
|
|
216
|
+
/**
|
|
217
|
+
* @description Value of the attribute
|
|
218
|
+
* @example VALUE 1
|
|
219
|
+
*/
|
|
220
|
+
value: string;
|
|
221
|
+
/**
|
|
222
|
+
* @description Type of the attribute
|
|
223
|
+
* @example String, Number, Date, Boolean
|
|
224
|
+
* @enum {string}
|
|
225
|
+
*/
|
|
226
|
+
type: 'String' | 'Number' | 'Boolean' | 'Date';
|
|
227
|
+
}
|
|
228
|
+
export interface UserContact {
|
|
229
|
+
/**
|
|
230
|
+
* @description Phone number
|
|
231
|
+
* @example 555-555-5555
|
|
232
|
+
*/
|
|
233
|
+
phone: string;
|
|
234
|
+
/**
|
|
235
|
+
* @description Type of phone number
|
|
236
|
+
* @example WORK, HOME, PRIMARY, OTHER
|
|
237
|
+
* @enum {string}
|
|
238
|
+
*/
|
|
239
|
+
type: 'WORK' | 'HOME' | 'PRIMARY' | 'OTHER';
|
|
240
|
+
}
|
|
241
|
+
export interface UserProfileNotificationEvent {
|
|
242
|
+
/**
|
|
243
|
+
* Format: date-time
|
|
244
|
+
* @description Date this was created
|
|
245
|
+
*/
|
|
246
|
+
createdOn?: string;
|
|
247
|
+
/** @description User that created this */
|
|
248
|
+
createdBy?: string;
|
|
249
|
+
/**
|
|
250
|
+
* Format: date-time
|
|
251
|
+
* @description Date this was modified
|
|
252
|
+
*/
|
|
253
|
+
modifiedOn?: string;
|
|
254
|
+
/** @description User that modified this */
|
|
255
|
+
modifiedBy?: string;
|
|
256
|
+
/**
|
|
257
|
+
* Format: int64
|
|
258
|
+
* @description The Profile Notification Event's ID.
|
|
259
|
+
* @example 1
|
|
260
|
+
*/
|
|
261
|
+
id: number;
|
|
262
|
+
rule: ProfileDeletionRule;
|
|
263
|
+
/**
|
|
264
|
+
* @description UUID of Profile Deletion.
|
|
265
|
+
* @example abcd123
|
|
266
|
+
*/
|
|
267
|
+
uuid: string;
|
|
268
|
+
/**
|
|
269
|
+
* @description Status
|
|
270
|
+
* @example Scheduled
|
|
271
|
+
* @enum {string}
|
|
272
|
+
*/
|
|
273
|
+
status: 'SCHEDULED' | 'COMPLETED' | 'CANCELLED';
|
|
274
|
+
/**
|
|
275
|
+
* Format: date-time
|
|
276
|
+
* @description Scheduled Notification Date
|
|
277
|
+
*/
|
|
278
|
+
notificationDate: string;
|
|
279
|
+
/**
|
|
280
|
+
* Format: date-time
|
|
281
|
+
* @description Profile Deletion Date if no action taken
|
|
282
|
+
*/
|
|
283
|
+
actionDate: string;
|
|
284
|
+
/**
|
|
285
|
+
* Format: int32
|
|
286
|
+
* @description Number of times a notification sent
|
|
287
|
+
* @example 10
|
|
288
|
+
*/
|
|
289
|
+
notificationSentCount: number;
|
|
290
|
+
}
|
|
291
|
+
export interface ProfileDeletionRule {
|
|
292
|
+
/**
|
|
293
|
+
* Format: date-time
|
|
294
|
+
* @description Date this was created
|
|
295
|
+
*/
|
|
296
|
+
createdOn?: string;
|
|
297
|
+
/** @description User that created this */
|
|
298
|
+
createdBy?: string;
|
|
299
|
+
/**
|
|
300
|
+
* Format: date-time
|
|
301
|
+
* @description Date this was modified
|
|
302
|
+
*/
|
|
303
|
+
modifiedOn?: string;
|
|
304
|
+
/** @description User that modified this */
|
|
305
|
+
modifiedBy?: string;
|
|
306
|
+
/**
|
|
307
|
+
* Format: int64
|
|
308
|
+
* @description The Profile Deletion Rule's ID.
|
|
309
|
+
* @example 1
|
|
310
|
+
*/
|
|
311
|
+
id: number;
|
|
312
|
+
/**
|
|
313
|
+
* @description Name of Profile Deletion Rule.
|
|
314
|
+
* @example Rule-1
|
|
315
|
+
*/
|
|
316
|
+
name: string;
|
|
317
|
+
/**
|
|
318
|
+
* Format: int32
|
|
319
|
+
* @description Elapsed Days(After) to send notification that account will be deleted if not action taken. Ex:180 days since email was not verified.
|
|
320
|
+
* @example 180
|
|
321
|
+
*/
|
|
322
|
+
notificationTriggerDays: number;
|
|
323
|
+
/**
|
|
324
|
+
* Format: int32
|
|
325
|
+
* @description Days After deletion will happen after sending notification if no action is taken. Ex:60 days after notification event was sent consider deleting profile
|
|
326
|
+
* @example 60
|
|
327
|
+
*/
|
|
328
|
+
actionTriggerDays: number;
|
|
329
|
+
/**
|
|
330
|
+
* Format: int32
|
|
331
|
+
* @description Period(per number of days) notification sent to users until account is deleted. Ex:Each 10 days notification event will be sent until profile is deleted
|
|
332
|
+
* @example 10
|
|
333
|
+
*/
|
|
334
|
+
notificationRecurrenceDays: number;
|
|
335
|
+
/**
|
|
336
|
+
* Format: int32
|
|
337
|
+
* @description Number of times a notification can be sent
|
|
338
|
+
* @example 180
|
|
339
|
+
*/
|
|
340
|
+
notificationLimit: number;
|
|
341
|
+
/** @enum {string} */
|
|
342
|
+
typeId: 'EMAIL_NEVER_VERIFIED' | 'NO_SIGN_IN' | 'LAST_LOGIN';
|
|
343
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code.store/arcxp-sdk-ts",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.0",
|
|
4
4
|
"description": "A strongly typed set of ArcXP API's and utilities reduce the amount of work required to develop with ArcXP, starting with reducing the boilerplate code you have to write.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"lint": "tsc --noEmit && TIMING=1 eslint \"src/**/*.ts*\"",
|
|
18
18
|
"test": "vitest",
|
|
19
19
|
"gen:ts": "npx ts-node-dev ./src/scripts/json-schema-to-ts.ts",
|
|
20
|
-
"cs": "npx changeset && npx changeset version"
|
|
20
|
+
"cs": "npx changeset && npx changeset version",
|
|
21
|
+
"swaggerToTypes": "npx swagger-typescript-api -p ./tmp/swagger.json -o ./tmp -n swaggerTypes.ts"
|
|
21
22
|
},
|
|
22
23
|
"keywords": [
|
|
23
24
|
"ArcXP",
|