@astrale-domains/shell 0.1.0-beta.4 → 0.1.0-beta.8
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/actions/index.js +1 -0
- package/dist/actions/user/index.js +1 -0
- package/dist/actions/user/resolve-home.js +19 -0
- package/dist/application.d.ts +5 -0
- package/dist/application.js +29 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.js +3 -4
- package/dist/mutations/group/index.js +1 -2
- package/dist/mutations/group/membership.js +19 -69
- package/dist/mutations/space/access.js +23 -52
- package/dist/mutations/space/default.js +23 -44
- package/dist/mutations/space/index.js +2 -3
- package/dist/mutations/user/index.js +1 -2
- package/dist/mutations/user/repair.js +85 -0
- package/dist/queries/space/access.js +13 -92
- package/dist/queries/space/admin.js +27 -0
- package/dist/queries/space/index.js +3 -3
- package/dist/queries/space/member.js +24 -0
- package/dist/queries/user/groups.js +24 -0
- package/dist/queries/user/home.js +28 -0
- package/dist/queries/user/index.js +5 -0
- package/dist/queries/user/owned-spaces.js +24 -0
- package/dist/queries/user/profile.js +17 -0
- package/dist/queries/user/setup.js +18 -0
- package/dist/runtime.d.ts +4 -0
- package/dist/runtime.js +18 -0
- package/dist/schema/domain/index.d.ts +26385 -8837
- package/dist/schema/domain/index.js +26 -42
- package/dist/schema/group/class.d.ts +3258 -29
- package/dist/schema/group/class.js +2 -6
- package/dist/schema/group/core.d.ts +9 -490
- package/dist/schema/group/core.js +7 -13
- package/dist/schema/group/index.d.ts +2 -3
- package/dist/schema/group/index.js +2 -3
- package/dist/schema/group/methods.d.ts +2028 -17
- package/dist/schema/group/methods.js +7 -7
- package/dist/schema/group/policies.d.ts +1 -3
- package/dist/schema/group/policies.js +5 -6
- package/dist/schema/group/relationships.d.ts +4264 -244
- package/dist/schema/group/relationships.js +2 -14
- package/dist/schema/group/view.d.ts +3258 -29
- package/dist/schema/group/view.js +0 -1
- package/dist/schema/home/index.d.ts +0 -1
- package/dist/schema/home/index.js +0 -1
- package/dist/schema/home/view.d.ts +0 -1
- package/dist/schema/home/view.js +0 -1
- package/dist/schema/index.d.ts +4 -5
- package/dist/schema/index.js +4 -5
- package/dist/schema/setup/functions.d.ts +47 -0
- package/dist/schema/setup/functions.js +27 -0
- package/dist/schema/setup/index.d.ts +1 -0
- package/dist/schema/setup/index.js +1 -0
- package/dist/schema/space/class.d.ts +2263 -24
- package/dist/schema/space/class.js +2 -6
- package/dist/schema/space/core.d.ts +22235 -710
- package/dist/schema/space/core.js +6 -8
- package/dist/schema/space/index.d.ts +0 -1
- package/dist/schema/space/index.js +0 -1
- package/dist/schema/space/methods.d.ts +2027 -16
- package/dist/schema/space/methods.js +7 -8
- package/dist/schema/space/policies.d.ts +1 -2
- package/dist/schema/space/policies.js +17 -11
- package/dist/schema/space/relationships.d.ts +22980 -826
- package/dist/schema/space/relationships.js +5 -6
- package/dist/schema/space/view.d.ts +2264 -25
- package/dist/schema/space/view.js +1 -2
- package/dist/schema/user/class.d.ts +1013 -10
- package/dist/schema/user/class.js +9 -5
- package/dist/schema/user/index.d.ts +1 -4
- package/dist/schema/user/index.js +1 -4
- package/dist/schema/user/methods.d.ts +14 -0
- package/dist/schema/user/methods.js +11 -0
- package/dist/schema/user/view.d.ts +1012 -10
- package/dist/schema/user/view.js +0 -1
- package/dist/workflows/group/assign.js +3 -0
- package/dist/workflows/group/change.js +31 -0
- package/dist/workflows/group/index.js +3 -4
- package/dist/workflows/group/unassign.js +3 -0
- package/dist/workflows/index.js +3 -4
- package/dist/workflows/setup/admin.js +3 -0
- package/dist/workflows/setup/index.js +5 -0
- package/dist/workflows/setup/member.js +3 -0
- package/dist/workflows/setup/plan.js +88 -0
- package/dist/workflows/setup/provision.js +57 -0
- package/dist/workflows/setup/run.js +74 -0
- package/dist/workflows/space/access.js +41 -0
- package/dist/workflows/space/add.js +3 -0
- package/dist/workflows/space/default.js +37 -0
- package/dist/workflows/space/index.js +4 -4
- package/dist/workflows/space/remove.js +3 -0
- package/package.json +13 -32
- package/dist/functions/application/index.d.ts +0 -3
- package/dist/functions/application/index.d.ts.map +0 -1
- package/dist/functions/application/index.js +0 -3
- package/dist/functions/application/index.js.map +0 -1
- package/dist/functions/application/install.d.ts +0 -4
- package/dist/functions/application/install.d.ts.map +0 -1
- package/dist/functions/application/install.js +0 -11
- package/dist/functions/application/install.js.map +0 -1
- package/dist/functions/application/uninstall.d.ts +0 -5
- package/dist/functions/application/uninstall.d.ts.map +0 -1
- package/dist/functions/application/uninstall.js +0 -11
- package/dist/functions/application/uninstall.js.map +0 -1
- package/dist/functions/execution/index.d.ts +0 -15
- package/dist/functions/execution/index.d.ts.map +0 -1
- package/dist/functions/execution/index.js +0 -2
- package/dist/functions/execution/index.js.map +0 -1
- package/dist/functions/group/assign-user.d.ts +0 -5
- package/dist/functions/group/assign-user.d.ts.map +0 -1
- package/dist/functions/group/assign-user.js +0 -11
- package/dist/functions/group/assign-user.js.map +0 -1
- package/dist/functions/group/index.d.ts +0 -3
- package/dist/functions/group/index.d.ts.map +0 -1
- package/dist/functions/group/index.js +0 -3
- package/dist/functions/group/index.js.map +0 -1
- package/dist/functions/group/unassign-user.d.ts +0 -5
- package/dist/functions/group/unassign-user.d.ts.map +0 -1
- package/dist/functions/group/unassign-user.js +0 -11
- package/dist/functions/group/unassign-user.js.map +0 -1
- package/dist/functions/index.d.ts +0 -6
- package/dist/functions/index.d.ts.map +0 -1
- package/dist/functions/index.js +0 -6
- package/dist/functions/index.js.map +0 -1
- package/dist/functions/space/add-user.d.ts +0 -5
- package/dist/functions/space/add-user.d.ts.map +0 -1
- package/dist/functions/space/add-user.js +0 -11
- package/dist/functions/space/add-user.js.map +0 -1
- package/dist/functions/space/index.d.ts +0 -4
- package/dist/functions/space/index.d.ts.map +0 -1
- package/dist/functions/space/index.js +0 -4
- package/dist/functions/space/index.js.map +0 -1
- package/dist/functions/space/remove-user.d.ts +0 -5
- package/dist/functions/space/remove-user.d.ts.map +0 -1
- package/dist/functions/space/remove-user.js +0 -11
- package/dist/functions/space/remove-user.js.map +0 -1
- package/dist/functions/space/set-default.d.ts +0 -6
- package/dist/functions/space/set-default.d.ts.map +0 -1
- package/dist/functions/space/set-default.js +0 -11
- package/dist/functions/space/set-default.js.map +0 -1
- package/dist/functions/user/administrator.d.ts +0 -4
- package/dist/functions/user/administrator.d.ts.map +0 -1
- package/dist/functions/user/administrator.js +0 -39
- package/dist/functions/user/administrator.js.map +0 -1
- package/dist/functions/user/ensure.d.ts +0 -18
- package/dist/functions/user/ensure.d.ts.map +0 -1
- package/dist/functions/user/ensure.js +0 -49
- package/dist/functions/user/ensure.js.map +0 -1
- package/dist/functions/user/index.d.ts +0 -3
- package/dist/functions/user/index.d.ts.map +0 -1
- package/dist/functions/user/index.js +0 -3
- package/dist/functions/user/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mutations/application/association.d.ts +0 -14
- package/dist/mutations/application/association.d.ts.map +0 -1
- package/dist/mutations/application/association.js +0 -46
- package/dist/mutations/application/association.js.map +0 -1
- package/dist/mutations/application/errors.d.ts +0 -5
- package/dist/mutations/application/errors.d.ts.map +0 -1
- package/dist/mutations/application/errors.js +0 -2
- package/dist/mutations/application/errors.js.map +0 -1
- package/dist/mutations/application/index.d.ts +0 -4
- package/dist/mutations/application/index.d.ts.map +0 -1
- package/dist/mutations/application/index.js +0 -3
- package/dist/mutations/application/index.js.map +0 -1
- package/dist/mutations/application/removal.d.ts +0 -6
- package/dist/mutations/application/removal.d.ts.map +0 -1
- package/dist/mutations/application/removal.js +0 -17
- package/dist/mutations/application/removal.js.map +0 -1
- package/dist/mutations/group/errors.d.ts +0 -5
- package/dist/mutations/group/errors.d.ts.map +0 -1
- package/dist/mutations/group/errors.js +0 -2
- package/dist/mutations/group/errors.js.map +0 -1
- package/dist/mutations/group/index.d.ts +0 -3
- package/dist/mutations/group/index.d.ts.map +0 -1
- package/dist/mutations/group/index.js.map +0 -1
- package/dist/mutations/group/membership.d.ts +0 -26
- package/dist/mutations/group/membership.d.ts.map +0 -1
- package/dist/mutations/group/membership.js.map +0 -1
- package/dist/mutations/index.d.ts +0 -4
- package/dist/mutations/index.d.ts.map +0 -1
- package/dist/mutations/index.js +0 -4
- package/dist/mutations/index.js.map +0 -1
- package/dist/mutations/space/access.d.ts +0 -30
- package/dist/mutations/space/access.d.ts.map +0 -1
- package/dist/mutations/space/access.js.map +0 -1
- package/dist/mutations/space/default.d.ts +0 -26
- package/dist/mutations/space/default.d.ts.map +0 -1
- package/dist/mutations/space/default.js.map +0 -1
- package/dist/mutations/space/errors.d.ts +0 -5
- package/dist/mutations/space/errors.d.ts.map +0 -1
- package/dist/mutations/space/errors.js +0 -2
- package/dist/mutations/space/errors.js.map +0 -1
- package/dist/mutations/space/index.d.ts +0 -4
- package/dist/mutations/space/index.d.ts.map +0 -1
- package/dist/mutations/space/index.js.map +0 -1
- package/dist/mutations/user/index.d.ts +0 -1
- package/dist/mutations/user/index.d.ts.map +0 -1
- package/dist/mutations/user/index.js.map +0 -1
- package/dist/public.d.ts +0 -5
- package/dist/public.d.ts.map +0 -1
- package/dist/public.js +0 -154
- package/dist/public.js.map +0 -1
- package/dist/queries/application/association.d.ts +0 -18
- package/dist/queries/application/association.d.ts.map +0 -1
- package/dist/queries/application/association.js +0 -82
- package/dist/queries/application/association.js.map +0 -1
- package/dist/queries/application/identity.d.ts +0 -4
- package/dist/queries/application/identity.d.ts.map +0 -1
- package/dist/queries/application/identity.js +0 -41
- package/dist/queries/application/identity.js.map +0 -1
- package/dist/queries/application/index.d.ts +0 -3
- package/dist/queries/application/index.d.ts.map +0 -1
- package/dist/queries/application/index.js +0 -3
- package/dist/queries/application/index.js.map +0 -1
- package/dist/queries/group/identity.d.ts +0 -3
- package/dist/queries/group/identity.d.ts.map +0 -1
- package/dist/queries/group/identity.js +0 -29
- package/dist/queries/group/identity.js.map +0 -1
- package/dist/queries/group/index.d.ts +0 -3
- package/dist/queries/group/index.d.ts.map +0 -1
- package/dist/queries/group/index.js +0 -3
- package/dist/queries/group/index.js.map +0 -1
- package/dist/queries/group/membership.d.ts +0 -17
- package/dist/queries/group/membership.d.ts.map +0 -1
- package/dist/queries/group/membership.js +0 -47
- package/dist/queries/group/membership.js.map +0 -1
- package/dist/queries/index.d.ts +0 -4
- package/dist/queries/index.d.ts.map +0 -1
- package/dist/queries/index.js +0 -4
- package/dist/queries/index.js.map +0 -1
- package/dist/queries/space/access.d.ts +0 -24
- package/dist/queries/space/access.d.ts.map +0 -1
- package/dist/queries/space/access.js.map +0 -1
- package/dist/queries/space/default.d.ts +0 -10
- package/dist/queries/space/default.d.ts.map +0 -1
- package/dist/queries/space/default.js +0 -25
- package/dist/queries/space/default.js.map +0 -1
- package/dist/queries/space/index.d.ts +0 -3
- package/dist/queries/space/index.d.ts.map +0 -1
- package/dist/queries/space/index.js.map +0 -1
- package/dist/rules/application/association.d.ts +0 -13
- package/dist/rules/application/association.d.ts.map +0 -1
- package/dist/rules/application/association.js +0 -10
- package/dist/rules/application/association.js.map +0 -1
- package/dist/rules/application/index.d.ts +0 -4
- package/dist/rules/application/index.d.ts.map +0 -1
- package/dist/rules/application/index.js +0 -4
- package/dist/rules/application/index.js.map +0 -1
- package/dist/rules/application/removal.d.ts +0 -11
- package/dist/rules/application/removal.d.ts.map +0 -1
- package/dist/rules/application/removal.js +0 -6
- package/dist/rules/application/removal.js.map +0 -1
- package/dist/rules/application/result.d.ts +0 -8
- package/dist/rules/application/result.d.ts.map +0 -1
- package/dist/rules/application/result.js +0 -17
- package/dist/rules/application/result.js.map +0 -1
- package/dist/rules/group/index.d.ts +0 -2
- package/dist/rules/group/index.d.ts.map +0 -1
- package/dist/rules/group/index.js +0 -2
- package/dist/rules/group/index.js.map +0 -1
- package/dist/rules/group/membership.d.ts +0 -5
- package/dist/rules/group/membership.d.ts.map +0 -1
- package/dist/rules/group/membership.js +0 -12
- package/dist/rules/group/membership.js.map +0 -1
- package/dist/rules/index.d.ts +0 -5
- package/dist/rules/index.d.ts.map +0 -1
- package/dist/rules/index.js +0 -5
- package/dist/rules/index.js.map +0 -1
- package/dist/rules/space/access.d.ts +0 -8
- package/dist/rules/space/access.d.ts.map +0 -1
- package/dist/rules/space/access.js +0 -18
- package/dist/rules/space/access.js.map +0 -1
- package/dist/rules/space/default.d.ts +0 -4
- package/dist/rules/space/default.d.ts.map +0 -1
- package/dist/rules/space/default.js +0 -7
- package/dist/rules/space/default.js.map +0 -1
- package/dist/rules/space/index.d.ts +0 -3
- package/dist/rules/space/index.d.ts.map +0 -1
- package/dist/rules/space/index.js +0 -3
- package/dist/rules/space/index.js.map +0 -1
- package/dist/rules/user/ensure.d.ts +0 -21
- package/dist/rules/user/ensure.d.ts.map +0 -1
- package/dist/rules/user/ensure.js +0 -61
- package/dist/rules/user/ensure.js.map +0 -1
- package/dist/rules/user/grant.d.ts +0 -13
- package/dist/rules/user/grant.d.ts.map +0 -1
- package/dist/rules/user/grant.js +0 -12
- package/dist/rules/user/grant.js.map +0 -1
- package/dist/rules/user/index.d.ts +0 -3
- package/dist/rules/user/index.d.ts.map +0 -1
- package/dist/rules/user/index.js +0 -3
- package/dist/rules/user/index.js.map +0 -1
- package/dist/schema/application/class.d.ts +0 -152
- package/dist/schema/application/class.d.ts.map +0 -1
- package/dist/schema/application/class.js +0 -10
- package/dist/schema/application/class.js.map +0 -1
- package/dist/schema/application/core.d.ts +0 -159
- package/dist/schema/application/core.d.ts.map +0 -1
- package/dist/schema/application/core.js +0 -13
- package/dist/schema/application/core.js.map +0 -1
- package/dist/schema/application/index.d.ts +0 -7
- package/dist/schema/application/index.d.ts.map +0 -1
- package/dist/schema/application/index.js +0 -7
- package/dist/schema/application/index.js.map +0 -1
- package/dist/schema/application/methods.d.ts +0 -171
- package/dist/schema/application/methods.d.ts.map +0 -1
- package/dist/schema/application/methods.js +0 -48
- package/dist/schema/application/methods.js.map +0 -1
- package/dist/schema/application/policies.d.ts +0 -3
- package/dist/schema/application/policies.d.ts.map +0 -1
- package/dist/schema/application/policies.js +0 -11
- package/dist/schema/application/policies.js.map +0 -1
- package/dist/schema/application/relationships.d.ts +0 -795
- package/dist/schema/application/relationships.d.ts.map +0 -1
- package/dist/schema/application/relationships.js +0 -20
- package/dist/schema/application/relationships.js.map +0 -1
- package/dist/schema/application/view.d.ts +0 -155
- package/dist/schema/application/view.d.ts.map +0 -1
- package/dist/schema/application/view.js +0 -7
- package/dist/schema/application/view.js.map +0 -1
- package/dist/schema/domain/index.d.ts.map +0 -1
- package/dist/schema/domain/index.js.map +0 -1
- package/dist/schema/group/class.d.ts.map +0 -1
- package/dist/schema/group/class.js.map +0 -1
- package/dist/schema/group/core.d.ts.map +0 -1
- package/dist/schema/group/core.js.map +0 -1
- package/dist/schema/group/index.d.ts.map +0 -1
- package/dist/schema/group/index.js.map +0 -1
- package/dist/schema/group/methods.d.ts.map +0 -1
- package/dist/schema/group/methods.js.map +0 -1
- package/dist/schema/group/policies.d.ts.map +0 -1
- package/dist/schema/group/policies.js.map +0 -1
- package/dist/schema/group/relationships.d.ts.map +0 -1
- package/dist/schema/group/relationships.js.map +0 -1
- package/dist/schema/group/view.d.ts.map +0 -1
- package/dist/schema/group/view.js.map +0 -1
- package/dist/schema/home/index.d.ts.map +0 -1
- package/dist/schema/home/index.js.map +0 -1
- package/dist/schema/home/view.d.ts.map +0 -1
- package/dist/schema/home/view.js.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/space/class.d.ts.map +0 -1
- package/dist/schema/space/class.js.map +0 -1
- package/dist/schema/space/core.d.ts.map +0 -1
- package/dist/schema/space/core.js.map +0 -1
- package/dist/schema/space/index.d.ts.map +0 -1
- package/dist/schema/space/index.js.map +0 -1
- package/dist/schema/space/methods.d.ts.map +0 -1
- package/dist/schema/space/methods.js.map +0 -1
- package/dist/schema/space/policies.d.ts.map +0 -1
- package/dist/schema/space/policies.js.map +0 -1
- package/dist/schema/space/relationships.d.ts.map +0 -1
- package/dist/schema/space/relationships.js.map +0 -1
- package/dist/schema/space/view.d.ts.map +0 -1
- package/dist/schema/space/view.js.map +0 -1
- package/dist/schema/user/administrator.d.ts +0 -30
- package/dist/schema/user/administrator.d.ts.map +0 -1
- package/dist/schema/user/administrator.js +0 -19
- package/dist/schema/user/administrator.js.map +0 -1
- package/dist/schema/user/class.d.ts.map +0 -1
- package/dist/schema/user/class.js.map +0 -1
- package/dist/schema/user/ensure.d.ts +0 -37
- package/dist/schema/user/ensure.d.ts.map +0 -1
- package/dist/schema/user/ensure.js +0 -28
- package/dist/schema/user/ensure.js.map +0 -1
- package/dist/schema/user/index.d.ts.map +0 -1
- package/dist/schema/user/index.js.map +0 -1
- package/dist/schema/user/interface.d.ts +0 -10
- package/dist/schema/user/interface.d.ts.map +0 -1
- package/dist/schema/user/interface.js +0 -12
- package/dist/schema/user/interface.js.map +0 -1
- package/dist/schema/user/view.d.ts.map +0 -1
- package/dist/schema/user/view.js.map +0 -1
- package/dist/tests/cross-layer/public.test.d.ts +0 -2
- package/dist/tests/cross-layer/public.test.d.ts.map +0 -1
- package/dist/tests/cross-layer/public.test.js +0 -70
- package/dist/tests/cross-layer/public.test.js.map +0 -1
- package/dist/tests/cross-layer/workflows.test.d.ts +0 -2
- package/dist/tests/cross-layer/workflows.test.d.ts.map +0 -1
- package/dist/tests/cross-layer/workflows.test.js +0 -290
- package/dist/tests/cross-layer/workflows.test.js.map +0 -1
- package/dist/tests/index.d.ts +0 -3
- package/dist/tests/index.d.ts.map +0 -1
- package/dist/tests/index.js +0 -3
- package/dist/tests/index.js.map +0 -1
- package/dist/utils/graph-endpoint/index.d.ts +0 -13
- package/dist/utils/graph-endpoint/index.d.ts.map +0 -1
- package/dist/utils/graph-endpoint/index.js +0 -6
- package/dist/utils/graph-endpoint/index.js.map +0 -1
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -3
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/query-page/index.d.ts +0 -3
- package/dist/utils/query-page/index.d.ts.map +0 -1
- package/dist/utils/query-page/index.js +0 -2
- package/dist/utils/query-page/index.js.map +0 -1
- package/dist/utils/query-page/nodes.d.ts +0 -16
- package/dist/utils/query-page/nodes.d.ts.map +0 -1
- package/dist/utils/query-page/nodes.js +0 -22
- package/dist/utils/query-page/nodes.js.map +0 -1
- package/dist/workflows/application/errors.d.ts +0 -5
- package/dist/workflows/application/errors.d.ts.map +0 -1
- package/dist/workflows/application/errors.js +0 -25
- package/dist/workflows/application/errors.js.map +0 -1
- package/dist/workflows/application/index.d.ts +0 -3
- package/dist/workflows/application/index.d.ts.map +0 -1
- package/dist/workflows/application/index.js +0 -3
- package/dist/workflows/application/index.js.map +0 -1
- package/dist/workflows/application/install.d.ts +0 -3
- package/dist/workflows/application/install.d.ts.map +0 -1
- package/dist/workflows/application/install.js +0 -37
- package/dist/workflows/application/install.js.map +0 -1
- package/dist/workflows/application/uninstall.d.ts +0 -4
- package/dist/workflows/application/uninstall.d.ts.map +0 -1
- package/dist/workflows/application/uninstall.js +0 -25
- package/dist/workflows/application/uninstall.js.map +0 -1
- package/dist/workflows/group/assign-user.d.ts +0 -8
- package/dist/workflows/group/assign-user.d.ts.map +0 -1
- package/dist/workflows/group/assign-user.js +0 -32
- package/dist/workflows/group/assign-user.js.map +0 -1
- package/dist/workflows/group/ensure-administrator.d.ts +0 -4
- package/dist/workflows/group/ensure-administrator.d.ts.map +0 -1
- package/dist/workflows/group/ensure-administrator.js +0 -26
- package/dist/workflows/group/ensure-administrator.js.map +0 -1
- package/dist/workflows/group/errors.d.ts +0 -2
- package/dist/workflows/group/errors.d.ts.map +0 -1
- package/dist/workflows/group/errors.js +0 -7
- package/dist/workflows/group/errors.js.map +0 -1
- package/dist/workflows/group/index.d.ts +0 -4
- package/dist/workflows/group/index.d.ts.map +0 -1
- package/dist/workflows/group/index.js.map +0 -1
- package/dist/workflows/group/unassign-user.d.ts +0 -8
- package/dist/workflows/group/unassign-user.d.ts.map +0 -1
- package/dist/workflows/group/unassign-user.js +0 -32
- package/dist/workflows/group/unassign-user.js.map +0 -1
- package/dist/workflows/index.d.ts +0 -4
- package/dist/workflows/index.d.ts.map +0 -1
- package/dist/workflows/index.js.map +0 -1
- package/dist/workflows/space/add-user.d.ts +0 -8
- package/dist/workflows/space/add-user.d.ts.map +0 -1
- package/dist/workflows/space/add-user.js +0 -34
- package/dist/workflows/space/add-user.js.map +0 -1
- package/dist/workflows/space/errors.d.ts +0 -3
- package/dist/workflows/space/errors.d.ts.map +0 -1
- package/dist/workflows/space/errors.js +0 -10
- package/dist/workflows/space/errors.js.map +0 -1
- package/dist/workflows/space/index.d.ts +0 -4
- package/dist/workflows/space/index.d.ts.map +0 -1
- package/dist/workflows/space/index.js.map +0 -1
- package/dist/workflows/space/remove-user.d.ts +0 -8
- package/dist/workflows/space/remove-user.d.ts.map +0 -1
- package/dist/workflows/space/remove-user.js +0 -62
- package/dist/workflows/space/remove-user.js.map +0 -1
- package/dist/workflows/space/set-default.d.ts +0 -9
- package/dist/workflows/space/set-default.d.ts.map +0 -1
- package/dist/workflows/space/set-default.js +0 -43
- package/dist/workflows/space/set-default.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './user/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { resolveHomeAction } from './resolve-home.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineAction } from '@astrale-os/sdk/action';
|
|
2
|
+
import { InvocationError } from '@astrale-os/sdk/execution';
|
|
3
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
4
|
+
import { observeHome } from '#queries/user';
|
|
5
|
+
export const resolveHomeAction = defineAction()('User.resolveHome', async ({ domain, query, self }) => {
|
|
6
|
+
const observed = await query(observeHome(domain), Path.id(self).raw);
|
|
7
|
+
if (observed.spaces.length > 1) {
|
|
8
|
+
throw new InvocationError('CONFLICT', 'The Shell User has more than one default Space.', {
|
|
9
|
+
reason: { code: 'MULTIPLE_DEFAULT_SPACES', details: {} },
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
const home = observed.spaces[0];
|
|
13
|
+
if (home !== undefined && home.class !== domain.classes.Space.key) {
|
|
14
|
+
throw new InvocationError('CONFLICT', 'The Shell User default target is not a Shell Space.', {
|
|
15
|
+
reason: { code: 'DEFAULT_SPACE_CLASS_CONFLICT', details: {} },
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return Object.freeze({ userId: self, personalSpaceId: home?.id ?? null });
|
|
19
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const frontend: import("@astrale-os/sdk/view").Frontend<import("@astrale-os/sdk/schema").DomainSchema<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput, import("@astrale-os/sdk/schema").DomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>>;
|
|
2
|
+
export declare const application: import("@astrale-os/sdk/application").Application<import("@astrale-os/sdk/schema").DomainSchema<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput, import("@astrale-os/sdk/schema").DomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>, import("@astrale-os/sdk/runtime").Runtime<import("@astrale-os/sdk/schema").DomainSchema<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput, import("@astrale-os/sdk/schema").DomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>, {}, () => {
|
|
3
|
+
providers: {};
|
|
4
|
+
}, readonly [import("@astrale-os/sdk/action").ActionDefinition<import("@astrale-os/sdk/schema").DomainSchema<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput, import("@astrale-os/sdk/schema").DomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>, "User.resolveHome", Readonly<Record<never, never>>>], readonly [import("@astrale-os/sdk/workflow").WorkflowDefinition<import("@astrale-os/sdk/schema").DomainSchema<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput, import("@astrale-os/sdk/schema").DomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>, "setupAdmin", Readonly<Record<never, never>>>, import("@astrale-os/sdk/workflow").WorkflowDefinition<import("@astrale-os/sdk/schema").DomainSchema<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput, import("@astrale-os/sdk/schema").DomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>, "setupMember", Readonly<Record<never, never>>>, import("@astrale-os/sdk/workflow").WorkflowDefinition<import("@astrale-os/sdk/schema").DomainSchema<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput, import("@astrale-os/sdk/schema").DomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>, "Group.assignUser", Readonly<Record<never, never>>>, import("@astrale-os/sdk/workflow").WorkflowDefinition<import("@astrale-os/sdk/schema").DomainSchema<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput, import("@astrale-os/sdk/schema").DomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>, "Group.unassignUser", Readonly<Record<never, never>>>, import("@astrale-os/sdk/workflow").WorkflowDefinition<import("@astrale-os/sdk/schema").DomainSchema<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput, import("@astrale-os/sdk/schema").DomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>, "Space.addUser", Readonly<Record<never, never>>>, import("@astrale-os/sdk/workflow").WorkflowDefinition<import("@astrale-os/sdk/schema").DomainSchema<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput, import("@astrale-os/sdk/schema").DomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>, "Space.removeUser", Readonly<Record<never, never>>>, import("@astrale-os/sdk/workflow").WorkflowDefinition<import("@astrale-os/sdk/schema").DomainSchema<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput, import("@astrale-os/sdk/schema").DomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>, "Space.setDefault", Readonly<Record<never, never>>>]>, import("@astrale-os/sdk/view").Frontend<import("@astrale-os/sdk/schema").DomainSchema<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput, import("@astrale-os/sdk/schema").DomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>>, undefined, import("@astrale-os/sdk/application").Requirements>;
|
|
5
|
+
export default application;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineApplication, defineFrontend, external, requirements, } from '@astrale-os/sdk/application';
|
|
2
|
+
import { K } from '@astrale-os/sdk/schema';
|
|
3
|
+
import runtime from './runtime.js';
|
|
4
|
+
import { ShellSchema } from './schema/index.js';
|
|
5
|
+
export const frontend = defineFrontend({
|
|
6
|
+
schema: ShellSchema,
|
|
7
|
+
source: external('https://app.astrale.ai'),
|
|
8
|
+
routes: {
|
|
9
|
+
group: '/groups',
|
|
10
|
+
home: '/',
|
|
11
|
+
space: '/spaces',
|
|
12
|
+
user: '/users',
|
|
13
|
+
},
|
|
14
|
+
entrypoint: 'home',
|
|
15
|
+
});
|
|
16
|
+
export const application = defineApplication({
|
|
17
|
+
schema: ShellSchema,
|
|
18
|
+
runtime,
|
|
19
|
+
frontend,
|
|
20
|
+
requirements: requirements({
|
|
21
|
+
callables: [
|
|
22
|
+
K.classes.Identity.static.methods.whois,
|
|
23
|
+
K.functions.provision,
|
|
24
|
+
K.functions.query,
|
|
25
|
+
K.functions.mutate,
|
|
26
|
+
],
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
export default application;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { Group, ORIGIN, S, ShellCore, ShellSchema, Space, User, adminGroup, administers_space, belongsToSpace, default_space, defaultSpace, groupAssignUser, groupCore, groupUnassignUser, groupView, homeView, mayAdministerSpace, maySetupUsers, memberGroup, member_of_group, member_of_space, owns_space, ownsSpace, resolveHome, setupAdmin, setupMember, spaceAddUser, spaceCore, spaceRemoveUser, spaceSetDefault, spaceView, userView, type GroupMembershipInput, type GroupMembershipResult, type ResolveHomeResult, type SetDefaultSpaceInput, type SetDefaultSpaceResult, type SetupUserInput, type SetupUserResult, type Shell, type SpaceUserAccess, type SpaceUserAccessInput, type SpaceUserAccessResult, type SpaceUserInput, type SpaceUserResult, } from '#schema';
|
|
2
|
+
export { application } from './application.js';
|
|
3
|
+
export { default as runtime } from './runtime.js';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { Group, ORIGIN, S, ShellCore, ShellSchema, Space, User, adminGroup, administers_space, belongsToSpace, default_space, defaultSpace, groupAssignUser, groupCore, groupUnassignUser, groupView, homeView, mayAdministerSpace, maySetupUsers, memberGroup, member_of_group, member_of_space, owns_space, ownsSpace, resolveHome, setupAdmin, setupMember, spaceAddUser, spaceCore, spaceRemoveUser, spaceSetDefault, spaceView, userView, } from '#schema';
|
|
2
|
+
export { application } from './application.js';
|
|
3
|
+
export { default as runtime } from './runtime.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { changeGroupMembership, } from './membership.js';
|
|
@@ -1,71 +1,21 @@
|
|
|
1
|
-
import { ClassPath } from '@astrale-os/sdk/graph';
|
|
2
1
|
import { Path } from '@astrale-os/sdk/graph/path';
|
|
3
2
|
import { defineMutation } from '@astrale-os/sdk/mutation';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
mutation.expect.edge({ class: EXTENDS_WITH, source, target });
|
|
24
|
-
}
|
|
25
|
-
if (change.state !== 'local-only') {
|
|
26
|
-
mutation.createEdge({ class: MEMBER_OF_GROUP, source, target });
|
|
27
|
-
}
|
|
28
|
-
if (change.state !== 'authority-only') {
|
|
29
|
-
mutation.createEdge({ class: EXTENDS_WITH, source, target });
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
project: () => ok(Object.freeze({})),
|
|
33
|
-
reject: (failure) => err({ code: failure.code, outcomeKnown: failure.outcomeKnown }),
|
|
34
|
-
});
|
|
35
|
-
/** Converge Shell product membership without mutating Kernel identity authority. */
|
|
36
|
-
export const assignLocalGroupMembership = defineMutation({
|
|
37
|
-
id: 'shell.group.assign-local-membership',
|
|
38
|
-
build: (change) => (mutation) => {
|
|
39
|
-
mutation.expect.query(change.guard);
|
|
40
|
-
mutation.createEdge({
|
|
41
|
-
class: MEMBER_OF_GROUP,
|
|
42
|
-
source: Path.from(change.user),
|
|
43
|
-
target: Path.id(change.group),
|
|
44
|
-
});
|
|
45
|
-
},
|
|
46
|
-
project: () => ok(Object.freeze({})),
|
|
47
|
-
reject: (failure) => err({ code: failure.code, outcomeKnown: failure.outcomeKnown }),
|
|
48
|
-
});
|
|
49
|
-
export const unassignGroupMembership = defineMutation({
|
|
50
|
-
id: 'shell.group.unassign-membership',
|
|
51
|
-
build: (change) => (mutation) => {
|
|
52
|
-
mutation.expect.query(change.guards.authority);
|
|
53
|
-
mutation.expect.query(change.guards.local);
|
|
54
|
-
if (change.state === 'absent') {
|
|
55
|
-
throw new TypeError('Absent Group membership is already converged.');
|
|
56
|
-
}
|
|
57
|
-
const source = Path.from(change.user);
|
|
58
|
-
const target = Path.id(change.group);
|
|
59
|
-
if (change.state !== 'authority-only') {
|
|
60
|
-
mutation.expect.edge({ class: MEMBER_OF_GROUP, source, target });
|
|
61
|
-
mutation.deleteEdge({ class: MEMBER_OF_GROUP, source, target });
|
|
62
|
-
}
|
|
63
|
-
if (change.state !== 'local-only') {
|
|
64
|
-
mutation.expect.edge({ class: EXTENDS_WITH, source, target });
|
|
65
|
-
mutation.deleteEdge({ class: EXTENDS_WITH, source, target });
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
project: () => ok(Object.freeze({})),
|
|
69
|
-
reject: (failure) => err({ code: failure.code, outcomeKnown: failure.outcomeKnown }),
|
|
70
|
-
});
|
|
71
|
-
//# sourceMappingURL=membership.js.map
|
|
3
|
+
export function changeGroupMembership(domain) {
|
|
4
|
+
return defineMutation({
|
|
5
|
+
id: 'shell.group.membership',
|
|
6
|
+
change(mutation, change) {
|
|
7
|
+
mutation.expect.query(change.guard);
|
|
8
|
+
const edge = {
|
|
9
|
+
class: domain.classes.member_of_group,
|
|
10
|
+
source: Path.parse(change.user),
|
|
11
|
+
target: Path.id(change.group),
|
|
12
|
+
};
|
|
13
|
+
if (change.present)
|
|
14
|
+
mutation.createEdge(edge);
|
|
15
|
+
else
|
|
16
|
+
mutation.deleteEdge(edge);
|
|
17
|
+
},
|
|
18
|
+
project: () => Object.freeze({ ok: true }),
|
|
19
|
+
reject: (failure) => Object.freeze({ ok: false, code: failure.code, outcomeKnown: failure.outcomeKnown }),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -1,54 +1,25 @@
|
|
|
1
|
-
import { ClassPath } from '@astrale-os/sdk/graph';
|
|
2
1
|
import { Path } from '@astrale-os/sdk/graph/path';
|
|
3
2
|
import { defineMutation } from '@astrale-os/sdk/mutation';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (change.state !== 'none')
|
|
28
|
-
mutation.deleteEdge({ class: opposite, source, target });
|
|
29
|
-
if (change.state !== 'conflict')
|
|
30
|
-
mutation.createEdge({ class: requested, source, target });
|
|
31
|
-
},
|
|
32
|
-
project: () => ok(Object.freeze({})),
|
|
33
|
-
reject: (failure) => err({ code: failure.code, outcomeKnown: failure.outcomeKnown }),
|
|
34
|
-
});
|
|
35
|
-
export const removeSpaceUserAccess = defineMutation({
|
|
36
|
-
id: 'shell.space.remove-user-access',
|
|
37
|
-
build: (subject) => (mutation) => {
|
|
38
|
-
mutation.expect.query(subject.guards.admin);
|
|
39
|
-
mutation.expect.query(subject.guards.member);
|
|
40
|
-
const source = graphEndpointPath(subject.user);
|
|
41
|
-
const target = Path.id(subject.space);
|
|
42
|
-
if (subject.state === 'member' || subject.state === 'conflict') {
|
|
43
|
-
mutation.expect.edge({ class: MEMBER_OF_SPACE, source, target });
|
|
44
|
-
mutation.deleteEdge({ class: MEMBER_OF_SPACE, source, target });
|
|
45
|
-
}
|
|
46
|
-
if (subject.state === 'admin' || subject.state === 'conflict') {
|
|
47
|
-
mutation.expect.edge({ class: ADMINISTERS_SPACE, source, target });
|
|
48
|
-
mutation.deleteEdge({ class: ADMINISTERS_SPACE, source, target });
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
project: () => ok(Object.freeze({})),
|
|
52
|
-
reject: (failure) => err({ code: failure.code, outcomeKnown: failure.outcomeKnown }),
|
|
53
|
-
});
|
|
54
|
-
//# sourceMappingURL=access.js.map
|
|
3
|
+
export function changeSpaceAccess(domain) {
|
|
4
|
+
return defineMutation({
|
|
5
|
+
id: 'shell.space.access',
|
|
6
|
+
change(mutation, change) {
|
|
7
|
+
mutation.expect.query(change.guards.member);
|
|
8
|
+
mutation.expect.query(change.guards.admin);
|
|
9
|
+
const source = Path.parse(change.user);
|
|
10
|
+
const target = Path.id(change.space);
|
|
11
|
+
const member = { class: domain.classes.member_of_space, source, target };
|
|
12
|
+
const admin = { class: domain.classes.administers_space, source, target };
|
|
13
|
+
if (change.removeMember)
|
|
14
|
+
mutation.deleteEdge(member);
|
|
15
|
+
if (change.removeAdmin)
|
|
16
|
+
mutation.deleteEdge(admin);
|
|
17
|
+
if (change.addMember)
|
|
18
|
+
mutation.createEdge(member);
|
|
19
|
+
if (change.addAdmin)
|
|
20
|
+
mutation.createEdge(admin);
|
|
21
|
+
},
|
|
22
|
+
project: () => Object.freeze({ ok: true }),
|
|
23
|
+
reject: (failure) => Object.freeze({ ok: false, code: failure.code, outcomeKnown: failure.outcomeKnown }),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -1,46 +1,25 @@
|
|
|
1
|
-
import { ClassPath } from '@astrale-os/sdk/graph';
|
|
2
1
|
import { Path } from '@astrale-os/sdk/graph/path';
|
|
3
2
|
import { defineMutation } from '@astrale-os/sdk/mutation';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
project: () => ok(Object.freeze({})),
|
|
30
|
-
reject: (failure) => err({ code: failure.code, outcomeKnown: failure.outcomeKnown }),
|
|
31
|
-
});
|
|
32
|
-
export const clearDefaultSpace = defineMutation({
|
|
33
|
-
id: 'shell.space.clear-default',
|
|
34
|
-
build: (subject) => (mutation) => {
|
|
35
|
-
for (const guard of subject.guards.access)
|
|
36
|
-
mutation.expect.query(guard);
|
|
37
|
-
mutation.expect.query(subject.guards.defaults);
|
|
38
|
-
const source = graphEndpointPath(subject.user);
|
|
39
|
-
const target = Path.id(subject.space);
|
|
40
|
-
mutation.expect.edge({ class: DEFAULT_SPACE, source, target });
|
|
41
|
-
mutation.deleteEdge({ class: DEFAULT_SPACE, source, target });
|
|
42
|
-
},
|
|
43
|
-
project: () => ok(Object.freeze({})),
|
|
44
|
-
reject: (failure) => err({ code: failure.code, outcomeKnown: failure.outcomeKnown }),
|
|
45
|
-
});
|
|
46
|
-
//# sourceMappingURL=default.js.map
|
|
3
|
+
export function changeDefaultSpace(domain) {
|
|
4
|
+
return defineMutation({
|
|
5
|
+
id: 'shell.space.default',
|
|
6
|
+
change(mutation, change) {
|
|
7
|
+
mutation.expect.query(change.guard);
|
|
8
|
+
const source = Path.id(change.user);
|
|
9
|
+
if (change.previous !== undefined) {
|
|
10
|
+
mutation.deleteEdge({
|
|
11
|
+
class: domain.classes.default_space,
|
|
12
|
+
source,
|
|
13
|
+
target: Path.id(change.previous),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
mutation.createEdge({
|
|
17
|
+
class: domain.classes.default_space,
|
|
18
|
+
source,
|
|
19
|
+
target: Path.id(change.next),
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
project: () => Object.freeze({ ok: true }),
|
|
23
|
+
reject: (failure) => Object.freeze({ ok: false, code: failure.code, outcomeKnown: failure.outcomeKnown }),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { changeSpaceAccess, } from './access.js';
|
|
2
|
+
export { changeDefaultSpace, } from './default.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { repairUser } from './repair.js';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { LocalBinding } from '@astrale-os/sdk/graph';
|
|
2
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
3
|
+
import { defineMutation } from '@astrale-os/sdk/mutation';
|
|
4
|
+
const personalSpace = LocalBinding('personalSpace');
|
|
5
|
+
export function repairUser(domain) {
|
|
6
|
+
return defineMutation({
|
|
7
|
+
id: 'shell.user.repair',
|
|
8
|
+
change(mutation, repair) {
|
|
9
|
+
mutation.expect.query(repair.guards.home);
|
|
10
|
+
mutation.expect.query(repair.guards.ownedSpaces);
|
|
11
|
+
mutation.expect.query(repair.guards.groups);
|
|
12
|
+
mutation.expect.node({
|
|
13
|
+
node: Path.id(repair.userId),
|
|
14
|
+
class: domain.classes.User,
|
|
15
|
+
props: repair.currentDisplayName === undefined
|
|
16
|
+
? { absent: ['displayName'] }
|
|
17
|
+
: { equals: { displayName: repair.currentDisplayName } },
|
|
18
|
+
});
|
|
19
|
+
if (repair.displayName !== undefined) {
|
|
20
|
+
mutation.updateNode({
|
|
21
|
+
node: Path.id(repair.userId),
|
|
22
|
+
class: domain.classes.User,
|
|
23
|
+
props: { set: { displayName: repair.displayName } },
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const home = repair.home.kind === 'create'
|
|
27
|
+
? mutation.createNode({
|
|
28
|
+
as: personalSpace,
|
|
29
|
+
class: domain.classes.Space,
|
|
30
|
+
props: { name: repair.home.name },
|
|
31
|
+
})
|
|
32
|
+
: Path.id(repair.home.id);
|
|
33
|
+
if (repair.home.kind === 'existing' && repair.home.name !== undefined) {
|
|
34
|
+
mutation.expect.node({
|
|
35
|
+
node: Path.id(repair.home.id),
|
|
36
|
+
class: domain.classes.Space,
|
|
37
|
+
props: { equals: { name: repair.home.currentName } },
|
|
38
|
+
});
|
|
39
|
+
mutation.updateNode({
|
|
40
|
+
node: Path.id(repair.home.id),
|
|
41
|
+
class: domain.classes.Space,
|
|
42
|
+
props: { set: { name: repair.home.name } },
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (repair.addOwnership) {
|
|
46
|
+
mutation.createEdge({
|
|
47
|
+
class: domain.classes.owns_space,
|
|
48
|
+
source: Path.id(repair.userId),
|
|
49
|
+
target: home,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (repair.addDefault) {
|
|
53
|
+
mutation.createEdge({
|
|
54
|
+
class: domain.classes.default_space,
|
|
55
|
+
source: Path.id(repair.userId),
|
|
56
|
+
target: home,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (repair.addMember) {
|
|
60
|
+
mutation.createEdge({
|
|
61
|
+
class: domain.classes.member_of_group,
|
|
62
|
+
source: Path.id(repair.userId),
|
|
63
|
+
target: Path.project(domain.core.nodes.member.ref),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (repair.addAdmin) {
|
|
67
|
+
mutation.createEdge({
|
|
68
|
+
class: domain.classes.member_of_group,
|
|
69
|
+
source: Path.id(repair.userId),
|
|
70
|
+
target: Path.project(domain.core.nodes.admin.ref),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
project(result, repair) {
|
|
75
|
+
const personalSpaceId = repair.home.kind === 'existing' ? repair.home.id : result.createdNodes[personalSpace];
|
|
76
|
+
if (personalSpaceId === undefined) {
|
|
77
|
+
throw new TypeError('Shell User repair omitted its created personal Space identity.');
|
|
78
|
+
}
|
|
79
|
+
return Object.freeze({ ok: true, personalSpaceId });
|
|
80
|
+
},
|
|
81
|
+
reject(failure) {
|
|
82
|
+
return Object.freeze({ ok: false, code: failure.code, outcomeKnown: failure.outcomeKnown });
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
@@ -1,93 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
pagination: { maximumPages: 64 },
|
|
15
|
-
build: (user) => Query.from({ kind: 'node', paths: [graphEndpointPath(user)], binding: 'user' })
|
|
16
|
-
.expand({
|
|
17
|
-
via: [ADMINISTERS_SPACE],
|
|
18
|
-
direction: 'outgoing',
|
|
19
|
-
bindings: { edge: 'adminAccess', node: 'space' },
|
|
20
|
-
})
|
|
21
|
-
.filter({ satisfies: SPACE })
|
|
22
|
-
.select({ kind: 'nodes', projection: { kind: 'reference' } }),
|
|
23
|
-
project: spaceAccessEvidence,
|
|
24
|
-
});
|
|
25
|
-
const memberSpaces = defineQuery({
|
|
26
|
-
id: 'shell.space.member-spaces',
|
|
27
|
-
page: { size: 256 },
|
|
28
|
-
pagination: { maximumPages: 64 },
|
|
29
|
-
build: (user) => Query.from({ kind: 'node', paths: [graphEndpointPath(user)], binding: 'user' })
|
|
30
|
-
.expand({
|
|
31
|
-
via: [MEMBER_OF_SPACE],
|
|
32
|
-
direction: 'outgoing',
|
|
33
|
-
bindings: { edge: 'memberAccess', node: 'space' },
|
|
34
|
-
})
|
|
35
|
-
.filter({ satisfies: SPACE })
|
|
36
|
-
.select({ kind: 'nodes', projection: { kind: 'reference' } }),
|
|
37
|
-
project: spaceAccessEvidence,
|
|
38
|
-
});
|
|
39
|
-
const ownedSpaces = defineQuery({
|
|
40
|
-
id: 'shell.space.owned-spaces',
|
|
41
|
-
page: { size: 256 },
|
|
42
|
-
pagination: { maximumPages: 64 },
|
|
43
|
-
build: (user) => Query.from({ kind: 'node', paths: [graphEndpointPath(user)], binding: 'user' })
|
|
44
|
-
.expand({
|
|
45
|
-
via: [OWNS_SPACE],
|
|
46
|
-
direction: 'outgoing',
|
|
47
|
-
bindings: { edge: 'ownership', node: 'space' },
|
|
48
|
-
})
|
|
49
|
-
.filter({ satisfies: SPACE })
|
|
50
|
-
.select({ kind: 'nodes', projection: { kind: 'reference' } }),
|
|
51
|
-
project: spaceAccessEvidence,
|
|
52
|
-
});
|
|
53
|
-
const groupSpaces = defineQuery({
|
|
54
|
-
id: 'shell.space.group-spaces',
|
|
55
|
-
page: { size: 256 },
|
|
56
|
-
pagination: { maximumPages: 64 },
|
|
57
|
-
build: (user) => Query.from({ kind: 'node', paths: [graphEndpointPath(user)], binding: 'user' })
|
|
58
|
-
.expand({
|
|
59
|
-
via: [S.$.class('member_of_group').schemaRef],
|
|
60
|
-
direction: 'outgoing',
|
|
61
|
-
bindings: { edge: 'membership', node: 'group' },
|
|
62
|
-
})
|
|
63
|
-
.filter({ satisfies: GROUP })
|
|
64
|
-
.expand({
|
|
65
|
-
via: [OWNS_SPACE, ADMINISTERS_SPACE, MEMBER_OF_SPACE],
|
|
66
|
-
direction: 'outgoing',
|
|
67
|
-
bindings: { edge: 'groupAccess', node: 'space' },
|
|
68
|
-
})
|
|
69
|
-
.filter({ satisfies: SPACE })
|
|
70
|
-
.select({ kind: 'nodes', projection: { kind: 'reference' } }),
|
|
71
|
-
project: spaceAccessEvidence,
|
|
72
|
-
});
|
|
73
|
-
export const observeDirectSpaceAccess = defineQuery.composite({
|
|
74
|
-
id: 'shell.space.observe-direct-access',
|
|
75
|
-
compose: (query, subject) => query.combine({
|
|
76
|
-
admin: query.query('admin', administeredSpaces, subject.user),
|
|
77
|
-
member: query.query('member', memberSpaces, subject.user),
|
|
78
|
-
}),
|
|
79
|
-
});
|
|
80
|
-
export const observeEffectiveSpaceAccess = defineQuery.composite({
|
|
81
|
-
id: 'shell.space.observe-effective-access',
|
|
82
|
-
compose: (query, subject) => query.combine({
|
|
83
|
-
administers: query.query('administers', administeredSpaces, subject.user),
|
|
84
|
-
group: query.query('group', groupSpaces, subject.user),
|
|
85
|
-
member: query.query('member', memberSpaces, subject.user),
|
|
86
|
-
owns: query.query('owns', ownedSpaces, subject.user),
|
|
87
|
-
}),
|
|
88
|
-
});
|
|
89
|
-
function spaceAccessEvidence(pages, _user, { ast }) {
|
|
90
|
-
const guard = completeNodeQueryGuard(pages, ast, 'Space access');
|
|
91
|
-
return Object.freeze({ spaces: guard.equals.ids, guard });
|
|
1
|
+
import { defineCompositeQuery } from '@astrale-os/sdk/query';
|
|
2
|
+
import { observeAdminSpaces } from './admin.js';
|
|
3
|
+
import { observeMemberSpaces } from './member.js';
|
|
4
|
+
export function observeDirectSpaceAccess(domain) {
|
|
5
|
+
return defineCompositeQuery({
|
|
6
|
+
id: 'shell.space.direct-access',
|
|
7
|
+
compose({ combine, query }, user) {
|
|
8
|
+
return combine({
|
|
9
|
+
admin: query('admin', observeAdminSpaces(domain), user),
|
|
10
|
+
member: query('member', observeMemberSpaces(domain), user),
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
});
|
|
92
14
|
}
|
|
93
|
-
//# sourceMappingURL=access.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
2
|
+
import { Query, defineQuery, queryResult } from '@astrale-os/sdk/query';
|
|
3
|
+
function adminSpacesQuery(domain) {
|
|
4
|
+
return {
|
|
5
|
+
build(user) {
|
|
6
|
+
const source = Query.from({ nodes: [Path.parse(user)] });
|
|
7
|
+
const spaces = source.expand({
|
|
8
|
+
via: [domain.classes.administers_space],
|
|
9
|
+
direction: 'outgoing',
|
|
10
|
+
});
|
|
11
|
+
return spaces.select({ kind: 'nodes', binding: spaces.node, projection: { kind: 'value' } });
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function observeAdminSpaces(domain) {
|
|
16
|
+
return defineQuery({
|
|
17
|
+
id: 'shell.space.admin-access',
|
|
18
|
+
...adminSpacesQuery(domain),
|
|
19
|
+
pagination: { maximumPages: 64 },
|
|
20
|
+
project(pages, _user, { ast, complete }) {
|
|
21
|
+
return Object.freeze({
|
|
22
|
+
spaces: queryResult.completeNodeValues(pages, 'direct administered Spaces'),
|
|
23
|
+
guard: Object.freeze({ query: ast, equals: complete }),
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
|
|
1
|
+
export { observeAdminSpaces } from './admin.js';
|
|
2
|
+
export { observeDirectSpaceAccess } from './access.js';
|
|
3
|
+
export { observeMemberSpaces } from './member.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
2
|
+
import { Query, defineQuery, queryResult } from '@astrale-os/sdk/query';
|
|
3
|
+
function memberSpacesQuery(domain) {
|
|
4
|
+
return {
|
|
5
|
+
build(user) {
|
|
6
|
+
const source = Query.from({ nodes: [Path.parse(user)] });
|
|
7
|
+
const spaces = source.expand({ via: [domain.classes.member_of_space], direction: 'outgoing' });
|
|
8
|
+
return spaces.select({ kind: 'nodes', binding: spaces.node, projection: { kind: 'value' } });
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function observeMemberSpaces(domain) {
|
|
13
|
+
return defineQuery({
|
|
14
|
+
id: 'shell.space.member-access',
|
|
15
|
+
...memberSpacesQuery(domain),
|
|
16
|
+
pagination: { maximumPages: 64 },
|
|
17
|
+
project(pages, _user, { ast, complete }) {
|
|
18
|
+
return Object.freeze({
|
|
19
|
+
spaces: queryResult.completeNodeValues(pages, 'direct member Spaces'),
|
|
20
|
+
guard: Object.freeze({ query: ast, equals: complete }),
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
2
|
+
import { Query, defineQuery, queryResult } from '@astrale-os/sdk/query';
|
|
3
|
+
function groupsQuery(domain) {
|
|
4
|
+
return {
|
|
5
|
+
build(user) {
|
|
6
|
+
const source = Query.from({ nodes: [Path.parse(user)] });
|
|
7
|
+
const groups = source.expand({ via: [domain.classes.member_of_group], direction: 'outgoing' });
|
|
8
|
+
return groups.select({ kind: 'nodes', binding: groups.node, projection: { kind: 'value' } });
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function observeUserGroups(domain) {
|
|
13
|
+
return defineQuery({
|
|
14
|
+
id: 'shell.user.groups',
|
|
15
|
+
...groupsQuery(domain),
|
|
16
|
+
pagination: { maximumPages: 64 },
|
|
17
|
+
project(pages, _user, { ast, complete }) {
|
|
18
|
+
return Object.freeze({
|
|
19
|
+
groups: queryResult.completeNodeValues(pages, 'Shell User Groups'),
|
|
20
|
+
guard: Object.freeze({ query: ast, equals: complete }),
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|