@contractspec/lib.identity-rbac 1.57.0 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/contracts/index.js +1045 -0
- package/dist/browser/contracts/organization.js +655 -0
- package/dist/browser/contracts/rbac.js +599 -0
- package/dist/browser/contracts/user.js +235 -0
- package/dist/browser/entities/index.js +464 -0
- package/dist/browser/entities/organization.js +150 -0
- package/dist/browser/entities/rbac.js +124 -0
- package/dist/browser/entities/user.js +168 -0
- package/dist/browser/events.js +374 -0
- package/dist/browser/identity-rbac.capability.js +28 -0
- package/dist/browser/identity-rbac.feature.js +67 -0
- package/dist/browser/index.js +2099 -0
- package/dist/browser/policies/engine.js +154 -0
- package/dist/browser/policies/index.js +154 -0
- package/dist/contracts/index.d.ts +4 -4
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +1045 -4
- package/dist/contracts/organization.d.ts +758 -764
- package/dist/contracts/organization.d.ts.map +1 -1
- package/dist/contracts/organization.js +653 -602
- package/dist/contracts/rbac.d.ts +517 -523
- package/dist/contracts/rbac.d.ts.map +1 -1
- package/dist/contracts/rbac.js +597 -481
- package/dist/contracts/user.d.ts +513 -519
- package/dist/contracts/user.d.ts.map +1 -1
- package/dist/contracts/user.js +222 -319
- package/dist/entities/index.d.ts +164 -169
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +462 -33
- package/dist/entities/organization.d.ts +58 -63
- package/dist/entities/organization.d.ts.map +1 -1
- package/dist/entities/organization.js +145 -145
- package/dist/entities/rbac.d.ts +62 -67
- package/dist/entities/rbac.d.ts.map +1 -1
- package/dist/entities/rbac.js +119 -132
- package/dist/entities/user.d.ts +66 -71
- package/dist/entities/user.d.ts.map +1 -1
- package/dist/entities/user.js +164 -189
- package/dist/events.d.ts +537 -543
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +343 -651
- package/dist/identity-rbac.capability.d.ts +2 -7
- package/dist/identity-rbac.capability.d.ts.map +1 -1
- package/dist/identity-rbac.capability.js +29 -29
- package/dist/identity-rbac.feature.d.ts +1 -6
- package/dist/identity-rbac.feature.d.ts.map +1 -1
- package/dist/identity-rbac.feature.js +66 -193
- package/dist/index.d.ts +6 -12
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2100 -14
- package/dist/node/contracts/index.js +1045 -0
- package/dist/node/contracts/organization.js +655 -0
- package/dist/node/contracts/rbac.js +599 -0
- package/dist/node/contracts/user.js +235 -0
- package/dist/node/entities/index.js +464 -0
- package/dist/node/entities/organization.js +150 -0
- package/dist/node/entities/rbac.js +124 -0
- package/dist/node/entities/user.js +168 -0
- package/dist/node/events.js +374 -0
- package/dist/node/identity-rbac.capability.js +28 -0
- package/dist/node/identity-rbac.feature.js +67 -0
- package/dist/node/index.js +2099 -0
- package/dist/node/policies/engine.js +154 -0
- package/dist/node/policies/index.js +154 -0
- package/dist/policies/engine.d.ts +98 -101
- package/dist/policies/engine.d.ts.map +1 -1
- package/dist/policies/engine.js +151 -164
- package/dist/policies/index.d.ts +2 -2
- package/dist/policies/index.d.ts.map +1 -0
- package/dist/policies/index.js +154 -2
- package/package.json +149 -40
- package/dist/contracts/organization.js.map +0 -1
- package/dist/contracts/rbac.js.map +0 -1
- package/dist/contracts/user.js.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/entities/organization.js.map +0 -1
- package/dist/entities/rbac.js.map +0 -1
- package/dist/entities/user.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/identity-rbac.capability.js.map +0 -1
- package/dist/identity-rbac.feature.js.map +0 -1
- package/dist/policies/engine.js.map +0 -1
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
// src/events.ts
|
|
2
|
+
import { SchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
3
|
+
import { defineEvent } from "@contractspec/lib.contracts";
|
|
4
|
+
var UserCreatedPayload = new SchemaModel({
|
|
5
|
+
name: "UserCreatedPayload",
|
|
6
|
+
description: "Payload for user created event",
|
|
7
|
+
fields: {
|
|
8
|
+
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },
|
|
10
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
11
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var UserUpdatedPayload = new SchemaModel({
|
|
15
|
+
name: "UserUpdatedPayload",
|
|
16
|
+
description: "Payload for user updated event",
|
|
17
|
+
fields: {
|
|
18
|
+
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
+
updatedFields: {
|
|
20
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
21
|
+
isOptional: false,
|
|
22
|
+
isArray: true
|
|
23
|
+
},
|
|
24
|
+
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
var UserDeletedPayload = new SchemaModel({
|
|
28
|
+
name: "UserDeletedPayload",
|
|
29
|
+
description: "Payload for user deleted event",
|
|
30
|
+
fields: {
|
|
31
|
+
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
32
|
+
email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },
|
|
33
|
+
deletedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
var UserEmailVerifiedPayload = new SchemaModel({
|
|
37
|
+
name: "UserEmailVerifiedPayload",
|
|
38
|
+
description: "Payload for user email verified event",
|
|
39
|
+
fields: {
|
|
40
|
+
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
41
|
+
email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },
|
|
42
|
+
verifiedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
var OrgCreatedPayload = new SchemaModel({
|
|
46
|
+
name: "OrgCreatedPayload",
|
|
47
|
+
description: "Payload for org created event",
|
|
48
|
+
fields: {
|
|
49
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
50
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
51
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
52
|
+
createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
53
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
var OrgUpdatedPayload = new SchemaModel({
|
|
57
|
+
name: "OrgUpdatedPayload",
|
|
58
|
+
description: "Payload for org updated event",
|
|
59
|
+
fields: {
|
|
60
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
61
|
+
updatedFields: {
|
|
62
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
63
|
+
isOptional: false,
|
|
64
|
+
isArray: true
|
|
65
|
+
},
|
|
66
|
+
updatedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
67
|
+
updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
var OrgDeletedPayload = new SchemaModel({
|
|
71
|
+
name: "OrgDeletedPayload",
|
|
72
|
+
description: "Payload for org deleted event",
|
|
73
|
+
fields: {
|
|
74
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
75
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
76
|
+
deletedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
77
|
+
deletedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
var OrgMemberAddedPayload = new SchemaModel({
|
|
81
|
+
name: "OrgMemberAddedPayload",
|
|
82
|
+
description: "Payload for member added event",
|
|
83
|
+
fields: {
|
|
84
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
85
|
+
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
86
|
+
role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
87
|
+
invitedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
88
|
+
joinedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
var OrgMemberRemovedPayload = new SchemaModel({
|
|
92
|
+
name: "OrgMemberRemovedPayload",
|
|
93
|
+
description: "Payload for member removed event",
|
|
94
|
+
fields: {
|
|
95
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
96
|
+
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
97
|
+
removedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
98
|
+
reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
99
|
+
removedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
var OrgMemberRoleChangedPayload = new SchemaModel({
|
|
103
|
+
name: "OrgMemberRoleChangedPayload",
|
|
104
|
+
description: "Payload for member role changed event",
|
|
105
|
+
fields: {
|
|
106
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
107
|
+
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
108
|
+
previousRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
109
|
+
newRole: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
110
|
+
changedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
111
|
+
changedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
var OrgInviteSentPayload = new SchemaModel({
|
|
115
|
+
name: "OrgInviteSentPayload",
|
|
116
|
+
description: "Payload for invite sent event",
|
|
117
|
+
fields: {
|
|
118
|
+
invitationId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
119
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
120
|
+
email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },
|
|
121
|
+
role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
122
|
+
invitedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
123
|
+
expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
124
|
+
sentAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
var OrgInviteAcceptedPayload = new SchemaModel({
|
|
128
|
+
name: "OrgInviteAcceptedPayload",
|
|
129
|
+
description: "Payload for invite accepted event",
|
|
130
|
+
fields: {
|
|
131
|
+
invitationId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
132
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
133
|
+
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
134
|
+
acceptedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
var OrgInviteDeclinedPayload = new SchemaModel({
|
|
138
|
+
name: "OrgInviteDeclinedPayload",
|
|
139
|
+
description: "Payload for invite declined event",
|
|
140
|
+
fields: {
|
|
141
|
+
invitationId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
142
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
143
|
+
declinedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
var RoleAssignedPayload = new SchemaModel({
|
|
147
|
+
name: "RoleAssignedPayload",
|
|
148
|
+
description: "Payload for role assigned event",
|
|
149
|
+
fields: {
|
|
150
|
+
bindingId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
151
|
+
roleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
152
|
+
roleName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
153
|
+
targetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
154
|
+
targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
155
|
+
assignedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
156
|
+
expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
157
|
+
assignedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
var RoleRevokedPayload = new SchemaModel({
|
|
161
|
+
name: "RoleRevokedPayload",
|
|
162
|
+
description: "Payload for role revoked event",
|
|
163
|
+
fields: {
|
|
164
|
+
bindingId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
165
|
+
roleId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
166
|
+
roleName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
167
|
+
targetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
168
|
+
targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
169
|
+
revokedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
170
|
+
revokedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
var UserCreatedEvent = defineEvent({
|
|
174
|
+
meta: {
|
|
175
|
+
key: "user.created",
|
|
176
|
+
version: "1.0.0",
|
|
177
|
+
description: "A new user has been created.",
|
|
178
|
+
stability: "stable",
|
|
179
|
+
owners: ["@platform.identity-rbac"],
|
|
180
|
+
tags: ["user", "created", "identity"]
|
|
181
|
+
},
|
|
182
|
+
payload: UserCreatedPayload
|
|
183
|
+
});
|
|
184
|
+
var UserUpdatedEvent = defineEvent({
|
|
185
|
+
meta: {
|
|
186
|
+
key: "user.updated",
|
|
187
|
+
version: "1.0.0",
|
|
188
|
+
description: "A user profile has been updated.",
|
|
189
|
+
stability: "stable",
|
|
190
|
+
owners: ["@platform.identity-rbac"],
|
|
191
|
+
tags: ["user", "updated", "identity"]
|
|
192
|
+
},
|
|
193
|
+
payload: UserUpdatedPayload
|
|
194
|
+
});
|
|
195
|
+
var UserDeletedEvent = defineEvent({
|
|
196
|
+
meta: {
|
|
197
|
+
key: "user.deleted",
|
|
198
|
+
version: "1.0.0",
|
|
199
|
+
description: "A user account has been deleted.",
|
|
200
|
+
stability: "stable",
|
|
201
|
+
owners: ["@platform.identity-rbac"],
|
|
202
|
+
tags: ["user", "deleted", "identity"]
|
|
203
|
+
},
|
|
204
|
+
pii: ["email"],
|
|
205
|
+
payload: UserDeletedPayload
|
|
206
|
+
});
|
|
207
|
+
var UserEmailVerifiedEvent = defineEvent({
|
|
208
|
+
meta: {
|
|
209
|
+
key: "user.email_verified",
|
|
210
|
+
version: "1.0.0",
|
|
211
|
+
description: "A user has verified their email address.",
|
|
212
|
+
stability: "stable",
|
|
213
|
+
owners: ["@platform.identity-rbac"],
|
|
214
|
+
tags: ["user", "verified", "identity"]
|
|
215
|
+
},
|
|
216
|
+
payload: UserEmailVerifiedPayload
|
|
217
|
+
});
|
|
218
|
+
var OrgCreatedEvent = defineEvent({
|
|
219
|
+
meta: {
|
|
220
|
+
key: "org.created",
|
|
221
|
+
version: "1.0.0",
|
|
222
|
+
description: "A new organization has been created.",
|
|
223
|
+
stability: "stable",
|
|
224
|
+
owners: ["@platform.identity-rbac"],
|
|
225
|
+
tags: ["org", "created", "identity"]
|
|
226
|
+
},
|
|
227
|
+
payload: OrgCreatedPayload
|
|
228
|
+
});
|
|
229
|
+
var OrgUpdatedEvent = defineEvent({
|
|
230
|
+
meta: {
|
|
231
|
+
key: "org.updated",
|
|
232
|
+
version: "1.0.0",
|
|
233
|
+
description: "An organization has been updated.",
|
|
234
|
+
stability: "stable",
|
|
235
|
+
owners: ["@platform.identity-rbac"],
|
|
236
|
+
tags: ["org", "updated", "identity"]
|
|
237
|
+
},
|
|
238
|
+
payload: OrgUpdatedPayload
|
|
239
|
+
});
|
|
240
|
+
var OrgDeletedEvent = defineEvent({
|
|
241
|
+
meta: {
|
|
242
|
+
key: "org.deleted",
|
|
243
|
+
version: "1.0.0",
|
|
244
|
+
description: "An organization has been deleted.",
|
|
245
|
+
stability: "stable",
|
|
246
|
+
owners: ["@platform.identity-rbac"],
|
|
247
|
+
tags: ["org", "deleted", "identity"]
|
|
248
|
+
},
|
|
249
|
+
payload: OrgDeletedPayload
|
|
250
|
+
});
|
|
251
|
+
var OrgMemberAddedEvent = defineEvent({
|
|
252
|
+
meta: {
|
|
253
|
+
key: "org.member.added",
|
|
254
|
+
version: "1.0.0",
|
|
255
|
+
description: "A user has joined an organization.",
|
|
256
|
+
stability: "stable",
|
|
257
|
+
owners: ["@platform.identity-rbac"],
|
|
258
|
+
tags: ["org", "member", "added", "identity"]
|
|
259
|
+
},
|
|
260
|
+
payload: OrgMemberAddedPayload
|
|
261
|
+
});
|
|
262
|
+
var OrgMemberRemovedEvent = defineEvent({
|
|
263
|
+
meta: {
|
|
264
|
+
key: "org.member.removed",
|
|
265
|
+
version: "1.0.0",
|
|
266
|
+
description: "A user has left or been removed from an organization.",
|
|
267
|
+
stability: "stable",
|
|
268
|
+
owners: ["@platform.identity-rbac"],
|
|
269
|
+
tags: ["org", "member", "removed", "identity"]
|
|
270
|
+
},
|
|
271
|
+
payload: OrgMemberRemovedPayload
|
|
272
|
+
});
|
|
273
|
+
var OrgMemberRoleChangedEvent = defineEvent({
|
|
274
|
+
meta: {
|
|
275
|
+
key: "org.member.role_changed",
|
|
276
|
+
version: "1.0.0",
|
|
277
|
+
description: "A member's role in an organization has changed.",
|
|
278
|
+
stability: "stable",
|
|
279
|
+
owners: ["@platform.identity-rbac"],
|
|
280
|
+
tags: ["org", "member", "role", "changed", "identity"]
|
|
281
|
+
},
|
|
282
|
+
payload: OrgMemberRoleChangedPayload
|
|
283
|
+
});
|
|
284
|
+
var OrgInviteSentEvent = defineEvent({
|
|
285
|
+
meta: {
|
|
286
|
+
key: "org.invite.sent",
|
|
287
|
+
version: "1.0.0",
|
|
288
|
+
description: "An invitation to join an organization has been sent.",
|
|
289
|
+
stability: "stable",
|
|
290
|
+
owners: ["@platform.identity-rbac"],
|
|
291
|
+
tags: ["org", "invite", "sent", "identity"]
|
|
292
|
+
},
|
|
293
|
+
pii: ["email"],
|
|
294
|
+
payload: OrgInviteSentPayload
|
|
295
|
+
});
|
|
296
|
+
var OrgInviteAcceptedEvent = defineEvent({
|
|
297
|
+
meta: {
|
|
298
|
+
key: "org.invite.accepted",
|
|
299
|
+
version: "1.0.0",
|
|
300
|
+
description: "An invitation has been accepted.",
|
|
301
|
+
stability: "stable",
|
|
302
|
+
owners: ["@platform.identity-rbac"],
|
|
303
|
+
tags: ["org", "invite", "accepted", "identity"]
|
|
304
|
+
},
|
|
305
|
+
payload: OrgInviteAcceptedPayload
|
|
306
|
+
});
|
|
307
|
+
var OrgInviteDeclinedEvent = defineEvent({
|
|
308
|
+
meta: {
|
|
309
|
+
key: "org.invite.declined",
|
|
310
|
+
version: "1.0.0",
|
|
311
|
+
description: "An invitation has been declined.",
|
|
312
|
+
stability: "stable",
|
|
313
|
+
owners: ["@platform.identity-rbac"],
|
|
314
|
+
tags: ["org", "invite", "declined", "identity"]
|
|
315
|
+
},
|
|
316
|
+
payload: OrgInviteDeclinedPayload
|
|
317
|
+
});
|
|
318
|
+
var RoleAssignedEvent = defineEvent({
|
|
319
|
+
meta: {
|
|
320
|
+
key: "role.assigned",
|
|
321
|
+
version: "1.0.0",
|
|
322
|
+
description: "A role has been assigned.",
|
|
323
|
+
stability: "stable",
|
|
324
|
+
owners: ["@platform.identity-rbac"],
|
|
325
|
+
tags: ["role", "assigned", "identity"]
|
|
326
|
+
},
|
|
327
|
+
payload: RoleAssignedPayload
|
|
328
|
+
});
|
|
329
|
+
var RoleRevokedEvent = defineEvent({
|
|
330
|
+
meta: {
|
|
331
|
+
key: "role.revoked",
|
|
332
|
+
version: "1.0.0",
|
|
333
|
+
description: "A role has been revoked.",
|
|
334
|
+
stability: "stable",
|
|
335
|
+
owners: ["@platform.identity-rbac"],
|
|
336
|
+
tags: ["role", "revoked", "identity"]
|
|
337
|
+
},
|
|
338
|
+
payload: RoleRevokedPayload
|
|
339
|
+
});
|
|
340
|
+
var IdentityRbacEvents = {
|
|
341
|
+
UserCreatedEvent,
|
|
342
|
+
UserUpdatedEvent,
|
|
343
|
+
UserDeletedEvent,
|
|
344
|
+
UserEmailVerifiedEvent,
|
|
345
|
+
OrgCreatedEvent,
|
|
346
|
+
OrgUpdatedEvent,
|
|
347
|
+
OrgDeletedEvent,
|
|
348
|
+
OrgMemberAddedEvent,
|
|
349
|
+
OrgMemberRemovedEvent,
|
|
350
|
+
OrgMemberRoleChangedEvent,
|
|
351
|
+
OrgInviteSentEvent,
|
|
352
|
+
OrgInviteAcceptedEvent,
|
|
353
|
+
OrgInviteDeclinedEvent,
|
|
354
|
+
RoleAssignedEvent,
|
|
355
|
+
RoleRevokedEvent
|
|
356
|
+
};
|
|
357
|
+
export {
|
|
358
|
+
UserUpdatedEvent,
|
|
359
|
+
UserEmailVerifiedEvent,
|
|
360
|
+
UserDeletedEvent,
|
|
361
|
+
UserCreatedEvent,
|
|
362
|
+
RoleRevokedEvent,
|
|
363
|
+
RoleAssignedEvent,
|
|
364
|
+
OrgUpdatedEvent,
|
|
365
|
+
OrgMemberRoleChangedEvent,
|
|
366
|
+
OrgMemberRemovedEvent,
|
|
367
|
+
OrgMemberAddedEvent,
|
|
368
|
+
OrgInviteSentEvent,
|
|
369
|
+
OrgInviteDeclinedEvent,
|
|
370
|
+
OrgInviteAcceptedEvent,
|
|
371
|
+
OrgDeletedEvent,
|
|
372
|
+
OrgCreatedEvent,
|
|
373
|
+
IdentityRbacEvents
|
|
374
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/identity-rbac.capability.ts
|
|
2
|
+
import { defineCapability, StabilityEnum } from "@contractspec/lib.contracts";
|
|
3
|
+
var IdentityCapability = defineCapability({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "identity",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
kind: "api",
|
|
8
|
+
stability: StabilityEnum.Experimental,
|
|
9
|
+
description: "User identity and authentication",
|
|
10
|
+
owners: ["@platform.core"],
|
|
11
|
+
tags: ["identity", "auth"]
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var RbacCapability = defineCapability({
|
|
15
|
+
meta: {
|
|
16
|
+
key: "rbac",
|
|
17
|
+
version: "1.0.0",
|
|
18
|
+
kind: "api",
|
|
19
|
+
stability: StabilityEnum.Experimental,
|
|
20
|
+
description: "Role-based access control",
|
|
21
|
+
owners: ["@platform.core"],
|
|
22
|
+
tags: ["rbac", "permissions", "auth"]
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
RbacCapability,
|
|
27
|
+
IdentityCapability
|
|
28
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// src/identity-rbac.feature.ts
|
|
2
|
+
import { defineFeature } from "@contractspec/lib.contracts";
|
|
3
|
+
var IdentityRbacFeature = defineFeature({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "identity-rbac",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
title: "Identity & RBAC",
|
|
8
|
+
description: "User identity, organization management, and role-based access control",
|
|
9
|
+
domain: "platform",
|
|
10
|
+
owners: ["@platform.identity-rbac"],
|
|
11
|
+
tags: ["identity", "rbac", "users", "organizations", "permissions"],
|
|
12
|
+
stability: "stable"
|
|
13
|
+
},
|
|
14
|
+
operations: [
|
|
15
|
+
{ key: "identity.user.create", version: "1.0.0" },
|
|
16
|
+
{ key: "identity.user.update", version: "1.0.0" },
|
|
17
|
+
{ key: "identity.user.delete", version: "1.0.0" },
|
|
18
|
+
{ key: "identity.user.me", version: "1.0.0" },
|
|
19
|
+
{ key: "identity.user.list", version: "1.0.0" },
|
|
20
|
+
{ key: "identity.org.create", version: "1.0.0" },
|
|
21
|
+
{ key: "identity.org.update", version: "1.0.0" },
|
|
22
|
+
{ key: "identity.org.get", version: "1.0.0" },
|
|
23
|
+
{ key: "identity.org.list", version: "1.0.0" },
|
|
24
|
+
{ key: "identity.org.invite", version: "1.0.0" },
|
|
25
|
+
{ key: "identity.org.invite.accept", version: "1.0.0" },
|
|
26
|
+
{ key: "identity.org.member.remove", version: "1.0.0" },
|
|
27
|
+
{ key: "identity.org.members.list", version: "1.0.0" },
|
|
28
|
+
{ key: "identity.rbac.role.create", version: "1.0.0" },
|
|
29
|
+
{ key: "identity.rbac.role.update", version: "1.0.0" },
|
|
30
|
+
{ key: "identity.rbac.role.delete", version: "1.0.0" },
|
|
31
|
+
{ key: "identity.rbac.role.list", version: "1.0.0" },
|
|
32
|
+
{ key: "identity.rbac.assign", version: "1.0.0" },
|
|
33
|
+
{ key: "identity.rbac.revoke", version: "1.0.0" },
|
|
34
|
+
{ key: "identity.rbac.check", version: "1.0.0" },
|
|
35
|
+
{ key: "identity.rbac.permissions", version: "1.0.0" }
|
|
36
|
+
],
|
|
37
|
+
events: [
|
|
38
|
+
{ key: "user.created", version: "1.0.0" },
|
|
39
|
+
{ key: "user.updated", version: "1.0.0" },
|
|
40
|
+
{ key: "user.deleted", version: "1.0.0" },
|
|
41
|
+
{ key: "user.email_verified", version: "1.0.0" },
|
|
42
|
+
{ key: "org.created", version: "1.0.0" },
|
|
43
|
+
{ key: "org.updated", version: "1.0.0" },
|
|
44
|
+
{ key: "org.deleted", version: "1.0.0" },
|
|
45
|
+
{ key: "org.member.added", version: "1.0.0" },
|
|
46
|
+
{ key: "org.member.removed", version: "1.0.0" },
|
|
47
|
+
{ key: "org.member.role_changed", version: "1.0.0" },
|
|
48
|
+
{ key: "org.invite.sent", version: "1.0.0" },
|
|
49
|
+
{ key: "org.invite.accepted", version: "1.0.0" },
|
|
50
|
+
{ key: "org.invite.declined", version: "1.0.0" },
|
|
51
|
+
{ key: "role.assigned", version: "1.0.0" },
|
|
52
|
+
{ key: "role.revoked", version: "1.0.0" }
|
|
53
|
+
],
|
|
54
|
+
presentations: [],
|
|
55
|
+
opToPresentation: [],
|
|
56
|
+
presentationsTargets: [],
|
|
57
|
+
capabilities: {
|
|
58
|
+
provides: [
|
|
59
|
+
{ key: "identity", version: "1.0.0" },
|
|
60
|
+
{ key: "rbac", version: "1.0.0" }
|
|
61
|
+
],
|
|
62
|
+
requires: []
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export {
|
|
66
|
+
IdentityRbacFeature
|
|
67
|
+
};
|