@contractspec/lib.identity-rbac 1.44.0 → 1.45.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/contracts/organization.d.ts +190 -190
- package/dist/contracts/organization.js +13 -13
- package/dist/contracts/organization.js.map +1 -1
- package/dist/contracts/rbac.d.ts +120 -120
- package/dist/contracts/rbac.js +10 -10
- package/dist/contracts/rbac.js.map +1 -1
- package/dist/contracts/user.d.ts +137 -137
- 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/index.d.ts.map +1 -1
- 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.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 +13 -5
package/dist/entities/rbac.d.ts
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema141 from "@contractspec/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/entities/rbac.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Role entity - named set of permissions.
|
|
6
6
|
*/
|
|
7
|
-
declare const RoleEntity:
|
|
8
|
-
id:
|
|
9
|
-
name:
|
|
10
|
-
description:
|
|
11
|
-
permissions:
|
|
12
|
-
createdAt:
|
|
13
|
-
updatedAt:
|
|
14
|
-
policyBindings:
|
|
7
|
+
declare const RoleEntity: _contractspec_lib_schema141.EntitySpec<{
|
|
8
|
+
id: _contractspec_lib_schema141.EntityScalarField;
|
|
9
|
+
name: _contractspec_lib_schema141.EntityScalarField;
|
|
10
|
+
description: _contractspec_lib_schema141.EntityScalarField;
|
|
11
|
+
permissions: _contractspec_lib_schema141.EntityScalarField;
|
|
12
|
+
createdAt: _contractspec_lib_schema141.EntityScalarField;
|
|
13
|
+
updatedAt: _contractspec_lib_schema141.EntityScalarField;
|
|
14
|
+
policyBindings: _contractspec_lib_schema141.EntityRelationField;
|
|
15
15
|
}>;
|
|
16
16
|
/**
|
|
17
17
|
* Permission entity - atomic access right.
|
|
18
18
|
*/
|
|
19
|
-
declare const PermissionEntity:
|
|
20
|
-
id:
|
|
21
|
-
name:
|
|
22
|
-
description:
|
|
23
|
-
createdAt:
|
|
24
|
-
updatedAt:
|
|
19
|
+
declare const PermissionEntity: _contractspec_lib_schema141.EntitySpec<{
|
|
20
|
+
id: _contractspec_lib_schema141.EntityScalarField;
|
|
21
|
+
name: _contractspec_lib_schema141.EntityScalarField;
|
|
22
|
+
description: _contractspec_lib_schema141.EntityScalarField;
|
|
23
|
+
createdAt: _contractspec_lib_schema141.EntityScalarField;
|
|
24
|
+
updatedAt: _contractspec_lib_schema141.EntityScalarField;
|
|
25
25
|
}>;
|
|
26
26
|
/**
|
|
27
27
|
* PolicyBinding entity - binds roles to principals.
|
|
28
28
|
*/
|
|
29
|
-
declare const PolicyBindingEntity:
|
|
30
|
-
id:
|
|
31
|
-
roleId:
|
|
32
|
-
targetType:
|
|
33
|
-
targetId:
|
|
34
|
-
expiresAt:
|
|
35
|
-
createdAt:
|
|
36
|
-
userId:
|
|
37
|
-
organizationId:
|
|
38
|
-
role:
|
|
39
|
-
user:
|
|
40
|
-
organization:
|
|
29
|
+
declare const PolicyBindingEntity: _contractspec_lib_schema141.EntitySpec<{
|
|
30
|
+
id: _contractspec_lib_schema141.EntityScalarField;
|
|
31
|
+
roleId: _contractspec_lib_schema141.EntityScalarField;
|
|
32
|
+
targetType: _contractspec_lib_schema141.EntityScalarField;
|
|
33
|
+
targetId: _contractspec_lib_schema141.EntityScalarField;
|
|
34
|
+
expiresAt: _contractspec_lib_schema141.EntityScalarField;
|
|
35
|
+
createdAt: _contractspec_lib_schema141.EntityScalarField;
|
|
36
|
+
userId: _contractspec_lib_schema141.EntityScalarField;
|
|
37
|
+
organizationId: _contractspec_lib_schema141.EntityScalarField;
|
|
38
|
+
role: _contractspec_lib_schema141.EntityRelationField;
|
|
39
|
+
user: _contractspec_lib_schema141.EntityRelationField;
|
|
40
|
+
organization: _contractspec_lib_schema141.EntityRelationField;
|
|
41
41
|
}>;
|
|
42
42
|
/**
|
|
43
43
|
* ApiKey entity - API keys for programmatic access.
|
|
44
44
|
*/
|
|
45
|
-
declare const ApiKeyEntity:
|
|
46
|
-
id:
|
|
47
|
-
name:
|
|
48
|
-
start:
|
|
49
|
-
prefix:
|
|
50
|
-
key:
|
|
51
|
-
userId:
|
|
52
|
-
refillInterval:
|
|
53
|
-
refillAmount:
|
|
54
|
-
lastRefillAt:
|
|
55
|
-
remaining:
|
|
56
|
-
requestCount:
|
|
57
|
-
lastRequest:
|
|
58
|
-
enabled:
|
|
59
|
-
rateLimitEnabled:
|
|
60
|
-
rateLimitTimeWindow:
|
|
61
|
-
rateLimitMax:
|
|
62
|
-
expiresAt:
|
|
63
|
-
permissions:
|
|
64
|
-
metadata:
|
|
65
|
-
createdAt:
|
|
66
|
-
updatedAt:
|
|
67
|
-
user:
|
|
45
|
+
declare const ApiKeyEntity: _contractspec_lib_schema141.EntitySpec<{
|
|
46
|
+
id: _contractspec_lib_schema141.EntityScalarField;
|
|
47
|
+
name: _contractspec_lib_schema141.EntityScalarField;
|
|
48
|
+
start: _contractspec_lib_schema141.EntityScalarField;
|
|
49
|
+
prefix: _contractspec_lib_schema141.EntityScalarField;
|
|
50
|
+
key: _contractspec_lib_schema141.EntityScalarField;
|
|
51
|
+
userId: _contractspec_lib_schema141.EntityScalarField;
|
|
52
|
+
refillInterval: _contractspec_lib_schema141.EntityScalarField;
|
|
53
|
+
refillAmount: _contractspec_lib_schema141.EntityScalarField;
|
|
54
|
+
lastRefillAt: _contractspec_lib_schema141.EntityScalarField;
|
|
55
|
+
remaining: _contractspec_lib_schema141.EntityScalarField;
|
|
56
|
+
requestCount: _contractspec_lib_schema141.EntityScalarField;
|
|
57
|
+
lastRequest: _contractspec_lib_schema141.EntityScalarField;
|
|
58
|
+
enabled: _contractspec_lib_schema141.EntityScalarField;
|
|
59
|
+
rateLimitEnabled: _contractspec_lib_schema141.EntityScalarField;
|
|
60
|
+
rateLimitTimeWindow: _contractspec_lib_schema141.EntityScalarField;
|
|
61
|
+
rateLimitMax: _contractspec_lib_schema141.EntityScalarField;
|
|
62
|
+
expiresAt: _contractspec_lib_schema141.EntityScalarField;
|
|
63
|
+
permissions: _contractspec_lib_schema141.EntityScalarField;
|
|
64
|
+
metadata: _contractspec_lib_schema141.EntityScalarField;
|
|
65
|
+
createdAt: _contractspec_lib_schema141.EntityScalarField;
|
|
66
|
+
updatedAt: _contractspec_lib_schema141.EntityScalarField;
|
|
67
|
+
user: _contractspec_lib_schema141.EntityRelationField;
|
|
68
68
|
}>;
|
|
69
69
|
/**
|
|
70
70
|
* Passkey entity - WebAuthn passkeys.
|
|
71
71
|
*/
|
|
72
|
-
declare const PasskeyEntity:
|
|
73
|
-
id:
|
|
74
|
-
name:
|
|
75
|
-
publicKey:
|
|
76
|
-
userId:
|
|
77
|
-
credentialID:
|
|
78
|
-
counter:
|
|
79
|
-
deviceType:
|
|
80
|
-
backedUp:
|
|
81
|
-
transports:
|
|
82
|
-
aaguid:
|
|
83
|
-
createdAt:
|
|
84
|
-
user:
|
|
72
|
+
declare const PasskeyEntity: _contractspec_lib_schema141.EntitySpec<{
|
|
73
|
+
id: _contractspec_lib_schema141.EntityScalarField;
|
|
74
|
+
name: _contractspec_lib_schema141.EntityScalarField;
|
|
75
|
+
publicKey: _contractspec_lib_schema141.EntityScalarField;
|
|
76
|
+
userId: _contractspec_lib_schema141.EntityScalarField;
|
|
77
|
+
credentialID: _contractspec_lib_schema141.EntityScalarField;
|
|
78
|
+
counter: _contractspec_lib_schema141.EntityScalarField;
|
|
79
|
+
deviceType: _contractspec_lib_schema141.EntityScalarField;
|
|
80
|
+
backedUp: _contractspec_lib_schema141.EntityScalarField;
|
|
81
|
+
transports: _contractspec_lib_schema141.EntityScalarField;
|
|
82
|
+
aaguid: _contractspec_lib_schema141.EntityScalarField;
|
|
83
|
+
createdAt: _contractspec_lib_schema141.EntityScalarField;
|
|
84
|
+
user: _contractspec_lib_schema141.EntityRelationField;
|
|
85
85
|
}>;
|
|
86
86
|
//#endregion
|
|
87
87
|
export { ApiKeyEntity, PasskeyEntity, PermissionEntity, PolicyBindingEntity, RoleEntity };
|
package/dist/entities/user.d.ts
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema420 from "@contractspec/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/entities/user.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* User entity - core user profile and authentication.
|
|
6
6
|
*/
|
|
7
|
-
declare const UserEntity:
|
|
8
|
-
id:
|
|
9
|
-
email:
|
|
10
|
-
emailVerified:
|
|
11
|
-
name:
|
|
12
|
-
firstName:
|
|
13
|
-
lastName:
|
|
14
|
-
locale:
|
|
15
|
-
timezone:
|
|
16
|
-
imageUrl:
|
|
17
|
-
image:
|
|
18
|
-
metadata:
|
|
19
|
-
onboardingCompleted:
|
|
20
|
-
onboardingStep:
|
|
21
|
-
whitelistedAt:
|
|
22
|
-
role:
|
|
23
|
-
banned:
|
|
24
|
-
banReason:
|
|
25
|
-
banExpires:
|
|
26
|
-
phoneNumber:
|
|
27
|
-
phoneNumberVerified:
|
|
28
|
-
createdAt:
|
|
29
|
-
updatedAt:
|
|
30
|
-
sessions:
|
|
31
|
-
accounts:
|
|
32
|
-
memberships:
|
|
33
|
-
invitations:
|
|
34
|
-
teamMemberships:
|
|
35
|
-
policyBindings:
|
|
36
|
-
apiKeys:
|
|
37
|
-
passkeys:
|
|
7
|
+
declare const UserEntity: _contractspec_lib_schema420.EntitySpec<{
|
|
8
|
+
id: _contractspec_lib_schema420.EntityScalarField;
|
|
9
|
+
email: _contractspec_lib_schema420.EntityScalarField;
|
|
10
|
+
emailVerified: _contractspec_lib_schema420.EntityScalarField;
|
|
11
|
+
name: _contractspec_lib_schema420.EntityScalarField;
|
|
12
|
+
firstName: _contractspec_lib_schema420.EntityScalarField;
|
|
13
|
+
lastName: _contractspec_lib_schema420.EntityScalarField;
|
|
14
|
+
locale: _contractspec_lib_schema420.EntityScalarField;
|
|
15
|
+
timezone: _contractspec_lib_schema420.EntityScalarField;
|
|
16
|
+
imageUrl: _contractspec_lib_schema420.EntityScalarField;
|
|
17
|
+
image: _contractspec_lib_schema420.EntityScalarField;
|
|
18
|
+
metadata: _contractspec_lib_schema420.EntityScalarField;
|
|
19
|
+
onboardingCompleted: _contractspec_lib_schema420.EntityScalarField;
|
|
20
|
+
onboardingStep: _contractspec_lib_schema420.EntityScalarField;
|
|
21
|
+
whitelistedAt: _contractspec_lib_schema420.EntityScalarField;
|
|
22
|
+
role: _contractspec_lib_schema420.EntityScalarField;
|
|
23
|
+
banned: _contractspec_lib_schema420.EntityScalarField;
|
|
24
|
+
banReason: _contractspec_lib_schema420.EntityScalarField;
|
|
25
|
+
banExpires: _contractspec_lib_schema420.EntityScalarField;
|
|
26
|
+
phoneNumber: _contractspec_lib_schema420.EntityScalarField;
|
|
27
|
+
phoneNumberVerified: _contractspec_lib_schema420.EntityScalarField;
|
|
28
|
+
createdAt: _contractspec_lib_schema420.EntityScalarField;
|
|
29
|
+
updatedAt: _contractspec_lib_schema420.EntityScalarField;
|
|
30
|
+
sessions: _contractspec_lib_schema420.EntityRelationField;
|
|
31
|
+
accounts: _contractspec_lib_schema420.EntityRelationField;
|
|
32
|
+
memberships: _contractspec_lib_schema420.EntityRelationField;
|
|
33
|
+
invitations: _contractspec_lib_schema420.EntityRelationField;
|
|
34
|
+
teamMemberships: _contractspec_lib_schema420.EntityRelationField;
|
|
35
|
+
policyBindings: _contractspec_lib_schema420.EntityRelationField;
|
|
36
|
+
apiKeys: _contractspec_lib_schema420.EntityRelationField;
|
|
37
|
+
passkeys: _contractspec_lib_schema420.EntityRelationField;
|
|
38
38
|
}>;
|
|
39
39
|
/**
|
|
40
40
|
* Session entity - login sessions.
|
|
41
41
|
*/
|
|
42
|
-
declare const SessionEntity:
|
|
43
|
-
id:
|
|
44
|
-
userId:
|
|
45
|
-
expiresAt:
|
|
46
|
-
token:
|
|
47
|
-
ipAddress:
|
|
48
|
-
userAgent:
|
|
49
|
-
impersonatedBy:
|
|
50
|
-
activeOrganizationId:
|
|
51
|
-
activeTeamId:
|
|
52
|
-
createdAt:
|
|
53
|
-
updatedAt:
|
|
54
|
-
user:
|
|
42
|
+
declare const SessionEntity: _contractspec_lib_schema420.EntitySpec<{
|
|
43
|
+
id: _contractspec_lib_schema420.EntityScalarField;
|
|
44
|
+
userId: _contractspec_lib_schema420.EntityScalarField;
|
|
45
|
+
expiresAt: _contractspec_lib_schema420.EntityScalarField;
|
|
46
|
+
token: _contractspec_lib_schema420.EntityScalarField;
|
|
47
|
+
ipAddress: _contractspec_lib_schema420.EntityScalarField;
|
|
48
|
+
userAgent: _contractspec_lib_schema420.EntityScalarField;
|
|
49
|
+
impersonatedBy: _contractspec_lib_schema420.EntityScalarField;
|
|
50
|
+
activeOrganizationId: _contractspec_lib_schema420.EntityScalarField;
|
|
51
|
+
activeTeamId: _contractspec_lib_schema420.EntityScalarField;
|
|
52
|
+
createdAt: _contractspec_lib_schema420.EntityScalarField;
|
|
53
|
+
updatedAt: _contractspec_lib_schema420.EntityScalarField;
|
|
54
|
+
user: _contractspec_lib_schema420.EntityRelationField;
|
|
55
55
|
}>;
|
|
56
56
|
/**
|
|
57
57
|
* Account entity - external authentication accounts.
|
|
58
58
|
*/
|
|
59
|
-
declare const AccountEntity:
|
|
60
|
-
id:
|
|
61
|
-
accountId:
|
|
62
|
-
providerId:
|
|
63
|
-
userId:
|
|
64
|
-
accessToken:
|
|
65
|
-
refreshToken:
|
|
66
|
-
idToken:
|
|
67
|
-
accessTokenExpiresAt:
|
|
68
|
-
refreshTokenExpiresAt:
|
|
69
|
-
scope:
|
|
70
|
-
password:
|
|
71
|
-
createdAt:
|
|
72
|
-
updatedAt:
|
|
73
|
-
user:
|
|
59
|
+
declare const AccountEntity: _contractspec_lib_schema420.EntitySpec<{
|
|
60
|
+
id: _contractspec_lib_schema420.EntityScalarField;
|
|
61
|
+
accountId: _contractspec_lib_schema420.EntityScalarField;
|
|
62
|
+
providerId: _contractspec_lib_schema420.EntityScalarField;
|
|
63
|
+
userId: _contractspec_lib_schema420.EntityScalarField;
|
|
64
|
+
accessToken: _contractspec_lib_schema420.EntityScalarField;
|
|
65
|
+
refreshToken: _contractspec_lib_schema420.EntityScalarField;
|
|
66
|
+
idToken: _contractspec_lib_schema420.EntityScalarField;
|
|
67
|
+
accessTokenExpiresAt: _contractspec_lib_schema420.EntityScalarField;
|
|
68
|
+
refreshTokenExpiresAt: _contractspec_lib_schema420.EntityScalarField;
|
|
69
|
+
scope: _contractspec_lib_schema420.EntityScalarField;
|
|
70
|
+
password: _contractspec_lib_schema420.EntityScalarField;
|
|
71
|
+
createdAt: _contractspec_lib_schema420.EntityScalarField;
|
|
72
|
+
updatedAt: _contractspec_lib_schema420.EntityScalarField;
|
|
73
|
+
user: _contractspec_lib_schema420.EntityRelationField;
|
|
74
74
|
}>;
|
|
75
75
|
/**
|
|
76
76
|
* Verification entity - email/phone verification tokens.
|
|
77
77
|
*/
|
|
78
|
-
declare const VerificationEntity:
|
|
79
|
-
id:
|
|
80
|
-
identifier:
|
|
81
|
-
value:
|
|
82
|
-
expiresAt:
|
|
83
|
-
createdAt:
|
|
84
|
-
updatedAt:
|
|
78
|
+
declare const VerificationEntity: _contractspec_lib_schema420.EntitySpec<{
|
|
79
|
+
id: _contractspec_lib_schema420.EntityScalarField;
|
|
80
|
+
identifier: _contractspec_lib_schema420.EntityScalarField;
|
|
81
|
+
value: _contractspec_lib_schema420.EntityScalarField;
|
|
82
|
+
expiresAt: _contractspec_lib_schema420.EntityScalarField;
|
|
83
|
+
createdAt: _contractspec_lib_schema420.EntityScalarField;
|
|
84
|
+
updatedAt: _contractspec_lib_schema420.EntityScalarField;
|
|
85
85
|
}>;
|
|
86
86
|
//#endregion
|
|
87
87
|
export { AccountEntity, SessionEntity, UserEntity, VerificationEntity };
|
package/dist/events.js
CHANGED
|
@@ -384,7 +384,7 @@ const RoleRevokedPayload = new SchemaModel({
|
|
|
384
384
|
const UserCreatedEvent = defineEvent({
|
|
385
385
|
meta: {
|
|
386
386
|
key: "user.created",
|
|
387
|
-
version: 1,
|
|
387
|
+
version: "1.0.0",
|
|
388
388
|
description: "A new user has been created.",
|
|
389
389
|
stability: "stable",
|
|
390
390
|
owners: ["@platform.identity-rbac"],
|
|
@@ -402,7 +402,7 @@ const UserCreatedEvent = defineEvent({
|
|
|
402
402
|
const UserUpdatedEvent = defineEvent({
|
|
403
403
|
meta: {
|
|
404
404
|
key: "user.updated",
|
|
405
|
-
version: 1,
|
|
405
|
+
version: "1.0.0",
|
|
406
406
|
description: "A user profile has been updated.",
|
|
407
407
|
stability: "stable",
|
|
408
408
|
owners: ["@platform.identity-rbac"],
|
|
@@ -420,7 +420,7 @@ const UserUpdatedEvent = defineEvent({
|
|
|
420
420
|
const UserDeletedEvent = defineEvent({
|
|
421
421
|
meta: {
|
|
422
422
|
key: "user.deleted",
|
|
423
|
-
version: 1,
|
|
423
|
+
version: "1.0.0",
|
|
424
424
|
description: "A user account has been deleted.",
|
|
425
425
|
stability: "stable",
|
|
426
426
|
owners: ["@platform.identity-rbac"],
|
|
@@ -439,7 +439,7 @@ const UserDeletedEvent = defineEvent({
|
|
|
439
439
|
const UserEmailVerifiedEvent = defineEvent({
|
|
440
440
|
meta: {
|
|
441
441
|
key: "user.email_verified",
|
|
442
|
-
version: 1,
|
|
442
|
+
version: "1.0.0",
|
|
443
443
|
description: "A user has verified their email address.",
|
|
444
444
|
stability: "stable",
|
|
445
445
|
owners: ["@platform.identity-rbac"],
|
|
@@ -457,7 +457,7 @@ const UserEmailVerifiedEvent = defineEvent({
|
|
|
457
457
|
const OrgCreatedEvent = defineEvent({
|
|
458
458
|
meta: {
|
|
459
459
|
key: "org.created",
|
|
460
|
-
version: 1,
|
|
460
|
+
version: "1.0.0",
|
|
461
461
|
description: "A new organization has been created.",
|
|
462
462
|
stability: "stable",
|
|
463
463
|
owners: ["@platform.identity-rbac"],
|
|
@@ -475,7 +475,7 @@ const OrgCreatedEvent = defineEvent({
|
|
|
475
475
|
const OrgUpdatedEvent = defineEvent({
|
|
476
476
|
meta: {
|
|
477
477
|
key: "org.updated",
|
|
478
|
-
version: 1,
|
|
478
|
+
version: "1.0.0",
|
|
479
479
|
description: "An organization has been updated.",
|
|
480
480
|
stability: "stable",
|
|
481
481
|
owners: ["@platform.identity-rbac"],
|
|
@@ -493,7 +493,7 @@ const OrgUpdatedEvent = defineEvent({
|
|
|
493
493
|
const OrgDeletedEvent = defineEvent({
|
|
494
494
|
meta: {
|
|
495
495
|
key: "org.deleted",
|
|
496
|
-
version: 1,
|
|
496
|
+
version: "1.0.0",
|
|
497
497
|
description: "An organization has been deleted.",
|
|
498
498
|
stability: "stable",
|
|
499
499
|
owners: ["@platform.identity-rbac"],
|
|
@@ -511,7 +511,7 @@ const OrgDeletedEvent = defineEvent({
|
|
|
511
511
|
const OrgMemberAddedEvent = defineEvent({
|
|
512
512
|
meta: {
|
|
513
513
|
key: "org.member.added",
|
|
514
|
-
version: 1,
|
|
514
|
+
version: "1.0.0",
|
|
515
515
|
description: "A user has joined an organization.",
|
|
516
516
|
stability: "stable",
|
|
517
517
|
owners: ["@platform.identity-rbac"],
|
|
@@ -530,7 +530,7 @@ const OrgMemberAddedEvent = defineEvent({
|
|
|
530
530
|
const OrgMemberRemovedEvent = defineEvent({
|
|
531
531
|
meta: {
|
|
532
532
|
key: "org.member.removed",
|
|
533
|
-
version: 1,
|
|
533
|
+
version: "1.0.0",
|
|
534
534
|
description: "A user has left or been removed from an organization.",
|
|
535
535
|
stability: "stable",
|
|
536
536
|
owners: ["@platform.identity-rbac"],
|
|
@@ -549,7 +549,7 @@ const OrgMemberRemovedEvent = defineEvent({
|
|
|
549
549
|
const OrgMemberRoleChangedEvent = defineEvent({
|
|
550
550
|
meta: {
|
|
551
551
|
key: "org.member.role_changed",
|
|
552
|
-
version: 1,
|
|
552
|
+
version: "1.0.0",
|
|
553
553
|
description: "A member's role in an organization has changed.",
|
|
554
554
|
stability: "stable",
|
|
555
555
|
owners: ["@platform.identity-rbac"],
|
|
@@ -569,7 +569,7 @@ const OrgMemberRoleChangedEvent = defineEvent({
|
|
|
569
569
|
const OrgInviteSentEvent = defineEvent({
|
|
570
570
|
meta: {
|
|
571
571
|
key: "org.invite.sent",
|
|
572
|
-
version: 1,
|
|
572
|
+
version: "1.0.0",
|
|
573
573
|
description: "An invitation to join an organization has been sent.",
|
|
574
574
|
stability: "stable",
|
|
575
575
|
owners: ["@platform.identity-rbac"],
|
|
@@ -589,7 +589,7 @@ const OrgInviteSentEvent = defineEvent({
|
|
|
589
589
|
const OrgInviteAcceptedEvent = defineEvent({
|
|
590
590
|
meta: {
|
|
591
591
|
key: "org.invite.accepted",
|
|
592
|
-
version: 1,
|
|
592
|
+
version: "1.0.0",
|
|
593
593
|
description: "An invitation has been accepted.",
|
|
594
594
|
stability: "stable",
|
|
595
595
|
owners: ["@platform.identity-rbac"],
|
|
@@ -608,7 +608,7 @@ const OrgInviteAcceptedEvent = defineEvent({
|
|
|
608
608
|
const OrgInviteDeclinedEvent = defineEvent({
|
|
609
609
|
meta: {
|
|
610
610
|
key: "org.invite.declined",
|
|
611
|
-
version: 1,
|
|
611
|
+
version: "1.0.0",
|
|
612
612
|
description: "An invitation has been declined.",
|
|
613
613
|
stability: "stable",
|
|
614
614
|
owners: ["@platform.identity-rbac"],
|
|
@@ -627,7 +627,7 @@ const OrgInviteDeclinedEvent = defineEvent({
|
|
|
627
627
|
const RoleAssignedEvent = defineEvent({
|
|
628
628
|
meta: {
|
|
629
629
|
key: "role.assigned",
|
|
630
|
-
version: 1,
|
|
630
|
+
version: "1.0.0",
|
|
631
631
|
description: "A role has been assigned.",
|
|
632
632
|
stability: "stable",
|
|
633
633
|
owners: ["@platform.identity-rbac"],
|
|
@@ -645,7 +645,7 @@ const RoleAssignedEvent = defineEvent({
|
|
|
645
645
|
const RoleRevokedEvent = defineEvent({
|
|
646
646
|
meta: {
|
|
647
647
|
key: "role.revoked",
|
|
648
|
-
version: 1,
|
|
648
|
+
version: "1.0.0",
|
|
649
649
|
description: "A role has been revoked.",
|
|
650
650
|
stability: "stable",
|
|
651
651
|
owners: ["@platform.identity-rbac"],
|
package/dist/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","names":[],"sources":["../src/events.ts"],"sourcesContent":["import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport { defineEvent } from '@contractspec/lib.contracts';\n\n// ============ User Event Payloads ============\n\nconst UserCreatedPayload = new SchemaModel({\n name: 'UserCreatedPayload',\n description: 'Payload for user created event',\n fields: {\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst UserUpdatedPayload = new SchemaModel({\n name: 'UserUpdatedPayload',\n description: 'Payload for user updated event',\n fields: {\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n updatedFields: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n isArray: true,\n },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst UserDeletedPayload = new SchemaModel({\n name: 'UserDeletedPayload',\n description: 'Payload for user deleted event',\n fields: {\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n deletedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst UserEmailVerifiedPayload = new SchemaModel({\n name: 'UserEmailVerifiedPayload',\n description: 'Payload for user email verified event',\n fields: {\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n verifiedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ Organization Event Payloads ============\n\nconst OrgCreatedPayload = new SchemaModel({\n name: 'OrgCreatedPayload',\n description: 'Payload for org created event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrgUpdatedPayload = new SchemaModel({\n name: 'OrgUpdatedPayload',\n description: 'Payload for org updated event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n updatedFields: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n isArray: true,\n },\n updatedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrgDeletedPayload = new SchemaModel({\n name: 'OrgDeletedPayload',\n description: 'Payload for org deleted event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n deletedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n deletedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ Member Event Payloads ============\n\nconst OrgMemberAddedPayload = new SchemaModel({\n name: 'OrgMemberAddedPayload',\n description: 'Payload for member added event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n invitedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n joinedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrgMemberRemovedPayload = new SchemaModel({\n name: 'OrgMemberRemovedPayload',\n description: 'Payload for member removed event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n removedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }, // left | removed | banned\n removedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrgMemberRoleChangedPayload = new SchemaModel({\n name: 'OrgMemberRoleChangedPayload',\n description: 'Payload for member role changed event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n previousRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n newRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n changedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n changedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ Invitation Event Payloads ============\n\nconst OrgInviteSentPayload = new SchemaModel({\n name: 'OrgInviteSentPayload',\n description: 'Payload for invite sent event',\n fields: {\n invitationId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n invitedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n sentAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrgInviteAcceptedPayload = new SchemaModel({\n name: 'OrgInviteAcceptedPayload',\n description: 'Payload for invite accepted event',\n fields: {\n invitationId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n acceptedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrgInviteDeclinedPayload = new SchemaModel({\n name: 'OrgInviteDeclinedPayload',\n description: 'Payload for invite declined event',\n fields: {\n invitationId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n declinedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ Role Event Payloads ============\n\nconst RoleAssignedPayload = new SchemaModel({\n name: 'RoleAssignedPayload',\n description: 'Payload for role assigned event',\n fields: {\n bindingId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n roleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n roleName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n targetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // user | organization\n targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n assignedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n assignedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst RoleRevokedPayload = new SchemaModel({\n name: 'RoleRevokedPayload',\n description: 'Payload for role revoked event',\n fields: {\n bindingId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n roleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n roleName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n targetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // user | organization\n targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n revokedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n revokedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ User Events ============\n\n/**\n * Emitted when a new user is created.\n */\nexport const UserCreatedEvent = defineEvent({\n meta: {\n key: 'user.created',\n version: 1,\n description: 'A new user has been created.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['user', 'created', 'identity'],\n },\n payload: UserCreatedPayload,\n});\n\n/**\n * Emitted when a user profile is updated.\n */\nexport const UserUpdatedEvent = defineEvent({\n meta: {\n key: 'user.updated',\n version: 1,\n description: 'A user profile has been updated.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['user', 'updated', 'identity'],\n },\n payload: UserUpdatedPayload,\n});\n\n/**\n * Emitted when a user is deleted.\n */\nexport const UserDeletedEvent = defineEvent({\n meta: {\n key: 'user.deleted',\n version: 1,\n description: 'A user account has been deleted.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['user', 'deleted', 'identity'],\n },\n pii: ['email'],\n payload: UserDeletedPayload,\n});\n\n/**\n * Emitted when a user's email is verified.\n */\nexport const UserEmailVerifiedEvent = defineEvent({\n meta: {\n key: 'user.email_verified',\n version: 1,\n description: 'A user has verified their email address.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['user', 'verified', 'identity'],\n },\n payload: UserEmailVerifiedPayload,\n});\n\n// ============ Organization Events ============\n\n/**\n * Emitted when a new organization is created.\n */\nexport const OrgCreatedEvent = defineEvent({\n meta: {\n key: 'org.created',\n version: 1,\n description: 'A new organization has been created.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'created', 'identity'],\n },\n payload: OrgCreatedPayload,\n});\n\n/**\n * Emitted when an organization is updated.\n */\nexport const OrgUpdatedEvent = defineEvent({\n meta: {\n key: 'org.updated',\n version: 1,\n description: 'An organization has been updated.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'updated', 'identity'],\n },\n payload: OrgUpdatedPayload,\n});\n\n/**\n * Emitted when an organization is deleted.\n */\nexport const OrgDeletedEvent = defineEvent({\n meta: {\n key: 'org.deleted',\n version: 1,\n description: 'An organization has been deleted.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'deleted', 'identity'],\n },\n payload: OrgDeletedPayload,\n});\n\n// ============ Member Events ============\n\n/**\n * Emitted when a member joins an organization.\n */\nexport const OrgMemberAddedEvent = defineEvent({\n meta: {\n key: 'org.member.added',\n version: 1,\n description: 'A user has joined an organization.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'member', 'added', 'identity'],\n },\n payload: OrgMemberAddedPayload,\n});\n\n/**\n * Emitted when a member leaves or is removed from an organization.\n */\nexport const OrgMemberRemovedEvent = defineEvent({\n meta: {\n key: 'org.member.removed',\n version: 1,\n description: 'A user has left or been removed from an organization.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'member', 'removed', 'identity'],\n },\n payload: OrgMemberRemovedPayload,\n});\n\n/**\n * Emitted when a member's role is changed.\n */\nexport const OrgMemberRoleChangedEvent = defineEvent({\n meta: {\n key: 'org.member.role_changed',\n version: 1,\n description: \"A member's role in an organization has changed.\",\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'member', 'role', 'changed', 'identity'],\n },\n payload: OrgMemberRoleChangedPayload,\n});\n\n// ============ Invitation Events ============\n\n/**\n * Emitted when an invitation is sent.\n */\nexport const OrgInviteSentEvent = defineEvent({\n meta: {\n key: 'org.invite.sent',\n version: 1,\n description: 'An invitation to join an organization has been sent.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'invite', 'sent', 'identity'],\n },\n pii: ['email'],\n payload: OrgInviteSentPayload,\n});\n\n/**\n * Emitted when an invitation is accepted.\n */\nexport const OrgInviteAcceptedEvent = defineEvent({\n meta: {\n key: 'org.invite.accepted',\n version: 1,\n description: 'An invitation has been accepted.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'invite', 'accepted', 'identity'],\n },\n payload: OrgInviteAcceptedPayload,\n});\n\n/**\n * Emitted when an invitation is declined.\n */\nexport const OrgInviteDeclinedEvent = defineEvent({\n meta: {\n key: 'org.invite.declined',\n version: 1,\n description: 'An invitation has been declined.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'invite', 'declined', 'identity'],\n },\n payload: OrgInviteDeclinedPayload,\n});\n\n// ============ Role Events ============\n\n/**\n * Emitted when a role is assigned to a user or organization.\n */\nexport const RoleAssignedEvent = defineEvent({\n meta: {\n key: 'role.assigned',\n version: 1,\n description: 'A role has been assigned.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['role', 'assigned', 'identity'],\n },\n payload: RoleAssignedPayload,\n});\n\n/**\n * Emitted when a role is revoked from a user or organization.\n */\nexport const RoleRevokedEvent = defineEvent({\n meta: {\n key: 'role.revoked',\n version: 1,\n description: 'A role has been revoked.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['role', 'revoked', 'identity'],\n },\n payload: RoleRevokedPayload,\n});\n\n// ============ All Events ============\n\n/**\n * All identity-rbac events.\n */\nexport const IdentityRbacEvents = {\n UserCreatedEvent,\n UserUpdatedEvent,\n UserDeletedEvent,\n UserEmailVerifiedEvent,\n OrgCreatedEvent,\n OrgUpdatedEvent,\n OrgDeletedEvent,\n OrgMemberAddedEvent,\n OrgMemberRemovedEvent,\n OrgMemberRoleChangedEvent,\n OrgInviteSentEvent,\n OrgInviteAcceptedEvent,\n OrgInviteDeclinedEvent,\n RoleAssignedEvent,\n RoleRevokedEvent,\n};\n"],"mappings":";;;;AAKA,MAAM,qBAAqB,IAAI,YAAY;CACzC,MAAM;CACN,aAAa;CACb,QAAQ;EACN,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EAClE,W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;EAChD;CACD,SAAS;CACV,CAAC;;;;AAOF,MAAa,oBAAoB,YAAY;CAC3C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,0BAA0B;EACnC,MAAM;GAAC;GAAQ;GAAY;GAAW;EACvC;CACD,SAAS;CACV,CAAC;;;;AAKF,MAAa,mBAAmB,YAAY;CAC1C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,0BAA0B;EACnC,MAAM;GAAC;GAAQ;GAAW;GAAW;EACtC;CACD,SAAS;CACV,CAAC;;;;AAOF,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
1
|
+
{"version":3,"file":"events.js","names":[],"sources":["../src/events.ts"],"sourcesContent":["import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport { defineEvent } from '@contractspec/lib.contracts';\n\n// ============ User Event Payloads ============\n\nconst UserCreatedPayload = new SchemaModel({\n name: 'UserCreatedPayload',\n description: 'Payload for user created event',\n fields: {\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst UserUpdatedPayload = new SchemaModel({\n name: 'UserUpdatedPayload',\n description: 'Payload for user updated event',\n fields: {\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n updatedFields: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n isArray: true,\n },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst UserDeletedPayload = new SchemaModel({\n name: 'UserDeletedPayload',\n description: 'Payload for user deleted event',\n fields: {\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n deletedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst UserEmailVerifiedPayload = new SchemaModel({\n name: 'UserEmailVerifiedPayload',\n description: 'Payload for user email verified event',\n fields: {\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n verifiedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ Organization Event Payloads ============\n\nconst OrgCreatedPayload = new SchemaModel({\n name: 'OrgCreatedPayload',\n description: 'Payload for org created event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrgUpdatedPayload = new SchemaModel({\n name: 'OrgUpdatedPayload',\n description: 'Payload for org updated event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n updatedFields: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n isArray: true,\n },\n updatedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrgDeletedPayload = new SchemaModel({\n name: 'OrgDeletedPayload',\n description: 'Payload for org deleted event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n deletedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n deletedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ Member Event Payloads ============\n\nconst OrgMemberAddedPayload = new SchemaModel({\n name: 'OrgMemberAddedPayload',\n description: 'Payload for member added event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n invitedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n joinedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrgMemberRemovedPayload = new SchemaModel({\n name: 'OrgMemberRemovedPayload',\n description: 'Payload for member removed event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n removedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }, // left | removed | banned\n removedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrgMemberRoleChangedPayload = new SchemaModel({\n name: 'OrgMemberRoleChangedPayload',\n description: 'Payload for member role changed event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n previousRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n newRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n changedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n changedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ Invitation Event Payloads ============\n\nconst OrgInviteSentPayload = new SchemaModel({\n name: 'OrgInviteSentPayload',\n description: 'Payload for invite sent event',\n fields: {\n invitationId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n invitedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n sentAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrgInviteAcceptedPayload = new SchemaModel({\n name: 'OrgInviteAcceptedPayload',\n description: 'Payload for invite accepted event',\n fields: {\n invitationId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n acceptedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst OrgInviteDeclinedPayload = new SchemaModel({\n name: 'OrgInviteDeclinedPayload',\n description: 'Payload for invite declined event',\n fields: {\n invitationId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n declinedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ Role Event Payloads ============\n\nconst RoleAssignedPayload = new SchemaModel({\n name: 'RoleAssignedPayload',\n description: 'Payload for role assigned event',\n fields: {\n bindingId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n roleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n roleName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n targetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // user | organization\n targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n assignedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n assignedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst RoleRevokedPayload = new SchemaModel({\n name: 'RoleRevokedPayload',\n description: 'Payload for role revoked event',\n fields: {\n bindingId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n roleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n roleName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n targetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // user | organization\n targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n revokedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n revokedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ User Events ============\n\n/**\n * Emitted when a new user is created.\n */\nexport const UserCreatedEvent = defineEvent({\n meta: {\n key: 'user.created',\n version: '1.0.0',\n description: 'A new user has been created.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['user', 'created', 'identity'],\n },\n payload: UserCreatedPayload,\n});\n\n/**\n * Emitted when a user profile is updated.\n */\nexport const UserUpdatedEvent = defineEvent({\n meta: {\n key: 'user.updated',\n version: '1.0.0',\n description: 'A user profile has been updated.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['user', 'updated', 'identity'],\n },\n payload: UserUpdatedPayload,\n});\n\n/**\n * Emitted when a user is deleted.\n */\nexport const UserDeletedEvent = defineEvent({\n meta: {\n key: 'user.deleted',\n version: '1.0.0',\n description: 'A user account has been deleted.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['user', 'deleted', 'identity'],\n },\n pii: ['email'],\n payload: UserDeletedPayload,\n});\n\n/**\n * Emitted when a user's email is verified.\n */\nexport const UserEmailVerifiedEvent = defineEvent({\n meta: {\n key: 'user.email_verified',\n version: '1.0.0',\n description: 'A user has verified their email address.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['user', 'verified', 'identity'],\n },\n payload: UserEmailVerifiedPayload,\n});\n\n// ============ Organization Events ============\n\n/**\n * Emitted when a new organization is created.\n */\nexport const OrgCreatedEvent = defineEvent({\n meta: {\n key: 'org.created',\n version: '1.0.0',\n description: 'A new organization has been created.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'created', 'identity'],\n },\n payload: OrgCreatedPayload,\n});\n\n/**\n * Emitted when an organization is updated.\n */\nexport const OrgUpdatedEvent = defineEvent({\n meta: {\n key: 'org.updated',\n version: '1.0.0',\n description: 'An organization has been updated.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'updated', 'identity'],\n },\n payload: OrgUpdatedPayload,\n});\n\n/**\n * Emitted when an organization is deleted.\n */\nexport const OrgDeletedEvent = defineEvent({\n meta: {\n key: 'org.deleted',\n version: '1.0.0',\n description: 'An organization has been deleted.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'deleted', 'identity'],\n },\n payload: OrgDeletedPayload,\n});\n\n// ============ Member Events ============\n\n/**\n * Emitted when a member joins an organization.\n */\nexport const OrgMemberAddedEvent = defineEvent({\n meta: {\n key: 'org.member.added',\n version: '1.0.0',\n description: 'A user has joined an organization.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'member', 'added', 'identity'],\n },\n payload: OrgMemberAddedPayload,\n});\n\n/**\n * Emitted when a member leaves or is removed from an organization.\n */\nexport const OrgMemberRemovedEvent = defineEvent({\n meta: {\n key: 'org.member.removed',\n version: '1.0.0',\n description: 'A user has left or been removed from an organization.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'member', 'removed', 'identity'],\n },\n payload: OrgMemberRemovedPayload,\n});\n\n/**\n * Emitted when a member's role is changed.\n */\nexport const OrgMemberRoleChangedEvent = defineEvent({\n meta: {\n key: 'org.member.role_changed',\n version: '1.0.0',\n description: \"A member's role in an organization has changed.\",\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'member', 'role', 'changed', 'identity'],\n },\n payload: OrgMemberRoleChangedPayload,\n});\n\n// ============ Invitation Events ============\n\n/**\n * Emitted when an invitation is sent.\n */\nexport const OrgInviteSentEvent = defineEvent({\n meta: {\n key: 'org.invite.sent',\n version: '1.0.0',\n description: 'An invitation to join an organization has been sent.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'invite', 'sent', 'identity'],\n },\n pii: ['email'],\n payload: OrgInviteSentPayload,\n});\n\n/**\n * Emitted when an invitation is accepted.\n */\nexport const OrgInviteAcceptedEvent = defineEvent({\n meta: {\n key: 'org.invite.accepted',\n version: '1.0.0',\n description: 'An invitation has been accepted.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'invite', 'accepted', 'identity'],\n },\n payload: OrgInviteAcceptedPayload,\n});\n\n/**\n * Emitted when an invitation is declined.\n */\nexport const OrgInviteDeclinedEvent = defineEvent({\n meta: {\n key: 'org.invite.declined',\n version: '1.0.0',\n description: 'An invitation has been declined.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['org', 'invite', 'declined', 'identity'],\n },\n payload: OrgInviteDeclinedPayload,\n});\n\n// ============ Role Events ============\n\n/**\n * Emitted when a role is assigned to a user or organization.\n */\nexport const RoleAssignedEvent = defineEvent({\n meta: {\n key: 'role.assigned',\n version: '1.0.0',\n description: 'A role has been assigned.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['role', 'assigned', 'identity'],\n },\n payload: RoleAssignedPayload,\n});\n\n/**\n * Emitted when a role is revoked from a user or organization.\n */\nexport const RoleRevokedEvent = defineEvent({\n meta: {\n key: 'role.revoked',\n version: '1.0.0',\n description: 'A role has been revoked.',\n stability: 'stable',\n owners: ['@platform.identity-rbac'],\n tags: ['role', 'revoked', 'identity'],\n },\n payload: RoleRevokedPayload,\n});\n\n// ============ All Events ============\n\n/**\n * All identity-rbac events.\n */\nexport const IdentityRbacEvents = {\n UserCreatedEvent,\n UserUpdatedEvent,\n UserDeletedEvent,\n UserEmailVerifiedEvent,\n OrgCreatedEvent,\n OrgUpdatedEvent,\n OrgDeletedEvent,\n OrgMemberAddedEvent,\n OrgMemberRemovedEvent,\n OrgMemberRoleChangedEvent,\n OrgInviteSentEvent,\n OrgInviteAcceptedEvent,\n OrgInviteDeclinedEvent,\n RoleAssignedEvent,\n RoleRevokedEvent,\n};\n"],"mappings":";;;;AAKA,MAAM,qBAAqB,IAAI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