@lssm/lib.identity-rbac 0.0.0-canary-20251217063201 → 0.0.0-canary-20251217073102

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 (143) hide show
  1. package/dist/contracts/dist/capabilities/openbanking.js +88 -1
  2. package/dist/contracts/dist/client/index.js +5 -1
  3. package/dist/contracts/dist/client/react/feature-render.js +2 -1
  4. package/dist/contracts/dist/client/react/form-render.js +4 -1
  5. package/dist/contracts/dist/client/react/index.js +4 -1
  6. package/dist/contracts/dist/contract-registry/index.js +1 -1
  7. package/dist/contracts/dist/contract-registry/schemas.js +60 -1
  8. package/dist/contracts/dist/docs/PUBLISHING.docblock.js +16 -76
  9. package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -350
  10. package/dist/contracts/dist/docs/index.js +29 -1
  11. package/dist/contracts/dist/docs/presentations.js +71 -1
  12. package/dist/contracts/dist/docs/registry.js +44 -1
  13. package/dist/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -383
  14. package/dist/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -68
  15. package/dist/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -140
  16. package/dist/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -86
  17. package/dist/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -1
  18. package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +24 -2
  19. package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +21 -2
  20. package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -213
  21. package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js +73 -5
  22. package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -1
  23. package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -1
  24. package/dist/contracts/dist/docs/tech/schema/README.docblock.js +20 -262
  25. package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -1
  26. package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +24 -2
  27. package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +23 -2
  28. package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +25 -16
  29. package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -1
  30. package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +22 -2
  31. package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js +40 -36
  32. package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -1
  33. package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js +23 -2
  34. package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js +36 -3
  35. package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -1
  36. package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js +36 -3
  37. package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -1
  38. package/dist/contracts/dist/events.js +10 -1
  39. package/dist/contracts/dist/experiments/evaluator.js +1 -1
  40. package/dist/contracts/dist/index.js +71 -1
  41. package/dist/contracts/dist/install.js +2 -1
  42. package/dist/contracts/dist/integrations/contracts.js +377 -1
  43. package/dist/contracts/dist/integrations/index.js +18 -1
  44. package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js +228 -1
  45. package/dist/contracts/dist/integrations/openbanking/contracts/balances.js +159 -1
  46. package/dist/contracts/dist/integrations/openbanking/contracts/index.js +3 -1
  47. package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js +210 -1
  48. package/dist/contracts/dist/integrations/openbanking/models.js +242 -1
  49. package/dist/contracts/dist/integrations/openbanking/telemetry.js +13 -1
  50. package/dist/contracts/dist/integrations/providers/elevenlabs.js +52 -1
  51. package/dist/contracts/dist/integrations/providers/gcs-storage.js +75 -1
  52. package/dist/contracts/dist/integrations/providers/gmail.js +87 -1
  53. package/dist/contracts/dist/integrations/providers/google-calendar.js +66 -1
  54. package/dist/contracts/dist/integrations/providers/index.js +11 -1
  55. package/dist/contracts/dist/integrations/providers/mistral.js +68 -1
  56. package/dist/contracts/dist/integrations/providers/postmark.js +68 -1
  57. package/dist/contracts/dist/integrations/providers/powens.js +116 -1
  58. package/dist/contracts/dist/integrations/providers/qdrant.js +73 -1
  59. package/dist/contracts/dist/integrations/providers/registry.js +10 -1
  60. package/dist/contracts/dist/integrations/providers/stripe.js +83 -1
  61. package/dist/contracts/dist/integrations/providers/twilio-sms.js +61 -1
  62. package/dist/contracts/dist/jsonschema.js +1 -1
  63. package/dist/contracts/dist/knowledge/contracts.js +306 -1
  64. package/dist/contracts/dist/knowledge/index.js +7 -1
  65. package/dist/contracts/dist/knowledge/spaces/email-threads.js +34 -1
  66. package/dist/contracts/dist/knowledge/spaces/financial-docs.js +34 -1
  67. package/dist/contracts/dist/knowledge/spaces/financial-overview.js +38 -1
  68. package/dist/contracts/dist/knowledge/spaces/index.js +6 -1
  69. package/dist/contracts/dist/knowledge/spaces/product-canon.js +34 -1
  70. package/dist/contracts/dist/knowledge/spaces/support-faq.js +37 -1
  71. package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -1
  72. package/dist/contracts/dist/llm/exporters.js +19 -1
  73. package/dist/contracts/dist/llm/index.js +2 -1
  74. package/dist/contracts/dist/llm/prompts.js +1 -1
  75. package/dist/contracts/dist/onboarding-base.js +196 -1
  76. package/dist/contracts/dist/openapi.js +1 -1
  77. package/dist/contracts/dist/ownership.js +21 -1
  78. package/dist/contracts/dist/presentations.js +1 -1
  79. package/dist/contracts/dist/presentations.v2.js +11 -1
  80. package/dist/contracts/dist/prompt.js +1 -1
  81. package/dist/contracts/dist/promptRegistry.js +1 -1
  82. package/dist/contracts/dist/regenerator/index.js +1 -1
  83. package/dist/contracts/dist/regenerator/service.js +6 -1
  84. package/dist/contracts/dist/registry.js +2 -1
  85. package/dist/contracts/dist/resources.js +1 -1
  86. package/dist/contracts/dist/schema/dist/EnumType.js +2 -1
  87. package/dist/contracts/dist/schema/dist/FieldType.js +49 -1
  88. package/dist/contracts/dist/schema/dist/ScalarTypeEnum.js +236 -1
  89. package/dist/contracts/dist/schema/dist/SchemaModel.js +34 -1
  90. package/dist/contracts/dist/schema/dist/entity/defineEntity.js +1 -1
  91. package/dist/contracts/dist/schema/dist/entity/index.js +2 -1
  92. package/dist/contracts/dist/schema/dist/entity/types.js +1 -1
  93. package/dist/contracts/dist/schema/dist/index.js +6 -1
  94. package/dist/contracts/dist/server/graphql-pothos.js +6 -1
  95. package/dist/contracts/dist/server/index.js +8 -1
  96. package/dist/contracts/dist/server/mcp/createMcpServer.js +4 -1
  97. package/dist/contracts/dist/server/mcp/registerPresentations.js +2 -1
  98. package/dist/contracts/dist/server/mcp/registerPrompts.js +1 -1
  99. package/dist/contracts/dist/server/mcp/registerResources.js +2 -1
  100. package/dist/contracts/dist/server/mcp/registerTools.js +1 -1
  101. package/dist/contracts/dist/server/provider-mcp.js +1 -1
  102. package/dist/contracts/dist/server/rest-elysia.js +1 -1
  103. package/dist/contracts/dist/server/rest-express.js +1 -1
  104. package/dist/contracts/dist/server/rest-generic.js +1 -1
  105. package/dist/contracts/dist/server/rest-next-app.js +1 -1
  106. package/dist/contracts/dist/server/rest-next-pages.js +1 -1
  107. package/dist/contracts/dist/spec.js +34 -1
  108. package/dist/contracts/dist/telemetry/index.js +1 -1
  109. package/dist/contracts/dist/telemetry/tracker.js +1 -1
  110. package/dist/contracts/dist/tests/index.js +1 -1
  111. package/dist/contracts/dist/tests/runner.js +2 -1
  112. package/dist/contracts/dist/workflow/index.js +1 -1
  113. package/dist/contracts/dist/workflow/runner.js +1 -1
  114. package/dist/contracts/index.js +5 -1
  115. package/dist/contracts/organization.d.ts +193 -193
  116. package/dist/contracts/organization.js +607 -1
  117. package/dist/contracts/rbac.d.ts +126 -126
  118. package/dist/contracts/rbac.js +487 -1
  119. package/dist/contracts/user.d.ts +139 -139
  120. package/dist/contracts/user.js +335 -1
  121. package/dist/entities/index.d.ts +160 -160
  122. package/dist/entities/index.js +35 -1
  123. package/dist/entities/organization.d.ts +59 -59
  124. package/dist/entities/organization.js +151 -1
  125. package/dist/entities/rbac.d.ts +63 -63
  126. package/dist/entities/rbac.js +138 -1
  127. package/dist/entities/user.d.ts +67 -67
  128. package/dist/entities/user.js +194 -1
  129. package/dist/events.d.ts +174 -174
  130. package/dist/events.js +543 -1
  131. package/dist/identity-rbac.feature.js +186 -1
  132. package/dist/index.js +14 -1
  133. package/dist/policies/engine.js +167 -1
  134. package/dist/policies/index.js +3 -1
  135. package/dist/schema/dist/EnumType.js +2 -1
  136. package/dist/schema/dist/FieldType.js +49 -1
  137. package/dist/schema/dist/ScalarTypeEnum.js +236 -1
  138. package/dist/schema/dist/SchemaModel.js +34 -1
  139. package/dist/schema/dist/entity/defineEntity.js +236 -1
  140. package/dist/schema/dist/entity/index.js +2 -1
  141. package/dist/schema/dist/entity/types.js +1 -1
  142. package/dist/schema/dist/index.js +6 -1
  143. package/package.json +5 -5
@@ -1 +1,335 @@
1
- import{l as e}from"../schema/dist/ScalarTypeEnum.js";import{t}from"../schema/dist/SchemaModel.js";import"../schema/dist/index.js";import{n,t as r}from"./dist/spec.js";import"./dist/index.js";const i=[`platform.identity-rbac`],a=new t({name:`UserProfile`,description:`User profile information`,fields:{id:{type:e.String_unsecure(),isOptional:!1},email:{type:e.EmailAddress(),isOptional:!1},emailVerified:{type:e.Boolean(),isOptional:!1},name:{type:e.String_unsecure(),isOptional:!0},firstName:{type:e.String_unsecure(),isOptional:!0},lastName:{type:e.String_unsecure(),isOptional:!0},locale:{type:e.String_unsecure(),isOptional:!0},timezone:{type:e.String_unsecure(),isOptional:!0},imageUrl:{type:e.URL(),isOptional:!0},role:{type:e.String_unsecure(),isOptional:!0},onboardingCompleted:{type:e.Boolean(),isOptional:!1},createdAt:{type:e.DateTime(),isOptional:!1}}}),o=new t({name:`CreateUserInput`,description:`Input for creating a new user`,fields:{email:{type:e.EmailAddress(),isOptional:!1},name:{type:e.String_unsecure(),isOptional:!0},firstName:{type:e.String_unsecure(),isOptional:!0},lastName:{type:e.String_unsecure(),isOptional:!0},password:{type:e.String_unsecure(),isOptional:!0}}}),s=new t({name:`UpdateUserInput`,description:`Input for updating a user profile`,fields:{name:{type:e.String_unsecure(),isOptional:!0},firstName:{type:e.String_unsecure(),isOptional:!0},lastName:{type:e.String_unsecure(),isOptional:!0},locale:{type:e.String_unsecure(),isOptional:!0},timezone:{type:e.String_unsecure(),isOptional:!0},imageUrl:{type:e.URL(),isOptional:!0}}}),c=new t({name:`DeleteUserInput`,description:`Input for deleting a user`,fields:{confirmEmail:{type:e.EmailAddress(),isOptional:!1}}}),l=new t({name:`SuccessResult`,description:`Simple success result`,fields:{success:{type:e.Boolean(),isOptional:!1}}}),u=new t({name:`UserDeletedPayload`,description:`Payload for user deleted event`,fields:{userId:{type:e.String_unsecure(),isOptional:!1}}}),d=new t({name:`ListUsersInput`,description:`Input for listing users`,fields:{limit:{type:e.Int_unsecure(),isOptional:!0},offset:{type:e.Int_unsecure(),isOptional:!0},search:{type:e.String_unsecure(),isOptional:!0}}}),f=new t({name:`ListUsersOutput`,description:`Output for listing users`,fields:{users:{type:a,isOptional:!1,isArray:!0},total:{type:e.Int_unsecure(),isOptional:!1}}}),p=r({meta:{name:`identity.user.create`,version:1,stability:`stable`,owners:[...i],tags:[`identity`,`user`,`create`],description:`Create a new user account.`,goal:`Register a new user in the system.`,context:`Used during signup flows. May trigger email verification.`},io:{input:o,output:a,errors:{EMAIL_EXISTS:{description:`A user with this email already exists`,http:409,gqlCode:`EMAIL_EXISTS`,when:`Email is already registered`}}},policy:{auth:`anonymous`},sideEffects:{emits:[{name:`user.created`,version:1,when:`User is successfully created`,payload:a}],audit:[`user.created`]}}),m=n({meta:{name:`identity.user.me`,version:1,stability:`stable`,owners:[...i],tags:[`identity`,`user`,`profile`],description:`Get the current authenticated user profile.`,goal:`Retrieve user profile for the authenticated session.`,context:`Called on app load and after profile updates.`},io:{input:null,output:a},policy:{auth:`user`}}),h=r({meta:{name:`identity.user.update`,version:1,stability:`stable`,owners:[...i],tags:[`identity`,`user`,`update`],description:`Update user profile information.`,goal:`Allow users to update their profile.`,context:`Self-service profile updates.`},io:{input:s,output:a},policy:{auth:`user`},sideEffects:{emits:[{name:`user.updated`,version:1,when:`User profile is updated`,payload:a}],audit:[`user.updated`]}}),g=r({meta:{name:`identity.user.delete`,version:1,stability:`stable`,owners:[...i],tags:[`identity`,`user`,`delete`],description:`Delete user account and all associated data.`,goal:`Allow users to delete their account (GDPR compliance).`,context:`Self-service account deletion. Cascades to memberships, sessions, etc.`},io:{input:c,output:l},policy:{auth:`user`,escalate:`human_review`},sideEffects:{emits:[{name:`user.deleted`,version:1,when:`User account is deleted`,payload:u}],audit:[`user.deleted`]}}),_=n({meta:{name:`identity.user.list`,version:1,stability:`stable`,owners:[...i],tags:[`identity`,`user`,`admin`,`list`],description:`List all users (admin only).`,goal:`Allow admins to browse and manage users.`,context:`Admin dashboard user management.`},io:{input:d,output:f},policy:{auth:`admin`}});export{p as CreateUserContract,o as CreateUserInputModel,g as DeleteUserContract,c as DeleteUserInputModel,m as GetCurrentUserContract,_ as ListUsersContract,d as ListUsersInputModel,f as ListUsersOutputModel,l as SuccessResultModel,h as UpdateUserContract,s as UpdateUserInputModel,u as UserDeletedPayloadModel,a as UserProfileModel};
1
+ import { ScalarTypeEnum } from "../schema/dist/ScalarTypeEnum.js";
2
+ import { SchemaModel } from "../schema/dist/SchemaModel.js";
3
+ import "../schema/dist/index.js";
4
+ import { defineCommand, defineQuery } from "./dist/spec.js";
5
+ import "./dist/index.js";
6
+
7
+ //#region src/contracts/user.ts
8
+ const OWNERS = ["platform.identity-rbac"];
9
+ const UserProfileModel = new SchemaModel({
10
+ name: "UserProfile",
11
+ description: "User profile information",
12
+ fields: {
13
+ id: {
14
+ type: ScalarTypeEnum.String_unsecure(),
15
+ isOptional: false
16
+ },
17
+ email: {
18
+ type: ScalarTypeEnum.EmailAddress(),
19
+ isOptional: false
20
+ },
21
+ emailVerified: {
22
+ type: ScalarTypeEnum.Boolean(),
23
+ isOptional: false
24
+ },
25
+ name: {
26
+ type: ScalarTypeEnum.String_unsecure(),
27
+ isOptional: true
28
+ },
29
+ firstName: {
30
+ type: ScalarTypeEnum.String_unsecure(),
31
+ isOptional: true
32
+ },
33
+ lastName: {
34
+ type: ScalarTypeEnum.String_unsecure(),
35
+ isOptional: true
36
+ },
37
+ locale: {
38
+ type: ScalarTypeEnum.String_unsecure(),
39
+ isOptional: true
40
+ },
41
+ timezone: {
42
+ type: ScalarTypeEnum.String_unsecure(),
43
+ isOptional: true
44
+ },
45
+ imageUrl: {
46
+ type: ScalarTypeEnum.URL(),
47
+ isOptional: true
48
+ },
49
+ role: {
50
+ type: ScalarTypeEnum.String_unsecure(),
51
+ isOptional: true
52
+ },
53
+ onboardingCompleted: {
54
+ type: ScalarTypeEnum.Boolean(),
55
+ isOptional: false
56
+ },
57
+ createdAt: {
58
+ type: ScalarTypeEnum.DateTime(),
59
+ isOptional: false
60
+ }
61
+ }
62
+ });
63
+ const CreateUserInputModel = new SchemaModel({
64
+ name: "CreateUserInput",
65
+ description: "Input for creating a new user",
66
+ fields: {
67
+ email: {
68
+ type: ScalarTypeEnum.EmailAddress(),
69
+ isOptional: false
70
+ },
71
+ name: {
72
+ type: ScalarTypeEnum.String_unsecure(),
73
+ isOptional: true
74
+ },
75
+ firstName: {
76
+ type: ScalarTypeEnum.String_unsecure(),
77
+ isOptional: true
78
+ },
79
+ lastName: {
80
+ type: ScalarTypeEnum.String_unsecure(),
81
+ isOptional: true
82
+ },
83
+ password: {
84
+ type: ScalarTypeEnum.String_unsecure(),
85
+ isOptional: true
86
+ }
87
+ }
88
+ });
89
+ const UpdateUserInputModel = new SchemaModel({
90
+ name: "UpdateUserInput",
91
+ description: "Input for updating a user profile",
92
+ fields: {
93
+ name: {
94
+ type: ScalarTypeEnum.String_unsecure(),
95
+ isOptional: true
96
+ },
97
+ firstName: {
98
+ type: ScalarTypeEnum.String_unsecure(),
99
+ isOptional: true
100
+ },
101
+ lastName: {
102
+ type: ScalarTypeEnum.String_unsecure(),
103
+ isOptional: true
104
+ },
105
+ locale: {
106
+ type: ScalarTypeEnum.String_unsecure(),
107
+ isOptional: true
108
+ },
109
+ timezone: {
110
+ type: ScalarTypeEnum.String_unsecure(),
111
+ isOptional: true
112
+ },
113
+ imageUrl: {
114
+ type: ScalarTypeEnum.URL(),
115
+ isOptional: true
116
+ }
117
+ }
118
+ });
119
+ const DeleteUserInputModel = new SchemaModel({
120
+ name: "DeleteUserInput",
121
+ description: "Input for deleting a user",
122
+ fields: { confirmEmail: {
123
+ type: ScalarTypeEnum.EmailAddress(),
124
+ isOptional: false
125
+ } }
126
+ });
127
+ const SuccessResultModel = new SchemaModel({
128
+ name: "SuccessResult",
129
+ description: "Simple success result",
130
+ fields: { success: {
131
+ type: ScalarTypeEnum.Boolean(),
132
+ isOptional: false
133
+ } }
134
+ });
135
+ const UserDeletedPayloadModel = new SchemaModel({
136
+ name: "UserDeletedPayload",
137
+ description: "Payload for user deleted event",
138
+ fields: { userId: {
139
+ type: ScalarTypeEnum.String_unsecure(),
140
+ isOptional: false
141
+ } }
142
+ });
143
+ const ListUsersInputModel = new SchemaModel({
144
+ name: "ListUsersInput",
145
+ description: "Input for listing users",
146
+ fields: {
147
+ limit: {
148
+ type: ScalarTypeEnum.Int_unsecure(),
149
+ isOptional: true
150
+ },
151
+ offset: {
152
+ type: ScalarTypeEnum.Int_unsecure(),
153
+ isOptional: true
154
+ },
155
+ search: {
156
+ type: ScalarTypeEnum.String_unsecure(),
157
+ isOptional: true
158
+ }
159
+ }
160
+ });
161
+ const ListUsersOutputModel = new SchemaModel({
162
+ name: "ListUsersOutput",
163
+ description: "Output for listing users",
164
+ fields: {
165
+ users: {
166
+ type: UserProfileModel,
167
+ isOptional: false,
168
+ isArray: true
169
+ },
170
+ total: {
171
+ type: ScalarTypeEnum.Int_unsecure(),
172
+ isOptional: false
173
+ }
174
+ }
175
+ });
176
+ /**
177
+ * Create a new user account.
178
+ */
179
+ const CreateUserContract = defineCommand({
180
+ meta: {
181
+ name: "identity.user.create",
182
+ version: 1,
183
+ stability: "stable",
184
+ owners: [...OWNERS],
185
+ tags: [
186
+ "identity",
187
+ "user",
188
+ "create"
189
+ ],
190
+ description: "Create a new user account.",
191
+ goal: "Register a new user in the system.",
192
+ context: "Used during signup flows. May trigger email verification."
193
+ },
194
+ io: {
195
+ input: CreateUserInputModel,
196
+ output: UserProfileModel,
197
+ errors: { EMAIL_EXISTS: {
198
+ description: "A user with this email already exists",
199
+ http: 409,
200
+ gqlCode: "EMAIL_EXISTS",
201
+ when: "Email is already registered"
202
+ } }
203
+ },
204
+ policy: { auth: "anonymous" },
205
+ sideEffects: {
206
+ emits: [{
207
+ name: "user.created",
208
+ version: 1,
209
+ when: "User is successfully created",
210
+ payload: UserProfileModel
211
+ }],
212
+ audit: ["user.created"]
213
+ }
214
+ });
215
+ /**
216
+ * Get the current user's profile.
217
+ */
218
+ const GetCurrentUserContract = defineQuery({
219
+ meta: {
220
+ name: "identity.user.me",
221
+ version: 1,
222
+ stability: "stable",
223
+ owners: [...OWNERS],
224
+ tags: [
225
+ "identity",
226
+ "user",
227
+ "profile"
228
+ ],
229
+ description: "Get the current authenticated user profile.",
230
+ goal: "Retrieve user profile for the authenticated session.",
231
+ context: "Called on app load and after profile updates."
232
+ },
233
+ io: {
234
+ input: null,
235
+ output: UserProfileModel
236
+ },
237
+ policy: { auth: "user" }
238
+ });
239
+ /**
240
+ * Update user profile.
241
+ */
242
+ const UpdateUserContract = defineCommand({
243
+ meta: {
244
+ name: "identity.user.update",
245
+ version: 1,
246
+ stability: "stable",
247
+ owners: [...OWNERS],
248
+ tags: [
249
+ "identity",
250
+ "user",
251
+ "update"
252
+ ],
253
+ description: "Update user profile information.",
254
+ goal: "Allow users to update their profile.",
255
+ context: "Self-service profile updates."
256
+ },
257
+ io: {
258
+ input: UpdateUserInputModel,
259
+ output: UserProfileModel
260
+ },
261
+ policy: { auth: "user" },
262
+ sideEffects: {
263
+ emits: [{
264
+ name: "user.updated",
265
+ version: 1,
266
+ when: "User profile is updated",
267
+ payload: UserProfileModel
268
+ }],
269
+ audit: ["user.updated"]
270
+ }
271
+ });
272
+ /**
273
+ * Delete user account.
274
+ */
275
+ const DeleteUserContract = defineCommand({
276
+ meta: {
277
+ name: "identity.user.delete",
278
+ version: 1,
279
+ stability: "stable",
280
+ owners: [...OWNERS],
281
+ tags: [
282
+ "identity",
283
+ "user",
284
+ "delete"
285
+ ],
286
+ description: "Delete user account and all associated data.",
287
+ goal: "Allow users to delete their account (GDPR compliance).",
288
+ context: "Self-service account deletion. Cascades to memberships, sessions, etc."
289
+ },
290
+ io: {
291
+ input: DeleteUserInputModel,
292
+ output: SuccessResultModel
293
+ },
294
+ policy: {
295
+ auth: "user",
296
+ escalate: "human_review"
297
+ },
298
+ sideEffects: {
299
+ emits: [{
300
+ name: "user.deleted",
301
+ version: 1,
302
+ when: "User account is deleted",
303
+ payload: UserDeletedPayloadModel
304
+ }],
305
+ audit: ["user.deleted"]
306
+ }
307
+ });
308
+ /**
309
+ * List users (admin only).
310
+ */
311
+ const ListUsersContract = defineQuery({
312
+ meta: {
313
+ name: "identity.user.list",
314
+ version: 1,
315
+ stability: "stable",
316
+ owners: [...OWNERS],
317
+ tags: [
318
+ "identity",
319
+ "user",
320
+ "admin",
321
+ "list"
322
+ ],
323
+ description: "List all users (admin only).",
324
+ goal: "Allow admins to browse and manage users.",
325
+ context: "Admin dashboard user management."
326
+ },
327
+ io: {
328
+ input: ListUsersInputModel,
329
+ output: ListUsersOutputModel
330
+ },
331
+ policy: { auth: "admin" }
332
+ });
333
+
334
+ //#endregion
335
+ export { CreateUserContract, CreateUserInputModel, DeleteUserContract, DeleteUserInputModel, GetCurrentUserContract, ListUsersContract, ListUsersInputModel, ListUsersOutputModel, SuccessResultModel, UpdateUserContract, UpdateUserInputModel, UserDeletedPayloadModel, UserProfileModel };