@astrale-domains/shell 0.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -0
- package/dist/functions/application/index.d.ts +3 -0
- package/dist/functions/application/index.d.ts.map +1 -0
- package/dist/functions/application/index.js +3 -0
- package/dist/functions/application/index.js.map +1 -0
- package/dist/functions/application/install.d.ts +4 -0
- package/dist/functions/application/install.d.ts.map +1 -0
- package/dist/functions/application/install.js +11 -0
- package/dist/functions/application/install.js.map +1 -0
- package/dist/functions/application/uninstall.d.ts +5 -0
- package/dist/functions/application/uninstall.d.ts.map +1 -0
- package/dist/functions/application/uninstall.js +11 -0
- package/dist/functions/application/uninstall.js.map +1 -0
- package/dist/functions/execution/index.d.ts +15 -0
- package/dist/functions/execution/index.d.ts.map +1 -0
- package/dist/functions/execution/index.js +2 -0
- package/dist/functions/execution/index.js.map +1 -0
- package/dist/functions/group/assign-user.d.ts +5 -0
- package/dist/functions/group/assign-user.d.ts.map +1 -0
- package/dist/functions/group/assign-user.js +11 -0
- package/dist/functions/group/assign-user.js.map +1 -0
- package/dist/functions/group/index.d.ts +3 -0
- package/dist/functions/group/index.d.ts.map +1 -0
- package/dist/functions/group/index.js +3 -0
- package/dist/functions/group/index.js.map +1 -0
- package/dist/functions/group/unassign-user.d.ts +5 -0
- package/dist/functions/group/unassign-user.d.ts.map +1 -0
- package/dist/functions/group/unassign-user.js +11 -0
- package/dist/functions/group/unassign-user.js.map +1 -0
- package/dist/functions/index.d.ts +6 -0
- package/dist/functions/index.d.ts.map +1 -0
- package/dist/functions/index.js +6 -0
- package/dist/functions/index.js.map +1 -0
- package/dist/functions/space/add-user.d.ts +5 -0
- package/dist/functions/space/add-user.d.ts.map +1 -0
- package/dist/functions/space/add-user.js +11 -0
- package/dist/functions/space/add-user.js.map +1 -0
- package/dist/functions/space/index.d.ts +4 -0
- package/dist/functions/space/index.d.ts.map +1 -0
- package/dist/functions/space/index.js +4 -0
- package/dist/functions/space/index.js.map +1 -0
- package/dist/functions/space/remove-user.d.ts +5 -0
- package/dist/functions/space/remove-user.d.ts.map +1 -0
- package/dist/functions/space/remove-user.js +11 -0
- package/dist/functions/space/remove-user.js.map +1 -0
- package/dist/functions/space/set-default.d.ts +6 -0
- package/dist/functions/space/set-default.d.ts.map +1 -0
- package/dist/functions/space/set-default.js +11 -0
- package/dist/functions/space/set-default.js.map +1 -0
- package/dist/functions/user/administrator.d.ts +4 -0
- package/dist/functions/user/administrator.d.ts.map +1 -0
- package/dist/functions/user/administrator.js +39 -0
- package/dist/functions/user/administrator.js.map +1 -0
- package/dist/functions/user/ensure.d.ts +18 -0
- package/dist/functions/user/ensure.d.ts.map +1 -0
- package/dist/functions/user/ensure.js +49 -0
- package/dist/functions/user/ensure.js.map +1 -0
- package/dist/functions/user/index.d.ts +3 -0
- package/dist/functions/user/index.d.ts.map +1 -0
- package/dist/functions/user/index.js +3 -0
- package/dist/functions/user/index.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/mutations/application/association.d.ts +14 -0
- package/dist/mutations/application/association.d.ts.map +1 -0
- package/dist/mutations/application/association.js +46 -0
- package/dist/mutations/application/association.js.map +1 -0
- package/dist/mutations/application/errors.d.ts +5 -0
- package/dist/mutations/application/errors.d.ts.map +1 -0
- package/dist/mutations/application/errors.js +2 -0
- package/dist/mutations/application/errors.js.map +1 -0
- package/dist/mutations/application/index.d.ts +4 -0
- package/dist/mutations/application/index.d.ts.map +1 -0
- package/dist/mutations/application/index.js +3 -0
- package/dist/mutations/application/index.js.map +1 -0
- package/dist/mutations/application/removal.d.ts +6 -0
- package/dist/mutations/application/removal.d.ts.map +1 -0
- package/dist/mutations/application/removal.js +17 -0
- package/dist/mutations/application/removal.js.map +1 -0
- package/dist/mutations/group/errors.d.ts +5 -0
- package/dist/mutations/group/errors.d.ts.map +1 -0
- package/dist/mutations/group/errors.js +2 -0
- package/dist/mutations/group/errors.js.map +1 -0
- package/dist/mutations/group/index.d.ts +3 -0
- package/dist/mutations/group/index.d.ts.map +1 -0
- package/dist/mutations/group/index.js +2 -0
- package/dist/mutations/group/index.js.map +1 -0
- package/dist/mutations/group/membership.d.ts +26 -0
- package/dist/mutations/group/membership.d.ts.map +1 -0
- package/dist/mutations/group/membership.js +71 -0
- package/dist/mutations/group/membership.js.map +1 -0
- package/dist/mutations/index.d.ts +4 -0
- package/dist/mutations/index.d.ts.map +1 -0
- package/dist/mutations/index.js +4 -0
- package/dist/mutations/index.js.map +1 -0
- package/dist/mutations/space/access.d.ts +30 -0
- package/dist/mutations/space/access.d.ts.map +1 -0
- package/dist/mutations/space/access.js +54 -0
- package/dist/mutations/space/access.js.map +1 -0
- package/dist/mutations/space/default.d.ts +26 -0
- package/dist/mutations/space/default.d.ts.map +1 -0
- package/dist/mutations/space/default.js +46 -0
- package/dist/mutations/space/default.js.map +1 -0
- package/dist/mutations/space/errors.d.ts +5 -0
- package/dist/mutations/space/errors.d.ts.map +1 -0
- package/dist/mutations/space/errors.js +2 -0
- package/dist/mutations/space/errors.js.map +1 -0
- package/dist/mutations/space/index.d.ts +4 -0
- package/dist/mutations/space/index.d.ts.map +1 -0
- package/dist/mutations/space/index.js +3 -0
- package/dist/mutations/space/index.js.map +1 -0
- package/dist/mutations/user/index.d.ts +1 -0
- package/dist/mutations/user/index.d.ts.map +1 -0
- package/dist/mutations/user/index.js +2 -0
- package/dist/mutations/user/index.js.map +1 -0
- package/dist/public.d.ts +5 -0
- package/dist/public.d.ts.map +1 -0
- package/dist/public.js +154 -0
- package/dist/public.js.map +1 -0
- package/dist/queries/application/association.d.ts +18 -0
- package/dist/queries/application/association.d.ts.map +1 -0
- package/dist/queries/application/association.js +82 -0
- package/dist/queries/application/association.js.map +1 -0
- package/dist/queries/application/identity.d.ts +4 -0
- package/dist/queries/application/identity.d.ts.map +1 -0
- package/dist/queries/application/identity.js +41 -0
- package/dist/queries/application/identity.js.map +1 -0
- package/dist/queries/application/index.d.ts +3 -0
- package/dist/queries/application/index.d.ts.map +1 -0
- package/dist/queries/application/index.js +3 -0
- package/dist/queries/application/index.js.map +1 -0
- package/dist/queries/group/identity.d.ts +3 -0
- package/dist/queries/group/identity.d.ts.map +1 -0
- package/dist/queries/group/identity.js +29 -0
- package/dist/queries/group/identity.js.map +1 -0
- package/dist/queries/group/index.d.ts +3 -0
- package/dist/queries/group/index.d.ts.map +1 -0
- package/dist/queries/group/index.js +3 -0
- package/dist/queries/group/index.js.map +1 -0
- package/dist/queries/group/membership.d.ts +17 -0
- package/dist/queries/group/membership.d.ts.map +1 -0
- package/dist/queries/group/membership.js +47 -0
- package/dist/queries/group/membership.js.map +1 -0
- package/dist/queries/index.d.ts +4 -0
- package/dist/queries/index.d.ts.map +1 -0
- package/dist/queries/index.js +4 -0
- package/dist/queries/index.js.map +1 -0
- package/dist/queries/space/access.d.ts +24 -0
- package/dist/queries/space/access.d.ts.map +1 -0
- package/dist/queries/space/access.js +93 -0
- package/dist/queries/space/access.js.map +1 -0
- package/dist/queries/space/default.d.ts +10 -0
- package/dist/queries/space/default.d.ts.map +1 -0
- package/dist/queries/space/default.js +25 -0
- package/dist/queries/space/default.js.map +1 -0
- package/dist/queries/space/index.d.ts +3 -0
- package/dist/queries/space/index.d.ts.map +1 -0
- package/dist/queries/space/index.js +3 -0
- package/dist/queries/space/index.js.map +1 -0
- package/dist/rules/application/association.d.ts +13 -0
- package/dist/rules/application/association.d.ts.map +1 -0
- package/dist/rules/application/association.js +10 -0
- package/dist/rules/application/association.js.map +1 -0
- package/dist/rules/application/index.d.ts +4 -0
- package/dist/rules/application/index.d.ts.map +1 -0
- package/dist/rules/application/index.js +4 -0
- package/dist/rules/application/index.js.map +1 -0
- package/dist/rules/application/removal.d.ts +11 -0
- package/dist/rules/application/removal.d.ts.map +1 -0
- package/dist/rules/application/removal.js +6 -0
- package/dist/rules/application/removal.js.map +1 -0
- package/dist/rules/application/result.d.ts +8 -0
- package/dist/rules/application/result.d.ts.map +1 -0
- package/dist/rules/application/result.js +17 -0
- package/dist/rules/application/result.js.map +1 -0
- package/dist/rules/group/index.d.ts +2 -0
- package/dist/rules/group/index.d.ts.map +1 -0
- package/dist/rules/group/index.js +2 -0
- package/dist/rules/group/index.js.map +1 -0
- package/dist/rules/group/membership.d.ts +5 -0
- package/dist/rules/group/membership.d.ts.map +1 -0
- package/dist/rules/group/membership.js +12 -0
- package/dist/rules/group/membership.js.map +1 -0
- package/dist/rules/index.d.ts +5 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +5 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/space/access.d.ts +8 -0
- package/dist/rules/space/access.d.ts.map +1 -0
- package/dist/rules/space/access.js +18 -0
- package/dist/rules/space/access.js.map +1 -0
- package/dist/rules/space/default.d.ts +4 -0
- package/dist/rules/space/default.d.ts.map +1 -0
- package/dist/rules/space/default.js +7 -0
- package/dist/rules/space/default.js.map +1 -0
- package/dist/rules/space/index.d.ts +3 -0
- package/dist/rules/space/index.d.ts.map +1 -0
- package/dist/rules/space/index.js +3 -0
- package/dist/rules/space/index.js.map +1 -0
- package/dist/rules/user/ensure.d.ts +21 -0
- package/dist/rules/user/ensure.d.ts.map +1 -0
- package/dist/rules/user/ensure.js +61 -0
- package/dist/rules/user/ensure.js.map +1 -0
- package/dist/rules/user/grant.d.ts +13 -0
- package/dist/rules/user/grant.d.ts.map +1 -0
- package/dist/rules/user/grant.js +12 -0
- package/dist/rules/user/grant.js.map +1 -0
- package/dist/rules/user/index.d.ts +3 -0
- package/dist/rules/user/index.d.ts.map +1 -0
- package/dist/rules/user/index.js +3 -0
- package/dist/rules/user/index.js.map +1 -0
- package/dist/schema/application/class.d.ts +152 -0
- package/dist/schema/application/class.d.ts.map +1 -0
- package/dist/schema/application/class.js +10 -0
- package/dist/schema/application/class.js.map +1 -0
- package/dist/schema/application/core.d.ts +159 -0
- package/dist/schema/application/core.d.ts.map +1 -0
- package/dist/schema/application/core.js +13 -0
- package/dist/schema/application/core.js.map +1 -0
- package/dist/schema/application/index.d.ts +7 -0
- package/dist/schema/application/index.d.ts.map +1 -0
- package/dist/schema/application/index.js +7 -0
- package/dist/schema/application/index.js.map +1 -0
- package/dist/schema/application/methods.d.ts +171 -0
- package/dist/schema/application/methods.d.ts.map +1 -0
- package/dist/schema/application/methods.js +48 -0
- package/dist/schema/application/methods.js.map +1 -0
- package/dist/schema/application/policies.d.ts +3 -0
- package/dist/schema/application/policies.d.ts.map +1 -0
- package/dist/schema/application/policies.js +11 -0
- package/dist/schema/application/policies.js.map +1 -0
- package/dist/schema/application/relationships.d.ts +795 -0
- package/dist/schema/application/relationships.d.ts.map +1 -0
- package/dist/schema/application/relationships.js +20 -0
- package/dist/schema/application/relationships.js.map +1 -0
- package/dist/schema/application/view.d.ts +155 -0
- package/dist/schema/application/view.d.ts.map +1 -0
- package/dist/schema/application/view.js +7 -0
- package/dist/schema/application/view.js.map +1 -0
- package/dist/schema/domain/index.d.ts +9363 -0
- package/dist/schema/domain/index.d.ts.map +1 -0
- package/dist/schema/domain/index.js +56 -0
- package/dist/schema/domain/index.js.map +1 -0
- package/dist/schema/group/class.d.ts +59 -0
- package/dist/schema/group/class.d.ts.map +1 -0
- package/dist/schema/group/class.js +11 -0
- package/dist/schema/group/class.js.map +1 -0
- package/dist/schema/group/core.d.ts +495 -0
- package/dist/schema/group/core.d.ts.map +1 -0
- package/dist/schema/group/core.js +20 -0
- package/dist/schema/group/core.js.map +1 -0
- package/dist/schema/group/index.d.ts +7 -0
- package/dist/schema/group/index.d.ts.map +1 -0
- package/dist/schema/group/index.js +7 -0
- package/dist/schema/group/index.js.map +1 -0
- package/dist/schema/group/methods.d.ts +48 -0
- package/dist/schema/group/methods.d.ts.map +1 -0
- package/dist/schema/group/methods.js +21 -0
- package/dist/schema/group/methods.js.map +1 -0
- package/dist/schema/group/policies.d.ts +3 -0
- package/dist/schema/group/policies.d.ts.map +1 -0
- package/dist/schema/group/policies.js +7 -0
- package/dist/schema/group/policies.js.map +1 -0
- package/dist/schema/group/relationships.d.ts +293 -0
- package/dist/schema/group/relationships.d.ts.map +1 -0
- package/dist/schema/group/relationships.js +20 -0
- package/dist/schema/group/relationships.js.map +1 -0
- package/dist/schema/group/view.d.ts +62 -0
- package/dist/schema/group/view.d.ts.map +1 -0
- package/dist/schema/group/view.js +7 -0
- package/dist/schema/group/view.js.map +1 -0
- package/dist/schema/home/index.d.ts +2 -0
- package/dist/schema/home/index.d.ts.map +1 -0
- package/dist/schema/home/index.js +2 -0
- package/dist/schema/home/index.js.map +1 -0
- package/dist/schema/home/view.d.ts +4 -0
- package/dist/schema/home/view.d.ts.map +1 -0
- package/dist/schema/home/view.js +5 -0
- package/dist/schema/home/view.js.map +1 -0
- package/dist/schema/index.d.ts +7 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +7 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/space/class.d.ts +74 -0
- package/dist/schema/space/class.d.ts.map +1 -0
- package/dist/schema/space/class.js +15 -0
- package/dist/schema/space/class.js.map +1 -0
- package/dist/schema/space/core.d.ts +995 -0
- package/dist/schema/space/core.d.ts.map +1 -0
- package/dist/schema/space/core.js +17 -0
- package/dist/schema/space/core.js.map +1 -0
- package/dist/schema/space/index.d.ts +7 -0
- package/dist/schema/space/index.d.ts.map +1 -0
- package/dist/schema/space/index.js +7 -0
- package/dist/schema/space/index.js.map +1 -0
- package/dist/schema/space/methods.d.ts +78 -0
- package/dist/schema/space/methods.d.ts.map +1 -0
- package/dist/schema/space/methods.js +31 -0
- package/dist/schema/space/methods.js.map +1 -0
- package/dist/schema/space/policies.d.ts +5 -0
- package/dist/schema/space/policies.d.ts.map +1 -0
- package/dist/schema/space/policies.js +15 -0
- package/dist/schema/space/policies.js.map +1 -0
- package/dist/schema/space/relationships.d.ts +1059 -0
- package/dist/schema/space/relationships.d.ts.map +1 -0
- package/dist/schema/space/relationships.js +25 -0
- package/dist/schema/space/relationships.js.map +1 -0
- package/dist/schema/space/view.d.ts +77 -0
- package/dist/schema/space/view.d.ts.map +1 -0
- package/dist/schema/space/view.js +7 -0
- package/dist/schema/space/view.js.map +1 -0
- package/dist/schema/user/administrator.d.ts +30 -0
- package/dist/schema/user/administrator.d.ts.map +1 -0
- package/dist/schema/user/administrator.js +19 -0
- package/dist/schema/user/administrator.js.map +1 -0
- package/dist/schema/user/class.d.ts +12 -0
- package/dist/schema/user/class.d.ts.map +1 -0
- package/dist/schema/user/class.js +7 -0
- package/dist/schema/user/class.js.map +1 -0
- package/dist/schema/user/ensure.d.ts +37 -0
- package/dist/schema/user/ensure.d.ts.map +1 -0
- package/dist/schema/user/ensure.js +28 -0
- package/dist/schema/user/ensure.js.map +1 -0
- package/dist/schema/user/index.d.ts +6 -0
- package/dist/schema/user/index.d.ts.map +1 -0
- package/dist/schema/user/index.js +6 -0
- package/dist/schema/user/index.js.map +1 -0
- package/dist/schema/user/interface.d.ts +10 -0
- package/dist/schema/user/interface.d.ts.map +1 -0
- package/dist/schema/user/interface.js +12 -0
- package/dist/schema/user/interface.js.map +1 -0
- package/dist/schema/user/view.d.ts +15 -0
- package/dist/schema/user/view.d.ts.map +1 -0
- package/dist/schema/user/view.js +7 -0
- package/dist/schema/user/view.js.map +1 -0
- package/dist/tests/cross-layer/public.test.d.ts +2 -0
- package/dist/tests/cross-layer/public.test.d.ts.map +1 -0
- package/dist/tests/cross-layer/public.test.js +70 -0
- package/dist/tests/cross-layer/public.test.js.map +1 -0
- package/dist/tests/cross-layer/workflows.test.d.ts +2 -0
- package/dist/tests/cross-layer/workflows.test.d.ts.map +1 -0
- package/dist/tests/cross-layer/workflows.test.js +290 -0
- package/dist/tests/cross-layer/workflows.test.js.map +1 -0
- package/dist/tests/index.d.ts +3 -0
- package/dist/tests/index.d.ts.map +1 -0
- package/dist/tests/index.js +3 -0
- package/dist/tests/index.js.map +1 -0
- package/dist/utils/graph-endpoint/index.d.ts +13 -0
- package/dist/utils/graph-endpoint/index.d.ts.map +1 -0
- package/dist/utils/graph-endpoint/index.js +6 -0
- package/dist/utils/graph-endpoint/index.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/query-page/index.d.ts +3 -0
- package/dist/utils/query-page/index.d.ts.map +1 -0
- package/dist/utils/query-page/index.js +2 -0
- package/dist/utils/query-page/index.js.map +1 -0
- package/dist/utils/query-page/nodes.d.ts +16 -0
- package/dist/utils/query-page/nodes.d.ts.map +1 -0
- package/dist/utils/query-page/nodes.js +22 -0
- package/dist/utils/query-page/nodes.js.map +1 -0
- package/dist/workflows/application/errors.d.ts +5 -0
- package/dist/workflows/application/errors.d.ts.map +1 -0
- package/dist/workflows/application/errors.js +25 -0
- package/dist/workflows/application/errors.js.map +1 -0
- package/dist/workflows/application/index.d.ts +3 -0
- package/dist/workflows/application/index.d.ts.map +1 -0
- package/dist/workflows/application/index.js +3 -0
- package/dist/workflows/application/index.js.map +1 -0
- package/dist/workflows/application/install.d.ts +3 -0
- package/dist/workflows/application/install.d.ts.map +1 -0
- package/dist/workflows/application/install.js +37 -0
- package/dist/workflows/application/install.js.map +1 -0
- package/dist/workflows/application/uninstall.d.ts +4 -0
- package/dist/workflows/application/uninstall.d.ts.map +1 -0
- package/dist/workflows/application/uninstall.js +25 -0
- package/dist/workflows/application/uninstall.js.map +1 -0
- package/dist/workflows/group/assign-user.d.ts +8 -0
- package/dist/workflows/group/assign-user.d.ts.map +1 -0
- package/dist/workflows/group/assign-user.js +32 -0
- package/dist/workflows/group/assign-user.js.map +1 -0
- package/dist/workflows/group/ensure-administrator.d.ts +4 -0
- package/dist/workflows/group/ensure-administrator.d.ts.map +1 -0
- package/dist/workflows/group/ensure-administrator.js +26 -0
- package/dist/workflows/group/ensure-administrator.js.map +1 -0
- package/dist/workflows/group/errors.d.ts +2 -0
- package/dist/workflows/group/errors.d.ts.map +1 -0
- package/dist/workflows/group/errors.js +7 -0
- package/dist/workflows/group/errors.js.map +1 -0
- package/dist/workflows/group/index.d.ts +4 -0
- package/dist/workflows/group/index.d.ts.map +1 -0
- package/dist/workflows/group/index.js +4 -0
- package/dist/workflows/group/index.js.map +1 -0
- package/dist/workflows/group/unassign-user.d.ts +8 -0
- package/dist/workflows/group/unassign-user.d.ts.map +1 -0
- package/dist/workflows/group/unassign-user.js +32 -0
- package/dist/workflows/group/unassign-user.js.map +1 -0
- package/dist/workflows/index.d.ts +4 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +4 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/space/add-user.d.ts +8 -0
- package/dist/workflows/space/add-user.d.ts.map +1 -0
- package/dist/workflows/space/add-user.js +34 -0
- package/dist/workflows/space/add-user.js.map +1 -0
- package/dist/workflows/space/errors.d.ts +3 -0
- package/dist/workflows/space/errors.d.ts.map +1 -0
- package/dist/workflows/space/errors.js +10 -0
- package/dist/workflows/space/errors.js.map +1 -0
- package/dist/workflows/space/index.d.ts +4 -0
- package/dist/workflows/space/index.d.ts.map +1 -0
- package/dist/workflows/space/index.js +4 -0
- package/dist/workflows/space/index.js.map +1 -0
- package/dist/workflows/space/remove-user.d.ts +8 -0
- package/dist/workflows/space/remove-user.d.ts.map +1 -0
- package/dist/workflows/space/remove-user.js +62 -0
- package/dist/workflows/space/remove-user.js.map +1 -0
- package/dist/workflows/space/set-default.d.ts +9 -0
- package/dist/workflows/space/set-default.d.ts.map +1 -0
- package/dist/workflows/space/set-default.js +43 -0
- package/dist/workflows/space/set-default.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { grant, issuer } from '@astrale-os/sdk/auth';
|
|
2
|
+
import { NodeId } from '@astrale-os/sdk/graph/node';
|
|
3
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
4
|
+
import { err, ok } from '@astrale-os/sdk/result';
|
|
5
|
+
import { createInlineWorkflowRunner } from '@astrale-os/sdk/workflow';
|
|
6
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
7
|
+
import { assignGroupMembership, clearDefaultSpace, installApplicationAssociation, removeSpaceUserAccess, setDefaultSpace, setSpaceUserAccess, uninstallApplicationAssociation, } from '#mutations';
|
|
8
|
+
import { observeApplicationAssociation, observeApplicationPresence, observeDefaultSpaces, observeDirectSpaceAccess, observeEffectiveSpaceAccess, observeGroupMembership, resolveShellApplication, } from '#queries';
|
|
9
|
+
import { installApplicationWorkflow, uninstallApplicationWorkflow } from '#workflows/application';
|
|
10
|
+
import { assignGroupUserWorkflow, unassignGroupUserWorkflow } from '#workflows/group';
|
|
11
|
+
import { addSpaceUserWorkflow, removeSpaceUserWorkflow, setDefaultSpaceWorkflow, } from '#workflows/space';
|
|
12
|
+
describe('Shell cross-layer workflows', () => {
|
|
13
|
+
it('installs and materializes an absent Application association', async () => {
|
|
14
|
+
const application = NodeId('application');
|
|
15
|
+
const space = NodeId('space');
|
|
16
|
+
const query = vi.fn(async (definition) => {
|
|
17
|
+
if (definition === observeApplicationAssociation) {
|
|
18
|
+
return applicationObservation([], space);
|
|
19
|
+
}
|
|
20
|
+
throw new Error('Unexpected Query.');
|
|
21
|
+
});
|
|
22
|
+
const mutate = vi.fn(async (definition) => {
|
|
23
|
+
if (definition === installApplicationAssociation)
|
|
24
|
+
return ok({ application });
|
|
25
|
+
throw new Error('Unexpected Mutation.');
|
|
26
|
+
});
|
|
27
|
+
const result = await createInlineWorkflowRunner().run(installApplicationWorkflow, {
|
|
28
|
+
input: { domain: Path.id(NodeId('domain')), space: Path.id(space) },
|
|
29
|
+
capabilities: {},
|
|
30
|
+
query,
|
|
31
|
+
mutate,
|
|
32
|
+
});
|
|
33
|
+
expect(result).toMatchObject({ application: { id: application }, space: { id: space } });
|
|
34
|
+
expect(mutate).toHaveBeenCalledTimes(1);
|
|
35
|
+
});
|
|
36
|
+
it('converges an existing or unknown-outcome Application association without duplication', async () => {
|
|
37
|
+
const application = NodeId('application');
|
|
38
|
+
const recovered = NodeId('recovered');
|
|
39
|
+
const space = NodeId('space');
|
|
40
|
+
const input = { domain: Path.id(NodeId('domain')), space: Path.id(space) };
|
|
41
|
+
const existingQuery = vi.fn(async () => ({
|
|
42
|
+
...applicationObservation([application], space),
|
|
43
|
+
}));
|
|
44
|
+
const unusedMutation = vi.fn();
|
|
45
|
+
const existing = await run(installApplicationWorkflow, input, existingQuery, unusedMutation);
|
|
46
|
+
expect(existing.application.id).toBe(application);
|
|
47
|
+
expect(unusedMutation).not.toHaveBeenCalled();
|
|
48
|
+
const recoveryQuery = vi
|
|
49
|
+
.fn()
|
|
50
|
+
.mockResolvedValueOnce(applicationObservation([], space))
|
|
51
|
+
.mockResolvedValueOnce(applicationObservation([recovered], space));
|
|
52
|
+
const uncertainMutation = vi
|
|
53
|
+
.fn()
|
|
54
|
+
.mockResolvedValue(err({ code: 'MUTATION_UNAVAILABLE', outcomeKnown: false }));
|
|
55
|
+
const recoveredResult = await run(installApplicationWorkflow, input, recoveryQuery, uncertainMutation);
|
|
56
|
+
expect(recoveredResult.application.id).toBe(recovered);
|
|
57
|
+
expect(recoveryQuery).toHaveBeenCalledTimes(2);
|
|
58
|
+
});
|
|
59
|
+
it('does not re-observe a conclusively rejected Application installation', async () => {
|
|
60
|
+
const space = NodeId('space');
|
|
61
|
+
const query = vi.fn(async () => applicationObservation([], space));
|
|
62
|
+
const mutate = vi
|
|
63
|
+
.fn()
|
|
64
|
+
.mockResolvedValue(err({ code: 'MUTATION_CONFLICT', outcomeKnown: true }));
|
|
65
|
+
await expect(run(installApplicationWorkflow, { domain: Path.id(NodeId('domain')), space: Path.id(space) }, query, mutate)).rejects.toMatchObject({
|
|
66
|
+
code: 'CONFLICT',
|
|
67
|
+
reason: {
|
|
68
|
+
code: 'APPLICATION_ASSOCIATION_REJECTED',
|
|
69
|
+
details: { rejection: 'MUTATION_CONFLICT' },
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
expect(query).toHaveBeenCalledTimes(1);
|
|
73
|
+
});
|
|
74
|
+
it('repairs partial Group membership and keeps converged membership idempotent', async () => {
|
|
75
|
+
const group = NodeId('group');
|
|
76
|
+
const user = Path.id(NodeId('user'));
|
|
77
|
+
const partialQuery = vi.fn(async () => groupObservation([group], []));
|
|
78
|
+
const mutate = vi.fn(async (definition, input) => {
|
|
79
|
+
expect(definition).toBe(assignGroupMembership);
|
|
80
|
+
expect(input).toMatchObject({ group, state: 'local-only' });
|
|
81
|
+
return ok({});
|
|
82
|
+
});
|
|
83
|
+
await run(assignGroupUserWorkflow, { group, input: { user } }, partialQuery, mutate);
|
|
84
|
+
expect(mutate).toHaveBeenCalledTimes(1);
|
|
85
|
+
const completeQuery = vi.fn(async () => groupObservation([group], [group]));
|
|
86
|
+
const noMutation = vi.fn();
|
|
87
|
+
await run(assignGroupUserWorkflow, { group, input: { user } }, completeQuery, noMutation);
|
|
88
|
+
expect(noMutation).not.toHaveBeenCalled();
|
|
89
|
+
});
|
|
90
|
+
it('recovers an uncertain Group assignment and treats absent removal as converged', async () => {
|
|
91
|
+
const group = NodeId('group');
|
|
92
|
+
const user = Path.id(NodeId('user'));
|
|
93
|
+
const query = vi
|
|
94
|
+
.fn()
|
|
95
|
+
.mockResolvedValueOnce(groupObservation([], []))
|
|
96
|
+
.mockResolvedValueOnce(groupObservation([group], [group]));
|
|
97
|
+
const mutate = vi
|
|
98
|
+
.fn()
|
|
99
|
+
.mockResolvedValue(err({ code: 'MUTATION_UNAVAILABLE', outcomeKnown: false }));
|
|
100
|
+
await run(assignGroupUserWorkflow, { group, input: { user } }, query, mutate);
|
|
101
|
+
expect(query).toHaveBeenCalledTimes(2);
|
|
102
|
+
const absent = vi.fn(async (definition) => {
|
|
103
|
+
expect(definition).toBe(observeGroupMembership);
|
|
104
|
+
return groupObservation([], []);
|
|
105
|
+
});
|
|
106
|
+
const noMutation = vi.fn();
|
|
107
|
+
await run(unassignGroupUserWorkflow, { group, input: { user } }, absent, noMutation);
|
|
108
|
+
expect(noMutation).not.toHaveBeenCalled();
|
|
109
|
+
});
|
|
110
|
+
it('sets direct Space access once and recovers an uncertain committed change', async () => {
|
|
111
|
+
const space = NodeId('space');
|
|
112
|
+
const user = Path.id(NodeId('user'));
|
|
113
|
+
const query = vi
|
|
114
|
+
.fn()
|
|
115
|
+
.mockResolvedValueOnce(directAccessObservation([], []))
|
|
116
|
+
.mockResolvedValueOnce(directAccessObservation([], [space]));
|
|
117
|
+
const mutate = vi.fn(async (definition) => {
|
|
118
|
+
expect(definition).toBe(setSpaceUserAccess);
|
|
119
|
+
return err({ code: 'MUTATION_UNAVAILABLE', outcomeKnown: false });
|
|
120
|
+
});
|
|
121
|
+
await run(addSpaceUserWorkflow, { space, input: { user, access: 'member' } }, query, mutate);
|
|
122
|
+
expect(query).toHaveBeenCalledTimes(2);
|
|
123
|
+
});
|
|
124
|
+
it('removes inaccessible direct access and clears the stale default', async () => {
|
|
125
|
+
const space = NodeId('space');
|
|
126
|
+
const user = NodeId('user');
|
|
127
|
+
const query = vi.fn(async (definition) => {
|
|
128
|
+
if (definition === observeDirectSpaceAccess)
|
|
129
|
+
return directAccessObservation([], [space]);
|
|
130
|
+
if (definition === observeEffectiveSpaceAccess) {
|
|
131
|
+
return accessObservation();
|
|
132
|
+
}
|
|
133
|
+
if (definition === observeDefaultSpaces)
|
|
134
|
+
return defaultObservation([space]);
|
|
135
|
+
throw new Error('Unexpected Query.');
|
|
136
|
+
});
|
|
137
|
+
const mutate = vi.fn(async (definition) => {
|
|
138
|
+
if (definition === removeSpaceUserAccess || definition === clearDefaultSpace) {
|
|
139
|
+
return ok({});
|
|
140
|
+
}
|
|
141
|
+
throw new Error('Unexpected Mutation.');
|
|
142
|
+
});
|
|
143
|
+
await createInlineWorkflowRunner().run(removeSpaceUserWorkflow, {
|
|
144
|
+
input: { space, input: { user: Path.id(user) } },
|
|
145
|
+
capabilities: {},
|
|
146
|
+
query,
|
|
147
|
+
mutate,
|
|
148
|
+
});
|
|
149
|
+
expect(mutate).toHaveBeenCalledTimes(2);
|
|
150
|
+
});
|
|
151
|
+
it('finishes stale-default cleanup when replay starts after direct access was removed', async () => {
|
|
152
|
+
const space = NodeId('space');
|
|
153
|
+
const user = Path.id(NodeId('user'));
|
|
154
|
+
const query = vi.fn(async (definition) => {
|
|
155
|
+
if (definition === observeDirectSpaceAccess)
|
|
156
|
+
return directAccessObservation([], []);
|
|
157
|
+
if (definition === observeEffectiveSpaceAccess) {
|
|
158
|
+
return accessObservation();
|
|
159
|
+
}
|
|
160
|
+
if (definition === observeDefaultSpaces)
|
|
161
|
+
return defaultObservation([space]);
|
|
162
|
+
throw new Error('Unexpected Query.');
|
|
163
|
+
});
|
|
164
|
+
const mutate = vi.fn(async (definition) => {
|
|
165
|
+
expect(definition).toBe(clearDefaultSpace);
|
|
166
|
+
return ok({});
|
|
167
|
+
});
|
|
168
|
+
await run(removeSpaceUserWorkflow, { space, input: { user } }, query, mutate);
|
|
169
|
+
expect(mutate).toHaveBeenCalledTimes(1);
|
|
170
|
+
expect(mutate).not.toHaveBeenCalledWith(removeSpaceUserAccess, expect.anything());
|
|
171
|
+
});
|
|
172
|
+
it('recovers uncertain stale-default cleanup from persisted graph state', async () => {
|
|
173
|
+
const space = NodeId('space');
|
|
174
|
+
const query = vi
|
|
175
|
+
.fn()
|
|
176
|
+
.mockResolvedValueOnce(directAccessObservation([], []))
|
|
177
|
+
.mockResolvedValueOnce(accessObservation())
|
|
178
|
+
.mockResolvedValueOnce(defaultObservation([space]))
|
|
179
|
+
.mockResolvedValueOnce(defaultObservation([]));
|
|
180
|
+
const mutate = vi
|
|
181
|
+
.fn()
|
|
182
|
+
.mockResolvedValue(err({ code: 'MUTATION_UNAVAILABLE', outcomeKnown: false }));
|
|
183
|
+
await run(removeSpaceUserWorkflow, { space, input: { user: Path.id(NodeId('user')) } }, query, mutate);
|
|
184
|
+
expect(query).toHaveBeenCalledTimes(4);
|
|
185
|
+
});
|
|
186
|
+
it('refuses an inaccessible default and converges an uncertain default change', async () => {
|
|
187
|
+
const user = NodeId('user');
|
|
188
|
+
const space = NodeId('space');
|
|
189
|
+
const actor = {
|
|
190
|
+
kind: 'authenticated',
|
|
191
|
+
principal: user,
|
|
192
|
+
authority: grant.self(user),
|
|
193
|
+
authentication: {
|
|
194
|
+
method: 'jwt',
|
|
195
|
+
issuer: issuer.accept('https://issuer.shell.test'),
|
|
196
|
+
subject: 'user',
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
const deniedQuery = vi.fn(async () => accessObservation());
|
|
200
|
+
const noMutation = vi.fn();
|
|
201
|
+
await expect(run(setDefaultSpaceWorkflow, { actor, space }, deniedQuery, noMutation)).rejects.toMatchObject({
|
|
202
|
+
code: 'CONFLICT',
|
|
203
|
+
reason: { code: 'DEFAULT_SPACE_INACCESSIBLE', details: {} },
|
|
204
|
+
});
|
|
205
|
+
expect(noMutation).not.toHaveBeenCalled();
|
|
206
|
+
const query = vi
|
|
207
|
+
.fn()
|
|
208
|
+
.mockResolvedValueOnce(accessObservation({ member: [space] }))
|
|
209
|
+
.mockResolvedValueOnce(defaultObservation([]))
|
|
210
|
+
.mockResolvedValueOnce(defaultObservation([space]));
|
|
211
|
+
const mutate = vi.fn(async (definition) => {
|
|
212
|
+
expect(definition).toBe(setDefaultSpace);
|
|
213
|
+
return err({ code: 'MUTATION_UNAVAILABLE', outcomeKnown: false });
|
|
214
|
+
});
|
|
215
|
+
await run(setDefaultSpaceWorkflow, { actor, space }, query, mutate);
|
|
216
|
+
expect(query).toHaveBeenCalledTimes(3);
|
|
217
|
+
});
|
|
218
|
+
it('protects the Core Shell Application and recovers an uncertain completed removal', async () => {
|
|
219
|
+
const shell = NodeId('shell');
|
|
220
|
+
const protectedQuery = vi.fn(async (definition) => {
|
|
221
|
+
expect(definition).toBe(resolveShellApplication);
|
|
222
|
+
return shell;
|
|
223
|
+
});
|
|
224
|
+
const noMutation = vi.fn();
|
|
225
|
+
await expect(run(uninstallApplicationWorkflow, shell, protectedQuery, noMutation)).rejects.toMatchObject({
|
|
226
|
+
code: 'CONFLICT',
|
|
227
|
+
reason: { code: 'SHELL_APPLICATION_PROTECTED', details: {} },
|
|
228
|
+
});
|
|
229
|
+
expect(noMutation).not.toHaveBeenCalled();
|
|
230
|
+
const application = NodeId('application');
|
|
231
|
+
const query = vi.fn(async (definition) => {
|
|
232
|
+
if (definition === resolveShellApplication)
|
|
233
|
+
return shell;
|
|
234
|
+
if (definition === observeApplicationPresence)
|
|
235
|
+
return false;
|
|
236
|
+
throw new Error('Unexpected Query.');
|
|
237
|
+
});
|
|
238
|
+
const mutate = vi.fn(async (definition) => {
|
|
239
|
+
expect(definition).toBe(uninstallApplicationAssociation);
|
|
240
|
+
return err({ code: 'MUTATION_UNAVAILABLE', outcomeKnown: false });
|
|
241
|
+
});
|
|
242
|
+
await run(uninstallApplicationWorkflow, application, query, mutate);
|
|
243
|
+
expect(query).toHaveBeenCalledTimes(2);
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
function applicationObservation(applications, space) {
|
|
247
|
+
return {
|
|
248
|
+
applications,
|
|
249
|
+
guard: guard(applications),
|
|
250
|
+
space,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function groupObservation(local, authority) {
|
|
254
|
+
return { local: groupEvidence(local), authority: groupEvidence(authority) };
|
|
255
|
+
}
|
|
256
|
+
function groupEvidence(groups) {
|
|
257
|
+
return { groups, guard: guard(groups) };
|
|
258
|
+
}
|
|
259
|
+
function directAccessObservation(admin, member) {
|
|
260
|
+
return { admin: evidence(admin), member: evidence(member) };
|
|
261
|
+
}
|
|
262
|
+
function accessObservation(input = {}) {
|
|
263
|
+
return {
|
|
264
|
+
administers: evidence([]),
|
|
265
|
+
group: evidence([]),
|
|
266
|
+
member: evidence(input.member ?? []),
|
|
267
|
+
owns: evidence([]),
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function defaultObservation(spaces) {
|
|
271
|
+
return { spaces, guard: guard(spaces) };
|
|
272
|
+
}
|
|
273
|
+
function evidence(spaces) {
|
|
274
|
+
return { spaces, guard: guard(spaces) };
|
|
275
|
+
}
|
|
276
|
+
function guard(ids) {
|
|
277
|
+
return {
|
|
278
|
+
query: {},
|
|
279
|
+
equals: { kind: 'node', ids },
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function run(workflow, input, query, mutate) {
|
|
283
|
+
return createInlineWorkflowRunner().run(workflow, {
|
|
284
|
+
input,
|
|
285
|
+
capabilities: {},
|
|
286
|
+
query,
|
|
287
|
+
mutate,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
//# sourceMappingURL=workflows.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.test.js","sourceRoot":"","sources":["../../../tests/cross-layer/workflows.test.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAA;AACjD,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAEjD,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,6BAA6B,EAC7B,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,+BAA+B,GAChC,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,0BAA0B,EAAE,4BAA4B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AAE,MAAe,EAAE,GAAG,EAAE;KACvC,CAAA;AACH,CAAC;AAED,SAAS,GAAG,CACV,QAA2C,EAC3C,KAAY,EACZ,KAAoB,EACpB,MAAwB;IAExB,OAAO,0BAA0B,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE;QAChD,KAAK;QACL,YAAY,EAAE,EAAE;QAChB,KAAK;QACL,MAAM;KACP,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../tests/index.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tests/index.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NodeId } from '@astrale-os/sdk/graph/node';
|
|
2
|
+
import type { PathLike } from '@astrale-os/sdk/graph/path';
|
|
3
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
4
|
+
export type GraphEndpoint = {
|
|
5
|
+
readonly kind: 'id';
|
|
6
|
+
readonly value: NodeId;
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: 'path';
|
|
9
|
+
readonly value: PathLike;
|
|
10
|
+
};
|
|
11
|
+
/** Preserve the semantic distinction between a graph identity and an authored graph path. */
|
|
12
|
+
export declare function graphEndpointPath(endpoint: GraphEndpoint): Path;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../utils/graph-endpoint/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAA;AAEjD,MAAM,MAAM,aAAa,GACrB;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,CAAA;AAEvD,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAE/D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
2
|
+
/** Preserve the semantic distinction between a graph identity and an authored graph path. */
|
|
3
|
+
export function graphEndpointPath(endpoint) {
|
|
4
|
+
return endpoint.kind === 'id' ? Path.id(endpoint.value) : Path.from(endpoint.value);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../utils/graph-endpoint/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAA;AAMjD,6FAA6F;AAC7F,MAAM,UAAU,iBAAiB,CAAC,QAAuB;IACvD,OAAO,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AACrF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAsB,MAAM,2BAA2B,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../utils/query-page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAC7E,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../utils/query-page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NodeId } from '@astrale-os/sdk/graph/node';
|
|
2
|
+
import type { MutationQueryPreconditionInput } from '@astrale-os/sdk/mutation';
|
|
3
|
+
import type { QueryNodeAST, QueryResult } from '@astrale-os/sdk/query';
|
|
4
|
+
import type { QueryPages } from '@astrale-os/sdk/query';
|
|
5
|
+
export type NodeQueryGuard = Extract<MutationQueryPreconditionInput, {
|
|
6
|
+
readonly equals: {
|
|
7
|
+
readonly kind: 'node';
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
/** Project one canonical Node result without claiming that its continuation chain is complete. */
|
|
11
|
+
export declare function nodeIds(result: QueryResult, context: string): readonly NodeId[];
|
|
12
|
+
/** Project a complete, SDK-admitted continuation chain without hiding Query execution in a helper. */
|
|
13
|
+
export declare function completeNodeIds(pages: QueryPages, context: string): readonly NodeId[];
|
|
14
|
+
/** Bind one exhausted Node selection to the exact logical Query that observed it. */
|
|
15
|
+
export declare function completeNodeQueryGuard(pages: QueryPages, query: QueryNodeAST, context: string): NodeQueryGuard;
|
|
16
|
+
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../utils/query-page/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAA;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAIvD,MAAM,MAAM,cAAc,GAAG,OAAO,CAClC,8BAA8B,EAC9B;IAAE,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAC/C,CAAA;AAED,kGAAkG;AAClG,wBAAgB,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAG/E;AAED,sGAAsG;AACtG,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAIrF;AAED,qFAAqF;AACrF,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,MAAM,GACd,cAAc,CAKhB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { completeQuerySelection } from '@astrale-os/sdk/query';
|
|
2
|
+
/** Project one canonical Node result without claiming that its continuation chain is complete. */
|
|
3
|
+
export function nodeIds(result, context) {
|
|
4
|
+
if (result.kind !== 'nodes')
|
|
5
|
+
throw new TypeError(`Expected a Node ${context} query result.`);
|
|
6
|
+
return Object.freeze(result.nodes.map((projection) => projection.value.id));
|
|
7
|
+
}
|
|
8
|
+
/** Project a complete, SDK-admitted continuation chain without hiding Query execution in a helper. */
|
|
9
|
+
export function completeNodeIds(pages, context) {
|
|
10
|
+
const selection = completeQuerySelection(pages);
|
|
11
|
+
if (selection.kind !== 'node')
|
|
12
|
+
throw new TypeError(`Expected a Node ${context} query result.`);
|
|
13
|
+
return selection.ids;
|
|
14
|
+
}
|
|
15
|
+
/** Bind one exhausted Node selection to the exact logical Query that observed it. */
|
|
16
|
+
export function completeNodeQueryGuard(pages, query, context) {
|
|
17
|
+
return Object.freeze({
|
|
18
|
+
query,
|
|
19
|
+
equals: Object.freeze({ kind: 'node', ids: completeNodeIds(pages, context) }),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=nodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../../../utils/query-page/nodes.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAO9D,kGAAkG;AAClG,MAAM,UAAU,OAAO,CAAC,MAAmB,EAAE,OAAe;IAC1D,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO;QAAE,MAAM,IAAI,SAAS,CAAC,mBAAmB,OAAO,gBAAgB,CAAC,CAAA;IAC5F,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAA;AAC7E,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,eAAe,CAAC,KAAiB,EAAE,OAAe;IAChE,MAAM,SAAS,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAA;IAC/C,IAAI,SAAS,CAAC,IAAI,KAAK,MAAM;QAAE,MAAM,IAAI,SAAS,CAAC,mBAAmB,OAAO,gBAAgB,CAAC,CAAA;IAC9F,OAAO,SAAS,CAAC,GAAG,CAAA;AACtB,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,sBAAsB,CACpC,KAAiB,EACjB,KAAmB,EACnB,OAAe;IAEf,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,KAAK;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;KAC9E,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function ambiguousApplicationAssociation(count: number): never;
|
|
2
|
+
export declare function applicationInstallConflict(code?: string): never;
|
|
3
|
+
export declare function protectedShellApplication(): never;
|
|
4
|
+
export declare function applicationRemovalConflict(code: string): never;
|
|
5
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../workflows/application/errors.ts"],"names":[],"mappings":"AAEA,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAMpE;AAED,wBAAgB,0BAA0B,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAa/D;AAED,wBAAgB,yBAAyB,IAAI,KAAK,CAIjD;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAI9D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { InvocationError } from '@astrale-os/sdk';
|
|
2
|
+
export function ambiguousApplicationAssociation(count) {
|
|
3
|
+
throw new InvocationError('CONFLICT', 'Application association is ambiguous and requires repair.', { reason: { code: 'APPLICATION_ASSOCIATION_AMBIGUOUS', details: { count } } });
|
|
4
|
+
}
|
|
5
|
+
export function applicationInstallConflict(code) {
|
|
6
|
+
throw new InvocationError('CONFLICT', 'Application association was not committed.', code === undefined
|
|
7
|
+
? {}
|
|
8
|
+
: {
|
|
9
|
+
reason: {
|
|
10
|
+
code: 'APPLICATION_ASSOCIATION_REJECTED',
|
|
11
|
+
details: { rejection: code },
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export function protectedShellApplication() {
|
|
16
|
+
throw new InvocationError('CONFLICT', 'The deterministic Shell Application cannot be removed.', {
|
|
17
|
+
reason: { code: 'SHELL_APPLICATION_PROTECTED', details: {} },
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export function applicationRemovalConflict(code) {
|
|
21
|
+
throw new InvocationError('CONFLICT', 'Application removal was rejected.', {
|
|
22
|
+
reason: { code: 'APPLICATION_REMOVAL_REJECTED', details: { rejection: code } },
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../workflows/application/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,UAAU,+BAA+B,CAAC,KAAa;IAC3D,MAAM,IAAI,eAAe,CACvB,UAAU,EACV,2DAA2D,EAC3D,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,mCAAmC,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAC9E,CAAA;AACH,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,IAAa;IACtD,MAAM,IAAI,eAAe,CACvB,UAAU,EACV,4CAA4C,EAC5C,IAAI,KAAK,SAAS;QAChB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;YACE,MAAM,EAAE;gBACN,IAAI,EAAE,kCAAkC;gBACxC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;aAC7B;SACF,CACN,CAAA;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,MAAM,IAAI,eAAe,CAAC,UAAU,EAAE,wDAAwD,EAAE;QAC9F,MAAM,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE,OAAO,EAAE,EAAE,EAAE;KAC7D,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACrD,MAAM,IAAI,eAAe,CAAC,UAAU,EAAE,mCAAmC,EAAE;QACzE,MAAM,EAAE,EAAE,IAAI,EAAE,8BAA8B,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;KAC/E,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../workflows/application/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../workflows/application/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { InstallApplicationInput, InstallApplicationResult } from '#schema/application';
|
|
2
|
+
export declare const installApplicationWorkflow: import("@astrale-os/sdk").WorkflowDefinition<InstallApplicationInput, InstallApplicationResult, {}>;
|
|
3
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../workflows/application/install.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAW5F,eAAO,MAAM,0BAA0B,qGAuCrC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineWorkflow } from '@astrale-os/sdk/workflow';
|
|
2
|
+
import { installApplicationAssociation } from '#mutations/application';
|
|
3
|
+
import { observeApplicationAssociation } from '#queries/application';
|
|
4
|
+
import { classifyApplicationAssociation, materializeInstallApplicationResult, } from '#rules/application';
|
|
5
|
+
import { ambiguousApplicationAssociation, applicationInstallConflict } from './errors.js';
|
|
6
|
+
export const installApplicationWorkflow = defineWorkflow({
|
|
7
|
+
id: 'shell.application.install',
|
|
8
|
+
async run({ mutate, query, step }, input) {
|
|
9
|
+
const observed = await step.run('observe-association', () => query(observeApplicationAssociation, input));
|
|
10
|
+
const state = classifyApplicationAssociation(observed);
|
|
11
|
+
if (state.kind === 'conflict')
|
|
12
|
+
return ambiguousApplicationAssociation(state.count);
|
|
13
|
+
if (state.kind === 'present')
|
|
14
|
+
return result(state.application);
|
|
15
|
+
const changed = await step.run('install-association', () => mutate(installApplicationAssociation, { association: input, guard: observed.guard }));
|
|
16
|
+
if (changed.ok)
|
|
17
|
+
return result(changed.value.application);
|
|
18
|
+
if (changed.error.outcomeKnown)
|
|
19
|
+
return applicationInstallConflict(changed.error.code);
|
|
20
|
+
const recovered = await step.run('recover-association', () => query(observeApplicationAssociation, input));
|
|
21
|
+
const recoveredState = classifyApplicationAssociation(recovered);
|
|
22
|
+
if (recoveredState.kind === 'conflict') {
|
|
23
|
+
return ambiguousApplicationAssociation(recoveredState.count);
|
|
24
|
+
}
|
|
25
|
+
if (recoveredState.kind === 'present')
|
|
26
|
+
return result(recoveredState.application);
|
|
27
|
+
return applicationInstallConflict(changed.error.code);
|
|
28
|
+
function result(application) {
|
|
29
|
+
return materializeInstallApplicationResult({
|
|
30
|
+
application,
|
|
31
|
+
association: input,
|
|
32
|
+
space: observed.space,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../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CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAErF,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAC3D,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAC5C,CAAA;QACD,MAAM,cAAc,GAAG,8BAA8B,CAAC,SAAS,CAAC,CAAA;QAChE,IAAI,cAAc,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACvC,OAAO,+BAA+B,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC9D,CAAC;QACD,IAAI,cAAc,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;QAChF,OAAO,0BAA0B,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAErD,SAAS,MAAM,CACb,WAAqF;YAErF,OAAO,mCAAmC,CAAC;gBACzC,WAAW;gBACX,WAAW,EAAE,KAAK;gBAClB,KAAK,EAAE,QAAQ,CAAC,KAAK;aACtB,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NodeId } from '@astrale-os/sdk/graph/node';
|
|
2
|
+
import type { UninstallApplicationResult } from '#schema/application';
|
|
3
|
+
export declare const uninstallApplicationWorkflow: import("@astrale-os/sdk").WorkflowDefinition<NodeId, UninstallApplicationResult, {}>;
|
|
4
|
+
//# sourceMappingURL=uninstall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../workflows/application/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAIxD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAQrE,eAAO,MAAM,4BAA4B,sFAsBvC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineWorkflow } from '@astrale-os/sdk/workflow';
|
|
2
|
+
import { uninstallApplicationAssociation } from '#mutations/application';
|
|
3
|
+
import { observeApplicationPresence, resolveShellApplication } from '#queries/application';
|
|
4
|
+
import { decideApplicationRemoval } from '#rules/application';
|
|
5
|
+
import { applicationRemovalConflict, protectedShellApplication } from './errors.js';
|
|
6
|
+
export const uninstallApplicationWorkflow = defineWorkflow({
|
|
7
|
+
id: 'shell.application.uninstall',
|
|
8
|
+
async run({ mutate, query, step }, application) {
|
|
9
|
+
const shellApplication = await step.run('resolve-shell-application', () => query(resolveShellApplication, undefined));
|
|
10
|
+
const decision = decideApplicationRemoval({ application, shellApplication });
|
|
11
|
+
if (decision.kind === 'protected-shell-application')
|
|
12
|
+
return protectedShellApplication();
|
|
13
|
+
const removed = await step.run('remove-association', () => mutate(uninstallApplicationAssociation, application));
|
|
14
|
+
if (!removed.ok) {
|
|
15
|
+
if (removed.error.outcomeKnown)
|
|
16
|
+
return applicationRemovalConflict(removed.error.code);
|
|
17
|
+
const present = await step.run('recover-removal-outcome', () => query(observeApplicationPresence, application));
|
|
18
|
+
if (present)
|
|
19
|
+
return applicationRemovalConflict(removed.error.code);
|
|
20
|
+
return Object.freeze({});
|
|
21
|
+
}
|
|
22
|
+
return removed.value;
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=uninstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../../workflows/application/uninstall.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAIzD,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAA;AACxE,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AA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NodeId } from '@astrale-os/sdk/graph/node';
|
|
2
|
+
import type { GroupMembershipInput, GroupMembershipResult } from '#schema/group';
|
|
3
|
+
export interface AssignGroupUserInput {
|
|
4
|
+
readonly group: NodeId;
|
|
5
|
+
readonly input: GroupMembershipInput;
|
|
6
|
+
}
|
|
7
|
+
export declare const assignGroupUserWorkflow: import("@astrale-os/sdk").WorkflowDefinition<AssignGroupUserInput, GroupMembershipResult, {}>;
|
|
8
|
+
//# sourceMappingURL=assign-user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assign-user.d.ts","sourceRoot":"","sources":["../../../workflows/group/assign-user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAIxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAQhF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAA;CACrC;AAED,eAAO,MAAM,uBAAuB,+FA8BlC,CAAA"}
|