@astrale-domains/shell 0.1.6 → 0.1.7
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/README.md +73 -173
- package/dist/domain.d.ts +477 -31
- package/dist/domain.js +87 -78
- package/dist/functions/application/index.js +2 -1
- package/dist/functions/application/legacy/index.js +1 -0
- package/dist/functions/application/legacy/list-entrypoints.js +8 -0
- package/dist/functions/authority/capabilities.js +1 -0
- package/dist/functions/authority/composition.js +47 -0
- package/dist/functions/authority/index.js +2 -0
- package/dist/functions/authority/roles.js +98 -0
- package/dist/functions/directory/disconnect-directory.js +35 -0
- package/dist/functions/directory/index.js +1 -0
- package/dist/functions/group/change-group-membership.js +43 -9
- package/dist/functions/group/create-group.js +23 -0
- package/dist/functions/group/delete-group.js +33 -0
- package/dist/functions/group/deprovision-group.js +27 -0
- package/dist/functions/group/group-errors.js +43 -0
- package/dist/functions/group/group-membership-errors.js +2 -0
- package/dist/functions/group/group.js +51 -0
- package/dist/functions/group/index.js +8 -2
- package/dist/functions/group/legacy/index.js +1 -0
- package/dist/functions/group/legacy/membership.js +60 -0
- package/dist/functions/group/membership-laws.js +40 -0
- package/dist/functions/group/provision-group.js +33 -0
- package/dist/functions/group/update-group.js +55 -0
- package/dist/functions/invitation/index.js +2 -0
- package/dist/functions/invitation/invitation-errors.js +13 -0
- package/dist/functions/invitation/invitation-methods.js +41 -0
- package/dist/functions/invitation/send-invitation.js +81 -0
- package/dist/functions/user/account.js +35 -0
- package/dist/functions/user/create-user.js +45 -0
- package/dist/functions/user/deactivate-user.js +19 -0
- package/dist/functions/user/delete-user.js +34 -0
- package/dist/functions/user/deprovision-user.js +21 -0
- package/dist/functions/user/index.js +15 -1
- package/dist/functions/user/invite-errors.js +18 -0
- package/dist/functions/user/invite-user.js +42 -34
- package/dist/functions/user/legacy/claimed-account.js +11 -0
- package/dist/functions/user/legacy/index.js +4 -0
- package/dist/functions/user/legacy/invite.js +20 -0
- package/dist/functions/user/legacy/migrate-accounts.js +98 -0
- package/dist/functions/user/legacy/record-profile.js +19 -0
- package/dist/functions/user/protect-administrators.js +16 -0
- package/dist/functions/user/provision-user.js +70 -0
- package/dist/functions/user/reactivate-user.js +19 -0
- package/dist/functions/user/read-account.js +12 -0
- package/dist/functions/user/request-invitation.js +17 -0
- package/dist/functions/user/update-profile.js +22 -0
- package/dist/functions/user/update-user.js +68 -0
- package/dist/functions/user/user-errors.js +69 -0
- package/dist/functions/user/write-account.js +57 -0
- package/dist/functions/view-access/index.js +2 -1
- package/dist/functions/view-access/{assign-views.js → legacy/assign-views.js} +11 -7
- package/dist/functions/view-access/legacy/index.js +1 -0
- package/dist/functions/view-access/{view-access-errors.js → legacy/view-access-errors.js} +5 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/integrations/user-invitation/invite-user-request.d.ts +6 -0
- package/dist/legacy/index.js +1 -0
- package/dist/legacy/release.js +33 -0
- package/dist/mutations/composition/grant-role.js +13 -0
- package/dist/mutations/composition/index.js +1 -0
- package/dist/mutations/group/legacy/index.js +1 -0
- package/dist/mutations/group/legacy/membership-class.js +7 -0
- package/dist/mutations/group/set-group-membership.js +23 -14
- package/dist/mutations/identity/create-profile.js +37 -0
- package/dist/mutations/identity/delete-identity.js +28 -0
- package/dist/mutations/identity/index.js +4 -0
- package/dist/mutations/identity/write-account.js +109 -0
- package/dist/mutations/identity/write-group.js +72 -0
- package/dist/mutations/invitation/index.js +1 -0
- package/dist/mutations/invitation/write-invitation.js +62 -0
- package/dist/mutations/user/legacy/index.js +1 -0
- package/dist/mutations/user/{record-user-profile.js → legacy/record-user-profile.js} +5 -2
- package/dist/providers/admin-enrollment/create-admin-enrollment-provider.js +6 -3
- package/dist/providers/admin-enrollment/legacy/index.js +1 -0
- package/dist/providers/admin-enrollment/legacy/send-without-profile.js +16 -0
- package/dist/queries/application/legacy/index.js +1 -0
- package/dist/queries/application/legacy/read-installed-entrypoints.js +47 -0
- package/dist/queries/composition/index.js +2 -0
- package/dist/queries/composition/read-extensions.js +34 -0
- package/dist/queries/composition/read-role-nodes.js +41 -0
- package/dist/queries/group/index.js +1 -1
- package/dist/queries/group/legacy/index.js +2 -0
- package/dist/queries/group/legacy/read-core-groups.js +46 -0
- package/dist/queries/group/legacy/read-member-of-group.js +24 -0
- package/dist/queries/group/read-group-membership-endpoints.js +11 -0
- package/dist/queries/group/read-group-membership.js +6 -21
- package/dist/queries/identity/index.js +1 -0
- package/dist/queries/identity/read-identities.js +29 -0
- package/dist/queries/invitation/index.js +1 -0
- package/dist/queries/invitation/read-invitation.js +25 -0
- package/dist/queries/profile/index.js +1 -0
- package/dist/queries/profile/read-profile.js +15 -0
- package/dist/queries/role/index.js +1 -0
- package/dist/queries/role/read-role-node.js +13 -0
- package/dist/queries/user/legacy/index.js +1 -0
- package/dist/queries/user/legacy/read-user-profile.js +27 -0
- package/dist/runtime.d.ts +18203 -630
- package/dist/runtime.js +32 -7
- package/dist/schema/index.d.ts +7 -4
- package/dist/schema/index.js +8 -4
- package/dist/schema/legacy/index.js +1 -0
- package/dist/schema/legacy/schema.js +32 -0
- package/dist/schema/modules/application/legacy/entrypoint-entry.js +11 -0
- package/dist/schema/modules/application/legacy/functions/index.js +1 -0
- package/dist/schema/modules/application/legacy/functions/list-entrypoints.js +21 -0
- package/dist/schema/modules/application/legacy/index.js +2 -0
- package/dist/schema/modules/directory/functions/disconnect-directory.d.ts +13 -0
- package/dist/schema/modules/directory/functions/disconnect-directory.js +15 -0
- package/dist/schema/modules/directory/functions/index.d.ts +1 -0
- package/dist/schema/modules/directory/functions/index.js +1 -0
- package/dist/schema/modules/directory/index.d.ts +1 -0
- package/dist/schema/modules/directory/index.js +1 -0
- package/dist/schema/modules/group/classes/group-profile-link.d.ts +34 -0
- package/dist/schema/modules/group/classes/group-profile-link.js +21 -0
- package/dist/schema/modules/group/classes/group-profile.d.ts +15 -0
- package/dist/schema/modules/group/classes/group-profile.js +20 -0
- package/dist/schema/modules/group/classes/group.d.ts +73 -1
- package/dist/schema/modules/group/classes/group.js +28 -7
- package/dist/schema/modules/group/classes/index.d.ts +2 -1
- package/dist/schema/modules/group/classes/index.js +3 -1
- package/dist/schema/modules/group/functions/assign-member.js +17 -0
- package/dist/schema/modules/group/functions/create-group.js +20 -0
- package/dist/schema/modules/group/functions/delete-group.js +12 -0
- package/dist/schema/modules/group/functions/deprovision-group.js +14 -0
- package/dist/schema/modules/group/functions/index.js +7 -2
- package/dist/schema/modules/group/functions/provision-group.js +14 -0
- package/dist/schema/modules/group/functions/unassign-member.js +17 -0
- package/dist/schema/modules/group/functions/update-group.js +20 -0
- package/dist/schema/modules/group/index.d.ts +3 -3
- package/dist/schema/modules/group/index.js +4 -3
- package/dist/schema/modules/group/legacy/admission.d.ts +9 -0
- package/dist/schema/modules/group/legacy/admission.js +9 -0
- package/dist/schema/modules/group/legacy/classes/index.d.ts +1 -0
- package/dist/schema/modules/group/legacy/classes/index.js +1 -0
- package/dist/schema/modules/group/{classes → legacy/classes}/member-of-group.d.ts +10 -1
- package/dist/schema/modules/group/legacy/classes/member-of-group.js +32 -0
- package/dist/schema/modules/group/legacy/core-groups.d.ts +22 -0
- package/dist/schema/modules/group/legacy/core-groups.js +28 -0
- package/dist/schema/modules/group/legacy/index.d.ts +5 -0
- package/dist/schema/modules/group/legacy/index.js +6 -0
- package/dist/schema/modules/group/legacy/policies/belongs-to-group.d.ts +5 -0
- package/dist/schema/modules/group/legacy/policies/belongs-to-group.js +9 -0
- package/dist/schema/modules/group/legacy/policies/index.d.ts +2 -0
- package/dist/schema/modules/group/legacy/policies/index.js +2 -0
- package/dist/schema/modules/group/legacy/policies/owns-membership-group.d.ts +6 -0
- package/dist/schema/modules/group/legacy/policies/owns-membership-group.js +12 -0
- package/dist/schema/modules/group/legacy/relaxations.d.ts +21 -0
- package/dist/schema/modules/group/legacy/relaxations.js +27 -0
- package/dist/schema/modules/group/policies/describes-group-of-subject.d.ts +2 -0
- package/dist/schema/modules/group/policies/describes-group-of-subject.js +7 -0
- package/dist/schema/modules/group/policies/index.d.ts +2 -1
- package/dist/schema/modules/group/policies/index.js +2 -1
- package/dist/schema/modules/group/policies/is-group-profile-source.d.ts +2 -0
- package/dist/schema/modules/group/policies/is-group-profile-source.js +6 -0
- package/dist/schema/modules/group/types/group.js +10 -0
- package/dist/schema/modules/group/types/index.js +1 -0
- package/dist/schema/modules/invitation/classes/index.js +2 -0
- package/dist/schema/modules/invitation/classes/invitation-user.js +17 -0
- package/dist/schema/modules/invitation/classes/invitation.js +30 -0
- package/dist/schema/modules/invitation/functions/accept.js +16 -0
- package/dist/schema/modules/invitation/functions/cancel.js +12 -0
- package/dist/schema/modules/invitation/functions/index.js +4 -0
- package/dist/schema/modules/invitation/functions/resend.js +12 -0
- package/dist/schema/modules/invitation/functions/send.js +20 -0
- package/dist/schema/modules/invitation/index.js +2 -0
- package/dist/schema/modules/invitation/types/index.js +1 -0
- package/dist/schema/modules/invitation/types/invitation-status.js +5 -0
- package/dist/schema/modules/namespace/classes/alias.d.ts +2 -1
- package/dist/schema/modules/namespace/classes/alias.js +11 -2
- package/dist/schema/modules/namespace/functions/link.js +3 -2
- package/dist/schema/modules/namespace/functions/rename.js +3 -2
- package/dist/schema/modules/namespace/functions/unlink.js +3 -2
- package/dist/schema/modules/role/classes/index.d.ts +1 -0
- package/dist/schema/modules/role/classes/index.js +1 -0
- package/dist/schema/modules/role/classes/role.d.ts +16 -0
- package/dist/schema/modules/role/classes/role.js +19 -0
- package/dist/schema/modules/role/core/index.d.ts +1 -0
- package/dist/schema/modules/role/core/index.js +1 -0
- package/dist/schema/modules/role/core/roles.d.ts +37 -0
- package/dist/schema/modules/role/core/roles.js +30 -0
- package/dist/schema/modules/role/index.d.ts +2 -0
- package/dist/schema/modules/role/index.js +2 -0
- package/dist/schema/modules/user/classes/index.d.ts +2 -0
- package/dist/schema/modules/user/classes/index.js +3 -0
- package/dist/schema/modules/user/classes/user-profile-link.d.ts +35 -0
- package/dist/schema/modules/user/classes/user-profile-link.js +22 -0
- package/dist/schema/modules/user/classes/user-profile.d.ts +41 -0
- package/dist/schema/modules/user/classes/user-profile.js +30 -0
- package/dist/schema/modules/user/classes/user.d.ts +133 -8
- package/dist/schema/modules/user/classes/user.js +46 -15
- package/dist/schema/modules/user/functions/create-user.js +21 -0
- package/dist/schema/modules/user/functions/deactivate-user.js +12 -0
- package/dist/schema/modules/user/functions/delete-user.js +12 -0
- package/dist/schema/modules/user/functions/deprovision-user.js +14 -0
- package/dist/schema/modules/user/functions/index.js +8 -1
- package/dist/schema/modules/user/functions/invite-user.js +23 -4
- package/dist/schema/modules/user/functions/provision-user.js +25 -0
- package/dist/schema/modules/user/functions/reactivate-user.js +12 -0
- package/dist/schema/modules/user/functions/update-profile.js +16 -0
- package/dist/schema/modules/user/functions/update-user.js +22 -0
- package/dist/schema/modules/user/index.d.ts +2 -1
- package/dist/schema/modules/user/index.js +2 -1
- package/dist/schema/modules/user/legacy/account-properties.js +24 -0
- package/dist/schema/modules/user/legacy/functions/index.js +2 -0
- package/dist/schema/modules/user/legacy/functions/migrate-accounts.js +23 -0
- package/dist/schema/modules/user/legacy/functions/record-profile.js +18 -0
- package/dist/schema/modules/user/legacy/index.js +5 -0
- package/dist/schema/modules/user/legacy/invite.js +15 -0
- package/dist/schema/modules/user/legacy/relaxations.js +37 -0
- package/dist/schema/modules/user/policies/describes-subject.d.ts +2 -0
- package/dist/schema/modules/user/policies/describes-subject.js +7 -0
- package/dist/schema/modules/user/policies/index.d.ts +2 -0
- package/dist/schema/modules/user/policies/index.js +2 -0
- package/dist/schema/modules/user/policies/is-profile-source.d.ts +2 -0
- package/dist/schema/modules/user/policies/is-profile-source.js +6 -0
- package/dist/schema/modules/user/types/account.d.ts +12 -0
- package/dist/schema/modules/user/types/account.js +12 -0
- package/dist/schema/modules/user/types/index.d.ts +1 -1
- package/dist/schema/modules/user/types/index.js +1 -1
- package/dist/schema/modules/view-access/classes/view-access.d.ts +7 -11
- package/dist/schema/modules/view-access/classes/view-access.js +17 -12
- package/dist/schema/modules/view-access/index.d.ts +1 -2
- package/dist/schema/modules/view-access/index.js +1 -2
- package/dist/schema/modules/view-access/legacy/functions/assign-views.js +22 -0
- package/dist/schema/modules/view-access/legacy/functions/index.js +1 -0
- package/dist/schema/modules/view-access/legacy/index.js +2 -0
- package/dist/schema/modules/view-access/legacy/view-assignment.js +24 -0
- package/dist/schema/modules/view-access/policies/holds-view-access.d.ts +2 -0
- package/dist/schema/modules/view-access/policies/holds-view-access.js +5 -0
- package/dist/schema/modules/view-access/policies/index.d.ts +1 -0
- package/dist/schema/modules/view-access/policies/index.js +1 -0
- package/dist/schema/policies/has-role.d.ts +6 -0
- package/dist/schema/policies/has-role.js +9 -0
- package/dist/schema/policies/index.d.ts +1 -0
- package/dist/schema/policies/index.js +1 -4
- package/dist/schema/policies/legacy/administers-shell-class.js +21 -0
- package/dist/schema/policies/legacy/index.js +4 -0
- package/dist/schema/policies/legacy/is-self.js +9 -0
- package/dist/schema/policies/legacy/owns-class.js +12 -0
- package/dist/schema/policies/legacy/uses-function.js +9 -0
- package/dist/schema/schema.d.ts +1849 -118
- package/dist/schema/schema.js +35 -15
- package/dist/schema/types/attributes.js +15 -0
- package/dist/schema/types/index.js +1 -0
- package/dist/utils/attributes/attributes.js +12 -0
- package/dist/utils/attributes/index.js +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/same-json/index.js +1 -0
- package/dist/utils/same-json/same-json.js +9 -0
- package/package.json +3 -3
- package/dist/functions/application/list-entrypoints.js +0 -6
- package/dist/functions/user/record-profile.js +0 -18
- package/dist/mutations/user/index.js +0 -1
- package/dist/queries/application/index.js +0 -1
- package/dist/queries/application/read-installed-entrypoints.js +0 -28
- package/dist/queries/user/index.js +0 -1
- package/dist/queries/user/read-user-profile.js +0 -9
- package/dist/schema/modules/application/functions/index.d.ts +0 -1
- package/dist/schema/modules/application/functions/index.js +0 -1
- package/dist/schema/modules/application/functions/list-entrypoints.d.ts +0 -15
- package/dist/schema/modules/application/functions/list-entrypoints.js +0 -16
- package/dist/schema/modules/application/index.d.ts +0 -2
- package/dist/schema/modules/application/index.js +0 -2
- package/dist/schema/modules/application/types/entrypoint-entry.d.ts +0 -8
- package/dist/schema/modules/application/types/entrypoint-entry.js +0 -7
- package/dist/schema/modules/application/types/index.d.ts +0 -1
- package/dist/schema/modules/application/types/index.js +0 -1
- package/dist/schema/modules/group/classes/member-of-group.js +0 -12
- package/dist/schema/modules/group/core/administrators-group.d.ts +0 -1
- package/dist/schema/modules/group/core/administrators-group.js +0 -6
- package/dist/schema/modules/group/core/applications-group.d.ts +0 -1
- package/dist/schema/modules/group/core/applications-group.js +0 -6
- package/dist/schema/modules/group/core/index.d.ts +0 -3
- package/dist/schema/modules/group/core/index.js +0 -3
- package/dist/schema/modules/group/core/members-group.d.ts +0 -1
- package/dist/schema/modules/group/core/members-group.js +0 -6
- package/dist/schema/modules/group/functions/assign-member-to-group.js +0 -11
- package/dist/schema/modules/group/functions/unassign-member-from-group.js +0 -11
- package/dist/schema/modules/group/policies/belongs-to-group.d.ts +0 -1
- package/dist/schema/modules/group/policies/belongs-to-group.js +0 -5
- package/dist/schema/modules/user/functions/record-profile.js +0 -14
- package/dist/schema/modules/user/types/user-profile.d.ts +0 -7
- package/dist/schema/modules/user/types/user-profile.js +0 -7
- package/dist/schema/modules/view-access/core/index.d.ts +0 -1
- package/dist/schema/modules/view-access/core/index.js +0 -1
- package/dist/schema/modules/view-access/core/view-only-group.d.ts +0 -5
- package/dist/schema/modules/view-access/core/view-only-group.js +0 -10
- package/dist/schema/modules/view-access/functions/assign-views.d.ts +0 -16
- package/dist/schema/modules/view-access/functions/assign-views.js +0 -17
- package/dist/schema/modules/view-access/functions/index.d.ts +0 -1
- package/dist/schema/modules/view-access/functions/index.js +0 -1
- package/dist/schema/modules/view-access/types/index.js +0 -1
- package/dist/schema/modules/view-access/types/view-assignment.js +0 -16
- package/dist/schema/policies/administers-shell-class.js +0 -11
- package/dist/schema/policies/is-self.js +0 -5
- package/dist/schema/policies/owns-class.js +0 -7
- package/dist/schema/policies/uses-function.js +0 -5
- /package/dist/functions/group/{assign-member-to-group.js → assign-member.js} +0 -0
- /package/dist/functions/group/{unassign-member-from-group.js → unassign-member.js} +0 -0
package/dist/schema/schema.js
CHANGED
|
@@ -1,25 +1,45 @@
|
|
|
1
1
|
import { defineSchema, KernelSchema, schema } from '@astrale-os/sdk/schema';
|
|
2
|
-
|
|
3
|
-
import {
|
|
2
|
+
// Seam L-SHELL-7…14: the legacy declarations, under their stored names.
|
|
3
|
+
import { legacyShellSchema } from './legacy/index.js';
|
|
4
|
+
import { disconnectDirectory } from './modules/directory/index.js';
|
|
5
|
+
import { Group, GroupProfile, describesGroupOfSubject, group_profile, isGroupProfileSource, } from './modules/group/index.js';
|
|
6
|
+
import { Invitation, invitation_user } from './modules/invitation/index.js';
|
|
4
7
|
import { Namespace, alias, viewsNamespace } from './modules/namespace/index.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
+
import { Role, shellRoles } from './modules/role/index.js';
|
|
9
|
+
import { User, UserProfile, describesSubject, isProfileSource, user_profile, } from './modules/user/index.js';
|
|
10
|
+
import { holdsViewAccess, view_access } from './modules/view-access/index.js';
|
|
11
|
+
import { hasRole } from './policies/index.js';
|
|
8
12
|
import { applicationView } from './views/index.js';
|
|
9
13
|
export const ORIGIN = 'shell.astrale.ai';
|
|
10
14
|
const dependencies = { kernel: KernelSchema };
|
|
11
|
-
const classes = {
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
const classes = {
|
|
16
|
+
User,
|
|
17
|
+
UserProfile,
|
|
18
|
+
user_profile,
|
|
19
|
+
Group,
|
|
20
|
+
GroupProfile,
|
|
21
|
+
group_profile,
|
|
22
|
+
Invitation,
|
|
23
|
+
invitation_user,
|
|
24
|
+
Role,
|
|
25
|
+
Namespace,
|
|
26
|
+
alias,
|
|
27
|
+
view_access,
|
|
28
|
+
...legacyShellSchema.classes,
|
|
29
|
+
};
|
|
30
|
+
const functions = { disconnectDirectory, ...legacyShellSchema.functions };
|
|
31
|
+
const policies = {
|
|
32
|
+
hasRole,
|
|
33
|
+
holdsViewAccess,
|
|
34
|
+
describesSubject,
|
|
35
|
+
isProfileSource,
|
|
36
|
+
describesGroupOfSubject,
|
|
37
|
+
isGroupProfileSource,
|
|
38
|
+
...legacyShellSchema.policies,
|
|
39
|
+
};
|
|
14
40
|
const views = { application: applicationView };
|
|
15
41
|
const core = {
|
|
16
|
-
nodes: {
|
|
17
|
-
admin: adminGroup,
|
|
18
|
-
applications: applicationsGroup,
|
|
19
|
-
member: memberGroup,
|
|
20
|
-
views: viewsNamespace,
|
|
21
|
-
'view-only': viewOnlyGroup,
|
|
22
|
-
},
|
|
42
|
+
nodes: { ...shellRoles, views: viewsNamespace, ...legacyShellSchema.core },
|
|
23
43
|
};
|
|
24
44
|
const input = {
|
|
25
45
|
name: 'Shell',
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { property } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* The stored `attributes` Property of an account or a group (AM11): whoever reads the Node reads
|
|
5
|
+
* them; Shell writes them only through `create` and `update`, whole, so a write replaces them all.
|
|
6
|
+
* The Kernel holds the bound, the same as `MAX_ATTRIBUTES` in `#utils`: Schema imports no Utils, so a
|
|
7
|
+
* test keeps the two equal.
|
|
8
|
+
*/
|
|
9
|
+
export const STORED_ATTRIBUTES_BOUND = 64;
|
|
10
|
+
export const attributesProperty = () => property({ type: 'object', additionalProperties: true, maxProperties: STORED_ATTRIBUTES_BOUND }, { required: false });
|
|
11
|
+
/**
|
|
12
|
+
* The attributes a method takes, each a JSON value by a non-empty name. The handler checks the
|
|
13
|
+
* count (`*_ATTRIBUTES_TOO_MANY`): a Zod check has no JSON Schema form.
|
|
14
|
+
*/
|
|
15
|
+
export const attributesInput = z.record(z.string().min(1).max(100), z.unknown());
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { STORED_ATTRIBUTES_BOUND, attributesInput, attributesProperty } from './attributes.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** How many attributes one account or group carries at most (AM11). */
|
|
2
|
+
export const MAX_ATTRIBUTES = 64;
|
|
3
|
+
/** The attributes a stored value holds: an object, never an array or null. */
|
|
4
|
+
export function toAttributes(value) {
|
|
5
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
6
|
+
? value
|
|
7
|
+
: undefined;
|
|
8
|
+
}
|
|
9
|
+
/** The attributes a method was given, once their count is checked; undefined past the bound. */
|
|
10
|
+
export function boundedAttributes(input) {
|
|
11
|
+
return Object.keys(input).length <= MAX_ATTRIBUTES ? input : undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MAX_ATTRIBUTES, boundedAttributes, toAttributes, } from './attributes.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { sameJson } from './same-json.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Two JSON values are equal whatever the order of their object keys. */
|
|
2
|
+
export function sameJson(a, b) {
|
|
3
|
+
return canonical(a) === canonical(b);
|
|
4
|
+
}
|
|
5
|
+
function canonical(value) {
|
|
6
|
+
return JSON.stringify(value, (_, item) => item !== null && typeof item === 'object' && !Array.isArray(item)
|
|
7
|
+
? Object.fromEntries(Object.entries(item).sort(([a], [b]) => (a < b ? -1 : 1)))
|
|
8
|
+
: item);
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-domains/shell",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Astrale Shell Domain schema and remote product implementation",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@astrale-os/ox": "0.1.4",
|
|
61
|
-
"@astrale-os/sdk": "0.6.0-beta.
|
|
61
|
+
"@astrale-os/sdk": "0.6.0-beta.60",
|
|
62
62
|
"@astrale-os/shell-react": "0.6.0-beta.11",
|
|
63
63
|
"@astrale-os/ui": "1.0.0-beta.37",
|
|
64
64
|
"@astrale/typescript-config": "npm:@jsr/astrale__typescript-config@~2.0.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"vitest": "5.0.5"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@astrale-os/sdk": ">=0.6.0-beta.
|
|
79
|
+
"@astrale-os/sdk": ">=0.6.0-beta.60 <1.0.0"
|
|
80
80
|
},
|
|
81
81
|
"devEngines": {
|
|
82
82
|
"runtime": {
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { defineAction } from '@astrale-os/sdk/action';
|
|
2
|
-
import { readInstalledEntrypoints } from '../../queries/application/index.js';
|
|
3
|
-
/** One graph read: every Domain with an `entrypoint` Edge, its name and its entrypoint View. */
|
|
4
|
-
export const listEntrypoints = defineAction()('listEntrypoints', async ({ query }) => ({
|
|
5
|
-
entrypoints: [...(await query(readInstalledEntrypoints, undefined, { as: 'executor' }))],
|
|
6
|
-
}));
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineAction } from '@astrale-os/sdk/action';
|
|
2
|
-
import { recordUserProfile } from '../../mutations/user/index.js';
|
|
3
|
-
import { readUserProfile } from '../../queries/user/index.js';
|
|
4
|
-
/**
|
|
5
|
-
* One read and, only when something changed, one write, with Shell's own authority: the policy
|
|
6
|
-
* admits the account itself alone. An email is kept in lower case.
|
|
7
|
-
*/
|
|
8
|
-
export const recordProfile = defineAction()('User.recordProfile', async ({ input, self, query, mutate }) => {
|
|
9
|
-
const asked = {
|
|
10
|
-
...(input.email === undefined ? {} : { email: input.email.trim().toLowerCase() }),
|
|
11
|
-
...(input.displayName === undefined ? {} : { displayName: input.displayName }),
|
|
12
|
-
};
|
|
13
|
-
const current = await query(readUserProfile, { user: self }, { as: 'executor' });
|
|
14
|
-
const set = Object.fromEntries(Object.entries(asked).filter(([key, value]) => current[key] !== value));
|
|
15
|
-
if (Object.keys(set).length > 0)
|
|
16
|
-
await mutate(recordUserProfile, { user: self, set });
|
|
17
|
-
return {};
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { recordUserProfile } from './record-user-profile.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { readInstalledEntrypoints } from './read-installed-entrypoints.js';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { defineQuery } from '@astrale-os/sdk/query';
|
|
2
|
-
const VIEW_MEMBER = /^view\.([A-Za-z][A-Za-z0-9_]*)$/u;
|
|
3
|
-
/**
|
|
4
|
-
* Every installed Domain entrypoint this authority can read, in origin order: each View with an
|
|
5
|
-
* outgoing `entrypoint` Edge, through its `of_domain` locator, which names the View
|
|
6
|
-
* (`view.<name>`) and reaches its Domain, with the origin and the display name.
|
|
7
|
-
*/
|
|
8
|
-
export const readInstalledEntrypoints = defineQuery()('shell.application.entrypoints', {
|
|
9
|
-
build: (_, { kernel: { View, entrypoint, of_domain } }) => View.where((view) => [
|
|
10
|
-
view.via(entrypoint, { direction: 'outgoing' }).exists(),
|
|
11
|
-
view.via(of_domain, { direction: 'outgoing' }).exists(),
|
|
12
|
-
])
|
|
13
|
-
.with((view) => ({
|
|
14
|
-
locator: view.via(of_domain, { direction: 'outgoing' }).withEdge().get(),
|
|
15
|
-
}))
|
|
16
|
-
// Shell may only traverse Views: their own values would come back withheld.
|
|
17
|
-
.ref()
|
|
18
|
-
.all({ max: 10_000 }),
|
|
19
|
-
output: (rows) => rows
|
|
20
|
-
.map(({ locator }) => {
|
|
21
|
-
const member = VIEW_MEMBER.exec(locator.$edge.member);
|
|
22
|
-
if (member === null)
|
|
23
|
-
throw new TypeError('Installed entrypoint locator names no View.');
|
|
24
|
-
const { origin, name } = locator;
|
|
25
|
-
return { origin, name, view: `${origin}:view.${member[1]}` };
|
|
26
|
-
})
|
|
27
|
-
.sort((left, right) => left.origin.localeCompare(right.origin)),
|
|
28
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { readUserProfile } from './read-user-profile.js';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineQuery } from '@astrale-os/sdk/query';
|
|
2
|
-
/** The email and display name one account recorded; nothing for an account it cannot read. */
|
|
3
|
-
export const readUserProfile = defineQuery()('shell.user.profile', {
|
|
4
|
-
build: ({ user }, { User }) => User.where((account) => account.id.eq(user)).first(),
|
|
5
|
-
output: (account) => ({
|
|
6
|
-
...(account?.claimedEmail === undefined ? {} : { email: account.claimedEmail }),
|
|
7
|
-
...(account?.claimedName === undefined ? {} : { displayName: account.claimedName }),
|
|
8
|
-
}),
|
|
9
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { listEntrypoints } from './list-entrypoints.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { listEntrypoints } from './list-entrypoints.js';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type Function as SchemaFunction } from '@astrale-os/sdk/schema';
|
|
2
|
-
/**
|
|
3
|
-
* The entrypoint View of every installed Domain that declares one, with its Domain name. Shell
|
|
4
|
-
* reads the Kernel `entrypoint` Edges with its own authority; a Domain without one is not listed.
|
|
5
|
-
*/
|
|
6
|
-
export declare const listEntrypoints: SchemaFunction<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
7
|
-
readonly mode: 'value';
|
|
8
|
-
readonly value: {
|
|
9
|
-
entrypoints: {
|
|
10
|
-
origin: string;
|
|
11
|
-
name: string;
|
|
12
|
-
view: string;
|
|
13
|
-
}[];
|
|
14
|
-
};
|
|
15
|
-
}, "authorized", false, false, undefined, undefined>>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { func } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { usesFunction } from '../../../policies/index.js';
|
|
4
|
-
import { entrypointEntry } from '../types/index.js';
|
|
5
|
-
/**
|
|
6
|
-
* The entrypoint View of every installed Domain that declares one, with its Domain name. Shell
|
|
7
|
-
* reads the Kernel `entrypoint` Edges with its own authority; a Domain without one is not listed.
|
|
8
|
-
*/
|
|
9
|
-
export const listEntrypoints = func({
|
|
10
|
-
description: 'List the entrypoint View and name of every installed Domain that declares one.',
|
|
11
|
-
auth: 'authorized',
|
|
12
|
-
input: z.strictObject({}),
|
|
13
|
-
output: z.object({ entrypoints: z.array(entrypointEntry) }),
|
|
14
|
-
// Holding can_use is enough: Core admin and member hold it; the Applications Group shares it.
|
|
15
|
-
policy: ({ check, ref }) => check(usesFunction, ref(() => listEntrypoints)),
|
|
16
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/** One installed Domain entrypoint: the Domain origin, its display name, and its View key. */
|
|
3
|
-
export declare const entrypointEntry: z.ZodObject<{
|
|
4
|
-
origin: z.ZodString;
|
|
5
|
-
name: z.ZodString;
|
|
6
|
-
view: z.ZodString;
|
|
7
|
-
}, z.core.$strip>;
|
|
8
|
-
export type EntrypointEntry = z.infer<typeof entrypointEntry>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { entrypointEntry, type EntrypointEntry } from './entrypoint-entry.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { entrypointEntry } from './entrypoint-entry.js';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { User } from '../../user/index.js';
|
|
3
|
-
import { Group } from './group.js';
|
|
4
|
-
export const member_of_group = edgeClass.directed({
|
|
5
|
-
policies: { read: true },
|
|
6
|
-
source: {
|
|
7
|
-
as: 'member',
|
|
8
|
-
accepts: [() => User, () => Group],
|
|
9
|
-
outgoing: '0..*',
|
|
10
|
-
},
|
|
11
|
-
target: { as: 'group', accepts: [() => Group], incoming: '0..*' },
|
|
12
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const adminGroup: import("@astrale-os/sdk/schema").CoreNode;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { K, core } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { Group } from '../classes/group.js';
|
|
3
|
-
export const adminGroup = core.node(() => Group, {
|
|
4
|
-
[K.classes.Named.properties.name.key]: 'Administrators',
|
|
5
|
-
[K.classes.Descriptable.properties.description.key]: 'Instance administrators.',
|
|
6
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const applicationsGroup: import("@astrale-os/sdk/schema").CoreNode;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { K, core } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { Group } from '../classes/group.js';
|
|
3
|
-
export const applicationsGroup = core.node(() => Group, {
|
|
4
|
-
[K.classes.Named.properties.name.key]: 'Applications',
|
|
5
|
-
[K.classes.Descriptable.properties.description.key]: 'May list the installed applications they can open.',
|
|
6
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const memberGroup: import("@astrale-os/sdk/schema").CoreNode;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { K, core } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { Group } from '../classes/group.js';
|
|
3
|
-
export const memberGroup = core.node(() => Group, {
|
|
4
|
-
[K.classes.Named.properties.name.key]: 'Members',
|
|
5
|
-
[K.classes.Descriptable.properties.description.key]: 'Instance members.',
|
|
6
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { ownsClass, administersShellClass } from '../../../policies/index.js';
|
|
4
|
-
import { groupMembershipInput } from '../types/index.js';
|
|
5
|
-
export const assignMember = method({
|
|
6
|
-
static: true,
|
|
7
|
-
auth: 'authorized',
|
|
8
|
-
input: groupMembershipInput,
|
|
9
|
-
output: z.object({}),
|
|
10
|
-
policy: ({ anyOf, check, input }) => anyOf(check(administersShellClass, input.group), check(ownsClass, input.group)),
|
|
11
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { ownsClass, administersShellClass } from '../../../policies/index.js';
|
|
4
|
-
import { groupMembershipInput } from '../types/index.js';
|
|
5
|
-
export const unassignMember = method({
|
|
6
|
-
static: true,
|
|
7
|
-
auth: 'authorized',
|
|
8
|
-
input: groupMembershipInput,
|
|
9
|
-
output: z.object({}),
|
|
10
|
-
policy: ({ anyOf, check, input }) => anyOf(check(administersShellClass, input.group), check(ownsClass, input.group)),
|
|
11
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const belongsToGroup: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { member_of_group } from '../classes/member-of-group.js';
|
|
3
|
-
export const belongsToGroup = policy({
|
|
4
|
-
match: ({ edge, subject, object }) => edge({ source: subject, class: () => member_of_group, target: object }),
|
|
5
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { isSelf } from '../../../policies/index.js';
|
|
4
|
-
import { userDisplayName, userEmail } from '../types/index.js';
|
|
5
|
-
export const recordProfile = method({
|
|
6
|
-
description: 'Record the email and display name this account signs in with; only the account itself may.',
|
|
7
|
-
auth: 'authorized',
|
|
8
|
-
input: z.strictObject({
|
|
9
|
-
email: userEmail.optional(),
|
|
10
|
-
displayName: userDisplayName.optional(),
|
|
11
|
-
}),
|
|
12
|
-
output: z.object({}),
|
|
13
|
-
policy: ({ check, self }) => check(isSelf, self),
|
|
14
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* What an account says about itself, to be recognised in the directory: its sign-in email and its
|
|
4
|
-
* name. The account writes them, so they name it for display and decide nothing.
|
|
5
|
-
*/
|
|
6
|
-
export declare const userEmail: z.ZodString;
|
|
7
|
-
export declare const userDisplayName: z.ZodString;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* What an account says about itself, to be recognised in the directory: its sign-in email and its
|
|
4
|
-
* name. The account writes them, so they name it for display and decide nothing.
|
|
5
|
-
*/
|
|
6
|
-
export const userEmail = z.string().min(3).max(320);
|
|
7
|
-
export const userDisplayName = z.string().min(1).max(200);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { viewOnlyGroup } from './view-only-group.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { viewOnlyGroup } from './view-only-group.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { K, core } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { Group } from '../../group/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Its members open only the Views given to them, never the workspace. Administrators keep the
|
|
5
|
-
* workspace even when they are members.
|
|
6
|
-
*/
|
|
7
|
-
export const viewOnlyGroup = core.node(() => Group, {
|
|
8
|
-
[K.classes.Named.properties.name.key]: 'View only',
|
|
9
|
-
[K.classes.Descriptable.properties.description.key]: 'Open only the Views given to them, never the workspace.',
|
|
10
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type Function as SchemaFunction } from '@astrale-os/sdk/schema';
|
|
2
|
-
/**
|
|
3
|
-
* Give Views to identities and withdraw others, in one write. Each identity is a User or a Group;
|
|
4
|
-
* a View already given, or already withdrawn, stays as it is. Whether an identity opens the
|
|
5
|
-
* workspace is its `view-only` membership, which `Group.assignMember` changes.
|
|
6
|
-
*/
|
|
7
|
-
export declare const assignViews: SchemaFunction<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
8
|
-
assignments: {
|
|
9
|
-
identity: string;
|
|
10
|
-
set?: string[] | undefined;
|
|
11
|
-
unset?: string[] | undefined;
|
|
12
|
-
}[];
|
|
13
|
-
}, {
|
|
14
|
-
readonly mode: 'value';
|
|
15
|
-
readonly value: Record<string, never>;
|
|
16
|
-
}, "authorized", false, false, undefined, undefined>>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { func } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { usesFunction } from '../../../policies/index.js';
|
|
4
|
-
import { MAX_ASSIGNMENTS, viewAssignment } from '../types/index.js';
|
|
5
|
-
/**
|
|
6
|
-
* Give Views to identities and withdraw others, in one write. Each identity is a User or a Group;
|
|
7
|
-
* a View already given, or already withdrawn, stays as it is. Whether an identity opens the
|
|
8
|
-
* workspace is its `view-only` membership, which `Group.assignMember` changes.
|
|
9
|
-
*/
|
|
10
|
-
export const assignViews = func({
|
|
11
|
-
description: 'Give and withdraw Views for each identity, in one write.',
|
|
12
|
-
auth: 'authorized',
|
|
13
|
-
input: z.strictObject({ assignments: z.array(viewAssignment).min(1).max(MAX_ASSIGNMENTS) }),
|
|
14
|
-
output: z.object({}),
|
|
15
|
-
// Holding can_use is enough: Core admin holds it, and may share it.
|
|
16
|
-
policy: ({ check, ref }) => check(usesFunction, ref(() => assignViews)),
|
|
17
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { assignViews } from './assign-views.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { assignViews } from './assign-views.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { viewAssignment, MAX_ASSIGNED_VIEWS, MAX_ASSIGNMENTS } from './view-assignment.js';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Bounds that keep one call within the Kernel's Mutation limits: at most 1,600 Edge operations
|
|
4
|
-
* and 1,640 locators, under 2,048 each.
|
|
5
|
-
*/
|
|
6
|
-
export const MAX_ASSIGNED_VIEWS = 20;
|
|
7
|
-
export const MAX_ASSIGNMENTS = 40;
|
|
8
|
-
// A Path inside a list is not a callable Path input: each is an exact @NodeId the Action checks.
|
|
9
|
-
const nodeId = z.string().min(2).max(512);
|
|
10
|
-
const views = z.array(nodeId).max(MAX_ASSIGNED_VIEWS);
|
|
11
|
-
/** The Views given to one User or Group (`set`) and withdrawn from it (`unset`), by @NodeId. */
|
|
12
|
-
export const viewAssignment = z.strictObject({
|
|
13
|
-
identity: nodeId,
|
|
14
|
-
set: views.optional(),
|
|
15
|
-
unset: views.optional(),
|
|
16
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { K, policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { Group, member_of_group, adminGroup } from '../modules/group/index.js';
|
|
3
|
-
/** Instance administration applies to Shell's concrete classes, not foreign descendants. */
|
|
4
|
-
export const administersShellClass = policy({
|
|
5
|
-
match: ({ exists, subject, object, ref, edge, allOf }) => exists(({ node }) => {
|
|
6
|
-
const concrete = node();
|
|
7
|
-
const owner = node(); // of_domain restricts this witness to a protected Domain endpoint.
|
|
8
|
-
const group = ref(() => Group);
|
|
9
|
-
return allOf(edge({ source: subject, class: () => member_of_group, target: ref(adminGroup) }), { source: ref(adminGroup), class: K.classes.instance_of.ref, target: group }, { source: group, class: K.classes.of_domain.ref, target: owner }, { source: concrete, class: K.classes.of_domain.ref, target: owner }, { source: object, class: K.classes.instance_of.ref, target: concrete });
|
|
10
|
-
}),
|
|
11
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { K, policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
export const ownsClass = policy({
|
|
3
|
-
match: ({ exists, subject, object, allOf }) => exists(({ node }) => {
|
|
4
|
-
const concrete = node(); // Périmètre défini par les deux edges kernel protégés.
|
|
5
|
-
return allOf({ source: object, class: K.classes.instance_of.ref, target: concrete }, { source: concrete, class: K.classes.of_domain.ref, target: subject });
|
|
6
|
-
}),
|
|
7
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { K, policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
/** The subject may use the object Function: its own or a composed Identity holds can_use on it. */
|
|
3
|
-
export const usesFunction = policy({
|
|
4
|
-
match: ({ edge, subject, object }) => edge({ source: subject, class: () => K.classes.can_use, target: object }),
|
|
5
|
-
});
|
|
File without changes
|
|
File without changes
|