@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.
- package/dist/browser/contracts/index.js +1045 -0
- package/dist/browser/contracts/organization.js +655 -0
- package/dist/browser/contracts/rbac.js +599 -0
- package/dist/browser/contracts/user.js +235 -0
- package/dist/browser/entities/index.js +464 -0
- package/dist/browser/entities/organization.js +150 -0
- package/dist/browser/entities/rbac.js +124 -0
- package/dist/browser/entities/user.js +168 -0
- package/dist/browser/events.js +374 -0
- package/dist/browser/identity-rbac.capability.js +28 -0
- package/dist/browser/identity-rbac.feature.js +67 -0
- package/dist/browser/index.js +2099 -0
- package/dist/browser/policies/engine.js +154 -0
- package/dist/browser/policies/index.js +154 -0
- package/dist/contracts/index.d.ts +4 -4
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +1045 -4
- package/dist/contracts/organization.d.ts +758 -764
- package/dist/contracts/organization.d.ts.map +1 -1
- package/dist/contracts/organization.js +653 -602
- package/dist/contracts/rbac.d.ts +517 -523
- package/dist/contracts/rbac.d.ts.map +1 -1
- package/dist/contracts/rbac.js +597 -481
- package/dist/contracts/user.d.ts +513 -519
- package/dist/contracts/user.d.ts.map +1 -1
- package/dist/contracts/user.js +222 -319
- package/dist/entities/index.d.ts +164 -169
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +462 -33
- package/dist/entities/organization.d.ts +58 -63
- package/dist/entities/organization.d.ts.map +1 -1
- package/dist/entities/organization.js +145 -145
- package/dist/entities/rbac.d.ts +62 -67
- package/dist/entities/rbac.d.ts.map +1 -1
- package/dist/entities/rbac.js +119 -132
- package/dist/entities/user.d.ts +66 -71
- package/dist/entities/user.d.ts.map +1 -1
- package/dist/entities/user.js +164 -189
- package/dist/events.d.ts +537 -543
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +343 -651
- package/dist/identity-rbac.capability.d.ts +2 -7
- package/dist/identity-rbac.capability.d.ts.map +1 -1
- package/dist/identity-rbac.capability.js +29 -29
- package/dist/identity-rbac.feature.d.ts +1 -7
- package/dist/identity-rbac.feature.d.ts.map +1 -1
- package/dist/identity-rbac.feature.js +66 -193
- package/dist/index.d.ts +6 -12
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2100 -14
- package/dist/node/contracts/index.js +1045 -0
- package/dist/node/contracts/organization.js +655 -0
- package/dist/node/contracts/rbac.js +599 -0
- package/dist/node/contracts/user.js +235 -0
- package/dist/node/entities/index.js +464 -0
- package/dist/node/entities/organization.js +150 -0
- package/dist/node/entities/rbac.js +124 -0
- package/dist/node/entities/user.js +168 -0
- package/dist/node/events.js +374 -0
- package/dist/node/identity-rbac.capability.js +28 -0
- package/dist/node/identity-rbac.feature.js +67 -0
- package/dist/node/index.js +2099 -0
- package/dist/node/policies/engine.js +154 -0
- package/dist/node/policies/index.js +154 -0
- package/dist/policies/engine.d.ts +98 -101
- package/dist/policies/engine.d.ts.map +1 -1
- package/dist/policies/engine.js +151 -164
- package/dist/policies/index.d.ts +2 -2
- package/dist/policies/index.d.ts.map +1 -0
- package/dist/policies/index.js +154 -2
- package/package.json +149 -40
- package/dist/contracts/organization.js.map +0 -1
- package/dist/contracts/rbac.js.map +0 -1
- package/dist/contracts/user.js.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/entities/organization.js.map +0 -1
- package/dist/entities/rbac.js.map +0 -1
- package/dist/entities/user.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/identity-rbac.capability.js.map +0 -1
- package/dist/identity-rbac.feature.js.map +0 -1
- package/dist/policies/engine.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/contracts/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,0BAA0B,CAAC;AAOvE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;EAU/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;EAW/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;EAM/B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;EAM7B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;EAMlC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;EAQ9B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO/B,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqC7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkBjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6B7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;IA+B7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkB5B,CAAC"}
|
package/dist/contracts/user.js
CHANGED
|
@@ -1,333 +1,236 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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
|
+
};
|