@astrale-domains/issues 0.1.3 → 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 +9 -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} +60 -11
- 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,16 @@
|
|
|
1
|
+
export declare const createProjectIssueMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
title: string;
|
|
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 { issueValue } from '../../issue/index.js';
|
|
4
|
+
import { ContributeToProject } from '../policies/contribute-to-project.js';
|
|
5
|
+
export const createProjectIssueMethod = method({
|
|
6
|
+
description: 'Create one atomically numbered Issue in this Project.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(ContributeToProject, self),
|
|
9
|
+
input: z.strictObject({
|
|
10
|
+
title: z.string().min(1).max(200),
|
|
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,12 @@
|
|
|
1
|
+
export declare const createProjectTagMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
name: string;
|
|
3
|
+
color?: string | 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 { 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';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { project_has_member
|
|
2
|
+
import { project_has_member } from '../classes/project-has-member.js';
|
|
3
|
+
import { project_owned_by } from '../classes/project-owned-by.js';
|
|
3
4
|
export const ContributeToProject = policy({
|
|
4
5
|
description: 'The caller owns or is a member of this Project.',
|
|
5
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 })),
|
package/dist/schema/{project/manage-project-policy.js → modules/project/policies/manage-project.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { project_owned_by } from '
|
|
2
|
+
import { project_owned_by } from '../classes/project-owned-by.js';
|
|
3
3
|
export const ManageProject = policy({
|
|
4
4
|
description: 'The caller is the exact owner of this Project.',
|
|
5
5
|
match: ({ edge, object, subject }) => edge({ source: subject, class: () => project_owned_by, target: object }),
|
|
@@ -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
|
+
});
|
package/dist/schema/{tag/relationships.d.ts → modules/tag/classes/project-contains-tag.d.ts}
RENAMED
|
@@ -14,19 +14,3 @@ export declare const project_contains_tag: import("@astrale-os/sdk/schema").Dire
|
|
|
14
14
|
readonly constraints: Record<never, never>;
|
|
15
15
|
readonly effectiveProperties: never;
|
|
16
16
|
}>;
|
|
17
|
-
export declare const issue_tagged_with: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
18
|
-
readonly depth: 0;
|
|
19
|
-
readonly abstract: false;
|
|
20
|
-
readonly extends: readonly [];
|
|
21
|
-
readonly properties: never;
|
|
22
|
-
readonly source: {
|
|
23
|
-
readonly as: "issue";
|
|
24
|
-
readonly outgoing: "0..*";
|
|
25
|
-
};
|
|
26
|
-
readonly target: {
|
|
27
|
-
readonly as: "tag";
|
|
28
|
-
readonly incoming: "0..*";
|
|
29
|
-
};
|
|
30
|
-
readonly constraints: Record<never, never>;
|
|
31
|
-
readonly effectiveProperties: never;
|
|
32
|
-
}>;
|
|
@@ -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
|
+
});
|
|
@@ -88,4 +88,4 @@ export declare const Tag: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
88
88
|
};
|
|
89
89
|
}, "authorized", false, "default">>, "edit", "self">;
|
|
90
90
|
readonly effectiveStaticMethods: never;
|
|
91
|
-
}
|
|
91
|
+
}> & import("@astrale-os/sdk/schema").StateClass<Readonly<Omit<Readonly<Record<never, never>>, never> & {}>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { K, nodeClass, property } from '@astrale-os/sdk/schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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';
|
|
5
6
|
export const Tag = nodeClass({
|
|
6
7
|
description: 'One Project-local label with a canonical slug.',
|
|
7
8
|
icon: 'tag',
|
|
@@ -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';
|
package/dist/schema/{tag/contribute-to-tag-policy.js → modules/tag/policies/contribute-to-tag.js}
RENAMED
|
@@ -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_tag } from '
|
|
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
4
|
export const ContributeToTag = policy({
|
|
5
5
|
description: 'The caller owns or belongs to the Project containing this Tag.',
|
|
6
6
|
match: ({ allOf, anyOf, edge, exists, object, subject }) => exists(({ node }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { Project, project_owned_by } from '
|
|
3
|
-
import { project_contains_tag } from '
|
|
2
|
+
import { Project, project_owned_by } from '../../project/index.js';
|
|
3
|
+
import { project_contains_tag } from '../classes/project-contains-tag.js';
|
|
4
4
|
export const ManageTag = policy({
|
|
5
5
|
description: 'The caller owns the Project containing this Tag.',
|
|
6
6
|
match: ({ allOf, edge, exists, object, subject }) => exists(({ node }) => {
|
|
@@ -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';
|