@lssm/lib.identity-rbac 0.0.0-canary-20251217083314 → 0.0.0-canary-20251220002821
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/contracts/dist/capabilities/openbanking.js +2 -1
- package/dist/contracts/dist/capabilities/openbanking.js.map +1 -0
- package/dist/contracts/dist/contract-registry/schemas.js +2 -1
- package/dist/contracts/dist/contract-registry/schemas.js.map +1 -0
- package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +2 -1
- package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/index.js +2 -6
- package/dist/contracts/dist/docs/meta.docs.js +30 -0
- package/dist/contracts/dist/docs/meta.docs.js.map +1 -0
- package/dist/contracts/dist/docs/presentations.js +2 -1
- package/dist/contracts/dist/docs/presentations.js.map +1 -0
- package/dist/contracts/dist/docs/registry.js +2 -1
- package/dist/contracts/dist/docs/registry.js.map +1 -0
- package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/schema/README.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/schema/README.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech-contracts.docs.js +97 -0
- package/dist/contracts/dist/docs/tech-contracts.docs.js.map +1 -0
- package/dist/contracts/dist/events.js +2 -1
- package/dist/contracts/dist/events.js.map +1 -0
- package/dist/contracts/dist/index.js +2 -1
- package/dist/contracts/dist/integrations/contracts.js +65 -66
- package/dist/contracts/dist/integrations/contracts.js.map +1 -0
- package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js +31 -32
- package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js.map +1 -0
- package/dist/contracts/dist/integrations/openbanking/contracts/balances.js +18 -19
- package/dist/contracts/dist/integrations/openbanking/contracts/balances.js.map +1 -0
- package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js +32 -33
- package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js.map +1 -0
- package/dist/contracts/dist/integrations/openbanking/models.js +60 -61
- package/dist/contracts/dist/integrations/openbanking/models.js.map +1 -0
- package/dist/contracts/dist/integrations/openbanking/telemetry.js +2 -1
- package/dist/contracts/dist/integrations/openbanking/telemetry.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/elevenlabs.js +2 -1
- package/dist/contracts/dist/integrations/providers/elevenlabs.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/gcs-storage.js +2 -1
- package/dist/contracts/dist/integrations/providers/gcs-storage.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/gmail.js +2 -1
- package/dist/contracts/dist/integrations/providers/gmail.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/google-calendar.js +2 -1
- package/dist/contracts/dist/integrations/providers/google-calendar.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/mistral.js +2 -1
- package/dist/contracts/dist/integrations/providers/mistral.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/postmark.js +2 -1
- package/dist/contracts/dist/integrations/providers/postmark.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/powens.js +2 -1
- package/dist/contracts/dist/integrations/providers/powens.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/qdrant.js +2 -1
- package/dist/contracts/dist/integrations/providers/qdrant.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/stripe.js +2 -1
- package/dist/contracts/dist/integrations/providers/stripe.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/twilio-sms.js +2 -1
- package/dist/contracts/dist/integrations/providers/twilio-sms.js.map +1 -0
- package/dist/contracts/dist/knowledge/contracts.js +44 -45
- package/dist/contracts/dist/knowledge/contracts.js.map +1 -0
- package/dist/contracts/dist/knowledge/spaces/email-threads.js +2 -1
- package/dist/contracts/dist/knowledge/spaces/email-threads.js.map +1 -0
- package/dist/contracts/dist/knowledge/spaces/financial-docs.js +2 -1
- package/dist/contracts/dist/knowledge/spaces/financial-docs.js.map +1 -0
- package/dist/contracts/dist/knowledge/spaces/financial-overview.js +2 -1
- package/dist/contracts/dist/knowledge/spaces/financial-overview.js.map +1 -0
- package/dist/contracts/dist/knowledge/spaces/product-canon.js +2 -1
- package/dist/contracts/dist/knowledge/spaces/product-canon.js.map +1 -0
- package/dist/contracts/dist/knowledge/spaces/support-faq.js +2 -1
- package/dist/contracts/dist/knowledge/spaces/support-faq.js.map +1 -0
- package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js +2 -1
- package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js.map +1 -0
- package/dist/contracts/dist/llm/exporters.js +2 -1
- package/dist/contracts/dist/llm/exporters.js.map +1 -0
- package/dist/contracts/dist/onboarding-base.js +22 -23
- package/dist/contracts/dist/onboarding-base.js.map +1 -0
- package/dist/contracts/dist/ownership.js +4 -2
- package/dist/contracts/dist/ownership.js.map +1 -0
- package/dist/contracts/dist/presentations.v2.js +2 -1
- package/dist/contracts/dist/presentations.v2.js.map +1 -0
- package/dist/contracts/dist/regenerator/service.js +2 -1
- package/dist/contracts/dist/regenerator/service.js.map +1 -0
- package/dist/contracts/dist/schema/dist/index.js +3873 -6
- package/dist/contracts/dist/schema/dist/index.js.map +1 -0
- package/dist/contracts/dist/spec.js +2 -1
- package/dist/contracts/dist/spec.js.map +1 -0
- package/dist/contracts/organization.d.ts +195 -194
- package/dist/contracts/organization.d.ts.map +1 -0
- package/dist/contracts/organization.js +72 -73
- package/dist/contracts/organization.js.map +1 -0
- package/dist/contracts/rbac.d.ts +120 -119
- package/dist/contracts/rbac.d.ts.map +1 -0
- package/dist/contracts/rbac.js +50 -51
- package/dist/contracts/rbac.js.map +1 -0
- package/dist/contracts/user.d.ts +141 -140
- package/dist/contracts/user.d.ts.map +1 -0
- package/dist/contracts/user.js +41 -42
- package/dist/contracts/user.js.map +1 -0
- package/dist/entities/index.d.ts +162 -161
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +2 -1
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/organization.d.ts +61 -60
- package/dist/entities/organization.d.ts.map +1 -0
- package/dist/entities/organization.js +62 -62
- package/dist/entities/organization.js.map +1 -0
- package/dist/entities/rbac.d.ts +65 -64
- package/dist/entities/rbac.d.ts.map +1 -0
- package/dist/entities/rbac.js +66 -66
- package/dist/entities/rbac.js.map +1 -0
- package/dist/entities/user.d.ts +69 -68
- package/dist/entities/user.d.ts.map +1 -0
- package/dist/entities/user.js +70 -70
- package/dist/entities/user.js.map +1 -0
- package/dist/events.d.ts +145 -144
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +89 -90
- package/dist/events.js.map +1 -0
- package/dist/identity-rbac.feature.d.ts +2 -1
- package/dist/identity-rbac.feature.d.ts.map +1 -0
- package/dist/identity-rbac.feature.js +2 -1
- package/dist/identity-rbac.feature.js.map +1 -0
- package/dist/policies/engine.d.ts +2 -1
- package/dist/policies/engine.d.ts.map +1 -0
- package/dist/policies/engine.js +2 -1
- package/dist/policies/engine.js.map +1 -0
- package/dist/schema/dist/index.js +4888 -6
- package/dist/schema/dist/index.js.map +1 -0
- package/package.json +13 -6
- package/dist/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/contracts/dist/schema/dist/SchemaModel.js +0 -34
- package/dist/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/schema/dist/EnumType.js +0 -2
- package/dist/schema/dist/FieldType.js +0 -49
- package/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/schema/dist/SchemaModel.js +0 -34
- package/dist/schema/dist/entity/defineEntity.js +0 -236
- package/dist/schema/dist/entity/index.js +0 -2
- package/dist/schema/dist/entity/types.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","names":[],"sources":["../src/events.ts"],"sourcesContent":[],"mappings":";;;;;;;;cA0Ma,kBAAgB,oBAAA,CAAA,UAAA;EAAhB,MAAA,EAAA;IAKX,IAAA,EAAA,iBAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;IAL2B,UAAA,EAAA,KAAA;EAAA,CAAA;EAAA,IAAA,EAAA;IAUhB,IAAA,6BAKX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UA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;;;;;;;;;;;;;;cAKW,wBAAsB,oBAAA,CAAA,UAAA;;UAKjC,iBAAA,CAAA;;;;;;;;;;;;;;;cAOW,mBAAiB,oBAAA,CAAA,UAAA;;UAK5B,iBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,kBAAgB,oBAAA,CAAA,UAAA;;UAK3B,iBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAOW;;;YAgBZ,iBAAA,CAAA"}
|
package/dist/events.js
CHANGED
|
@@ -1,382 +1,380 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SchemaModel } from "./schema/dist/SchemaModel.js";
|
|
3
|
-
import "./schema/dist/index.js";
|
|
1
|
+
import { E5, x8 } from "./schema/dist/index.js";
|
|
4
2
|
import { defineEvent } from "./contracts/dist/events.js";
|
|
5
3
|
import "./contracts/dist/index.js";
|
|
6
4
|
|
|
7
5
|
//#region src/events.ts
|
|
8
|
-
const UserCreatedPayload = new
|
|
6
|
+
const UserCreatedPayload = new x8({
|
|
9
7
|
name: "UserCreatedPayload",
|
|
10
8
|
description: "Payload for user created event",
|
|
11
9
|
fields: {
|
|
12
10
|
userId: {
|
|
13
|
-
type:
|
|
11
|
+
type: E5.String_unsecure(),
|
|
14
12
|
isOptional: false
|
|
15
13
|
},
|
|
16
14
|
email: {
|
|
17
|
-
type:
|
|
15
|
+
type: E5.EmailAddress(),
|
|
18
16
|
isOptional: false
|
|
19
17
|
},
|
|
20
18
|
name: {
|
|
21
|
-
type:
|
|
19
|
+
type: E5.String_unsecure(),
|
|
22
20
|
isOptional: true
|
|
23
21
|
},
|
|
24
22
|
createdAt: {
|
|
25
|
-
type:
|
|
23
|
+
type: E5.DateTime(),
|
|
26
24
|
isOptional: false
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
27
|
});
|
|
30
|
-
const UserUpdatedPayload = new
|
|
28
|
+
const UserUpdatedPayload = new x8({
|
|
31
29
|
name: "UserUpdatedPayload",
|
|
32
30
|
description: "Payload for user updated event",
|
|
33
31
|
fields: {
|
|
34
32
|
userId: {
|
|
35
|
-
type:
|
|
33
|
+
type: E5.String_unsecure(),
|
|
36
34
|
isOptional: false
|
|
37
35
|
},
|
|
38
36
|
updatedFields: {
|
|
39
|
-
type:
|
|
37
|
+
type: E5.String_unsecure(),
|
|
40
38
|
isOptional: false,
|
|
41
39
|
isArray: true
|
|
42
40
|
},
|
|
43
41
|
updatedAt: {
|
|
44
|
-
type:
|
|
42
|
+
type: E5.DateTime(),
|
|
45
43
|
isOptional: false
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
});
|
|
49
|
-
const UserDeletedPayload = new
|
|
47
|
+
const UserDeletedPayload = new x8({
|
|
50
48
|
name: "UserDeletedPayload",
|
|
51
49
|
description: "Payload for user deleted event",
|
|
52
50
|
fields: {
|
|
53
51
|
userId: {
|
|
54
|
-
type:
|
|
52
|
+
type: E5.String_unsecure(),
|
|
55
53
|
isOptional: false
|
|
56
54
|
},
|
|
57
55
|
email: {
|
|
58
|
-
type:
|
|
56
|
+
type: E5.EmailAddress(),
|
|
59
57
|
isOptional: false
|
|
60
58
|
},
|
|
61
59
|
deletedAt: {
|
|
62
|
-
type:
|
|
60
|
+
type: E5.DateTime(),
|
|
63
61
|
isOptional: false
|
|
64
62
|
}
|
|
65
63
|
}
|
|
66
64
|
});
|
|
67
|
-
const UserEmailVerifiedPayload = new
|
|
65
|
+
const UserEmailVerifiedPayload = new x8({
|
|
68
66
|
name: "UserEmailVerifiedPayload",
|
|
69
67
|
description: "Payload for user email verified event",
|
|
70
68
|
fields: {
|
|
71
69
|
userId: {
|
|
72
|
-
type:
|
|
70
|
+
type: E5.String_unsecure(),
|
|
73
71
|
isOptional: false
|
|
74
72
|
},
|
|
75
73
|
email: {
|
|
76
|
-
type:
|
|
74
|
+
type: E5.EmailAddress(),
|
|
77
75
|
isOptional: false
|
|
78
76
|
},
|
|
79
77
|
verifiedAt: {
|
|
80
|
-
type:
|
|
78
|
+
type: E5.DateTime(),
|
|
81
79
|
isOptional: false
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
82
|
});
|
|
85
|
-
const OrgCreatedPayload = new
|
|
83
|
+
const OrgCreatedPayload = new x8({
|
|
86
84
|
name: "OrgCreatedPayload",
|
|
87
85
|
description: "Payload for org created event",
|
|
88
86
|
fields: {
|
|
89
87
|
orgId: {
|
|
90
|
-
type:
|
|
88
|
+
type: E5.String_unsecure(),
|
|
91
89
|
isOptional: false
|
|
92
90
|
},
|
|
93
91
|
name: {
|
|
94
|
-
type:
|
|
92
|
+
type: E5.String_unsecure(),
|
|
95
93
|
isOptional: false
|
|
96
94
|
},
|
|
97
95
|
slug: {
|
|
98
|
-
type:
|
|
96
|
+
type: E5.String_unsecure(),
|
|
99
97
|
isOptional: true
|
|
100
98
|
},
|
|
101
99
|
createdBy: {
|
|
102
|
-
type:
|
|
100
|
+
type: E5.String_unsecure(),
|
|
103
101
|
isOptional: false
|
|
104
102
|
},
|
|
105
103
|
createdAt: {
|
|
106
|
-
type:
|
|
104
|
+
type: E5.DateTime(),
|
|
107
105
|
isOptional: false
|
|
108
106
|
}
|
|
109
107
|
}
|
|
110
108
|
});
|
|
111
|
-
const OrgUpdatedPayload = new
|
|
109
|
+
const OrgUpdatedPayload = new x8({
|
|
112
110
|
name: "OrgUpdatedPayload",
|
|
113
111
|
description: "Payload for org updated event",
|
|
114
112
|
fields: {
|
|
115
113
|
orgId: {
|
|
116
|
-
type:
|
|
114
|
+
type: E5.String_unsecure(),
|
|
117
115
|
isOptional: false
|
|
118
116
|
},
|
|
119
117
|
updatedFields: {
|
|
120
|
-
type:
|
|
118
|
+
type: E5.String_unsecure(),
|
|
121
119
|
isOptional: false,
|
|
122
120
|
isArray: true
|
|
123
121
|
},
|
|
124
122
|
updatedBy: {
|
|
125
|
-
type:
|
|
123
|
+
type: E5.String_unsecure(),
|
|
126
124
|
isOptional: false
|
|
127
125
|
},
|
|
128
126
|
updatedAt: {
|
|
129
|
-
type:
|
|
127
|
+
type: E5.DateTime(),
|
|
130
128
|
isOptional: false
|
|
131
129
|
}
|
|
132
130
|
}
|
|
133
131
|
});
|
|
134
|
-
const OrgDeletedPayload = new
|
|
132
|
+
const OrgDeletedPayload = new x8({
|
|
135
133
|
name: "OrgDeletedPayload",
|
|
136
134
|
description: "Payload for org deleted event",
|
|
137
135
|
fields: {
|
|
138
136
|
orgId: {
|
|
139
|
-
type:
|
|
137
|
+
type: E5.String_unsecure(),
|
|
140
138
|
isOptional: false
|
|
141
139
|
},
|
|
142
140
|
name: {
|
|
143
|
-
type:
|
|
141
|
+
type: E5.String_unsecure(),
|
|
144
142
|
isOptional: false
|
|
145
143
|
},
|
|
146
144
|
deletedBy: {
|
|
147
|
-
type:
|
|
145
|
+
type: E5.String_unsecure(),
|
|
148
146
|
isOptional: false
|
|
149
147
|
},
|
|
150
148
|
deletedAt: {
|
|
151
|
-
type:
|
|
149
|
+
type: E5.DateTime(),
|
|
152
150
|
isOptional: false
|
|
153
151
|
}
|
|
154
152
|
}
|
|
155
153
|
});
|
|
156
|
-
const OrgMemberAddedPayload = new
|
|
154
|
+
const OrgMemberAddedPayload = new x8({
|
|
157
155
|
name: "OrgMemberAddedPayload",
|
|
158
156
|
description: "Payload for member added event",
|
|
159
157
|
fields: {
|
|
160
158
|
orgId: {
|
|
161
|
-
type:
|
|
159
|
+
type: E5.String_unsecure(),
|
|
162
160
|
isOptional: false
|
|
163
161
|
},
|
|
164
162
|
userId: {
|
|
165
|
-
type:
|
|
163
|
+
type: E5.String_unsecure(),
|
|
166
164
|
isOptional: false
|
|
167
165
|
},
|
|
168
166
|
role: {
|
|
169
|
-
type:
|
|
167
|
+
type: E5.String_unsecure(),
|
|
170
168
|
isOptional: false
|
|
171
169
|
},
|
|
172
170
|
invitedBy: {
|
|
173
|
-
type:
|
|
171
|
+
type: E5.String_unsecure(),
|
|
174
172
|
isOptional: true
|
|
175
173
|
},
|
|
176
174
|
joinedAt: {
|
|
177
|
-
type:
|
|
175
|
+
type: E5.DateTime(),
|
|
178
176
|
isOptional: false
|
|
179
177
|
}
|
|
180
178
|
}
|
|
181
179
|
});
|
|
182
|
-
const OrgMemberRemovedPayload = new
|
|
180
|
+
const OrgMemberRemovedPayload = new x8({
|
|
183
181
|
name: "OrgMemberRemovedPayload",
|
|
184
182
|
description: "Payload for member removed event",
|
|
185
183
|
fields: {
|
|
186
184
|
orgId: {
|
|
187
|
-
type:
|
|
185
|
+
type: E5.String_unsecure(),
|
|
188
186
|
isOptional: false
|
|
189
187
|
},
|
|
190
188
|
userId: {
|
|
191
|
-
type:
|
|
189
|
+
type: E5.String_unsecure(),
|
|
192
190
|
isOptional: false
|
|
193
191
|
},
|
|
194
192
|
removedBy: {
|
|
195
|
-
type:
|
|
193
|
+
type: E5.String_unsecure(),
|
|
196
194
|
isOptional: true
|
|
197
195
|
},
|
|
198
196
|
reason: {
|
|
199
|
-
type:
|
|
197
|
+
type: E5.String_unsecure(),
|
|
200
198
|
isOptional: true
|
|
201
199
|
},
|
|
202
200
|
removedAt: {
|
|
203
|
-
type:
|
|
201
|
+
type: E5.DateTime(),
|
|
204
202
|
isOptional: false
|
|
205
203
|
}
|
|
206
204
|
}
|
|
207
205
|
});
|
|
208
|
-
const OrgMemberRoleChangedPayload = new
|
|
206
|
+
const OrgMemberRoleChangedPayload = new x8({
|
|
209
207
|
name: "OrgMemberRoleChangedPayload",
|
|
210
208
|
description: "Payload for member role changed event",
|
|
211
209
|
fields: {
|
|
212
210
|
orgId: {
|
|
213
|
-
type:
|
|
211
|
+
type: E5.String_unsecure(),
|
|
214
212
|
isOptional: false
|
|
215
213
|
},
|
|
216
214
|
userId: {
|
|
217
|
-
type:
|
|
215
|
+
type: E5.String_unsecure(),
|
|
218
216
|
isOptional: false
|
|
219
217
|
},
|
|
220
218
|
previousRole: {
|
|
221
|
-
type:
|
|
219
|
+
type: E5.String_unsecure(),
|
|
222
220
|
isOptional: false
|
|
223
221
|
},
|
|
224
222
|
newRole: {
|
|
225
|
-
type:
|
|
223
|
+
type: E5.String_unsecure(),
|
|
226
224
|
isOptional: false
|
|
227
225
|
},
|
|
228
226
|
changedBy: {
|
|
229
|
-
type:
|
|
227
|
+
type: E5.String_unsecure(),
|
|
230
228
|
isOptional: false
|
|
231
229
|
},
|
|
232
230
|
changedAt: {
|
|
233
|
-
type:
|
|
231
|
+
type: E5.DateTime(),
|
|
234
232
|
isOptional: false
|
|
235
233
|
}
|
|
236
234
|
}
|
|
237
235
|
});
|
|
238
|
-
const OrgInviteSentPayload = new
|
|
236
|
+
const OrgInviteSentPayload = new x8({
|
|
239
237
|
name: "OrgInviteSentPayload",
|
|
240
238
|
description: "Payload for invite sent event",
|
|
241
239
|
fields: {
|
|
242
240
|
invitationId: {
|
|
243
|
-
type:
|
|
241
|
+
type: E5.String_unsecure(),
|
|
244
242
|
isOptional: false
|
|
245
243
|
},
|
|
246
244
|
orgId: {
|
|
247
|
-
type:
|
|
245
|
+
type: E5.String_unsecure(),
|
|
248
246
|
isOptional: false
|
|
249
247
|
},
|
|
250
248
|
email: {
|
|
251
|
-
type:
|
|
249
|
+
type: E5.EmailAddress(),
|
|
252
250
|
isOptional: false
|
|
253
251
|
},
|
|
254
252
|
role: {
|
|
255
|
-
type:
|
|
253
|
+
type: E5.String_unsecure(),
|
|
256
254
|
isOptional: false
|
|
257
255
|
},
|
|
258
256
|
invitedBy: {
|
|
259
|
-
type:
|
|
257
|
+
type: E5.String_unsecure(),
|
|
260
258
|
isOptional: false
|
|
261
259
|
},
|
|
262
260
|
expiresAt: {
|
|
263
|
-
type:
|
|
261
|
+
type: E5.DateTime(),
|
|
264
262
|
isOptional: true
|
|
265
263
|
},
|
|
266
264
|
sentAt: {
|
|
267
|
-
type:
|
|
265
|
+
type: E5.DateTime(),
|
|
268
266
|
isOptional: false
|
|
269
267
|
}
|
|
270
268
|
}
|
|
271
269
|
});
|
|
272
|
-
const OrgInviteAcceptedPayload = new
|
|
270
|
+
const OrgInviteAcceptedPayload = new x8({
|
|
273
271
|
name: "OrgInviteAcceptedPayload",
|
|
274
272
|
description: "Payload for invite accepted event",
|
|
275
273
|
fields: {
|
|
276
274
|
invitationId: {
|
|
277
|
-
type:
|
|
275
|
+
type: E5.String_unsecure(),
|
|
278
276
|
isOptional: false
|
|
279
277
|
},
|
|
280
278
|
orgId: {
|
|
281
|
-
type:
|
|
279
|
+
type: E5.String_unsecure(),
|
|
282
280
|
isOptional: false
|
|
283
281
|
},
|
|
284
282
|
userId: {
|
|
285
|
-
type:
|
|
283
|
+
type: E5.String_unsecure(),
|
|
286
284
|
isOptional: false
|
|
287
285
|
},
|
|
288
286
|
acceptedAt: {
|
|
289
|
-
type:
|
|
287
|
+
type: E5.DateTime(),
|
|
290
288
|
isOptional: false
|
|
291
289
|
}
|
|
292
290
|
}
|
|
293
291
|
});
|
|
294
|
-
const OrgInviteDeclinedPayload = new
|
|
292
|
+
const OrgInviteDeclinedPayload = new x8({
|
|
295
293
|
name: "OrgInviteDeclinedPayload",
|
|
296
294
|
description: "Payload for invite declined event",
|
|
297
295
|
fields: {
|
|
298
296
|
invitationId: {
|
|
299
|
-
type:
|
|
297
|
+
type: E5.String_unsecure(),
|
|
300
298
|
isOptional: false
|
|
301
299
|
},
|
|
302
300
|
orgId: {
|
|
303
|
-
type:
|
|
301
|
+
type: E5.String_unsecure(),
|
|
304
302
|
isOptional: false
|
|
305
303
|
},
|
|
306
304
|
declinedAt: {
|
|
307
|
-
type:
|
|
305
|
+
type: E5.DateTime(),
|
|
308
306
|
isOptional: false
|
|
309
307
|
}
|
|
310
308
|
}
|
|
311
309
|
});
|
|
312
|
-
const RoleAssignedPayload = new
|
|
310
|
+
const RoleAssignedPayload = new x8({
|
|
313
311
|
name: "RoleAssignedPayload",
|
|
314
312
|
description: "Payload for role assigned event",
|
|
315
313
|
fields: {
|
|
316
314
|
bindingId: {
|
|
317
|
-
type:
|
|
315
|
+
type: E5.String_unsecure(),
|
|
318
316
|
isOptional: false
|
|
319
317
|
},
|
|
320
318
|
roleId: {
|
|
321
|
-
type:
|
|
319
|
+
type: E5.String_unsecure(),
|
|
322
320
|
isOptional: false
|
|
323
321
|
},
|
|
324
322
|
roleName: {
|
|
325
|
-
type:
|
|
323
|
+
type: E5.String_unsecure(),
|
|
326
324
|
isOptional: false
|
|
327
325
|
},
|
|
328
326
|
targetType: {
|
|
329
|
-
type:
|
|
327
|
+
type: E5.String_unsecure(),
|
|
330
328
|
isOptional: false
|
|
331
329
|
},
|
|
332
330
|
targetId: {
|
|
333
|
-
type:
|
|
331
|
+
type: E5.String_unsecure(),
|
|
334
332
|
isOptional: false
|
|
335
333
|
},
|
|
336
334
|
assignedBy: {
|
|
337
|
-
type:
|
|
335
|
+
type: E5.String_unsecure(),
|
|
338
336
|
isOptional: false
|
|
339
337
|
},
|
|
340
338
|
expiresAt: {
|
|
341
|
-
type:
|
|
339
|
+
type: E5.DateTime(),
|
|
342
340
|
isOptional: true
|
|
343
341
|
},
|
|
344
342
|
assignedAt: {
|
|
345
|
-
type:
|
|
343
|
+
type: E5.DateTime(),
|
|
346
344
|
isOptional: false
|
|
347
345
|
}
|
|
348
346
|
}
|
|
349
347
|
});
|
|
350
|
-
const RoleRevokedPayload = new
|
|
348
|
+
const RoleRevokedPayload = new x8({
|
|
351
349
|
name: "RoleRevokedPayload",
|
|
352
350
|
description: "Payload for role revoked event",
|
|
353
351
|
fields: {
|
|
354
352
|
bindingId: {
|
|
355
|
-
type:
|
|
353
|
+
type: E5.String_unsecure(),
|
|
356
354
|
isOptional: false
|
|
357
355
|
},
|
|
358
356
|
roleId: {
|
|
359
|
-
type:
|
|
357
|
+
type: E5.String_unsecure(),
|
|
360
358
|
isOptional: false
|
|
361
359
|
},
|
|
362
360
|
roleName: {
|
|
363
|
-
type:
|
|
361
|
+
type: E5.String_unsecure(),
|
|
364
362
|
isOptional: false
|
|
365
363
|
},
|
|
366
364
|
targetType: {
|
|
367
|
-
type:
|
|
365
|
+
type: E5.String_unsecure(),
|
|
368
366
|
isOptional: false
|
|
369
367
|
},
|
|
370
368
|
targetId: {
|
|
371
|
-
type:
|
|
369
|
+
type: E5.String_unsecure(),
|
|
372
370
|
isOptional: false
|
|
373
371
|
},
|
|
374
372
|
revokedBy: {
|
|
375
|
-
type:
|
|
373
|
+
type: E5.String_unsecure(),
|
|
376
374
|
isOptional: false
|
|
377
375
|
},
|
|
378
376
|
revokedAt: {
|
|
379
|
-
type:
|
|
377
|
+
type: E5.DateTime(),
|
|
380
378
|
isOptional: false
|
|
381
379
|
}
|
|
382
380
|
}
|
|
@@ -540,4 +538,5 @@ const IdentityRbacEvents = {
|
|
|
540
538
|
};
|
|
541
539
|
|
|
542
540
|
//#endregion
|
|
543
|
-
export { IdentityRbacEvents, OrgCreatedEvent, OrgDeletedEvent, OrgInviteAcceptedEvent, OrgInviteDeclinedEvent, OrgInviteSentEvent, OrgMemberAddedEvent, OrgMemberRemovedEvent, OrgMemberRoleChangedEvent, OrgUpdatedEvent, RoleAssignedEvent, RoleRevokedEvent, UserCreatedEvent, UserDeletedEvent, UserEmailVerifiedEvent, UserUpdatedEvent };
|
|
541
|
+
export { IdentityRbacEvents, OrgCreatedEvent, OrgDeletedEvent, OrgInviteAcceptedEvent, OrgInviteDeclinedEvent, OrgInviteSentEvent, OrgMemberAddedEvent, OrgMemberRemovedEvent, OrgMemberRoleChangedEvent, OrgUpdatedEvent, RoleAssignedEvent, RoleRevokedEvent, UserCreatedEvent, UserDeletedEvent, UserEmailVerifiedEvent, UserUpdatedEvent };
|
|
542
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","names":["SchemaModel","ScalarTypeEnum"],"sources":["../src/events.ts"],"sourcesContent":["import { SchemaModel, ScalarTypeEnum } from '@lssm/lib.schema';\nimport { defineEvent } from '@lssm/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 name: 'user.created',\n version: 1,\n description: 'A new user has been created.',\n payload: UserCreatedPayload,\n});\n\n/**\n * Emitted when a user profile is updated.\n */\nexport const UserUpdatedEvent = defineEvent({\n name: 'user.updated',\n version: 1,\n description: 'A user profile has been updated.',\n payload: UserUpdatedPayload,\n});\n\n/**\n * Emitted when a user is deleted.\n */\nexport const UserDeletedEvent = defineEvent({\n name: 'user.deleted',\n version: 1,\n description: 'A user account has been deleted.',\n pii: ['email'],\n payload: UserDeletedPayload,\n});\n\n/**\n * Emitted when a user's email is verified.\n */\nexport const UserEmailVerifiedEvent = defineEvent({\n name: 'user.email_verified',\n version: 1,\n description: 'A user has verified their email address.',\n payload: UserEmailVerifiedPayload,\n});\n\n// ============ Organization Events ============\n\n/**\n * Emitted when a new organization is created.\n */\nexport const OrgCreatedEvent = defineEvent({\n name: 'org.created',\n version: 1,\n description: 'A new organization has been created.',\n payload: OrgCreatedPayload,\n});\n\n/**\n * Emitted when an organization is updated.\n */\nexport const OrgUpdatedEvent = defineEvent({\n name: 'org.updated',\n version: 1,\n description: 'An organization has been updated.',\n payload: OrgUpdatedPayload,\n});\n\n/**\n * Emitted when an organization is deleted.\n */\nexport const OrgDeletedEvent = defineEvent({\n name: 'org.deleted',\n version: 1,\n description: 'An organization has been deleted.',\n payload: OrgDeletedPayload,\n});\n\n// ============ Member Events ============\n\n/**\n * Emitted when a member joins an organization.\n */\nexport const OrgMemberAddedEvent = defineEvent({\n name: 'org.member.added',\n version: 1,\n description: 'A user has joined an organization.',\n payload: OrgMemberAddedPayload,\n});\n\n/**\n * Emitted when a member leaves or is removed from an organization.\n */\nexport const OrgMemberRemovedEvent = defineEvent({\n name: 'org.member.removed',\n version: 1,\n description: 'A user has left or been removed from an organization.',\n payload: OrgMemberRemovedPayload,\n});\n\n/**\n * Emitted when a member's role is changed.\n */\nexport const OrgMemberRoleChangedEvent = defineEvent({\n name: 'org.member.role_changed',\n version: 1,\n description: \"A member's role in an organization has changed.\",\n payload: OrgMemberRoleChangedPayload,\n});\n\n// ============ Invitation Events ============\n\n/**\n * Emitted when an invitation is sent.\n */\nexport const OrgInviteSentEvent = defineEvent({\n name: 'org.invite.sent',\n version: 1,\n description: 'An invitation to join an organization has been sent.',\n pii: ['email'],\n payload: OrgInviteSentPayload,\n});\n\n/**\n * Emitted when an invitation is accepted.\n */\nexport const OrgInviteAcceptedEvent = defineEvent({\n name: 'org.invite.accepted',\n version: 1,\n description: 'An invitation has been accepted.',\n payload: OrgInviteAcceptedPayload,\n});\n\n/**\n * Emitted when an invitation is declined.\n */\nexport const OrgInviteDeclinedEvent = defineEvent({\n name: 'org.invite.declined',\n version: 1,\n description: 'An invitation has been declined.',\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 name: 'role.assigned',\n version: 1,\n description: 'A role has been assigned.',\n payload: RoleAssignedPayload,\n});\n\n/**\n * Emitted when a role is revoked from a user or organization.\n */\nexport const RoleRevokedEvent = defineEvent({\n name: 'role.revoked',\n version: 1,\n description: 'A role has been revoked.',\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,IAAIA,GAAY;CACzC,MAAM;CACN,aAAa;CACb,QAAQ;EACN,QAAQ;GAAE,MAAMC,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,OAAO;GAAE,MAAMA,GAAe,cAAc;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EAClE,WAAW;GAAE,MAAMA,GAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAM,qBAAqB,IAAID,GAAY;CACzC,MAAM;CACN,aAAa;CACb,QAAQ;EACN,QAAQ;GAAE,MAAMC,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,eAAe;GACb,MAAMA,GAAe,iBAAiB;GACtC,YAAY;GACZ,SAAS;GACV;EACD,WAAW;GAAE,MAAMA,GAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAM,qBAAqB,IAAID,GAAY;CACzC,MAAM;CACN,aAAa;CACb,QAAQ;EACN,QAAQ;GAAE,MAAMC,GAAe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"identity-rbac.feature.d.ts","names":[],"sources":["../src/identity-rbac.feature.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAWa,qBAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-rbac.feature.js","names":["IdentityRbacFeature: FeatureModuleSpec"],"sources":["../src/identity-rbac.feature.ts"],"sourcesContent":["/**\n * Identity RBAC Feature Module Specification\n *\n * Defines the feature module for identity management and role-based access control.\n */\nimport type { FeatureModuleSpec } from '@lssm/lib.contracts';\n\n/**\n * Identity RBAC feature module that bundles user, organization,\n * and role-based access control capabilities.\n */\nexport const IdentityRbacFeature: FeatureModuleSpec = {\n meta: {\n key: 'identity-rbac',\n title: 'Identity & RBAC',\n description:\n 'User identity, organization management, and role-based access control',\n domain: 'platform',\n owners: ['@platform.identity-rbac'],\n tags: ['identity', 'rbac', 'users', 'organizations', 'permissions'],\n stability: 'stable',\n },\n\n // All contract operations included in this feature\n operations: [\n // User operations\n { name: 'identity.user.create', version: 1 },\n { name: 'identity.user.update', version: 1 },\n { name: 'identity.user.delete', version: 1 },\n { name: 'identity.user.me', version: 1 },\n { name: 'identity.user.list', version: 1 },\n\n // Organization operations\n { name: 'identity.org.create', version: 1 },\n { name: 'identity.org.update', version: 1 },\n { name: 'identity.org.get', version: 1 },\n { name: 'identity.org.list', version: 1 },\n { name: 'identity.org.invite', version: 1 },\n { name: 'identity.org.invite.accept', version: 1 },\n { name: 'identity.org.member.remove', version: 1 },\n { name: 'identity.org.members.list', version: 1 },\n\n // RBAC operations\n { name: 'identity.rbac.role.create', version: 1 },\n { name: 'identity.rbac.role.update', version: 1 },\n { name: 'identity.rbac.role.delete', version: 1 },\n { name: 'identity.rbac.role.list', version: 1 },\n { name: 'identity.rbac.assign', version: 1 },\n { name: 'identity.rbac.revoke', version: 1 },\n { name: 'identity.rbac.check', version: 1 },\n { name: 'identity.rbac.permissions', version: 1 },\n ],\n\n // Events emitted by this feature\n events: [\n // User events\n { name: 'user.created', version: 1 },\n { name: 'user.updated', version: 1 },\n { name: 'user.deleted', version: 1 },\n { name: 'user.email_verified', version: 1 },\n\n // Organization events\n { name: 'org.created', version: 1 },\n { name: 'org.updated', version: 1 },\n { name: 'org.deleted', version: 1 },\n { name: 'org.member.added', version: 1 },\n { name: 'org.member.removed', version: 1 },\n { name: 'org.member.role_changed', version: 1 },\n\n // Invitation events\n { name: 'org.invite.sent', version: 1 },\n { name: 'org.invite.accepted', version: 1 },\n { name: 'org.invite.declined', version: 1 },\n\n // Role events\n { name: 'role.assigned', version: 1 },\n { name: 'role.revoked', version: 1 },\n ],\n\n // No presentations for this library feature\n presentations: [],\n opToPresentation: [],\n presentationsTargets: [],\n\n // Capability definitions\n capabilities: {\n provides: [\n { key: 'identity', version: 1 },\n { key: 'rbac', version: 1 },\n ],\n requires: [],\n },\n};\n"],"mappings":";;;;;AAWA,MAAaA,sBAAyC;CACpD,MAAM;EACJ,KAAK;EACL,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,0BAA0B;EACnC,MAAM;GAAC;GAAY;GAAQ;GAAS;GAAiB;GAAc;EACnE,WAAW;EACZ;CAGD,YAAY;EAEV;GAAE,MAAM;GAAwB,SAAS;GAAG;EAC5C;GAAE,MAAM;GAAwB,SAAS;GAAG;EAC5C;GAAE,MAAM;GAAwB,SAAS;GAAG;EAC5C;GAAE,MAAM;GAAoB,SAAS;GAAG;EACxC;GAAE,MAAM;GAAsB,SAAS;GAAG;EAG1C;GAAE,MAAM;GAAuB,SAAS;GAAG;EAC3C;GAAE,MAAM;GAAuB,SAAS;GAAG;EAC3C;GAAE,MAAM;GAAoB,SAAS;GAAG;EACxC;GAAE,MAAM;GAAqB,SAAS;GAAG;EACzC;GAAE,MAAM;GAAuB,SAAS;GAAG;EAC3C;GAAE,MAAM;GAA8B,SAAS;GAAG;EAClD;GAAE,MAAM;GAA8B,SAAS;GAAG;EAClD;GAAE,MAAM;GAA6B,SAAS;GAAG;EAGjD;GAAE,MAAM;GAA6B,SAAS;GAAG;EACjD;GAAE,MAAM;GAA6B,SAAS;GAAG;EACjD;GAAE,MAAM;GAA6B,SAAS;GAAG;EACjD;GAAE,MAAM;GAA2B,SAAS;GAAG;EAC/C;GAAE,MAAM;GAAwB,SAAS;GAAG;EAC5C;GAAE,MAAM;GAAwB,SAAS;GAAG;EAC5C;GAAE,MAAM;GAAuB,SAAS;GAAG;EAC3C;GAAE,MAAM;GAA6B,SAAS;GAAG;EAClD;CAGD,QAAQ;EAEN;GAAE,MAAM;GAAgB,SAAS;GAAG;EACpC;GAAE,MAAM;GAAgB,SAAS;GAAG;EACpC;GAAE,MAAM;GAAgB,SAAS;GAAG;EACpC;GAAE,MAAM;GAAuB,SAAS;GAAG;EAG3C;GAAE,MAAM;GAAe,SAAS;GAAG;EACnC;GAAE,MAAM;GAAe,SAAS;GAAG;EACnC;GAAE,MAAM;GAAe,SAAS;GAAG;EACnC;GAAE,MAAM;GAAoB,SAAS;GAAG;EACxC;GAAE,MAAM;GAAsB,SAAS;GAAG;EAC1C;GAAE,MAAM;GAA2B,SAAS;GAAG;EAG/C;GAAE,MAAM;GAAmB,SAAS;GAAG;EACvC;GAAE,MAAM;GAAuB,SAAS;GAAG;EAC3C;GAAE,MAAM;GAAuB,SAAS;GAAG;EAG3C;GAAE,MAAM;GAAiB,SAAS;GAAG;EACrC;GAAE,MAAM;GAAgB,SAAS;GAAG;EACrC;CAGD,eAAe,EAAE;CACjB,kBAAkB,EAAE;CACpB,sBAAsB,EAAE;CAGxB,cAAc;EACZ,UAAU,CACR;GAAE,KAAK;GAAY,SAAS;GAAG,EAC/B;GAAE,KAAK;GAAQ,SAAS;GAAG,CAC5B;EACD,UAAU,EAAE;EACb;CACF"}
|
|
@@ -129,4 +129,5 @@ declare class RBACPolicyEngine {
|
|
|
129
129
|
*/
|
|
130
130
|
declare function createRBACEngine(): RBACPolicyEngine;
|
|
131
131
|
//#endregion
|
|
132
|
-
export { Permission, PermissionCheckInput, PermissionCheckResult, PermissionKey, PolicyBindingForEval, RBACPolicyEngine, RoleWithPermissions, StandardRole, createRBACEngine };
|
|
132
|
+
export { Permission, PermissionCheckInput, PermissionCheckResult, PermissionKey, PolicyBindingForEval, RBACPolicyEngine, RoleWithPermissions, StandardRole, createRBACEngine };
|
|
133
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.d.ts","names":[],"sources":["../../src/policies/engine.ts"],"sourcesContent":[],"mappings":";;AAGA;AAoDA;AAKa,cAzDA,UA6GH,EAAA;EAKO,SAAA,WAAA,EAAA,aAGH;EAMG,SAAA,SAAA,EAAA,WAAqB;EASrB,SAAA,WAAA,EAAmB,aAAA;EASnB,SAAA,WAAA,EAAA,aAET;EASK,SAAA,SAAA,EAAgB,WAAA;EAQlB,SAAA,WAAA,EAAA,aAAA;EACG,SAAA,UAAA,EAAA,YAAA;EACD,SAAA,QAAA,EAAA,UAAA;EAAR,SAAA,UAAA,EAAA,YAAA;EAmDS,SAAA,UAAA,EAAA,YAAA;EAEG,SAAA,QAAA,EAAA,UAAA;EACN,SAAA,aAAA,EAAA,eAAA;EAFN,SAAA,aAAA,EAAA,eAAA;EA4CS,SAAA,kBAAA,EAAA,oBAAA;EACT,SAAA,WAAA,EAAA,aAAA;EAiBS,SAAA,cAAA,EAAA,oBAAA;EACT,SAAA,WAAA,EAAA,aAAA;EAAO,SAAA,WAAA,EAAA,aAAA;EAcI,SAAA,WAAgB,EAAA,aAAI;;;;;;;;;;;;;;;;;KA/OxB,aAAA,WAAwB,yBAAyB;;;;cAKhD;;;;;;;;;;;;;;;;;;;;;;;;;UAyDI,oBAAA;;;cAGH;;;;;UAMG,qBAAA;;;;;;;;UASA,mBAAA;;;;;;;;UASA,oBAAA;;QAET;;;cAGM;;;;;cAMD,gBAAA;;;;;;yBAQF,gCACG,yBACT,QAAQ;;;;sEAmDC,yBACT;iBACY;WACN;;;;;+FA0CG,yBACT;;;;gGAiBS,yBACT;;;;;iBAcW,gBAAA,CAAA,GAAoB"}
|
package/dist/policies/engine.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.js","names":["roles: RoleWithPermissions[]"],"sources":["../../src/policies/engine.ts"],"sourcesContent":["/**\n * Standard permissions for identity-rbac module.\n */\nexport const Permission = {\n // User permissions\n USER_CREATE: 'user.create',\n USER_READ: 'user.read',\n USER_UPDATE: 'user.update',\n USER_DELETE: 'user.delete',\n USER_LIST: 'user.list',\n USER_MANAGE: 'user.manage',\n\n // Organization permissions\n ORG_CREATE: 'org.create',\n ORG_READ: 'org.read',\n ORG_UPDATE: 'org.update',\n ORG_DELETE: 'org.delete',\n ORG_LIST: 'org.list',\n\n // Member permissions\n MEMBER_INVITE: 'member.invite',\n MEMBER_REMOVE: 'member.remove',\n MEMBER_UPDATE_ROLE: 'member.update_role',\n MEMBER_LIST: 'member.list',\n MANAGE_MEMBERS: 'org.manage_members',\n\n // Team permissions\n TEAM_CREATE: 'team.create',\n TEAM_UPDATE: 'team.update',\n TEAM_DELETE: 'team.delete',\n TEAM_MANAGE: 'team.manage',\n\n // Role permissions\n ROLE_CREATE: 'role.create',\n ROLE_UPDATE: 'role.update',\n ROLE_DELETE: 'role.delete',\n ROLE_ASSIGN: 'role.assign',\n ROLE_REVOKE: 'role.revoke',\n\n // Billing permissions\n BILLING_VIEW: 'billing.view',\n BILLING_MANAGE: 'billing.manage',\n\n // Project permissions\n PROJECT_CREATE: 'project.create',\n PROJECT_READ: 'project.read',\n PROJECT_UPDATE: 'project.update',\n PROJECT_DELETE: 'project.delete',\n PROJECT_MANAGE: 'project.manage',\n\n // Admin permissions\n ADMIN_ACCESS: 'admin.access',\n ADMIN_IMPERSONATE: 'admin.impersonate',\n} as const;\n\nexport type PermissionKey = (typeof Permission)[keyof typeof Permission];\n\n/**\n * Standard role definitions.\n */\nexport const StandardRole = {\n OWNER: {\n name: 'owner',\n description: 'Organization owner with full access',\n permissions: Object.values(Permission),\n },\n ADMIN: {\n name: 'admin',\n description: 'Administrator with most permissions',\n permissions: [\n Permission.USER_READ,\n Permission.USER_LIST,\n Permission.ORG_READ,\n Permission.ORG_UPDATE,\n Permission.MEMBER_INVITE,\n Permission.MEMBER_REMOVE,\n Permission.MEMBER_UPDATE_ROLE,\n Permission.MEMBER_LIST,\n Permission.MANAGE_MEMBERS,\n Permission.TEAM_CREATE,\n Permission.TEAM_UPDATE,\n Permission.TEAM_DELETE,\n Permission.TEAM_MANAGE,\n Permission.PROJECT_CREATE,\n Permission.PROJECT_READ,\n Permission.PROJECT_UPDATE,\n Permission.PROJECT_DELETE,\n Permission.PROJECT_MANAGE,\n Permission.BILLING_VIEW,\n ],\n },\n MEMBER: {\n name: 'member',\n description: 'Regular organization member',\n permissions: [\n Permission.USER_READ,\n Permission.ORG_READ,\n Permission.MEMBER_LIST,\n Permission.PROJECT_READ,\n Permission.PROJECT_CREATE,\n ],\n },\n VIEWER: {\n name: 'viewer',\n description: 'Read-only access',\n permissions: [\n Permission.USER_READ,\n Permission.ORG_READ,\n Permission.MEMBER_LIST,\n Permission.PROJECT_READ,\n ],\n },\n} as const;\n\n/**\n * Permission check input.\n */\nexport interface PermissionCheckInput {\n userId: string;\n orgId?: string;\n permission: PermissionKey | string;\n}\n\n/**\n * Permission check result.\n */\nexport interface PermissionCheckResult {\n allowed: boolean;\n reason?: string;\n matchedRole?: string;\n}\n\n/**\n * Role with permissions.\n */\nexport interface RoleWithPermissions {\n id: string;\n name: string;\n permissions: string[];\n}\n\n/**\n * Policy binding for permission evaluation.\n */\nexport interface PolicyBindingForEval {\n roleId: string;\n role: RoleWithPermissions;\n targetType: 'user' | 'organization';\n targetId: string;\n expiresAt?: Date | null;\n}\n\n/**\n * RBAC Policy Engine for permission checks.\n */\nexport class RBACPolicyEngine {\n private roleCache = new Map<string, RoleWithPermissions>();\n private bindingCache = new Map<string, PolicyBindingForEval[]>();\n\n /**\n * Check if a user has a specific permission.\n */\n async checkPermission(\n input: PermissionCheckInput,\n bindings: PolicyBindingForEval[]\n ): Promise<PermissionCheckResult> {\n const { userId, orgId, permission } = input;\n const now = new Date();\n\n // Get all applicable bindings\n const userBindings = bindings.filter(\n (b) => b.targetType === 'user' && b.targetId === userId\n );\n\n const orgBindings = orgId\n ? bindings.filter(\n (b) => b.targetType === 'organization' && b.targetId === orgId\n )\n : [];\n\n const allBindings = [...userBindings, ...orgBindings];\n\n // Filter out expired bindings\n const activeBindings = allBindings.filter(\n (b) => !b.expiresAt || b.expiresAt > now\n );\n\n if (activeBindings.length === 0) {\n return {\n allowed: false,\n reason: 'No active role bindings found',\n };\n }\n\n // Check if any role grants the permission\n for (const binding of activeBindings) {\n if (binding.role.permissions.includes(permission)) {\n return {\n allowed: true,\n matchedRole: binding.role.name,\n };\n }\n }\n\n return {\n allowed: false,\n reason: `No role grants the \"${permission}\" permission`,\n };\n }\n\n /**\n * Get all permissions for a user in a context.\n */\n async getPermissions(\n userId: string,\n orgId: string | undefined,\n bindings: PolicyBindingForEval[]\n ): Promise<{\n permissions: Set<string>;\n roles: RoleWithPermissions[];\n }> {\n const now = new Date();\n\n // Get all applicable bindings\n const userBindings = bindings.filter(\n (b) => b.targetType === 'user' && b.targetId === userId\n );\n\n const orgBindings = orgId\n ? bindings.filter(\n (b) => b.targetType === 'organization' && b.targetId === orgId\n )\n : [];\n\n const allBindings = [...userBindings, ...orgBindings];\n\n // Filter out expired bindings\n const activeBindings = allBindings.filter(\n (b) => !b.expiresAt || b.expiresAt > now\n );\n\n const permissions = new Set<string>();\n const roles: RoleWithPermissions[] = [];\n\n for (const binding of activeBindings) {\n roles.push(binding.role);\n for (const perm of binding.role.permissions) {\n permissions.add(perm);\n }\n }\n\n return { permissions, roles };\n }\n\n /**\n * Check if user has any of the specified permissions.\n */\n async hasAnyPermission(\n userId: string,\n orgId: string | undefined,\n permissions: string[],\n bindings: PolicyBindingForEval[]\n ): Promise<boolean> {\n const { permissions: userPerms } = await this.getPermissions(\n userId,\n orgId,\n bindings\n );\n\n return permissions.some((p) => userPerms.has(p));\n }\n\n /**\n * Check if user has all of the specified permissions.\n */\n async hasAllPermissions(\n userId: string,\n orgId: string | undefined,\n permissions: string[],\n bindings: PolicyBindingForEval[]\n ): Promise<boolean> {\n const { permissions: userPerms } = await this.getPermissions(\n userId,\n orgId,\n bindings\n );\n\n return permissions.every((p) => userPerms.has(p));\n }\n}\n\n/**\n * Create a new RBAC policy engine instance.\n */\nexport function createRBACEngine(): RBACPolicyEngine {\n return new RBACPolicyEngine();\n}\n"],"mappings":";;;;AAGA,MAAa,aAAa;CAExB,aAAa;CACb,WAAW;CACX,aAAa;CACb,aAAa;CACb,WAAW;CACX,aAAa;CAGb,YAAY;CACZ,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,UAAU;CAGV,eAAe;CACf,eAAe;CACf,oBAAoB;CACpB,aAAa;CACb,gBAAgB;CAGhB,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CAGb,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CACb,aAAa;CAGb,cAAc;CACd,gBAAgB;CAGhB,gBAAgB;CAChB,cAAc;CACd,gBAAgB;CAChB,gBAAgB;CAChB,gBAAgB;CAGhB,cAAc;CACd,mBAAmB;CACpB;;;;AAOD,MAAa,eAAe;CAC1B,OAAO;EACL,MAAM;EACN,aAAa;EACb,aAAa,OAAO,OAAO,WAAW;EACvC;CACD,OAAO;EACL,MAAM;EACN,aAAa;EACb,aAAa;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACZ;EACF;CACD,QAAQ;EACN,MAAM;EACN,aAAa;EACb,aAAa;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACZ;EACF;CACD,QAA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