@contractspec/lib.identity-rbac 0.0.0-canary-20260113162409

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 (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +102 -0
  3. package/dist/contracts/index.d.ts +4 -0
  4. package/dist/contracts/index.js +5 -0
  5. package/dist/contracts/organization.d.ts +896 -0
  6. package/dist/contracts/organization.d.ts.map +1 -0
  7. package/dist/contracts/organization.js +605 -0
  8. package/dist/contracts/organization.js.map +1 -0
  9. package/dist/contracts/rbac.d.ts +612 -0
  10. package/dist/contracts/rbac.d.ts.map +1 -0
  11. package/dist/contracts/rbac.js +484 -0
  12. package/dist/contracts/rbac.js.map +1 -0
  13. package/dist/contracts/user.d.ts +611 -0
  14. package/dist/contracts/user.d.ts.map +1 -0
  15. package/dist/contracts/user.js +333 -0
  16. package/dist/contracts/user.js.map +1 -0
  17. package/dist/entities/index.d.ts +177 -0
  18. package/dist/entities/index.d.ts.map +1 -0
  19. package/dist/entities/index.js +36 -0
  20. package/dist/entities/index.js.map +1 -0
  21. package/dist/entities/organization.d.ts +87 -0
  22. package/dist/entities/organization.d.ts.map +1 -0
  23. package/dist/entities/organization.js +151 -0
  24. package/dist/entities/organization.js.map +1 -0
  25. package/dist/entities/rbac.d.ts +88 -0
  26. package/dist/entities/rbac.d.ts.map +1 -0
  27. package/dist/entities/rbac.js +138 -0
  28. package/dist/entities/rbac.js.map +1 -0
  29. package/dist/entities/user.d.ts +88 -0
  30. package/dist/entities/user.d.ts.map +1 -0
  31. package/dist/entities/user.js +194 -0
  32. package/dist/entities/user.js.map +1 -0
  33. package/dist/events.d.ts +690 -0
  34. package/dist/events.d.ts.map +1 -0
  35. package/dist/events.js +683 -0
  36. package/dist/events.js.map +1 -0
  37. package/dist/identity-rbac.capability.d.ts +8 -0
  38. package/dist/identity-rbac.capability.d.ts.map +1 -0
  39. package/dist/identity-rbac.capability.js +29 -0
  40. package/dist/identity-rbac.capability.js.map +1 -0
  41. package/dist/identity-rbac.feature.d.ts +12 -0
  42. package/dist/identity-rbac.feature.d.ts.map +1 -0
  43. package/dist/identity-rbac.feature.js +195 -0
  44. package/dist/identity-rbac.feature.js.map +1 -0
  45. package/dist/index.d.ts +12 -0
  46. package/dist/index.js +14 -0
  47. package/dist/policies/engine.d.ts +133 -0
  48. package/dist/policies/engine.d.ts.map +1 -0
  49. package/dist/policies/engine.js +168 -0
  50. package/dist/policies/engine.js.map +1 -0
  51. package/dist/policies/index.d.ts +2 -0
  52. package/dist/policies/index.js +3 -0
  53. package/package.json +85 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.d.ts","names":[],"sources":["../../src/contracts/organization.ts"],"sourcesContent":[],"mappings":";;;;;cAQa,mBAAiB;;UAa5B,2BAAA,CAAA;;EAbW,CAAA;EAaX,IAAA,EAAA;;;;;;;;;IAb4B,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;EAejB,CAAA;EAQX,WAAA,EAAA;;;EAR0B,CAAA;EAAA,IAAA,EAAA;IAUf,IAAA,uCAcX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;CAdsB,CAAA;AAAA,cAVX,eAUW,EAVI,WAUJ,CAAA;EAgBX,EAAA,EAAA;IAWX,IAAA,EA7BA,2BAAA,CAAA,SA6BA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;IAX0B,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;EAaf,CAAA;CASX,CAAA;cAtCW,aAAW;;UActB,2BAAA,CAAA;IAe8B,UAAA,EAAA,KAAA;EAAA,CAAA;EAWnB,MAAA,EAAA;IAQA,IAAA,uCAUX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;EAV8B,CAAA;EAAA,IAAA,EAAA;IAYnB,IAAA,u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,CAAA"}
@@ -0,0 +1,605 @@
1
+ import { SuccessResultModel } from "./user.js";
2
+ import { ScalarTypeEnum, SchemaModel } from "@contractspec/lib.schema";
3
+ import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
4
+
5
+ //#region src/contracts/organization.ts
6
+ const OWNERS = ["platform.identity-rbac"];
7
+ const OrganizationModel = new SchemaModel({
8
+ name: "Organization",
9
+ description: "Organization details",
10
+ fields: {
11
+ id: {
12
+ type: ScalarTypeEnum.String_unsecure(),
13
+ isOptional: false
14
+ },
15
+ name: {
16
+ type: ScalarTypeEnum.String_unsecure(),
17
+ isOptional: false
18
+ },
19
+ slug: {
20
+ type: ScalarTypeEnum.String_unsecure(),
21
+ isOptional: true
22
+ },
23
+ logo: {
24
+ type: ScalarTypeEnum.URL(),
25
+ isOptional: true
26
+ },
27
+ description: {
28
+ type: ScalarTypeEnum.String_unsecure(),
29
+ isOptional: true
30
+ },
31
+ type: {
32
+ type: ScalarTypeEnum.String_unsecure(),
33
+ isOptional: false
34
+ },
35
+ onboardingCompleted: {
36
+ type: ScalarTypeEnum.Boolean(),
37
+ isOptional: false
38
+ },
39
+ createdAt: {
40
+ type: ScalarTypeEnum.DateTime(),
41
+ isOptional: false
42
+ }
43
+ }
44
+ });
45
+ const MemberUserModel = new SchemaModel({
46
+ name: "MemberUser",
47
+ description: "Basic user info within a member",
48
+ fields: {
49
+ id: {
50
+ type: ScalarTypeEnum.String_unsecure(),
51
+ isOptional: false
52
+ },
53
+ email: {
54
+ type: ScalarTypeEnum.EmailAddress(),
55
+ isOptional: false
56
+ },
57
+ name: {
58
+ type: ScalarTypeEnum.String_unsecure(),
59
+ isOptional: true
60
+ }
61
+ }
62
+ });
63
+ const MemberModel = new SchemaModel({
64
+ name: "Member",
65
+ description: "Organization member",
66
+ fields: {
67
+ id: {
68
+ type: ScalarTypeEnum.String_unsecure(),
69
+ isOptional: false
70
+ },
71
+ userId: {
72
+ type: ScalarTypeEnum.String_unsecure(),
73
+ isOptional: false
74
+ },
75
+ organizationId: {
76
+ type: ScalarTypeEnum.String_unsecure(),
77
+ isOptional: false
78
+ },
79
+ role: {
80
+ type: ScalarTypeEnum.String_unsecure(),
81
+ isOptional: false
82
+ },
83
+ createdAt: {
84
+ type: ScalarTypeEnum.DateTime(),
85
+ isOptional: false
86
+ },
87
+ user: {
88
+ type: MemberUserModel,
89
+ isOptional: false
90
+ }
91
+ }
92
+ });
93
+ const InvitationModel = new SchemaModel({
94
+ name: "Invitation",
95
+ description: "Organization invitation",
96
+ fields: {
97
+ id: {
98
+ type: ScalarTypeEnum.String_unsecure(),
99
+ isOptional: false
100
+ },
101
+ email: {
102
+ type: ScalarTypeEnum.EmailAddress(),
103
+ isOptional: false
104
+ },
105
+ role: {
106
+ type: ScalarTypeEnum.String_unsecure(),
107
+ isOptional: true
108
+ },
109
+ status: {
110
+ type: ScalarTypeEnum.String_unsecure(),
111
+ isOptional: false
112
+ },
113
+ expiresAt: {
114
+ type: ScalarTypeEnum.DateTime(),
115
+ isOptional: true
116
+ },
117
+ createdAt: {
118
+ type: ScalarTypeEnum.DateTime(),
119
+ isOptional: false
120
+ }
121
+ }
122
+ });
123
+ const CreateOrgInputModel = new SchemaModel({
124
+ name: "CreateOrgInput",
125
+ description: "Input for creating an organization",
126
+ fields: {
127
+ name: {
128
+ type: ScalarTypeEnum.NonEmptyString(),
129
+ isOptional: false
130
+ },
131
+ slug: {
132
+ type: ScalarTypeEnum.String_unsecure(),
133
+ isOptional: true
134
+ },
135
+ description: {
136
+ type: ScalarTypeEnum.String_unsecure(),
137
+ isOptional: true
138
+ },
139
+ type: {
140
+ type: ScalarTypeEnum.String_unsecure(),
141
+ isOptional: true
142
+ }
143
+ }
144
+ });
145
+ const GetOrgInputModel = new SchemaModel({
146
+ name: "GetOrgInput",
147
+ description: "Input for getting an organization",
148
+ fields: { orgId: {
149
+ type: ScalarTypeEnum.String_unsecure(),
150
+ isOptional: false
151
+ } }
152
+ });
153
+ const UpdateOrgInputModel = new SchemaModel({
154
+ name: "UpdateOrgInput",
155
+ description: "Input for updating an organization",
156
+ fields: {
157
+ orgId: {
158
+ type: ScalarTypeEnum.String_unsecure(),
159
+ isOptional: false
160
+ },
161
+ name: {
162
+ type: ScalarTypeEnum.String_unsecure(),
163
+ isOptional: true
164
+ },
165
+ slug: {
166
+ type: ScalarTypeEnum.String_unsecure(),
167
+ isOptional: true
168
+ },
169
+ logo: {
170
+ type: ScalarTypeEnum.URL(),
171
+ isOptional: true
172
+ },
173
+ description: {
174
+ type: ScalarTypeEnum.String_unsecure(),
175
+ isOptional: true
176
+ }
177
+ }
178
+ });
179
+ const InviteMemberInputModel = new SchemaModel({
180
+ name: "InviteMemberInput",
181
+ description: "Input for inviting a member",
182
+ fields: {
183
+ orgId: {
184
+ type: ScalarTypeEnum.String_unsecure(),
185
+ isOptional: false
186
+ },
187
+ email: {
188
+ type: ScalarTypeEnum.EmailAddress(),
189
+ isOptional: false
190
+ },
191
+ role: {
192
+ type: ScalarTypeEnum.String_unsecure(),
193
+ isOptional: false
194
+ },
195
+ teamId: {
196
+ type: ScalarTypeEnum.String_unsecure(),
197
+ isOptional: true
198
+ }
199
+ }
200
+ });
201
+ const AcceptInviteInputModel = new SchemaModel({
202
+ name: "AcceptInviteInput",
203
+ description: "Input for accepting an invitation",
204
+ fields: { invitationId: {
205
+ type: ScalarTypeEnum.String_unsecure(),
206
+ isOptional: false
207
+ } }
208
+ });
209
+ const RemoveMemberInputModel = new SchemaModel({
210
+ name: "RemoveMemberInput",
211
+ description: "Input for removing a member",
212
+ fields: {
213
+ orgId: {
214
+ type: ScalarTypeEnum.String_unsecure(),
215
+ isOptional: false
216
+ },
217
+ userId: {
218
+ type: ScalarTypeEnum.String_unsecure(),
219
+ isOptional: false
220
+ }
221
+ }
222
+ });
223
+ const MemberRemovedPayloadModel = new SchemaModel({
224
+ name: "MemberRemovedPayload",
225
+ description: "Payload for member removed event",
226
+ fields: {
227
+ orgId: {
228
+ type: ScalarTypeEnum.String_unsecure(),
229
+ isOptional: false
230
+ },
231
+ userId: {
232
+ type: ScalarTypeEnum.String_unsecure(),
233
+ isOptional: false
234
+ }
235
+ }
236
+ });
237
+ const ListMembersInputModel = new SchemaModel({
238
+ name: "ListMembersInput",
239
+ description: "Input for listing members",
240
+ fields: {
241
+ orgId: {
242
+ type: ScalarTypeEnum.String_unsecure(),
243
+ isOptional: false
244
+ },
245
+ limit: {
246
+ type: ScalarTypeEnum.Int_unsecure(),
247
+ isOptional: true
248
+ },
249
+ offset: {
250
+ type: ScalarTypeEnum.Int_unsecure(),
251
+ isOptional: true
252
+ }
253
+ }
254
+ });
255
+ const ListMembersOutputModel = new SchemaModel({
256
+ name: "ListMembersOutput",
257
+ description: "Output for listing members",
258
+ fields: {
259
+ members: {
260
+ type: MemberModel,
261
+ isOptional: false,
262
+ isArray: true
263
+ },
264
+ total: {
265
+ type: ScalarTypeEnum.Int_unsecure(),
266
+ isOptional: false
267
+ }
268
+ }
269
+ });
270
+ const OrganizationWithRoleModel = new SchemaModel({
271
+ name: "OrganizationWithRole",
272
+ description: "Organization with user role",
273
+ fields: {
274
+ id: {
275
+ type: ScalarTypeEnum.String_unsecure(),
276
+ isOptional: false
277
+ },
278
+ name: {
279
+ type: ScalarTypeEnum.String_unsecure(),
280
+ isOptional: false
281
+ },
282
+ slug: {
283
+ type: ScalarTypeEnum.String_unsecure(),
284
+ isOptional: true
285
+ },
286
+ logo: {
287
+ type: ScalarTypeEnum.URL(),
288
+ isOptional: true
289
+ },
290
+ description: {
291
+ type: ScalarTypeEnum.String_unsecure(),
292
+ isOptional: true
293
+ },
294
+ type: {
295
+ type: ScalarTypeEnum.String_unsecure(),
296
+ isOptional: false
297
+ },
298
+ onboardingCompleted: {
299
+ type: ScalarTypeEnum.Boolean(),
300
+ isOptional: false
301
+ },
302
+ createdAt: {
303
+ type: ScalarTypeEnum.DateTime(),
304
+ isOptional: false
305
+ },
306
+ role: {
307
+ type: ScalarTypeEnum.String_unsecure(),
308
+ isOptional: false
309
+ }
310
+ }
311
+ });
312
+ const ListUserOrgsOutputModel = new SchemaModel({
313
+ name: "ListUserOrgsOutput",
314
+ description: "Output for listing user organizations",
315
+ fields: { organizations: {
316
+ type: OrganizationWithRoleModel,
317
+ isOptional: false,
318
+ isArray: true
319
+ } }
320
+ });
321
+ /**
322
+ * Create a new organization.
323
+ */
324
+ const CreateOrgContract = defineCommand({
325
+ meta: {
326
+ key: "identity.org.create",
327
+ version: "1.0.0",
328
+ stability: "stable",
329
+ owners: [...OWNERS],
330
+ tags: [
331
+ "identity",
332
+ "org",
333
+ "create"
334
+ ],
335
+ description: "Create a new organization.",
336
+ goal: "Allow users to create new organizations/workspaces.",
337
+ context: "Called during onboarding or when creating additional workspaces."
338
+ },
339
+ io: {
340
+ input: CreateOrgInputModel,
341
+ output: OrganizationModel,
342
+ errors: { SLUG_EXISTS: {
343
+ description: "An organization with this slug already exists",
344
+ http: 409,
345
+ gqlCode: "SLUG_EXISTS",
346
+ when: "Slug is already taken"
347
+ } }
348
+ },
349
+ policy: { auth: "user" },
350
+ sideEffects: {
351
+ emits: [{
352
+ key: "org.created",
353
+ version: "1.0.0",
354
+ when: "Organization is created",
355
+ payload: OrganizationModel
356
+ }],
357
+ audit: ["org.created"]
358
+ }
359
+ });
360
+ /**
361
+ * Get organization details.
362
+ */
363
+ const GetOrgContract = defineQuery({
364
+ meta: {
365
+ key: "identity.org.get",
366
+ version: "1.0.0",
367
+ stability: "stable",
368
+ owners: [...OWNERS],
369
+ tags: [
370
+ "identity",
371
+ "org",
372
+ "get"
373
+ ],
374
+ description: "Get organization details.",
375
+ goal: "Retrieve organization information.",
376
+ context: "Called when viewing organization settings or dashboard."
377
+ },
378
+ io: {
379
+ input: GetOrgInputModel,
380
+ output: OrganizationModel
381
+ },
382
+ policy: { auth: "user" }
383
+ });
384
+ /**
385
+ * Update organization.
386
+ */
387
+ const UpdateOrgContract = defineCommand({
388
+ meta: {
389
+ key: "identity.org.update",
390
+ version: "1.0.0",
391
+ stability: "stable",
392
+ owners: [...OWNERS],
393
+ tags: [
394
+ "identity",
395
+ "org",
396
+ "update"
397
+ ],
398
+ description: "Update organization details.",
399
+ goal: "Allow org admins to update organization settings.",
400
+ context: "Organization settings page."
401
+ },
402
+ io: {
403
+ input: UpdateOrgInputModel,
404
+ output: OrganizationModel
405
+ },
406
+ policy: { auth: "user" },
407
+ sideEffects: {
408
+ emits: [{
409
+ key: "org.updated",
410
+ version: "1.0.0",
411
+ when: "Organization is updated",
412
+ payload: OrganizationModel
413
+ }],
414
+ audit: ["org.updated"]
415
+ }
416
+ });
417
+ /**
418
+ * Invite a member to the organization.
419
+ */
420
+ const InviteMemberContract = defineCommand({
421
+ meta: {
422
+ key: "identity.org.invite",
423
+ version: "1.0.0",
424
+ stability: "stable",
425
+ owners: [...OWNERS],
426
+ tags: [
427
+ "identity",
428
+ "org",
429
+ "invite",
430
+ "member"
431
+ ],
432
+ description: "Invite a user to join the organization.",
433
+ goal: "Allow org admins to invite new members.",
434
+ context: "Team management. Sends invitation email."
435
+ },
436
+ io: {
437
+ input: InviteMemberInputModel,
438
+ output: InvitationModel,
439
+ errors: {
440
+ ALREADY_MEMBER: {
441
+ description: "User is already a member of this organization",
442
+ http: 409,
443
+ gqlCode: "ALREADY_MEMBER",
444
+ when: "Invitee is already a member"
445
+ },
446
+ INVITE_PENDING: {
447
+ description: "An invitation for this email is already pending",
448
+ http: 409,
449
+ gqlCode: "INVITE_PENDING",
450
+ when: "Active invitation exists"
451
+ }
452
+ }
453
+ },
454
+ policy: { auth: "user" },
455
+ sideEffects: {
456
+ emits: [{
457
+ key: "org.invite.sent",
458
+ version: "1.0.0",
459
+ when: "Invitation is sent",
460
+ payload: InvitationModel
461
+ }],
462
+ audit: ["org.invite.sent"]
463
+ }
464
+ });
465
+ /**
466
+ * Accept an invitation.
467
+ */
468
+ const AcceptInviteContract = defineCommand({
469
+ meta: {
470
+ key: "identity.org.invite.accept",
471
+ version: "1.0.0",
472
+ stability: "stable",
473
+ owners: [...OWNERS],
474
+ tags: [
475
+ "identity",
476
+ "org",
477
+ "invite",
478
+ "accept"
479
+ ],
480
+ description: "Accept an organization invitation.",
481
+ goal: "Allow users to join organizations via invitation.",
482
+ context: "Called from invitation email link."
483
+ },
484
+ io: {
485
+ input: AcceptInviteInputModel,
486
+ output: MemberModel,
487
+ errors: {
488
+ INVITE_EXPIRED: {
489
+ description: "The invitation has expired",
490
+ http: 410,
491
+ gqlCode: "INVITE_EXPIRED",
492
+ when: "Invitation is past expiry date"
493
+ },
494
+ INVITE_USED: {
495
+ description: "The invitation has already been used",
496
+ http: 409,
497
+ gqlCode: "INVITE_USED",
498
+ when: "Invitation was already accepted"
499
+ }
500
+ }
501
+ },
502
+ policy: { auth: "user" },
503
+ sideEffects: {
504
+ emits: [{
505
+ key: "org.member.added",
506
+ version: "1.0.0",
507
+ when: "Member joins org",
508
+ payload: MemberModel
509
+ }],
510
+ audit: ["org.member.added"]
511
+ }
512
+ });
513
+ /**
514
+ * Remove a member from the organization.
515
+ */
516
+ const RemoveMemberContract = defineCommand({
517
+ meta: {
518
+ key: "identity.org.member.remove",
519
+ version: "1.0.0",
520
+ stability: "stable",
521
+ owners: [...OWNERS],
522
+ tags: [
523
+ "identity",
524
+ "org",
525
+ "member",
526
+ "remove"
527
+ ],
528
+ description: "Remove a member from the organization.",
529
+ goal: "Allow org admins to remove members.",
530
+ context: "Team management."
531
+ },
532
+ io: {
533
+ input: RemoveMemberInputModel,
534
+ output: SuccessResultModel,
535
+ errors: { CANNOT_REMOVE_OWNER: {
536
+ description: "Cannot remove the organization owner",
537
+ http: 403,
538
+ gqlCode: "CANNOT_REMOVE_OWNER",
539
+ when: "Target is the org owner"
540
+ } }
541
+ },
542
+ policy: { auth: "user" },
543
+ sideEffects: {
544
+ emits: [{
545
+ key: "org.member.removed",
546
+ version: "1.0.0",
547
+ when: "Member is removed",
548
+ payload: MemberRemovedPayloadModel
549
+ }],
550
+ audit: ["org.member.removed"]
551
+ }
552
+ });
553
+ /**
554
+ * List organization members.
555
+ */
556
+ const ListMembersContract = defineQuery({
557
+ meta: {
558
+ key: "identity.org.members.list",
559
+ version: "1.0.0",
560
+ stability: "stable",
561
+ owners: [...OWNERS],
562
+ tags: [
563
+ "identity",
564
+ "org",
565
+ "member",
566
+ "list"
567
+ ],
568
+ description: "List organization members.",
569
+ goal: "View all members of an organization.",
570
+ context: "Team management page."
571
+ },
572
+ io: {
573
+ input: ListMembersInputModel,
574
+ output: ListMembersOutputModel
575
+ },
576
+ policy: { auth: "user" }
577
+ });
578
+ /**
579
+ * List user's organizations.
580
+ */
581
+ const ListUserOrgsContract = defineQuery({
582
+ meta: {
583
+ key: "identity.org.list",
584
+ version: "1.0.0",
585
+ stability: "stable",
586
+ owners: [...OWNERS],
587
+ tags: [
588
+ "identity",
589
+ "org",
590
+ "list"
591
+ ],
592
+ description: "List organizations the current user belongs to.",
593
+ goal: "Show user their organizations for workspace switching.",
594
+ context: "Workspace switcher, org selection."
595
+ },
596
+ io: {
597
+ input: null,
598
+ output: ListUserOrgsOutputModel
599
+ },
600
+ policy: { auth: "user" }
601
+ });
602
+
603
+ //#endregion
604
+ export { AcceptInviteContract, AcceptInviteInputModel, CreateOrgContract, CreateOrgInputModel, GetOrgContract, GetOrgInputModel, InvitationModel, InviteMemberContract, InviteMemberInputModel, ListMembersContract, ListMembersInputModel, ListMembersOutputModel, ListUserOrgsContract, ListUserOrgsOutputModel, MemberModel, MemberRemovedPayloadModel, MemberUserModel, OrganizationModel, OrganizationWithRoleModel, RemoveMemberContract, RemoveMemberInputModel, UpdateOrgContract, UpdateOrgInputModel };
605
+ //# sourceMappingURL=organization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.js","names":[],"sources":["../../src/contracts/organization.ts"],"sourcesContent":["import { ScalarTypeEnum, SchemaModel } from '@contractspec/lib.schema';\nimport { defineCommand, defineQuery } from '@contractspec/lib.contracts';\nimport { SuccessResultModel } from './user';\n\nconst OWNERS = ['platform.identity-rbac'] as const;\n\n// ============ SchemaModels ============\n\nexport const OrganizationModel = new SchemaModel({\n name: 'Organization',\n description: 'Organization details',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n logo: { type: ScalarTypeEnum.URL(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // PLATFORM_ADMIN | CONTRACT_SPEC_CUSTOMER\n onboardingCompleted: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const MemberUserModel = new SchemaModel({\n name: 'MemberUser',\n description: 'Basic user info within a member',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nexport const MemberModel = new SchemaModel({\n name: 'Member',\n description: 'Organization member',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n user: { type: MemberUserModel, isOptional: false },\n },\n});\n\nexport const InvitationModel = new SchemaModel({\n name: 'Invitation',\n description: 'Organization invitation',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // pending | accepted | declined | expired\n expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const CreateOrgInputModel = new SchemaModel({\n name: 'CreateOrgInput',\n description: 'Input for creating an organization',\n fields: {\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n type: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nexport const GetOrgInputModel = new SchemaModel({\n name: 'GetOrgInput',\n description: 'Input for getting an organization',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const UpdateOrgInputModel = new SchemaModel({\n name: 'UpdateOrgInput',\n description: 'Input for updating an organization',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n logo: { type: ScalarTypeEnum.URL(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nexport const InviteMemberInputModel = new SchemaModel({\n name: 'InviteMemberInput',\n description: 'Input for inviting a member',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // owner | admin | member\n teamId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nexport const AcceptInviteInputModel = new SchemaModel({\n name: 'AcceptInviteInput',\n description: 'Input for accepting an invitation',\n fields: {\n invitationId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const RemoveMemberInputModel = new SchemaModel({\n name: 'RemoveMemberInput',\n description: 'Input for removing a member',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const MemberRemovedPayloadModel = new SchemaModel({\n name: 'MemberRemovedPayload',\n description: 'Payload for member removed event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const ListMembersInputModel = new SchemaModel({\n name: 'ListMembersInput',\n description: 'Input for listing members',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n offset: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nexport const ListMembersOutputModel = new SchemaModel({\n name: 'ListMembersOutput',\n description: 'Output for listing members',\n fields: {\n members: { type: MemberModel, isOptional: false, isArray: true },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nexport const OrganizationWithRoleModel = new SchemaModel({\n name: 'OrganizationWithRole',\n description: 'Organization with user role',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n logo: { type: ScalarTypeEnum.URL(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n onboardingCompleted: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const ListUserOrgsOutputModel = new SchemaModel({\n name: 'ListUserOrgsOutput',\n description: 'Output for listing user organizations',\n fields: {\n organizations: {\n type: OrganizationWithRoleModel,\n isOptional: false,\n isArray: true,\n },\n },\n});\n\n// ============ Contracts ============\n\n/**\n * Create a new organization.\n */\nexport const CreateOrgContract = defineCommand({\n meta: {\n key: 'identity.org.create',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'create'],\n description: 'Create a new organization.',\n goal: 'Allow users to create new organizations/workspaces.',\n context: 'Called during onboarding or when creating additional workspaces.',\n },\n io: {\n input: CreateOrgInputModel,\n output: OrganizationModel,\n errors: {\n SLUG_EXISTS: {\n description: 'An organization with this slug already exists',\n http: 409,\n gqlCode: 'SLUG_EXISTS',\n when: 'Slug is already taken',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n sideEffects: {\n emits: [\n {\n key: 'org.created',\n version: '1.0.0',\n when: 'Organization is created',\n payload: OrganizationModel,\n },\n ],\n audit: ['org.created'],\n },\n});\n\n/**\n * Get organization details.\n */\nexport const GetOrgContract = defineQuery({\n meta: {\n key: 'identity.org.get',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'get'],\n description: 'Get organization details.',\n goal: 'Retrieve organization information.',\n context: 'Called when viewing organization settings or dashboard.',\n },\n io: {\n input: GetOrgInputModel,\n output: OrganizationModel,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Update organization.\n */\nexport const UpdateOrgContract = defineCommand({\n meta: {\n key: 'identity.org.update',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'update'],\n description: 'Update organization details.',\n goal: 'Allow org admins to update organization settings.',\n context: 'Organization settings page.',\n },\n io: {\n input: UpdateOrgInputModel,\n output: OrganizationModel,\n },\n policy: {\n auth: 'user',\n },\n sideEffects: {\n emits: [\n {\n key: 'org.updated',\n version: '1.0.0',\n when: 'Organization is updated',\n payload: OrganizationModel,\n },\n ],\n audit: ['org.updated'],\n },\n});\n\n/**\n * Invite a member to the organization.\n */\nexport const InviteMemberContract = defineCommand({\n meta: {\n key: 'identity.org.invite',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'invite', 'member'],\n description: 'Invite a user to join the organization.',\n goal: 'Allow org admins to invite new members.',\n context: 'Team management. Sends invitation email.',\n },\n io: {\n input: InviteMemberInputModel,\n output: InvitationModel,\n errors: {\n ALREADY_MEMBER: {\n description: 'User is already a member of this organization',\n http: 409,\n gqlCode: 'ALREADY_MEMBER',\n when: 'Invitee is already a member',\n },\n INVITE_PENDING: {\n description: 'An invitation for this email is already pending',\n http: 409,\n gqlCode: 'INVITE_PENDING',\n when: 'Active invitation exists',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n sideEffects: {\n emits: [\n {\n key: 'org.invite.sent',\n version: '1.0.0',\n when: 'Invitation is sent',\n payload: InvitationModel,\n },\n ],\n audit: ['org.invite.sent'],\n },\n});\n\n/**\n * Accept an invitation.\n */\nexport const AcceptInviteContract = defineCommand({\n meta: {\n key: 'identity.org.invite.accept',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'invite', 'accept'],\n description: 'Accept an organization invitation.',\n goal: 'Allow users to join organizations via invitation.',\n context: 'Called from invitation email link.',\n },\n io: {\n input: AcceptInviteInputModel,\n output: MemberModel,\n errors: {\n INVITE_EXPIRED: {\n description: 'The invitation has expired',\n http: 410,\n gqlCode: 'INVITE_EXPIRED',\n when: 'Invitation is past expiry date',\n },\n INVITE_USED: {\n description: 'The invitation has already been used',\n http: 409,\n gqlCode: 'INVITE_USED',\n when: 'Invitation was already accepted',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n sideEffects: {\n emits: [\n {\n key: 'org.member.added',\n version: '1.0.0',\n when: 'Member joins org',\n payload: MemberModel,\n },\n ],\n audit: ['org.member.added'],\n },\n});\n\n/**\n * Remove a member from the organization.\n */\nexport const RemoveMemberContract = defineCommand({\n meta: {\n key: 'identity.org.member.remove',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'member', 'remove'],\n description: 'Remove a member from the organization.',\n goal: 'Allow org admins to remove members.',\n context: 'Team management.',\n },\n io: {\n input: RemoveMemberInputModel,\n output: SuccessResultModel,\n errors: {\n CANNOT_REMOVE_OWNER: {\n description: 'Cannot remove the organization owner',\n http: 403,\n gqlCode: 'CANNOT_REMOVE_OWNER',\n when: 'Target is the org owner',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n sideEffects: {\n emits: [\n {\n key: 'org.member.removed',\n version: '1.0.0',\n when: 'Member is removed',\n payload: MemberRemovedPayloadModel,\n },\n ],\n audit: ['org.member.removed'],\n },\n});\n\n/**\n * List organization members.\n */\nexport const ListMembersContract = defineQuery({\n meta: {\n key: 'identity.org.members.list',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'member', 'list'],\n description: 'List organization members.',\n goal: 'View all members of an organization.',\n context: 'Team management page.',\n },\n io: {\n input: ListMembersInputModel,\n output: ListMembersOutputModel,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * List user's organizations.\n */\nexport const ListUserOrgsContract = defineQuery({\n meta: {\n key: 'identity.org.list',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'list'],\n description: 'List organizations the current user belongs to.',\n goal: 'Show user their organizations for workspace switching.',\n context: 'Workspace switcher, org selection.',\n },\n io: {\n input: null,\n output: ListUserOrgsOutputModel,\n },\n policy: {\n auth: 'user',\n },\n});\n"],"mappings":";;;;;AAIA,MAAM,SAAS,CAAC,yBAAyB;AAIzC,MAAa,oBAAoB,IAAI,YAAY;CAC/C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EAClE,MAAM;GAAE,MAAM,eAAe,KAAK;GAAE,YAAY;GAAM;EACtD,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;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