@forklaunch/implementation-iam-base 0.5.3 → 0.5.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.
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ 'use strict';
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -8,14 +8,18 @@ var __export = (target, all) => {
8
8
  __defProp(target, name, { get: all[name], enumerable: true });
9
9
  };
10
10
  var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
11
+ if ((from && typeof from === 'object') || typeof from === 'function') {
12
12
  for (let key of __getOwnPropNames(from))
13
13
  if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
15
18
  }
16
19
  return to;
17
20
  };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var __toCommonJS = (mod) =>
22
+ __copyProps(__defProp({}, '__esModule', { value: true }), mod);
19
23
 
20
24
  // domain/schemas/index.ts
21
25
  var schemas_exports = {};
@@ -28,30 +32,36 @@ __export(schemas_exports, {
28
32
  module.exports = __toCommonJS(schemas_exports);
29
33
 
30
34
  // domain/schemas/organization.schema.ts
31
- var import_internal = require("@forklaunch/internal");
35
+ var import_internal = require('@forklaunch/internal');
32
36
 
33
37
  // domain/schemas/typebox/organization.schema.ts
34
- var import_typebox4 = require("@forklaunch/validator/typebox");
38
+ var import_typebox4 = require('@forklaunch/validator/typebox');
35
39
 
36
40
  // domain/schemas/typebox/user.schema.ts
37
- var import_typebox3 = require("@forklaunch/validator/typebox");
41
+ var import_typebox3 = require('@forklaunch/validator/typebox');
38
42
 
39
43
  // domain/schemas/typebox/role.schema.ts
40
- var import_typebox2 = require("@forklaunch/validator/typebox");
44
+ var import_typebox2 = require('@forklaunch/validator/typebox');
41
45
 
42
46
  // domain/schemas/typebox/permission.schema.ts
43
- var import_typebox = require("@forklaunch/validator/typebox");
47
+ var import_typebox = require('@forklaunch/validator/typebox');
44
48
  var CreatePermissionSchema = {
45
49
  slug: import_typebox.string,
46
- addToRolesIds: (0, import_typebox.optional)((0, import_typebox.array)(import_typebox.string)),
50
+ addToRolesIds: (0, import_typebox.optional)(
51
+ (0, import_typebox.array)(import_typebox.string)
52
+ ),
47
53
  providerFields: (0, import_typebox.optional)(import_typebox.unknown)
48
54
  };
49
55
  var UpdatePermissionSchema = ({ uuidId }) => ({
50
56
  id: uuidId ? import_typebox.uuid : import_typebox.string,
51
57
  slug: (0, import_typebox.optional)(import_typebox.string),
52
58
  providerFields: (0, import_typebox.optional)(import_typebox.unknown),
53
- addToRolesIds: (0, import_typebox.optional)((0, import_typebox.array)(import_typebox.string)),
54
- removeFromRolesIds: (0, import_typebox.optional)((0, import_typebox.array)(import_typebox.string))
59
+ addToRolesIds: (0, import_typebox.optional)(
60
+ (0, import_typebox.array)(import_typebox.string)
61
+ ),
62
+ removeFromRolesIds: (0, import_typebox.optional)(
63
+ (0, import_typebox.array)(import_typebox.string)
64
+ )
55
65
  });
56
66
  var PermissionSchema = ({ uuidId }) => ({
57
67
  id: uuidId ? import_typebox.uuid : import_typebox.string,
@@ -69,13 +79,17 @@ var BasePermissionServiceSchemas = (options) => ({
69
79
  // domain/schemas/typebox/role.schema.ts
70
80
  var CreateRoleSchema = {
71
81
  name: import_typebox2.string,
72
- permissionIds: (0, import_typebox2.optional)((0, import_typebox2.array)(import_typebox2.string)),
82
+ permissionIds: (0, import_typebox2.optional)(
83
+ (0, import_typebox2.array)(import_typebox2.string)
84
+ ),
73
85
  providerFields: (0, import_typebox2.optional)(import_typebox2.unknown)
74
86
  };
75
87
  var UpdateRoleSchema = ({ uuidId }) => ({
76
88
  id: uuidId ? import_typebox2.uuid : import_typebox2.string,
77
89
  name: (0, import_typebox2.optional)(import_typebox2.string),
78
- permissionIds: (0, import_typebox2.optional)((0, import_typebox2.array)(import_typebox2.string)),
90
+ permissionIds: (0, import_typebox2.optional)(
91
+ (0, import_typebox2.array)(import_typebox2.string)
92
+ ),
79
93
  providerFields: (0, import_typebox2.optional)(import_typebox2.unknown)
80
94
  });
81
95
  var RoleSchema = ({ uuidId }) => ({
@@ -110,7 +124,9 @@ var UpdateUserSchema = ({ uuidId }) => ({
110
124
  password: (0, import_typebox3.optional)(import_typebox3.string),
111
125
  firstName: (0, import_typebox3.optional)(import_typebox3.string),
112
126
  lastName: (0, import_typebox3.optional)(import_typebox3.string),
113
- roles: (0, import_typebox3.optional)((0, import_typebox3.array)(import_typebox3.string)),
127
+ roles: (0, import_typebox3.optional)(
128
+ (0, import_typebox3.array)(import_typebox3.string)
129
+ ),
114
130
  phoneNumber: (0, import_typebox3.optional)(import_typebox3.string),
115
131
  subscription: (0, import_typebox3.optional)(import_typebox3.string),
116
132
  providerFields: (0, import_typebox3.optional)(import_typebox3.unknown)
@@ -149,18 +165,20 @@ var UpdateOrganizationSchema = ({ uuidId }) => ({
149
165
  logoUrl: (0, import_typebox4.optional)(import_typebox4.string),
150
166
  providerFields: (0, import_typebox4.optional)(import_typebox4.unknown)
151
167
  });
152
- var OrganizationSchema = ({ uuidId }) => (organizationStatus) => ({
153
- id: uuidId ? import_typebox4.uuid : import_typebox4.string,
154
- name: import_typebox4.string,
155
- users: (0, import_typebox4.array)(UserSchema({ uuidId })),
156
- domain: import_typebox4.string,
157
- subscription: import_typebox4.string,
158
- status: (0, import_typebox4.enum_)(organizationStatus),
159
- logoUrl: (0, import_typebox4.optional)(import_typebox4.string),
160
- providerFields: (0, import_typebox4.optional)(import_typebox4.unknown),
161
- createdAt: (0, import_typebox4.optional)(import_typebox4.date),
162
- updatedAt: (0, import_typebox4.optional)(import_typebox4.date)
163
- });
168
+ var OrganizationSchema =
169
+ ({ uuidId }) =>
170
+ (organizationStatus) => ({
171
+ id: uuidId ? import_typebox4.uuid : import_typebox4.string,
172
+ name: import_typebox4.string,
173
+ users: (0, import_typebox4.array)(UserSchema({ uuidId })),
174
+ domain: import_typebox4.string,
175
+ subscription: import_typebox4.string,
176
+ status: (0, import_typebox4.enum_)(organizationStatus),
177
+ logoUrl: (0, import_typebox4.optional)(import_typebox4.string),
178
+ providerFields: (0, import_typebox4.optional)(import_typebox4.unknown),
179
+ createdAt: (0, import_typebox4.optional)(import_typebox4.date),
180
+ updatedAt: (0, import_typebox4.optional)(import_typebox4.date)
181
+ });
164
182
  var BaseOrganizationServiceSchemas = (options) => ({
165
183
  CreateOrganizationSchema,
166
184
  UpdateOrganizationSchema: UpdateOrganizationSchema(options),
@@ -168,27 +186,33 @@ var BaseOrganizationServiceSchemas = (options) => ({
168
186
  });
169
187
 
170
188
  // domain/schemas/zod/organization.schema.ts
171
- var import_zod4 = require("@forklaunch/validator/zod");
189
+ var import_zod4 = require('@forklaunch/validator/zod');
172
190
 
173
191
  // domain/schemas/zod/user.schema.ts
174
- var import_zod3 = require("@forklaunch/validator/zod");
192
+ var import_zod3 = require('@forklaunch/validator/zod');
175
193
 
176
194
  // domain/schemas/zod/role.schema.ts
177
- var import_zod2 = require("@forklaunch/validator/zod");
195
+ var import_zod2 = require('@forklaunch/validator/zod');
178
196
 
179
197
  // domain/schemas/zod/permission.schema.ts
180
- var import_zod = require("@forklaunch/validator/zod");
198
+ var import_zod = require('@forklaunch/validator/zod');
181
199
  var CreatePermissionSchema2 = {
182
200
  slug: import_zod.string,
183
- addToRolesIds: (0, import_zod.optional)((0, import_zod.array)(import_zod.string)),
201
+ addToRolesIds: (0, import_zod.optional)(
202
+ (0, import_zod.array)(import_zod.string)
203
+ ),
184
204
  providerFields: (0, import_zod.optional)(import_zod.unknown)
185
205
  };
186
206
  var UpdatePermissionSchema2 = ({ uuidId }) => ({
187
207
  id: uuidId ? import_zod.uuid : import_zod.string,
188
208
  slug: (0, import_zod.optional)(import_zod.string),
189
209
  providerFields: (0, import_zod.optional)(import_zod.unknown),
190
- addToRolesIds: (0, import_zod.optional)((0, import_zod.array)(import_zod.string)),
191
- removeFromRolesIds: (0, import_zod.optional)((0, import_zod.array)(import_zod.string))
210
+ addToRolesIds: (0, import_zod.optional)(
211
+ (0, import_zod.array)(import_zod.string)
212
+ ),
213
+ removeFromRolesIds: (0, import_zod.optional)(
214
+ (0, import_zod.array)(import_zod.string)
215
+ )
192
216
  });
193
217
  var PermissionSchema2 = ({ uuidId }) => ({
194
218
  id: uuidId ? import_zod.uuid : import_zod.string,
@@ -206,13 +230,17 @@ var BasePermissionServiceSchemas2 = (options) => ({
206
230
  // domain/schemas/zod/role.schema.ts
207
231
  var CreateRoleSchema2 = {
208
232
  name: import_zod2.string,
209
- permissionIds: (0, import_zod2.optional)((0, import_zod2.array)(import_zod2.string)),
233
+ permissionIds: (0, import_zod2.optional)(
234
+ (0, import_zod2.array)(import_zod2.string)
235
+ ),
210
236
  providerFields: (0, import_zod2.optional)(import_zod2.unknown)
211
237
  };
212
238
  var UpdateRoleSchema2 = ({ uuidId }) => ({
213
239
  id: uuidId ? import_zod2.uuid : import_zod2.string,
214
240
  name: (0, import_zod2.optional)(import_zod2.string),
215
- permissionIds: (0, import_zod2.optional)((0, import_zod2.array)(import_zod2.string)),
241
+ permissionIds: (0, import_zod2.optional)(
242
+ (0, import_zod2.array)(import_zod2.string)
243
+ ),
216
244
  providerFields: (0, import_zod2.optional)(import_zod2.unknown)
217
245
  });
218
246
  var RoleSchema2 = ({ uuidId }) => ({
@@ -286,18 +314,20 @@ var UpdateOrganizationSchema2 = ({ uuidId }) => ({
286
314
  logoUrl: (0, import_zod4.optional)(import_zod4.string),
287
315
  providerFields: (0, import_zod4.optional)(import_zod4.unknown)
288
316
  });
289
- var OrganizationSchema2 = ({ uuidId }) => (organizationStatus) => ({
290
- id: uuidId ? import_zod4.uuid : import_zod4.string,
291
- name: import_zod4.string,
292
- users: (0, import_zod4.array)(UserSchema2({ uuidId })),
293
- domain: import_zod4.string,
294
- subscription: import_zod4.string,
295
- status: (0, import_zod4.enum_)(organizationStatus),
296
- logoUrl: (0, import_zod4.optional)(import_zod4.string),
297
- providerFields: (0, import_zod4.optional)(import_zod4.unknown),
298
- createdAt: (0, import_zod4.optional)(import_zod4.date),
299
- updatedAt: (0, import_zod4.optional)(import_zod4.date)
300
- });
317
+ var OrganizationSchema2 =
318
+ ({ uuidId }) =>
319
+ (organizationStatus) => ({
320
+ id: uuidId ? import_zod4.uuid : import_zod4.string,
321
+ name: import_zod4.string,
322
+ users: (0, import_zod4.array)(UserSchema2({ uuidId })),
323
+ domain: import_zod4.string,
324
+ subscription: import_zod4.string,
325
+ status: (0, import_zod4.enum_)(organizationStatus),
326
+ logoUrl: (0, import_zod4.optional)(import_zod4.string),
327
+ providerFields: (0, import_zod4.optional)(import_zod4.unknown),
328
+ createdAt: (0, import_zod4.optional)(import_zod4.date),
329
+ updatedAt: (0, import_zod4.optional)(import_zod4.date)
330
+ });
301
331
  var BaseOrganizationServiceSchemas2 = (options) => ({
302
332
  CreateOrganizationSchema: CreateOrganizationSchema2,
303
333
  UpdateOrganizationSchema: UpdateOrganizationSchema2(options),
@@ -305,35 +335,37 @@ var BaseOrganizationServiceSchemas2 = (options) => ({
305
335
  });
306
336
 
307
337
  // domain/schemas/organization.schema.ts
308
- var BaseOrganizationServiceSchemas3 = (0, import_internal.serviceSchemaResolver)(
338
+ var BaseOrganizationServiceSchemas3 = (0,
339
+ import_internal.serviceSchemaResolver)(
309
340
  BaseOrganizationServiceSchemas,
310
341
  BaseOrganizationServiceSchemas2
311
342
  );
312
343
 
313
344
  // domain/schemas/permission.schema.ts
314
- var import_internal2 = require("@forklaunch/internal");
345
+ var import_internal2 = require('@forklaunch/internal');
315
346
  var BasePermissionServiceSchemas3 = (0, import_internal2.serviceSchemaResolver)(
316
347
  BasePermissionServiceSchemas,
317
348
  BasePermissionServiceSchemas2
318
349
  );
319
350
 
320
351
  // domain/schemas/role.schema.ts
321
- var import_internal3 = require("@forklaunch/internal");
352
+ var import_internal3 = require('@forklaunch/internal');
322
353
  var BaseRoleServiceSchemas3 = (0, import_internal3.serviceSchemaResolver)(
323
354
  BaseRoleServiceSchemas,
324
355
  BaseRoleServiceSchemas2
325
356
  );
326
357
 
327
358
  // domain/schemas/user.schema.ts
328
- var import_internal4 = require("@forklaunch/internal");
359
+ var import_internal4 = require('@forklaunch/internal');
329
360
  var BaseUserServiceSchemas3 = (0, import_internal4.serviceSchemaResolver)(
330
361
  BaseUserServiceSchemas,
331
362
  BaseUserServiceSchemas2
332
363
  );
333
364
  // Annotate the CommonJS export names for ESM import in node:
334
- 0 && (module.exports = {
335
- BaseOrganizationServiceSchemas,
336
- BasePermissionServiceSchemas,
337
- BaseRoleServiceSchemas,
338
- BaseUserServiceSchemas
339
- });
365
+ 0 &&
366
+ (module.exports = {
367
+ BaseOrganizationServiceSchemas,
368
+ BasePermissionServiceSchemas,
369
+ BaseRoleServiceSchemas,
370
+ BaseUserServiceSchemas
371
+ });
@@ -1,5 +1,5 @@
1
1
  // domain/schemas/organization.schema.ts
2
- import { serviceSchemaResolver } from "@forklaunch/internal";
2
+ import { serviceSchemaResolver } from '@forklaunch/internal';
3
3
 
4
4
  // domain/schemas/typebox/organization.schema.ts
5
5
  import {
@@ -10,7 +10,7 @@ import {
10
10
  string as string4,
11
11
  unknown as unknown4,
12
12
  uuid as uuid4
13
- } from "@forklaunch/validator/typebox";
13
+ } from '@forklaunch/validator/typebox';
14
14
 
15
15
  // domain/schemas/typebox/user.schema.ts
16
16
  import {
@@ -21,7 +21,7 @@ import {
21
21
  string as string3,
22
22
  unknown as unknown3,
23
23
  uuid as uuid3
24
- } from "@forklaunch/validator/typebox";
24
+ } from '@forklaunch/validator/typebox';
25
25
 
26
26
  // domain/schemas/typebox/role.schema.ts
27
27
  import {
@@ -31,7 +31,7 @@ import {
31
31
  string as string2,
32
32
  unknown as unknown2,
33
33
  uuid as uuid2
34
- } from "@forklaunch/validator/typebox";
34
+ } from '@forklaunch/validator/typebox';
35
35
 
36
36
  // domain/schemas/typebox/permission.schema.ts
37
37
  import {
@@ -41,7 +41,7 @@ import {
41
41
  string,
42
42
  unknown,
43
43
  uuid
44
- } from "@forklaunch/validator/typebox";
44
+ } from '@forklaunch/validator/typebox';
45
45
  var CreatePermissionSchema = {
46
46
  slug: string,
47
47
  addToRolesIds: optional(array(string)),
@@ -150,18 +150,20 @@ var UpdateOrganizationSchema = ({ uuidId }) => ({
150
150
  logoUrl: optional4(string4),
151
151
  providerFields: optional4(unknown4)
152
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
- providerFields: optional4(unknown4),
162
- createdAt: optional4(date4),
163
- updatedAt: optional4(date4)
164
- });
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),
@@ -177,7 +179,7 @@ import {
177
179
  string as string8,
178
180
  unknown as unknown8,
179
181
  uuid as uuid8
180
- } from "@forklaunch/validator/zod";
182
+ } from '@forklaunch/validator/zod';
181
183
 
182
184
  // domain/schemas/zod/user.schema.ts
183
185
  import {
@@ -188,7 +190,7 @@ import {
188
190
  string as string7,
189
191
  unknown as unknown7,
190
192
  uuid as uuid7
191
- } from "@forklaunch/validator/zod";
193
+ } from '@forklaunch/validator/zod';
192
194
 
193
195
  // domain/schemas/zod/role.schema.ts
194
196
  import {
@@ -198,7 +200,7 @@ import {
198
200
  string as string6,
199
201
  unknown as unknown6,
200
202
  uuid as uuid6
201
- } from "@forklaunch/validator/zod";
203
+ } from '@forklaunch/validator/zod';
202
204
 
203
205
  // domain/schemas/zod/permission.schema.ts
204
206
  import {
@@ -208,7 +210,7 @@ import {
208
210
  string as string5,
209
211
  unknown as unknown5,
210
212
  uuid as uuid5
211
- } from "@forklaunch/validator/zod";
213
+ } from '@forklaunch/validator/zod';
212
214
  var CreatePermissionSchema2 = {
213
215
  slug: string5,
214
216
  addToRolesIds: optional5(array5(string5)),
@@ -317,18 +319,20 @@ var UpdateOrganizationSchema2 = ({ uuidId }) => ({
317
319
  logoUrl: optional8(string8),
318
320
  providerFields: optional8(unknown8)
319
321
  });
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
- providerFields: optional8(unknown8),
329
- createdAt: optional8(date8),
330
- updatedAt: optional8(date8)
331
- });
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),
@@ -342,21 +346,21 @@ var BaseOrganizationServiceSchemas3 = serviceSchemaResolver(
342
346
  );
343
347
 
344
348
  // domain/schemas/permission.schema.ts
345
- import { serviceSchemaResolver as serviceSchemaResolver2 } from "@forklaunch/internal";
349
+ import { serviceSchemaResolver as serviceSchemaResolver2 } from '@forklaunch/internal';
346
350
  var BasePermissionServiceSchemas3 = serviceSchemaResolver2(
347
351
  BasePermissionServiceSchemas,
348
352
  BasePermissionServiceSchemas2
349
353
  );
350
354
 
351
355
  // domain/schemas/role.schema.ts
352
- import { serviceSchemaResolver as serviceSchemaResolver3 } from "@forklaunch/internal";
356
+ import { serviceSchemaResolver as serviceSchemaResolver3 } from '@forklaunch/internal';
353
357
  var BaseRoleServiceSchemas3 = serviceSchemaResolver3(
354
358
  BaseRoleServiceSchemas,
355
359
  BaseRoleServiceSchemas2
356
360
  );
357
361
 
358
362
  // domain/schemas/user.schema.ts
359
- import { serviceSchemaResolver as serviceSchemaResolver4 } from "@forklaunch/internal";
363
+ import { serviceSchemaResolver as serviceSchemaResolver4 } from '@forklaunch/internal';
360
364
  var BaseUserServiceSchemas3 = serviceSchemaResolver4(
361
365
  BaseUserServiceSchemas,
362
366
  BaseUserServiceSchemas2