@contractspec/lib.identity-rbac 1.56.1 → 1.58.0

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 (82) hide show
  1. package/dist/browser/contracts/index.js +1045 -0
  2. package/dist/browser/contracts/organization.js +655 -0
  3. package/dist/browser/contracts/rbac.js +599 -0
  4. package/dist/browser/contracts/user.js +235 -0
  5. package/dist/browser/entities/index.js +464 -0
  6. package/dist/browser/entities/organization.js +150 -0
  7. package/dist/browser/entities/rbac.js +124 -0
  8. package/dist/browser/entities/user.js +168 -0
  9. package/dist/browser/events.js +374 -0
  10. package/dist/browser/identity-rbac.capability.js +28 -0
  11. package/dist/browser/identity-rbac.feature.js +67 -0
  12. package/dist/browser/index.js +2099 -0
  13. package/dist/browser/policies/engine.js +154 -0
  14. package/dist/browser/policies/index.js +154 -0
  15. package/dist/contracts/index.d.ts +4 -4
  16. package/dist/contracts/index.d.ts.map +1 -0
  17. package/dist/contracts/index.js +1045 -4
  18. package/dist/contracts/organization.d.ts +758 -764
  19. package/dist/contracts/organization.d.ts.map +1 -1
  20. package/dist/contracts/organization.js +653 -602
  21. package/dist/contracts/rbac.d.ts +517 -523
  22. package/dist/contracts/rbac.d.ts.map +1 -1
  23. package/dist/contracts/rbac.js +597 -481
  24. package/dist/contracts/user.d.ts +513 -519
  25. package/dist/contracts/user.d.ts.map +1 -1
  26. package/dist/contracts/user.js +222 -319
  27. package/dist/entities/index.d.ts +164 -169
  28. package/dist/entities/index.d.ts.map +1 -1
  29. package/dist/entities/index.js +462 -33
  30. package/dist/entities/organization.d.ts +58 -63
  31. package/dist/entities/organization.d.ts.map +1 -1
  32. package/dist/entities/organization.js +145 -145
  33. package/dist/entities/rbac.d.ts +62 -67
  34. package/dist/entities/rbac.d.ts.map +1 -1
  35. package/dist/entities/rbac.js +119 -132
  36. package/dist/entities/user.d.ts +66 -71
  37. package/dist/entities/user.d.ts.map +1 -1
  38. package/dist/entities/user.js +164 -189
  39. package/dist/events.d.ts +537 -543
  40. package/dist/events.d.ts.map +1 -1
  41. package/dist/events.js +343 -651
  42. package/dist/identity-rbac.capability.d.ts +2 -7
  43. package/dist/identity-rbac.capability.d.ts.map +1 -1
  44. package/dist/identity-rbac.capability.js +29 -29
  45. package/dist/identity-rbac.feature.d.ts +1 -7
  46. package/dist/identity-rbac.feature.d.ts.map +1 -1
  47. package/dist/identity-rbac.feature.js +66 -193
  48. package/dist/index.d.ts +6 -12
  49. package/dist/index.d.ts.map +1 -0
  50. package/dist/index.js +2100 -14
  51. package/dist/node/contracts/index.js +1045 -0
  52. package/dist/node/contracts/organization.js +655 -0
  53. package/dist/node/contracts/rbac.js +599 -0
  54. package/dist/node/contracts/user.js +235 -0
  55. package/dist/node/entities/index.js +464 -0
  56. package/dist/node/entities/organization.js +150 -0
  57. package/dist/node/entities/rbac.js +124 -0
  58. package/dist/node/entities/user.js +168 -0
  59. package/dist/node/events.js +374 -0
  60. package/dist/node/identity-rbac.capability.js +28 -0
  61. package/dist/node/identity-rbac.feature.js +67 -0
  62. package/dist/node/index.js +2099 -0
  63. package/dist/node/policies/engine.js +154 -0
  64. package/dist/node/policies/index.js +154 -0
  65. package/dist/policies/engine.d.ts +98 -101
  66. package/dist/policies/engine.d.ts.map +1 -1
  67. package/dist/policies/engine.js +151 -164
  68. package/dist/policies/index.d.ts +2 -2
  69. package/dist/policies/index.d.ts.map +1 -0
  70. package/dist/policies/index.js +154 -2
  71. package/package.json +149 -40
  72. package/dist/contracts/organization.js.map +0 -1
  73. package/dist/contracts/rbac.js.map +0 -1
  74. package/dist/contracts/user.js.map +0 -1
  75. package/dist/entities/index.js.map +0 -1
  76. package/dist/entities/organization.js.map +0 -1
  77. package/dist/entities/rbac.js.map +0 -1
  78. package/dist/entities/user.js.map +0 -1
  79. package/dist/events.js.map +0 -1
  80. package/dist/identity-rbac.capability.js.map +0 -1
  81. package/dist/identity-rbac.feature.js.map +0 -1
  82. package/dist/policies/engine.js.map +0 -1
@@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;;;;;;;;;;;;;;;;;;;;;;;;IA6B7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;IA+B7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkB5B,CAAC"}
@@ -1,333 +1,236 @@
1
- import { ScalarTypeEnum, SchemaModel } from "@contractspec/lib.schema";
1
+ // @bun
2
+ // src/contracts/user.ts
3
+ import { SchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
2
4
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
3
-
4
- //#region src/contracts/user.ts
5
- const OWNERS = ["platform.identity-rbac"];
6
- const UserProfileModel = new SchemaModel({
7
- name: "UserProfile",
8
- description: "User profile information",
9
- fields: {
10
- id: {
11
- type: ScalarTypeEnum.String_unsecure(),
12
- isOptional: false
13
- },
14
- email: {
15
- type: ScalarTypeEnum.EmailAddress(),
16
- isOptional: false
17
- },
18
- emailVerified: {
19
- type: ScalarTypeEnum.Boolean(),
20
- isOptional: false
21
- },
22
- name: {
23
- type: ScalarTypeEnum.String_unsecure(),
24
- isOptional: true
25
- },
26
- firstName: {
27
- type: ScalarTypeEnum.String_unsecure(),
28
- isOptional: true
29
- },
30
- lastName: {
31
- type: ScalarTypeEnum.String_unsecure(),
32
- isOptional: true
33
- },
34
- locale: {
35
- type: ScalarTypeEnum.String_unsecure(),
36
- isOptional: true
37
- },
38
- timezone: {
39
- type: ScalarTypeEnum.String_unsecure(),
40
- isOptional: true
41
- },
42
- imageUrl: {
43
- type: ScalarTypeEnum.URL(),
44
- isOptional: true
45
- },
46
- role: {
47
- type: ScalarTypeEnum.String_unsecure(),
48
- isOptional: true
49
- },
50
- onboardingCompleted: {
51
- type: ScalarTypeEnum.Boolean(),
52
- isOptional: false
53
- },
54
- createdAt: {
55
- type: ScalarTypeEnum.DateTime(),
56
- isOptional: false
57
- }
58
- }
5
+ var OWNERS = ["platform.identity-rbac"];
6
+ var UserProfileModel = new SchemaModel({
7
+ name: "UserProfile",
8
+ description: "User profile information",
9
+ fields: {
10
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
11
+ email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },
12
+ emailVerified: { type: ScalarTypeEnum.Boolean(), isOptional: false },
13
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
14
+ firstName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
15
+ lastName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
16
+ locale: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
17
+ timezone: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
18
+ imageUrl: { type: ScalarTypeEnum.URL(), isOptional: true },
19
+ role: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
20
+ onboardingCompleted: { type: ScalarTypeEnum.Boolean(), isOptional: false },
21
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
22
+ }
59
23
  });
60
- const CreateUserInputModel = new SchemaModel({
61
- name: "CreateUserInput",
62
- description: "Input for creating a new user",
63
- fields: {
64
- email: {
65
- type: ScalarTypeEnum.EmailAddress(),
66
- isOptional: false
67
- },
68
- name: {
69
- type: ScalarTypeEnum.String_unsecure(),
70
- isOptional: true
71
- },
72
- firstName: {
73
- type: ScalarTypeEnum.String_unsecure(),
74
- isOptional: true
75
- },
76
- lastName: {
77
- type: ScalarTypeEnum.String_unsecure(),
78
- isOptional: true
79
- },
80
- password: {
81
- type: ScalarTypeEnum.String_unsecure(),
82
- isOptional: true
83
- }
84
- }
24
+ var CreateUserInputModel = new SchemaModel({
25
+ name: "CreateUserInput",
26
+ description: "Input for creating a new user",
27
+ fields: {
28
+ email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },
29
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
30
+ firstName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
31
+ lastName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
32
+ password: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
33
+ }
85
34
  });
86
- const UpdateUserInputModel = new SchemaModel({
87
- name: "UpdateUserInput",
88
- description: "Input for updating a user profile",
89
- fields: {
90
- name: {
91
- type: ScalarTypeEnum.String_unsecure(),
92
- isOptional: true
93
- },
94
- firstName: {
95
- type: ScalarTypeEnum.String_unsecure(),
96
- isOptional: true
97
- },
98
- lastName: {
99
- type: ScalarTypeEnum.String_unsecure(),
100
- isOptional: true
101
- },
102
- locale: {
103
- type: ScalarTypeEnum.String_unsecure(),
104
- isOptional: true
105
- },
106
- timezone: {
107
- type: ScalarTypeEnum.String_unsecure(),
108
- isOptional: true
109
- },
110
- imageUrl: {
111
- type: ScalarTypeEnum.URL(),
112
- isOptional: true
113
- }
114
- }
35
+ var UpdateUserInputModel = new SchemaModel({
36
+ name: "UpdateUserInput",
37
+ description: "Input for updating a user profile",
38
+ fields: {
39
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
40
+ firstName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
41
+ lastName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
42
+ locale: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
43
+ timezone: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
44
+ imageUrl: { type: ScalarTypeEnum.URL(), isOptional: true }
45
+ }
115
46
  });
116
- const DeleteUserInputModel = new SchemaModel({
117
- name: "DeleteUserInput",
118
- description: "Input for deleting a user",
119
- fields: { confirmEmail: {
120
- type: ScalarTypeEnum.EmailAddress(),
121
- isOptional: false
122
- } }
47
+ var DeleteUserInputModel = new SchemaModel({
48
+ name: "DeleteUserInput",
49
+ description: "Input for deleting a user",
50
+ fields: {
51
+ confirmEmail: { type: ScalarTypeEnum.EmailAddress(), isOptional: false }
52
+ }
123
53
  });
124
- const SuccessResultModel = new SchemaModel({
125
- name: "SuccessResult",
126
- description: "Simple success result",
127
- fields: { success: {
128
- type: ScalarTypeEnum.Boolean(),
129
- isOptional: false
130
- } }
54
+ var SuccessResultModel = new SchemaModel({
55
+ name: "SuccessResult",
56
+ description: "Simple success result",
57
+ fields: {
58
+ success: { type: ScalarTypeEnum.Boolean(), isOptional: false }
59
+ }
131
60
  });
132
- const UserDeletedPayloadModel = new SchemaModel({
133
- name: "UserDeletedPayload",
134
- description: "Payload for user deleted event",
135
- fields: { userId: {
136
- type: ScalarTypeEnum.String_unsecure(),
137
- isOptional: false
138
- } }
61
+ var UserDeletedPayloadModel = new SchemaModel({
62
+ name: "UserDeletedPayload",
63
+ description: "Payload for user deleted event",
64
+ fields: {
65
+ userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
66
+ }
139
67
  });
140
- const ListUsersInputModel = new SchemaModel({
141
- name: "ListUsersInput",
142
- description: "Input for listing users",
143
- fields: {
144
- limit: {
145
- type: ScalarTypeEnum.Int_unsecure(),
146
- isOptional: true
147
- },
148
- offset: {
149
- type: ScalarTypeEnum.Int_unsecure(),
150
- isOptional: true
151
- },
152
- search: {
153
- type: ScalarTypeEnum.String_unsecure(),
154
- isOptional: true
155
- }
156
- }
68
+ var ListUsersInputModel = new SchemaModel({
69
+ name: "ListUsersInput",
70
+ description: "Input for listing users",
71
+ fields: {
72
+ limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
73
+ offset: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
74
+ search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
75
+ }
157
76
  });
158
- const ListUsersOutputModel = new SchemaModel({
159
- name: "ListUsersOutput",
160
- description: "Output for listing users",
161
- fields: {
162
- users: {
163
- type: UserProfileModel,
164
- isOptional: false,
165
- isArray: true
166
- },
167
- total: {
168
- type: ScalarTypeEnum.Int_unsecure(),
169
- isOptional: false
170
- }
171
- }
77
+ var ListUsersOutputModel = new SchemaModel({
78
+ name: "ListUsersOutput",
79
+ description: "Output for listing users",
80
+ fields: {
81
+ users: { type: UserProfileModel, isOptional: false, isArray: true },
82
+ total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false }
83
+ }
172
84
  });
173
- /**
174
- * Create a new user account.
175
- */
176
- const CreateUserContract = defineCommand({
177
- meta: {
178
- key: "identity.user.create",
179
- version: "1.0.0",
180
- stability: "stable",
181
- owners: [...OWNERS],
182
- tags: [
183
- "identity",
184
- "user",
185
- "create"
186
- ],
187
- description: "Create a new user account.",
188
- goal: "Register a new user in the system.",
189
- context: "Used during signup flows. May trigger email verification."
190
- },
191
- io: {
192
- input: CreateUserInputModel,
193
- output: UserProfileModel,
194
- errors: { EMAIL_EXISTS: {
195
- description: "A user with this email already exists",
196
- http: 409,
197
- gqlCode: "EMAIL_EXISTS",
198
- when: "Email is already registered"
199
- } }
200
- },
201
- policy: { auth: "anonymous" },
202
- sideEffects: {
203
- emits: [{
204
- key: "user.created",
205
- version: "1.0.0",
206
- when: "User is successfully created",
207
- payload: UserProfileModel
208
- }],
209
- audit: ["user.created"]
210
- }
85
+ var CreateUserContract = defineCommand({
86
+ meta: {
87
+ key: "identity.user.create",
88
+ version: "1.0.0",
89
+ stability: "stable",
90
+ owners: [...OWNERS],
91
+ tags: ["identity", "user", "create"],
92
+ description: "Create a new user account.",
93
+ goal: "Register a new user in the system.",
94
+ context: "Used during signup flows. May trigger email verification."
95
+ },
96
+ io: {
97
+ input: CreateUserInputModel,
98
+ output: UserProfileModel,
99
+ errors: {
100
+ EMAIL_EXISTS: {
101
+ description: "A user with this email already exists",
102
+ http: 409,
103
+ gqlCode: "EMAIL_EXISTS",
104
+ when: "Email is already registered"
105
+ }
106
+ }
107
+ },
108
+ policy: {
109
+ auth: "anonymous"
110
+ },
111
+ sideEffects: {
112
+ emits: [
113
+ {
114
+ key: "user.created",
115
+ version: "1.0.0",
116
+ when: "User is successfully created",
117
+ payload: UserProfileModel
118
+ }
119
+ ],
120
+ audit: ["user.created"]
121
+ }
211
122
  });
212
- /**
213
- * Get the current user's profile.
214
- */
215
- const GetCurrentUserContract = defineQuery({
216
- meta: {
217
- key: "identity.user.me",
218
- version: "1.0.0",
219
- stability: "stable",
220
- owners: [...OWNERS],
221
- tags: [
222
- "identity",
223
- "user",
224
- "profile"
225
- ],
226
- description: "Get the current authenticated user profile.",
227
- goal: "Retrieve user profile for the authenticated session.",
228
- context: "Called on app load and after profile updates."
229
- },
230
- io: {
231
- input: null,
232
- output: UserProfileModel
233
- },
234
- policy: { auth: "user" }
123
+ var GetCurrentUserContract = defineQuery({
124
+ meta: {
125
+ key: "identity.user.me",
126
+ version: "1.0.0",
127
+ stability: "stable",
128
+ owners: [...OWNERS],
129
+ tags: ["identity", "user", "profile"],
130
+ description: "Get the current authenticated user profile.",
131
+ goal: "Retrieve user profile for the authenticated session.",
132
+ context: "Called on app load and after profile updates."
133
+ },
134
+ io: {
135
+ input: null,
136
+ output: UserProfileModel
137
+ },
138
+ policy: {
139
+ auth: "user"
140
+ }
235
141
  });
236
- /**
237
- * Update user profile.
238
- */
239
- const UpdateUserContract = defineCommand({
240
- meta: {
241
- key: "identity.user.update",
242
- version: "1.0.0",
243
- stability: "stable",
244
- owners: [...OWNERS],
245
- tags: [
246
- "identity",
247
- "user",
248
- "update"
249
- ],
250
- description: "Update user profile information.",
251
- goal: "Allow users to update their profile.",
252
- context: "Self-service profile updates."
253
- },
254
- io: {
255
- input: UpdateUserInputModel,
256
- output: UserProfileModel
257
- },
258
- policy: { auth: "user" },
259
- sideEffects: {
260
- emits: [{
261
- key: "user.updated",
262
- version: "1.0.0",
263
- when: "User profile is updated",
264
- payload: UserProfileModel
265
- }],
266
- audit: ["user.updated"]
267
- }
142
+ var UpdateUserContract = defineCommand({
143
+ meta: {
144
+ key: "identity.user.update",
145
+ version: "1.0.0",
146
+ stability: "stable",
147
+ owners: [...OWNERS],
148
+ tags: ["identity", "user", "update"],
149
+ description: "Update user profile information.",
150
+ goal: "Allow users to update their profile.",
151
+ context: "Self-service profile updates."
152
+ },
153
+ io: {
154
+ input: UpdateUserInputModel,
155
+ output: UserProfileModel
156
+ },
157
+ policy: {
158
+ auth: "user"
159
+ },
160
+ sideEffects: {
161
+ emits: [
162
+ {
163
+ key: "user.updated",
164
+ version: "1.0.0",
165
+ when: "User profile is updated",
166
+ payload: UserProfileModel
167
+ }
168
+ ],
169
+ audit: ["user.updated"]
170
+ }
268
171
  });
269
- /**
270
- * Delete user account.
271
- */
272
- const DeleteUserContract = defineCommand({
273
- meta: {
274
- key: "identity.user.delete",
275
- version: "1.0.0",
276
- stability: "stable",
277
- owners: [...OWNERS],
278
- tags: [
279
- "identity",
280
- "user",
281
- "delete"
282
- ],
283
- description: "Delete user account and all associated data.",
284
- goal: "Allow users to delete their account (GDPR compliance).",
285
- context: "Self-service account deletion. Cascades to memberships, sessions, etc."
286
- },
287
- io: {
288
- input: DeleteUserInputModel,
289
- output: SuccessResultModel
290
- },
291
- policy: {
292
- auth: "user",
293
- escalate: "human_review"
294
- },
295
- sideEffects: {
296
- emits: [{
297
- key: "user.deleted",
298
- version: "1.0.0",
299
- when: "User account is deleted",
300
- payload: UserDeletedPayloadModel
301
- }],
302
- audit: ["user.deleted"]
303
- }
172
+ var DeleteUserContract = defineCommand({
173
+ meta: {
174
+ key: "identity.user.delete",
175
+ version: "1.0.0",
176
+ stability: "stable",
177
+ owners: [...OWNERS],
178
+ tags: ["identity", "user", "delete"],
179
+ description: "Delete user account and all associated data.",
180
+ goal: "Allow users to delete their account (GDPR compliance).",
181
+ context: "Self-service account deletion. Cascades to memberships, sessions, etc."
182
+ },
183
+ io: {
184
+ input: DeleteUserInputModel,
185
+ output: SuccessResultModel
186
+ },
187
+ policy: {
188
+ auth: "user",
189
+ escalate: "human_review"
190
+ },
191
+ sideEffects: {
192
+ emits: [
193
+ {
194
+ key: "user.deleted",
195
+ version: "1.0.0",
196
+ when: "User account is deleted",
197
+ payload: UserDeletedPayloadModel
198
+ }
199
+ ],
200
+ audit: ["user.deleted"]
201
+ }
304
202
  });
305
- /**
306
- * List users (admin only).
307
- */
308
- const ListUsersContract = defineQuery({
309
- meta: {
310
- key: "identity.user.list",
311
- version: "1.0.0",
312
- stability: "stable",
313
- owners: [...OWNERS],
314
- tags: [
315
- "identity",
316
- "user",
317
- "admin",
318
- "list"
319
- ],
320
- description: "List all users (admin only).",
321
- goal: "Allow admins to browse and manage users.",
322
- context: "Admin dashboard user management."
323
- },
324
- io: {
325
- input: ListUsersInputModel,
326
- output: ListUsersOutputModel
327
- },
328
- policy: { auth: "admin" }
203
+ var ListUsersContract = defineQuery({
204
+ meta: {
205
+ key: "identity.user.list",
206
+ version: "1.0.0",
207
+ stability: "stable",
208
+ owners: [...OWNERS],
209
+ tags: ["identity", "user", "admin", "list"],
210
+ description: "List all users (admin only).",
211
+ goal: "Allow admins to browse and manage users.",
212
+ context: "Admin dashboard user management."
213
+ },
214
+ io: {
215
+ input: ListUsersInputModel,
216
+ output: ListUsersOutputModel
217
+ },
218
+ policy: {
219
+ auth: "admin"
220
+ }
329
221
  });
330
-
331
- //#endregion
332
- export { CreateUserContract, CreateUserInputModel, DeleteUserContract, DeleteUserInputModel, GetCurrentUserContract, ListUsersContract, ListUsersInputModel, ListUsersOutputModel, SuccessResultModel, UpdateUserContract, UpdateUserInputModel, UserDeletedPayloadModel, UserProfileModel };
333
- //# sourceMappingURL=user.js.map
222
+ export {
223
+ UserProfileModel,
224
+ UserDeletedPayloadModel,
225
+ UpdateUserInputModel,
226
+ UpdateUserContract,
227
+ SuccessResultModel,
228
+ ListUsersOutputModel,
229
+ ListUsersInputModel,
230
+ ListUsersContract,
231
+ GetCurrentUserContract,
232
+ DeleteUserInputModel,
233
+ DeleteUserContract,
234
+ CreateUserInputModel,
235
+ CreateUserContract
236
+ };