@astrale-domains/shell 0.1.0-beta.12 → 0.1.0-beta.13
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 +67 -46
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +1 -0
- package/dist/actions/user/index.d.ts +1 -0
- package/dist/actions/user/index.js +1 -0
- package/dist/actions/user/resolve-home.d.ts +3 -0
- package/dist/actions/user/resolve-home.js +19 -0
- package/dist/application.d.ts +6 -0
- package/dist/application.js +30 -0
- package/dist/entrypoints/application.d.ts +1 -0
- package/dist/entrypoints/application.js +1 -0
- package/dist/entrypoints/runtime.d.ts +1 -0
- package/dist/entrypoints/runtime.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/mutations/group/index.d.ts +1 -0
- package/dist/mutations/group/index.js +1 -0
- package/dist/mutations/group/membership.d.ts +19 -0
- package/dist/mutations/group/membership.js +19 -0
- package/dist/mutations/space/access.d.ts +25 -0
- package/dist/mutations/space/access.js +23 -0
- package/dist/mutations/space/default.d.ts +19 -0
- package/dist/mutations/space/default.js +23 -0
- package/dist/mutations/space/index.d.ts +2 -0
- package/dist/mutations/space/index.js +2 -0
- package/dist/mutations/user/index.d.ts +1 -0
- package/dist/mutations/user/index.js +1 -0
- package/dist/mutations/user/repair.d.ts +37 -0
- package/dist/mutations/user/repair.js +83 -0
- package/dist/queries/space/access.d.ts +9 -0
- package/dist/queries/space/access.js +12 -0
- package/dist/queries/space/admin.d.ts +9 -0
- package/dist/queries/space/admin.js +20 -0
- package/dist/queries/space/index.d.ts +3 -0
- package/dist/queries/space/index.js +3 -0
- package/dist/queries/space/member.d.ts +9 -0
- package/dist/queries/space/member.js +17 -0
- package/dist/queries/user/groups.d.ts +9 -0
- package/dist/queries/user/groups.js +17 -0
- package/dist/queries/user/home.d.ts +9 -0
- package/dist/queries/user/home.js +21 -0
- package/dist/queries/user/index.d.ts +5 -0
- package/dist/queries/user/index.js +5 -0
- package/dist/queries/user/owned-spaces.d.ts +9 -0
- package/dist/queries/user/owned-spaces.js +17 -0
- package/dist/queries/user/profile.d.ts +4 -0
- package/dist/queries/user/profile.js +16 -0
- package/dist/queries/user/setup.d.ts +13 -0
- package/dist/queries/user/setup.js +16 -0
- package/dist/runtime.d.ts +10 -0
- package/dist/runtime.js +17 -0
- package/dist/schema/domain/index.d.ts +69 -1640
- package/dist/schema/domain/index.js +3 -2
- package/dist/schema/group/class.d.ts +13 -321
- package/dist/schema/group/class.js +3 -2
- package/dist/schema/group/methods.d.ts +2 -2
- package/dist/schema/group/methods.js +1 -5
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/space/class.d.ts +10 -78
- package/dist/schema/space/class.js +3 -2
- package/dist/schema/space/methods.d.ts +4 -4
- package/dist/schema/space/methods.js +1 -5
- package/dist/schema/user/class.d.ts +14 -274
- package/dist/schema/user/class.js +5 -5
- package/dist/workflows/group/assign.d.ts +3 -0
- package/dist/workflows/group/assign.js +3 -0
- package/dist/workflows/group/change.d.ts +6 -0
- package/dist/workflows/group/change.js +31 -0
- package/dist/workflows/group/index.d.ts +3 -0
- package/dist/workflows/group/index.js +3 -0
- package/dist/workflows/group/unassign.d.ts +3 -0
- package/dist/workflows/group/unassign.js +3 -0
- package/dist/workflows/index.d.ts +3 -0
- package/dist/workflows/index.js +3 -0
- package/dist/workflows/setup/admin.d.ts +3 -0
- package/dist/workflows/setup/admin.js +3 -0
- package/dist/workflows/setup/index.d.ts +5 -0
- package/dist/workflows/setup/index.js +5 -0
- package/dist/workflows/setup/member.d.ts +3 -0
- package/dist/workflows/setup/member.js +3 -0
- package/dist/workflows/setup/plan.d.ts +18 -0
- package/dist/workflows/setup/plan.js +88 -0
- package/dist/workflows/setup/provision.d.ts +5 -0
- package/dist/workflows/setup/provision.js +57 -0
- package/dist/workflows/setup/run.d.ts +7 -0
- package/dist/workflows/setup/run.js +74 -0
- package/dist/workflows/space/access.d.ts +7 -0
- package/dist/workflows/space/access.js +41 -0
- package/dist/workflows/space/add.d.ts +3 -0
- package/dist/workflows/space/add.js +3 -0
- package/dist/workflows/space/default.d.ts +3 -0
- package/dist/workflows/space/default.js +37 -0
- package/dist/workflows/space/index.d.ts +4 -0
- package/dist/workflows/space/index.js +4 -0
- package/dist/workflows/space/remove.d.ts +3 -0
- package/dist/workflows/space/remove.js +3 -0
- package/package.json +27 -11
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
2
|
+
import { Query, defineQuery, queryResult } from '@astrale-os/sdk/query';
|
|
3
|
+
export const observeUserGroups = defineQuery()((domain) => ({
|
|
4
|
+
id: 'shell.user.groups',
|
|
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
|
+
pagination: { maximumPages: 64 },
|
|
11
|
+
project(pages, _user, { ast, complete }) {
|
|
12
|
+
return Object.freeze({
|
|
13
|
+
groups: queryResult.completeNodeValues(pages, 'Shell User Groups'),
|
|
14
|
+
guard: Object.freeze({ query: ast, equals: complete }),
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Node } from '@astrale-os/sdk/graph/node';
|
|
2
|
+
import type { QueryPrecondition } from '@astrale-os/sdk/mutation';
|
|
3
|
+
import type { QueryNodeAST, SingleQueryDefinition } from '@astrale-os/sdk/query';
|
|
4
|
+
import type { Shell } from '#schema';
|
|
5
|
+
export interface HomeObservation {
|
|
6
|
+
readonly spaces: readonly Node[];
|
|
7
|
+
readonly guard: QueryPrecondition<QueryNodeAST>;
|
|
8
|
+
}
|
|
9
|
+
export declare const observeHome: SingleQueryDefinition<Shell, string, HomeObservation>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
2
|
+
import { Query, defineQuery, queryResult } from '@astrale-os/sdk/query';
|
|
3
|
+
export const observeHome = defineQuery()((domain) => ({
|
|
4
|
+
id: 'shell.user.home',
|
|
5
|
+
build(user) {
|
|
6
|
+
const source = Query.from({ nodes: [Path.parse(user)] });
|
|
7
|
+
const spaces = source.expand({
|
|
8
|
+
via: [domain.classes.default_space],
|
|
9
|
+
direction: 'outgoing',
|
|
10
|
+
});
|
|
11
|
+
return spaces.select({ kind: 'nodes', binding: spaces.node, projection: { kind: 'value' } });
|
|
12
|
+
},
|
|
13
|
+
page: { size: 2 },
|
|
14
|
+
pagination: { maximumPages: 2 },
|
|
15
|
+
project(pages, _user, { ast, complete }) {
|
|
16
|
+
return Object.freeze({
|
|
17
|
+
spaces: queryResult.completeNodeValues(pages, 'Shell User home'),
|
|
18
|
+
guard: Object.freeze({ query: ast, equals: complete }),
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { observeUserGroups, type UserGroupsObservation } from './groups.js';
|
|
2
|
+
export { observeHome, type HomeObservation } from './home.js';
|
|
3
|
+
export { observeOwnedSpaces, type OwnedSpacesObservation } from './owned-spaces.js';
|
|
4
|
+
export { readUserProfile } from './profile.js';
|
|
5
|
+
export { observeUserSetup, type UserSetupObservation } from './setup.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Node } from '@astrale-os/sdk/graph/node';
|
|
2
|
+
import type { QueryPrecondition } from '@astrale-os/sdk/mutation';
|
|
3
|
+
import type { QueryNodeAST, SingleQueryDefinition } from '@astrale-os/sdk/query';
|
|
4
|
+
import type { Shell } from '#schema';
|
|
5
|
+
export interface OwnedSpacesObservation {
|
|
6
|
+
readonly spaces: readonly Node[];
|
|
7
|
+
readonly guard: QueryPrecondition<QueryNodeAST>;
|
|
8
|
+
}
|
|
9
|
+
export declare const observeOwnedSpaces: SingleQueryDefinition<Shell, string, OwnedSpacesObservation>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
2
|
+
import { Query, defineQuery, queryResult } from '@astrale-os/sdk/query';
|
|
3
|
+
export const observeOwnedSpaces = defineQuery()((domain) => ({
|
|
4
|
+
id: 'shell.user.owned-spaces',
|
|
5
|
+
build(user) {
|
|
6
|
+
const source = Query.from({ nodes: [Path.parse(user)] });
|
|
7
|
+
const spaces = source.expand({ via: [domain.classes.owns_space], direction: 'outgoing' });
|
|
8
|
+
return spaces.select({ kind: 'nodes', binding: spaces.node, projection: { kind: 'value' } });
|
|
9
|
+
},
|
|
10
|
+
pagination: { maximumPages: 64 },
|
|
11
|
+
project(pages, _user, { ast, complete }) {
|
|
12
|
+
return Object.freeze({
|
|
13
|
+
spaces: queryResult.completeNodeValues(pages, 'Shell User owned Spaces'),
|
|
14
|
+
guard: Object.freeze({ query: ast, equals: complete }),
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/sdk/graph/path';
|
|
2
|
+
import { Query, defineQuery, queryResult, } from '@astrale-os/sdk/query';
|
|
3
|
+
export const readUserProfile = defineQuery()((domain) => ({
|
|
4
|
+
id: 'shell.user.profile',
|
|
5
|
+
build(user) {
|
|
6
|
+
return Query.from({ nodes: [Path.parse(user)] })
|
|
7
|
+
.filter({ class: domain.classes.User })
|
|
8
|
+
.select({
|
|
9
|
+
kind: 'nodes',
|
|
10
|
+
projection: { kind: 'value' },
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
project(result) {
|
|
14
|
+
return queryResult.exactlyOneNode(result, 'Shell User profile');
|
|
15
|
+
},
|
|
16
|
+
}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Node } from '@astrale-os/sdk/graph/node';
|
|
2
|
+
import { type CompositeQueryDefinition } from '@astrale-os/sdk/query';
|
|
3
|
+
import type { Shell } from '#schema';
|
|
4
|
+
import type { UserGroupsObservation } from './groups.js';
|
|
5
|
+
import { type HomeObservation } from './home.js';
|
|
6
|
+
import { type OwnedSpacesObservation } from './owned-spaces.js';
|
|
7
|
+
export interface UserSetupObservation {
|
|
8
|
+
readonly profile: Node;
|
|
9
|
+
readonly home: HomeObservation;
|
|
10
|
+
readonly ownedSpaces: OwnedSpacesObservation;
|
|
11
|
+
readonly groups: UserGroupsObservation;
|
|
12
|
+
}
|
|
13
|
+
export declare const observeUserSetup: CompositeQueryDefinition<Shell, string, UserSetupObservation>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineCompositeQuery } from '@astrale-os/sdk/query';
|
|
2
|
+
import { observeUserGroups } from './groups.js';
|
|
3
|
+
import { observeHome } from './home.js';
|
|
4
|
+
import { observeOwnedSpaces } from './owned-spaces.js';
|
|
5
|
+
import { readUserProfile } from './profile.js';
|
|
6
|
+
export const observeUserSetup = defineCompositeQuery()(() => ({
|
|
7
|
+
id: 'shell.user.setup',
|
|
8
|
+
compose({ combine, query }, userId) {
|
|
9
|
+
return combine({
|
|
10
|
+
profile: query('profile', readUserProfile, userId),
|
|
11
|
+
home: query('home', observeHome, userId),
|
|
12
|
+
ownedSpaces: query('owned-spaces', observeOwnedSpaces, userId),
|
|
13
|
+
groups: query('groups', observeUserGroups, userId),
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Runtime } from '@astrale-os/sdk/runtime';
|
|
2
|
+
import type { ShellSchema } from './schema/index.js';
|
|
3
|
+
declare const integrations: {};
|
|
4
|
+
declare const initialize: () => {
|
|
5
|
+
providers: {};
|
|
6
|
+
};
|
|
7
|
+
declare const actions: readonly [import("@astrale-os/sdk/action").ActionDefinition<import("@astrale-os/sdk/schema").DefinedSchema<"shell.astrale.ai", import("@astrale-os/sdk/schema").ResolvedDomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>, "User.resolveHome", Readonly<Record<never, never>>>];
|
|
8
|
+
declare const workflows: readonly [import("@astrale-os/sdk/workflow").WorkflowDefinition<import("@astrale-os/sdk/schema").DefinedSchema<"shell.astrale.ai", import("@astrale-os/sdk/schema").ResolvedDomainOfInput<"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").DefinedSchema<"shell.astrale.ai", import("@astrale-os/sdk/schema").ResolvedDomainOfInput<"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").DefinedSchema<"shell.astrale.ai", import("@astrale-os/sdk/schema").ResolvedDomainOfInput<"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").DefinedSchema<"shell.astrale.ai", import("@astrale-os/sdk/schema").ResolvedDomainOfInput<"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").DefinedSchema<"shell.astrale.ai", import("@astrale-os/sdk/schema").ResolvedDomainOfInput<"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").DefinedSchema<"shell.astrale.ai", import("@astrale-os/sdk/schema").ResolvedDomainOfInput<"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").DefinedSchema<"shell.astrale.ai", import("@astrale-os/sdk/schema").ResolvedDomainOfInput<"shell.astrale.ai", import("./schema/domain/index.js").ShellSchemaInput>>, "Space.setDefault", Readonly<Record<never, never>>>];
|
|
9
|
+
declare const runtime: Runtime<typeof ShellSchema, typeof integrations, typeof initialize, typeof actions, typeof workflows>;
|
|
10
|
+
export default runtime;
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineRuntime } from '@astrale-os/sdk/runtime';
|
|
2
|
+
import { resolveHomeAction } from './actions/index.js';
|
|
3
|
+
import { addSpaceUserWorkflow, assignGroupUserWorkflow, removeSpaceUserWorkflow, setDefaultSpaceWorkflow, setupAdminWorkflow, setupMemberWorkflow, unassignGroupUserWorkflow, } from './workflows/index.js';
|
|
4
|
+
const integrations = {};
|
|
5
|
+
const initialize = () => ({ providers: {} });
|
|
6
|
+
const actions = [resolveHomeAction];
|
|
7
|
+
const workflows = [
|
|
8
|
+
setupAdminWorkflow,
|
|
9
|
+
setupMemberWorkflow,
|
|
10
|
+
assignGroupUserWorkflow,
|
|
11
|
+
unassignGroupUserWorkflow,
|
|
12
|
+
addSpaceUserWorkflow,
|
|
13
|
+
removeSpaceUserWorkflow,
|
|
14
|
+
setDefaultSpaceWorkflow,
|
|
15
|
+
];
|
|
16
|
+
const runtime = defineRuntime()({ integrations, initialize, actions, workflows });
|
|
17
|
+
export default runtime;
|