@astrale-domains/shell 0.1.8 → 0.1.9
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/domain.d.ts +30 -23
- package/dist/domain.js +8 -0
- package/dist/functions/authority/roles.js +14 -6
- package/dist/functions/group/change-group-membership.js +7 -1
- package/dist/functions/group/membership-laws.js +20 -22
- package/dist/functions/view-access/index.js +2 -2
- package/dist/functions/view-access/legacy/index.js +1 -0
- package/dist/functions/view-access/legacy/migrate-view-access.js +29 -0
- package/dist/mutations/view-access/legacy/index.js +1 -0
- package/dist/mutations/view-access/legacy/move-view-access.js +26 -0
- package/dist/mutations/view-access/set-view-access.js +1 -1
- package/dist/queries/view-access/legacy/index.js +1 -0
- package/dist/queries/view-access/legacy/read-view-access-to-move.js +40 -0
- package/dist/queries/view-access/read-view-access.js +1 -1
- package/dist/runtime.d.ts +1605 -707
- package/dist/runtime.js +3 -2
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +2 -1
- package/dist/schema/legacy/schema.js +5 -3
- package/dist/schema/modules/view-access/index.d.ts +1 -2
- package/dist/schema/modules/view-access/index.js +2 -2
- package/dist/schema/modules/view-access/legacy/classes/index.d.ts +1 -0
- package/dist/schema/modules/view-access/legacy/classes/index.js +1 -0
- package/dist/schema/modules/view-access/{classes → legacy/classes}/view-access.d.ts +7 -5
- package/dist/schema/modules/view-access/legacy/classes/view-access.js +25 -0
- package/dist/schema/modules/view-access/legacy/functions/assign-views.d.ts +18 -0
- package/dist/schema/modules/view-access/legacy/functions/index.d.ts +2 -0
- package/dist/schema/modules/view-access/legacy/functions/index.js +1 -0
- package/dist/schema/modules/view-access/legacy/functions/migrate-view-access.d.ts +13 -0
- package/dist/schema/modules/view-access/legacy/functions/migrate-view-access.js +22 -0
- package/dist/schema/modules/view-access/legacy/index.d.ts +4 -0
- package/dist/schema/modules/view-access/legacy/index.js +3 -1
- package/dist/schema/modules/view-access/legacy/policies/holds-view-access.d.ts +5 -0
- package/dist/schema/modules/view-access/legacy/policies/holds-view-access.js +8 -0
- package/dist/schema/modules/view-access/legacy/policies/index.d.ts +1 -0
- package/dist/schema/modules/view-access/legacy/policies/index.js +1 -0
- package/dist/schema/modules/view-access/legacy/view-assignment.d.ts +21 -0
- package/dist/schema/schema.d.ts +112 -91
- package/dist/schema/schema.js +1 -4
- package/package.json +1 -1
- package/dist/schema/modules/view-access/classes/index.d.ts +0 -1
- package/dist/schema/modules/view-access/classes/index.js +0 -1
- package/dist/schema/modules/view-access/classes/view-access.js +0 -23
- package/dist/schema/modules/view-access/policies/holds-view-access.d.ts +0 -2
- package/dist/schema/modules/view-access/policies/holds-view-access.js +0 -5
- package/dist/schema/modules/view-access/policies/index.d.ts +0 -1
- package/dist/schema/modules/view-access/policies/index.js +0 -1
package/dist/runtime.js
CHANGED
|
@@ -8,8 +8,8 @@ import { link, rename, unlink } from './functions/namespace/index.js';
|
|
|
8
8
|
import { create as createUser, deactivate, deprovision as deprovisionUser, invite,
|
|
9
9
|
// L-SHELL-5, L-SHELL-14: legacy handlers, through their owner's facade.
|
|
10
10
|
legacyMigrateAccounts, legacyRecordProfile, provision as provisionUser, reactivate, remove as deleteUser, update as updateUser, updateProfile, } from './functions/user/index.js';
|
|
11
|
-
// L-SHELL-12: the legacy
|
|
12
|
-
import { legacyAssignViews } from './functions/view-access/index.js';
|
|
11
|
+
// L-SHELL-12, L-SHELL-20: the legacy handlers of assignViews and the view_access migration.
|
|
12
|
+
import { legacyAssignViews, legacyMigrateViewAccess } from './functions/view-access/index.js';
|
|
13
13
|
import { integrations } from './integrations/index.js';
|
|
14
14
|
import { enrollmentProvider } from './providers/admin-enrollment/index.js';
|
|
15
15
|
const initialize = (environment) => ({
|
|
@@ -46,6 +46,7 @@ const functions = [
|
|
|
46
46
|
legacyListEntrypoints,
|
|
47
47
|
legacyAssignViews,
|
|
48
48
|
legacyMigrateAccounts,
|
|
49
|
+
legacyMigrateViewAccess,
|
|
49
50
|
];
|
|
50
51
|
const runtime = defineRuntime()({
|
|
51
52
|
integrations,
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export { Role, atomicRoles, profileRoles, shellRoles, PROFILE_NAMES, type Profil
|
|
|
6
6
|
export { hasRole } from './policies/index.js';
|
|
7
7
|
export { disconnectDirectory } from './modules/directory/index.js';
|
|
8
8
|
export { Namespace, alias, viewsNamespace } from './modules/namespace/index.js';
|
|
9
|
-
export { view_access, holdsViewAccess } from './modules/view-access/index.js';
|
|
9
|
+
export { legacyViewAccess as view_access, legacyHoldsViewAccess as holdsViewAccess, } from './modules/view-access/index.js';
|
|
10
10
|
export { legacyMemberOfGroup as member_of_group, legacyAdministratorsGroup as adminGroup, legacyMembersGroup as memberGroup, } from './modules/group/index.js';
|
package/dist/schema/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { Role, atomicRoles, profileRoles, shellRoles, PROFILE_NAMES, } from './m
|
|
|
5
5
|
export { hasRole } from './policies/index.js';
|
|
6
6
|
export { disconnectDirectory } from './modules/directory/index.js';
|
|
7
7
|
export { Namespace, alias, viewsNamespace } from './modules/namespace/index.js';
|
|
8
|
-
|
|
8
|
+
// Seam L-SHELL-20: the package root's former names of the Shell's own view_access.
|
|
9
|
+
export { legacyViewAccess as view_access, legacyHoldsViewAccess as holdsViewAccess, } from './modules/view-access/index.js';
|
|
9
10
|
// Seam L-SHELL-16: the package root's former names of the legacy Edge Class and Core groups.
|
|
10
11
|
export { legacyMemberOfGroup as member_of_group, legacyAdministratorsGroup as adminGroup, legacyMembersGroup as memberGroup, } from './modules/group/index.js';
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { legacyListEntrypoints } from '../modules/application/legacy/index.js';
|
|
2
2
|
import { legacyAdministratorsGroup, legacyApplicationsGroup, legacyBelongsToGroup, legacyMemberOfGroup, legacyMembersGroup, legacyOwnsMembershipGroup, legacyViewOnlyGroup, } from '../modules/group/legacy/index.js';
|
|
3
3
|
import { legacyMigrateAccounts } from '../modules/user/legacy/index.js';
|
|
4
|
-
import { legacyAssignViews } from '../modules/view-access/legacy/index.js';
|
|
4
|
+
import { legacyAssignViews, legacyHoldsViewAccess, legacyMigrateViewAccess, legacyViewAccess, } from '../modules/view-access/legacy/index.js';
|
|
5
5
|
import { legacyAdministersShellClass, legacyIsSelf, legacyOwnsClass, legacyUsesFunction, } from '../policies/legacy/index.js';
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated The declarations the Shell keeps for legacy readers and callers, under their stored
|
|
8
8
|
* names so their keys stay (L-SHELL-7). Each item has its own row: L-SHELL-8, L-SHELL-10,
|
|
9
|
-
* L-SHELL-11, L-SHELL-12, L-SHELL-14. Replaced by the target Schema alone. Removal: Shell major (delivery step 5) after 1Pact step 4.
|
|
9
|
+
* L-SHELL-11, L-SHELL-12, L-SHELL-14, L-SHELL-20. Replaced by the target Schema alone. Removal: Shell major (delivery step 5) after 1Pact step 4.
|
|
10
10
|
*/
|
|
11
11
|
export const legacyShellSchema = {
|
|
12
|
-
classes: { member_of_group: legacyMemberOfGroup },
|
|
12
|
+
classes: { member_of_group: legacyMemberOfGroup, view_access: legacyViewAccess },
|
|
13
13
|
functions: {
|
|
14
14
|
listEntrypoints: legacyListEntrypoints,
|
|
15
15
|
assignViews: legacyAssignViews,
|
|
16
16
|
legacyMigrateAccounts,
|
|
17
|
+
legacyMigrateViewAccess,
|
|
17
18
|
},
|
|
18
19
|
policies: {
|
|
19
20
|
belongsToGroup: legacyBelongsToGroup,
|
|
@@ -22,6 +23,7 @@ export const legacyShellSchema = {
|
|
|
22
23
|
usesFunction: legacyUsesFunction,
|
|
23
24
|
isSelf: legacyIsSelf,
|
|
24
25
|
legacyOwnsMembershipGroup,
|
|
26
|
+
holdsViewAccess: legacyHoldsViewAccess,
|
|
25
27
|
},
|
|
26
28
|
core: {
|
|
27
29
|
admin: legacyAdministratorsGroup,
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { holdsViewAccess } from './policies/index.js';
|
|
1
|
+
export { legacyHoldsViewAccess, legacyViewAccess } from './legacy/index.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
// Seam L-SHELL-20: the package root's former names, reached through this module's facade.
|
|
2
|
+
export { legacyHoldsViewAccess, legacyViewAccess } from './legacy/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { legacyViewAccess } from './view-access.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { legacyViewAccess } from './view-access.js';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* @deprecated The Shell's own `view_access` (L-SHELL-20): a View an Identity landed on without
|
|
3
|
+
* `member`. The Kernel enforces only its own `view_access` (kernel-host 1.0.0-beta.45), so nothing
|
|
4
|
+
* writes this one any more; it stays declared so stored Edges remain valid until
|
|
5
|
+
* `legacyMigrateViewAccess` copies them to the Kernel's and deletes them. Replaced by Kernel
|
|
6
|
+
* `view_access`, which `view.manager` writes. Removal: Shell major (delivery step 5), once the
|
|
7
|
+
* migration ran on every instance.
|
|
6
8
|
*/
|
|
7
|
-
export declare const
|
|
9
|
+
export declare const legacyViewAccess: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
8
10
|
readonly depth: 0;
|
|
9
11
|
readonly abstract: false;
|
|
10
12
|
readonly extends: readonly [];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { K, edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { profileRoles } from '../../../role/index.js';
|
|
3
|
+
import { hasRole } from '../../../../policies/index.js';
|
|
4
|
+
import { legacyHoldsViewAccess } from '../policies/holds-view-access.js';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated The Shell's own `view_access` (L-SHELL-20): a View an Identity landed on without
|
|
7
|
+
* `member`. The Kernel enforces only its own `view_access` (kernel-host 1.0.0-beta.45), so nothing
|
|
8
|
+
* writes this one any more; it stays declared so stored Edges remain valid until
|
|
9
|
+
* `legacyMigrateViewAccess` copies them to the Kernel's and deletes them. Replaced by Kernel
|
|
10
|
+
* `view_access`, which `view.manager` writes. Removal: Shell major (delivery step 5), once the
|
|
11
|
+
* migration ran on every instance.
|
|
12
|
+
*/
|
|
13
|
+
export const legacyViewAccess = edgeClass.directed({
|
|
14
|
+
inheritance: 'final',
|
|
15
|
+
abstract: false,
|
|
16
|
+
description: 'A View this Identity lands on without member.',
|
|
17
|
+
source: { as: 'audience', accepts: [K.classes.Identity], outgoing: '0..*', onDelete: 'detach' },
|
|
18
|
+
target: { as: 'view', accepts: [K.classes.View], incoming: '0..*', onDelete: 'detach' },
|
|
19
|
+
policies: {
|
|
20
|
+
read: ({ anyOf, check, ref, self }) => anyOf(check(hasRole, ref(profileRoles['workspace.admin'])), check(legacyHoldsViewAccess, self)),
|
|
21
|
+
traverse: true,
|
|
22
|
+
create: false,
|
|
23
|
+
delete: ({ check, ref }) => check(hasRole, ref(profileRoles['workspace.admin'])),
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Give and withdraw Views for each identity, in one write (L-SHELL-12). Replaced by a
|
|
3
|
+
* Mutation on `view_access`, which only `workspace.admin` holders may write. Removal: Shell major
|
|
4
|
+
* (delivery step 5) after 1Pact step 4.
|
|
5
|
+
*
|
|
6
|
+
* Its legacy `can_use` holders, the Administrators group, hold `workspace.admin` through the release
|
|
7
|
+
* (AM5), which now admits them.
|
|
8
|
+
*/
|
|
9
|
+
export declare const legacyAssignViews: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
10
|
+
assignments: {
|
|
11
|
+
identity: string;
|
|
12
|
+
set?: string[] | undefined;
|
|
13
|
+
unset?: string[] | undefined;
|
|
14
|
+
}[];
|
|
15
|
+
}, {
|
|
16
|
+
readonly mode: 'value';
|
|
17
|
+
readonly value: Record<string, never>;
|
|
18
|
+
}, "authorized", false, false, undefined, undefined>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Copy every Shell `view_access` Edge to the Kernel's `view_access`, the one the
|
|
3
|
+
* Kernel enforces, and delete the Shell's; running it again changes nothing (L-SHELL-20). Replaced
|
|
4
|
+
* by nothing: Views are given through the Kernel's Edge. Removal: Shell major (delivery step 5),
|
|
5
|
+
* once every instance has run it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const legacyMigrateViewAccess: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
8
|
+
readonly mode: 'value';
|
|
9
|
+
readonly value: {
|
|
10
|
+
copied: number;
|
|
11
|
+
removed: number;
|
|
12
|
+
};
|
|
13
|
+
}, "authorized", false, false, undefined, undefined>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { func } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { profileRoles } from '../../../role/index.js';
|
|
4
|
+
import { hasRole } from '../../../../policies/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Copy every Shell `view_access` Edge to the Kernel's `view_access`, the one the
|
|
7
|
+
* Kernel enforces, and delete the Shell's; running it again changes nothing (L-SHELL-20). Replaced
|
|
8
|
+
* by nothing: Views are given through the Kernel's Edge. Removal: Shell major (delivery step 5),
|
|
9
|
+
* once every instance has run it.
|
|
10
|
+
*/
|
|
11
|
+
export const legacyMigrateViewAccess = func({
|
|
12
|
+
description: "Move the Views given through the Shell's view_access to the Kernel's.",
|
|
13
|
+
auth: 'authorized',
|
|
14
|
+
input: z.strictObject({}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
/** Kernel Edges created: the Shell Edges whose Kernel Edge did not exist yet. */
|
|
17
|
+
copied: z.number().int().min(0),
|
|
18
|
+
/** Shell Edges deleted, all of them once the copy landed. */
|
|
19
|
+
removed: z.number().int().min(0),
|
|
20
|
+
}),
|
|
21
|
+
policy: ({ check, ref }) => check(hasRole, ref(profileRoles['workspace.admin'])),
|
|
22
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { legacyViewAccess } from './classes/index.js';
|
|
2
|
+
export { legacyHoldsViewAccess } from './policies/index.js';
|
|
3
|
+
export { legacyAssignViews, legacyMigrateViewAccess } from './functions/index.js';
|
|
4
|
+
export { LEGACY_MAX_ASSIGNED_VIEWS, LEGACY_MAX_ASSIGNMENTS, legacyViewAssignment, } from './view-assignment.js';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { legacyViewAccess } from './classes/index.js';
|
|
2
|
+
export { legacyHoldsViewAccess } from './policies/index.js';
|
|
3
|
+
export { legacyAssignViews, legacyMigrateViewAccess } from './functions/index.js';
|
|
2
4
|
export { LEGACY_MAX_ASSIGNED_VIEWS, LEGACY_MAX_ASSIGNMENTS, legacyViewAssignment, } from './view-assignment.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated The subject is the Shell `view_access` Edge's audience, or extends it (L-SHELL-20).
|
|
3
|
+
* Replaced by the Kernel's `holdsViewAccess`. Removal: with `legacyViewAccess`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const legacyHoldsViewAccess: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated The subject is the Shell `view_access` Edge's audience, or extends it (L-SHELL-20).
|
|
4
|
+
* Replaced by the Kernel's `holdsViewAccess`. Removal: with `legacyViewAccess`.
|
|
5
|
+
*/
|
|
6
|
+
export const legacyHoldsViewAccess = policy({
|
|
7
|
+
match: ({ sameNode, subject, source }) => sameNode(subject, source),
|
|
8
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { legacyHoldsViewAccess } from './holds-view-access.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { legacyHoldsViewAccess } from './holds-view-access.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Bounds of one `assignViews` call within the Kernel's Mutation limits (L-SHELL-12).
|
|
4
|
+
* Replaced by a Mutation on `view_access`. Removal: Shell major (delivery step 5) after 1Pact step 4.
|
|
5
|
+
*/
|
|
6
|
+
export declare const LEGACY_MAX_ASSIGNED_VIEWS = 20;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated At most 40 identities in one `assignViews` call (L-SHELL-12). Replaced by a Mutation
|
|
9
|
+
* on `view_access`. Removal: Shell major (delivery step 5) after 1Pact step 4.
|
|
10
|
+
*/
|
|
11
|
+
export declare const LEGACY_MAX_ASSIGNMENTS = 40;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated The Views given to one identity (`set`) and withdrawn from it (`unset`), by @NodeId
|
|
14
|
+
* (L-SHELL-12). Replaced by a Mutation on `view_access`. Removal: Shell major (delivery step 5)
|
|
15
|
+
* after 1Pact step 4.
|
|
16
|
+
*/
|
|
17
|
+
export declare const legacyViewAssignment: z.ZodObject<{
|
|
18
|
+
identity: z.ZodString;
|
|
19
|
+
set: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
|
+
unset: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
}, z.core.$strict>;
|
package/dist/schema/schema.d.ts
CHANGED
|
@@ -31,6 +31,28 @@ declare const classes: {
|
|
|
31
31
|
readonly constraints: Record<never, never>;
|
|
32
32
|
readonly effectiveProperties: never;
|
|
33
33
|
}>;
|
|
34
|
+
readonly view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
35
|
+
readonly depth: 0;
|
|
36
|
+
readonly abstract: false;
|
|
37
|
+
readonly extends: readonly [];
|
|
38
|
+
readonly properties: never;
|
|
39
|
+
readonly source: {
|
|
40
|
+
readonly as: "audience";
|
|
41
|
+
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"Identity"> & {
|
|
42
|
+
readonly origin: "kernel.astrale.ai";
|
|
43
|
+
})[];
|
|
44
|
+
readonly outgoing: "0..*";
|
|
45
|
+
};
|
|
46
|
+
readonly target: {
|
|
47
|
+
readonly as: "view";
|
|
48
|
+
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"View"> & {
|
|
49
|
+
readonly origin: "kernel.astrale.ai";
|
|
50
|
+
})[];
|
|
51
|
+
readonly incoming: "0..*";
|
|
52
|
+
};
|
|
53
|
+
readonly constraints: Record<never, never>;
|
|
54
|
+
readonly effectiveProperties: never;
|
|
55
|
+
}>;
|
|
34
56
|
readonly User: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
35
57
|
readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
|
|
36
58
|
readonly inheritance: "open";
|
|
@@ -574,28 +596,6 @@ declare const classes: {
|
|
|
574
596
|
readonly constraints: Record<never, never>;
|
|
575
597
|
readonly effectiveProperties: never;
|
|
576
598
|
}>;
|
|
577
|
-
readonly view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
578
|
-
readonly depth: 0;
|
|
579
|
-
readonly abstract: false;
|
|
580
|
-
readonly extends: readonly [];
|
|
581
|
-
readonly properties: never;
|
|
582
|
-
readonly source: {
|
|
583
|
-
readonly as: "audience";
|
|
584
|
-
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"Identity"> & {
|
|
585
|
-
readonly origin: "kernel.astrale.ai";
|
|
586
|
-
})[];
|
|
587
|
-
readonly outgoing: "0..*";
|
|
588
|
-
};
|
|
589
|
-
readonly target: {
|
|
590
|
-
readonly as: "view";
|
|
591
|
-
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"View"> & {
|
|
592
|
-
readonly origin: "kernel.astrale.ai";
|
|
593
|
-
})[];
|
|
594
|
-
readonly incoming: "0..*";
|
|
595
|
-
};
|
|
596
|
-
readonly constraints: Record<never, never>;
|
|
597
|
-
readonly effectiveProperties: never;
|
|
598
|
-
}>;
|
|
599
599
|
};
|
|
600
600
|
export type ShellClasses = typeof classes;
|
|
601
601
|
declare const input: {
|
|
@@ -635,6 +635,28 @@ declare const input: {
|
|
|
635
635
|
readonly constraints: Record<never, never>;
|
|
636
636
|
readonly effectiveProperties: never;
|
|
637
637
|
}>;
|
|
638
|
+
readonly view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
639
|
+
readonly depth: 0;
|
|
640
|
+
readonly abstract: false;
|
|
641
|
+
readonly extends: readonly [];
|
|
642
|
+
readonly properties: never;
|
|
643
|
+
readonly source: {
|
|
644
|
+
readonly as: "audience";
|
|
645
|
+
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"Identity"> & {
|
|
646
|
+
readonly origin: "kernel.astrale.ai";
|
|
647
|
+
})[];
|
|
648
|
+
readonly outgoing: "0..*";
|
|
649
|
+
};
|
|
650
|
+
readonly target: {
|
|
651
|
+
readonly as: "view";
|
|
652
|
+
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"View"> & {
|
|
653
|
+
readonly origin: "kernel.astrale.ai";
|
|
654
|
+
})[];
|
|
655
|
+
readonly incoming: "0..*";
|
|
656
|
+
};
|
|
657
|
+
readonly constraints: Record<never, never>;
|
|
658
|
+
readonly effectiveProperties: never;
|
|
659
|
+
}>;
|
|
638
660
|
readonly User: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
639
661
|
readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
|
|
640
662
|
readonly inheritance: "open";
|
|
@@ -1178,28 +1200,6 @@ declare const input: {
|
|
|
1178
1200
|
readonly constraints: Record<never, never>;
|
|
1179
1201
|
readonly effectiveProperties: never;
|
|
1180
1202
|
}>;
|
|
1181
|
-
readonly view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
1182
|
-
readonly depth: 0;
|
|
1183
|
-
readonly abstract: false;
|
|
1184
|
-
readonly extends: readonly [];
|
|
1185
|
-
readonly properties: never;
|
|
1186
|
-
readonly source: {
|
|
1187
|
-
readonly as: "audience";
|
|
1188
|
-
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"Identity"> & {
|
|
1189
|
-
readonly origin: "kernel.astrale.ai";
|
|
1190
|
-
})[];
|
|
1191
|
-
readonly outgoing: "0..*";
|
|
1192
|
-
};
|
|
1193
|
-
readonly target: {
|
|
1194
|
-
readonly as: "view";
|
|
1195
|
-
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"View"> & {
|
|
1196
|
-
readonly origin: "kernel.astrale.ai";
|
|
1197
|
-
})[];
|
|
1198
|
-
readonly incoming: "0..*";
|
|
1199
|
-
};
|
|
1200
|
-
readonly constraints: Record<never, never>;
|
|
1201
|
-
readonly effectiveProperties: never;
|
|
1202
|
-
}>;
|
|
1203
1203
|
};
|
|
1204
1204
|
readonly functions: {
|
|
1205
1205
|
readonly listEntrypoints: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
@@ -1233,6 +1233,13 @@ declare const input: {
|
|
|
1233
1233
|
profiles: number;
|
|
1234
1234
|
};
|
|
1235
1235
|
}, "authorized", false, false, undefined, undefined>>;
|
|
1236
|
+
readonly legacyMigrateViewAccess: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
1237
|
+
readonly mode: 'value';
|
|
1238
|
+
readonly value: {
|
|
1239
|
+
copied: number;
|
|
1240
|
+
removed: number;
|
|
1241
|
+
};
|
|
1242
|
+
}, "authorized", false, false, undefined, undefined>>;
|
|
1236
1243
|
readonly disconnectDirectory: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
1237
1244
|
directory: string;
|
|
1238
1245
|
}, {
|
|
@@ -1250,8 +1257,8 @@ declare const input: {
|
|
|
1250
1257
|
readonly usesFunction: import("@astrale-os/sdk/schema").Policy;
|
|
1251
1258
|
readonly isSelf: import("@astrale-os/sdk/schema").Policy;
|
|
1252
1259
|
readonly legacyOwnsMembershipGroup: import("@astrale-os/sdk/schema").Policy;
|
|
1253
|
-
readonly hasRole: import("@astrale-os/sdk/schema").Policy;
|
|
1254
1260
|
readonly holdsViewAccess: import("@astrale-os/sdk/schema").Policy;
|
|
1261
|
+
readonly hasRole: import("@astrale-os/sdk/schema").Policy;
|
|
1255
1262
|
readonly describesSubject: import("@astrale-os/sdk/schema").Policy;
|
|
1256
1263
|
readonly isProfileSource: import("@astrale-os/sdk/schema").Policy;
|
|
1257
1264
|
readonly describesGroupOfSubject: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -1316,6 +1323,28 @@ export declare const ShellSchema: import("@astrale-os/sdk/schema").AuthoredSchem
|
|
|
1316
1323
|
readonly constraints: Record<never, never>;
|
|
1317
1324
|
readonly effectiveProperties: never;
|
|
1318
1325
|
}>;
|
|
1326
|
+
readonly view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
1327
|
+
readonly depth: 0;
|
|
1328
|
+
readonly abstract: false;
|
|
1329
|
+
readonly extends: readonly [];
|
|
1330
|
+
readonly properties: never;
|
|
1331
|
+
readonly source: {
|
|
1332
|
+
readonly as: "audience";
|
|
1333
|
+
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"Identity"> & {
|
|
1334
|
+
readonly origin: "kernel.astrale.ai";
|
|
1335
|
+
})[];
|
|
1336
|
+
readonly outgoing: "0..*";
|
|
1337
|
+
};
|
|
1338
|
+
readonly target: {
|
|
1339
|
+
readonly as: "view";
|
|
1340
|
+
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"View"> & {
|
|
1341
|
+
readonly origin: "kernel.astrale.ai";
|
|
1342
|
+
})[];
|
|
1343
|
+
readonly incoming: "0..*";
|
|
1344
|
+
};
|
|
1345
|
+
readonly constraints: Record<never, never>;
|
|
1346
|
+
readonly effectiveProperties: never;
|
|
1347
|
+
}>;
|
|
1319
1348
|
readonly User: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
1320
1349
|
readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
|
|
1321
1350
|
readonly inheritance: "open";
|
|
@@ -1859,28 +1888,6 @@ export declare const ShellSchema: import("@astrale-os/sdk/schema").AuthoredSchem
|
|
|
1859
1888
|
readonly constraints: Record<never, never>;
|
|
1860
1889
|
readonly effectiveProperties: never;
|
|
1861
1890
|
}>;
|
|
1862
|
-
readonly view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
1863
|
-
readonly depth: 0;
|
|
1864
|
-
readonly abstract: false;
|
|
1865
|
-
readonly extends: readonly [];
|
|
1866
|
-
readonly properties: never;
|
|
1867
|
-
readonly source: {
|
|
1868
|
-
readonly as: "audience";
|
|
1869
|
-
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"Identity"> & {
|
|
1870
|
-
readonly origin: "kernel.astrale.ai";
|
|
1871
|
-
})[];
|
|
1872
|
-
readonly outgoing: "0..*";
|
|
1873
|
-
};
|
|
1874
|
-
readonly target: {
|
|
1875
|
-
readonly as: "view";
|
|
1876
|
-
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"View"> & {
|
|
1877
|
-
readonly origin: "kernel.astrale.ai";
|
|
1878
|
-
})[];
|
|
1879
|
-
readonly incoming: "0..*";
|
|
1880
|
-
};
|
|
1881
|
-
readonly constraints: Record<never, never>;
|
|
1882
|
-
readonly effectiveProperties: never;
|
|
1883
|
-
}>;
|
|
1884
1891
|
};
|
|
1885
1892
|
readonly functions: {
|
|
1886
1893
|
readonly listEntrypoints: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
@@ -1914,6 +1921,13 @@ export declare const ShellSchema: import("@astrale-os/sdk/schema").AuthoredSchem
|
|
|
1914
1921
|
profiles: number;
|
|
1915
1922
|
};
|
|
1916
1923
|
}, "authorized", false, false, undefined, undefined>>;
|
|
1924
|
+
readonly legacyMigrateViewAccess: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
1925
|
+
readonly mode: 'value';
|
|
1926
|
+
readonly value: {
|
|
1927
|
+
copied: number;
|
|
1928
|
+
removed: number;
|
|
1929
|
+
};
|
|
1930
|
+
}, "authorized", false, false, undefined, undefined>>;
|
|
1917
1931
|
readonly disconnectDirectory: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
1918
1932
|
directory: string;
|
|
1919
1933
|
}, {
|
|
@@ -1931,8 +1945,8 @@ export declare const ShellSchema: import("@astrale-os/sdk/schema").AuthoredSchem
|
|
|
1931
1945
|
readonly usesFunction: import("@astrale-os/sdk/schema").Policy;
|
|
1932
1946
|
readonly isSelf: import("@astrale-os/sdk/schema").Policy;
|
|
1933
1947
|
readonly legacyOwnsMembershipGroup: import("@astrale-os/sdk/schema").Policy;
|
|
1934
|
-
readonly hasRole: import("@astrale-os/sdk/schema").Policy;
|
|
1935
1948
|
readonly holdsViewAccess: import("@astrale-os/sdk/schema").Policy;
|
|
1949
|
+
readonly hasRole: import("@astrale-os/sdk/schema").Policy;
|
|
1936
1950
|
readonly describesSubject: import("@astrale-os/sdk/schema").Policy;
|
|
1937
1951
|
readonly isProfileSource: import("@astrale-os/sdk/schema").Policy;
|
|
1938
1952
|
readonly describesGroupOfSubject: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -1999,6 +2013,28 @@ export declare const S: schema.ResolvedDomainOf<import("@astrale-os/sdk/schema")
|
|
|
1999
2013
|
readonly constraints: Record<never, never>;
|
|
2000
2014
|
readonly effectiveProperties: never;
|
|
2001
2015
|
}>;
|
|
2016
|
+
readonly view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
2017
|
+
readonly depth: 0;
|
|
2018
|
+
readonly abstract: false;
|
|
2019
|
+
readonly extends: readonly [];
|
|
2020
|
+
readonly properties: never;
|
|
2021
|
+
readonly source: {
|
|
2022
|
+
readonly as: "audience";
|
|
2023
|
+
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"Identity"> & {
|
|
2024
|
+
readonly origin: "kernel.astrale.ai";
|
|
2025
|
+
})[];
|
|
2026
|
+
readonly outgoing: "0..*";
|
|
2027
|
+
};
|
|
2028
|
+
readonly target: {
|
|
2029
|
+
readonly as: "view";
|
|
2030
|
+
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"View"> & {
|
|
2031
|
+
readonly origin: "kernel.astrale.ai";
|
|
2032
|
+
})[];
|
|
2033
|
+
readonly incoming: "0..*";
|
|
2034
|
+
};
|
|
2035
|
+
readonly constraints: Record<never, never>;
|
|
2036
|
+
readonly effectiveProperties: never;
|
|
2037
|
+
}>;
|
|
2002
2038
|
readonly User: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
2003
2039
|
readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
|
|
2004
2040
|
readonly inheritance: "open";
|
|
@@ -2542,28 +2578,6 @@ export declare const S: schema.ResolvedDomainOf<import("@astrale-os/sdk/schema")
|
|
|
2542
2578
|
readonly constraints: Record<never, never>;
|
|
2543
2579
|
readonly effectiveProperties: never;
|
|
2544
2580
|
}>;
|
|
2545
|
-
readonly view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
2546
|
-
readonly depth: 0;
|
|
2547
|
-
readonly abstract: false;
|
|
2548
|
-
readonly extends: readonly [];
|
|
2549
|
-
readonly properties: never;
|
|
2550
|
-
readonly source: {
|
|
2551
|
-
readonly as: "audience";
|
|
2552
|
-
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"Identity"> & {
|
|
2553
|
-
readonly origin: "kernel.astrale.ai";
|
|
2554
|
-
})[];
|
|
2555
|
-
readonly outgoing: "0..*";
|
|
2556
|
-
};
|
|
2557
|
-
readonly target: {
|
|
2558
|
-
readonly as: "view";
|
|
2559
|
-
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"View"> & {
|
|
2560
|
-
readonly origin: "kernel.astrale.ai";
|
|
2561
|
-
})[];
|
|
2562
|
-
readonly incoming: "0..*";
|
|
2563
|
-
};
|
|
2564
|
-
readonly constraints: Record<never, never>;
|
|
2565
|
-
readonly effectiveProperties: never;
|
|
2566
|
-
}>;
|
|
2567
2581
|
};
|
|
2568
2582
|
readonly functions: {
|
|
2569
2583
|
readonly listEntrypoints: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
@@ -2597,6 +2611,13 @@ export declare const S: schema.ResolvedDomainOf<import("@astrale-os/sdk/schema")
|
|
|
2597
2611
|
profiles: number;
|
|
2598
2612
|
};
|
|
2599
2613
|
}, "authorized", false, false, undefined, undefined>>;
|
|
2614
|
+
readonly legacyMigrateViewAccess: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
2615
|
+
readonly mode: 'value';
|
|
2616
|
+
readonly value: {
|
|
2617
|
+
copied: number;
|
|
2618
|
+
removed: number;
|
|
2619
|
+
};
|
|
2620
|
+
}, "authorized", false, false, undefined, undefined>>;
|
|
2600
2621
|
readonly disconnectDirectory: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2601
2622
|
directory: string;
|
|
2602
2623
|
}, {
|
|
@@ -2614,8 +2635,8 @@ export declare const S: schema.ResolvedDomainOf<import("@astrale-os/sdk/schema")
|
|
|
2614
2635
|
readonly usesFunction: import("@astrale-os/sdk/schema").Policy;
|
|
2615
2636
|
readonly isSelf: import("@astrale-os/sdk/schema").Policy;
|
|
2616
2637
|
readonly legacyOwnsMembershipGroup: import("@astrale-os/sdk/schema").Policy;
|
|
2617
|
-
readonly hasRole: import("@astrale-os/sdk/schema").Policy;
|
|
2618
2638
|
readonly holdsViewAccess: import("@astrale-os/sdk/schema").Policy;
|
|
2639
|
+
readonly hasRole: import("@astrale-os/sdk/schema").Policy;
|
|
2619
2640
|
readonly describesSubject: import("@astrale-os/sdk/schema").Policy;
|
|
2620
2641
|
readonly isProfileSource: import("@astrale-os/sdk/schema").Policy;
|
|
2621
2642
|
readonly describesGroupOfSubject: import("@astrale-os/sdk/schema").Policy;
|
package/dist/schema/schema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineSchema, KernelSchema, schema } from '@astrale-os/sdk/schema';
|
|
2
|
-
// Seam L-SHELL-7…
|
|
2
|
+
// Seam L-SHELL-7…20: the legacy declarations, under their stored names.
|
|
3
3
|
import { legacyShellSchema } from './legacy/index.js';
|
|
4
4
|
import { disconnectDirectory } from './modules/directory/index.js';
|
|
5
5
|
import { Group, GroupProfile, describesGroupOfSubject, group_profile, isGroupProfileSource, } from './modules/group/index.js';
|
|
@@ -7,7 +7,6 @@ import { Invitation, invitation_user } from './modules/invitation/index.js';
|
|
|
7
7
|
import { Namespace, alias, viewsNamespace } from './modules/namespace/index.js';
|
|
8
8
|
import { Role, shellRoles } from './modules/role/index.js';
|
|
9
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
10
|
import { hasRole } from './policies/index.js';
|
|
12
11
|
import { applicationView } from './views/index.js';
|
|
13
12
|
export const ORIGIN = 'shell.astrale.ai';
|
|
@@ -24,13 +23,11 @@ const classes = {
|
|
|
24
23
|
Role,
|
|
25
24
|
Namespace,
|
|
26
25
|
alias,
|
|
27
|
-
view_access,
|
|
28
26
|
...legacyShellSchema.classes,
|
|
29
27
|
};
|
|
30
28
|
const functions = { disconnectDirectory, ...legacyShellSchema.functions };
|
|
31
29
|
const policies = {
|
|
32
30
|
hasRole,
|
|
33
|
-
holdsViewAccess,
|
|
34
31
|
describesSubject,
|
|
35
32
|
isProfileSource,
|
|
36
33
|
describesGroupOfSubject,
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { view_access } from './view-access.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { view_access } from './view-access.js';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { K, edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { profileRoles } from '../../role/index.js';
|
|
3
|
-
import { hasRole } from '../../../policies/index.js';
|
|
4
|
-
import { holdsViewAccess } from '../policies/index.js';
|
|
5
|
-
/**
|
|
6
|
-
* A View an Identity lands on without `member`: an account, a group or a Role, and each of their
|
|
7
|
-
* members. It decides navigation, never data: the View's own Domain still guards everything it
|
|
8
|
-
* shows (V1). Only an admin writes it; an admin or its holders read it. Each end detaches with its
|
|
9
|
-
* Node.
|
|
10
|
-
*/
|
|
11
|
-
export const view_access = edgeClass.directed({
|
|
12
|
-
inheritance: 'final',
|
|
13
|
-
abstract: false,
|
|
14
|
-
description: 'A View this Identity lands on without member.',
|
|
15
|
-
source: { as: 'audience', accepts: [K.classes.Identity], outgoing: '0..*', onDelete: 'detach' },
|
|
16
|
-
target: { as: 'view', accepts: [K.classes.View], incoming: '0..*', onDelete: 'detach' },
|
|
17
|
-
policies: {
|
|
18
|
-
read: ({ anyOf, check, ref, self }) => anyOf(check(hasRole, ref(profileRoles['workspace.admin'])), check(holdsViewAccess, self)),
|
|
19
|
-
traverse: true,
|
|
20
|
-
create: ({ check, ref }) => check(hasRole, ref(profileRoles['workspace.admin'])),
|
|
21
|
-
delete: ({ check, ref }) => check(hasRole, ref(profileRoles['workspace.admin'])),
|
|
22
|
-
},
|
|
23
|
-
});
|