@forklaunch/implementation-iam-base 0.1.2 → 0.1.4
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/{schemas/typebox → lib/eject/schemas/zod}/organization.schema.ts +4 -4
- package/{schemas/typebox → lib/eject/schemas/zod}/permission.schema.ts +1 -1
- package/{schemas/typebox → lib/eject/schemas/zod}/role.schema.ts +4 -4
- package/{schemas/typebox → lib/eject/schemas/zod}/user.schema.ts +4 -4
- package/lib/eject/services/services/organization.service.ts +146 -0
- package/lib/eject/services/services/permission.service.ts +349 -0
- package/lib/eject/services/services/role.service.ts +182 -0
- package/lib/eject/services/user.service.ts +225 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.d.ts.map +1 -0
- 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/organization.schema.d.ts +58 -0
- package/lib/schemas/organization.schema.d.ts.map +1 -0
- package/lib/schemas/organization.schema.js +14 -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 +14 -0
- package/lib/schemas/role.schema.d.ts +42 -0
- package/lib/schemas/role.schema.d.ts.map +1 -0
- package/lib/schemas/role.schema.js +14 -0
- package/lib/schemas/typebox/organization.schema.d.ts +30 -0
- package/lib/schemas/typebox/organization.schema.d.ts.map +1 -0
- package/lib/schemas/typebox/organization.schema.js +28 -0
- package/lib/schemas/typebox/permission.schema.d.ts +20 -0
- package/lib/schemas/typebox/permission.schema.d.ts.map +1 -0
- package/lib/schemas/typebox/permission.schema.js +20 -0
- package/lib/schemas/typebox/role.schema.d.ts +22 -0
- package/lib/schemas/typebox/role.schema.d.ts.map +1 -0
- package/lib/schemas/typebox/role.schema.js +20 -0
- package/lib/schemas/typebox/user.schema.d.ts +37 -0
- package/lib/schemas/typebox/user.schema.d.ts.map +1 -0
- package/lib/schemas/typebox/user.schema.js +35 -0
- package/lib/schemas/user.schema.d.ts +72 -0
- package/lib/schemas/user.schema.d.ts.map +1 -0
- package/lib/schemas/user.schema.js +14 -0
- package/lib/schemas/zod/organization.schema.d.ts +30 -0
- package/lib/schemas/zod/organization.schema.d.ts.map +1 -0
- package/lib/schemas/zod/organization.schema.js +28 -0
- package/lib/schemas/zod/permission.schema.d.ts +20 -0
- package/lib/schemas/zod/permission.schema.d.ts.map +1 -0
- package/lib/schemas/zod/permission.schema.js +20 -0
- package/lib/schemas/zod/role.schema.d.ts +22 -0
- package/lib/schemas/zod/role.schema.d.ts.map +1 -0
- package/lib/schemas/zod/role.schema.js +20 -0
- package/lib/schemas/zod/user.schema.d.ts +37 -0
- package/lib/schemas/zod/user.schema.d.ts.map +1 -0
- package/lib/schemas/zod/user.schema.js +35 -0
- package/lib/services/organization.service.d.ts +44 -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 +61 -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 +48 -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 +6 -4
- package/__test__/schemaEquality.test.ts +0 -293
- package/schemas/organization.schema.ts +0 -28
- package/schemas/permission.schema.ts +0 -28
- package/schemas/role.schema.ts +0 -28
- package/schemas/user.schema.ts +0 -28
- package/tsconfig.json +0 -7
- /package/{schemas/zod → lib/eject/schemas}/organization.schema.ts +0 -0
- /package/{schemas/zod → lib/eject/schemas}/permission.schema.ts +0 -0
- /package/{schemas/zod → lib/eject/schemas}/role.schema.ts +0 -0
- /package/{schemas/zod → lib/eject/schemas}/user.schema.ts +0 -0
- /package/{services → lib/eject/services}/organization.service.ts +0 -0
- /package/{services → lib/eject/services}/permission.service.ts +0 -0
- /package/{services → lib/eject/services}/role.service.ts +0 -0
- /package/{services → lib/eject/services/services}/user.service.ts +0 -0
- /package/{index.ts → lib/index.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.schema.d.ts","sourceRoot":"","sources":["../../../schemas/typebox/user.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAML,sBAAsB,EAGvB,MAAM,+BAA+B,CAAC;AAEvC,eAAO,MAAM,gBAAgB;;;;;;;;;;CAU5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,OAAO;;;;;;;;;;CAU9C,CAAC;AAEH,eAAO,MAAM,UAAU,GACpB,QAAQ,OAAO,MACf,aAAa,SAAS,eAAe,CAAC,sBAAsB,CAAC,EAC5D,eAAe,aAAa;;;;;;;;;;;CAY5B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { array, date, email, optional, string, unknown, uuid } from '@forklaunch/validator/typebox';
|
|
2
|
+
export const CreateUserSchema = {
|
|
3
|
+
email: email,
|
|
4
|
+
password: string,
|
|
5
|
+
firstName: string,
|
|
6
|
+
lastName: string,
|
|
7
|
+
organizationId: string,
|
|
8
|
+
roleIds: array(string),
|
|
9
|
+
phoneNumber: optional(string),
|
|
10
|
+
subscription: optional(string),
|
|
11
|
+
extraFields: optional(unknown)
|
|
12
|
+
};
|
|
13
|
+
export const UpdateUserSchema = (uuidId) => ({
|
|
14
|
+
id: uuidId ? uuid : string,
|
|
15
|
+
email: optional(email),
|
|
16
|
+
password: optional(string),
|
|
17
|
+
firstName: optional(string),
|
|
18
|
+
lastName: optional(string),
|
|
19
|
+
roleIds: optional(array(string)),
|
|
20
|
+
phoneNumber: optional(string),
|
|
21
|
+
subscription: optional(string),
|
|
22
|
+
extraFields: optional(unknown)
|
|
23
|
+
});
|
|
24
|
+
export const UserSchema = (uuidId) => (RoleDtoSchema) => ({
|
|
25
|
+
id: uuidId ? uuid : string,
|
|
26
|
+
email: email,
|
|
27
|
+
firstName: string,
|
|
28
|
+
lastName: string,
|
|
29
|
+
roles: array(RoleDtoSchema),
|
|
30
|
+
phoneNumber: optional(string),
|
|
31
|
+
subscription: optional(string),
|
|
32
|
+
extraFields: optional(unknown),
|
|
33
|
+
createdAt: optional(date),
|
|
34
|
+
updatedAt: optional(date)
|
|
35
|
+
});
|