@astrale-domains/issues 0.1.2 → 0.1.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/CHANGELOG.md +78 -0
- package/README.md +65 -15
- package/dist/schema/.runtime/states/issue/index.d.ts +27 -0
- package/dist/schema/.runtime/states/issue/index.js +11 -0
- package/dist/schema/index.d.ts +6 -7
- package/dist/schema/index.js +5 -6
- package/dist/schema/{comment/relationships.d.ts → modules/comment/classes/comment-authored-by.d.ts} +2 -18
- package/dist/schema/modules/comment/classes/comment-authored-by.js +9 -0
- package/dist/schema/{comment/class.d.ts → modules/comment/classes/comment.d.ts} +36 -4
- package/dist/schema/modules/comment/classes/comment.js +17 -0
- package/dist/schema/modules/comment/classes/index.d.ts +3 -0
- package/dist/schema/modules/comment/classes/index.js +3 -0
- package/dist/schema/modules/comment/classes/issue-has-comment.d.ts +16 -0
- package/dist/schema/modules/comment/classes/issue-has-comment.js +10 -0
- package/dist/schema/modules/comment/functions/delete-comment.d.ts +7 -0
- package/dist/schema/modules/comment/functions/delete-comment.js +11 -0
- package/dist/schema/modules/comment/functions/edit-comment.d.ts +9 -0
- package/dist/schema/modules/comment/functions/edit-comment.js +11 -0
- package/dist/schema/modules/comment/functions/index.d.ts +2 -0
- package/dist/schema/modules/comment/functions/index.js +2 -0
- package/dist/schema/modules/comment/index.d.ts +4 -0
- package/dist/schema/modules/comment/index.js +4 -0
- package/dist/schema/modules/comment/policies/contribute-to-comment.d.ts +1 -0
- package/dist/schema/modules/comment/policies/contribute-to-comment.js +12 -0
- package/dist/schema/modules/comment/policies/edit-own-comment.d.ts +1 -0
- package/dist/schema/modules/comment/policies/edit-own-comment.js +6 -0
- package/dist/schema/modules/comment/policies/index.d.ts +4 -0
- package/dist/schema/modules/comment/policies/index.js +4 -0
- package/dist/schema/modules/comment/policies/traverse-comment-relationship.d.ts +1 -0
- package/dist/schema/modules/comment/policies/traverse-comment-relationship.js +17 -0
- package/dist/schema/modules/comment/policies/traverse-issue-comment.d.ts +1 -0
- package/dist/schema/modules/comment/policies/traverse-issue-comment.js +14 -0
- package/dist/schema/modules/comment/types/comment.d.ts +5 -0
- package/dist/schema/modules/comment/types/comment.js +6 -0
- package/dist/schema/modules/comment/types/index.d.ts +1 -0
- package/dist/schema/modules/comment/types/index.js +1 -0
- package/dist/schema/modules/issue/classes/index.d.ts +5 -0
- package/dist/schema/modules/issue/classes/index.js +5 -0
- package/dist/schema/modules/issue/classes/issue-assigned-to.d.ts +16 -0
- package/dist/schema/modules/issue/classes/issue-assigned-to.js +9 -0
- package/dist/schema/modules/issue/classes/issue-reported-by.d.ts +16 -0
- package/dist/schema/modules/issue/classes/issue-reported-by.js +9 -0
- package/dist/schema/modules/issue/classes/issue-subtask-of.d.ts +19 -0
- package/dist/schema/modules/issue/classes/issue-subtask-of.js +10 -0
- package/dist/schema/modules/issue/classes/issue.d.ts +258 -0
- package/dist/schema/modules/issue/classes/issue.js +35 -0
- package/dist/schema/modules/issue/classes/project-contains-issue.d.ts +16 -0
- package/dist/schema/modules/issue/classes/project-contains-issue.js +10 -0
- package/dist/schema/modules/issue/functions/add-issue-comment.d.ts +9 -0
- package/dist/schema/modules/issue/functions/add-issue-comment.js +11 -0
- package/dist/schema/modules/issue/functions/archive-issue.d.ts +7 -0
- package/dist/schema/modules/issue/functions/archive-issue.js +11 -0
- package/dist/schema/modules/issue/functions/assign-issue.d.ts +9 -0
- package/dist/schema/modules/issue/functions/assign-issue.js +11 -0
- package/dist/schema/modules/issue/functions/index.d.ts +7 -0
- package/dist/schema/modules/issue/functions/index.js +7 -0
- package/dist/schema/modules/issue/functions/set-issue-parent.d.ts +9 -0
- package/dist/schema/modules/issue/functions/set-issue-parent.js +11 -0
- package/dist/schema/modules/issue/functions/set-issue-tags.d.ts +9 -0
- package/dist/schema/modules/issue/functions/set-issue-tags.js +11 -0
- package/dist/schema/modules/issue/functions/transition-issue.d.ts +22 -0
- package/dist/schema/modules/issue/functions/transition-issue.js +20 -0
- package/dist/schema/modules/issue/functions/update-issue.d.ts +16 -0
- package/dist/schema/modules/issue/functions/update-issue.js +15 -0
- package/dist/schema/modules/issue/index.d.ts +4 -0
- package/dist/schema/modules/issue/index.js +4 -0
- package/dist/schema/modules/issue/policies/contribute-to-issue.d.ts +1 -0
- package/dist/schema/modules/issue/policies/contribute-to-issue.js +10 -0
- package/dist/schema/modules/issue/policies/index.d.ts +5 -0
- package/dist/schema/modules/issue/policies/index.js +5 -0
- package/dist/schema/modules/issue/policies/traverse-issue-assignee.d.ts +1 -0
- package/dist/schema/modules/issue/policies/traverse-issue-assignee.js +14 -0
- package/dist/schema/modules/issue/policies/traverse-issue-parent.d.ts +1 -0
- package/dist/schema/modules/issue/policies/traverse-issue-parent.js +14 -0
- package/dist/schema/modules/issue/policies/traverse-issue-reporter.d.ts +1 -0
- package/dist/schema/modules/issue/policies/traverse-issue-reporter.js +14 -0
- package/dist/schema/modules/issue/policies/traverse-project-issue.d.ts +1 -0
- package/dist/schema/modules/issue/policies/traverse-project-issue.js +7 -0
- package/dist/schema/modules/issue/types/index.d.ts +1 -0
- package/dist/schema/modules/issue/types/index.js +1 -0
- package/dist/schema/modules/issue/types/issue.d.ts +10 -0
- package/dist/schema/modules/issue/types/issue.js +12 -0
- package/dist/schema/modules/project/classes/index.d.ts +3 -0
- package/dist/schema/modules/project/classes/index.js +3 -0
- package/dist/schema/modules/project/classes/project-has-member.d.ts +16 -0
- package/dist/schema/modules/project/classes/project-has-member.js +9 -0
- package/dist/schema/{tracker/relationships.d.ts → modules/project/classes/project-owned-by.d.ts} +5 -5
- package/dist/schema/modules/project/classes/project-owned-by.js +9 -0
- package/dist/schema/modules/project/classes/project.d.ts +283 -0
- package/dist/schema/modules/project/classes/project.js +35 -0
- package/dist/schema/modules/project/functions/add-project-member.d.ts +10 -0
- package/dist/schema/modules/project/functions/add-project-member.js +12 -0
- package/dist/schema/modules/project/functions/archive-project.d.ts +7 -0
- package/dist/schema/modules/project/functions/archive-project.js +11 -0
- package/dist/schema/modules/project/functions/create-project-issue.d.ts +16 -0
- package/dist/schema/modules/project/functions/create-project-issue.js +15 -0
- package/dist/schema/modules/project/functions/create-project-tag.d.ts +12 -0
- package/dist/schema/modules/project/functions/create-project-tag.js +14 -0
- package/dist/schema/modules/project/functions/create-project.d.ts +14 -0
- package/dist/schema/modules/project/functions/create-project.js +14 -0
- package/dist/schema/modules/project/functions/index.d.ts +8 -0
- package/dist/schema/modules/project/functions/index.js +8 -0
- package/dist/schema/modules/project/functions/list-projects.d.ts +25 -0
- package/dist/schema/modules/project/functions/list-projects.js +16 -0
- package/dist/schema/modules/project/functions/remove-project-member.d.ts +10 -0
- package/dist/schema/modules/project/functions/remove-project-member.js +12 -0
- package/dist/schema/modules/project/functions/update-project.d.ts +13 -0
- package/dist/schema/modules/project/functions/update-project.js +14 -0
- package/dist/schema/modules/project/index.d.ts +4 -0
- package/dist/schema/modules/project/index.js +4 -0
- package/dist/schema/modules/project/policies/contribute-to-project.d.ts +1 -0
- package/dist/schema/modules/project/policies/contribute-to-project.js +7 -0
- package/dist/schema/modules/project/policies/index.d.ts +4 -0
- package/dist/schema/modules/project/policies/index.js +4 -0
- package/dist/schema/modules/project/policies/manage-project.d.ts +1 -0
- package/dist/schema/modules/project/policies/manage-project.js +6 -0
- package/dist/schema/modules/project/policies/traverse-project-member.d.ts +1 -0
- package/dist/schema/modules/project/policies/traverse-project-member.js +7 -0
- package/dist/schema/modules/project/policies/traverse-project-owner.d.ts +1 -0
- package/dist/schema/modules/project/policies/traverse-project-owner.js +7 -0
- package/dist/schema/modules/project/types/index.d.ts +2 -0
- package/dist/schema/modules/project/types/index.js +2 -0
- package/dist/schema/modules/project/types/membership-change.d.ts +6 -0
- package/dist/schema/modules/project/types/membership-change.js +7 -0
- package/dist/schema/modules/project/types/project.d.ts +8 -0
- package/dist/schema/modules/project/types/project.js +9 -0
- package/dist/schema/modules/tag/classes/index.d.ts +3 -0
- package/dist/schema/modules/tag/classes/index.js +3 -0
- package/dist/schema/modules/tag/classes/issue-tagged-with.d.ts +16 -0
- package/dist/schema/modules/tag/classes/issue-tagged-with.js +10 -0
- package/dist/schema/modules/tag/classes/project-contains-tag.d.ts +16 -0
- package/dist/schema/modules/tag/classes/project-contains-tag.js +10 -0
- package/dist/schema/{tag/class.d.ts → modules/tag/classes/tag.d.ts} +40 -3
- package/dist/schema/modules/tag/classes/tag.js +16 -0
- package/dist/schema/modules/tag/functions/delete-tag.d.ts +7 -0
- package/dist/schema/modules/tag/functions/delete-tag.js +11 -0
- package/dist/schema/modules/tag/functions/edit-tag.d.ts +12 -0
- package/dist/schema/modules/tag/functions/edit-tag.js +14 -0
- package/dist/schema/modules/tag/functions/index.d.ts +2 -0
- package/dist/schema/modules/tag/functions/index.js +2 -0
- package/dist/schema/modules/tag/index.d.ts +4 -0
- package/dist/schema/modules/tag/index.js +4 -0
- package/dist/schema/modules/tag/policies/contribute-to-tag.d.ts +1 -0
- package/dist/schema/modules/tag/policies/contribute-to-tag.js +10 -0
- package/dist/schema/modules/tag/policies/index.d.ts +4 -0
- package/dist/schema/modules/tag/policies/index.js +4 -0
- package/dist/schema/modules/tag/policies/manage-tag.d.ts +1 -0
- package/dist/schema/modules/tag/policies/manage-tag.js +10 -0
- package/dist/schema/modules/tag/policies/traverse-issue-tag.d.ts +1 -0
- package/dist/schema/modules/tag/policies/traverse-issue-tag.js +14 -0
- package/dist/schema/modules/tag/policies/traverse-project-tag.d.ts +1 -0
- package/dist/schema/modules/tag/policies/traverse-project-tag.js +7 -0
- package/dist/schema/modules/tag/types/index.d.ts +1 -0
- package/dist/schema/modules/tag/types/index.js +1 -0
- package/dist/schema/modules/tag/types/tag.d.ts +7 -0
- package/dist/schema/modules/tag/types/tag.js +8 -0
- package/dist/schema/schema.d.ts +902 -0
- package/dist/schema/schema.js +49 -0
- package/dist/schema/types/index.js +1 -0
- package/dist/schema/types/node-id.js +2 -0
- package/package.json +28 -20
- package/dist/schema/application/functions.js +0 -156
- package/dist/schema/application/index.d.ts +0 -701
- package/dist/schema/application/index.js +0 -49
- package/dist/schema/command/class.d.ts +0 -38
- package/dist/schema/command/class.js +0 -13
- package/dist/schema/command/index.d.ts +0 -2
- package/dist/schema/command/index.js +0 -2
- package/dist/schema/command/relationships.d.ts +0 -32
- package/dist/schema/command/relationships.js +0 -14
- package/dist/schema/comment/class.js +0 -7
- package/dist/schema/comment/index.d.ts +0 -2
- package/dist/schema/comment/index.js +0 -2
- package/dist/schema/comment/relationships.js +0 -11
- package/dist/schema/issue/class.d.ts +0 -74
- package/dist/schema/issue/class.js +0 -17
- package/dist/schema/issue/index.d.ts +0 -2
- package/dist/schema/issue/index.js +0 -2
- package/dist/schema/issue/relationships.d.ts +0 -112
- package/dist/schema/issue/relationships.js +0 -23
- package/dist/schema/tag/class.js +0 -10
- package/dist/schema/tag/index.d.ts +0 -2
- package/dist/schema/tag/index.js +0 -2
- package/dist/schema/tag/relationships.d.ts +0 -32
- package/dist/schema/tag/relationships.js +0 -12
- package/dist/schema/tracker/class.d.ts +0 -73
- package/dist/schema/tracker/class.js +0 -10
- package/dist/schema/tracker/index.d.ts +0 -2
- package/dist/schema/tracker/index.js +0 -2
- package/dist/schema/tracker/relationships.js +0 -7
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { tagValue } from '../../tag/index.js';
|
|
4
|
+
import { ManageProject } from '../policies/manage-project.js';
|
|
5
|
+
export const createProjectTagMethod = method({
|
|
6
|
+
description: 'Create one Project-local Tag.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(ManageProject, self),
|
|
9
|
+
input: z.strictObject({
|
|
10
|
+
name: z.string().min(1).max(64),
|
|
11
|
+
color: z.string().optional(),
|
|
12
|
+
}),
|
|
13
|
+
output: tagValue,
|
|
14
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const createProjectMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
key: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string | undefined;
|
|
5
|
+
}, {
|
|
6
|
+
readonly mode: 'value';
|
|
7
|
+
readonly value: {
|
|
8
|
+
id: string;
|
|
9
|
+
key: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
archived: boolean;
|
|
13
|
+
};
|
|
14
|
+
}, "authenticated", true, "default">>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { projectValue } from '../types/project.js';
|
|
4
|
+
export const createProjectMethod = method({
|
|
5
|
+
description: 'Create one Project owned by the authenticated caller.',
|
|
6
|
+
static: true,
|
|
7
|
+
auth: 'authenticated',
|
|
8
|
+
input: z.strictObject({
|
|
9
|
+
key: z.string().min(1).max(40),
|
|
10
|
+
name: z.string().min(1).max(120),
|
|
11
|
+
description: z.string().max(5_000).optional(),
|
|
12
|
+
}),
|
|
13
|
+
output: projectValue,
|
|
14
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { addProjectMemberMethod } from './add-project-member.js';
|
|
2
|
+
export { archiveProjectMethod } from './archive-project.js';
|
|
3
|
+
export { createProjectIssueMethod } from './create-project-issue.js';
|
|
4
|
+
export { createProjectTagMethod } from './create-project-tag.js';
|
|
5
|
+
export { createProjectMethod } from './create-project.js';
|
|
6
|
+
export { listProjectsMethod } from './list-projects.js';
|
|
7
|
+
export { removeProjectMemberMethod } from './remove-project-member.js';
|
|
8
|
+
export { updateProjectMethod } from './update-project.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { addProjectMemberMethod } from './add-project-member.js';
|
|
2
|
+
export { archiveProjectMethod } from './archive-project.js';
|
|
3
|
+
export { createProjectIssueMethod } from './create-project-issue.js';
|
|
4
|
+
export { createProjectTagMethod } from './create-project-tag.js';
|
|
5
|
+
export { createProjectMethod } from './create-project.js';
|
|
6
|
+
export { listProjectsMethod } from './list-projects.js';
|
|
7
|
+
export { removeProjectMemberMethod } from './remove-project-member.js';
|
|
8
|
+
export { updateProjectMethod } from './update-project.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const listProjectsMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
2
|
+
readonly mode: 'value';
|
|
3
|
+
readonly value: {
|
|
4
|
+
projects: {
|
|
5
|
+
id: string;
|
|
6
|
+
key: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
archived: boolean;
|
|
10
|
+
issues: {
|
|
11
|
+
id: string;
|
|
12
|
+
reference: string;
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
status: "accepted" | "closed" | "deferred" | "open" | "resolved";
|
|
16
|
+
priority: number;
|
|
17
|
+
archived: boolean;
|
|
18
|
+
comments: {
|
|
19
|
+
id: string;
|
|
20
|
+
body: string;
|
|
21
|
+
}[];
|
|
22
|
+
}[];
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
}, "authenticated", true, "default">>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { commentValue } from '../../comment/index.js';
|
|
4
|
+
import { issueValue } from '../../issue/index.js';
|
|
5
|
+
import { projectValue } from '../types/project.js';
|
|
6
|
+
export const listProjectsMethod = method({
|
|
7
|
+
description: 'List the caller-visible Projects with their Issues.',
|
|
8
|
+
static: true,
|
|
9
|
+
auth: 'authenticated',
|
|
10
|
+
input: z.strictObject({}),
|
|
11
|
+
output: z.strictObject({
|
|
12
|
+
projects: z.array(projectValue.extend({
|
|
13
|
+
issues: z.array(issueValue.extend({ comments: z.array(commentValue) })),
|
|
14
|
+
})),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const removeProjectMemberMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
memberId: string;
|
|
3
|
+
}, {
|
|
4
|
+
readonly mode: 'value';
|
|
5
|
+
readonly value: {
|
|
6
|
+
projectId: string;
|
|
7
|
+
memberId: string;
|
|
8
|
+
changed: boolean;
|
|
9
|
+
};
|
|
10
|
+
}, "authorized", false, "default">>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { nodeIdValue } from '../../../types/index.js';
|
|
4
|
+
import { ManageProject } from '../policies/manage-project.js';
|
|
5
|
+
import { membershipChangeValue } from '../types/membership-change.js';
|
|
6
|
+
export const removeProjectMemberMethod = method({
|
|
7
|
+
description: 'Remove one unassigned Identity from Project membership.',
|
|
8
|
+
auth: 'authorized',
|
|
9
|
+
policy: ({ check, self }) => check(ManageProject, self),
|
|
10
|
+
input: z.strictObject({ memberId: nodeIdValue }),
|
|
11
|
+
output: membershipChangeValue,
|
|
12
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const updateProjectMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
name?: string | undefined;
|
|
3
|
+
description?: string | undefined;
|
|
4
|
+
}, {
|
|
5
|
+
readonly mode: 'value';
|
|
6
|
+
readonly value: {
|
|
7
|
+
id: string;
|
|
8
|
+
key: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
archived: boolean;
|
|
12
|
+
};
|
|
13
|
+
}, "authorized", false, "default">>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ManageProject } from '../policies/manage-project.js';
|
|
4
|
+
import { projectValue } from '../types/project.js';
|
|
5
|
+
export const updateProjectMethod = method({
|
|
6
|
+
description: 'Update mutable Project metadata.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(ManageProject, self),
|
|
9
|
+
input: z.strictObject({
|
|
10
|
+
name: z.string().min(1).max(120).optional(),
|
|
11
|
+
description: z.string().max(5_000).optional(),
|
|
12
|
+
}),
|
|
13
|
+
output: projectValue,
|
|
14
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { membershipChangeValue, projectValue } from './types/index.js';
|
|
2
|
+
export { project_has_member, project_owned_by, Project } from './classes/index.js';
|
|
3
|
+
export { addProjectMemberMethod, archiveProjectMethod, createProjectIssueMethod, createProjectTagMethod, createProjectMethod, listProjectsMethod, removeProjectMemberMethod, updateProjectMethod, } from './functions/index.js';
|
|
4
|
+
export { ContributeToProject, ManageProject, TraverseProjectMember, TraverseProjectOwner, } from './policies/index.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { membershipChangeValue, projectValue } from './types/index.js';
|
|
2
|
+
export { project_has_member, project_owned_by, Project } from './classes/index.js';
|
|
3
|
+
export { addProjectMemberMethod, archiveProjectMethod, createProjectIssueMethod, createProjectTagMethod, createProjectMethod, listProjectsMethod, removeProjectMemberMethod, updateProjectMethod, } from './functions/index.js';
|
|
4
|
+
export { ContributeToProject, ManageProject, TraverseProjectMember, TraverseProjectOwner, } from './policies/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ContributeToProject: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { project_has_member } from '../classes/project-has-member.js';
|
|
3
|
+
import { project_owned_by } from '../classes/project-owned-by.js';
|
|
4
|
+
export const ContributeToProject = policy({
|
|
5
|
+
description: 'The caller owns or is a member of this Project.',
|
|
6
|
+
match: ({ anyOf, edge, object, subject }) => anyOf(edge({ source: subject, class: () => project_owned_by, target: object }), edge({ source: subject, class: () => project_has_member, target: object })),
|
|
7
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ManageProject: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { project_owned_by } from '../classes/project-owned-by.js';
|
|
3
|
+
export const ManageProject = policy({
|
|
4
|
+
description: 'The caller is the exact owner of this Project.',
|
|
5
|
+
match: ({ edge, object, subject }) => edge({ source: subject, class: () => project_owned_by, target: object }),
|
|
6
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TraverseProjectMember: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { project_has_member } from '../classes/project-has-member.js';
|
|
3
|
+
import { project_owned_by } from '../classes/project-owned-by.js';
|
|
4
|
+
export const TraverseProjectMember = policy({
|
|
5
|
+
description: 'Project membership is visible only to that Project owner and members.',
|
|
6
|
+
match: ({ allOf, anyOf, edge, source, subject, target }) => anyOf(allOf(edge({ source, class: () => project_has_member, target }), edge({ source: subject, class: () => project_owned_by, target })), allOf(edge({ source, class: () => project_has_member, target }), edge({ source: subject, class: () => project_has_member, target }))),
|
|
7
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TraverseProjectOwner: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { project_has_member } from '../classes/project-has-member.js';
|
|
3
|
+
import { project_owned_by } from '../classes/project-owned-by.js';
|
|
4
|
+
export const TraverseProjectOwner = policy({
|
|
5
|
+
description: 'Project ownership is visible only to that Project owner and members.',
|
|
6
|
+
match: ({ allOf, anyOf, edge, source, subject, target }) => anyOf(allOf(edge({ source, class: () => project_owned_by, target }), edge({ source: subject, class: () => project_owned_by, target })), allOf(edge({ source, class: () => project_owned_by, target }), edge({ source: subject, class: () => project_has_member, target }))),
|
|
7
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { nodeIdValue } from '../../../types/index.js';
|
|
3
|
+
export const projectValue = z.strictObject({
|
|
4
|
+
id: nodeIdValue,
|
|
5
|
+
key: z.string().min(2).max(10),
|
|
6
|
+
name: z.string().min(1).max(120),
|
|
7
|
+
description: z.string().max(5_000),
|
|
8
|
+
archived: z.boolean(),
|
|
9
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const issue_tagged_with: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
2
|
+
readonly depth: 0;
|
|
3
|
+
readonly abstract: false;
|
|
4
|
+
readonly extends: readonly [];
|
|
5
|
+
readonly properties: never;
|
|
6
|
+
readonly source: {
|
|
7
|
+
readonly as: "issue";
|
|
8
|
+
readonly outgoing: "0..*";
|
|
9
|
+
};
|
|
10
|
+
readonly target: {
|
|
11
|
+
readonly as: "tag";
|
|
12
|
+
readonly incoming: "0..*";
|
|
13
|
+
};
|
|
14
|
+
readonly constraints: Record<never, never>;
|
|
15
|
+
readonly effectiveProperties: never;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { Issue } from '../../issue/index.js';
|
|
3
|
+
import { TraverseIssueTag } from '../policies/traverse-issue-tag.js';
|
|
4
|
+
import { Tag } from './tag.js';
|
|
5
|
+
export const issue_tagged_with = edgeClass.directed({
|
|
6
|
+
description: 'One Issue is classified by one Tag from the same Project.',
|
|
7
|
+
source: { as: 'issue', accepts: [() => Issue], outgoing: '0..*' },
|
|
8
|
+
target: { as: 'tag', accepts: [() => Tag], incoming: '0..*' },
|
|
9
|
+
policies: { traverse: () => TraverseIssueTag },
|
|
10
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const project_contains_tag: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
2
|
+
readonly depth: 0;
|
|
3
|
+
readonly abstract: false;
|
|
4
|
+
readonly extends: readonly [];
|
|
5
|
+
readonly properties: never;
|
|
6
|
+
readonly source: {
|
|
7
|
+
readonly as: "project";
|
|
8
|
+
readonly outgoing: "0..*";
|
|
9
|
+
};
|
|
10
|
+
readonly target: {
|
|
11
|
+
readonly as: "tag";
|
|
12
|
+
readonly incoming: "1";
|
|
13
|
+
};
|
|
14
|
+
readonly constraints: Record<never, never>;
|
|
15
|
+
readonly effectiveProperties: never;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { Project } from '../../project/index.js';
|
|
3
|
+
import { TraverseProjectTag } from '../policies/traverse-project-tag.js';
|
|
4
|
+
import { Tag } from './tag.js';
|
|
5
|
+
export const project_contains_tag = edgeClass.directed({
|
|
6
|
+
description: 'One Project owns one local Tag vocabulary entry.',
|
|
7
|
+
source: { as: 'project', accepts: [() => Project], outgoing: '0..*' },
|
|
8
|
+
target: { as: 'tag', accepts: [() => Tag], incoming: '1' },
|
|
9
|
+
policies: { traverse: () => TraverseProjectTag },
|
|
10
|
+
});
|
|
@@ -38,7 +38,27 @@ export declare const Tag: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
38
38
|
readonly slug: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "slug", "self">;
|
|
39
39
|
readonly color: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "color", "self">;
|
|
40
40
|
};
|
|
41
|
-
readonly methods:
|
|
41
|
+
readonly methods: {
|
|
42
|
+
readonly edit: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
43
|
+
name?: string | undefined;
|
|
44
|
+
color?: string | null | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
readonly mode: 'value';
|
|
47
|
+
readonly value: {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
slug: string;
|
|
51
|
+
color?: string | undefined;
|
|
52
|
+
};
|
|
53
|
+
}, "authorized", false, "default">>;
|
|
54
|
+
readonly delete: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
55
|
+
readonly mode: 'value';
|
|
56
|
+
readonly value: {
|
|
57
|
+
tagId: string;
|
|
58
|
+
deleted: true;
|
|
59
|
+
};
|
|
60
|
+
}, "authorized", false, "default">>;
|
|
61
|
+
};
|
|
42
62
|
readonly effectiveProperties: (import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "color", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "slug", "self">) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
|
|
43
63
|
readonly name: "createdAt";
|
|
44
64
|
readonly key: "kernel.astrale.ai:class.Timestamped.property.createdAt";
|
|
@@ -49,6 +69,23 @@ export declare const Tag: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
49
69
|
readonly name: "updatedAt";
|
|
50
70
|
readonly key: "kernel.astrale.ai:class.Timestamped.property.updatedAt";
|
|
51
71
|
});
|
|
52
|
-
readonly effectiveInstanceMethods: never
|
|
72
|
+
readonly effectiveInstanceMethods: import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
73
|
+
readonly mode: 'value';
|
|
74
|
+
readonly value: {
|
|
75
|
+
tagId: string;
|
|
76
|
+
deleted: true;
|
|
77
|
+
};
|
|
78
|
+
}, "authorized", false, "default">>, "delete", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
79
|
+
name?: string | undefined;
|
|
80
|
+
color?: string | null | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
readonly mode: 'value';
|
|
83
|
+
readonly value: {
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
slug: string;
|
|
87
|
+
color?: string | undefined;
|
|
88
|
+
};
|
|
89
|
+
}, "authorized", false, "default">>, "edit", "self">;
|
|
53
90
|
readonly effectiveStaticMethods: never;
|
|
54
|
-
}
|
|
91
|
+
}> & import("@astrale-os/sdk/schema").StateClass<Readonly<Omit<Readonly<Record<never, never>>, never> & {}>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { K, nodeClass, property } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { deleteTagMethod } from '../functions/delete-tag.js';
|
|
4
|
+
import { editTagMethod } from '../functions/edit-tag.js';
|
|
5
|
+
import { ContributeToTag } from '../policies/contribute-to-tag.js';
|
|
6
|
+
export const Tag = nodeClass({
|
|
7
|
+
description: 'One Project-local label with a canonical slug.',
|
|
8
|
+
icon: 'tag',
|
|
9
|
+
extends: [K.classes.Named, K.classes.Timestamped],
|
|
10
|
+
properties: {
|
|
11
|
+
slug: z.string().min(1).max(80),
|
|
12
|
+
color: property(z.string().min(7).max(7), { required: false }),
|
|
13
|
+
},
|
|
14
|
+
methods: { edit: editTagMethod, delete: deleteTagMethod },
|
|
15
|
+
policies: { read: () => ContributeToTag },
|
|
16
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const deleteTagMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
2
|
+
readonly mode: 'value';
|
|
3
|
+
readonly value: {
|
|
4
|
+
tagId: string;
|
|
5
|
+
deleted: true;
|
|
6
|
+
};
|
|
7
|
+
}, "authorized", false, "default">>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { nodeIdValue } from '../../../types/index.js';
|
|
4
|
+
import { ManageTag } from '../policies/manage-tag.js';
|
|
5
|
+
export const deleteTagMethod = method({
|
|
6
|
+
description: 'Detach and delete this Project-local Tag when it labels at most 2,046 Issues; unlink larger sets first.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(ManageTag, self),
|
|
9
|
+
input: z.strictObject({}),
|
|
10
|
+
output: z.strictObject({ tagId: nodeIdValue, deleted: z.literal(true) }),
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const editTagMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
name?: string | undefined;
|
|
3
|
+
color?: string | null | undefined;
|
|
4
|
+
}, {
|
|
5
|
+
readonly mode: 'value';
|
|
6
|
+
readonly value: {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
color?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
}, "authorized", false, "default">>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ManageTag } from '../policies/manage-tag.js';
|
|
4
|
+
import { tagValue } from '../types/tag.js';
|
|
5
|
+
export const editTagMethod = method({
|
|
6
|
+
description: 'Edit this Project-local Tag.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(ManageTag, self),
|
|
9
|
+
input: z.strictObject({
|
|
10
|
+
name: z.string().min(1).max(64).optional(),
|
|
11
|
+
color: z.string().nullable().optional(),
|
|
12
|
+
}),
|
|
13
|
+
output: tagValue,
|
|
14
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { tagValue } from './types/index.js';
|
|
2
|
+
export { issue_tagged_with, project_contains_tag, Tag } from './classes/index.js';
|
|
3
|
+
export { deleteTagMethod, editTagMethod } from './functions/index.js';
|
|
4
|
+
export { ContributeToTag, ManageTag, TraverseIssueTag, TraverseProjectTag, } from './policies/index.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { tagValue } from './types/index.js';
|
|
2
|
+
export { issue_tagged_with, project_contains_tag, Tag } from './classes/index.js';
|
|
3
|
+
export { deleteTagMethod, editTagMethod } from './functions/index.js';
|
|
4
|
+
export { ContributeToTag, ManageTag, TraverseIssueTag, TraverseProjectTag, } from './policies/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ContributeToTag: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { Project, project_has_member, project_owned_by } from '../../project/index.js';
|
|
3
|
+
import { project_contains_tag } from '../classes/project-contains-tag.js';
|
|
4
|
+
export const ContributeToTag = policy({
|
|
5
|
+
description: 'The caller owns or belongs to the Project containing this Tag.',
|
|
6
|
+
match: ({ allOf, anyOf, edge, exists, object, subject }) => exists(({ node }) => {
|
|
7
|
+
const project = node(() => Project);
|
|
8
|
+
return allOf(anyOf(edge({ source: subject, class: () => project_owned_by, target: project }), edge({ source: subject, class: () => project_has_member, target: project })), edge({ source: project, class: () => project_contains_tag, target: object }));
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ManageTag: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { Project, project_owned_by } from '../../project/index.js';
|
|
3
|
+
import { project_contains_tag } from '../classes/project-contains-tag.js';
|
|
4
|
+
export const ManageTag = policy({
|
|
5
|
+
description: 'The caller owns the Project containing this Tag.',
|
|
6
|
+
match: ({ allOf, edge, exists, object, subject }) => exists(({ node }) => {
|
|
7
|
+
const project = node(() => Project);
|
|
8
|
+
return allOf(edge({ source: subject, class: () => project_owned_by, target: project }), edge({ source: project, class: () => project_contains_tag, target: object }));
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TraverseIssueTag: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { project_contains_issue } from '../../issue/index.js';
|
|
3
|
+
import { Project, project_has_member, project_owned_by } from '../../project/index.js';
|
|
4
|
+
import { issue_tagged_with } from '../classes/issue-tagged-with.js';
|
|
5
|
+
export const TraverseIssueTag = policy({
|
|
6
|
+
description: 'Issue Tag relationships are visible only inside the containing Project.',
|
|
7
|
+
match: ({ allOf, anyOf, edge, exists, source, subject, target }) => anyOf(exists(({ node }) => {
|
|
8
|
+
const project = node(() => Project);
|
|
9
|
+
return allOf(edge({ source, class: () => issue_tagged_with, target }), edge({ source: project, class: () => project_contains_issue, target: source }), edge({ source: subject, class: () => project_owned_by, target: project }));
|
|
10
|
+
}), exists(({ node }) => {
|
|
11
|
+
const project = node(() => Project);
|
|
12
|
+
return allOf(edge({ source, class: () => issue_tagged_with, target }), edge({ source: project, class: () => project_contains_issue, target: source }), edge({ source: subject, class: () => project_has_member, target: project }));
|
|
13
|
+
})),
|
|
14
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TraverseProjectTag: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { project_has_member, project_owned_by } from '../../project/index.js';
|
|
3
|
+
import { project_contains_tag } from '../classes/project-contains-tag.js';
|
|
4
|
+
export const TraverseProjectTag = policy({
|
|
5
|
+
description: 'Project Tag containment is visible only to that Project owner and members.',
|
|
6
|
+
match: ({ allOf, anyOf, edge, source, subject, target }) => anyOf(allOf(edge({ source, class: () => project_contains_tag, target }), edge({ source: subject, class: () => project_owned_by, target: source })), allOf(edge({ source, class: () => project_contains_tag, target }), edge({ source: subject, class: () => project_has_member, target: source }))),
|
|
7
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { tagValue } from './tag.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { tagValue } from './tag.js';
|