@contractspec/lib.identity-rbac 1.44.1 → 1.45.1
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/contracts/organization.d.ts +198 -198
- package/dist/contracts/organization.d.ts.map +1 -1
- package/dist/contracts/organization.js +13 -13
- package/dist/contracts/organization.js.map +1 -1
- package/dist/contracts/rbac.d.ts +128 -128
- package/dist/contracts/rbac.d.ts.map +1 -1
- package/dist/contracts/rbac.js +10 -10
- package/dist/contracts/rbac.js.map +1 -1
- package/dist/contracts/user.d.ts +142 -142
- package/dist/contracts/user.js +8 -8
- package/dist/contracts/user.js.map +1 -1
- package/dist/entities/index.d.ts +160 -160
- package/dist/entities/organization.d.ts +59 -59
- package/dist/entities/rbac.d.ts +63 -63
- package/dist/entities/user.d.ts +67 -67
- package/dist/events.d.ts +174 -174
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +15 -15
- package/dist/events.js.map +1 -1
- package/dist/identity-rbac.feature.js +39 -39
- package/dist/identity-rbac.feature.js.map +1 -1
- package/package.json +5 -5
package/dist/contracts/user.js
CHANGED
|
@@ -176,7 +176,7 @@ const ListUsersOutputModel = new SchemaModel({
|
|
|
176
176
|
const CreateUserContract = defineCommand({
|
|
177
177
|
meta: {
|
|
178
178
|
key: "identity.user.create",
|
|
179
|
-
version: 1,
|
|
179
|
+
version: "1.0.0",
|
|
180
180
|
stability: "stable",
|
|
181
181
|
owners: [...OWNERS],
|
|
182
182
|
tags: [
|
|
@@ -202,7 +202,7 @@ const CreateUserContract = defineCommand({
|
|
|
202
202
|
sideEffects: {
|
|
203
203
|
emits: [{
|
|
204
204
|
key: "user.created",
|
|
205
|
-
version: 1,
|
|
205
|
+
version: "1.0.0",
|
|
206
206
|
when: "User is successfully created",
|
|
207
207
|
payload: UserProfileModel
|
|
208
208
|
}],
|
|
@@ -215,7 +215,7 @@ const CreateUserContract = defineCommand({
|
|
|
215
215
|
const GetCurrentUserContract = defineQuery({
|
|
216
216
|
meta: {
|
|
217
217
|
key: "identity.user.me",
|
|
218
|
-
version: 1,
|
|
218
|
+
version: "1.0.0",
|
|
219
219
|
stability: "stable",
|
|
220
220
|
owners: [...OWNERS],
|
|
221
221
|
tags: [
|
|
@@ -239,7 +239,7 @@ const GetCurrentUserContract = defineQuery({
|
|
|
239
239
|
const UpdateUserContract = defineCommand({
|
|
240
240
|
meta: {
|
|
241
241
|
key: "identity.user.update",
|
|
242
|
-
version: 1,
|
|
242
|
+
version: "1.0.0",
|
|
243
243
|
stability: "stable",
|
|
244
244
|
owners: [...OWNERS],
|
|
245
245
|
tags: [
|
|
@@ -259,7 +259,7 @@ const UpdateUserContract = defineCommand({
|
|
|
259
259
|
sideEffects: {
|
|
260
260
|
emits: [{
|
|
261
261
|
key: "user.updated",
|
|
262
|
-
version: 1,
|
|
262
|
+
version: "1.0.0",
|
|
263
263
|
when: "User profile is updated",
|
|
264
264
|
payload: UserProfileModel
|
|
265
265
|
}],
|
|
@@ -272,7 +272,7 @@ const UpdateUserContract = defineCommand({
|
|
|
272
272
|
const DeleteUserContract = defineCommand({
|
|
273
273
|
meta: {
|
|
274
274
|
key: "identity.user.delete",
|
|
275
|
-
version: 1,
|
|
275
|
+
version: "1.0.0",
|
|
276
276
|
stability: "stable",
|
|
277
277
|
owners: [...OWNERS],
|
|
278
278
|
tags: [
|
|
@@ -295,7 +295,7 @@ const DeleteUserContract = defineCommand({
|
|
|
295
295
|
sideEffects: {
|
|
296
296
|
emits: [{
|
|
297
297
|
key: "user.deleted",
|
|
298
|
-
version: 1,
|
|
298
|
+
version: "1.0.0",
|
|
299
299
|
when: "User account is deleted",
|
|
300
300
|
payload: UserDeletedPayloadModel
|
|
301
301
|
}],
|
|
@@ -308,7 +308,7 @@ const DeleteUserContract = defineCommand({
|
|
|
308
308
|
const ListUsersContract = defineQuery({
|
|
309
309
|
meta: {
|
|
310
310
|
key: "identity.user.list",
|
|
311
|
-
version: 1,
|
|
311
|
+
version: "1.0.0",
|
|
312
312
|
stability: "stable",
|
|
313
313
|
owners: [...OWNERS],
|
|
314
314
|
tags: [
|
|
@@ -1 +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":";;;;AAGA,MAAM,SAAS,CAAC,yBAAyB;AAIzC,MAAa,mBAAmB,IAAI,YAAY;CAC9C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACjE,eAAe;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EACpE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EAClE,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACvE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACpE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE,UAAU;GAAE,MAAM,eAAe,KAAK;GAAE,YAAY;GAAM;EAC1D,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EAClE,qBAAqB;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EAC1E,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAa,uBAAuB,IAAI,YAAY;CAClD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACjE,MAAM;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;CACD,aAAa;EACX,OAAO,CACL;GACE,KAAK;GACL,SAAS;GACT,MAAM;GACN,SAAS;GACV,CACF;EACD,OAAO,CAAC,eAAe;EACxB;CACF,CAAC;;;;AAKF,MAAa,qBAAqB,cAAc;CAC9C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAY;GAAQ;GAAS;EACpC,aAAa;EACb,MAAM;EACN,SACE;EACH;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ;EACN,MAAM;EACN,UAAU;EACX;CACD,aAAa;EACX,OAAO,CACL;GACE,KAAK;GACL,SAAS;GACT,MAAM;GACN,SAAS;GACV,CACF;EACD,OAAO,CAAC,eAAe;EACxB;CACF,CAAC;;;;AAKF,MAAa,oBAAoB,YAAY;CAC3C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAY;GAAQ;GAAS;GAAO;EAC3C,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EACN,MAAM,SACP;CACF,CAAC"}
|
|
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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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.0.0',\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":";;;;AAGA,MAAM,SAAS,CAAC,yBAAyB;AAIzC,MAAa,mBAAmB,IAAI,YAAY;CAC9C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY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oBAAoB,YAAY;CAC3C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAY;GAAQ;GAAS;GAAO;EAC3C,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EACN,MAAM,SACP;CACF,CAAC"}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,172 +1,172 @@
|
|
|
1
1
|
import { AccountEntity, SessionEntity, UserEntity, VerificationEntity } from "./user.js";
|
|
2
2
|
import { InvitationEntity, MemberEntity, OrganizationEntity, OrganizationTypeEnum, TeamEntity, TeamMemberEntity } from "./organization.js";
|
|
3
3
|
import { ApiKeyEntity, PasskeyEntity, PermissionEntity, PolicyBindingEntity, RoleEntity } from "./rbac.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as _contractspec_lib_schema575 from "@contractspec/lib.schema";
|
|
5
5
|
import { ModuleSchemaContribution } from "@contractspec/lib.schema";
|
|
6
6
|
|
|
7
7
|
//#region src/entities/index.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* All identity-rbac entities for schema composition.
|
|
10
10
|
*/
|
|
11
|
-
declare const identityRbacEntities: (
|
|
12
|
-
id:
|
|
13
|
-
email:
|
|
14
|
-
emailVerified:
|
|
15
|
-
name:
|
|
16
|
-
firstName:
|
|
17
|
-
lastName:
|
|
18
|
-
locale:
|
|
19
|
-
timezone:
|
|
20
|
-
imageUrl:
|
|
21
|
-
image:
|
|
22
|
-
metadata:
|
|
23
|
-
onboardingCompleted:
|
|
24
|
-
onboardingStep:
|
|
25
|
-
whitelistedAt:
|
|
26
|
-
role:
|
|
27
|
-
banned:
|
|
28
|
-
banReason:
|
|
29
|
-
banExpires:
|
|
30
|
-
phoneNumber:
|
|
31
|
-
phoneNumberVerified:
|
|
32
|
-
createdAt:
|
|
33
|
-
updatedAt:
|
|
34
|
-
sessions:
|
|
35
|
-
accounts:
|
|
36
|
-
memberships:
|
|
37
|
-
invitations:
|
|
38
|
-
teamMemberships:
|
|
39
|
-
policyBindings:
|
|
40
|
-
apiKeys:
|
|
41
|
-
passkeys:
|
|
42
|
-
}> |
|
|
43
|
-
id:
|
|
44
|
-
userId:
|
|
45
|
-
expiresAt:
|
|
46
|
-
token:
|
|
47
|
-
ipAddress:
|
|
48
|
-
userAgent:
|
|
49
|
-
impersonatedBy:
|
|
50
|
-
activeOrganizationId:
|
|
51
|
-
activeTeamId:
|
|
52
|
-
createdAt:
|
|
53
|
-
updatedAt:
|
|
54
|
-
user:
|
|
55
|
-
}> |
|
|
56
|
-
id:
|
|
57
|
-
accountId:
|
|
58
|
-
providerId:
|
|
59
|
-
userId:
|
|
60
|
-
accessToken:
|
|
61
|
-
refreshToken:
|
|
62
|
-
idToken:
|
|
63
|
-
accessTokenExpiresAt:
|
|
64
|
-
refreshTokenExpiresAt:
|
|
65
|
-
scope:
|
|
66
|
-
password:
|
|
67
|
-
createdAt:
|
|
68
|
-
updatedAt:
|
|
69
|
-
user:
|
|
70
|
-
}> |
|
|
71
|
-
id:
|
|
72
|
-
identifier:
|
|
73
|
-
value:
|
|
74
|
-
expiresAt:
|
|
75
|
-
createdAt:
|
|
76
|
-
updatedAt:
|
|
77
|
-
}> |
|
|
78
|
-
id:
|
|
79
|
-
userId:
|
|
80
|
-
organizationId:
|
|
81
|
-
role:
|
|
82
|
-
createdAt:
|
|
83
|
-
user:
|
|
84
|
-
organization:
|
|
85
|
-
}> |
|
|
86
|
-
id:
|
|
87
|
-
organizationId:
|
|
88
|
-
email:
|
|
89
|
-
role:
|
|
90
|
-
status:
|
|
91
|
-
acceptedAt:
|
|
92
|
-
expiresAt:
|
|
93
|
-
inviterId:
|
|
94
|
-
teamId:
|
|
95
|
-
createdAt:
|
|
96
|
-
updatedAt:
|
|
97
|
-
organization:
|
|
98
|
-
inviter:
|
|
99
|
-
team:
|
|
100
|
-
}> |
|
|
101
|
-
id:
|
|
102
|
-
name:
|
|
103
|
-
organizationId:
|
|
104
|
-
createdAt:
|
|
105
|
-
updatedAt:
|
|
106
|
-
organization:
|
|
107
|
-
members:
|
|
108
|
-
invitations:
|
|
109
|
-
}> |
|
|
110
|
-
id:
|
|
111
|
-
teamId:
|
|
112
|
-
userId:
|
|
113
|
-
createdAt:
|
|
114
|
-
team:
|
|
115
|
-
user:
|
|
116
|
-
}> |
|
|
117
|
-
id:
|
|
118
|
-
name:
|
|
119
|
-
description:
|
|
120
|
-
createdAt:
|
|
121
|
-
updatedAt:
|
|
122
|
-
}> |
|
|
123
|
-
id:
|
|
124
|
-
roleId:
|
|
125
|
-
targetType:
|
|
126
|
-
targetId:
|
|
127
|
-
expiresAt:
|
|
128
|
-
createdAt:
|
|
129
|
-
userId:
|
|
130
|
-
organizationId:
|
|
131
|
-
role:
|
|
132
|
-
user:
|
|
133
|
-
organization:
|
|
134
|
-
}> |
|
|
135
|
-
id:
|
|
136
|
-
name:
|
|
137
|
-
start:
|
|
138
|
-
prefix:
|
|
139
|
-
key:
|
|
140
|
-
userId:
|
|
141
|
-
refillInterval:
|
|
142
|
-
refillAmount:
|
|
143
|
-
lastRefillAt:
|
|
144
|
-
remaining:
|
|
145
|
-
requestCount:
|
|
146
|
-
lastRequest:
|
|
147
|
-
enabled:
|
|
148
|
-
rateLimitEnabled:
|
|
149
|
-
rateLimitTimeWindow:
|
|
150
|
-
rateLimitMax:
|
|
151
|
-
expiresAt:
|
|
152
|
-
permissions:
|
|
153
|
-
metadata:
|
|
154
|
-
createdAt:
|
|
155
|
-
updatedAt:
|
|
156
|
-
user:
|
|
157
|
-
}> |
|
|
158
|
-
id:
|
|
159
|
-
name:
|
|
160
|
-
publicKey:
|
|
161
|
-
userId:
|
|
162
|
-
credentialID:
|
|
163
|
-
counter:
|
|
164
|
-
deviceType:
|
|
165
|
-
backedUp:
|
|
166
|
-
transports:
|
|
167
|
-
aaguid:
|
|
168
|
-
createdAt:
|
|
169
|
-
user:
|
|
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
170
|
}>)[];
|
|
171
171
|
/**
|
|
172
172
|
* Module schema contribution for identity-rbac.
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema734 from "@contractspec/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/entities/organization.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Organization type enum.
|
|
6
6
|
*/
|
|
7
|
-
declare const OrganizationTypeEnum:
|
|
7
|
+
declare const OrganizationTypeEnum: _contractspec_lib_schema734.EntityEnumDef;
|
|
8
8
|
/**
|
|
9
9
|
* Organization entity - tenant/company grouping.
|
|
10
10
|
*/
|
|
11
|
-
declare const OrganizationEntity:
|
|
12
|
-
id:
|
|
13
|
-
name:
|
|
14
|
-
slug:
|
|
15
|
-
logo:
|
|
16
|
-
description:
|
|
17
|
-
metadata:
|
|
18
|
-
type:
|
|
19
|
-
onboardingCompleted:
|
|
20
|
-
onboardingStep:
|
|
21
|
-
referralCode:
|
|
22
|
-
referredBy:
|
|
23
|
-
createdAt:
|
|
24
|
-
updatedAt:
|
|
25
|
-
members:
|
|
26
|
-
invitations:
|
|
27
|
-
teams:
|
|
28
|
-
policyBindings:
|
|
11
|
+
declare const OrganizationEntity: _contractspec_lib_schema734.EntitySpec<{
|
|
12
|
+
id: _contractspec_lib_schema734.EntityScalarField;
|
|
13
|
+
name: _contractspec_lib_schema734.EntityScalarField;
|
|
14
|
+
slug: _contractspec_lib_schema734.EntityScalarField;
|
|
15
|
+
logo: _contractspec_lib_schema734.EntityScalarField;
|
|
16
|
+
description: _contractspec_lib_schema734.EntityScalarField;
|
|
17
|
+
metadata: _contractspec_lib_schema734.EntityScalarField;
|
|
18
|
+
type: _contractspec_lib_schema734.EntityEnumField;
|
|
19
|
+
onboardingCompleted: _contractspec_lib_schema734.EntityScalarField;
|
|
20
|
+
onboardingStep: _contractspec_lib_schema734.EntityScalarField;
|
|
21
|
+
referralCode: _contractspec_lib_schema734.EntityScalarField;
|
|
22
|
+
referredBy: _contractspec_lib_schema734.EntityScalarField;
|
|
23
|
+
createdAt: _contractspec_lib_schema734.EntityScalarField;
|
|
24
|
+
updatedAt: _contractspec_lib_schema734.EntityScalarField;
|
|
25
|
+
members: _contractspec_lib_schema734.EntityRelationField;
|
|
26
|
+
invitations: _contractspec_lib_schema734.EntityRelationField;
|
|
27
|
+
teams: _contractspec_lib_schema734.EntityRelationField;
|
|
28
|
+
policyBindings: _contractspec_lib_schema734.EntityRelationField;
|
|
29
29
|
}>;
|
|
30
30
|
/**
|
|
31
31
|
* Member entity - user membership in an organization.
|
|
32
32
|
*/
|
|
33
|
-
declare const MemberEntity:
|
|
34
|
-
id:
|
|
35
|
-
userId:
|
|
36
|
-
organizationId:
|
|
37
|
-
role:
|
|
38
|
-
createdAt:
|
|
39
|
-
user:
|
|
40
|
-
organization:
|
|
33
|
+
declare const MemberEntity: _contractspec_lib_schema734.EntitySpec<{
|
|
34
|
+
id: _contractspec_lib_schema734.EntityScalarField;
|
|
35
|
+
userId: _contractspec_lib_schema734.EntityScalarField;
|
|
36
|
+
organizationId: _contractspec_lib_schema734.EntityScalarField;
|
|
37
|
+
role: _contractspec_lib_schema734.EntityScalarField;
|
|
38
|
+
createdAt: _contractspec_lib_schema734.EntityScalarField;
|
|
39
|
+
user: _contractspec_lib_schema734.EntityRelationField;
|
|
40
|
+
organization: _contractspec_lib_schema734.EntityRelationField;
|
|
41
41
|
}>;
|
|
42
42
|
/**
|
|
43
43
|
* Invitation entity - pending organization invites.
|
|
44
44
|
*/
|
|
45
|
-
declare const InvitationEntity:
|
|
46
|
-
id:
|
|
47
|
-
organizationId:
|
|
48
|
-
email:
|
|
49
|
-
role:
|
|
50
|
-
status:
|
|
51
|
-
acceptedAt:
|
|
52
|
-
expiresAt:
|
|
53
|
-
inviterId:
|
|
54
|
-
teamId:
|
|
55
|
-
createdAt:
|
|
56
|
-
updatedAt:
|
|
57
|
-
organization:
|
|
58
|
-
inviter:
|
|
59
|
-
team:
|
|
45
|
+
declare const InvitationEntity: _contractspec_lib_schema734.EntitySpec<{
|
|
46
|
+
id: _contractspec_lib_schema734.EntityScalarField;
|
|
47
|
+
organizationId: _contractspec_lib_schema734.EntityScalarField;
|
|
48
|
+
email: _contractspec_lib_schema734.EntityScalarField;
|
|
49
|
+
role: _contractspec_lib_schema734.EntityScalarField;
|
|
50
|
+
status: _contractspec_lib_schema734.EntityScalarField;
|
|
51
|
+
acceptedAt: _contractspec_lib_schema734.EntityScalarField;
|
|
52
|
+
expiresAt: _contractspec_lib_schema734.EntityScalarField;
|
|
53
|
+
inviterId: _contractspec_lib_schema734.EntityScalarField;
|
|
54
|
+
teamId: _contractspec_lib_schema734.EntityScalarField;
|
|
55
|
+
createdAt: _contractspec_lib_schema734.EntityScalarField;
|
|
56
|
+
updatedAt: _contractspec_lib_schema734.EntityScalarField;
|
|
57
|
+
organization: _contractspec_lib_schema734.EntityRelationField;
|
|
58
|
+
inviter: _contractspec_lib_schema734.EntityRelationField;
|
|
59
|
+
team: _contractspec_lib_schema734.EntityRelationField;
|
|
60
60
|
}>;
|
|
61
61
|
/**
|
|
62
62
|
* Team entity - team within an organization.
|
|
63
63
|
*/
|
|
64
|
-
declare const TeamEntity:
|
|
65
|
-
id:
|
|
66
|
-
name:
|
|
67
|
-
organizationId:
|
|
68
|
-
createdAt:
|
|
69
|
-
updatedAt:
|
|
70
|
-
organization:
|
|
71
|
-
members:
|
|
72
|
-
invitations:
|
|
64
|
+
declare const TeamEntity: _contractspec_lib_schema734.EntitySpec<{
|
|
65
|
+
id: _contractspec_lib_schema734.EntityScalarField;
|
|
66
|
+
name: _contractspec_lib_schema734.EntityScalarField;
|
|
67
|
+
organizationId: _contractspec_lib_schema734.EntityScalarField;
|
|
68
|
+
createdAt: _contractspec_lib_schema734.EntityScalarField;
|
|
69
|
+
updatedAt: _contractspec_lib_schema734.EntityScalarField;
|
|
70
|
+
organization: _contractspec_lib_schema734.EntityRelationField;
|
|
71
|
+
members: _contractspec_lib_schema734.EntityRelationField;
|
|
72
|
+
invitations: _contractspec_lib_schema734.EntityRelationField;
|
|
73
73
|
}>;
|
|
74
74
|
/**
|
|
75
75
|
* TeamMember entity - user's team membership.
|
|
76
76
|
*/
|
|
77
|
-
declare const TeamMemberEntity:
|
|
78
|
-
id:
|
|
79
|
-
teamId:
|
|
80
|
-
userId:
|
|
81
|
-
createdAt:
|
|
82
|
-
team:
|
|
83
|
-
user:
|
|
77
|
+
declare const TeamMemberEntity: _contractspec_lib_schema734.EntitySpec<{
|
|
78
|
+
id: _contractspec_lib_schema734.EntityScalarField;
|
|
79
|
+
teamId: _contractspec_lib_schema734.EntityScalarField;
|
|
80
|
+
userId: _contractspec_lib_schema734.EntityScalarField;
|
|
81
|
+
createdAt: _contractspec_lib_schema734.EntityScalarField;
|
|
82
|
+
team: _contractspec_lib_schema734.EntityRelationField;
|
|
83
|
+
user: _contractspec_lib_schema734.EntityRelationField;
|
|
84
84
|
}>;
|
|
85
85
|
//#endregion
|
|
86
86
|
export { InvitationEntity, MemberEntity, OrganizationEntity, OrganizationTypeEnum, TeamEntity, TeamMemberEntity };
|