@forklaunch/implementation-iam-base 0.1.2 → 0.1.5
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/__test__/schemaEquality.test.d.ts +2 -0
- package/lib/__test__/schemaEquality.test.d.ts.map +1 -0
- package/lib/__test__/schemaEquality.test.js +175 -0
- package/lib/eject/schemas/index.ts +4 -0
- package/{schemas/typebox → lib/eject/schemas}/organization.schema.ts +13 -11
- package/{schemas/zod → lib/eject/schemas}/permission.schema.ts +7 -1
- package/lib/eject/schemas/role.schema.ts +37 -0
- package/{schemas/typebox → lib/eject/schemas}/user.schema.ts +20 -19
- package/lib/eject/services/index.ts +4 -0
- package/{services → lib/eject/services}/organization.service.ts +6 -6
- package/{services → lib/eject/services}/permission.service.ts +9 -6
- package/{services → lib/eject/services}/role.service.ts +6 -6
- package/{services → lib/eject/services}/user.service.ts +11 -9
- package/lib/jest.config.d.ts +4 -0
- package/lib/jest.config.d.ts.map +1 -0
- package/lib/jest.config.js +19 -0
- package/lib/schemas/index.d.ts +5 -0
- package/lib/schemas/index.d.ts.map +1 -0
- package/lib/schemas/index.js +4 -0
- package/lib/schemas/organization.schema.d.ts +192 -0
- package/lib/schemas/organization.schema.d.ts.map +1 -0
- package/lib/schemas/organization.schema.js +4 -0
- package/lib/schemas/permission.schema.d.ts +42 -0
- package/lib/schemas/permission.schema.d.ts.map +1 -0
- package/lib/schemas/permission.schema.js +4 -0
- package/lib/schemas/role.schema.d.ts +66 -0
- package/lib/schemas/role.schema.d.ts.map +1 -0
- package/lib/schemas/role.schema.js +4 -0
- package/lib/schemas/typebox/organization.schema.d.ts +106 -0
- package/lib/schemas/typebox/organization.schema.d.ts.map +1 -0
- package/lib/schemas/typebox/organization.schema.js +34 -0
- package/lib/schemas/typebox/permission.schema.d.ts +41 -0
- package/lib/schemas/typebox/permission.schema.d.ts.map +1 -0
- package/lib/schemas/typebox/permission.schema.js +25 -0
- package/lib/schemas/typebox/role.schema.d.ts +53 -0
- package/lib/schemas/typebox/role.schema.d.ts.map +1 -0
- package/lib/schemas/typebox/role.schema.js +26 -0
- package/lib/schemas/typebox/user.schema.d.ts +97 -0
- package/lib/schemas/typebox/user.schema.d.ts.map +1 -0
- package/lib/schemas/typebox/user.schema.js +41 -0
- package/lib/schemas/user.schema.d.ts +136 -0
- package/lib/schemas/user.schema.d.ts.map +1 -0
- package/lib/schemas/user.schema.js +4 -0
- package/lib/schemas/zod/organization.schema.d.ts +278 -0
- package/lib/schemas/zod/organization.schema.d.ts.map +1 -0
- package/lib/schemas/zod/organization.schema.js +34 -0
- package/lib/schemas/zod/permission.schema.d.ts +41 -0
- package/lib/schemas/zod/permission.schema.d.ts.map +1 -0
- package/lib/schemas/zod/permission.schema.js +25 -0
- package/lib/schemas/zod/role.schema.d.ts +77 -0
- package/lib/schemas/zod/role.schema.d.ts.map +1 -0
- package/lib/schemas/zod/role.schema.js +26 -0
- package/lib/schemas/zod/user.schema.d.ts +173 -0
- package/lib/schemas/zod/user.schema.d.ts.map +1 -0
- package/lib/schemas/zod/user.schema.js +41 -0
- package/lib/services/index.d.ts +5 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +4 -0
- package/lib/services/organization.service.d.ts +45 -0
- package/lib/services/organization.service.d.ts.map +1 -0
- package/lib/services/organization.service.js +35 -0
- package/lib/services/permission.service.d.ts +62 -0
- package/lib/services/permission.service.d.ts.map +1 -0
- package/lib/services/permission.service.js +159 -0
- package/lib/services/role.service.d.ts +49 -0
- package/lib/services/role.service.d.ts.map +1 -0
- package/lib/services/role.service.js +57 -0
- package/lib/services/user.service.d.ts +54 -0
- package/lib/services/user.service.d.ts.map +1 -0
- package/lib/services/user.service.js +85 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/vitest.config.d.ts +3 -0
- package/lib/vitest.config.d.ts.map +1 -0
- package/lib/vitest.config.js +7 -0
- package/package.json +22 -10
- package/__test__/schemaEquality.test.ts +0 -293
- package/index.ts +0 -8
- package/schemas/organization.schema.ts +0 -28
- package/schemas/permission.schema.ts +0 -28
- package/schemas/role.schema.ts +0 -28
- package/schemas/typebox/permission.schema.ts +0 -30
- package/schemas/typebox/role.schema.ts +0 -36
- package/schemas/user.schema.ts +0 -28
- package/schemas/zod/organization.schema.ts +0 -49
- package/schemas/zod/role.schema.ts +0 -36
- package/schemas/zod/user.schema.ts +0 -52
- package/tsconfig.json +0 -7
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { IdiomaticSchema } from '@forklaunch/validator';
|
|
2
|
-
import {
|
|
3
|
-
array,
|
|
4
|
-
date,
|
|
5
|
-
email,
|
|
6
|
-
optional,
|
|
7
|
-
string,
|
|
8
|
-
unknown,
|
|
9
|
-
uuid,
|
|
10
|
-
ZodSchemaValidator
|
|
11
|
-
} from '@forklaunch/validator/zod';
|
|
12
|
-
|
|
13
|
-
export const CreateUserSchema = {
|
|
14
|
-
email: email,
|
|
15
|
-
password: string,
|
|
16
|
-
firstName: string,
|
|
17
|
-
lastName: string,
|
|
18
|
-
organizationId: string,
|
|
19
|
-
roleIds: array(string),
|
|
20
|
-
phoneNumber: optional(string),
|
|
21
|
-
subscription: optional(string),
|
|
22
|
-
extraFields: optional(unknown)
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const UpdateUserSchema = (uuidId: boolean) => ({
|
|
26
|
-
id: uuidId ? uuid : string,
|
|
27
|
-
email: optional(email),
|
|
28
|
-
password: optional(string),
|
|
29
|
-
firstName: optional(string),
|
|
30
|
-
lastName: optional(string),
|
|
31
|
-
roleIds: optional(array(string)),
|
|
32
|
-
phoneNumber: optional(string),
|
|
33
|
-
subscription: optional(string),
|
|
34
|
-
extraFields: optional(unknown)
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export const UserSchema =
|
|
38
|
-
(uuidId: boolean) =>
|
|
39
|
-
<RoleDtoSchema extends IdiomaticSchema<ZodSchemaValidator>>(
|
|
40
|
-
RoleDtoSchema: RoleDtoSchema
|
|
41
|
-
) => ({
|
|
42
|
-
id: uuidId ? uuid : string,
|
|
43
|
-
email: email,
|
|
44
|
-
firstName: string,
|
|
45
|
-
lastName: string,
|
|
46
|
-
roles: array(RoleDtoSchema),
|
|
47
|
-
phoneNumber: optional(string),
|
|
48
|
-
subscription: optional(string),
|
|
49
|
-
extraFields: optional(unknown),
|
|
50
|
-
createdAt: optional(date),
|
|
51
|
-
updatedAt: optional(date)
|
|
52
|
-
});
|