@contractspec/lib.identity-rbac 1.44.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/LICENSE +21 -0
- package/README.md +102 -0
- package/dist/contracts/index.d.ts +4 -0
- package/dist/contracts/index.js +5 -0
- package/dist/contracts/organization.d.ts +896 -0
- package/dist/contracts/organization.d.ts.map +1 -0
- package/dist/contracts/organization.js +605 -0
- package/dist/contracts/organization.js.map +1 -0
- package/dist/contracts/rbac.d.ts +612 -0
- package/dist/contracts/rbac.d.ts.map +1 -0
- package/dist/contracts/rbac.js +484 -0
- package/dist/contracts/rbac.js.map +1 -0
- package/dist/contracts/user.d.ts +611 -0
- package/dist/contracts/user.d.ts.map +1 -0
- package/dist/contracts/user.js +333 -0
- package/dist/contracts/user.js.map +1 -0
- package/dist/entities/index.d.ts +177 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +36 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/organization.d.ts +87 -0
- package/dist/entities/organization.d.ts.map +1 -0
- package/dist/entities/organization.js +151 -0
- package/dist/entities/organization.js.map +1 -0
- package/dist/entities/rbac.d.ts +88 -0
- package/dist/entities/rbac.d.ts.map +1 -0
- package/dist/entities/rbac.js +138 -0
- package/dist/entities/rbac.js.map +1 -0
- package/dist/entities/user.d.ts +88 -0
- package/dist/entities/user.d.ts.map +1 -0
- package/dist/entities/user.js +194 -0
- package/dist/entities/user.js.map +1 -0
- package/dist/events.d.ts +690 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +683 -0
- package/dist/events.js.map +1 -0
- package/dist/identity-rbac.feature.d.ts +12 -0
- package/dist/identity-rbac.feature.d.ts.map +1 -0
- package/dist/identity-rbac.feature.js +188 -0
- package/dist/identity-rbac.feature.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +14 -0
- package/dist/policies/engine.d.ts +133 -0
- package/dist/policies/engine.d.ts.map +1 -0
- package/dist/policies/engine.js +168 -0
- package/dist/policies/engine.js.map +1 -0
- package/dist/policies/index.d.ts +2 -0
- package/dist/policies/index.js +3 -0
- package/package.json +78 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { ScalarTypeEnum, SchemaModel } from "@contractspec/lib.schema";
|
|
2
|
+
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
|
+
}
|
|
59
|
+
});
|
|
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
|
+
}
|
|
85
|
+
});
|
|
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
|
+
}
|
|
115
|
+
});
|
|
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
|
+
} }
|
|
123
|
+
});
|
|
124
|
+
const SuccessResultModel = new SchemaModel({
|
|
125
|
+
name: "SuccessResult",
|
|
126
|
+
description: "Simple success result",
|
|
127
|
+
fields: { success: {
|
|
128
|
+
type: ScalarTypeEnum.Boolean(),
|
|
129
|
+
isOptional: false
|
|
130
|
+
} }
|
|
131
|
+
});
|
|
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
|
+
} }
|
|
139
|
+
});
|
|
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
|
+
}
|
|
157
|
+
});
|
|
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
|
+
}
|
|
172
|
+
});
|
|
173
|
+
/**
|
|
174
|
+
* Create a new user account.
|
|
175
|
+
*/
|
|
176
|
+
const CreateUserContract = defineCommand({
|
|
177
|
+
meta: {
|
|
178
|
+
key: "identity.user.create",
|
|
179
|
+
version: 1,
|
|
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,
|
|
206
|
+
when: "User is successfully created",
|
|
207
|
+
payload: UserProfileModel
|
|
208
|
+
}],
|
|
209
|
+
audit: ["user.created"]
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
/**
|
|
213
|
+
* Get the current user's profile.
|
|
214
|
+
*/
|
|
215
|
+
const GetCurrentUserContract = defineQuery({
|
|
216
|
+
meta: {
|
|
217
|
+
key: "identity.user.me",
|
|
218
|
+
version: 1,
|
|
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" }
|
|
235
|
+
});
|
|
236
|
+
/**
|
|
237
|
+
* Update user profile.
|
|
238
|
+
*/
|
|
239
|
+
const UpdateUserContract = defineCommand({
|
|
240
|
+
meta: {
|
|
241
|
+
key: "identity.user.update",
|
|
242
|
+
version: 1,
|
|
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,
|
|
263
|
+
when: "User profile is updated",
|
|
264
|
+
payload: UserProfileModel
|
|
265
|
+
}],
|
|
266
|
+
audit: ["user.updated"]
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
/**
|
|
270
|
+
* Delete user account.
|
|
271
|
+
*/
|
|
272
|
+
const DeleteUserContract = defineCommand({
|
|
273
|
+
meta: {
|
|
274
|
+
key: "identity.user.delete",
|
|
275
|
+
version: 1,
|
|
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,
|
|
299
|
+
when: "User account is deleted",
|
|
300
|
+
payload: UserDeletedPayloadModel
|
|
301
|
+
}],
|
|
302
|
+
audit: ["user.deleted"]
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
/**
|
|
306
|
+
* List users (admin only).
|
|
307
|
+
*/
|
|
308
|
+
const ListUsersContract = defineQuery({
|
|
309
|
+
meta: {
|
|
310
|
+
key: "identity.user.list",
|
|
311
|
+
version: 1,
|
|
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" }
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
//#endregion
|
|
332
|
+
export { CreateUserContract, CreateUserInputModel, DeleteUserContract, DeleteUserInputModel, GetCurrentUserContract, ListUsersContract, ListUsersInputModel, ListUsersOutputModel, SuccessResultModel, UpdateUserContract, UpdateUserInputModel, UserDeletedPayloadModel, UserProfileModel };
|
|
333
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","names":[],"sources":["../../src/contracts/user.ts"],"sourcesContent":["import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport { defineCommand, defineQuery } from '@contractspec/lib.contracts';\n\nconst OWNERS = ['platform.identity-rbac'] as const;\n\n// ============ SchemaModels ============\n\nexport const UserProfileModel = new SchemaModel({\n name: 'UserProfile',\n description: 'User profile information',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n emailVerified: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n firstName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n lastName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n locale: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n timezone: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n imageUrl: { type: ScalarTypeEnum.URL(), isOptional: true },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n onboardingCompleted: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const CreateUserInputModel = new SchemaModel({\n name: 'CreateUserInput',\n description: 'Input for creating a new user',\n fields: {\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n firstName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n lastName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n password: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nexport const UpdateUserInputModel = new SchemaModel({\n name: 'UpdateUserInput',\n description: 'Input for updating a user profile',\n fields: {\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n firstName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n lastName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n locale: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n timezone: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n imageUrl: { type: ScalarTypeEnum.URL(), isOptional: true },\n },\n});\n\nexport const DeleteUserInputModel = new SchemaModel({\n name: 'DeleteUserInput',\n description: 'Input for deleting a user',\n fields: {\n confirmEmail: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n },\n});\n\nexport const SuccessResultModel = new SchemaModel({\n name: 'SuccessResult',\n description: 'Simple success result',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\nexport const UserDeletedPayloadModel = new SchemaModel({\n name: 'UserDeletedPayload',\n description: 'Payload for user deleted event',\n fields: {\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const ListUsersInputModel = new SchemaModel({\n name: 'ListUsersInput',\n description: 'Input for listing users',\n fields: {\n limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n offset: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nexport const ListUsersOutputModel = new SchemaModel({\n name: 'ListUsersOutput',\n description: 'Output for listing users',\n fields: {\n users: { type: UserProfileModel, isOptional: false, isArray: true },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\n// ============ Contracts ============\n\n/**\n * Create a new user account.\n */\nexport const CreateUserContract = defineCommand({\n meta: {\n key: 'identity.user.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'user', 'create'],\n description: 'Create a new user account.',\n goal: 'Register a new user in the system.',\n context: 'Used during signup flows. May trigger email verification.',\n },\n io: {\n input: CreateUserInputModel,\n output: UserProfileModel,\n errors: {\n EMAIL_EXISTS: {\n description: 'A user with this email already exists',\n http: 409,\n gqlCode: 'EMAIL_EXISTS',\n when: 'Email is already registered',\n },\n },\n },\n policy: {\n auth: 'anonymous',\n },\n sideEffects: {\n emits: [\n {\n key: 'user.created',\n version: 1,\n when: 'User is successfully created',\n payload: UserProfileModel,\n },\n ],\n audit: ['user.created'],\n },\n});\n\n/**\n * Get the current user's profile.\n */\nexport const GetCurrentUserContract = defineQuery({\n meta: {\n key: 'identity.user.me',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'user', 'profile'],\n description: 'Get the current authenticated user profile.',\n goal: 'Retrieve user profile for the authenticated session.',\n context: 'Called on app load and after profile updates.',\n },\n io: {\n input: null,\n output: UserProfileModel,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Update user profile.\n */\nexport const UpdateUserContract = defineCommand({\n meta: {\n key: 'identity.user.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'user', 'update'],\n description: 'Update user profile information.',\n goal: 'Allow users to update their profile.',\n context: 'Self-service profile updates.',\n },\n io: {\n input: UpdateUserInputModel,\n output: UserProfileModel,\n },\n policy: {\n auth: 'user',\n },\n sideEffects: {\n emits: [\n {\n key: 'user.updated',\n version: 1,\n when: 'User profile is updated',\n payload: UserProfileModel,\n },\n ],\n audit: ['user.updated'],\n },\n});\n\n/**\n * Delete user account.\n */\nexport const DeleteUserContract = defineCommand({\n meta: {\n key: 'identity.user.delete',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'user', 'delete'],\n description: 'Delete user account and all associated data.',\n goal: 'Allow users to delete their account (GDPR compliance).',\n context:\n 'Self-service account deletion. Cascades to memberships, sessions, etc.',\n },\n io: {\n input: DeleteUserInputModel,\n output: SuccessResultModel,\n },\n policy: {\n auth: 'user',\n escalate: 'human_review',\n },\n sideEffects: {\n emits: [\n {\n key: 'user.deleted',\n version: 1,\n when: 'User account is deleted',\n payload: UserDeletedPayloadModel,\n },\n ],\n audit: ['user.deleted'],\n },\n});\n\n/**\n * List users (admin only).\n */\nexport const ListUsersContract = defineQuery({\n meta: {\n key: 'identity.user.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'user', 'admin', 'list'],\n description: 'List all users (admin only).',\n goal: 'Allow admins to browse and manage users.',\n context: 'Admin dashboard user management.',\n },\n io: {\n input: ListUsersInputModel,\n output: ListUsersOutputModel,\n },\n policy: {\n auth: 'admin',\n },\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { AccountEntity, SessionEntity, UserEntity, VerificationEntity } from "./user.js";
|
|
2
|
+
import { InvitationEntity, MemberEntity, OrganizationEntity, OrganizationTypeEnum, TeamEntity, TeamMemberEntity } from "./organization.js";
|
|
3
|
+
import { ApiKeyEntity, PasskeyEntity, PermissionEntity, PolicyBindingEntity, RoleEntity } from "./rbac.js";
|
|
4
|
+
import * as _contractspec_lib_schema575 from "@contractspec/lib.schema";
|
|
5
|
+
import { ModuleSchemaContribution } from "@contractspec/lib.schema";
|
|
6
|
+
|
|
7
|
+
//#region src/entities/index.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* All identity-rbac entities for schema composition.
|
|
10
|
+
*/
|
|
11
|
+
declare const identityRbacEntities: (_contractspec_lib_schema575.EntitySpec<{
|
|
12
|
+
id: _contractspec_lib_schema575.EntityScalarField;
|
|
13
|
+
email: _contractspec_lib_schema575.EntityScalarField;
|
|
14
|
+
emailVerified: _contractspec_lib_schema575.EntityScalarField;
|
|
15
|
+
name: _contractspec_lib_schema575.EntityScalarField;
|
|
16
|
+
firstName: _contractspec_lib_schema575.EntityScalarField;
|
|
17
|
+
lastName: _contractspec_lib_schema575.EntityScalarField;
|
|
18
|
+
locale: _contractspec_lib_schema575.EntityScalarField;
|
|
19
|
+
timezone: _contractspec_lib_schema575.EntityScalarField;
|
|
20
|
+
imageUrl: _contractspec_lib_schema575.EntityScalarField;
|
|
21
|
+
image: _contractspec_lib_schema575.EntityScalarField;
|
|
22
|
+
metadata: _contractspec_lib_schema575.EntityScalarField;
|
|
23
|
+
onboardingCompleted: _contractspec_lib_schema575.EntityScalarField;
|
|
24
|
+
onboardingStep: _contractspec_lib_schema575.EntityScalarField;
|
|
25
|
+
whitelistedAt: _contractspec_lib_schema575.EntityScalarField;
|
|
26
|
+
role: _contractspec_lib_schema575.EntityScalarField;
|
|
27
|
+
banned: _contractspec_lib_schema575.EntityScalarField;
|
|
28
|
+
banReason: _contractspec_lib_schema575.EntityScalarField;
|
|
29
|
+
banExpires: _contractspec_lib_schema575.EntityScalarField;
|
|
30
|
+
phoneNumber: _contractspec_lib_schema575.EntityScalarField;
|
|
31
|
+
phoneNumberVerified: _contractspec_lib_schema575.EntityScalarField;
|
|
32
|
+
createdAt: _contractspec_lib_schema575.EntityScalarField;
|
|
33
|
+
updatedAt: _contractspec_lib_schema575.EntityScalarField;
|
|
34
|
+
sessions: _contractspec_lib_schema575.EntityRelationField;
|
|
35
|
+
accounts: _contractspec_lib_schema575.EntityRelationField;
|
|
36
|
+
memberships: _contractspec_lib_schema575.EntityRelationField;
|
|
37
|
+
invitations: _contractspec_lib_schema575.EntityRelationField;
|
|
38
|
+
teamMemberships: _contractspec_lib_schema575.EntityRelationField;
|
|
39
|
+
policyBindings: _contractspec_lib_schema575.EntityRelationField;
|
|
40
|
+
apiKeys: _contractspec_lib_schema575.EntityRelationField;
|
|
41
|
+
passkeys: _contractspec_lib_schema575.EntityRelationField;
|
|
42
|
+
}> | _contractspec_lib_schema575.EntitySpec<{
|
|
43
|
+
id: _contractspec_lib_schema575.EntityScalarField;
|
|
44
|
+
userId: _contractspec_lib_schema575.EntityScalarField;
|
|
45
|
+
expiresAt: _contractspec_lib_schema575.EntityScalarField;
|
|
46
|
+
token: _contractspec_lib_schema575.EntityScalarField;
|
|
47
|
+
ipAddress: _contractspec_lib_schema575.EntityScalarField;
|
|
48
|
+
userAgent: _contractspec_lib_schema575.EntityScalarField;
|
|
49
|
+
impersonatedBy: _contractspec_lib_schema575.EntityScalarField;
|
|
50
|
+
activeOrganizationId: _contractspec_lib_schema575.EntityScalarField;
|
|
51
|
+
activeTeamId: _contractspec_lib_schema575.EntityScalarField;
|
|
52
|
+
createdAt: _contractspec_lib_schema575.EntityScalarField;
|
|
53
|
+
updatedAt: _contractspec_lib_schema575.EntityScalarField;
|
|
54
|
+
user: _contractspec_lib_schema575.EntityRelationField;
|
|
55
|
+
}> | _contractspec_lib_schema575.EntitySpec<{
|
|
56
|
+
id: _contractspec_lib_schema575.EntityScalarField;
|
|
57
|
+
accountId: _contractspec_lib_schema575.EntityScalarField;
|
|
58
|
+
providerId: _contractspec_lib_schema575.EntityScalarField;
|
|
59
|
+
userId: _contractspec_lib_schema575.EntityScalarField;
|
|
60
|
+
accessToken: _contractspec_lib_schema575.EntityScalarField;
|
|
61
|
+
refreshToken: _contractspec_lib_schema575.EntityScalarField;
|
|
62
|
+
idToken: _contractspec_lib_schema575.EntityScalarField;
|
|
63
|
+
accessTokenExpiresAt: _contractspec_lib_schema575.EntityScalarField;
|
|
64
|
+
refreshTokenExpiresAt: _contractspec_lib_schema575.EntityScalarField;
|
|
65
|
+
scope: _contractspec_lib_schema575.EntityScalarField;
|
|
66
|
+
password: _contractspec_lib_schema575.EntityScalarField;
|
|
67
|
+
createdAt: _contractspec_lib_schema575.EntityScalarField;
|
|
68
|
+
updatedAt: _contractspec_lib_schema575.EntityScalarField;
|
|
69
|
+
user: _contractspec_lib_schema575.EntityRelationField;
|
|
70
|
+
}> | _contractspec_lib_schema575.EntitySpec<{
|
|
71
|
+
id: _contractspec_lib_schema575.EntityScalarField;
|
|
72
|
+
identifier: _contractspec_lib_schema575.EntityScalarField;
|
|
73
|
+
value: _contractspec_lib_schema575.EntityScalarField;
|
|
74
|
+
expiresAt: _contractspec_lib_schema575.EntityScalarField;
|
|
75
|
+
createdAt: _contractspec_lib_schema575.EntityScalarField;
|
|
76
|
+
updatedAt: _contractspec_lib_schema575.EntityScalarField;
|
|
77
|
+
}> | _contractspec_lib_schema575.EntitySpec<{
|
|
78
|
+
id: _contractspec_lib_schema575.EntityScalarField;
|
|
79
|
+
userId: _contractspec_lib_schema575.EntityScalarField;
|
|
80
|
+
organizationId: _contractspec_lib_schema575.EntityScalarField;
|
|
81
|
+
role: _contractspec_lib_schema575.EntityScalarField;
|
|
82
|
+
createdAt: _contractspec_lib_schema575.EntityScalarField;
|
|
83
|
+
user: _contractspec_lib_schema575.EntityRelationField;
|
|
84
|
+
organization: _contractspec_lib_schema575.EntityRelationField;
|
|
85
|
+
}> | _contractspec_lib_schema575.EntitySpec<{
|
|
86
|
+
id: _contractspec_lib_schema575.EntityScalarField;
|
|
87
|
+
organizationId: _contractspec_lib_schema575.EntityScalarField;
|
|
88
|
+
email: _contractspec_lib_schema575.EntityScalarField;
|
|
89
|
+
role: _contractspec_lib_schema575.EntityScalarField;
|
|
90
|
+
status: _contractspec_lib_schema575.EntityScalarField;
|
|
91
|
+
acceptedAt: _contractspec_lib_schema575.EntityScalarField;
|
|
92
|
+
expiresAt: _contractspec_lib_schema575.EntityScalarField;
|
|
93
|
+
inviterId: _contractspec_lib_schema575.EntityScalarField;
|
|
94
|
+
teamId: _contractspec_lib_schema575.EntityScalarField;
|
|
95
|
+
createdAt: _contractspec_lib_schema575.EntityScalarField;
|
|
96
|
+
updatedAt: _contractspec_lib_schema575.EntityScalarField;
|
|
97
|
+
organization: _contractspec_lib_schema575.EntityRelationField;
|
|
98
|
+
inviter: _contractspec_lib_schema575.EntityRelationField;
|
|
99
|
+
team: _contractspec_lib_schema575.EntityRelationField;
|
|
100
|
+
}> | _contractspec_lib_schema575.EntitySpec<{
|
|
101
|
+
id: _contractspec_lib_schema575.EntityScalarField;
|
|
102
|
+
name: _contractspec_lib_schema575.EntityScalarField;
|
|
103
|
+
organizationId: _contractspec_lib_schema575.EntityScalarField;
|
|
104
|
+
createdAt: _contractspec_lib_schema575.EntityScalarField;
|
|
105
|
+
updatedAt: _contractspec_lib_schema575.EntityScalarField;
|
|
106
|
+
organization: _contractspec_lib_schema575.EntityRelationField;
|
|
107
|
+
members: _contractspec_lib_schema575.EntityRelationField;
|
|
108
|
+
invitations: _contractspec_lib_schema575.EntityRelationField;
|
|
109
|
+
}> | _contractspec_lib_schema575.EntitySpec<{
|
|
110
|
+
id: _contractspec_lib_schema575.EntityScalarField;
|
|
111
|
+
teamId: _contractspec_lib_schema575.EntityScalarField;
|
|
112
|
+
userId: _contractspec_lib_schema575.EntityScalarField;
|
|
113
|
+
createdAt: _contractspec_lib_schema575.EntityScalarField;
|
|
114
|
+
team: _contractspec_lib_schema575.EntityRelationField;
|
|
115
|
+
user: _contractspec_lib_schema575.EntityRelationField;
|
|
116
|
+
}> | _contractspec_lib_schema575.EntitySpec<{
|
|
117
|
+
id: _contractspec_lib_schema575.EntityScalarField;
|
|
118
|
+
name: _contractspec_lib_schema575.EntityScalarField;
|
|
119
|
+
description: _contractspec_lib_schema575.EntityScalarField;
|
|
120
|
+
createdAt: _contractspec_lib_schema575.EntityScalarField;
|
|
121
|
+
updatedAt: _contractspec_lib_schema575.EntityScalarField;
|
|
122
|
+
}> | _contractspec_lib_schema575.EntitySpec<{
|
|
123
|
+
id: _contractspec_lib_schema575.EntityScalarField;
|
|
124
|
+
roleId: _contractspec_lib_schema575.EntityScalarField;
|
|
125
|
+
targetType: _contractspec_lib_schema575.EntityScalarField;
|
|
126
|
+
targetId: _contractspec_lib_schema575.EntityScalarField;
|
|
127
|
+
expiresAt: _contractspec_lib_schema575.EntityScalarField;
|
|
128
|
+
createdAt: _contractspec_lib_schema575.EntityScalarField;
|
|
129
|
+
userId: _contractspec_lib_schema575.EntityScalarField;
|
|
130
|
+
organizationId: _contractspec_lib_schema575.EntityScalarField;
|
|
131
|
+
role: _contractspec_lib_schema575.EntityRelationField;
|
|
132
|
+
user: _contractspec_lib_schema575.EntityRelationField;
|
|
133
|
+
organization: _contractspec_lib_schema575.EntityRelationField;
|
|
134
|
+
}> | _contractspec_lib_schema575.EntitySpec<{
|
|
135
|
+
id: _contractspec_lib_schema575.EntityScalarField;
|
|
136
|
+
name: _contractspec_lib_schema575.EntityScalarField;
|
|
137
|
+
start: _contractspec_lib_schema575.EntityScalarField;
|
|
138
|
+
prefix: _contractspec_lib_schema575.EntityScalarField;
|
|
139
|
+
key: _contractspec_lib_schema575.EntityScalarField;
|
|
140
|
+
userId: _contractspec_lib_schema575.EntityScalarField;
|
|
141
|
+
refillInterval: _contractspec_lib_schema575.EntityScalarField;
|
|
142
|
+
refillAmount: _contractspec_lib_schema575.EntityScalarField;
|
|
143
|
+
lastRefillAt: _contractspec_lib_schema575.EntityScalarField;
|
|
144
|
+
remaining: _contractspec_lib_schema575.EntityScalarField;
|
|
145
|
+
requestCount: _contractspec_lib_schema575.EntityScalarField;
|
|
146
|
+
lastRequest: _contractspec_lib_schema575.EntityScalarField;
|
|
147
|
+
enabled: _contractspec_lib_schema575.EntityScalarField;
|
|
148
|
+
rateLimitEnabled: _contractspec_lib_schema575.EntityScalarField;
|
|
149
|
+
rateLimitTimeWindow: _contractspec_lib_schema575.EntityScalarField;
|
|
150
|
+
rateLimitMax: _contractspec_lib_schema575.EntityScalarField;
|
|
151
|
+
expiresAt: _contractspec_lib_schema575.EntityScalarField;
|
|
152
|
+
permissions: _contractspec_lib_schema575.EntityScalarField;
|
|
153
|
+
metadata: _contractspec_lib_schema575.EntityScalarField;
|
|
154
|
+
createdAt: _contractspec_lib_schema575.EntityScalarField;
|
|
155
|
+
updatedAt: _contractspec_lib_schema575.EntityScalarField;
|
|
156
|
+
user: _contractspec_lib_schema575.EntityRelationField;
|
|
157
|
+
}> | _contractspec_lib_schema575.EntitySpec<{
|
|
158
|
+
id: _contractspec_lib_schema575.EntityScalarField;
|
|
159
|
+
name: _contractspec_lib_schema575.EntityScalarField;
|
|
160
|
+
publicKey: _contractspec_lib_schema575.EntityScalarField;
|
|
161
|
+
userId: _contractspec_lib_schema575.EntityScalarField;
|
|
162
|
+
credentialID: _contractspec_lib_schema575.EntityScalarField;
|
|
163
|
+
counter: _contractspec_lib_schema575.EntityScalarField;
|
|
164
|
+
deviceType: _contractspec_lib_schema575.EntityScalarField;
|
|
165
|
+
backedUp: _contractspec_lib_schema575.EntityScalarField;
|
|
166
|
+
transports: _contractspec_lib_schema575.EntityScalarField;
|
|
167
|
+
aaguid: _contractspec_lib_schema575.EntityScalarField;
|
|
168
|
+
createdAt: _contractspec_lib_schema575.EntityScalarField;
|
|
169
|
+
user: _contractspec_lib_schema575.EntityRelationField;
|
|
170
|
+
}>)[];
|
|
171
|
+
/**
|
|
172
|
+
* Module schema contribution for identity-rbac.
|
|
173
|
+
*/
|
|
174
|
+
declare const identityRbacSchemaContribution: ModuleSchemaContribution;
|
|
175
|
+
//#endregion
|
|
176
|
+
export { AccountEntity, ApiKeyEntity, InvitationEntity, MemberEntity, OrganizationEntity, OrganizationTypeEnum, PasskeyEntity, PermissionEntity, PolicyBindingEntity, RoleEntity, SessionEntity, TeamEntity, TeamMemberEntity, UserEntity, VerificationEntity, identityRbacEntities, identityRbacSchemaContribution };
|
|
177
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/entities/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAsDa,cAAA,oBAeZ,EAAA,6BAfgC,UAehC,CAAA;EAAA,EAAA,EAAA,2BAAA,CAAA,iBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAfgC,CAAA;EAAA,EAAA,EAAA,2BAAA,CAAA,iBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBjC;;cAAa,gCAAgC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AccountEntity, SessionEntity, UserEntity, VerificationEntity } from "./user.js";
|
|
2
|
+
import { InvitationEntity, MemberEntity, OrganizationEntity, OrganizationTypeEnum, TeamEntity, TeamMemberEntity } from "./organization.js";
|
|
3
|
+
import { ApiKeyEntity, PasskeyEntity, PermissionEntity, PolicyBindingEntity, RoleEntity } from "./rbac.js";
|
|
4
|
+
|
|
5
|
+
//#region src/entities/index.ts
|
|
6
|
+
/**
|
|
7
|
+
* All identity-rbac entities for schema composition.
|
|
8
|
+
*/
|
|
9
|
+
const identityRbacEntities = [
|
|
10
|
+
UserEntity,
|
|
11
|
+
SessionEntity,
|
|
12
|
+
AccountEntity,
|
|
13
|
+
VerificationEntity,
|
|
14
|
+
OrganizationEntity,
|
|
15
|
+
MemberEntity,
|
|
16
|
+
InvitationEntity,
|
|
17
|
+
TeamEntity,
|
|
18
|
+
TeamMemberEntity,
|
|
19
|
+
RoleEntity,
|
|
20
|
+
PermissionEntity,
|
|
21
|
+
PolicyBindingEntity,
|
|
22
|
+
ApiKeyEntity,
|
|
23
|
+
PasskeyEntity
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Module schema contribution for identity-rbac.
|
|
27
|
+
*/
|
|
28
|
+
const identityRbacSchemaContribution = {
|
|
29
|
+
moduleId: "@contractspec/lib.identity-rbac",
|
|
30
|
+
entities: identityRbacEntities,
|
|
31
|
+
enums: [OrganizationTypeEnum]
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { AccountEntity, ApiKeyEntity, InvitationEntity, MemberEntity, OrganizationEntity, OrganizationTypeEnum, PasskeyEntity, PermissionEntity, PolicyBindingEntity, RoleEntity, SessionEntity, TeamEntity, TeamMemberEntity, UserEntity, VerificationEntity, identityRbacEntities, identityRbacSchemaContribution };
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["identityRbacSchemaContribution: ModuleSchemaContribution"],"sources":["../../src/entities/index.ts"],"sourcesContent":["// User-related entities\nexport {\n UserEntity,\n SessionEntity,\n AccountEntity,\n VerificationEntity,\n} from './user';\n\n// Organization-related entities\nexport {\n OrganizationTypeEnum,\n OrganizationEntity,\n MemberEntity,\n InvitationEntity,\n TeamEntity,\n TeamMemberEntity,\n} from './organization';\n\n// RBAC entities\nexport {\n RoleEntity,\n PermissionEntity,\n PolicyBindingEntity,\n ApiKeyEntity,\n PasskeyEntity,\n} from './rbac';\n\n// Re-export all entities as a module contribution\nimport {\n UserEntity,\n SessionEntity,\n AccountEntity,\n VerificationEntity,\n} from './user';\nimport {\n OrganizationTypeEnum,\n OrganizationEntity,\n MemberEntity,\n InvitationEntity,\n TeamEntity,\n TeamMemberEntity,\n} from './organization';\nimport {\n RoleEntity,\n PermissionEntity,\n PolicyBindingEntity,\n ApiKeyEntity,\n PasskeyEntity,\n} from './rbac';\nimport type { ModuleSchemaContribution } from '@contractspec/lib.schema';\n\n/**\n * All identity-rbac entities for schema composition.\n */\nexport const identityRbacEntities = [\n UserEntity,\n SessionEntity,\n AccountEntity,\n VerificationEntity,\n OrganizationEntity,\n MemberEntity,\n InvitationEntity,\n TeamEntity,\n TeamMemberEntity,\n RoleEntity,\n PermissionEntity,\n PolicyBindingEntity,\n ApiKeyEntity,\n PasskeyEntity,\n];\n\n/**\n * Module schema contribution for identity-rbac.\n */\nexport const identityRbacSchemaContribution: ModuleSchemaContribution = {\n moduleId: '@contractspec/lib.identity-rbac',\n entities: identityRbacEntities,\n enums: [OrganizationTypeEnum],\n};\n"],"mappings":";;;;;;;;AAsDA,MAAa,uBAAuB;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;AAKD,MAAaA,iCAA2D;CACtE,UAAU;CACV,UAAU;CACV,OAAO,CAAC,qBAAqB;CAC9B"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as _contractspec_lib_schema796 from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/entities/organization.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Organization type enum.
|
|
6
|
+
*/
|
|
7
|
+
declare const OrganizationTypeEnum: _contractspec_lib_schema796.EntityEnumDef;
|
|
8
|
+
/**
|
|
9
|
+
* Organization entity - tenant/company grouping.
|
|
10
|
+
*/
|
|
11
|
+
declare const OrganizationEntity: _contractspec_lib_schema796.EntitySpec<{
|
|
12
|
+
id: _contractspec_lib_schema796.EntityScalarField;
|
|
13
|
+
name: _contractspec_lib_schema796.EntityScalarField;
|
|
14
|
+
slug: _contractspec_lib_schema796.EntityScalarField;
|
|
15
|
+
logo: _contractspec_lib_schema796.EntityScalarField;
|
|
16
|
+
description: _contractspec_lib_schema796.EntityScalarField;
|
|
17
|
+
metadata: _contractspec_lib_schema796.EntityScalarField;
|
|
18
|
+
type: _contractspec_lib_schema796.EntityEnumField;
|
|
19
|
+
onboardingCompleted: _contractspec_lib_schema796.EntityScalarField;
|
|
20
|
+
onboardingStep: _contractspec_lib_schema796.EntityScalarField;
|
|
21
|
+
referralCode: _contractspec_lib_schema796.EntityScalarField;
|
|
22
|
+
referredBy: _contractspec_lib_schema796.EntityScalarField;
|
|
23
|
+
createdAt: _contractspec_lib_schema796.EntityScalarField;
|
|
24
|
+
updatedAt: _contractspec_lib_schema796.EntityScalarField;
|
|
25
|
+
members: _contractspec_lib_schema796.EntityRelationField;
|
|
26
|
+
invitations: _contractspec_lib_schema796.EntityRelationField;
|
|
27
|
+
teams: _contractspec_lib_schema796.EntityRelationField;
|
|
28
|
+
policyBindings: _contractspec_lib_schema796.EntityRelationField;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Member entity - user membership in an organization.
|
|
32
|
+
*/
|
|
33
|
+
declare const MemberEntity: _contractspec_lib_schema796.EntitySpec<{
|
|
34
|
+
id: _contractspec_lib_schema796.EntityScalarField;
|
|
35
|
+
userId: _contractspec_lib_schema796.EntityScalarField;
|
|
36
|
+
organizationId: _contractspec_lib_schema796.EntityScalarField;
|
|
37
|
+
role: _contractspec_lib_schema796.EntityScalarField;
|
|
38
|
+
createdAt: _contractspec_lib_schema796.EntityScalarField;
|
|
39
|
+
user: _contractspec_lib_schema796.EntityRelationField;
|
|
40
|
+
organization: _contractspec_lib_schema796.EntityRelationField;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Invitation entity - pending organization invites.
|
|
44
|
+
*/
|
|
45
|
+
declare const InvitationEntity: _contractspec_lib_schema796.EntitySpec<{
|
|
46
|
+
id: _contractspec_lib_schema796.EntityScalarField;
|
|
47
|
+
organizationId: _contractspec_lib_schema796.EntityScalarField;
|
|
48
|
+
email: _contractspec_lib_schema796.EntityScalarField;
|
|
49
|
+
role: _contractspec_lib_schema796.EntityScalarField;
|
|
50
|
+
status: _contractspec_lib_schema796.EntityScalarField;
|
|
51
|
+
acceptedAt: _contractspec_lib_schema796.EntityScalarField;
|
|
52
|
+
expiresAt: _contractspec_lib_schema796.EntityScalarField;
|
|
53
|
+
inviterId: _contractspec_lib_schema796.EntityScalarField;
|
|
54
|
+
teamId: _contractspec_lib_schema796.EntityScalarField;
|
|
55
|
+
createdAt: _contractspec_lib_schema796.EntityScalarField;
|
|
56
|
+
updatedAt: _contractspec_lib_schema796.EntityScalarField;
|
|
57
|
+
organization: _contractspec_lib_schema796.EntityRelationField;
|
|
58
|
+
inviter: _contractspec_lib_schema796.EntityRelationField;
|
|
59
|
+
team: _contractspec_lib_schema796.EntityRelationField;
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Team entity - team within an organization.
|
|
63
|
+
*/
|
|
64
|
+
declare const TeamEntity: _contractspec_lib_schema796.EntitySpec<{
|
|
65
|
+
id: _contractspec_lib_schema796.EntityScalarField;
|
|
66
|
+
name: _contractspec_lib_schema796.EntityScalarField;
|
|
67
|
+
organizationId: _contractspec_lib_schema796.EntityScalarField;
|
|
68
|
+
createdAt: _contractspec_lib_schema796.EntityScalarField;
|
|
69
|
+
updatedAt: _contractspec_lib_schema796.EntityScalarField;
|
|
70
|
+
organization: _contractspec_lib_schema796.EntityRelationField;
|
|
71
|
+
members: _contractspec_lib_schema796.EntityRelationField;
|
|
72
|
+
invitations: _contractspec_lib_schema796.EntityRelationField;
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* TeamMember entity - user's team membership.
|
|
76
|
+
*/
|
|
77
|
+
declare const TeamMemberEntity: _contractspec_lib_schema796.EntitySpec<{
|
|
78
|
+
id: _contractspec_lib_schema796.EntityScalarField;
|
|
79
|
+
teamId: _contractspec_lib_schema796.EntityScalarField;
|
|
80
|
+
userId: _contractspec_lib_schema796.EntityScalarField;
|
|
81
|
+
createdAt: _contractspec_lib_schema796.EntityScalarField;
|
|
82
|
+
team: _contractspec_lib_schema796.EntityRelationField;
|
|
83
|
+
user: _contractspec_lib_schema796.EntityRelationField;
|
|
84
|
+
}>;
|
|
85
|
+
//#endregion
|
|
86
|
+
export { InvitationEntity, MemberEntity, OrganizationEntity, OrganizationTypeEnum, TeamEntity, TeamMemberEntity };
|
|
87
|
+
//# sourceMappingURL=organization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization.d.ts","names":[],"sources":["../../src/entities/organization.ts"],"sourcesContent":[],"mappings":";;;;;;AAUa,cAAA,oBAKX,EAAA,2BAAA,CAL+B,aAK/B;AAKF;;;cAAa,gDAAkB;MAkD7B,2BAAA,CAAA;;;;;;;;;;;;;;8DAlD6B;EAAA,KAAA,iDAAA;EAuDlB,cAAA,iDAqBX;CAAA,CAAA;;;;cArBW,0CAAY;MAqBvB,2BAAA,CAAA;;+DArBuB;EAAA,IAAA,+CAAA;EA0BZ,SAAA,+CAmCX;EAAA,IAAA,iDAAA;;;;;;cAnCW,8CAAgB;MAmC3B,2BAAA,CAAA;;;;;;;0DAnC2B;EAAA,MAAA,+CAAA;EAwChB,SAAA,+CAmBX;EAAA,SAAA,+CAAA;;;;;;;;cAnBW,UAAU,8BAAA,UAAA,CAAA;EAAA,EAAA,EAmBrB,2BAAA,CAAA,iBAnBqB;EAwBV,IAAA,+CAeX;EAAA,cAAA,+CAAA;;;;;;;;;;cAfW,8CAAgB;MAe3B,2BAAA,CAAA"}
|