@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.
Files changed (87) hide show
  1. package/lib/__test__/schemaEquality.test.d.ts +2 -0
  2. package/lib/__test__/schemaEquality.test.d.ts.map +1 -0
  3. package/lib/__test__/schemaEquality.test.js +175 -0
  4. package/lib/eject/schemas/index.ts +4 -0
  5. package/{schemas/typebox → lib/eject/schemas}/organization.schema.ts +13 -11
  6. package/{schemas/zod → lib/eject/schemas}/permission.schema.ts +7 -1
  7. package/lib/eject/schemas/role.schema.ts +37 -0
  8. package/{schemas/typebox → lib/eject/schemas}/user.schema.ts +20 -19
  9. package/lib/eject/services/index.ts +4 -0
  10. package/{services → lib/eject/services}/organization.service.ts +6 -6
  11. package/{services → lib/eject/services}/permission.service.ts +9 -6
  12. package/{services → lib/eject/services}/role.service.ts +6 -6
  13. package/{services → lib/eject/services}/user.service.ts +11 -9
  14. package/lib/jest.config.d.ts +4 -0
  15. package/lib/jest.config.d.ts.map +1 -0
  16. package/lib/jest.config.js +19 -0
  17. package/lib/schemas/index.d.ts +5 -0
  18. package/lib/schemas/index.d.ts.map +1 -0
  19. package/lib/schemas/index.js +4 -0
  20. package/lib/schemas/organization.schema.d.ts +192 -0
  21. package/lib/schemas/organization.schema.d.ts.map +1 -0
  22. package/lib/schemas/organization.schema.js +4 -0
  23. package/lib/schemas/permission.schema.d.ts +42 -0
  24. package/lib/schemas/permission.schema.d.ts.map +1 -0
  25. package/lib/schemas/permission.schema.js +4 -0
  26. package/lib/schemas/role.schema.d.ts +66 -0
  27. package/lib/schemas/role.schema.d.ts.map +1 -0
  28. package/lib/schemas/role.schema.js +4 -0
  29. package/lib/schemas/typebox/organization.schema.d.ts +106 -0
  30. package/lib/schemas/typebox/organization.schema.d.ts.map +1 -0
  31. package/lib/schemas/typebox/organization.schema.js +34 -0
  32. package/lib/schemas/typebox/permission.schema.d.ts +41 -0
  33. package/lib/schemas/typebox/permission.schema.d.ts.map +1 -0
  34. package/lib/schemas/typebox/permission.schema.js +25 -0
  35. package/lib/schemas/typebox/role.schema.d.ts +53 -0
  36. package/lib/schemas/typebox/role.schema.d.ts.map +1 -0
  37. package/lib/schemas/typebox/role.schema.js +26 -0
  38. package/lib/schemas/typebox/user.schema.d.ts +97 -0
  39. package/lib/schemas/typebox/user.schema.d.ts.map +1 -0
  40. package/lib/schemas/typebox/user.schema.js +41 -0
  41. package/lib/schemas/user.schema.d.ts +136 -0
  42. package/lib/schemas/user.schema.d.ts.map +1 -0
  43. package/lib/schemas/user.schema.js +4 -0
  44. package/lib/schemas/zod/organization.schema.d.ts +278 -0
  45. package/lib/schemas/zod/organization.schema.d.ts.map +1 -0
  46. package/lib/schemas/zod/organization.schema.js +34 -0
  47. package/lib/schemas/zod/permission.schema.d.ts +41 -0
  48. package/lib/schemas/zod/permission.schema.d.ts.map +1 -0
  49. package/lib/schemas/zod/permission.schema.js +25 -0
  50. package/lib/schemas/zod/role.schema.d.ts +77 -0
  51. package/lib/schemas/zod/role.schema.d.ts.map +1 -0
  52. package/lib/schemas/zod/role.schema.js +26 -0
  53. package/lib/schemas/zod/user.schema.d.ts +173 -0
  54. package/lib/schemas/zod/user.schema.d.ts.map +1 -0
  55. package/lib/schemas/zod/user.schema.js +41 -0
  56. package/lib/services/index.d.ts +5 -0
  57. package/lib/services/index.d.ts.map +1 -0
  58. package/lib/services/index.js +4 -0
  59. package/lib/services/organization.service.d.ts +45 -0
  60. package/lib/services/organization.service.d.ts.map +1 -0
  61. package/lib/services/organization.service.js +35 -0
  62. package/lib/services/permission.service.d.ts +62 -0
  63. package/lib/services/permission.service.d.ts.map +1 -0
  64. package/lib/services/permission.service.js +159 -0
  65. package/lib/services/role.service.d.ts +49 -0
  66. package/lib/services/role.service.d.ts.map +1 -0
  67. package/lib/services/role.service.js +57 -0
  68. package/lib/services/user.service.d.ts +54 -0
  69. package/lib/services/user.service.d.ts.map +1 -0
  70. package/lib/services/user.service.js +85 -0
  71. package/lib/tsconfig.tsbuildinfo +1 -0
  72. package/lib/vitest.config.d.ts +3 -0
  73. package/lib/vitest.config.d.ts.map +1 -0
  74. package/lib/vitest.config.js +7 -0
  75. package/package.json +22 -10
  76. package/__test__/schemaEquality.test.ts +0 -293
  77. package/index.ts +0 -8
  78. package/schemas/organization.schema.ts +0 -28
  79. package/schemas/permission.schema.ts +0 -28
  80. package/schemas/role.schema.ts +0 -28
  81. package/schemas/typebox/permission.schema.ts +0 -30
  82. package/schemas/typebox/role.schema.ts +0 -36
  83. package/schemas/user.schema.ts +0 -28
  84. package/schemas/zod/organization.schema.ts +0 -49
  85. package/schemas/zod/role.schema.ts +0 -36
  86. package/schemas/zod/user.schema.ts +0 -52
  87. 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
- });
package/tsconfig.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "outDir": "lib"
5
- },
6
- "exclude": ["node_modules", "lib", "eslint.config.mjs"]
7
- }