@astrale-domains/issues 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -5
- package/dist/schema/modules/comment/classes/comment-authored-by.js +4 -1
- package/dist/schema/modules/comment/classes/comment.d.ts +1 -0
- package/dist/schema/modules/comment/classes/comment.js +5 -2
- package/dist/schema/modules/comment/classes/issue-has-comment.js +1 -1
- package/dist/schema/modules/comment/index.d.ts +1 -1
- package/dist/schema/modules/comment/index.js +1 -1
- package/dist/schema/modules/comment/policies/contribute-to-comment-or-reported-issue-of-comment.d.ts +1 -0
- package/dist/schema/modules/comment/policies/contribute-to-comment-or-reported-issue-of-comment.js +19 -0
- package/dist/schema/modules/comment/policies/index.d.ts +1 -1
- package/dist/schema/modules/comment/policies/index.js +1 -1
- package/dist/schema/modules/comment/policies/traverse-issue-comment.js +3 -3
- package/dist/schema/modules/issue/classes/issue-assigned-to.js +1 -1
- package/dist/schema/modules/issue/classes/issue-reported-by.js +1 -1
- package/dist/schema/modules/issue/classes/issue-subtask-of.js +1 -1
- package/dist/schema/modules/issue/classes/issue.d.ts +16 -0
- package/dist/schema/modules/issue/classes/issue.js +7 -2
- package/dist/schema/modules/issue/classes/project-contains-issue.js +1 -1
- package/dist/schema/modules/issue/functions/archive-issue.js +2 -2
- package/dist/schema/modules/issue/functions/edit-issue.d.ts +15 -0
- package/dist/schema/modules/issue/functions/edit-issue.js +14 -0
- package/dist/schema/modules/issue/functions/index.d.ts +1 -0
- package/dist/schema/modules/issue/functions/index.js +1 -0
- package/dist/schema/modules/issue/index.d.ts +2 -2
- package/dist/schema/modules/issue/index.js +2 -2
- package/dist/schema/modules/issue/policies/contribute-to-issue-or-reported-issue.d.ts +1 -0
- package/dist/schema/modules/issue/policies/contribute-to-issue-or-reported-issue.js +16 -0
- package/dist/schema/modules/issue/policies/index.d.ts +2 -0
- package/dist/schema/modules/issue/policies/index.js +2 -0
- package/dist/schema/modules/issue/policies/reported-issue.d.ts +1 -0
- package/dist/schema/modules/issue/policies/reported-issue.js +6 -0
- package/dist/schema/modules/issue/policies/traverse-issue-reporter.js +3 -2
- package/dist/schema/modules/project/classes/project-has-member.js +1 -1
- package/dist/schema/modules/project/classes/project-owned-by.js +1 -1
- package/dist/schema/modules/project/classes/project.d.ts +1 -0
- package/dist/schema/modules/project/classes/project.js +1 -1
- package/dist/schema/modules/tag/classes/issue-tagged-with.js +1 -1
- package/dist/schema/modules/tag/classes/project-contains-tag.js +1 -1
- package/dist/schema/modules/tag/classes/tag.d.ts +1 -0
- package/dist/schema/modules/tag/classes/tag.js +1 -1
- package/dist/schema/schema.d.ts +22 -1
- package/dist/schema/schema.js +5 -3
- package/package.json +1 -1
- package/dist/schema/modules/comment/policies/contribute-to-comment.d.ts +0 -1
- package/dist/schema/modules/comment/policies/contribute-to-comment.js +0 -12
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ The public callable surface keeps observation Project-owned and mutations receiv
|
|
|
31
31
|
Project.create
|
|
32
32
|
Project.list
|
|
33
33
|
Project.update | addMember | removeMember | createIssue | receiveReport | createTag | archive
|
|
34
|
-
Issue.update | transition | assign | setTags | setParent | addComment | archive
|
|
34
|
+
Issue.update | edit | transition | assign | setTags | setParent | addComment | archive
|
|
35
35
|
Comment.edit | delete
|
|
36
36
|
Tag.edit | delete
|
|
37
37
|
```
|
|
@@ -43,9 +43,13 @@ oversized Mutation with a backend-dependent failure.
|
|
|
43
43
|
|
|
44
44
|
`Project.create` and `Project.list` require authentication. `Project.list` returns only Projects the
|
|
45
45
|
caller owns or has joined, with their visible Issues and Comment threads nested for one CLI/agent
|
|
46
|
-
observation.
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
observation. A reporter observes its own Issues through the graph, under its own authority: from
|
|
47
|
+
its Identity through `issue_reported_by`, then each Issue's Comments. Receiver Methods use
|
|
48
|
+
Schema-owned Policies: Project owners administer metadata, membership, Tags, and archival; owners and
|
|
49
|
+
members contribute to Issues; an Issue's reporter edits its title and description through
|
|
50
|
+
`Issue.edit` and archives it; only a Comment author edits or deletes it. Priority, status,
|
|
51
|
+
assignment, Tags, parent, and Comments remain collaborator operations. Issues and their Comments are
|
|
52
|
+
visible through a Project the caller owns or has joined, and to the Issue's reporter.
|
|
49
53
|
|
|
50
54
|
Ownership, membership, reporting, assignment, and authorship remain graph-native Policy facts. The
|
|
51
55
|
owning Project, Issue, or Comment also stores the corresponding Identity IDs privately, updated in
|
|
@@ -68,7 +72,8 @@ unknown outcomes propagate, so the sender must retain the original payload and k
|
|
|
68
72
|
The inline Workflow runner is not the source of durability: the graph receipt and atomic preconditions are.
|
|
69
73
|
|
|
70
74
|
Context describes current client observations, separate from mutable Issue text. Missing versions and
|
|
71
|
-
instance coordinates remain unknown. Creating a report
|
|
75
|
+
instance coordinates remain unknown. Creating a report makes the sender the Issue's reporter, with
|
|
76
|
+
the reporter access above; it grants no Project membership and no access to other Issues or Tags.
|
|
72
77
|
The generic domain has no Admin dependency. Receiving a report performs no automatic triage,
|
|
73
78
|
duplicate matching, or background processing.
|
|
74
79
|
|
|
@@ -5,5 +5,8 @@ export const comment_authored_by = edgeClass.directed({
|
|
|
5
5
|
description: 'The immutable author of one Comment.',
|
|
6
6
|
source: { as: 'author', accepts: [K.classes.Identity], outgoing: '0..*' },
|
|
7
7
|
target: { as: 'comment', accepts: [() => Comment], incoming: '1' },
|
|
8
|
-
policies: {
|
|
8
|
+
policies: {
|
|
9
|
+
read: () => TraverseCommentRelationship,
|
|
10
|
+
traverse: () => TraverseCommentRelationship,
|
|
11
|
+
},
|
|
9
12
|
});
|
|
@@ -4,7 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
import { nodeIdValue } from '../../../types/index.js';
|
|
5
5
|
import { deleteCommentMethod } from '../functions/delete-comment.js';
|
|
6
6
|
import { editCommentMethod } from '../functions/edit-comment.js';
|
|
7
|
-
import {
|
|
7
|
+
import { ContributeToCommentOrReportedIssueOfComment } from '../policies/contribute-to-comment-or-reported-issue-of-comment.js';
|
|
8
8
|
export const Comment = nodeClass({
|
|
9
9
|
description: 'One authored discussion entry attached to an Issue.',
|
|
10
10
|
icon: classIcon.lucide(MessageSquare),
|
|
@@ -14,5 +14,8 @@ export const Comment = nodeClass({
|
|
|
14
14
|
authorId: property(nodeIdValue, {}),
|
|
15
15
|
},
|
|
16
16
|
methods: { edit: editCommentMethod, delete: deleteCommentMethod },
|
|
17
|
-
policies: {
|
|
17
|
+
policies: {
|
|
18
|
+
read: () => ContributeToCommentOrReportedIssueOfComment,
|
|
19
|
+
traverse: () => ContributeToCommentOrReportedIssueOfComment,
|
|
20
|
+
},
|
|
18
21
|
});
|
|
@@ -6,5 +6,5 @@ export const issue_has_comment = edgeClass.directed({
|
|
|
6
6
|
description: 'One Issue contains one Comment.',
|
|
7
7
|
source: { as: 'issue', accepts: [() => Issue], outgoing: '0..*' },
|
|
8
8
|
target: { as: 'comment', accepts: [() => Comment], incoming: '1' },
|
|
9
|
-
policies: { traverse: () => TraverseIssueComment },
|
|
9
|
+
policies: { read: () => TraverseIssueComment, traverse: () => TraverseIssueComment },
|
|
10
10
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { commentValue } from './types/index.js';
|
|
2
2
|
export { comment_authored_by, Comment, issue_has_comment } from './classes/index.js';
|
|
3
3
|
export { deleteCommentMethod, editCommentMethod } from './functions/index.js';
|
|
4
|
-
export {
|
|
4
|
+
export { ContributeToCommentOrReportedIssueOfComment, EditOwnComment, TraverseCommentRelationship, TraverseIssueComment, } from './policies/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { commentValue } from './types/index.js';
|
|
2
2
|
export { comment_authored_by, Comment, issue_has_comment } from './classes/index.js';
|
|
3
3
|
export { deleteCommentMethod, editCommentMethod } from './functions/index.js';
|
|
4
|
-
export {
|
|
4
|
+
export { ContributeToCommentOrReportedIssueOfComment, EditOwnComment, TraverseCommentRelationship, TraverseIssueComment, } from './policies/index.js';
|
package/dist/schema/modules/comment/policies/contribute-to-comment-or-reported-issue-of-comment.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ContributeToCommentOrReportedIssueOfComment: import("@astrale-os/sdk/schema").Policy;
|
package/dist/schema/modules/comment/policies/contribute-to-comment-or-reported-issue-of-comment.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { Issue, issue_reported_by, project_contains_issue } from '../../issue/index.js';
|
|
3
|
+
import { Project, project_has_member, project_owned_by } from '../../project/index.js';
|
|
4
|
+
import { issue_has_comment } from '../classes/issue-has-comment.js';
|
|
5
|
+
export const ContributeToCommentOrReportedIssueOfComment = policy({
|
|
6
|
+
description: 'The caller owns or belongs to the Project containing this Comment, or reported its Issue.',
|
|
7
|
+
match: ({ allOf, anyOf, edge, exists, object, subject }) => anyOf(exists(({ node }) => {
|
|
8
|
+
const project = node(() => Project);
|
|
9
|
+
const issue = node(() => Issue);
|
|
10
|
+
return allOf(edge({ source: subject, class: () => project_owned_by, target: project }), edge({ source: project, class: () => project_contains_issue, target: issue }), edge({ source: issue, class: () => issue_has_comment, target: object }));
|
|
11
|
+
}), exists(({ node }) => {
|
|
12
|
+
const project = node(() => Project);
|
|
13
|
+
const issue = node(() => Issue);
|
|
14
|
+
return allOf(edge({ source: subject, class: () => project_has_member, target: project }), edge({ source: project, class: () => project_contains_issue, target: issue }), edge({ source: issue, class: () => issue_has_comment, target: object }));
|
|
15
|
+
}), exists(({ node }) => {
|
|
16
|
+
const issue = node(() => Issue);
|
|
17
|
+
return allOf(edge({ source: subject, class: () => issue_reported_by, target: issue }), edge({ source: issue, class: () => issue_has_comment, target: object }));
|
|
18
|
+
})),
|
|
19
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ContributeToCommentOrReportedIssueOfComment } from './contribute-to-comment-or-reported-issue-of-comment.js';
|
|
2
2
|
export { EditOwnComment } from './edit-own-comment.js';
|
|
3
3
|
export { TraverseCommentRelationship } from './traverse-comment-relationship.js';
|
|
4
4
|
export { TraverseIssueComment } from './traverse-issue-comment.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ContributeToCommentOrReportedIssueOfComment } from './contribute-to-comment-or-reported-issue-of-comment.js';
|
|
2
2
|
export { EditOwnComment } from './edit-own-comment.js';
|
|
3
3
|
export { TraverseCommentRelationship } from './traverse-comment-relationship.js';
|
|
4
4
|
export { TraverseIssueComment } from './traverse-issue-comment.js';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { project_contains_issue } from '../../issue/index.js';
|
|
2
|
+
import { issue_reported_by, project_contains_issue } from '../../issue/index.js';
|
|
3
3
|
import { Project, project_has_member, project_owned_by } from '../../project/index.js';
|
|
4
4
|
export const TraverseIssueComment = policy({
|
|
5
|
-
description: 'Issue Comment containment is visible
|
|
5
|
+
description: 'Issue Comment containment is visible inside the containing Project and to the Issue reporter.',
|
|
6
6
|
match: ({ allOf, anyOf, edge, exists, source, subject }) => anyOf(exists(({ node }) => {
|
|
7
7
|
const project = node(() => Project);
|
|
8
8
|
return allOf(edge({ source: project, class: () => project_contains_issue, target: source }), edge({ source: subject, class: () => project_owned_by, target: project }));
|
|
9
9
|
}), exists(({ node }) => {
|
|
10
10
|
const project = node(() => Project);
|
|
11
11
|
return allOf(edge({ source: project, class: () => project_contains_issue, target: source }), edge({ source: subject, class: () => project_has_member, target: project }));
|
|
12
|
-
})),
|
|
12
|
+
}), edge({ source: subject, class: () => issue_reported_by, target: source })),
|
|
13
13
|
});
|
|
@@ -5,5 +5,5 @@ export const issue_assigned_to = edgeClass.directed({
|
|
|
5
5
|
description: 'The optional current assignee of one Issue.',
|
|
6
6
|
source: { as: 'assignee', accepts: [K.classes.Identity], outgoing: '0..*' },
|
|
7
7
|
target: { as: 'issue', accepts: [() => Issue], incoming: '0..1' },
|
|
8
|
-
policies: { traverse: () => TraverseIssueAssignee },
|
|
8
|
+
policies: { read: () => TraverseIssueAssignee, traverse: () => TraverseIssueAssignee },
|
|
9
9
|
});
|
|
@@ -5,5 +5,5 @@ export const issue_reported_by = edgeClass.directed({
|
|
|
5
5
|
description: 'The immutable reporter of one Issue.',
|
|
6
6
|
source: { as: 'reporter', accepts: [K.classes.Identity], outgoing: '0..*' },
|
|
7
7
|
target: { as: 'issue', accepts: [() => Issue], incoming: '1' },
|
|
8
|
-
policies: { traverse: () => TraverseIssueReporter },
|
|
8
|
+
policies: { read: () => TraverseIssueReporter, traverse: () => TraverseIssueReporter },
|
|
9
9
|
});
|
|
@@ -6,5 +6,5 @@ export const issue_subtask_of = edgeClass.directed({
|
|
|
6
6
|
source: { as: 'child', accepts: [() => Issue], outgoing: '0..1' },
|
|
7
7
|
target: { as: 'parent', accepts: [() => Issue], incoming: '0..*' },
|
|
8
8
|
constraints: { noSelf: true, acyclic: true },
|
|
9
|
-
policies: { traverse: () => TraverseIssueParent },
|
|
9
|
+
policies: { read: () => TraverseIssueParent, traverse: () => TraverseIssueParent },
|
|
10
10
|
});
|
|
@@ -93,6 +93,21 @@ export declare const Issue: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
|
93
93
|
archived: boolean;
|
|
94
94
|
};
|
|
95
95
|
}, "authorized", false, false, undefined>>;
|
|
96
|
+
edit: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
97
|
+
title?: string | undefined;
|
|
98
|
+
description?: string | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
readonly mode: 'value';
|
|
101
|
+
readonly value: {
|
|
102
|
+
id: string;
|
|
103
|
+
reference: string;
|
|
104
|
+
title: string;
|
|
105
|
+
description: string;
|
|
106
|
+
status: "accepted" | "closed" | "deferred" | "open" | "resolved";
|
|
107
|
+
priority: number;
|
|
108
|
+
archived: boolean;
|
|
109
|
+
};
|
|
110
|
+
}, "authorized", false, false, undefined>>;
|
|
96
111
|
transition: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
97
112
|
event: "accept" | "close" | "defer" | "reopen" | "resolve";
|
|
98
113
|
}, {
|
|
@@ -161,5 +176,6 @@ export declare const Issue: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
|
161
176
|
};
|
|
162
177
|
readonly policies: {
|
|
163
178
|
read: () => import("@astrale-os/sdk/schema").Policy;
|
|
179
|
+
traverse: () => import("@astrale-os/sdk/schema").Policy;
|
|
164
180
|
};
|
|
165
181
|
}>;
|
|
@@ -5,11 +5,12 @@ import { nodeIdValue } from '../../../types/index.js';
|
|
|
5
5
|
import { addIssueCommentMethod } from '../functions/add-issue-comment.js';
|
|
6
6
|
import { archiveIssueMethod } from '../functions/archive-issue.js';
|
|
7
7
|
import { assignIssueMethod } from '../functions/assign-issue.js';
|
|
8
|
+
import { editIssueMethod } from '../functions/edit-issue.js';
|
|
8
9
|
import { setIssueParentMethod } from '../functions/set-issue-parent.js';
|
|
9
10
|
import { setIssueTagsMethod } from '../functions/set-issue-tags.js';
|
|
10
11
|
import { transitionIssueMethod } from '../functions/transition-issue.js';
|
|
11
12
|
import { updateIssueMethod } from '../functions/update-issue.js';
|
|
12
|
-
import {
|
|
13
|
+
import { ContributeToIssueOrReportedIssue } from '../policies/contribute-to-issue-or-reported-issue.js';
|
|
13
14
|
import { issueStatus } from '../states/index.js';
|
|
14
15
|
import { reportContentValue } from '../types/report.js';
|
|
15
16
|
export const Issue = nodeClass({
|
|
@@ -28,6 +29,7 @@ export const Issue = nodeClass({
|
|
|
28
29
|
},
|
|
29
30
|
methods: {
|
|
30
31
|
update: updateIssueMethod,
|
|
32
|
+
edit: editIssueMethod,
|
|
31
33
|
transition: transitionIssueMethod,
|
|
32
34
|
assign: assignIssueMethod,
|
|
33
35
|
setTags: setIssueTagsMethod,
|
|
@@ -35,5 +37,8 @@ export const Issue = nodeClass({
|
|
|
35
37
|
addComment: addIssueCommentMethod,
|
|
36
38
|
archive: archiveIssueMethod,
|
|
37
39
|
},
|
|
38
|
-
policies: {
|
|
40
|
+
policies: {
|
|
41
|
+
read: () => ContributeToIssueOrReportedIssue,
|
|
42
|
+
traverse: () => ContributeToIssueOrReportedIssue,
|
|
43
|
+
},
|
|
39
44
|
});
|
|
@@ -6,5 +6,5 @@ export const project_contains_issue = edgeClass.directed({
|
|
|
6
6
|
description: 'One Project contains and numbers one Issue.',
|
|
7
7
|
source: { as: 'project', accepts: [() => Project], outgoing: '0..*' },
|
|
8
8
|
target: { as: 'issue', accepts: [() => Issue], incoming: '1' },
|
|
9
|
-
policies: { traverse: () => TraverseProjectIssue },
|
|
9
|
+
policies: { read: () => TraverseProjectIssue, traverse: () => TraverseProjectIssue },
|
|
10
10
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { method } from '@astrale-os/sdk/schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { nodeIdValue } from '../../../types/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { ContributeToIssueOrReportedIssue } from '../policies/contribute-to-issue-or-reported-issue.js';
|
|
5
5
|
export const archiveIssueMethod = method({
|
|
6
6
|
description: 'Archive this Issue without deleting its discussion or relationships.',
|
|
7
7
|
auth: 'authorized',
|
|
8
|
-
policy: ({ check, self }) => check(
|
|
8
|
+
policy: ({ check, self }) => check(ContributeToIssueOrReportedIssue, self),
|
|
9
9
|
input: z.strictObject({}),
|
|
10
10
|
output: z.strictObject({ issueId: nodeIdValue, archived: z.literal(true) }),
|
|
11
11
|
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const editIssueMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
title?: string | undefined;
|
|
3
|
+
description?: string | undefined;
|
|
4
|
+
}, {
|
|
5
|
+
readonly mode: 'value';
|
|
6
|
+
readonly value: {
|
|
7
|
+
id: string;
|
|
8
|
+
reference: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
status: "accepted" | "closed" | "deferred" | "open" | "resolved";
|
|
12
|
+
priority: number;
|
|
13
|
+
archived: boolean;
|
|
14
|
+
};
|
|
15
|
+
}, "authorized", false, false, undefined>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ReportedIssue } from '../policies/reported-issue.js';
|
|
4
|
+
import { issueValue } from '../types/issue.js';
|
|
5
|
+
export const editIssueMethod = method({
|
|
6
|
+
description: 'Edit the title and description of this Issue as its reporter.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(ReportedIssue, self),
|
|
9
|
+
input: z.strictObject({
|
|
10
|
+
title: z.string().min(1).max(200).optional(),
|
|
11
|
+
description: z.string().max(50_000).optional(),
|
|
12
|
+
}),
|
|
13
|
+
output: issueValue,
|
|
14
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { addIssueCommentMethod } from './add-issue-comment.js';
|
|
2
2
|
export { archiveIssueMethod } from './archive-issue.js';
|
|
3
3
|
export { assignIssueMethod } from './assign-issue.js';
|
|
4
|
+
export { editIssueMethod } from './edit-issue.js';
|
|
4
5
|
export { setIssueParentMethod } from './set-issue-parent.js';
|
|
5
6
|
export { setIssueTagsMethod } from './set-issue-tags.js';
|
|
6
7
|
export { transitionIssueMethod } from './transition-issue.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { addIssueCommentMethod } from './add-issue-comment.js';
|
|
2
2
|
export { archiveIssueMethod } from './archive-issue.js';
|
|
3
3
|
export { assignIssueMethod } from './assign-issue.js';
|
|
4
|
+
export { editIssueMethod } from './edit-issue.js';
|
|
4
5
|
export { setIssueParentMethod } from './set-issue-parent.js';
|
|
5
6
|
export { setIssueTagsMethod } from './set-issue-tags.js';
|
|
6
7
|
export { transitionIssueMethod } from './transition-issue.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { issueValue, reportContentValue, reportContextValue, receiveReportInput, reportReceiptValue, type ReportContent, } from './types/index.js';
|
|
2
2
|
export { issueStatus, type IssueEvent, type IssueStatus } from './states/index.js';
|
|
3
3
|
export { issue_assigned_to, issue_reported_by, issue_subtask_of, Issue, project_contains_issue, } from './classes/index.js';
|
|
4
|
-
export { addIssueCommentMethod, archiveIssueMethod, assignIssueMethod, setIssueParentMethod, setIssueTagsMethod, transitionIssueMethod, updateIssueMethod, } from './functions/index.js';
|
|
5
|
-
export { ContributeToIssue, TraverseIssueAssignee, TraverseIssueParent, TraverseIssueReporter, TraverseProjectIssue, } from './policies/index.js';
|
|
4
|
+
export { addIssueCommentMethod, archiveIssueMethod, assignIssueMethod, editIssueMethod, setIssueParentMethod, setIssueTagsMethod, transitionIssueMethod, updateIssueMethod, } from './functions/index.js';
|
|
5
|
+
export { ContributeToIssue, ContributeToIssueOrReportedIssue, ReportedIssue, TraverseIssueAssignee, TraverseIssueParent, TraverseIssueReporter, TraverseProjectIssue, } from './policies/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { issueValue, reportContentValue, reportContextValue, receiveReportInput, reportReceiptValue, } from './types/index.js';
|
|
2
2
|
export { issueStatus } from './states/index.js';
|
|
3
3
|
export { issue_assigned_to, issue_reported_by, issue_subtask_of, Issue, project_contains_issue, } from './classes/index.js';
|
|
4
|
-
export { addIssueCommentMethod, archiveIssueMethod, assignIssueMethod, setIssueParentMethod, setIssueTagsMethod, transitionIssueMethod, updateIssueMethod, } from './functions/index.js';
|
|
5
|
-
export { ContributeToIssue, TraverseIssueAssignee, TraverseIssueParent, TraverseIssueReporter, TraverseProjectIssue, } from './policies/index.js';
|
|
4
|
+
export { addIssueCommentMethod, archiveIssueMethod, assignIssueMethod, editIssueMethod, setIssueParentMethod, setIssueTagsMethod, transitionIssueMethod, updateIssueMethod, } from './functions/index.js';
|
|
5
|
+
export { ContributeToIssue, ContributeToIssueOrReportedIssue, ReportedIssue, TraverseIssueAssignee, TraverseIssueParent, TraverseIssueReporter, TraverseProjectIssue, } from './policies/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ContributeToIssueOrReportedIssue: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
// Flat rather than `policy.anyOf(ContributeToIssue, ReportedIssue)`: composition adds one level to
|
|
6
|
+
// the depth-4 collaborator walk, above the Pattern depth budget.
|
|
7
|
+
export const ContributeToIssueOrReportedIssue = policy({
|
|
8
|
+
description: 'The caller owns or belongs to the Project containing this Issue, or is its immutable reporter.',
|
|
9
|
+
match: ({ allOf, anyOf, edge, exists, object, subject }) => anyOf(exists(({ node }) => {
|
|
10
|
+
const project = node(() => Project);
|
|
11
|
+
return allOf(edge({ source: subject, class: () => project_owned_by, target: project }), edge({ source: project, class: () => project_contains_issue, target: object }));
|
|
12
|
+
}), exists(({ node }) => {
|
|
13
|
+
const project = node(() => Project);
|
|
14
|
+
return allOf(edge({ source: subject, class: () => project_has_member, target: project }), edge({ source: project, class: () => project_contains_issue, target: object }));
|
|
15
|
+
}), edge({ source: subject, class: () => issue_reported_by, target: object })),
|
|
16
|
+
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { ContributeToIssue } from './contribute-to-issue.js';
|
|
2
|
+
export { ContributeToIssueOrReportedIssue } from './contribute-to-issue-or-reported-issue.js';
|
|
3
|
+
export { ReportedIssue } from './reported-issue.js';
|
|
2
4
|
export { TraverseIssueAssignee } from './traverse-issue-assignee.js';
|
|
3
5
|
export { TraverseIssueParent } from './traverse-issue-parent.js';
|
|
4
6
|
export { TraverseIssueReporter } from './traverse-issue-reporter.js';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { ContributeToIssue } from './contribute-to-issue.js';
|
|
2
|
+
export { ContributeToIssueOrReportedIssue } from './contribute-to-issue-or-reported-issue.js';
|
|
3
|
+
export { ReportedIssue } from './reported-issue.js';
|
|
2
4
|
export { TraverseIssueAssignee } from './traverse-issue-assignee.js';
|
|
3
5
|
export { TraverseIssueParent } from './traverse-issue-parent.js';
|
|
4
6
|
export { TraverseIssueReporter } from './traverse-issue-reporter.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ReportedIssue: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { issue_reported_by } from '../classes/issue-reported-by.js';
|
|
3
|
+
export const ReportedIssue = policy({
|
|
4
|
+
description: 'The caller is the immutable reporter of this Issue.',
|
|
5
|
+
match: ({ edge, object, subject }) => edge({ source: subject, class: () => issue_reported_by, target: object }),
|
|
6
|
+
});
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
2
|
import { Project, project_has_member, project_owned_by } from '../../project/index.js';
|
|
3
|
+
import { issue_reported_by } from '../classes/issue-reported-by.js';
|
|
3
4
|
import { project_contains_issue } from '../classes/project-contains-issue.js';
|
|
4
5
|
export const TraverseIssueReporter = policy({
|
|
5
|
-
description: 'Issue reporter relationships are visible
|
|
6
|
+
description: 'Issue reporter relationships are visible inside the containing Project and to the reporter.',
|
|
6
7
|
match: ({ allOf, anyOf, edge, exists, subject, target }) => anyOf(exists(({ node }) => {
|
|
7
8
|
const project = node(() => Project);
|
|
8
9
|
return allOf(edge({ source: project, class: () => project_contains_issue, target }), edge({ source: subject, class: () => project_owned_by, target: project }));
|
|
9
10
|
}), exists(({ node }) => {
|
|
10
11
|
const project = node(() => Project);
|
|
11
12
|
return allOf(edge({ source: project, class: () => project_contains_issue, target }), edge({ source: subject, class: () => project_has_member, target: project }));
|
|
12
|
-
})),
|
|
13
|
+
}), edge({ source: subject, class: () => issue_reported_by, target })),
|
|
13
14
|
});
|
|
@@ -5,5 +5,5 @@ export const project_has_member = edgeClass.directed({
|
|
|
5
5
|
description: 'An Identity admitted to collaborate in one Project.',
|
|
6
6
|
source: { as: 'member', accepts: [K.classes.Identity], outgoing: '0..*' },
|
|
7
7
|
target: { as: 'project', accepts: [() => Project], incoming: '0..*' },
|
|
8
|
-
policies: { traverse: () => TraverseProjectMember },
|
|
8
|
+
policies: { read: () => TraverseProjectMember, traverse: () => TraverseProjectMember },
|
|
9
9
|
});
|
|
@@ -5,5 +5,5 @@ export const project_owned_by = edgeClass.directed({
|
|
|
5
5
|
description: 'The exact Identity that owns and administers one Project.',
|
|
6
6
|
source: { as: 'owner', accepts: [K.classes.Identity], outgoing: '0..*' },
|
|
7
7
|
target: { as: 'project', accepts: [() => Project], incoming: '1' },
|
|
8
|
-
policies: { traverse: () => TraverseProjectOwner },
|
|
8
|
+
policies: { read: () => TraverseProjectOwner, traverse: () => TraverseProjectOwner },
|
|
9
9
|
});
|
|
@@ -6,5 +6,5 @@ export const issue_tagged_with = edgeClass.directed({
|
|
|
6
6
|
description: 'One Issue is classified by one Tag from the same Project.',
|
|
7
7
|
source: { as: 'issue', accepts: [() => Issue], outgoing: '0..*' },
|
|
8
8
|
target: { as: 'tag', accepts: [() => Tag], incoming: '0..*' },
|
|
9
|
-
policies: { traverse: () => TraverseIssueTag },
|
|
9
|
+
policies: { read: () => TraverseIssueTag, traverse: () => TraverseIssueTag },
|
|
10
10
|
});
|
|
@@ -6,5 +6,5 @@ export const project_contains_tag = edgeClass.directed({
|
|
|
6
6
|
description: 'One Project owns one local Tag vocabulary entry.',
|
|
7
7
|
source: { as: 'project', accepts: [() => Project], outgoing: '0..*' },
|
|
8
8
|
target: { as: 'tag', accepts: [() => Tag], incoming: '1' },
|
|
9
|
-
policies: { traverse: () => TraverseProjectTag },
|
|
9
|
+
policies: { read: () => TraverseProjectTag, traverse: () => TraverseProjectTag },
|
|
10
10
|
});
|
|
@@ -13,5 +13,5 @@ export const Tag = nodeClass({
|
|
|
13
13
|
color: property(z.string().min(7).max(7), { required: false }),
|
|
14
14
|
},
|
|
15
15
|
methods: { edit: editTagMethod, delete: deleteTagMethod },
|
|
16
|
-
policies: { read: () => ContributeToTag },
|
|
16
|
+
policies: { read: () => ContributeToTag, traverse: () => ContributeToTag },
|
|
17
17
|
});
|
package/dist/schema/schema.d.ts
CHANGED
|
@@ -167,6 +167,7 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
|
|
|
167
167
|
};
|
|
168
168
|
readonly policies: {
|
|
169
169
|
read: () => import("@astrale-os/sdk/schema").Policy;
|
|
170
|
+
traverse: () => import("@astrale-os/sdk/schema").Policy;
|
|
170
171
|
};
|
|
171
172
|
}>;
|
|
172
173
|
readonly Issue: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
@@ -263,6 +264,21 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
|
|
|
263
264
|
archived: boolean;
|
|
264
265
|
};
|
|
265
266
|
}, "authorized", false, false, undefined>>;
|
|
267
|
+
edit: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
268
|
+
title?: string | undefined;
|
|
269
|
+
description?: string | undefined;
|
|
270
|
+
}, {
|
|
271
|
+
readonly mode: 'value';
|
|
272
|
+
readonly value: {
|
|
273
|
+
id: string;
|
|
274
|
+
reference: string;
|
|
275
|
+
title: string;
|
|
276
|
+
description: string;
|
|
277
|
+
status: "accepted" | "closed" | "deferred" | "open" | "resolved";
|
|
278
|
+
priority: number;
|
|
279
|
+
archived: boolean;
|
|
280
|
+
};
|
|
281
|
+
}, "authorized", false, false, undefined>>;
|
|
266
282
|
transition: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
267
283
|
event: "accept" | "close" | "defer" | "reopen" | "resolve";
|
|
268
284
|
}, {
|
|
@@ -331,6 +347,7 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
|
|
|
331
347
|
};
|
|
332
348
|
readonly policies: {
|
|
333
349
|
read: () => import("@astrale-os/sdk/schema").Policy;
|
|
350
|
+
traverse: () => import("@astrale-os/sdk/schema").Policy;
|
|
334
351
|
};
|
|
335
352
|
}>;
|
|
336
353
|
readonly Comment: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
@@ -361,6 +378,7 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
|
|
|
361
378
|
};
|
|
362
379
|
readonly policies: {
|
|
363
380
|
read: () => import("@astrale-os/sdk/schema").Policy;
|
|
381
|
+
traverse: () => import("@astrale-os/sdk/schema").Policy;
|
|
364
382
|
};
|
|
365
383
|
}>;
|
|
366
384
|
readonly Tag: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
@@ -396,6 +414,7 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
|
|
|
396
414
|
};
|
|
397
415
|
readonly policies: {
|
|
398
416
|
read: () => import("@astrale-os/sdk/schema").Policy;
|
|
417
|
+
traverse: () => import("@astrale-os/sdk/schema").Policy;
|
|
399
418
|
};
|
|
400
419
|
}>;
|
|
401
420
|
readonly project_owned_by: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
@@ -566,9 +585,11 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
|
|
|
566
585
|
readonly ManageProject: import("@astrale-os/sdk/schema").Policy;
|
|
567
586
|
readonly ContributeToProject: import("@astrale-os/sdk/schema").Policy;
|
|
568
587
|
readonly ContributeToIssue: import("@astrale-os/sdk/schema").Policy;
|
|
588
|
+
readonly ReportedIssue: import("@astrale-os/sdk/schema").Policy;
|
|
589
|
+
readonly ContributeToIssueOrReportedIssue: import("@astrale-os/sdk/schema").Policy;
|
|
569
590
|
readonly ContributeToTag: import("@astrale-os/sdk/schema").Policy;
|
|
570
591
|
readonly ManageTag: import("@astrale-os/sdk/schema").Policy;
|
|
571
|
-
readonly
|
|
592
|
+
readonly ContributeToCommentOrReportedIssueOfComment: import("@astrale-os/sdk/schema").Policy;
|
|
572
593
|
readonly EditOwnComment: import("@astrale-os/sdk/schema").Policy;
|
|
573
594
|
readonly TraverseProjectOwner: import("@astrale-os/sdk/schema").Policy;
|
|
574
595
|
readonly TraverseProjectMember: import("@astrale-os/sdk/schema").Policy;
|
package/dist/schema/schema.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KernelSchema, defineSchema, view } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { Comment, comment_authored_by, issue_has_comment,
|
|
3
|
-
import { Issue, ContributeToIssue, TraverseIssueAssignee, TraverseIssueParent, TraverseIssueReporter, TraverseProjectIssue, issue_assigned_to, issue_reported_by, issue_subtask_of, project_contains_issue, } from './modules/issue/index.js';
|
|
2
|
+
import { Comment, comment_authored_by, issue_has_comment, ContributeToCommentOrReportedIssueOfComment, EditOwnComment, TraverseCommentRelationship, TraverseIssueComment, } from './modules/comment/index.js';
|
|
3
|
+
import { Issue, ContributeToIssue, ContributeToIssueOrReportedIssue, ReportedIssue, TraverseIssueAssignee, TraverseIssueParent, TraverseIssueReporter, TraverseProjectIssue, issue_assigned_to, issue_reported_by, issue_subtask_of, project_contains_issue, } from './modules/issue/index.js';
|
|
4
4
|
import { Project, ContributeToProject, ManageProject, TraverseProjectMember, TraverseProjectOwner, project_has_member, project_owned_by, } from './modules/project/index.js';
|
|
5
5
|
import { Tag, ContributeToTag, ManageTag, TraverseIssueTag, TraverseProjectTag, issue_tagged_with, project_contains_tag, } from './modules/tag/index.js';
|
|
6
6
|
const origin = 'issues.astrale.ai';
|
|
@@ -24,9 +24,11 @@ const policies = {
|
|
|
24
24
|
ManageProject,
|
|
25
25
|
ContributeToProject,
|
|
26
26
|
ContributeToIssue,
|
|
27
|
+
ReportedIssue,
|
|
28
|
+
ContributeToIssueOrReportedIssue,
|
|
27
29
|
ContributeToTag,
|
|
28
30
|
ManageTag,
|
|
29
|
-
|
|
31
|
+
ContributeToCommentOrReportedIssueOfComment,
|
|
30
32
|
EditOwnComment,
|
|
31
33
|
TraverseProjectOwner,
|
|
32
34
|
TraverseProjectMember,
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ContributeToComment: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { Issue, project_contains_issue } from '../../issue/index.js';
|
|
3
|
-
import { Project, project_has_member, project_owned_by } from '../../project/index.js';
|
|
4
|
-
import { issue_has_comment } from '../classes/issue-has-comment.js';
|
|
5
|
-
export const ContributeToComment = policy({
|
|
6
|
-
description: 'The caller owns or belongs to the Project containing this Comment.',
|
|
7
|
-
match: ({ allOf, anyOf, edge, exists, object, subject }) => exists(({ node }) => {
|
|
8
|
-
const project = node(() => Project);
|
|
9
|
-
const issue = node(() => Issue);
|
|
10
|
-
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_issue, target: issue }), edge({ source: issue, class: () => issue_has_comment, target: object }));
|
|
11
|
-
}),
|
|
12
|
-
});
|