@lssm/lib.identity-rbac 0.0.0-canary-20251217080011 → 1.41.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/index.js +1 -5
- package/dist/contracts/organization.js +1 -607
- package/dist/contracts/rbac.js +1 -487
- package/dist/contracts/user.js +1 -335
- package/dist/entities/index.js +1 -35
- package/dist/entities/organization.js +1 -151
- package/dist/entities/rbac.js +1 -138
- package/dist/entities/user.js +1 -194
- package/dist/events.js +1 -543
- package/dist/identity-rbac.feature.js +1 -186
- package/dist/index.js +1 -14
- package/dist/policies/engine.js +1 -167
- package/dist/policies/index.js +1 -3
- package/package.json +18 -19
- package/dist/contracts/dist/capabilities/openbanking.js +0 -88
- package/dist/contracts/dist/client/index.js +0 -5
- package/dist/contracts/dist/client/react/feature-render.js +0 -2
- package/dist/contracts/dist/client/react/form-render.js +0 -4
- package/dist/contracts/dist/client/react/index.js +0 -4
- package/dist/contracts/dist/contract-registry/index.js +0 -1
- package/dist/contracts/dist/contract-registry/schemas.js +0 -60
- package/dist/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
- package/dist/contracts/dist/docs/index.js +0 -29
- package/dist/contracts/dist/docs/presentations.js +0 -71
- package/dist/contracts/dist/docs/registry.js +0 -44
- 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/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
- package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
- package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
- package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
- package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
- package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
- package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
- package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
- package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
- package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
- package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
- package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
- package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
- package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
- package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
- package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
- package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
- package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
- package/dist/contracts/dist/events.js +0 -10
- package/dist/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/contracts/dist/index.js +0 -71
- package/dist/contracts/dist/install.js +0 -2
- package/dist/contracts/dist/integrations/contracts.js +0 -377
- package/dist/contracts/dist/integrations/index.js +0 -18
- package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
- package/dist/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
- package/dist/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
- package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
- package/dist/contracts/dist/integrations/openbanking/models.js +0 -242
- package/dist/contracts/dist/integrations/openbanking/telemetry.js +0 -13
- package/dist/contracts/dist/integrations/providers/elevenlabs.js +0 -52
- package/dist/contracts/dist/integrations/providers/gcs-storage.js +0 -75
- package/dist/contracts/dist/integrations/providers/gmail.js +0 -87
- package/dist/contracts/dist/integrations/providers/google-calendar.js +0 -66
- package/dist/contracts/dist/integrations/providers/index.js +0 -11
- package/dist/contracts/dist/integrations/providers/mistral.js +0 -68
- package/dist/contracts/dist/integrations/providers/postmark.js +0 -68
- package/dist/contracts/dist/integrations/providers/powens.js +0 -116
- package/dist/contracts/dist/integrations/providers/qdrant.js +0 -73
- package/dist/contracts/dist/integrations/providers/registry.js +0 -10
- package/dist/contracts/dist/integrations/providers/stripe.js +0 -83
- package/dist/contracts/dist/integrations/providers/twilio-sms.js +0 -61
- package/dist/contracts/dist/jsonschema.js +0 -1
- package/dist/contracts/dist/knowledge/contracts.js +0 -306
- package/dist/contracts/dist/knowledge/index.js +0 -7
- package/dist/contracts/dist/knowledge/spaces/email-threads.js +0 -34
- package/dist/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
- package/dist/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
- package/dist/contracts/dist/knowledge/spaces/index.js +0 -6
- package/dist/contracts/dist/knowledge/spaces/product-canon.js +0 -34
- package/dist/contracts/dist/knowledge/spaces/support-faq.js +0 -37
- package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
- package/dist/contracts/dist/llm/exporters.js +0 -19
- package/dist/contracts/dist/llm/index.js +0 -2
- package/dist/contracts/dist/llm/prompts.js +0 -1
- package/dist/contracts/dist/onboarding-base.js +0 -196
- package/dist/contracts/dist/openapi.js +0 -1
- package/dist/contracts/dist/ownership.js +0 -21
- package/dist/contracts/dist/presentations.js +0 -1
- package/dist/contracts/dist/presentations.v2.js +0 -11
- package/dist/contracts/dist/prompt.js +0 -1
- package/dist/contracts/dist/promptRegistry.js +0 -1
- package/dist/contracts/dist/regenerator/index.js +0 -1
- package/dist/contracts/dist/regenerator/service.js +0 -6
- package/dist/contracts/dist/registry.js +0 -2
- package/dist/contracts/dist/resources.js +0 -1
- 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/contracts/dist/schema/dist/index.js +0 -6
- package/dist/contracts/dist/server/graphql-pothos.js +0 -6
- package/dist/contracts/dist/server/index.js +0 -8
- package/dist/contracts/dist/server/mcp/createMcpServer.js +0 -4
- package/dist/contracts/dist/server/mcp/registerPresentations.js +0 -2
- package/dist/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/contracts/dist/server/mcp/registerResources.js +0 -2
- package/dist/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/contracts/dist/server/rest-express.js +0 -1
- package/dist/contracts/dist/server/rest-generic.js +0 -1
- package/dist/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/contracts/dist/spec.js +0 -34
- package/dist/contracts/dist/telemetry/index.js +0 -1
- package/dist/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/contracts/dist/tests/index.js +0 -1
- package/dist/contracts/dist/tests/runner.js +0 -2
- package/dist/contracts/dist/workflow/index.js +0 -1
- package/dist/contracts/dist/workflow/runner.js +0 -1
- package/dist/contracts/index.d.ts +0 -4
- package/dist/contracts/organization.d.ts +0 -895
- package/dist/contracts/rbac.d.ts +0 -611
- package/dist/contracts/user.d.ts +0 -610
- package/dist/entities/index.d.ts +0 -176
- package/dist/entities/organization.d.ts +0 -86
- package/dist/entities/rbac.d.ts +0 -87
- package/dist/entities/user.d.ts +0 -87
- package/dist/events.d.ts +0 -689
- package/dist/identity-rbac.feature.d.ts +0 -11
- package/dist/index.d.ts +0 -11
- package/dist/policies/engine.d.ts +0 -132
- package/dist/policies/index.d.ts +0 -2
- 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
- package/dist/schema/dist/index.js +0 -6
|
@@ -1,186 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Identity RBAC feature module that bundles user, organization,
|
|
4
|
-
* and role-based access control capabilities.
|
|
5
|
-
*/
|
|
6
|
-
const IdentityRbacFeature = {
|
|
7
|
-
meta: {
|
|
8
|
-
key: "identity-rbac",
|
|
9
|
-
title: "Identity & RBAC",
|
|
10
|
-
description: "User identity, organization management, and role-based access control",
|
|
11
|
-
domain: "platform",
|
|
12
|
-
owners: ["@platform.identity-rbac"],
|
|
13
|
-
tags: [
|
|
14
|
-
"identity",
|
|
15
|
-
"rbac",
|
|
16
|
-
"users",
|
|
17
|
-
"organizations",
|
|
18
|
-
"permissions"
|
|
19
|
-
],
|
|
20
|
-
stability: "stable"
|
|
21
|
-
},
|
|
22
|
-
operations: [
|
|
23
|
-
{
|
|
24
|
-
name: "identity.user.create",
|
|
25
|
-
version: 1
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: "identity.user.update",
|
|
29
|
-
version: 1
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: "identity.user.delete",
|
|
33
|
-
version: 1
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: "identity.user.me",
|
|
37
|
-
version: 1
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: "identity.user.list",
|
|
41
|
-
version: 1
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: "identity.org.create",
|
|
45
|
-
version: 1
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: "identity.org.update",
|
|
49
|
-
version: 1
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: "identity.org.get",
|
|
53
|
-
version: 1
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: "identity.org.list",
|
|
57
|
-
version: 1
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: "identity.org.invite",
|
|
61
|
-
version: 1
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: "identity.org.invite.accept",
|
|
65
|
-
version: 1
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: "identity.org.member.remove",
|
|
69
|
-
version: 1
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: "identity.org.members.list",
|
|
73
|
-
version: 1
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: "identity.rbac.role.create",
|
|
77
|
-
version: 1
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: "identity.rbac.role.update",
|
|
81
|
-
version: 1
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: "identity.rbac.role.delete",
|
|
85
|
-
version: 1
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: "identity.rbac.role.list",
|
|
89
|
-
version: 1
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: "identity.rbac.assign",
|
|
93
|
-
version: 1
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: "identity.rbac.revoke",
|
|
97
|
-
version: 1
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: "identity.rbac.check",
|
|
101
|
-
version: 1
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: "identity.rbac.permissions",
|
|
105
|
-
version: 1
|
|
106
|
-
}
|
|
107
|
-
],
|
|
108
|
-
events: [
|
|
109
|
-
{
|
|
110
|
-
name: "user.created",
|
|
111
|
-
version: 1
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
name: "user.updated",
|
|
115
|
-
version: 1
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: "user.deleted",
|
|
119
|
-
version: 1
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: "user.email_verified",
|
|
123
|
-
version: 1
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
name: "org.created",
|
|
127
|
-
version: 1
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
name: "org.updated",
|
|
131
|
-
version: 1
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
name: "org.deleted",
|
|
135
|
-
version: 1
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
name: "org.member.added",
|
|
139
|
-
version: 1
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
name: "org.member.removed",
|
|
143
|
-
version: 1
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: "org.member.role_changed",
|
|
147
|
-
version: 1
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
name: "org.invite.sent",
|
|
151
|
-
version: 1
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: "org.invite.accepted",
|
|
155
|
-
version: 1
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: "org.invite.declined",
|
|
159
|
-
version: 1
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
name: "role.assigned",
|
|
163
|
-
version: 1
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
name: "role.revoked",
|
|
167
|
-
version: 1
|
|
168
|
-
}
|
|
169
|
-
],
|
|
170
|
-
presentations: [],
|
|
171
|
-
opToPresentation: [],
|
|
172
|
-
presentationsTargets: [],
|
|
173
|
-
capabilities: {
|
|
174
|
-
provides: [{
|
|
175
|
-
key: "identity",
|
|
176
|
-
version: 1
|
|
177
|
-
}, {
|
|
178
|
-
key: "rbac",
|
|
179
|
-
version: 1
|
|
180
|
-
}],
|
|
181
|
-
requires: []
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
//#endregion
|
|
186
|
-
export { IdentityRbacFeature };
|
|
1
|
+
const e={meta:{key:`identity-rbac`,title:`Identity & RBAC`,description:`User identity, organization management, and role-based access control`,domain:`platform`,owners:[`@platform.identity-rbac`],tags:[`identity`,`rbac`,`users`,`organizations`,`permissions`],stability:`stable`},operations:[{name:`identity.user.create`,version:1},{name:`identity.user.update`,version:1},{name:`identity.user.delete`,version:1},{name:`identity.user.me`,version:1},{name:`identity.user.list`,version:1},{name:`identity.org.create`,version:1},{name:`identity.org.update`,version:1},{name:`identity.org.get`,version:1},{name:`identity.org.list`,version:1},{name:`identity.org.invite`,version:1},{name:`identity.org.invite.accept`,version:1},{name:`identity.org.member.remove`,version:1},{name:`identity.org.members.list`,version:1},{name:`identity.rbac.role.create`,version:1},{name:`identity.rbac.role.update`,version:1},{name:`identity.rbac.role.delete`,version:1},{name:`identity.rbac.role.list`,version:1},{name:`identity.rbac.assign`,version:1},{name:`identity.rbac.revoke`,version:1},{name:`identity.rbac.check`,version:1},{name:`identity.rbac.permissions`,version:1}],events:[{name:`user.created`,version:1},{name:`user.updated`,version:1},{name:`user.deleted`,version:1},{name:`user.email_verified`,version:1},{name:`org.created`,version:1},{name:`org.updated`,version:1},{name:`org.deleted`,version:1},{name:`org.member.added`,version:1},{name:`org.member.removed`,version:1},{name:`org.member.role_changed`,version:1},{name:`org.invite.sent`,version:1},{name:`org.invite.accepted`,version:1},{name:`org.invite.declined`,version:1},{name:`role.assigned`,version:1},{name:`role.revoked`,version:1}],presentations:[],opToPresentation:[],presentationsTargets:[],capabilities:{provides:[{key:`identity`,version:1},{key:`rbac`,version:1}],requires:[]}};export{e as IdentityRbacFeature};
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1 @@
|
|
|
1
|
-
import { IdentityRbacEvents, OrgCreatedEvent, OrgDeletedEvent, OrgInviteAcceptedEvent, OrgInviteDeclinedEvent, OrgInviteSentEvent, OrgMemberAddedEvent, OrgMemberRemovedEvent, OrgMemberRoleChangedEvent, OrgUpdatedEvent, RoleAssignedEvent, RoleRevokedEvent, UserCreatedEvent, UserDeletedEvent, UserEmailVerifiedEvent, UserUpdatedEvent
|
|
2
|
-
import { IdentityRbacFeature } from "./identity-rbac.feature.js";
|
|
3
|
-
import { AccountEntity, SessionEntity, UserEntity, VerificationEntity } from "./entities/user.js";
|
|
4
|
-
import { InvitationEntity, MemberEntity, OrganizationEntity, OrganizationTypeEnum, TeamEntity, TeamMemberEntity } from "./entities/organization.js";
|
|
5
|
-
import { ApiKeyEntity, PasskeyEntity, PermissionEntity, PolicyBindingEntity, RoleEntity } from "./entities/rbac.js";
|
|
6
|
-
import { identityRbacEntities, identityRbacSchemaContribution } from "./entities/index.js";
|
|
7
|
-
import { CreateUserContract, CreateUserInputModel, DeleteUserContract, DeleteUserInputModel, GetCurrentUserContract, ListUsersContract, ListUsersInputModel, ListUsersOutputModel, SuccessResultModel, UpdateUserContract, UpdateUserInputModel, UserDeletedPayloadModel, UserProfileModel } from "./contracts/user.js";
|
|
8
|
-
import { AcceptInviteContract, AcceptInviteInputModel, CreateOrgContract, CreateOrgInputModel, GetOrgContract, GetOrgInputModel, InvitationModel, InviteMemberContract, InviteMemberInputModel, ListMembersContract, ListMembersInputModel, ListMembersOutputModel, ListUserOrgsContract, ListUserOrgsOutputModel, MemberModel, MemberRemovedPayloadModel, MemberUserModel, OrganizationModel, OrganizationWithRoleModel, RemoveMemberContract, RemoveMemberInputModel, UpdateOrgContract, UpdateOrgInputModel } from "./contracts/organization.js";
|
|
9
|
-
import { AssignRoleContract, AssignRoleInputModel, BindingIdPayloadModel, CheckPermissionContract, CheckPermissionInputModel, CreateRoleContract, CreateRoleInputModel, DeleteRoleContract, DeleteRoleInputModel, ListRolesContract, ListRolesOutputModel, ListUserPermissionsContract, ListUserPermissionsInputModel, ListUserPermissionsOutputModel, PermissionCheckResultModel, PolicyBindingModel, RevokeRoleContract, RevokeRoleInputModel, RoleModel, UpdateRoleContract, UpdateRoleInputModel } from "./contracts/rbac.js";
|
|
10
|
-
import "./contracts/index.js";
|
|
11
|
-
import { Permission, RBACPolicyEngine, StandardRole, createRBACEngine } from "./policies/engine.js";
|
|
12
|
-
import "./policies/index.js";
|
|
13
|
-
|
|
14
|
-
export { AcceptInviteContract, AcceptInviteInputModel, AccountEntity, ApiKeyEntity, AssignRoleContract, AssignRoleInputModel, BindingIdPayloadModel, CheckPermissionContract, CheckPermissionInputModel, CreateOrgContract, CreateOrgInputModel, CreateRoleContract, CreateRoleInputModel, CreateUserContract, CreateUserInputModel, DeleteRoleContract, DeleteRoleInputModel, DeleteUserContract, DeleteUserInputModel, GetCurrentUserContract, GetOrgContract, GetOrgInputModel, IdentityRbacEvents, IdentityRbacFeature, InvitationEntity, InvitationModel, InviteMemberContract, InviteMemberInputModel, ListMembersContract, ListMembersInputModel, ListMembersOutputModel, ListRolesContract, ListRolesOutputModel, ListUserOrgsContract, ListUserOrgsOutputModel, ListUserPermissionsContract, ListUserPermissionsInputModel, ListUserPermissionsOutputModel, ListUsersContract, ListUsersInputModel, ListUsersOutputModel, MemberEntity, MemberModel, MemberRemovedPayloadModel, MemberUserModel, OrgCreatedEvent, OrgDeletedEvent, OrgInviteAcceptedEvent, OrgInviteDeclinedEvent, OrgInviteSentEvent, OrgMemberAddedEvent, OrgMemberRemovedEvent, OrgMemberRoleChangedEvent, OrgUpdatedEvent, OrganizationEntity, OrganizationModel, OrganizationTypeEnum, OrganizationWithRoleModel, PasskeyEntity, Permission, PermissionCheckResultModel, PermissionEntity, PolicyBindingEntity, PolicyBindingModel, RBACPolicyEngine, RemoveMemberContract, RemoveMemberInputModel, RevokeRoleContract, RevokeRoleInputModel, RoleAssignedEvent, RoleEntity, RoleModel, RoleRevokedEvent, SessionEntity, StandardRole, SuccessResultModel, TeamEntity, TeamMemberEntity, UpdateOrgContract, UpdateOrgInputModel, UpdateRoleContract, UpdateRoleInputModel, UpdateUserContract, UpdateUserInputModel, UserCreatedEvent, UserDeletedEvent, UserDeletedPayloadModel, UserEmailVerifiedEvent, UserEntity, UserProfileModel, UserUpdatedEvent, VerificationEntity, createRBACEngine, identityRbacEntities, identityRbacSchemaContribution };
|
|
1
|
+
import{IdentityRbacEvents as e,OrgCreatedEvent as t,OrgDeletedEvent as n,OrgInviteAcceptedEvent as r,OrgInviteDeclinedEvent as i,OrgInviteSentEvent as a,OrgMemberAddedEvent as o,OrgMemberRemovedEvent as s,OrgMemberRoleChangedEvent as c,OrgUpdatedEvent as l,RoleAssignedEvent as u,RoleRevokedEvent as d,UserCreatedEvent as f,UserDeletedEvent as p,UserEmailVerifiedEvent as m,UserUpdatedEvent as h}from"./events.js";import{IdentityRbacFeature as g}from"./identity-rbac.feature.js";import{AccountEntity as _,SessionEntity as v,UserEntity as y,VerificationEntity as b}from"./entities/user.js";import{InvitationEntity as x,MemberEntity as S,OrganizationEntity as C,OrganizationTypeEnum as w,TeamEntity as T,TeamMemberEntity as E}from"./entities/organization.js";import{ApiKeyEntity as D,PasskeyEntity as O,PermissionEntity as k,PolicyBindingEntity as A,RoleEntity as j}from"./entities/rbac.js";import{identityRbacEntities as M,identityRbacSchemaContribution as N}from"./entities/index.js";import{CreateUserContract as P,CreateUserInputModel as F,DeleteUserContract as I,DeleteUserInputModel as L,GetCurrentUserContract as R,ListUsersContract as z,ListUsersInputModel as B,ListUsersOutputModel as V,SuccessResultModel as H,UpdateUserContract as U,UpdateUserInputModel as W,UserDeletedPayloadModel as G,UserProfileModel as K}from"./contracts/user.js";import{AcceptInviteContract as q,AcceptInviteInputModel as J,CreateOrgContract as Y,CreateOrgInputModel as X,GetOrgContract as Z,GetOrgInputModel as Q,InvitationModel as $,InviteMemberContract as ee,InviteMemberInputModel as te,ListMembersContract as ne,ListMembersInputModel as re,ListMembersOutputModel as ie,ListUserOrgsContract as ae,ListUserOrgsOutputModel as oe,MemberModel as se,MemberRemovedPayloadModel as ce,MemberUserModel as le,OrganizationModel as ue,OrganizationWithRoleModel as de,RemoveMemberContract as fe,RemoveMemberInputModel as pe,UpdateOrgContract as me,UpdateOrgInputModel as he}from"./contracts/organization.js";import{AssignRoleContract as ge,AssignRoleInputModel as _e,BindingIdPayloadModel as ve,CheckPermissionContract as ye,CheckPermissionInputModel as be,CreateRoleContract as xe,CreateRoleInputModel as Se,DeleteRoleContract as Ce,DeleteRoleInputModel as we,ListRolesContract as Te,ListRolesOutputModel as Ee,ListUserPermissionsContract as De,ListUserPermissionsInputModel as Oe,ListUserPermissionsOutputModel as ke,PermissionCheckResultModel as Ae,PolicyBindingModel as je,RevokeRoleContract as Me,RevokeRoleInputModel as Ne,RoleModel as Pe,UpdateRoleContract as Fe,UpdateRoleInputModel as Ie}from"./contracts/rbac.js";import"./contracts/index.js";import{Permission as Le,RBACPolicyEngine as Re,StandardRole as ze,createRBACEngine as Be}from"./policies/engine.js";import"./policies/index.js";export{q as AcceptInviteContract,J as AcceptInviteInputModel,_ as AccountEntity,D as ApiKeyEntity,ge as AssignRoleContract,_e as AssignRoleInputModel,ve as BindingIdPayloadModel,ye as CheckPermissionContract,be as CheckPermissionInputModel,Y as CreateOrgContract,X as CreateOrgInputModel,xe as CreateRoleContract,Se as CreateRoleInputModel,P as CreateUserContract,F as CreateUserInputModel,Ce as DeleteRoleContract,we as DeleteRoleInputModel,I as DeleteUserContract,L as DeleteUserInputModel,R as GetCurrentUserContract,Z as GetOrgContract,Q as GetOrgInputModel,e as IdentityRbacEvents,g as IdentityRbacFeature,x as InvitationEntity,$ as InvitationModel,ee as InviteMemberContract,te as InviteMemberInputModel,ne as ListMembersContract,re as ListMembersInputModel,ie as ListMembersOutputModel,Te as ListRolesContract,Ee as ListRolesOutputModel,ae as ListUserOrgsContract,oe as ListUserOrgsOutputModel,De as ListUserPermissionsContract,Oe as ListUserPermissionsInputModel,ke as ListUserPermissionsOutputModel,z as ListUsersContract,B as ListUsersInputModel,V as ListUsersOutputModel,S as MemberEntity,se as MemberModel,ce as MemberRemovedPayloadModel,le as MemberUserModel,t as OrgCreatedEvent,n as OrgDeletedEvent,r as OrgInviteAcceptedEvent,i as OrgInviteDeclinedEvent,a as OrgInviteSentEvent,o as OrgMemberAddedEvent,s as OrgMemberRemovedEvent,c as OrgMemberRoleChangedEvent,l as OrgUpdatedEvent,C as OrganizationEntity,ue as OrganizationModel,w as OrganizationTypeEnum,de as OrganizationWithRoleModel,O as PasskeyEntity,Le as Permission,Ae as PermissionCheckResultModel,k as PermissionEntity,A as PolicyBindingEntity,je as PolicyBindingModel,Re as RBACPolicyEngine,fe as RemoveMemberContract,pe as RemoveMemberInputModel,Me as RevokeRoleContract,Ne as RevokeRoleInputModel,u as RoleAssignedEvent,j as RoleEntity,Pe as RoleModel,d as RoleRevokedEvent,v as SessionEntity,ze as StandardRole,H as SuccessResultModel,T as TeamEntity,E as TeamMemberEntity,me as UpdateOrgContract,he as UpdateOrgInputModel,Fe as UpdateRoleContract,Ie as UpdateRoleInputModel,U as UpdateUserContract,W as UpdateUserInputModel,f as UserCreatedEvent,p as UserDeletedEvent,G as UserDeletedPayloadModel,m as UserEmailVerifiedEvent,y as UserEntity,K as UserProfileModel,h as UserUpdatedEvent,b as VerificationEntity,Be as createRBACEngine,M as identityRbacEntities,N as identityRbacSchemaContribution};
|
package/dist/policies/engine.js
CHANGED
|
@@ -1,167 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Standard permissions for identity-rbac module.
|
|
4
|
-
*/
|
|
5
|
-
const Permission = {
|
|
6
|
-
USER_CREATE: "user.create",
|
|
7
|
-
USER_READ: "user.read",
|
|
8
|
-
USER_UPDATE: "user.update",
|
|
9
|
-
USER_DELETE: "user.delete",
|
|
10
|
-
USER_LIST: "user.list",
|
|
11
|
-
USER_MANAGE: "user.manage",
|
|
12
|
-
ORG_CREATE: "org.create",
|
|
13
|
-
ORG_READ: "org.read",
|
|
14
|
-
ORG_UPDATE: "org.update",
|
|
15
|
-
ORG_DELETE: "org.delete",
|
|
16
|
-
ORG_LIST: "org.list",
|
|
17
|
-
MEMBER_INVITE: "member.invite",
|
|
18
|
-
MEMBER_REMOVE: "member.remove",
|
|
19
|
-
MEMBER_UPDATE_ROLE: "member.update_role",
|
|
20
|
-
MEMBER_LIST: "member.list",
|
|
21
|
-
MANAGE_MEMBERS: "org.manage_members",
|
|
22
|
-
TEAM_CREATE: "team.create",
|
|
23
|
-
TEAM_UPDATE: "team.update",
|
|
24
|
-
TEAM_DELETE: "team.delete",
|
|
25
|
-
TEAM_MANAGE: "team.manage",
|
|
26
|
-
ROLE_CREATE: "role.create",
|
|
27
|
-
ROLE_UPDATE: "role.update",
|
|
28
|
-
ROLE_DELETE: "role.delete",
|
|
29
|
-
ROLE_ASSIGN: "role.assign",
|
|
30
|
-
ROLE_REVOKE: "role.revoke",
|
|
31
|
-
BILLING_VIEW: "billing.view",
|
|
32
|
-
BILLING_MANAGE: "billing.manage",
|
|
33
|
-
PROJECT_CREATE: "project.create",
|
|
34
|
-
PROJECT_READ: "project.read",
|
|
35
|
-
PROJECT_UPDATE: "project.update",
|
|
36
|
-
PROJECT_DELETE: "project.delete",
|
|
37
|
-
PROJECT_MANAGE: "project.manage",
|
|
38
|
-
ADMIN_ACCESS: "admin.access",
|
|
39
|
-
ADMIN_IMPERSONATE: "admin.impersonate"
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Standard role definitions.
|
|
43
|
-
*/
|
|
44
|
-
const StandardRole = {
|
|
45
|
-
OWNER: {
|
|
46
|
-
name: "owner",
|
|
47
|
-
description: "Organization owner with full access",
|
|
48
|
-
permissions: Object.values(Permission)
|
|
49
|
-
},
|
|
50
|
-
ADMIN: {
|
|
51
|
-
name: "admin",
|
|
52
|
-
description: "Administrator with most permissions",
|
|
53
|
-
permissions: [
|
|
54
|
-
Permission.USER_READ,
|
|
55
|
-
Permission.USER_LIST,
|
|
56
|
-
Permission.ORG_READ,
|
|
57
|
-
Permission.ORG_UPDATE,
|
|
58
|
-
Permission.MEMBER_INVITE,
|
|
59
|
-
Permission.MEMBER_REMOVE,
|
|
60
|
-
Permission.MEMBER_UPDATE_ROLE,
|
|
61
|
-
Permission.MEMBER_LIST,
|
|
62
|
-
Permission.MANAGE_MEMBERS,
|
|
63
|
-
Permission.TEAM_CREATE,
|
|
64
|
-
Permission.TEAM_UPDATE,
|
|
65
|
-
Permission.TEAM_DELETE,
|
|
66
|
-
Permission.TEAM_MANAGE,
|
|
67
|
-
Permission.PROJECT_CREATE,
|
|
68
|
-
Permission.PROJECT_READ,
|
|
69
|
-
Permission.PROJECT_UPDATE,
|
|
70
|
-
Permission.PROJECT_DELETE,
|
|
71
|
-
Permission.PROJECT_MANAGE,
|
|
72
|
-
Permission.BILLING_VIEW
|
|
73
|
-
]
|
|
74
|
-
},
|
|
75
|
-
MEMBER: {
|
|
76
|
-
name: "member",
|
|
77
|
-
description: "Regular organization member",
|
|
78
|
-
permissions: [
|
|
79
|
-
Permission.USER_READ,
|
|
80
|
-
Permission.ORG_READ,
|
|
81
|
-
Permission.MEMBER_LIST,
|
|
82
|
-
Permission.PROJECT_READ,
|
|
83
|
-
Permission.PROJECT_CREATE
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
VIEWER: {
|
|
87
|
-
name: "viewer",
|
|
88
|
-
description: "Read-only access",
|
|
89
|
-
permissions: [
|
|
90
|
-
Permission.USER_READ,
|
|
91
|
-
Permission.ORG_READ,
|
|
92
|
-
Permission.MEMBER_LIST,
|
|
93
|
-
Permission.PROJECT_READ
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* RBAC Policy Engine for permission checks.
|
|
99
|
-
*/
|
|
100
|
-
var RBACPolicyEngine = class {
|
|
101
|
-
roleCache = /* @__PURE__ */ new Map();
|
|
102
|
-
bindingCache = /* @__PURE__ */ new Map();
|
|
103
|
-
/**
|
|
104
|
-
* Check if a user has a specific permission.
|
|
105
|
-
*/
|
|
106
|
-
async checkPermission(input, bindings) {
|
|
107
|
-
const { userId, orgId, permission } = input;
|
|
108
|
-
const now = /* @__PURE__ */ new Date();
|
|
109
|
-
const userBindings = bindings.filter((b) => b.targetType === "user" && b.targetId === userId);
|
|
110
|
-
const orgBindings = orgId ? bindings.filter((b) => b.targetType === "organization" && b.targetId === orgId) : [];
|
|
111
|
-
const activeBindings = [...userBindings, ...orgBindings].filter((b) => !b.expiresAt || b.expiresAt > now);
|
|
112
|
-
if (activeBindings.length === 0) return {
|
|
113
|
-
allowed: false,
|
|
114
|
-
reason: "No active role bindings found"
|
|
115
|
-
};
|
|
116
|
-
for (const binding of activeBindings) if (binding.role.permissions.includes(permission)) return {
|
|
117
|
-
allowed: true,
|
|
118
|
-
matchedRole: binding.role.name
|
|
119
|
-
};
|
|
120
|
-
return {
|
|
121
|
-
allowed: false,
|
|
122
|
-
reason: `No role grants the "${permission}" permission`
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Get all permissions for a user in a context.
|
|
127
|
-
*/
|
|
128
|
-
async getPermissions(userId, orgId, bindings) {
|
|
129
|
-
const now = /* @__PURE__ */ new Date();
|
|
130
|
-
const userBindings = bindings.filter((b) => b.targetType === "user" && b.targetId === userId);
|
|
131
|
-
const orgBindings = orgId ? bindings.filter((b) => b.targetType === "organization" && b.targetId === orgId) : [];
|
|
132
|
-
const activeBindings = [...userBindings, ...orgBindings].filter((b) => !b.expiresAt || b.expiresAt > now);
|
|
133
|
-
const permissions = /* @__PURE__ */ new Set();
|
|
134
|
-
const roles = [];
|
|
135
|
-
for (const binding of activeBindings) {
|
|
136
|
-
roles.push(binding.role);
|
|
137
|
-
for (const perm of binding.role.permissions) permissions.add(perm);
|
|
138
|
-
}
|
|
139
|
-
return {
|
|
140
|
-
permissions,
|
|
141
|
-
roles
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Check if user has any of the specified permissions.
|
|
146
|
-
*/
|
|
147
|
-
async hasAnyPermission(userId, orgId, permissions, bindings) {
|
|
148
|
-
const { permissions: userPerms } = await this.getPermissions(userId, orgId, bindings);
|
|
149
|
-
return permissions.some((p) => userPerms.has(p));
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Check if user has all of the specified permissions.
|
|
153
|
-
*/
|
|
154
|
-
async hasAllPermissions(userId, orgId, permissions, bindings) {
|
|
155
|
-
const { permissions: userPerms } = await this.getPermissions(userId, orgId, bindings);
|
|
156
|
-
return permissions.every((p) => userPerms.has(p));
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* Create a new RBAC policy engine instance.
|
|
161
|
-
*/
|
|
162
|
-
function createRBACEngine() {
|
|
163
|
-
return new RBACPolicyEngine();
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
//#endregion
|
|
167
|
-
export { Permission, RBACPolicyEngine, StandardRole, createRBACEngine };
|
|
1
|
+
const e={USER_CREATE:`user.create`,USER_READ:`user.read`,USER_UPDATE:`user.update`,USER_DELETE:`user.delete`,USER_LIST:`user.list`,USER_MANAGE:`user.manage`,ORG_CREATE:`org.create`,ORG_READ:`org.read`,ORG_UPDATE:`org.update`,ORG_DELETE:`org.delete`,ORG_LIST:`org.list`,MEMBER_INVITE:`member.invite`,MEMBER_REMOVE:`member.remove`,MEMBER_UPDATE_ROLE:`member.update_role`,MEMBER_LIST:`member.list`,MANAGE_MEMBERS:`org.manage_members`,TEAM_CREATE:`team.create`,TEAM_UPDATE:`team.update`,TEAM_DELETE:`team.delete`,TEAM_MANAGE:`team.manage`,ROLE_CREATE:`role.create`,ROLE_UPDATE:`role.update`,ROLE_DELETE:`role.delete`,ROLE_ASSIGN:`role.assign`,ROLE_REVOKE:`role.revoke`,BILLING_VIEW:`billing.view`,BILLING_MANAGE:`billing.manage`,PROJECT_CREATE:`project.create`,PROJECT_READ:`project.read`,PROJECT_UPDATE:`project.update`,PROJECT_DELETE:`project.delete`,PROJECT_MANAGE:`project.manage`,ADMIN_ACCESS:`admin.access`,ADMIN_IMPERSONATE:`admin.impersonate`},t={OWNER:{name:`owner`,description:`Organization owner with full access`,permissions:Object.values(e)},ADMIN:{name:`admin`,description:`Administrator with most permissions`,permissions:[e.USER_READ,e.USER_LIST,e.ORG_READ,e.ORG_UPDATE,e.MEMBER_INVITE,e.MEMBER_REMOVE,e.MEMBER_UPDATE_ROLE,e.MEMBER_LIST,e.MANAGE_MEMBERS,e.TEAM_CREATE,e.TEAM_UPDATE,e.TEAM_DELETE,e.TEAM_MANAGE,e.PROJECT_CREATE,e.PROJECT_READ,e.PROJECT_UPDATE,e.PROJECT_DELETE,e.PROJECT_MANAGE,e.BILLING_VIEW]},MEMBER:{name:`member`,description:`Regular organization member`,permissions:[e.USER_READ,e.ORG_READ,e.MEMBER_LIST,e.PROJECT_READ,e.PROJECT_CREATE]},VIEWER:{name:`viewer`,description:`Read-only access`,permissions:[e.USER_READ,e.ORG_READ,e.MEMBER_LIST,e.PROJECT_READ]}};var n=class{roleCache=new Map;bindingCache=new Map;async checkPermission(e,t){let{userId:n,orgId:r,permission:i}=e,a=new Date,o=t.filter(e=>e.targetType===`user`&&e.targetId===n),s=r?t.filter(e=>e.targetType===`organization`&&e.targetId===r):[],c=[...o,...s].filter(e=>!e.expiresAt||e.expiresAt>a);if(c.length===0)return{allowed:!1,reason:`No active role bindings found`};for(let e of c)if(e.role.permissions.includes(i))return{allowed:!0,matchedRole:e.role.name};return{allowed:!1,reason:`No role grants the "${i}" permission`}}async getPermissions(e,t,n){let r=new Date,i=n.filter(t=>t.targetType===`user`&&t.targetId===e),a=t?n.filter(e=>e.targetType===`organization`&&e.targetId===t):[],o=[...i,...a].filter(e=>!e.expiresAt||e.expiresAt>r),s=new Set,c=[];for(let e of o){c.push(e.role);for(let t of e.role.permissions)s.add(t)}return{permissions:s,roles:c}}async hasAnyPermission(e,t,n,r){let{permissions:i}=await this.getPermissions(e,t,r);return n.some(e=>i.has(e))}async hasAllPermissions(e,t,n,r){let{permissions:i}=await this.getPermissions(e,t,r);return n.every(e=>i.has(e))}};function r(){return new n}export{e as Permission,n as RBACPolicyEngine,t as StandardRole,r as createRBACEngine};
|
package/dist/policies/index.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export { Permission, RBACPolicyEngine, StandardRole, createRBACEngine };
|
|
1
|
+
import{Permission as e,RBACPolicyEngine as t,StandardRole as n,createRBACEngine as r}from"./engine.js";export{e as Permission,t as RBACPolicyEngine,n as StandardRole,r as createRBACEngine};
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/lib.identity-rbac",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.41.0",
|
|
4
4
|
"description": "Identity, Organizations, and RBAC module for ContractSpec applications",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
10
|
-
"publish:pkg:canary": "bun publish:pkg --tag canary",
|
|
11
10
|
"build": "bun build:bundle && bun build:types",
|
|
12
11
|
"build:bundle": "tsdown",
|
|
13
12
|
"build:types": "tsc --noEmit",
|
|
@@ -18,29 +17,29 @@
|
|
|
18
17
|
"lint:check": "eslint src"
|
|
19
18
|
},
|
|
20
19
|
"dependencies": {
|
|
21
|
-
"@lssm/lib.schema": "
|
|
22
|
-
"@lssm/lib.contracts": "
|
|
20
|
+
"@lssm/lib.schema": "workspace:*",
|
|
21
|
+
"@lssm/lib.contracts": "workspace:*",
|
|
23
22
|
"zod": "^4.1.13"
|
|
24
23
|
},
|
|
25
24
|
"devDependencies": {
|
|
26
|
-
"@lssm/tool.typescript": "
|
|
27
|
-
"@lssm/tool.tsdown": "
|
|
25
|
+
"@lssm/tool.typescript": "workspace:*",
|
|
26
|
+
"@lssm/tool.tsdown": "workspace:*",
|
|
28
27
|
"typescript": "^5.9.3"
|
|
29
28
|
},
|
|
30
29
|
"exports": {
|
|
31
|
-
".": "./
|
|
32
|
-
"./contracts": "./
|
|
33
|
-
"./contracts/organization": "./
|
|
34
|
-
"./contracts/rbac": "./
|
|
35
|
-
"./contracts/user": "./
|
|
36
|
-
"./entities": "./
|
|
37
|
-
"./entities/organization": "./
|
|
38
|
-
"./entities/rbac": "./
|
|
39
|
-
"./entities/user": "./
|
|
40
|
-
"./events": "./
|
|
41
|
-
"./identity-rbac.feature": "./
|
|
42
|
-
"./policies": "./
|
|
43
|
-
"./policies/engine": "./
|
|
30
|
+
".": "./src/index.ts",
|
|
31
|
+
"./contracts": "./src/contracts/index.ts",
|
|
32
|
+
"./contracts/organization": "./src/contracts/organization.ts",
|
|
33
|
+
"./contracts/rbac": "./src/contracts/rbac.ts",
|
|
34
|
+
"./contracts/user": "./src/contracts/user.ts",
|
|
35
|
+
"./entities": "./src/entities/index.ts",
|
|
36
|
+
"./entities/organization": "./src/entities/organization.ts",
|
|
37
|
+
"./entities/rbac": "./src/entities/rbac.ts",
|
|
38
|
+
"./entities/user": "./src/entities/user.ts",
|
|
39
|
+
"./events": "./src/events.ts",
|
|
40
|
+
"./identity-rbac.feature": "./src/identity-rbac.feature.ts",
|
|
41
|
+
"./policies": "./src/policies/index.ts",
|
|
42
|
+
"./policies/engine": "./src/policies/engine.ts",
|
|
44
43
|
"./*": "./*"
|
|
45
44
|
},
|
|
46
45
|
"module": "./dist/index.js",
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { StabilityEnum } from "../ownership.js";
|
|
2
|
-
|
|
3
|
-
//#region ../contracts/dist/capabilities/openbanking.js
|
|
4
|
-
const OWNERS = ["platform.finance"];
|
|
5
|
-
const TAGS = ["open-banking", "finance"];
|
|
6
|
-
const openBankingAccountsReadCapability = {
|
|
7
|
-
meta: {
|
|
8
|
-
key: "openbanking.accounts.read",
|
|
9
|
-
version: 1,
|
|
10
|
-
kind: "integration",
|
|
11
|
-
title: "Open Banking Accounts (Read)",
|
|
12
|
-
description: "Provides read-only access to linked bank accounts, including account summaries and metadata.",
|
|
13
|
-
domain: "finance",
|
|
14
|
-
owners: [...OWNERS],
|
|
15
|
-
tags: [...TAGS],
|
|
16
|
-
stability: StabilityEnum.Experimental
|
|
17
|
-
},
|
|
18
|
-
provides: [
|
|
19
|
-
{
|
|
20
|
-
surface: "operation",
|
|
21
|
-
name: "openbanking.accounts.list",
|
|
22
|
-
version: 1,
|
|
23
|
-
description: "List bank accounts linked to a Powens open banking connection."
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
surface: "operation",
|
|
27
|
-
name: "openbanking.accounts.get",
|
|
28
|
-
version: 1,
|
|
29
|
-
description: "Retrieve the canonical bank account record for a specific account."
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
surface: "operation",
|
|
33
|
-
name: "openbanking.accounts.sync",
|
|
34
|
-
version: 1,
|
|
35
|
-
description: "Trigger a refresh of bank account metadata from the open banking provider."
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
};
|
|
39
|
-
const openBankingTransactionsReadCapability = {
|
|
40
|
-
meta: {
|
|
41
|
-
key: "openbanking.transactions.read",
|
|
42
|
-
version: 1,
|
|
43
|
-
kind: "integration",
|
|
44
|
-
title: "Open Banking Transactions (Read)",
|
|
45
|
-
description: "Enables retrieval of transaction history for linked bank accounts via open banking providers.",
|
|
46
|
-
domain: "finance",
|
|
47
|
-
owners: [...OWNERS],
|
|
48
|
-
tags: [...TAGS, "transactions"],
|
|
49
|
-
stability: StabilityEnum.Experimental
|
|
50
|
-
},
|
|
51
|
-
provides: [{
|
|
52
|
-
surface: "operation",
|
|
53
|
-
name: "openbanking.transactions.list",
|
|
54
|
-
version: 1,
|
|
55
|
-
description: "List transactions for a given bank account with optional date filtering."
|
|
56
|
-
}, {
|
|
57
|
-
surface: "operation",
|
|
58
|
-
name: "openbanking.transactions.sync",
|
|
59
|
-
version: 1,
|
|
60
|
-
description: "Synchronise transactions from the open banking provider into the canonical ledger."
|
|
61
|
-
}]
|
|
62
|
-
};
|
|
63
|
-
const openBankingBalancesReadCapability = {
|
|
64
|
-
meta: {
|
|
65
|
-
key: "openbanking.balances.read",
|
|
66
|
-
version: 1,
|
|
67
|
-
kind: "integration",
|
|
68
|
-
title: "Open Banking Balances (Read)",
|
|
69
|
-
description: "Allows querying of current and available balances for linked bank accounts via open banking providers.",
|
|
70
|
-
domain: "finance",
|
|
71
|
-
owners: [...OWNERS],
|
|
72
|
-
tags: [...TAGS, "balances"],
|
|
73
|
-
stability: StabilityEnum.Experimental
|
|
74
|
-
},
|
|
75
|
-
provides: [{
|
|
76
|
-
surface: "operation",
|
|
77
|
-
name: "openbanking.balances.get",
|
|
78
|
-
version: 1,
|
|
79
|
-
description: "Retrieve the latest known balances for a specified bank account."
|
|
80
|
-
}, {
|
|
81
|
-
surface: "operation",
|
|
82
|
-
name: "openbanking.balances.refresh",
|
|
83
|
-
version: 1,
|
|
84
|
-
description: "Force a balance refresh from the open banking provider."
|
|
85
|
-
}]
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
//#endregion
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { ContractRegistryFileSchema, ContractRegistryItemSchema, ContractRegistryItemTypeSchema } from "./schemas.js";
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { StabilityEnum } from "../ownership.js";
|
|
2
|
-
import z from "zod";
|
|
3
|
-
|
|
4
|
-
//#region ../contracts/dist/contract-registry/schemas.js
|
|
5
|
-
const ContractRegistryItemTypeSchema = z.enum([
|
|
6
|
-
"contractspec:operation",
|
|
7
|
-
"contractspec:event",
|
|
8
|
-
"contractspec:presentation",
|
|
9
|
-
"contractspec:form",
|
|
10
|
-
"contractspec:feature",
|
|
11
|
-
"contractspec:workflow",
|
|
12
|
-
"contractspec:template",
|
|
13
|
-
"contractspec:integration",
|
|
14
|
-
"contractspec:data-view",
|
|
15
|
-
"contractspec:migration",
|
|
16
|
-
"contractspec:telemetry",
|
|
17
|
-
"contractspec:experiment",
|
|
18
|
-
"contractspec:app-config",
|
|
19
|
-
"contractspec:knowledge"
|
|
20
|
-
]);
|
|
21
|
-
const ContractRegistryFileSchema = z.object({
|
|
22
|
-
path: z.string().min(1),
|
|
23
|
-
type: z.string().min(1),
|
|
24
|
-
content: z.string().optional()
|
|
25
|
-
});
|
|
26
|
-
const ContractRegistryItemSchema = z.object({
|
|
27
|
-
name: z.string().min(1),
|
|
28
|
-
type: ContractRegistryItemTypeSchema,
|
|
29
|
-
version: z.number().int().nonnegative(),
|
|
30
|
-
title: z.string().min(1),
|
|
31
|
-
description: z.string().min(1),
|
|
32
|
-
meta: z.object({
|
|
33
|
-
stability: z.enum([
|
|
34
|
-
StabilityEnum.Idea,
|
|
35
|
-
StabilityEnum.InCreation,
|
|
36
|
-
StabilityEnum.Experimental,
|
|
37
|
-
StabilityEnum.Beta,
|
|
38
|
-
StabilityEnum.Stable,
|
|
39
|
-
StabilityEnum.Deprecated
|
|
40
|
-
]),
|
|
41
|
-
owners: z.array(z.string().min(1)).default([]),
|
|
42
|
-
tags: z.array(z.string().min(1)).default([])
|
|
43
|
-
}),
|
|
44
|
-
dependencies: z.array(z.string().min(1)).optional(),
|
|
45
|
-
registryDependencies: z.array(z.string().min(1)).optional(),
|
|
46
|
-
files: z.array(ContractRegistryFileSchema).min(1),
|
|
47
|
-
schema: z.object({
|
|
48
|
-
input: z.unknown().optional(),
|
|
49
|
-
output: z.unknown().optional()
|
|
50
|
-
}).optional()
|
|
51
|
-
});
|
|
52
|
-
const ContractRegistryManifestSchema = z.object({
|
|
53
|
-
$schema: z.string().min(1).optional(),
|
|
54
|
-
name: z.string().min(1),
|
|
55
|
-
homepage: z.string().min(1).optional(),
|
|
56
|
-
items: z.array(ContractRegistryItemSchema)
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
//#endregion
|
|
60
|
-
export { ContractRegistryFileSchema, ContractRegistryItemSchema, ContractRegistryItemTypeSchema };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { registerDocBlocks } from "./registry.js";
|
|
2
|
-
|
|
3
|
-
//#region ../contracts/dist/docs/PUBLISHING.docblock.js
|
|
4
|
-
const PUBLISHING_DocBlocks = [{
|
|
5
|
-
id: "docs.PUBLISHING",
|
|
6
|
-
title: "Publishing ContractSpec Libraries",
|
|
7
|
-
summary: "This guide describes how we release the ContractSpec libraries to npm. We use a dual-track release system: **Stable** (manual) and **Canary** (automatic).",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/PUBLISHING",
|
|
11
|
-
tags: ["PUBLISHING"],
|
|
12
|
-
body: "# Publishing ContractSpec Libraries\n\nThis guide describes how we release the ContractSpec libraries to npm. We use a dual-track release system: **Stable** (manual) and **Canary** (automatic).\n\n## Release Tracks\n\n| Track | Branch | npm Tag | Frequency | Versioning | Use Case |\n|-------|--------|---------|-----------|------------|----------|\n| **Stable** | `release` | `latest` | Manual | SemVer (e.g., `1.7.4`) | Production, external users |\n| **Canary** | `main` | `canary` | Every Push | Snapshot (e.g., `1.7.4-canary...`) | Dev, internal testing |\n\n## Prerequisites\n\n- ✅ `NPM_TOKEN` secret is configured in GitHub (owner or automation token with _publish_ scope).\n- ✅ `GITHUB_TOKEN` (built-in) has permissions to create PRs (enabled by default in new repos).\n- ✅ For stable releases: `release` branch exists and is protected.\n\n## Canary Workflow (Automatic)\n\nEvery commit pushed to `main` triggers the `.github/workflows/publish-canary.yml` workflow.\n\n1. **Trigger**: Push to `main`.\n2. **Versioning**: Runs `changeset version --snapshot canary` to generate a temporary snapshot version.\n3. **Publish**: Packages are published to npm with the `canary` tag using `changeset publish --tag canary`.\n\n### Consuming Canary Builds\n\nTo install the latest bleeding-edge version:\n\n```bash\nnpm install @lssm/lib.contracts@canary\n# or\nbun add @lssm/lib.contracts@canary\n```\n\n## Stable Release Workflow (Manual)\n\nStable releases are managed via the `release` branch using the standard [Changesets Action](https://github.com/changesets/action).\n\n1. **Develop on `main`**: Create features and fixes.\n2. **Add Changesets**: Run `bun changeset` to document changes and impact (major/minor/patch).\n3. **Merge to `release`**: When ready to ship, open a PR from `main` to `release` or merge manually.\n4. **\"Version Packages\" PR**:\n - The GitHub Action detects new changesets and automatically creates a Pull Request titled **\"Version Packages\"**.\n - This PR contains the version bumps and updated `CHANGELOG.md` files.\n5. **Merge & Publish**:\n - Review and merge the \"Version Packages\" PR.\n - The Action runs again, detects the versions have been bumped, builds the libraries, and publishes them to npm with the `latest` tag.\n\n### Publishing Steps\n\n1. Ensure all changesets are present on `main`.\n2. Merge `main` into `release`:\n ```bash\n git checkout release\n git pull origin release\n git merge main\n git push origin release\n ```\n3. Go to GitHub Pull Requests. You will see a **\"Version Packages\"** PR created by the bot.\n4. Merge that PR.\n5. The release is now live on npm!\n\n## Manual Verification (Optional)\n\nBefore publishing a new version you can run:\n\n```bash\nbun run build:not-apps\nnpx npm-packlist --json packages/libs/contracts\n```\n\n## Rollback\n\nIf a publish fails mid-way, re-run the workflow once the issue is fixed. Already published packages are skipped automatically. Use `npm deprecate <package>@<version>` if we need to warn consumers about a broken release.\n"
|
|
13
|
-
}];
|
|
14
|
-
registerDocBlocks(PUBLISHING_DocBlocks);
|
|
15
|
-
|
|
16
|
-
//#endregion
|