@astrale-domains/shell 0.1.0-beta.20 → 0.1.0-beta.22
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/CHANGELOG.md +28 -0
- package/README.md +19 -15
- package/dist/application.d.ts +3 -2
- package/dist/application.js +53 -18
- package/dist/{workflows → functions}/group/assign.d.ts +1 -1
- package/dist/{workflows → functions}/group/change.d.ts +1 -1
- package/dist/{workflows → functions}/group/unassign.d.ts +1 -1
- package/dist/functions/registry/index.d.ts +12 -0
- package/dist/functions/registry/index.js +12 -0
- package/dist/{workflows → functions}/setup/admin.d.ts +1 -1
- package/dist/{workflows → functions}/setup/index.d.ts +0 -1
- package/dist/{workflows → functions}/setup/index.js +0 -1
- package/dist/{workflows → functions}/setup/member.d.ts +1 -1
- package/dist/{workflows → functions}/setup/provision.d.ts +2 -2
- package/dist/{workflows → functions}/setup/run.d.ts +2 -2
- package/dist/{workflows → functions}/setup/run.js +9 -2
- package/dist/{workflows → functions}/space/access.d.ts +1 -1
- package/dist/{workflows → functions}/space/add.d.ts +1 -1
- package/dist/{workflows → functions}/space/default.d.ts +1 -1
- package/dist/{workflows → functions}/space/remove.d.ts +1 -1
- package/dist/functions/user/index.d.ts +3 -0
- package/dist/functions/user/index.js +3 -0
- package/dist/{actions → functions}/user/resolve-home.d.ts +1 -1
- package/dist/mutations/group/membership.d.ts +1 -1
- package/dist/mutations/space/access.d.ts +1 -1
- package/dist/mutations/space/default.d.ts +1 -1
- package/dist/mutations/user/repair.d.ts +3 -21
- package/dist/queries/space/access.d.ts +1 -1
- package/dist/queries/space/admin.d.ts +1 -1
- package/dist/queries/space/member.d.ts +1 -1
- package/dist/queries/user/groups.d.ts +1 -1
- package/dist/queries/user/home.d.ts +1 -1
- package/dist/queries/user/owned-spaces.d.ts +1 -1
- package/dist/queries/user/profile.d.ts +1 -1
- package/dist/queries/user/setup.d.ts +1 -1
- package/dist/rules/user/index.d.ts +1 -0
- package/dist/rules/user/index.js +1 -0
- package/dist/rules/user/setup.d.ts +38 -0
- package/dist/{workflows/setup/plan.js → rules/user/setup.js} +0 -5
- package/dist/runtime.d.ts +6 -3
- package/dist/runtime.js +7 -13
- package/dist/schema/index.d.ts +4 -6
- package/dist/schema/index.js +4 -6
- package/dist/schema/{group/class.d.ts → modules/group/classes/group.d.ts} +4 -2
- package/dist/schema/modules/group/classes/group.js +10 -0
- package/dist/schema/{group/relationships.js → modules/group/classes/member-of-group.js} +2 -2
- package/dist/schema/modules/group/core/admin-group.d.ts +1 -0
- package/dist/schema/modules/group/core/admin-group.js +2 -0
- package/dist/schema/modules/group/core/core.d.ts +8 -0
- package/dist/schema/modules/group/core/core.js +6 -0
- package/dist/schema/modules/group/core/identity.d.ts +1 -0
- package/dist/schema/modules/group/core/identity.js +10 -0
- package/dist/schema/modules/group/core/member-group.d.ts +1 -0
- package/dist/schema/modules/group/core/member-group.js +2 -0
- package/dist/schema/modules/group/functions/assign-user.d.ts +6 -0
- package/dist/schema/modules/group/functions/assign-user.js +2 -0
- package/dist/schema/modules/group/functions/membership.d.ts +7 -0
- package/dist/schema/{group/methods.js → modules/group/functions/membership.js} +4 -6
- package/dist/schema/modules/group/functions/unassign-user.d.ts +6 -0
- package/dist/schema/modules/group/functions/unassign-user.js +2 -0
- package/dist/schema/modules/group/index.d.ts +9 -0
- package/dist/schema/modules/group/index.js +9 -0
- package/dist/schema/{group/policies.js → modules/group/policies/may-setup-users.js} +1 -1
- package/dist/schema/{group/view.js → modules/group/views/group.js} +1 -1
- package/dist/schema/modules/space/classes/administers-space.d.ts +16 -0
- package/dist/schema/modules/space/classes/administers-space.js +9 -0
- package/dist/schema/modules/space/classes/default-space.d.ts +16 -0
- package/dist/schema/modules/space/classes/default-space.js +8 -0
- package/dist/schema/modules/space/classes/member-of-space.d.ts +16 -0
- package/dist/schema/modules/space/classes/member-of-space.js +9 -0
- package/dist/schema/modules/space/classes/owns-space.d.ts +16 -0
- package/dist/schema/modules/space/classes/owns-space.js +9 -0
- package/dist/schema/{space/class.d.ts → modules/space/classes/space.d.ts} +5 -2
- package/dist/schema/modules/space/classes/space.js +15 -0
- package/dist/schema/{space → modules/space/core}/core.d.ts +0 -1
- package/dist/schema/modules/space/core/core.js +12 -0
- package/dist/schema/modules/space/core/default-space.d.ts +1 -0
- package/dist/schema/modules/space/core/default-space.js +6 -0
- package/dist/schema/modules/space/functions/access.d.ts +10 -0
- package/dist/schema/modules/space/functions/access.js +9 -0
- package/dist/schema/modules/space/functions/add-user.d.ts +7 -0
- package/dist/schema/modules/space/functions/add-user.js +11 -0
- package/dist/schema/modules/space/functions/remove-user.d.ts +6 -0
- package/dist/schema/modules/space/functions/remove-user.js +9 -0
- package/dist/schema/modules/space/functions/set-default.d.ts +4 -0
- package/dist/schema/modules/space/functions/set-default.js +9 -0
- package/dist/schema/modules/space/index.d.ts +14 -0
- package/dist/schema/modules/space/index.js +14 -0
- package/dist/schema/modules/space/policies/belongs-to-space.d.ts +1 -0
- package/dist/schema/modules/space/policies/belongs-to-space.js +9 -0
- package/dist/schema/modules/space/policies/group-space-branch.d.ts +4 -0
- package/dist/schema/modules/space/policies/group-space-branch.js +7 -0
- package/dist/schema/modules/space/policies/may-administer-space.d.ts +1 -0
- package/dist/schema/modules/space/policies/may-administer-space.js +8 -0
- package/dist/schema/modules/space/policies/owns-space.d.ts +1 -0
- package/dist/schema/modules/space/policies/owns-space.js +7 -0
- package/dist/schema/{space/view.js → modules/space/views/space.js} +1 -1
- package/dist/schema/{user/class.d.ts → modules/user/classes/user.d.ts} +3 -2
- package/dist/schema/modules/user/classes/user.js +12 -0
- package/dist/schema/modules/user/functions/setup-admin.d.ts +14 -0
- package/dist/schema/modules/user/functions/setup-admin.js +2 -0
- package/dist/schema/{setup/functions.d.ts → modules/user/functions/setup-member.d.ts} +0 -14
- package/dist/schema/modules/user/functions/setup-member.js +2 -0
- package/dist/schema/modules/user/functions/setup-user.d.ts +15 -0
- package/dist/schema/{setup/functions.js → modules/user/functions/setup-user.js} +4 -11
- package/dist/schema/modules/user/index.d.ts +6 -0
- package/dist/schema/modules/user/index.js +6 -0
- package/dist/schema/{user/view.js → modules/user/views/user.js} +1 -1
- package/dist/schema/{domain/index.d.ts → schema.d.ts} +4 -5
- package/dist/schema/{domain/index.js → schema.js} +3 -6
- package/package.json +16 -10
- package/dist/actions/index.d.ts +0 -1
- package/dist/actions/index.js +0 -1
- package/dist/actions/user/index.d.ts +0 -1
- package/dist/actions/user/index.js +0 -1
- package/dist/entrypoints/application.d.ts +0 -1
- package/dist/entrypoints/application.js +0 -1
- package/dist/entrypoints/runtime.d.ts +0 -1
- package/dist/entrypoints/runtime.js +0 -1
- package/dist/schema/group/class.js +0 -8
- package/dist/schema/group/core.d.ts +0 -10
- package/dist/schema/group/core.js +0 -14
- package/dist/schema/group/index.d.ts +0 -6
- package/dist/schema/group/index.js +0 -6
- package/dist/schema/group/methods.d.ts +0 -13
- package/dist/schema/home/index.d.ts +0 -1
- package/dist/schema/home/index.js +0 -1
- package/dist/schema/setup/index.d.ts +0 -1
- package/dist/schema/setup/index.js +0 -1
- package/dist/schema/space/class.js +0 -12
- package/dist/schema/space/core.js +0 -15
- package/dist/schema/space/index.d.ts +0 -6
- package/dist/schema/space/index.js +0 -6
- package/dist/schema/space/methods.d.ts +0 -18
- package/dist/schema/space/methods.js +0 -28
- package/dist/schema/space/policies.d.ts +0 -4
- package/dist/schema/space/policies.js +0 -21
- package/dist/schema/space/relationships.d.ts +0 -64
- package/dist/schema/space/relationships.js +0 -24
- package/dist/schema/user/class.js +0 -11
- package/dist/schema/user/index.d.ts +0 -3
- package/dist/schema/user/index.js +0 -3
- package/dist/workflows/index.d.ts +0 -3
- package/dist/workflows/index.js +0 -3
- package/dist/workflows/setup/plan.d.ts +0 -18
- /package/dist/{workflows → functions}/group/assign.js +0 -0
- /package/dist/{workflows → functions}/group/change.js +0 -0
- /package/dist/{workflows → functions}/group/index.d.ts +0 -0
- /package/dist/{workflows → functions}/group/index.js +0 -0
- /package/dist/{workflows → functions}/group/unassign.js +0 -0
- /package/dist/{workflows → functions}/setup/admin.js +0 -0
- /package/dist/{workflows → functions}/setup/member.js +0 -0
- /package/dist/{workflows → functions}/setup/provision.js +0 -0
- /package/dist/{workflows → functions}/space/access.js +0 -0
- /package/dist/{workflows → functions}/space/add.js +0 -0
- /package/dist/{workflows → functions}/space/default.js +0 -0
- /package/dist/{workflows → functions}/space/index.d.ts +0 -0
- /package/dist/{workflows → functions}/space/index.js +0 -0
- /package/dist/{workflows → functions}/space/remove.js +0 -0
- /package/dist/{actions → functions}/user/resolve-home.js +0 -0
- /package/dist/schema/{group/relationships.d.ts → modules/group/classes/member-of-group.d.ts} +0 -0
- /package/dist/schema/{group/policies.d.ts → modules/group/policies/may-setup-users.d.ts} +0 -0
- /package/dist/schema/{group/view.d.ts → modules/group/views/group.d.ts} +0 -0
- /package/dist/schema/{space/view.d.ts → modules/space/views/space.d.ts} +0 -0
- /package/dist/schema/{user/methods.d.ts → modules/user/functions/resolve-home.d.ts} +0 -0
- /package/dist/schema/{user/methods.js → modules/user/functions/resolve-home.js} +0 -0
- /package/dist/schema/{home/view.d.ts → modules/user/views/home.d.ts} +0 -0
- /package/dist/schema/{home/view.js → modules/user/views/home.js} +0 -0
- /package/dist/schema/{user/view.d.ts → modules/user/views/user.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.0-beta.22](https://github.com/astrale-os/shell/compare/shell-domain-v0.1.0-beta.21...shell-domain-v0.1.0-beta.22) (2026-09-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **core:** declare required node class icons ([#163](https://github.com/astrale-os/shell/issues/163)) ([2114424](https://github.com/astrale-os/shell/commit/2114424dc1295d978e49536aea76ace897917987))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **domain:** authorize installed app discovery ([#164](https://github.com/astrale-os/shell/issues/164)) ([cbcb559](https://github.com/astrale-os/shell/commit/cbcb5594ffa9701ec979333f76f7c5dc3597401e))
|
|
14
|
+
|
|
15
|
+
## [0.1.0-beta.21](https://github.com/astrale-os/shell/compare/shell-domain-v0.1.0-beta.20...shell-domain-v0.1.0-beta.21) (2026-09-01)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### ⚠ BREAKING CHANGES
|
|
19
|
+
|
|
20
|
+
* adopt unified Domain functions layer ([#157](https://github.com/astrale-os/shell/issues/157))
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* adopt unified Domain functions layer ([#157](https://github.com/astrale-os/shell/issues/157)) ([ae73910](https://github.com/astrale-os/shell/commit/ae739107da4b3827ff06f09a1bf86958135a2a5a))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* **domain:** stabilize executable declarations ([a12caa6](https://github.com/astrale-os/shell/commit/a12caa64cb42d8b7d623a53463ff2f1242d27052))
|
|
30
|
+
|
|
3
31
|
## [0.1.0-beta.20](https://github.com/astrale-os/shell/compare/shell-domain-v0.1.0-beta.19...shell-domain-v0.1.0-beta.20) (2026-08-31)
|
|
4
32
|
|
|
5
33
|
|
package/README.md
CHANGED
|
@@ -34,21 +34,24 @@ The Methods are:
|
|
|
34
34
|
|
|
35
35
|
Installation authors the `admin`, `member`, and `default-space` Core nodes. Shell infers no authority
|
|
36
36
|
from email, claims, path spelling, creation order, or a successful handler-local boolean.
|
|
37
|
-
The signed Publication declares installation-owned authority profiles: the Shell principal
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
The signed Publication declares installation-owned authority profiles: the Shell principal can
|
|
38
|
+
read installed Kernel `Domain` metadata so managed sessions can list applications and resolve their
|
|
39
|
+
domain Views, and the Shell principal plus Core `admin` receive the intended Kernel
|
|
40
|
+
application-plane surface, excluding only the ability to grant `grant` or revoke `revoke`; Core
|
|
41
|
+
`member` receives Kernel Introspection, Query, Mutation, and View resolution. Kernel install,
|
|
42
|
+
upgrade, introspection, and uninstall own those authority edges as one generation.
|
|
42
43
|
|
|
43
44
|
## Source ownership
|
|
44
45
|
|
|
45
|
-
- `schema
|
|
46
|
-
|
|
46
|
+
- `schema/schema.ts` composes the complete Domain contract, while
|
|
47
|
+
`schema/modules/{user,group,space,home}/` owns each declaration and its focused evidence;
|
|
48
|
+
- every standalone Function and receiver-bound Method declaration has one file under its semantic
|
|
49
|
+
module's `functions/` directory; there is no separate code-kind `methods/` owner;
|
|
50
|
+
- `rules/user/` owns the pure closed decision for User setup and exposes no graph effect;
|
|
47
51
|
- `queries/` owns canonical graph observations through the invocation-bound Query executor;
|
|
48
52
|
- `mutations/` owns canonical graph changes and exact preconditions;
|
|
49
|
-
- `
|
|
50
|
-
|
|
51
|
-
unknown-outcome observation; and
|
|
53
|
+
- `functions/` owns the single-operation `User.resolveHome` Action, setup Workflows, Group
|
|
54
|
+
membership, Space access/default journeys, and unknown-outcome observation; and
|
|
52
55
|
- each semantic owner keeps focused evidence in its own `__tests__/` directory, while root tests
|
|
53
56
|
remain reserved for cross-layer or physical evidence.
|
|
54
57
|
|
|
@@ -56,8 +59,8 @@ No current responsibility earns a `states/`, `capabilities/`, `integrations/`, `
|
|
|
56
59
|
`views/`, or `ui/` source layer. DSL View declarations remain in Schema; a future frontend
|
|
57
60
|
projection or UI must establish its own concrete responsibility before adding those layers.
|
|
58
61
|
|
|
59
|
-
Shell never re-declares shared metadata properties. `Group` and `Space`
|
|
60
|
-
`K.Descriptable`
|
|
62
|
+
Shell never re-declares shared metadata properties. `Group` and `Space` extend `K.Named` and
|
|
63
|
+
`K.Descriptable` because those Kernel Classes own the admitted
|
|
61
64
|
`name` and `description` properties; no timestamps are authored by Shell.
|
|
62
65
|
|
|
63
66
|
## Execution and evidence
|
|
@@ -84,9 +87,10 @@ schema facade.
|
|
|
84
87
|
Domain publication product. It publishes the remote Shell application and runtime needed by platform
|
|
85
88
|
Worker deployments through the explicit `./application` and `./runtime` subpaths, while its root remains
|
|
86
89
|
Schema-only. Its build therefore compiles the explicit roots in `tsconfig.package.json` and applies
|
|
87
|
-
Shell-owned checks to the emitted platform closure.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
Shell-owned normalization and checks to the emitted platform closure. Source-only `#` aliases are
|
|
91
|
+
rewritten to relative declaration references so consumer path mappings cannot capture private Shell
|
|
92
|
+
types. Tarball qualification then verifies the exact exports, isolated subpaths, absence of source
|
|
93
|
+
maps, and an install using only public npm dependencies.
|
|
90
94
|
|
|
91
95
|
The generic `astrale-domain package` command remains Schema-only and exposes only the Domain root plus
|
|
92
96
|
package metadata. This Shell exception must not be copied to ordinary product Domains or used to
|
package/dist/application.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Application, type Frontend, type Requirements } from '@astrale-os/sdk/application';
|
|
2
2
|
import runtime from './runtime.js';
|
|
3
3
|
import { ShellSchema } from './schema/index.js';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
declare const frontend: Frontend<typeof ShellSchema>;
|
|
5
|
+
declare const applicationRequirements: Requirements;
|
|
6
|
+
export declare const application: Application<typeof ShellSchema, typeof runtime, typeof frontend, undefined, typeof applicationRequirements>;
|
|
6
7
|
export default application;
|
package/dist/application.js
CHANGED
|
@@ -2,18 +2,7 @@ import { defineApplication, defineFrontend, external, requirements, } from '@ast
|
|
|
2
2
|
import { K, KernelRootFunctions } from '@astrale-os/sdk/schema';
|
|
3
3
|
import runtime from './runtime.js';
|
|
4
4
|
import { S, ShellSchema } from './schema/index.js';
|
|
5
|
-
const
|
|
6
|
-
const authority = {
|
|
7
|
-
grant: ['create', 'read', 'update', 'delete', 'traverse', 'use', 'revoke'],
|
|
8
|
-
revoke: ['create', 'read', 'update', 'delete', 'traverse', 'use', 'grant'],
|
|
9
|
-
};
|
|
10
|
-
const memberFunctions = [
|
|
11
|
-
K.classes.View.static.methods.resolve,
|
|
12
|
-
K.functions.introspect,
|
|
13
|
-
K.functions.mutate,
|
|
14
|
-
K.functions.query,
|
|
15
|
-
];
|
|
16
|
-
export const frontend = defineFrontend({
|
|
5
|
+
const frontend = defineFrontend({
|
|
17
6
|
schema: ShellSchema,
|
|
18
7
|
source: external('https://app.astrale.ai'),
|
|
19
8
|
routes: {
|
|
@@ -24,31 +13,77 @@ export const frontend = defineFrontend({
|
|
|
24
13
|
},
|
|
25
14
|
entrypoint: 'home',
|
|
26
15
|
});
|
|
27
|
-
const
|
|
16
|
+
const applicationRequirements = requirements({
|
|
28
17
|
functions: KernelRootFunctions,
|
|
29
18
|
classes: [
|
|
19
|
+
{
|
|
20
|
+
class: K.classes.Domain,
|
|
21
|
+
operations: ['read'],
|
|
22
|
+
},
|
|
30
23
|
{
|
|
31
24
|
class: K.classes.extends_with,
|
|
32
25
|
operations: ['create', 'read', 'traverse', 'delete'],
|
|
33
26
|
},
|
|
34
27
|
],
|
|
35
|
-
authority
|
|
28
|
+
authority: {
|
|
29
|
+
grant: ['create', 'read', 'update', 'delete', 'traverse', 'use', 'revoke'],
|
|
30
|
+
revoke: ['create', 'read', 'update', 'delete', 'traverse', 'use', 'grant'],
|
|
31
|
+
},
|
|
36
32
|
profiles: [
|
|
37
33
|
{
|
|
38
34
|
subject: S.core.nodes.admin,
|
|
39
35
|
functions: KernelRootFunctions,
|
|
40
36
|
classes: [
|
|
41
|
-
|
|
37
|
+
{
|
|
38
|
+
class: S.classes.Group,
|
|
39
|
+
operations: ['create', 'read', 'traverse', 'update', 'delete'],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
class: S.classes.Space,
|
|
43
|
+
operations: ['create', 'read', 'traverse', 'update', 'delete'],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
class: S.classes.User,
|
|
47
|
+
operations: ['create', 'read', 'traverse', 'update', 'delete'],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
class: S.classes.administers_space,
|
|
51
|
+
operations: ['create', 'read', 'traverse', 'update', 'delete'],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
class: S.classes.default_space,
|
|
55
|
+
operations: ['create', 'read', 'traverse', 'update', 'delete'],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
class: S.classes.member_of_group,
|
|
59
|
+
operations: ['create', 'read', 'traverse', 'update', 'delete'],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
class: S.classes.member_of_space,
|
|
63
|
+
operations: ['create', 'read', 'traverse', 'update', 'delete'],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
class: S.classes.owns_space,
|
|
67
|
+
operations: ['create', 'read', 'traverse', 'update', 'delete'],
|
|
68
|
+
},
|
|
42
69
|
{
|
|
43
70
|
class: K.classes.extends_with,
|
|
44
71
|
operations: ['create', 'read', 'traverse', 'delete'],
|
|
45
72
|
},
|
|
46
73
|
],
|
|
47
|
-
authority
|
|
74
|
+
authority: {
|
|
75
|
+
grant: ['create', 'read', 'update', 'delete', 'traverse', 'use', 'revoke'],
|
|
76
|
+
revoke: ['create', 'read', 'update', 'delete', 'traverse', 'use', 'grant'],
|
|
77
|
+
},
|
|
48
78
|
},
|
|
49
79
|
{
|
|
50
80
|
subject: S.core.nodes.member,
|
|
51
|
-
functions:
|
|
81
|
+
functions: [
|
|
82
|
+
K.classes.View.static.methods.resolve,
|
|
83
|
+
K.functions.introspect,
|
|
84
|
+
K.functions.mutate,
|
|
85
|
+
K.functions.query,
|
|
86
|
+
],
|
|
52
87
|
},
|
|
53
88
|
],
|
|
54
89
|
});
|
|
@@ -56,6 +91,6 @@ export const application = defineApplication({
|
|
|
56
91
|
schema: ShellSchema,
|
|
57
92
|
runtime,
|
|
58
93
|
frontend,
|
|
59
|
-
requirements:
|
|
94
|
+
requirements: applicationRequirements,
|
|
60
95
|
});
|
|
61
96
|
export default application;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type WorkflowDefinition } from '@astrale-os/sdk/workflow';
|
|
2
|
-
import type { ShellSchema } from '
|
|
2
|
+
import type { ShellSchema } from '../../schema/index.js';
|
|
3
3
|
export declare const assignGroupUserWorkflow: WorkflowDefinition<typeof ShellSchema, 'Group.assignUser'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WorkflowContext } from '@astrale-os/sdk/workflow';
|
|
2
|
-
import type { S, Shell } from '
|
|
2
|
+
import type { S, Shell } from '../../schema/index.js';
|
|
3
3
|
type GroupCallable = typeof S.classes.Group.self.methods.assignUser | typeof S.classes.Group.self.methods.unassignUser;
|
|
4
4
|
type GroupContext = WorkflowContext<GroupCallable, Shell>;
|
|
5
5
|
export declare function changeMembership(context: GroupContext, present: boolean): Promise<Readonly<Record<never, never>>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type WorkflowDefinition } from '@astrale-os/sdk/workflow';
|
|
2
|
-
import type { ShellSchema } from '
|
|
2
|
+
import type { ShellSchema } from '../../schema/index.js';
|
|
3
3
|
export declare const unassignGroupUserWorkflow: WorkflowDefinition<typeof ShellSchema, 'Group.unassignUser'>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { assignGroupUserWorkflow, unassignGroupUserWorkflow } from '../group/index.js';
|
|
2
|
+
import { setupAdminWorkflow, setupMemberWorkflow } from '../setup/index.js';
|
|
3
|
+
import { addSpaceUserWorkflow, removeSpaceUserWorkflow, setDefaultSpaceWorkflow } from '../space/index.js';
|
|
4
|
+
export declare const workflows: readonly [
|
|
5
|
+
typeof setupAdminWorkflow,
|
|
6
|
+
typeof setupMemberWorkflow,
|
|
7
|
+
typeof assignGroupUserWorkflow,
|
|
8
|
+
typeof unassignGroupUserWorkflow,
|
|
9
|
+
typeof addSpaceUserWorkflow,
|
|
10
|
+
typeof removeSpaceUserWorkflow,
|
|
11
|
+
typeof setDefaultSpaceWorkflow
|
|
12
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { assignGroupUserWorkflow, unassignGroupUserWorkflow } from '#functions/group';
|
|
2
|
+
import { setupAdminWorkflow, setupMemberWorkflow } from '#functions/setup';
|
|
3
|
+
import { addSpaceUserWorkflow, removeSpaceUserWorkflow, setDefaultSpaceWorkflow, } from '#functions/space';
|
|
4
|
+
export const workflows = [
|
|
5
|
+
setupAdminWorkflow,
|
|
6
|
+
setupMemberWorkflow,
|
|
7
|
+
assignGroupUserWorkflow,
|
|
8
|
+
unassignGroupUserWorkflow,
|
|
9
|
+
addSpaceUserWorkflow,
|
|
10
|
+
removeSpaceUserWorkflow,
|
|
11
|
+
setDefaultSpaceWorkflow,
|
|
12
|
+
];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { setupAdminWorkflow } from './admin.js';
|
|
2
2
|
export { setupMemberWorkflow } from './member.js';
|
|
3
|
-
export { planUserSetup, type SetupConflictReason, type SetupPlan, type SetupRole } from './plan.js';
|
|
4
3
|
export { provisioningRequest, provisioningResult } from './provision.js';
|
|
5
4
|
export { runSetup } from './run.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProvisionRequest, ProvisionResult } from '@astrale-os/sdk/auth';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { SetupRole } from '../../rules/user/index.js';
|
|
3
|
+
import type { SetupUserInput, SetupUserResult, Shell } from '../../schema/index.js';
|
|
4
4
|
export declare function provisioningRequest(domain: Shell, input: SetupUserInput, role: SetupRole): ProvisionRequest;
|
|
5
5
|
export declare function provisioningResult(result: ProvisionResult): SetupUserResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WorkflowContext } from '@astrale-os/sdk/workflow';
|
|
2
|
-
import type { S, SetupUserResult, Shell } from '
|
|
3
|
-
import { type SetupRole } from '
|
|
2
|
+
import type { S, SetupUserResult, Shell } from '../../schema/index.js';
|
|
3
|
+
import { type SetupRole } from '../../rules/user/index.js';
|
|
4
4
|
type SetupCallable = typeof S.functions.setupAdmin | typeof S.functions.setupMember;
|
|
5
5
|
type SetupContext = WorkflowContext<SetupCallable, Shell>;
|
|
6
6
|
export declare function runSetup(context: SetupContext, role: SetupRole): Promise<SetupUserResult>;
|
|
@@ -4,7 +4,7 @@ import { InvocationError } from '@astrale-os/sdk/execution';
|
|
|
4
4
|
import { Path } from '@astrale-os/sdk/graph/path';
|
|
5
5
|
import { repairUser } from '#mutations/user';
|
|
6
6
|
import { observeUserSetup } from '#queries/user';
|
|
7
|
-
import { planUserSetup } from '
|
|
7
|
+
import { planUserSetup } from '#rules/user';
|
|
8
8
|
import { provisioningRequest, provisioningResult } from './provision.js';
|
|
9
9
|
export async function runSetup(context, role) {
|
|
10
10
|
const { input, step } = context;
|
|
@@ -42,7 +42,14 @@ async function convergeExisting(context, role, userId, changedBeforeObservation)
|
|
|
42
42
|
changed: changedBeforeObservation,
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
const repaired = await context.step.run('repair-user-setup', () => context.graph.self.mutate(repairUser,
|
|
45
|
+
const repaired = await context.step.run('repair-user-setup', () => context.graph.self.mutate(repairUser, {
|
|
46
|
+
...plan.repair,
|
|
47
|
+
guards: {
|
|
48
|
+
home: observed.home.guard,
|
|
49
|
+
ownedSpaces: observed.ownedSpaces.guard,
|
|
50
|
+
groups: observed.groups.guard,
|
|
51
|
+
},
|
|
52
|
+
}));
|
|
46
53
|
if (repaired.ok) {
|
|
47
54
|
return Object.freeze({ userId, personalSpaceId: repaired.personalSpaceId, changed: true });
|
|
48
55
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WorkflowContext } from '@astrale-os/sdk/workflow';
|
|
2
|
-
import type { S, Shell } from '
|
|
2
|
+
import type { S, Shell } from '../../schema/index.js';
|
|
3
3
|
export type DesiredSpaceAccess = 'member' | 'admin' | null;
|
|
4
4
|
type SpaceAccessCallable = typeof S.classes.Space.self.methods.addUser | typeof S.classes.Space.self.methods.removeUser;
|
|
5
5
|
type SpaceAccessContext = WorkflowContext<SpaceAccessCallable, Shell>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type WorkflowDefinition } from '@astrale-os/sdk/workflow';
|
|
2
|
-
import type { ShellSchema } from '
|
|
2
|
+
import type { ShellSchema } from '../../schema/index.js';
|
|
3
3
|
export declare const addSpaceUserWorkflow: WorkflowDefinition<typeof ShellSchema, 'Space.addUser'>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type WorkflowDefinition } from '@astrale-os/sdk/workflow';
|
|
2
|
-
import type { ShellSchema } from '
|
|
2
|
+
import type { ShellSchema } from '../../schema/index.js';
|
|
3
3
|
export declare const setDefaultSpaceWorkflow: WorkflowDefinition<typeof ShellSchema, 'Space.setDefault'>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type WorkflowDefinition } from '@astrale-os/sdk/workflow';
|
|
2
|
-
import type { ShellSchema } from '
|
|
2
|
+
import type { ShellSchema } from '../../schema/index.js';
|
|
3
3
|
export declare const removeSpaceUserWorkflow: WorkflowDefinition<typeof ShellSchema, 'Space.removeUser'>;
|
|
@@ -2,7 +2,7 @@ import type { NodeId } from '@astrale-os/sdk/graph/node';
|
|
|
2
2
|
import type { QueryPrecondition } from '@astrale-os/sdk/mutation';
|
|
3
3
|
import type { QueryEdgeAST } from '@astrale-os/sdk/query';
|
|
4
4
|
import { type Mutation } from '@astrale-os/sdk/mutation';
|
|
5
|
-
import type { Shell } from '
|
|
5
|
+
import type { Shell } from '../../schema/index.js';
|
|
6
6
|
export interface GroupMembershipChange {
|
|
7
7
|
readonly user: string;
|
|
8
8
|
readonly group: NodeId;
|
|
@@ -2,7 +2,7 @@ import type { NodeId } from '@astrale-os/sdk/graph/node';
|
|
|
2
2
|
import type { QueryPrecondition } from '@astrale-os/sdk/mutation';
|
|
3
3
|
import type { QueryNodeAST } from '@astrale-os/sdk/query';
|
|
4
4
|
import { type Mutation } from '@astrale-os/sdk/mutation';
|
|
5
|
-
import type { Shell } from '
|
|
5
|
+
import type { Shell } from '../../schema/index.js';
|
|
6
6
|
export interface SpaceAccessChange {
|
|
7
7
|
readonly user: string;
|
|
8
8
|
readonly space: NodeId;
|
|
@@ -2,7 +2,7 @@ import type { NodeId } from '@astrale-os/sdk/graph/node';
|
|
|
2
2
|
import type { QueryPrecondition } from '@astrale-os/sdk/mutation';
|
|
3
3
|
import type { QueryNodeAST } from '@astrale-os/sdk/query';
|
|
4
4
|
import { type Mutation } from '@astrale-os/sdk/mutation';
|
|
5
|
-
import type { Shell } from '
|
|
5
|
+
import type { Shell } from '../../schema/index.js';
|
|
6
6
|
export interface DefaultSpaceChange {
|
|
7
7
|
readonly user: NodeId;
|
|
8
8
|
readonly previous?: NodeId;
|
|
@@ -2,27 +2,9 @@ import type { NodeId } from '@astrale-os/sdk/graph/node';
|
|
|
2
2
|
import type { QueryPrecondition } from '@astrale-os/sdk/mutation';
|
|
3
3
|
import type { QueryEdgeAST, QueryNodeAST } from '@astrale-os/sdk/query';
|
|
4
4
|
import { type Mutation } from '@astrale-os/sdk/mutation';
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
readonly currentDisplayName?: string;
|
|
9
|
-
readonly displayName?: string;
|
|
10
|
-
readonly home: {
|
|
11
|
-
readonly kind: 'existing';
|
|
12
|
-
readonly id: NodeId;
|
|
13
|
-
readonly currentName: string;
|
|
14
|
-
readonly name?: string;
|
|
15
|
-
} | {
|
|
16
|
-
readonly kind: 'create';
|
|
17
|
-
readonly name: string;
|
|
18
|
-
};
|
|
19
|
-
readonly addDefault: boolean;
|
|
20
|
-
readonly addOwnership: boolean;
|
|
21
|
-
readonly addMember: boolean;
|
|
22
|
-
readonly addMemberAuthority: boolean;
|
|
23
|
-
readonly addAdmin: boolean;
|
|
24
|
-
readonly addAdminAuthority: boolean;
|
|
25
|
-
readonly removeAdminAuthority: boolean;
|
|
5
|
+
import type { UserSetupRepair } from '../../rules/user/index.js';
|
|
6
|
+
import type { Shell } from '../../schema/index.js';
|
|
7
|
+
export interface UserRepair extends UserSetupRepair {
|
|
26
8
|
readonly guards: {
|
|
27
9
|
readonly home: QueryPrecondition<QueryNodeAST>;
|
|
28
10
|
readonly ownedSpaces: QueryPrecondition<QueryNodeAST>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CompositeQueryDefinition } from '@astrale-os/sdk/query';
|
|
2
|
-
import type { Shell } from '
|
|
2
|
+
import type { Shell } from '../../schema/index.js';
|
|
3
3
|
import { type AdminSpacesObservation } from './admin.js';
|
|
4
4
|
import { type MemberSpacesObservation } from './member.js';
|
|
5
5
|
export interface DirectSpaceAccessObservation {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Node } from '@astrale-os/sdk/graph/node';
|
|
2
2
|
import type { QueryPrecondition } from '@astrale-os/sdk/mutation';
|
|
3
3
|
import type { QueryNodeAST, SingleQueryDefinition } from '@astrale-os/sdk/query';
|
|
4
|
-
import type { Shell } from '
|
|
4
|
+
import type { Shell } from '../../schema/index.js';
|
|
5
5
|
export interface AdminSpacesObservation {
|
|
6
6
|
readonly spaces: readonly Node[];
|
|
7
7
|
readonly guard: QueryPrecondition<QueryNodeAST>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Node } from '@astrale-os/sdk/graph/node';
|
|
2
2
|
import type { QueryPrecondition } from '@astrale-os/sdk/mutation';
|
|
3
3
|
import type { QueryNodeAST, SingleQueryDefinition } from '@astrale-os/sdk/query';
|
|
4
|
-
import type { Shell } from '
|
|
4
|
+
import type { Shell } from '../../schema/index.js';
|
|
5
5
|
export interface MemberSpacesObservation {
|
|
6
6
|
readonly spaces: readonly Node[];
|
|
7
7
|
readonly guard: QueryPrecondition<QueryNodeAST>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Node } from '@astrale-os/sdk/graph/node';
|
|
2
2
|
import type { QueryPrecondition } from '@astrale-os/sdk/mutation';
|
|
3
3
|
import type { QueryEdgeAST, SingleQueryDefinition } from '@astrale-os/sdk/query';
|
|
4
|
-
import type { Shell } from '
|
|
4
|
+
import type { Shell } from '../../schema/index.js';
|
|
5
5
|
export interface UserGroupsObservation {
|
|
6
6
|
readonly groups: readonly Node[];
|
|
7
7
|
readonly authorities: readonly Node[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Node } from '@astrale-os/sdk/graph/node';
|
|
2
2
|
import type { QueryPrecondition } from '@astrale-os/sdk/mutation';
|
|
3
3
|
import type { QueryNodeAST, SingleQueryDefinition } from '@astrale-os/sdk/query';
|
|
4
|
-
import type { Shell } from '
|
|
4
|
+
import type { Shell } from '../../schema/index.js';
|
|
5
5
|
export interface HomeObservation {
|
|
6
6
|
readonly spaces: readonly Node[];
|
|
7
7
|
readonly guard: QueryPrecondition<QueryNodeAST>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Node } from '@astrale-os/sdk/graph/node';
|
|
2
2
|
import type { QueryPrecondition } from '@astrale-os/sdk/mutation';
|
|
3
3
|
import type { QueryNodeAST, SingleQueryDefinition } from '@astrale-os/sdk/query';
|
|
4
|
-
import type { Shell } from '
|
|
4
|
+
import type { Shell } from '../../schema/index.js';
|
|
5
5
|
export interface OwnedSpacesObservation {
|
|
6
6
|
readonly spaces: readonly Node[];
|
|
7
7
|
readonly guard: QueryPrecondition<QueryNodeAST>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Node } from '@astrale-os/sdk/graph/node';
|
|
2
2
|
import { type SingleQueryDefinition } from '@astrale-os/sdk/query';
|
|
3
|
-
import type { Shell } from '
|
|
3
|
+
import type { Shell } from '../../schema/index.js';
|
|
4
4
|
export declare const readUserProfile: SingleQueryDefinition<Shell, string, Node>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Node } from '@astrale-os/sdk/graph/node';
|
|
2
2
|
import { type CompositeQueryDefinition } from '@astrale-os/sdk/query';
|
|
3
|
-
import type { Shell } from '
|
|
3
|
+
import type { Shell } from '../../schema/index.js';
|
|
4
4
|
import type { UserGroupsObservation } from './groups.js';
|
|
5
5
|
import { type HomeObservation } from './home.js';
|
|
6
6
|
import { type OwnedSpacesObservation } from './owned-spaces.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { planUserSetup, type SetupConflictReason, type SetupPlan, type SetupRole, type UserSetupRepair, } from './setup.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { planUserSetup, } from './setup.js';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Node } from '@astrale-os/sdk/graph/node';
|
|
2
|
+
import type { UserSetupObservation } from '../../queries/user/index.js';
|
|
3
|
+
import type { SetupUserInput, Shell } from '../../schema/index.js';
|
|
4
|
+
export type SetupRole = 'member' | 'admin';
|
|
5
|
+
export type SetupPlan = {
|
|
6
|
+
readonly kind: 'conflict';
|
|
7
|
+
readonly reason: SetupConflictReason;
|
|
8
|
+
readonly message: string;
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'unchanged';
|
|
11
|
+
readonly personalSpaceId: Node['id'];
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'repair';
|
|
14
|
+
readonly repair: UserSetupRepair;
|
|
15
|
+
};
|
|
16
|
+
export interface UserSetupRepair {
|
|
17
|
+
readonly userId: Node['id'];
|
|
18
|
+
readonly currentDisplayName?: string;
|
|
19
|
+
readonly displayName?: string;
|
|
20
|
+
readonly home: {
|
|
21
|
+
readonly kind: 'existing';
|
|
22
|
+
readonly id: Node['id'];
|
|
23
|
+
readonly currentName: string;
|
|
24
|
+
readonly name?: string;
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'create';
|
|
27
|
+
readonly name: string;
|
|
28
|
+
};
|
|
29
|
+
readonly addDefault: boolean;
|
|
30
|
+
readonly addOwnership: boolean;
|
|
31
|
+
readonly addMember: boolean;
|
|
32
|
+
readonly addMemberAuthority: boolean;
|
|
33
|
+
readonly addAdmin: boolean;
|
|
34
|
+
readonly addAdminAuthority: boolean;
|
|
35
|
+
readonly removeAdminAuthority: boolean;
|
|
36
|
+
}
|
|
37
|
+
export type SetupConflictReason = 'IDENTITY_CLASS_CONFLICT' | 'IDENTITY_FACT_CONFLICT' | 'MULTIPLE_DEFAULT_SPACES' | 'DEFAULT_SPACE_CLASS_CONFLICT' | 'AMBIGUOUS_PERSONAL_SPACE';
|
|
38
|
+
export declare function planUserSetup(domain: Shell, input: SetupUserInput, role: SetupRole, observation: UserSetupObservation): SetupPlan;
|
|
@@ -82,11 +82,6 @@ export function planUserSetup(domain, input, role, observation) {
|
|
|
82
82
|
addAdmin,
|
|
83
83
|
addAdminAuthority,
|
|
84
84
|
removeAdminAuthority,
|
|
85
|
-
guards: Object.freeze({
|
|
86
|
-
home: observation.home.guard,
|
|
87
|
-
ownedSpaces: observation.ownedSpaces.guard,
|
|
88
|
-
groups: observation.groups.guard,
|
|
89
|
-
}),
|
|
90
85
|
}),
|
|
91
86
|
});
|
|
92
87
|
}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { type Runtime } from '@astrale-os/sdk/runtime';
|
|
2
|
+
import { workflows } from './functions/registry/index.js';
|
|
3
|
+
import { actions } from './functions/user/index.js';
|
|
2
4
|
import type { ShellSchema } from './schema/index.js';
|
|
3
5
|
declare const integrations: {};
|
|
4
6
|
declare const initialize: () => {
|
|
5
7
|
providers: {};
|
|
6
8
|
};
|
|
7
|
-
declare const
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
declare const runtime: Runtime<typeof ShellSchema, typeof integrations, typeof initialize, [
|
|
10
|
+
...typeof actions,
|
|
11
|
+
...typeof workflows
|
|
12
|
+
]>;
|
|
10
13
|
export default runtime;
|