@astrale-domains/issues 0.1.3 → 0.1.5
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 +21 -0
- package/README.md +13 -19
- package/dist/schema/.runtime/states/issue/index.d.ts +4 -7
- package/dist/schema/.runtime/states/issue/index.js +2 -2
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.js +4 -4
- package/dist/schema/{comment/relationships.d.ts → modules/comment/classes/comment-authored-by.d.ts} +0 -16
- 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} +1 -1
- package/dist/schema/{comment/class.js → modules/comment/classes/comment.js} +5 -4
- 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/{comment/contribute-to-comment-policy.js → modules/comment/policies/contribute-to-comment.js} +3 -3
- package/dist/schema/{comment/edit-own-comment-policy.js → modules/comment/policies/edit-own-comment.js} +1 -1
- package/dist/schema/modules/comment/policies/index.d.ts +4 -0
- package/dist/schema/modules/comment/policies/index.js +4 -0
- package/dist/schema/{comment/traverse-comment-relationship-policy.d.ts → modules/comment/policies/traverse-comment-relationship.d.ts} +0 -1
- package/dist/schema/{comment/traverse-comment-relationship-policy.js → modules/comment/policies/traverse-comment-relationship.js} +4 -4
- 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/{issue/class.d.ts → modules/issue/classes/issue.d.ts} +28 -3
- 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/{issue/contribute-to-issue-policy.js → modules/issue/policies/contribute-to-issue.js} +2 -2
- 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/{project/relationships.d.ts → modules/project/classes/project-has-member.d.ts} +0 -16
- package/dist/schema/modules/project/classes/project-has-member.js +9 -0
- package/dist/schema/modules/project/classes/project-owned-by.d.ts +16 -0
- package/dist/schema/modules/project/classes/project-owned-by.js +9 -0
- package/dist/schema/{project/class.d.ts → modules/project/classes/project.d.ts} +63 -14
- 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/{project/contribute-to-project-policy.js → modules/project/policies/contribute-to-project.js} +2 -1
- package/dist/schema/modules/project/policies/index.d.ts +4 -0
- package/dist/schema/modules/project/policies/index.js +4 -0
- package/dist/schema/{project/manage-project-policy.js → modules/project/policies/manage-project.js} +1 -1
- 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/{tag/relationships.d.ts → modules/tag/classes/project-contains-tag.d.ts} +0 -16
- 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} +1 -1
- package/dist/schema/{tag/class.js → modules/tag/classes/tag.js} +3 -2
- 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/{tag/contribute-to-tag-policy.js → modules/tag/policies/contribute-to-tag.js} +2 -2
- package/dist/schema/modules/tag/policies/index.d.ts +4 -0
- package/dist/schema/modules/tag/policies/index.js +4 -0
- package/dist/schema/{tag/manage-tag-policy.js → modules/tag/policies/manage-tag.js} +2 -2
- 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 +732 -650
- package/dist/schema/schema.js +47 -42
- package/dist/schema/types/index.js +1 -0
- package/dist/schema/types/node-id.js +2 -0
- package/package.json +24 -26
- package/dist/schema/comment/index.d.ts +0 -5
- package/dist/schema/comment/index.js +0 -5
- package/dist/schema/comment/methods.js +0 -18
- package/dist/schema/comment/relationships.js +0 -16
- package/dist/schema/issue/class.js +0 -29
- package/dist/schema/issue/index.d.ts +0 -4
- package/dist/schema/issue/index.js +0 -4
- package/dist/schema/issue/methods.js +0 -66
- package/dist/schema/issue/relationships.d.ts +0 -67
- package/dist/schema/issue/relationships.js +0 -29
- package/dist/schema/issue/traverse-issue-relationship-policy.d.ts +0 -5
- package/dist/schema/issue/traverse-issue-relationship-policy.js +0 -55
- package/dist/schema/project/class.js +0 -27
- package/dist/schema/project/index.d.ts +0 -5
- package/dist/schema/project/index.js +0 -5
- package/dist/schema/project/methods.js +0 -68
- package/dist/schema/project/relationships.js +0 -15
- package/dist/schema/project/traverse-project-relationship-policy.d.ts +0 -4
- package/dist/schema/project/traverse-project-relationship-policy.js +0 -20
- package/dist/schema/tag/index.d.ts +0 -4
- package/dist/schema/tag/index.js +0 -4
- package/dist/schema/tag/methods.js +0 -21
- package/dist/schema/tag/relationships.js +0 -16
- package/dist/schema/value/index.js +0 -34
- /package/dist/schema/{comment/contribute-to-comment-policy.d.ts → modules/comment/policies/contribute-to-comment.d.ts} +0 -0
- /package/dist/schema/{comment/edit-own-comment-policy.d.ts → modules/comment/policies/edit-own-comment.d.ts} +0 -0
- /package/dist/schema/{issue/contribute-to-issue-policy.d.ts → modules/issue/policies/contribute-to-issue.d.ts} +0 -0
- /package/dist/schema/{project/contribute-to-project-policy.d.ts → modules/project/policies/contribute-to-project.d.ts} +0 -0
- /package/dist/schema/{project/manage-project-policy.d.ts → modules/project/policies/manage-project.d.ts} +0 -0
- /package/dist/schema/{tag/contribute-to-tag-policy.d.ts → modules/tag/policies/contribute-to-tag.d.ts} +0 -0
- /package/dist/schema/{tag/manage-tag-policy.d.ts → modules/tag/policies/manage-tag.d.ts} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { Project } from '../../project/index.js';
|
|
3
|
+
import { TraverseProjectIssue } from '../policies/traverse-project-issue.js';
|
|
4
|
+
import { Issue } from './issue.js';
|
|
5
|
+
export const project_contains_issue = edgeClass.directed({
|
|
6
|
+
description: 'One Project contains and numbers one Issue.',
|
|
7
|
+
source: { as: 'project', accepts: [() => Project], outgoing: '0..*' },
|
|
8
|
+
target: { as: 'issue', accepts: [() => Issue], incoming: '1' },
|
|
9
|
+
policies: { traverse: () => TraverseProjectIssue },
|
|
10
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const addIssueCommentMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
body: string;
|
|
3
|
+
}, {
|
|
4
|
+
readonly mode: 'value';
|
|
5
|
+
readonly value: {
|
|
6
|
+
id: string;
|
|
7
|
+
body: string;
|
|
8
|
+
};
|
|
9
|
+
}, "authorized", false, "default">>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { commentValue } from '../../comment/index.js';
|
|
4
|
+
import { ContributeToIssue } from '../policies/contribute-to-issue.js';
|
|
5
|
+
export const addIssueCommentMethod = method({
|
|
6
|
+
description: 'Add one authored Comment to this Issue.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(ContributeToIssue, self),
|
|
9
|
+
input: z.strictObject({ body: z.string().min(1).max(50_000) }),
|
|
10
|
+
output: commentValue,
|
|
11
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const archiveIssueMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
2
|
+
readonly mode: 'value';
|
|
3
|
+
readonly value: {
|
|
4
|
+
issueId: string;
|
|
5
|
+
archived: 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 { ContributeToIssue } from '../policies/contribute-to-issue.js';
|
|
5
|
+
export const archiveIssueMethod = method({
|
|
6
|
+
description: 'Archive this Issue without deleting its discussion or relationships.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(ContributeToIssue, self),
|
|
9
|
+
input: z.strictObject({}),
|
|
10
|
+
output: z.strictObject({ issueId: nodeIdValue, archived: z.literal(true) }),
|
|
11
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const assignIssueMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
assigneeId: string | null;
|
|
3
|
+
}, {
|
|
4
|
+
readonly mode: 'value';
|
|
5
|
+
readonly value: {
|
|
6
|
+
issueId: string;
|
|
7
|
+
assigneeId?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
}, "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 { ContributeToIssue } from '../policies/contribute-to-issue.js';
|
|
5
|
+
export const assignIssueMethod = method({
|
|
6
|
+
description: 'Assign this Issue to a Project participant or clear its assignee.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(ContributeToIssue, self),
|
|
9
|
+
input: z.strictObject({ assigneeId: nodeIdValue.nullable() }),
|
|
10
|
+
output: z.strictObject({ issueId: nodeIdValue, assigneeId: nodeIdValue.optional() }),
|
|
11
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { addIssueCommentMethod } from './add-issue-comment.js';
|
|
2
|
+
export { archiveIssueMethod } from './archive-issue.js';
|
|
3
|
+
export { assignIssueMethod } from './assign-issue.js';
|
|
4
|
+
export { setIssueParentMethod } from './set-issue-parent.js';
|
|
5
|
+
export { setIssueTagsMethod } from './set-issue-tags.js';
|
|
6
|
+
export { transitionIssueMethod } from './transition-issue.js';
|
|
7
|
+
export { updateIssueMethod } from './update-issue.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { addIssueCommentMethod } from './add-issue-comment.js';
|
|
2
|
+
export { archiveIssueMethod } from './archive-issue.js';
|
|
3
|
+
export { assignIssueMethod } from './assign-issue.js';
|
|
4
|
+
export { setIssueParentMethod } from './set-issue-parent.js';
|
|
5
|
+
export { setIssueTagsMethod } from './set-issue-tags.js';
|
|
6
|
+
export { transitionIssueMethod } from './transition-issue.js';
|
|
7
|
+
export { updateIssueMethod } from './update-issue.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const setIssueParentMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
parentId: string | null;
|
|
3
|
+
}, {
|
|
4
|
+
readonly mode: 'value';
|
|
5
|
+
readonly value: {
|
|
6
|
+
issueId: string;
|
|
7
|
+
parentId?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
}, "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 { ContributeToIssue } from '../policies/contribute-to-issue.js';
|
|
5
|
+
export const setIssueParentMethod = method({
|
|
6
|
+
description: 'Set or clear this Issue parent inside the same Project.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(ContributeToIssue, self),
|
|
9
|
+
input: z.strictObject({ parentId: nodeIdValue.nullable() }),
|
|
10
|
+
output: z.strictObject({ issueId: nodeIdValue, parentId: nodeIdValue.optional() }),
|
|
11
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const setIssueTagsMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
tagIds: string[];
|
|
3
|
+
}, {
|
|
4
|
+
readonly mode: 'value';
|
|
5
|
+
readonly value: {
|
|
6
|
+
issueId: string;
|
|
7
|
+
tagIds: string[];
|
|
8
|
+
};
|
|
9
|
+
}, "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 { ContributeToIssue } from '../policies/contribute-to-issue.js';
|
|
5
|
+
export const setIssueTagsMethod = method({
|
|
6
|
+
description: 'Replace this Issue Tag set with an exact Project-local set.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(ContributeToIssue, self),
|
|
9
|
+
input: z.strictObject({ tagIds: z.array(nodeIdValue).max(128) }),
|
|
10
|
+
output: z.strictObject({ issueId: nodeIdValue, tagIds: z.array(nodeIdValue) }),
|
|
11
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const transitionIssueMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
event: unknown;
|
|
3
|
+
}, {
|
|
4
|
+
readonly mode: 'value';
|
|
5
|
+
readonly value: {
|
|
6
|
+
kind: "transitioned";
|
|
7
|
+
issue: {
|
|
8
|
+
id: string;
|
|
9
|
+
reference: string;
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
status: "accepted" | "closed" | "deferred" | "open" | "resolved";
|
|
13
|
+
priority: number;
|
|
14
|
+
archived: boolean;
|
|
15
|
+
};
|
|
16
|
+
} | {
|
|
17
|
+
kind: "rejected";
|
|
18
|
+
code: "STATE_TRANSITION_ILLEGAL";
|
|
19
|
+
from: "accepted" | "closed" | "deferred" | "open" | "resolved";
|
|
20
|
+
event: "accept" | "close" | "defer" | "reopen" | "resolve";
|
|
21
|
+
};
|
|
22
|
+
}, "authorized", false, "default">>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { issueStatus } from '../../../.runtime/states/issue/index.js';
|
|
4
|
+
import { ContributeToIssue } from '../policies/contribute-to-issue.js';
|
|
5
|
+
import { issueValue } from '../types/issue.js';
|
|
6
|
+
export const transitionIssueMethod = method({
|
|
7
|
+
description: 'Apply one legal Issue status event.',
|
|
8
|
+
auth: 'authorized',
|
|
9
|
+
policy: ({ check, self }) => check(ContributeToIssue, self),
|
|
10
|
+
input: z.strictObject({ event: issueStatus.eventSchema }),
|
|
11
|
+
output: z.discriminatedUnion('kind', [
|
|
12
|
+
z.strictObject({ kind: z.literal('transitioned'), issue: issueValue }),
|
|
13
|
+
z.strictObject({
|
|
14
|
+
kind: z.literal('rejected'),
|
|
15
|
+
code: z.literal('STATE_TRANSITION_ILLEGAL'),
|
|
16
|
+
from: issueStatus.stateSchema,
|
|
17
|
+
event: issueStatus.eventSchema,
|
|
18
|
+
}),
|
|
19
|
+
]),
|
|
20
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const updateIssueMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
title?: string | undefined;
|
|
3
|
+
description?: string | undefined;
|
|
4
|
+
priority?: number | undefined;
|
|
5
|
+
}, {
|
|
6
|
+
readonly mode: 'value';
|
|
7
|
+
readonly value: {
|
|
8
|
+
id: string;
|
|
9
|
+
reference: string;
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
status: "accepted" | "closed" | "deferred" | "open" | "resolved";
|
|
13
|
+
priority: number;
|
|
14
|
+
archived: boolean;
|
|
15
|
+
};
|
|
16
|
+
}, "authorized", false, "default">>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ContributeToIssue } from '../policies/contribute-to-issue.js';
|
|
4
|
+
import { issueValue } from '../types/issue.js';
|
|
5
|
+
export const updateIssueMethod = method({
|
|
6
|
+
description: 'Update mutable Issue fields.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(ContributeToIssue, self),
|
|
9
|
+
input: z.strictObject({
|
|
10
|
+
title: z.string().min(1).max(200).optional(),
|
|
11
|
+
description: z.string().max(50_000).optional(),
|
|
12
|
+
priority: z.number().int().min(0).max(4).optional(),
|
|
13
|
+
}),
|
|
14
|
+
output: issueValue,
|
|
15
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { issueValue } from './types/index.js';
|
|
2
|
+
export { issue_assigned_to, issue_reported_by, issue_subtask_of, Issue, project_contains_issue, } from './classes/index.js';
|
|
3
|
+
export { addIssueCommentMethod, archiveIssueMethod, assignIssueMethod, setIssueParentMethod, setIssueTagsMethod, transitionIssueMethod, updateIssueMethod, } from './functions/index.js';
|
|
4
|
+
export { ContributeToIssue, TraverseIssueAssignee, TraverseIssueParent, TraverseIssueReporter, TraverseProjectIssue, } from './policies/index.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { issueValue } from './types/index.js';
|
|
2
|
+
export { issue_assigned_to, issue_reported_by, issue_subtask_of, Issue, project_contains_issue, } from './classes/index.js';
|
|
3
|
+
export { addIssueCommentMethod, archiveIssueMethod, assignIssueMethod, setIssueParentMethod, setIssueTagsMethod, transitionIssueMethod, updateIssueMethod, } from './functions/index.js';
|
|
4
|
+
export { ContributeToIssue, TraverseIssueAssignee, TraverseIssueParent, TraverseIssueReporter, TraverseProjectIssue, } from './policies/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { Project, project_has_member, project_owned_by } from '
|
|
3
|
-
import { project_contains_issue } from '
|
|
2
|
+
import { Project, project_has_member, project_owned_by } from '../../project/index.js';
|
|
3
|
+
import { project_contains_issue } from '../classes/project-contains-issue.js';
|
|
4
4
|
export const ContributeToIssue = policy({
|
|
5
5
|
description: 'The caller owns or belongs to the Project containing this Issue.',
|
|
6
6
|
match: ({ allOf, anyOf, edge, exists, object, subject }) => exists(({ node }) => {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ContributeToIssue } from './contribute-to-issue.js';
|
|
2
|
+
export { TraverseIssueAssignee } from './traverse-issue-assignee.js';
|
|
3
|
+
export { TraverseIssueParent } from './traverse-issue-parent.js';
|
|
4
|
+
export { TraverseIssueReporter } from './traverse-issue-reporter.js';
|
|
5
|
+
export { TraverseProjectIssue } from './traverse-project-issue.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ContributeToIssue } from './contribute-to-issue.js';
|
|
2
|
+
export { TraverseIssueAssignee } from './traverse-issue-assignee.js';
|
|
3
|
+
export { TraverseIssueParent } from './traverse-issue-parent.js';
|
|
4
|
+
export { TraverseIssueReporter } from './traverse-issue-reporter.js';
|
|
5
|
+
export { TraverseProjectIssue } from './traverse-project-issue.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TraverseIssueAssignee: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { Project, project_has_member, project_owned_by } from '../../project/index.js';
|
|
3
|
+
import { issue_assigned_to } from '../classes/issue-assigned-to.js';
|
|
4
|
+
import { project_contains_issue } from '../classes/project-contains-issue.js';
|
|
5
|
+
export const TraverseIssueAssignee = policy({
|
|
6
|
+
description: 'Issue assignment 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_assigned_to, target }), edge({ source: project, class: () => project_contains_issue, target }), edge({ source: subject, class: () => project_owned_by, target: project }));
|
|
10
|
+
}), exists(({ node }) => {
|
|
11
|
+
const project = node(() => Project);
|
|
12
|
+
return allOf(edge({ source, class: () => issue_assigned_to, target }), edge({ source: project, class: () => project_contains_issue, target }), edge({ source: subject, class: () => project_has_member, target: project }));
|
|
13
|
+
})),
|
|
14
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TraverseIssueParent: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { Project, project_has_member, project_owned_by } from '../../project/index.js';
|
|
3
|
+
import { issue_subtask_of } from '../classes/issue-subtask-of.js';
|
|
4
|
+
import { project_contains_issue } from '../classes/project-contains-issue.js';
|
|
5
|
+
export const TraverseIssueParent = policy({
|
|
6
|
+
description: 'Issue parent 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_subtask_of, 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_subtask_of, 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 TraverseIssueReporter: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { Project, project_has_member, project_owned_by } from '../../project/index.js';
|
|
3
|
+
import { issue_reported_by } from '../classes/issue-reported-by.js';
|
|
4
|
+
import { project_contains_issue } from '../classes/project-contains-issue.js';
|
|
5
|
+
export const TraverseIssueReporter = policy({
|
|
6
|
+
description: 'Issue reporter 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_reported_by, target }), edge({ source: project, class: () => project_contains_issue, target }), edge({ source: subject, class: () => project_owned_by, target: project }));
|
|
10
|
+
}), exists(({ node }) => {
|
|
11
|
+
const project = node(() => Project);
|
|
12
|
+
return allOf(edge({ source, class: () => issue_reported_by, target }), edge({ source: project, class: () => project_contains_issue, target }), edge({ source: subject, class: () => project_has_member, target: project }));
|
|
13
|
+
})),
|
|
14
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TraverseProjectIssue: 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_issue } from '../classes/project-contains-issue.js';
|
|
4
|
+
export const TraverseProjectIssue = policy({
|
|
5
|
+
description: 'Project Issue 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_issue, target }), edge({ source: subject, class: () => project_owned_by, target: source })), allOf(edge({ source, class: () => project_contains_issue, target }), edge({ source: subject, class: () => project_has_member, target: source }))),
|
|
7
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { issueValue } from './issue.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { issueValue } from './issue.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const issueValue: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
reference: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
description: z.ZodString;
|
|
7
|
+
status: z.ZodType<"accepted" | "closed" | "deferred" | "open" | "resolved", unknown, z.core.$ZodTypeInternals<"accepted" | "closed" | "deferred" | "open" | "resolved", unknown>>;
|
|
8
|
+
priority: z.ZodNumber;
|
|
9
|
+
archived: z.ZodBoolean;
|
|
10
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { nodeIdValue } from '../../../types/index.js';
|
|
3
|
+
import { issueStatus } from '../../../.runtime/states/issue/index.js';
|
|
4
|
+
export const issueValue = z.strictObject({
|
|
5
|
+
id: nodeIdValue,
|
|
6
|
+
reference: z.string().min(1).max(32),
|
|
7
|
+
title: z.string().min(1).max(200),
|
|
8
|
+
description: z.string().max(50_000),
|
|
9
|
+
status: issueStatus.stateSchema,
|
|
10
|
+
priority: z.number().int().min(0).max(4),
|
|
11
|
+
archived: z.boolean(),
|
|
12
|
+
});
|
package/dist/schema/{project/relationships.d.ts → modules/project/classes/project-has-member.d.ts}
RENAMED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
export declare const project_owned_by: 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: "owner";
|
|
8
|
-
readonly outgoing: "0..*";
|
|
9
|
-
};
|
|
10
|
-
readonly target: {
|
|
11
|
-
readonly as: "project";
|
|
12
|
-
readonly incoming: "1";
|
|
13
|
-
};
|
|
14
|
-
readonly constraints: Record<never, never>;
|
|
15
|
-
readonly effectiveProperties: never;
|
|
16
|
-
}>;
|
|
17
1
|
export declare const project_has_member: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
18
2
|
readonly depth: 0;
|
|
19
3
|
readonly abstract: false;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { K, edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { TraverseProjectMember } from '../policies/traverse-project-member.js';
|
|
3
|
+
import { Project } from './project.js';
|
|
4
|
+
export const project_has_member = edgeClass.directed({
|
|
5
|
+
description: 'An Identity admitted to collaborate in one Project.',
|
|
6
|
+
source: { as: 'member', accepts: [K.classes.Identity], outgoing: '0..*' },
|
|
7
|
+
target: { as: 'project', accepts: [() => Project], incoming: '0..*' },
|
|
8
|
+
policies: { traverse: () => TraverseProjectMember },
|
|
9
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const project_owned_by: 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: "owner";
|
|
8
|
+
readonly outgoing: "0..*";
|
|
9
|
+
};
|
|
10
|
+
readonly target: {
|
|
11
|
+
readonly as: "project";
|
|
12
|
+
readonly incoming: "1";
|
|
13
|
+
};
|
|
14
|
+
readonly constraints: Record<never, never>;
|
|
15
|
+
readonly effectiveProperties: never;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { K, edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { TraverseProjectOwner } from '../policies/traverse-project-owner.js';
|
|
3
|
+
import { Project } from './project.js';
|
|
4
|
+
export const project_owned_by = edgeClass.directed({
|
|
5
|
+
description: 'The exact Identity that owns and administers one Project.',
|
|
6
|
+
source: { as: 'owner', accepts: [K.classes.Identity], outgoing: '0..*' },
|
|
7
|
+
target: { as: 'project', accepts: [() => Project], incoming: '1' },
|
|
8
|
+
policies: { traverse: () => TraverseProjectOwner },
|
|
9
|
+
});
|
|
@@ -72,6 +72,31 @@ export declare const Project: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
72
72
|
archived: boolean;
|
|
73
73
|
};
|
|
74
74
|
}, "authenticated", true, "default">>;
|
|
75
|
+
readonly list: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
76
|
+
readonly mode: 'value';
|
|
77
|
+
readonly value: {
|
|
78
|
+
projects: {
|
|
79
|
+
id: string;
|
|
80
|
+
key: string;
|
|
81
|
+
name: string;
|
|
82
|
+
description: string;
|
|
83
|
+
archived: boolean;
|
|
84
|
+
issues: {
|
|
85
|
+
id: string;
|
|
86
|
+
reference: string;
|
|
87
|
+
title: string;
|
|
88
|
+
description: string;
|
|
89
|
+
status: "accepted" | "closed" | "deferred" | "open" | "resolved";
|
|
90
|
+
priority: number;
|
|
91
|
+
archived: boolean;
|
|
92
|
+
comments: {
|
|
93
|
+
id: string;
|
|
94
|
+
body: string;
|
|
95
|
+
}[];
|
|
96
|
+
}[];
|
|
97
|
+
}[];
|
|
98
|
+
};
|
|
99
|
+
}, "authenticated", true, "default">>;
|
|
75
100
|
readonly update: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
76
101
|
name?: string | undefined;
|
|
77
102
|
description?: string | undefined;
|
|
@@ -144,12 +169,12 @@ export declare const Project: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
144
169
|
readonly effectiveProperties: (import("@astrale-os/sdk/schema").AuthoredPropertyProjection<boolean, boolean, true, "archived", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "key", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string[], string[], true, "memberIds", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<number, number, true, "nextIssueNumber", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "ownerId", "self">) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, false> & {
|
|
145
170
|
readonly name: "description";
|
|
146
171
|
readonly key: "kernel.astrale.ai:class.Descriptable.property.description";
|
|
147
|
-
}) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
|
|
148
|
-
readonly name: "createdAt";
|
|
149
|
-
readonly key: "kernel.astrale.ai:class.Timestamped.property.createdAt";
|
|
150
172
|
}) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
|
|
151
173
|
readonly name: "name";
|
|
152
174
|
readonly key: "kernel.astrale.ai:class.Named.property.name";
|
|
175
|
+
}) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
|
|
176
|
+
readonly name: "createdAt";
|
|
177
|
+
readonly key: "kernel.astrale.ai:class.Timestamped.property.createdAt";
|
|
153
178
|
}) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
|
|
154
179
|
readonly name: "updatedAt";
|
|
155
180
|
readonly key: "kernel.astrale.ai:class.Timestamped.property.updatedAt";
|
|
@@ -161,6 +186,15 @@ export declare const Project: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
161
186
|
archived: true;
|
|
162
187
|
};
|
|
163
188
|
}, "authorized", false, "default">>, "archive", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
189
|
+
memberId: string;
|
|
190
|
+
}, {
|
|
191
|
+
readonly mode: 'value';
|
|
192
|
+
readonly value: {
|
|
193
|
+
projectId: string;
|
|
194
|
+
memberId: string;
|
|
195
|
+
changed: boolean;
|
|
196
|
+
};
|
|
197
|
+
}, "authorized", false, "default">>, "addMember", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
164
198
|
name?: string | undefined;
|
|
165
199
|
description?: string | undefined;
|
|
166
200
|
}, {
|
|
@@ -181,15 +215,6 @@ export declare const Project: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
181
215
|
memberId: string;
|
|
182
216
|
changed: boolean;
|
|
183
217
|
};
|
|
184
|
-
}, "authorized", false, "default">>, "addMember", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
185
|
-
memberId: string;
|
|
186
|
-
}, {
|
|
187
|
-
readonly mode: 'value';
|
|
188
|
-
readonly value: {
|
|
189
|
-
projectId: string;
|
|
190
|
-
memberId: string;
|
|
191
|
-
changed: boolean;
|
|
192
|
-
};
|
|
193
218
|
}, "authorized", false, "default">>, "removeMember", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
194
219
|
title: string;
|
|
195
220
|
description?: string | undefined;
|
|
@@ -217,7 +242,31 @@ export declare const Project: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
217
242
|
color?: string | undefined;
|
|
218
243
|
};
|
|
219
244
|
}, "authorized", false, "default">>, "createTag", "self">;
|
|
220
|
-
readonly effectiveStaticMethods: import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
245
|
+
readonly effectiveStaticMethods: import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
246
|
+
readonly mode: 'value';
|
|
247
|
+
readonly value: {
|
|
248
|
+
projects: {
|
|
249
|
+
id: string;
|
|
250
|
+
key: string;
|
|
251
|
+
name: string;
|
|
252
|
+
description: string;
|
|
253
|
+
archived: boolean;
|
|
254
|
+
issues: {
|
|
255
|
+
id: string;
|
|
256
|
+
reference: string;
|
|
257
|
+
title: string;
|
|
258
|
+
description: string;
|
|
259
|
+
status: "accepted" | "closed" | "deferred" | "open" | "resolved";
|
|
260
|
+
priority: number;
|
|
261
|
+
archived: boolean;
|
|
262
|
+
comments: {
|
|
263
|
+
id: string;
|
|
264
|
+
body: string;
|
|
265
|
+
}[];
|
|
266
|
+
}[];
|
|
267
|
+
}[];
|
|
268
|
+
};
|
|
269
|
+
}, "authenticated", true, "default">>, "list", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
221
270
|
key: string;
|
|
222
271
|
name: string;
|
|
223
272
|
description?: string | undefined;
|
|
@@ -231,4 +280,4 @@ export declare const Project: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
231
280
|
archived: boolean;
|
|
232
281
|
};
|
|
233
282
|
}, "authenticated", true, "default">>, "create", "self">;
|
|
234
|
-
}
|
|
283
|
+
}> & import("@astrale-os/sdk/schema").StateClass<Readonly<Omit<Readonly<Record<never, never>>, never> & {}>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { K, nodeClass, property } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { nodeIdValue } from '../../../types/index.js';
|
|
4
|
+
import { addProjectMemberMethod } from '../functions/add-project-member.js';
|
|
5
|
+
import { archiveProjectMethod } from '../functions/archive-project.js';
|
|
6
|
+
import { createProjectIssueMethod } from '../functions/create-project-issue.js';
|
|
7
|
+
import { createProjectTagMethod } from '../functions/create-project-tag.js';
|
|
8
|
+
import { createProjectMethod } from '../functions/create-project.js';
|
|
9
|
+
import { listProjectsMethod } from '../functions/list-projects.js';
|
|
10
|
+
import { removeProjectMemberMethod } from '../functions/remove-project-member.js';
|
|
11
|
+
import { updateProjectMethod } from '../functions/update-project.js';
|
|
12
|
+
import { ContributeToProject } from '../policies/contribute-to-project.js';
|
|
13
|
+
export const Project = nodeClass({
|
|
14
|
+
description: 'A collaborative namespace for numbered Issues, Tags, and membership.',
|
|
15
|
+
icon: 'folder-kanban',
|
|
16
|
+
extends: [K.classes.Named, K.classes.Descriptable, K.classes.Timestamped],
|
|
17
|
+
properties: {
|
|
18
|
+
key: z.string().min(2).max(10),
|
|
19
|
+
ownerId: property(nodeIdValue, {}),
|
|
20
|
+
memberIds: property(z.array(nodeIdValue).max(256), {}),
|
|
21
|
+
nextIssueNumber: property(z.number().int().min(1), {}),
|
|
22
|
+
archived: z.boolean(),
|
|
23
|
+
},
|
|
24
|
+
methods: {
|
|
25
|
+
create: createProjectMethod,
|
|
26
|
+
list: listProjectsMethod,
|
|
27
|
+
update: updateProjectMethod,
|
|
28
|
+
addMember: addProjectMemberMethod,
|
|
29
|
+
removeMember: removeProjectMemberMethod,
|
|
30
|
+
createIssue: createProjectIssueMethod,
|
|
31
|
+
createTag: createProjectTagMethod,
|
|
32
|
+
archive: archiveProjectMethod,
|
|
33
|
+
},
|
|
34
|
+
policies: { read: () => ContributeToProject },
|
|
35
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const addProjectMemberMethod: 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 addProjectMemberMethod = method({
|
|
7
|
+
description: 'Add one Identity as a Project member.',
|
|
8
|
+
auth: 'authorized',
|
|
9
|
+
policy: ({ check, self }) => check(ManageProject, self),
|
|
10
|
+
input: z.strictObject({ memberId: nodeIdValue }),
|
|
11
|
+
output: membershipChangeValue,
|
|
12
|
+
});
|