@forklaunch/implementation-iam-base 0.3.1 → 0.3.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/lib/domain/schemas/index.d.mts +847 -0
- package/lib/domain/schemas/index.d.ts +847 -0
- package/lib/{schemas → domain/schemas}/index.js +138 -104
- package/lib/{schemas → domain/schemas}/index.mjs +81 -77
- package/lib/eject/domain/schemas/organization.schema.ts +3 -3
- package/lib/eject/domain/schemas/permission.schema.ts +3 -3
- package/lib/eject/domain/schemas/role.schema.ts +3 -3
- package/lib/eject/domain/schemas/user.schema.ts +3 -3
- package/lib/eject/domain/types/iamDto.types.ts +43 -0
- package/lib/eject/domain/types/iamEntities.types.ts +49 -0
- package/lib/eject/services/organization.service.ts +41 -77
- package/lib/eject/services/permission.service.ts +80 -104
- package/lib/eject/services/role.service.ts +51 -81
- package/lib/eject/services/user.service.ts +51 -74
- package/lib/services/index.d.mts +495 -191
- package/lib/services/index.d.ts +495 -191
- package/lib/services/index.js +249 -212
- package/lib/services/index.mjs +222 -218
- package/package.json +20 -13
- package/lib/schemas/index.d.mts +0 -474
- package/lib/schemas/index.d.ts +0 -474
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// schemas/organization.schema.ts
|
|
2
|
-
import { serviceSchemaResolver } from
|
|
1
|
+
// domain/schemas/organization.schema.ts
|
|
2
|
+
import { serviceSchemaResolver } from '@forklaunch/internal';
|
|
3
3
|
|
|
4
|
-
// schemas/typebox/organization.schema.ts
|
|
4
|
+
// domain/schemas/typebox/organization.schema.ts
|
|
5
5
|
import {
|
|
6
6
|
array as array4,
|
|
7
7
|
date as date4,
|
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
string as string4,
|
|
11
11
|
unknown as unknown4,
|
|
12
12
|
uuid as uuid4
|
|
13
|
-
} from
|
|
13
|
+
} from '@forklaunch/validator/typebox';
|
|
14
14
|
|
|
15
|
-
// schemas/typebox/user.schema.ts
|
|
15
|
+
// domain/schemas/typebox/user.schema.ts
|
|
16
16
|
import {
|
|
17
17
|
array as array3,
|
|
18
18
|
date as date3,
|
|
@@ -21,9 +21,9 @@ import {
|
|
|
21
21
|
string as string3,
|
|
22
22
|
unknown as unknown3,
|
|
23
23
|
uuid as uuid3
|
|
24
|
-
} from
|
|
24
|
+
} from '@forklaunch/validator/typebox';
|
|
25
25
|
|
|
26
|
-
// schemas/typebox/role.schema.ts
|
|
26
|
+
// domain/schemas/typebox/role.schema.ts
|
|
27
27
|
import {
|
|
28
28
|
array as array2,
|
|
29
29
|
date as date2,
|
|
@@ -31,9 +31,9 @@ import {
|
|
|
31
31
|
string as string2,
|
|
32
32
|
unknown as unknown2,
|
|
33
33
|
uuid as uuid2
|
|
34
|
-
} from
|
|
34
|
+
} from '@forklaunch/validator/typebox';
|
|
35
35
|
|
|
36
|
-
// schemas/typebox/permission.schema.ts
|
|
36
|
+
// domain/schemas/typebox/permission.schema.ts
|
|
37
37
|
import {
|
|
38
38
|
array,
|
|
39
39
|
date,
|
|
@@ -41,23 +41,23 @@ import {
|
|
|
41
41
|
string,
|
|
42
42
|
unknown,
|
|
43
43
|
uuid
|
|
44
|
-
} from
|
|
44
|
+
} from '@forklaunch/validator/typebox';
|
|
45
45
|
var CreatePermissionSchema = {
|
|
46
46
|
slug: string,
|
|
47
47
|
addToRolesIds: optional(array(string)),
|
|
48
|
-
|
|
48
|
+
providerFields: optional(unknown)
|
|
49
49
|
};
|
|
50
50
|
var UpdatePermissionSchema = ({ uuidId }) => ({
|
|
51
51
|
id: uuidId ? uuid : string,
|
|
52
52
|
slug: optional(string),
|
|
53
|
-
|
|
53
|
+
providerFields: optional(unknown),
|
|
54
54
|
addToRolesIds: optional(array(string)),
|
|
55
55
|
removeFromRolesIds: optional(array(string))
|
|
56
56
|
});
|
|
57
57
|
var PermissionSchema = ({ uuidId }) => ({
|
|
58
58
|
id: uuidId ? uuid : string,
|
|
59
59
|
slug: string,
|
|
60
|
-
|
|
60
|
+
providerFields: optional(unknown),
|
|
61
61
|
createdAt: optional(date),
|
|
62
62
|
updatedAt: optional(date)
|
|
63
63
|
});
|
|
@@ -67,23 +67,23 @@ var BasePermissionServiceSchemas = (options) => ({
|
|
|
67
67
|
PermissionSchema: PermissionSchema(options)
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
// schemas/typebox/role.schema.ts
|
|
70
|
+
// domain/schemas/typebox/role.schema.ts
|
|
71
71
|
var CreateRoleSchema = {
|
|
72
72
|
name: string2,
|
|
73
73
|
permissionIds: optional2(array2(string2)),
|
|
74
|
-
|
|
74
|
+
providerFields: optional2(unknown2)
|
|
75
75
|
};
|
|
76
76
|
var UpdateRoleSchema = ({ uuidId }) => ({
|
|
77
77
|
id: uuidId ? uuid2 : string2,
|
|
78
78
|
name: optional2(string2),
|
|
79
79
|
permissionIds: optional2(array2(string2)),
|
|
80
|
-
|
|
80
|
+
providerFields: optional2(unknown2)
|
|
81
81
|
});
|
|
82
82
|
var RoleSchema = ({ uuidId }) => ({
|
|
83
83
|
id: uuidId ? uuid2 : string2,
|
|
84
84
|
name: string2,
|
|
85
85
|
permissions: array2(PermissionSchema({ uuidId })),
|
|
86
|
-
|
|
86
|
+
providerFields: optional2(unknown2),
|
|
87
87
|
createdAt: optional2(date2),
|
|
88
88
|
updatedAt: optional2(date2)
|
|
89
89
|
});
|
|
@@ -93,7 +93,7 @@ var BaseRoleServiceSchemas = (options) => ({
|
|
|
93
93
|
RoleSchema: RoleSchema(options)
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
// schemas/typebox/user.schema.ts
|
|
96
|
+
// domain/schemas/typebox/user.schema.ts
|
|
97
97
|
var CreateUserSchema = {
|
|
98
98
|
email,
|
|
99
99
|
password: string3,
|
|
@@ -103,7 +103,7 @@ var CreateUserSchema = {
|
|
|
103
103
|
roleIds: array3(string3),
|
|
104
104
|
phoneNumber: optional3(string3),
|
|
105
105
|
subscription: optional3(string3),
|
|
106
|
-
|
|
106
|
+
providerFields: optional3(unknown3)
|
|
107
107
|
};
|
|
108
108
|
var UpdateUserSchema = ({ uuidId }) => ({
|
|
109
109
|
id: uuidId ? uuid3 : string3,
|
|
@@ -114,7 +114,7 @@ var UpdateUserSchema = ({ uuidId }) => ({
|
|
|
114
114
|
roleIds: optional3(array3(string3)),
|
|
115
115
|
phoneNumber: optional3(string3),
|
|
116
116
|
subscription: optional3(string3),
|
|
117
|
-
|
|
117
|
+
providerFields: optional3(unknown3)
|
|
118
118
|
});
|
|
119
119
|
var UserSchema = ({ uuidId }) => ({
|
|
120
120
|
id: uuidId ? uuid3 : string3,
|
|
@@ -124,7 +124,7 @@ var UserSchema = ({ uuidId }) => ({
|
|
|
124
124
|
roles: array3(RoleSchema({ uuidId })),
|
|
125
125
|
phoneNumber: optional3(string3),
|
|
126
126
|
subscription: optional3(string3),
|
|
127
|
-
|
|
127
|
+
providerFields: optional3(unknown3),
|
|
128
128
|
createdAt: optional3(date3),
|
|
129
129
|
updatedAt: optional3(date3)
|
|
130
130
|
});
|
|
@@ -134,13 +134,13 @@ var BaseUserServiceSchemas = (options) => ({
|
|
|
134
134
|
UserSchema: UserSchema(options)
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
-
// schemas/typebox/organization.schema.ts
|
|
137
|
+
// domain/schemas/typebox/organization.schema.ts
|
|
138
138
|
var CreateOrganizationSchema = {
|
|
139
139
|
name: string4,
|
|
140
140
|
domain: string4,
|
|
141
141
|
subscription: string4,
|
|
142
142
|
logoUrl: optional4(string4),
|
|
143
|
-
|
|
143
|
+
providerFields: optional4(unknown4)
|
|
144
144
|
};
|
|
145
145
|
var UpdateOrganizationSchema = ({ uuidId }) => ({
|
|
146
146
|
id: uuidId ? uuid4 : string4,
|
|
@@ -148,27 +148,29 @@ var UpdateOrganizationSchema = ({ uuidId }) => ({
|
|
|
148
148
|
domain: optional4(string4),
|
|
149
149
|
subscription: optional4(string4),
|
|
150
150
|
logoUrl: optional4(string4),
|
|
151
|
-
|
|
152
|
-
});
|
|
153
|
-
var OrganizationSchema = ({ uuidId }) => (organizationStatus) => ({
|
|
154
|
-
id: uuidId ? uuid4 : string4,
|
|
155
|
-
name: string4,
|
|
156
|
-
users: array4(UserSchema({ uuidId })),
|
|
157
|
-
domain: string4,
|
|
158
|
-
subscription: string4,
|
|
159
|
-
status: enum_(organizationStatus),
|
|
160
|
-
logoUrl: optional4(string4),
|
|
161
|
-
extraFields: optional4(unknown4),
|
|
162
|
-
createdAt: optional4(date4),
|
|
163
|
-
updatedAt: optional4(date4)
|
|
151
|
+
providerFields: optional4(unknown4)
|
|
164
152
|
});
|
|
153
|
+
var OrganizationSchema =
|
|
154
|
+
({ uuidId }) =>
|
|
155
|
+
(organizationStatus) => ({
|
|
156
|
+
id: uuidId ? uuid4 : string4,
|
|
157
|
+
name: string4,
|
|
158
|
+
users: array4(UserSchema({ uuidId })),
|
|
159
|
+
domain: string4,
|
|
160
|
+
subscription: string4,
|
|
161
|
+
status: enum_(organizationStatus),
|
|
162
|
+
logoUrl: optional4(string4),
|
|
163
|
+
providerFields: optional4(unknown4),
|
|
164
|
+
createdAt: optional4(date4),
|
|
165
|
+
updatedAt: optional4(date4)
|
|
166
|
+
});
|
|
165
167
|
var BaseOrganizationServiceSchemas = (options) => ({
|
|
166
168
|
CreateOrganizationSchema,
|
|
167
169
|
UpdateOrganizationSchema: UpdateOrganizationSchema(options),
|
|
168
170
|
OrganizationSchema: OrganizationSchema(options)
|
|
169
171
|
});
|
|
170
172
|
|
|
171
|
-
// schemas/zod/organization.schema.ts
|
|
173
|
+
// domain/schemas/zod/organization.schema.ts
|
|
172
174
|
import {
|
|
173
175
|
array as array8,
|
|
174
176
|
date as date8,
|
|
@@ -177,9 +179,9 @@ import {
|
|
|
177
179
|
string as string8,
|
|
178
180
|
unknown as unknown8,
|
|
179
181
|
uuid as uuid8
|
|
180
|
-
} from
|
|
182
|
+
} from '@forklaunch/validator/zod';
|
|
181
183
|
|
|
182
|
-
// schemas/zod/user.schema.ts
|
|
184
|
+
// domain/schemas/zod/user.schema.ts
|
|
183
185
|
import {
|
|
184
186
|
array as array7,
|
|
185
187
|
date as date7,
|
|
@@ -188,9 +190,9 @@ import {
|
|
|
188
190
|
string as string7,
|
|
189
191
|
unknown as unknown7,
|
|
190
192
|
uuid as uuid7
|
|
191
|
-
} from
|
|
193
|
+
} from '@forklaunch/validator/zod';
|
|
192
194
|
|
|
193
|
-
// schemas/zod/role.schema.ts
|
|
195
|
+
// domain/schemas/zod/role.schema.ts
|
|
194
196
|
import {
|
|
195
197
|
array as array6,
|
|
196
198
|
date as date6,
|
|
@@ -198,9 +200,9 @@ import {
|
|
|
198
200
|
string as string6,
|
|
199
201
|
unknown as unknown6,
|
|
200
202
|
uuid as uuid6
|
|
201
|
-
} from
|
|
203
|
+
} from '@forklaunch/validator/zod';
|
|
202
204
|
|
|
203
|
-
// schemas/zod/permission.schema.ts
|
|
205
|
+
// domain/schemas/zod/permission.schema.ts
|
|
204
206
|
import {
|
|
205
207
|
array as array5,
|
|
206
208
|
date as date5,
|
|
@@ -208,23 +210,23 @@ import {
|
|
|
208
210
|
string as string5,
|
|
209
211
|
unknown as unknown5,
|
|
210
212
|
uuid as uuid5
|
|
211
|
-
} from
|
|
213
|
+
} from '@forklaunch/validator/zod';
|
|
212
214
|
var CreatePermissionSchema2 = {
|
|
213
215
|
slug: string5,
|
|
214
216
|
addToRolesIds: optional5(array5(string5)),
|
|
215
|
-
|
|
217
|
+
providerFields: optional5(unknown5)
|
|
216
218
|
};
|
|
217
219
|
var UpdatePermissionSchema2 = ({ uuidId }) => ({
|
|
218
220
|
id: uuidId ? uuid5 : string5,
|
|
219
221
|
slug: optional5(string5),
|
|
220
|
-
|
|
222
|
+
providerFields: optional5(unknown5),
|
|
221
223
|
addToRolesIds: optional5(array5(string5)),
|
|
222
224
|
removeFromRolesIds: optional5(array5(string5))
|
|
223
225
|
});
|
|
224
226
|
var PermissionSchema2 = ({ uuidId }) => ({
|
|
225
227
|
id: uuidId ? uuid5 : string5,
|
|
226
228
|
slug: string5,
|
|
227
|
-
|
|
229
|
+
providerFields: optional5(unknown5),
|
|
228
230
|
createdAt: optional5(date5),
|
|
229
231
|
updatedAt: optional5(date5)
|
|
230
232
|
});
|
|
@@ -234,23 +236,23 @@ var BasePermissionServiceSchemas2 = (options) => ({
|
|
|
234
236
|
PermissionSchema: PermissionSchema2(options)
|
|
235
237
|
});
|
|
236
238
|
|
|
237
|
-
// schemas/zod/role.schema.ts
|
|
239
|
+
// domain/schemas/zod/role.schema.ts
|
|
238
240
|
var CreateRoleSchema2 = {
|
|
239
241
|
name: string6,
|
|
240
242
|
permissionIds: optional6(array6(string6)),
|
|
241
|
-
|
|
243
|
+
providerFields: optional6(unknown6)
|
|
242
244
|
};
|
|
243
245
|
var UpdateRoleSchema2 = ({ uuidId }) => ({
|
|
244
246
|
id: uuidId ? uuid6 : string6,
|
|
245
247
|
name: optional6(string6),
|
|
246
248
|
permissionIds: optional6(array6(string6)),
|
|
247
|
-
|
|
249
|
+
providerFields: optional6(unknown6)
|
|
248
250
|
});
|
|
249
251
|
var RoleSchema2 = ({ uuidId }) => ({
|
|
250
252
|
id: uuidId ? uuid6 : string6,
|
|
251
253
|
name: string6,
|
|
252
254
|
permissions: array6(PermissionSchema2({ uuidId })),
|
|
253
|
-
|
|
255
|
+
providerFields: optional6(unknown6),
|
|
254
256
|
createdAt: optional6(date6),
|
|
255
257
|
updatedAt: optional6(date6)
|
|
256
258
|
});
|
|
@@ -260,7 +262,7 @@ var BaseRoleServiceSchemas2 = (options) => ({
|
|
|
260
262
|
RoleSchema: RoleSchema2(options)
|
|
261
263
|
});
|
|
262
264
|
|
|
263
|
-
// schemas/zod/user.schema.ts
|
|
265
|
+
// domain/schemas/zod/user.schema.ts
|
|
264
266
|
var CreateUserSchema2 = {
|
|
265
267
|
email: email2,
|
|
266
268
|
password: string7,
|
|
@@ -270,7 +272,7 @@ var CreateUserSchema2 = {
|
|
|
270
272
|
roleIds: array7(string7),
|
|
271
273
|
phoneNumber: optional7(string7),
|
|
272
274
|
subscription: optional7(string7),
|
|
273
|
-
|
|
275
|
+
providerFields: optional7(unknown7)
|
|
274
276
|
};
|
|
275
277
|
var UpdateUserSchema2 = ({ uuidId }) => ({
|
|
276
278
|
id: uuidId ? uuid7 : string7,
|
|
@@ -281,7 +283,7 @@ var UpdateUserSchema2 = ({ uuidId }) => ({
|
|
|
281
283
|
roleIds: optional7(array7(string7)),
|
|
282
284
|
phoneNumber: optional7(string7),
|
|
283
285
|
subscription: optional7(string7),
|
|
284
|
-
|
|
286
|
+
providerFields: optional7(unknown7)
|
|
285
287
|
});
|
|
286
288
|
var UserSchema2 = ({ uuidId }) => ({
|
|
287
289
|
id: uuidId ? uuid7 : string7,
|
|
@@ -291,7 +293,7 @@ var UserSchema2 = ({ uuidId }) => ({
|
|
|
291
293
|
roles: array7(RoleSchema2({ uuidId })),
|
|
292
294
|
phoneNumber: optional7(string7),
|
|
293
295
|
subscription: optional7(string7),
|
|
294
|
-
|
|
296
|
+
providerFields: optional7(unknown7),
|
|
295
297
|
createdAt: optional7(date7),
|
|
296
298
|
updatedAt: optional7(date7)
|
|
297
299
|
});
|
|
@@ -301,13 +303,13 @@ var BaseUserServiceSchemas2 = (options) => ({
|
|
|
301
303
|
UserSchema: UserSchema2(options)
|
|
302
304
|
});
|
|
303
305
|
|
|
304
|
-
// schemas/zod/organization.schema.ts
|
|
306
|
+
// domain/schemas/zod/organization.schema.ts
|
|
305
307
|
var CreateOrganizationSchema2 = {
|
|
306
308
|
name: string8,
|
|
307
309
|
domain: string8,
|
|
308
310
|
subscription: string8,
|
|
309
311
|
logoUrl: optional8(string8),
|
|
310
|
-
|
|
312
|
+
providerFields: optional8(unknown8)
|
|
311
313
|
};
|
|
312
314
|
var UpdateOrganizationSchema2 = ({ uuidId }) => ({
|
|
313
315
|
id: uuidId ? uuid8 : string8,
|
|
@@ -315,48 +317,50 @@ var UpdateOrganizationSchema2 = ({ uuidId }) => ({
|
|
|
315
317
|
domain: optional8(string8),
|
|
316
318
|
subscription: optional8(string8),
|
|
317
319
|
logoUrl: optional8(string8),
|
|
318
|
-
|
|
319
|
-
});
|
|
320
|
-
var OrganizationSchema2 = ({ uuidId }) => (organizationStatus) => ({
|
|
321
|
-
id: uuidId ? uuid8 : string8,
|
|
322
|
-
name: string8,
|
|
323
|
-
users: array8(UserSchema2({ uuidId })),
|
|
324
|
-
domain: string8,
|
|
325
|
-
subscription: string8,
|
|
326
|
-
status: enum_2(organizationStatus),
|
|
327
|
-
logoUrl: optional8(string8),
|
|
328
|
-
extraFields: optional8(unknown8),
|
|
329
|
-
createdAt: optional8(date8),
|
|
330
|
-
updatedAt: optional8(date8)
|
|
320
|
+
providerFields: optional8(unknown8)
|
|
331
321
|
});
|
|
322
|
+
var OrganizationSchema2 =
|
|
323
|
+
({ uuidId }) =>
|
|
324
|
+
(organizationStatus) => ({
|
|
325
|
+
id: uuidId ? uuid8 : string8,
|
|
326
|
+
name: string8,
|
|
327
|
+
users: array8(UserSchema2({ uuidId })),
|
|
328
|
+
domain: string8,
|
|
329
|
+
subscription: string8,
|
|
330
|
+
status: enum_2(organizationStatus),
|
|
331
|
+
logoUrl: optional8(string8),
|
|
332
|
+
providerFields: optional8(unknown8),
|
|
333
|
+
createdAt: optional8(date8),
|
|
334
|
+
updatedAt: optional8(date8)
|
|
335
|
+
});
|
|
332
336
|
var BaseOrganizationServiceSchemas2 = (options) => ({
|
|
333
337
|
CreateOrganizationSchema: CreateOrganizationSchema2,
|
|
334
338
|
UpdateOrganizationSchema: UpdateOrganizationSchema2(options),
|
|
335
339
|
OrganizationSchema: OrganizationSchema2(options)
|
|
336
340
|
});
|
|
337
341
|
|
|
338
|
-
// schemas/organization.schema.ts
|
|
342
|
+
// domain/schemas/organization.schema.ts
|
|
339
343
|
var BaseOrganizationServiceSchemas3 = serviceSchemaResolver(
|
|
340
344
|
BaseOrganizationServiceSchemas,
|
|
341
345
|
BaseOrganizationServiceSchemas2
|
|
342
346
|
);
|
|
343
347
|
|
|
344
|
-
// schemas/permission.schema.ts
|
|
345
|
-
import { serviceSchemaResolver as serviceSchemaResolver2 } from
|
|
348
|
+
// domain/schemas/permission.schema.ts
|
|
349
|
+
import { serviceSchemaResolver as serviceSchemaResolver2 } from '@forklaunch/internal';
|
|
346
350
|
var BasePermissionServiceSchemas3 = serviceSchemaResolver2(
|
|
347
351
|
BasePermissionServiceSchemas,
|
|
348
352
|
BasePermissionServiceSchemas2
|
|
349
353
|
);
|
|
350
354
|
|
|
351
|
-
// schemas/role.schema.ts
|
|
352
|
-
import { serviceSchemaResolver as serviceSchemaResolver3 } from
|
|
355
|
+
// domain/schemas/role.schema.ts
|
|
356
|
+
import { serviceSchemaResolver as serviceSchemaResolver3 } from '@forklaunch/internal';
|
|
353
357
|
var BaseRoleServiceSchemas3 = serviceSchemaResolver3(
|
|
354
358
|
BaseRoleServiceSchemas,
|
|
355
359
|
BaseRoleServiceSchemas2
|
|
356
360
|
);
|
|
357
361
|
|
|
358
|
-
// schemas/user.schema.ts
|
|
359
|
-
import { serviceSchemaResolver as serviceSchemaResolver4 } from
|
|
362
|
+
// domain/schemas/user.schema.ts
|
|
363
|
+
import { serviceSchemaResolver as serviceSchemaResolver4 } from '@forklaunch/internal';
|
|
360
364
|
var BaseUserServiceSchemas3 = serviceSchemaResolver4(
|
|
361
365
|
BaseUserServiceSchemas,
|
|
362
366
|
BaseUserServiceSchemas2
|
|
@@ -15,7 +15,7 @@ export const CreateOrganizationSchema = {
|
|
|
15
15
|
domain: string,
|
|
16
16
|
subscription: string,
|
|
17
17
|
logoUrl: optional(string),
|
|
18
|
-
|
|
18
|
+
providerFields: optional(unknown)
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export const UpdateOrganizationSchema = ({ uuidId }: { uuidId: boolean }) => ({
|
|
@@ -24,7 +24,7 @@ export const UpdateOrganizationSchema = ({ uuidId }: { uuidId: boolean }) => ({
|
|
|
24
24
|
domain: optional(string),
|
|
25
25
|
subscription: optional(string),
|
|
26
26
|
logoUrl: optional(string),
|
|
27
|
-
|
|
27
|
+
providerFields: optional(unknown)
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
export const OrganizationSchema =
|
|
@@ -39,7 +39,7 @@ export const OrganizationSchema =
|
|
|
39
39
|
subscription: string,
|
|
40
40
|
status: enum_(organizationStatus),
|
|
41
41
|
logoUrl: optional(string),
|
|
42
|
-
|
|
42
|
+
providerFields: optional(unknown),
|
|
43
43
|
createdAt: optional(date),
|
|
44
44
|
updatedAt: optional(date)
|
|
45
45
|
});
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
export const CreatePermissionSchema = {
|
|
11
11
|
slug: string,
|
|
12
12
|
addToRolesIds: optional(array(string)),
|
|
13
|
-
|
|
13
|
+
providerFields: optional(unknown)
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export const UpdatePermissionSchema = ({ uuidId }: { uuidId: boolean }) => ({
|
|
17
17
|
id: uuidId ? uuid : string,
|
|
18
18
|
slug: optional(string),
|
|
19
|
-
|
|
19
|
+
providerFields: optional(unknown),
|
|
20
20
|
addToRolesIds: optional(array(string)),
|
|
21
21
|
removeFromRolesIds: optional(array(string))
|
|
22
22
|
});
|
|
@@ -24,7 +24,7 @@ export const UpdatePermissionSchema = ({ uuidId }: { uuidId: boolean }) => ({
|
|
|
24
24
|
export const PermissionSchema = ({ uuidId }: { uuidId: boolean }) => ({
|
|
25
25
|
id: uuidId ? uuid : string,
|
|
26
26
|
slug: string,
|
|
27
|
-
|
|
27
|
+
providerFields: optional(unknown),
|
|
28
28
|
createdAt: optional(date),
|
|
29
29
|
updatedAt: optional(date)
|
|
30
30
|
});
|
|
@@ -11,21 +11,21 @@ import { PermissionSchema } from './permission.schema';
|
|
|
11
11
|
export const CreateRoleSchema = {
|
|
12
12
|
name: string,
|
|
13
13
|
permissionIds: optional(array(string)),
|
|
14
|
-
|
|
14
|
+
providerFields: optional(unknown)
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export const UpdateRoleSchema = ({ uuidId }: { uuidId: boolean }) => ({
|
|
18
18
|
id: uuidId ? uuid : string,
|
|
19
19
|
name: optional(string),
|
|
20
20
|
permissionIds: optional(array(string)),
|
|
21
|
-
|
|
21
|
+
providerFields: optional(unknown)
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
export const RoleSchema = ({ uuidId }: { uuidId: boolean }) => ({
|
|
25
25
|
id: uuidId ? uuid : string,
|
|
26
26
|
name: string,
|
|
27
27
|
permissions: array(PermissionSchema({ uuidId })),
|
|
28
|
-
|
|
28
|
+
providerFields: optional(unknown),
|
|
29
29
|
createdAt: optional(date),
|
|
30
30
|
updatedAt: optional(date)
|
|
31
31
|
});
|
|
@@ -18,7 +18,7 @@ export const CreateUserSchema = {
|
|
|
18
18
|
roleIds: array(string),
|
|
19
19
|
phoneNumber: optional(string),
|
|
20
20
|
subscription: optional(string),
|
|
21
|
-
|
|
21
|
+
providerFields: optional(unknown)
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export const UpdateUserSchema = ({ uuidId }: { uuidId: boolean }) => ({
|
|
@@ -30,7 +30,7 @@ export const UpdateUserSchema = ({ uuidId }: { uuidId: boolean }) => ({
|
|
|
30
30
|
roleIds: optional(array(string)),
|
|
31
31
|
phoneNumber: optional(string),
|
|
32
32
|
subscription: optional(string),
|
|
33
|
-
|
|
33
|
+
providerFields: optional(unknown)
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
export const UserSchema = ({ uuidId }: { uuidId: boolean }) => ({
|
|
@@ -41,7 +41,7 @@ export const UserSchema = ({ uuidId }: { uuidId: boolean }) => ({
|
|
|
41
41
|
roles: array(RoleSchema({ uuidId })),
|
|
42
42
|
phoneNumber: optional(string),
|
|
43
43
|
subscription: optional(string),
|
|
44
|
-
|
|
44
|
+
providerFields: optional(unknown),
|
|
45
45
|
createdAt: optional(date),
|
|
46
46
|
updatedAt: optional(date)
|
|
47
47
|
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CreateOrganizationDto,
|
|
3
|
+
CreatePermissionDto,
|
|
4
|
+
CreateRoleDto,
|
|
5
|
+
CreateUserDto,
|
|
6
|
+
OrganizationDto,
|
|
7
|
+
PermissionDto,
|
|
8
|
+
RoleDto,
|
|
9
|
+
UpdateOrganizationDto,
|
|
10
|
+
UpdatePermissionDto,
|
|
11
|
+
UpdateRoleDto,
|
|
12
|
+
UpdateUserDto,
|
|
13
|
+
UserDto
|
|
14
|
+
} from '@forklaunch/interfaces-iam/types';
|
|
15
|
+
|
|
16
|
+
// organization
|
|
17
|
+
export type OrganizationDtos<OrganizationStatus> = {
|
|
18
|
+
OrganizationMapper: OrganizationDto<OrganizationStatus>;
|
|
19
|
+
CreateOrganizationMapper: CreateOrganizationDto;
|
|
20
|
+
UpdateOrganizationMapper: UpdateOrganizationDto;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// permission
|
|
24
|
+
export type PermissionDtos = {
|
|
25
|
+
PermissionMapper: PermissionDto;
|
|
26
|
+
CreatePermissionMapper: CreatePermissionDto;
|
|
27
|
+
UpdatePermissionMapper: UpdatePermissionDto;
|
|
28
|
+
RoleEntityMapper: UpdateRoleDto;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// role
|
|
32
|
+
export type RoleDtos = {
|
|
33
|
+
RoleMapper: RoleDto;
|
|
34
|
+
CreateRoleMapper: CreateRoleDto;
|
|
35
|
+
UpdateRoleMapper: UpdateRoleDto;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// user
|
|
39
|
+
export type UserDtos = {
|
|
40
|
+
UserMapper: UserDto;
|
|
41
|
+
CreateUserMapper: CreateUserDto;
|
|
42
|
+
UpdateUserMapper: UpdateUserDto;
|
|
43
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MapNestedDtoArraysToCollections } from '@forklaunch/core/services';
|
|
2
|
+
import {
|
|
3
|
+
OrganizationDto,
|
|
4
|
+
PermissionDto,
|
|
5
|
+
RoleDto,
|
|
6
|
+
UpdateRoleDto,
|
|
7
|
+
UserDto
|
|
8
|
+
} from '@forklaunch/interfaces-iam/types';
|
|
9
|
+
|
|
10
|
+
// organization
|
|
11
|
+
export type OrganizationEntities<OrganizationStatus> = {
|
|
12
|
+
OrganizationMapper: MapNestedDtoArraysToCollections<
|
|
13
|
+
OrganizationDto<OrganizationStatus>,
|
|
14
|
+
'users'
|
|
15
|
+
>;
|
|
16
|
+
CreateOrganizationMapper: MapNestedDtoArraysToCollections<
|
|
17
|
+
OrganizationDto<OrganizationStatus>,
|
|
18
|
+
'users'
|
|
19
|
+
>;
|
|
20
|
+
UpdateOrganizationMapper: MapNestedDtoArraysToCollections<
|
|
21
|
+
OrganizationDto<OrganizationStatus>,
|
|
22
|
+
'users'
|
|
23
|
+
>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// permission
|
|
27
|
+
export type PermissionEntities = {
|
|
28
|
+
PermissionMapper: PermissionDto;
|
|
29
|
+
CreatePermissionMapper: PermissionDto;
|
|
30
|
+
UpdatePermissionMapper: PermissionDto;
|
|
31
|
+
RoleEntityMapper: MapNestedDtoArraysToCollections<
|
|
32
|
+
UpdateRoleDto,
|
|
33
|
+
'permissions'
|
|
34
|
+
>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// role
|
|
38
|
+
export type RoleEntities = {
|
|
39
|
+
RoleMapper: MapNestedDtoArraysToCollections<RoleDto, 'permissions'>;
|
|
40
|
+
CreateRoleMapper: MapNestedDtoArraysToCollections<RoleDto, 'permissions'>;
|
|
41
|
+
UpdateRoleMapper: MapNestedDtoArraysToCollections<RoleDto, 'permissions'>;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// user
|
|
45
|
+
export type UserEntities = {
|
|
46
|
+
UserMapper: MapNestedDtoArraysToCollections<UserDto, 'roles'>;
|
|
47
|
+
CreateUserMapper: MapNestedDtoArraysToCollections<UserDto, 'roles'>;
|
|
48
|
+
UpdateUserMapper: MapNestedDtoArraysToCollections<UserDto, 'roles'>;
|
|
49
|
+
};
|