@astrale-domains/issues 0.7.3 → 0.7.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/README.md +24 -12
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/schema/modules/comment/classes/comment-authored-by.js +3 -3
- package/dist/schema/modules/comment/classes/comment.js +3 -3
- package/dist/schema/modules/comment/classes/issue-has-comment.d.ts +1 -1
- package/dist/schema/modules/comment/classes/issue-has-comment.js +5 -2
- package/dist/schema/modules/comment/functions/delete-comment.js +2 -2
- package/dist/schema/modules/comment/functions/edit-comment.js +2 -2
- 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/authored-comment.d.ts +1 -0
- package/dist/schema/modules/comment/policies/{edit-own-comment.js → authored-comment.js} +1 -1
- package/dist/schema/modules/comment/policies/index.d.ts +4 -4
- package/dist/schema/modules/comment/policies/index.js +4 -4
- package/dist/schema/modules/comment/policies/owns-or-belongs-to-project-of-issue-of-authored-comment.d.ts +1 -0
- package/dist/schema/modules/comment/policies/{traverse-comment-relationship.js → owns-or-belongs-to-project-of-issue-of-authored-comment.js} +2 -2
- package/dist/schema/modules/comment/policies/owns-or-belongs-to-project-of-issue-of-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 → owns-or-belongs-to-project-of-issue-of-comment-or-reported-issue-of-comment.js} +1 -1
- package/dist/schema/modules/comment/policies/owns-or-belongs-to-project-of-issue-with-comment-or-reported-issue-with-comment.d.ts +1 -0
- package/dist/schema/modules/comment/policies/{traverse-issue-comment.js → owns-or-belongs-to-project-of-issue-with-comment-or-reported-issue-with-comment.js} +1 -1
- package/dist/schema/modules/issue/classes/index.d.ts +1 -0
- package/dist/schema/modules/issue/classes/index.js +1 -0
- package/dist/schema/modules/issue/classes/issue-assigned-to.d.ts +1 -1
- package/dist/schema/modules/issue/classes/issue-assigned-to.js +5 -2
- package/dist/schema/modules/issue/classes/issue-is-about.d.ts +30 -0
- package/dist/schema/modules/issue/classes/issue-is-about.js +16 -0
- package/dist/schema/modules/issue/classes/issue-reported-by.d.ts +1 -1
- package/dist/schema/modules/issue/classes/issue-reported-by.js +5 -2
- package/dist/schema/modules/issue/classes/issue-subtask-of.d.ts +2 -2
- package/dist/schema/modules/issue/classes/issue-subtask-of.js +5 -2
- package/dist/schema/modules/issue/classes/issue-tracked-by.d.ts +2 -2
- package/dist/schema/modules/issue/classes/issue-tracked-by.js +5 -2
- package/dist/schema/modules/issue/classes/issue.d.ts +9 -0
- package/dist/schema/modules/issue/classes/issue.js +5 -3
- package/dist/schema/modules/issue/classes/project-contains-issue.d.ts +1 -1
- package/dist/schema/modules/issue/classes/project-contains-issue.js +5 -3
- package/dist/schema/modules/issue/functions/add-issue-comment.js +2 -2
- package/dist/schema/modules/issue/functions/archive-issue.js +2 -2
- package/dist/schema/modules/issue/functions/assign-issue.js +2 -2
- package/dist/schema/modules/issue/functions/delete-issue.js +2 -2
- package/dist/schema/modules/issue/functions/edit-issue.js +2 -2
- 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/functions/set-issue-parent.js +2 -2
- package/dist/schema/modules/issue/functions/set-issue-tags.js +2 -2
- package/dist/schema/modules/issue/functions/set-issue-topics.d.ts +9 -0
- package/dist/schema/modules/issue/functions/set-issue-topics.js +12 -0
- package/dist/schema/modules/issue/functions/track-issue.js +2 -2
- package/dist/schema/modules/issue/functions/transition-issue.js +2 -2
- package/dist/schema/modules/issue/functions/untrack-issue.js +2 -2
- package/dist/schema/modules/issue/functions/update-issue.js +2 -2
- package/dist/schema/modules/issue/index.d.ts +3 -3
- package/dist/schema/modules/issue/index.js +3 -3
- package/dist/schema/modules/issue/policies/index.d.ts +9 -9
- package/dist/schema/modules/issue/policies/index.js +9 -9
- package/dist/schema/modules/issue/policies/owns-or-belongs-to-project-of-assigned-issue.d.ts +1 -0
- package/dist/schema/modules/issue/policies/{traverse-issue-assignee.js → owns-or-belongs-to-project-of-assigned-issue.js} +1 -1
- package/dist/schema/modules/issue/policies/owns-or-belongs-to-project-of-child-issue.d.ts +1 -0
- package/dist/schema/modules/issue/policies/{traverse-issue-parent.js → owns-or-belongs-to-project-of-child-issue.js} +1 -1
- package/dist/schema/modules/issue/policies/owns-or-belongs-to-project-of-issue-or-reported-issue.d.ts +1 -0
- package/dist/schema/modules/issue/policies/{contribute-to-issue-or-reported-issue.js → owns-or-belongs-to-project-of-issue-or-reported-issue.js} +2 -2
- package/dist/schema/modules/issue/policies/owns-or-belongs-to-project-of-issue-with-topic.d.ts +1 -0
- package/dist/schema/modules/issue/policies/owns-or-belongs-to-project-of-issue-with-topic.js +13 -0
- package/dist/schema/modules/issue/policies/owns-or-belongs-to-project-of-issue.d.ts +1 -0
- package/dist/schema/modules/issue/policies/{contribute-to-issue.js → owns-or-belongs-to-project-of-issue.js} +1 -1
- package/dist/schema/modules/issue/policies/owns-or-belongs-to-project-of-reported-issue-or-reported-issue.d.ts +1 -0
- package/dist/schema/modules/issue/policies/{traverse-issue-reporter.js → owns-or-belongs-to-project-of-reported-issue-or-reported-issue.js} +1 -1
- package/dist/schema/modules/issue/policies/owns-or-belongs-to-project-of-tracked-or-tracking-issue.d.ts +2 -0
- package/dist/schema/modules/issue/policies/{traverse-issue-tracking.js → owns-or-belongs-to-project-of-tracked-or-tracking-issue.js} +2 -2
- package/dist/schema/modules/issue/policies/owns-project-of-issue.d.ts +1 -0
- package/dist/schema/modules/issue/policies/{manage-issue.js → owns-project-of-issue.js} +1 -1
- package/dist/schema/modules/issue/policies/reported-issue.d.ts +1 -1
- package/dist/schema/modules/issue/policies/reported-issue.js +1 -1
- package/dist/schema/modules/issue/types/index.d.ts +1 -1
- package/dist/schema/modules/issue/types/index.js +1 -1
- package/dist/schema/modules/issue/types/issue.d.ts +2 -0
- package/dist/schema/modules/issue/types/issue.js +2 -0
- package/dist/schema/modules/project/classes/project-has-member.js +5 -2
- package/dist/schema/modules/project/classes/project-owned-by.js +5 -2
- package/dist/schema/modules/project/classes/project.js +2 -2
- package/dist/schema/modules/project/functions/add-project-member.js +2 -2
- package/dist/schema/modules/project/functions/archive-project.js +2 -2
- package/dist/schema/modules/project/functions/create-project-issue.js +2 -2
- package/dist/schema/modules/project/functions/create-project-tag.js +2 -2
- package/dist/schema/modules/project/functions/delete-project.js +2 -2
- package/dist/schema/modules/project/functions/receive-project-report.js +2 -2
- package/dist/schema/modules/project/functions/remove-project-member.js +2 -2
- package/dist/schema/modules/project/functions/update-project.js +2 -2
- package/dist/schema/modules/project/index.d.ts +1 -1
- package/dist/schema/modules/project/index.js +1 -1
- package/dist/schema/modules/project/policies/index.d.ts +5 -4
- package/dist/schema/modules/project/policies/index.js +5 -4
- package/dist/schema/modules/project/policies/owns-or-belongs-to-containing-project.d.ts +1 -0
- package/dist/schema/modules/project/policies/owns-or-belongs-to-containing-project.js +7 -0
- package/dist/schema/modules/project/policies/owns-or-belongs-to-project-of-membership.d.ts +1 -0
- package/dist/schema/modules/project/policies/{traverse-project-member.js → owns-or-belongs-to-project-of-membership.js} +1 -1
- package/dist/schema/modules/project/policies/owns-or-belongs-to-project-of-ownership.d.ts +1 -0
- package/dist/schema/modules/project/policies/{traverse-project-owner.js → owns-or-belongs-to-project-of-ownership.js} +1 -1
- package/dist/schema/modules/project/policies/owns-or-belongs-to-project.d.ts +1 -0
- package/dist/schema/modules/project/policies/{contribute-to-project.js → owns-or-belongs-to-project.js} +1 -1
- package/dist/schema/modules/project/policies/owns-project.d.ts +1 -0
- package/dist/schema/modules/project/policies/{manage-project.js → owns-project.js} +1 -1
- package/dist/schema/modules/project/types/project-edges.d.ts +1 -1
- package/dist/schema/modules/tag/classes/issue-tagged-with.d.ts +1 -1
- package/dist/schema/modules/tag/classes/issue-tagged-with.js +5 -2
- package/dist/schema/modules/tag/classes/project-contains-tag.js +5 -3
- package/dist/schema/modules/tag/classes/tag.js +5 -2
- package/dist/schema/modules/tag/functions/delete-tag.js +2 -2
- package/dist/schema/modules/tag/functions/edit-tag.js +2 -2
- package/dist/schema/modules/tag/index.d.ts +1 -1
- package/dist/schema/modules/tag/index.js +1 -1
- package/dist/schema/modules/tag/policies/index.d.ts +3 -4
- package/dist/schema/modules/tag/policies/index.js +3 -4
- package/dist/schema/modules/tag/policies/owns-or-belongs-to-project-of-tag.d.ts +1 -0
- package/dist/schema/modules/tag/policies/{contribute-to-tag.js → owns-or-belongs-to-project-of-tag.js} +1 -1
- package/dist/schema/modules/tag/policies/owns-or-belongs-to-project-of-tagged-issue.d.ts +1 -0
- package/dist/schema/modules/tag/policies/{traverse-issue-tag.js → owns-or-belongs-to-project-of-tagged-issue.js} +1 -1
- package/dist/schema/modules/tag/policies/owns-project-of-tag.d.ts +1 -0
- package/dist/schema/modules/tag/policies/{manage-tag.js → owns-project-of-tag.js} +1 -1
- package/dist/schema/schema.d.ts +979 -30
- package/dist/schema/schema.js +28 -26
- package/package.json +3 -1
- package/dist/schema/modules/comment/policies/contribute-to-comment-or-reported-issue-of-comment.d.ts +0 -1
- package/dist/schema/modules/comment/policies/edit-own-comment.d.ts +0 -1
- package/dist/schema/modules/comment/policies/traverse-comment-relationship.d.ts +0 -1
- package/dist/schema/modules/comment/policies/traverse-issue-comment.d.ts +0 -1
- package/dist/schema/modules/issue/policies/contribute-to-issue-or-reported-issue.d.ts +0 -1
- package/dist/schema/modules/issue/policies/contribute-to-issue.d.ts +0 -1
- package/dist/schema/modules/issue/policies/manage-issue.d.ts +0 -1
- package/dist/schema/modules/issue/policies/traverse-issue-assignee.d.ts +0 -1
- package/dist/schema/modules/issue/policies/traverse-issue-parent.d.ts +0 -1
- package/dist/schema/modules/issue/policies/traverse-issue-reporter.d.ts +0 -1
- package/dist/schema/modules/issue/policies/traverse-issue-tracking.d.ts +0 -2
- package/dist/schema/modules/issue/policies/traverse-project-issue.d.ts +0 -1
- package/dist/schema/modules/issue/policies/traverse-project-issue.js +0 -6
- package/dist/schema/modules/project/policies/contribute-to-project.d.ts +0 -1
- package/dist/schema/modules/project/policies/manage-project.d.ts +0 -1
- package/dist/schema/modules/project/policies/traverse-project-member.d.ts +0 -1
- package/dist/schema/modules/project/policies/traverse-project-owner.d.ts +0 -1
- package/dist/schema/modules/tag/policies/contribute-to-tag.d.ts +0 -1
- package/dist/schema/modules/tag/policies/manage-tag.d.ts +0 -1
- package/dist/schema/modules/tag/policies/traverse-issue-tag.d.ts +0 -1
- package/dist/schema/modules/tag/policies/traverse-project-tag.d.ts +0 -1
- package/dist/schema/modules/tag/policies/traverse-project-tag.js +0 -6
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
It is an Astrale Application with Schema Policies, receiver Methods, atomic Mutations, and an
|
|
5
5
|
inbox-first Shell View.
|
|
6
6
|
|
|
7
|
-
The
|
|
8
|
-
|
|
7
|
+
Collaboration edges target any `Identity` subtype. The Schema depends on Kernel, and on Shell only
|
|
8
|
+
to name the people it holds by their Shell profile; Shell is not a source of Core group data.
|
|
9
9
|
|
|
10
10
|
```text
|
|
11
11
|
Project
|
|
@@ -18,6 +18,7 @@ Issue
|
|
|
18
18
|
status: open | accepted | resolved | closed
|
|
19
19
|
priority: no priority, low, medium, high, urgent (0..4); optional assignee; optional acyclic parent; Tags
|
|
20
20
|
tracked by at most one other Issue, in any Project
|
|
21
|
+
about at most 32 Nodes, of any Domain
|
|
21
22
|
|
|
22
23
|
Comment
|
|
23
24
|
body; immutable author; belongs to one Issue
|
|
@@ -33,8 +34,8 @@ Comments by reading the graph under their own authority:
|
|
|
33
34
|
Project.create
|
|
34
35
|
Project.update | addMember | removeMember | createIssue | receiveReport | createTag | archive
|
|
35
36
|
| delete
|
|
36
|
-
Issue.update | edit | transition | assign | setTags | setParent | track | untrack
|
|
37
|
-
| archive | delete
|
|
37
|
+
Issue.update | edit | transition | assign | setTags | setTopics | setParent | track | untrack
|
|
38
|
+
| addComment | archive | delete
|
|
38
39
|
Comment.edit | delete
|
|
39
40
|
Tag.edit | delete
|
|
40
41
|
```
|
|
@@ -48,8 +49,8 @@ failure.
|
|
|
48
49
|
`Issue.delete` deletes an Issue for good, archived or not, in one atomic Mutation: its Comments,
|
|
49
50
|
and every Edge that holds the Issue or one of its Comments. Its sub-Issues stay, without a parent.
|
|
50
51
|
Its reference is never given again, since a Project's `nextIssueNumber` only grows. The Mutation
|
|
51
|
-
holds at most 2,048 writes: three per Comment, one per sub-Issue, Tag
|
|
52
|
-
Issue in its Project. A larger Issue is refused (`ISSUE_TOO_LARGE_TO_DELETE`) until some Comments
|
|
52
|
+
holds at most 2,048 writes: three per Comment, one per sub-Issue, Tag, Node it is about and person,
|
|
53
|
+
and two for the Issue in its Project. A larger Issue is refused (`ISSUE_TOO_LARGE_TO_DELETE`) until some Comments
|
|
53
54
|
are deleted or sub-Issues detached, and an archived Project refuses it (`PROJECT_ARCHIVED`). The
|
|
54
55
|
Edges are read from the graph, not from `reporterId`, `assigneeId` or `authorId`, so an Issue whose
|
|
55
56
|
reporter, assignee or Comment author was deleted is still deleted whole.
|
|
@@ -57,7 +58,7 @@ reporter, assignee or Comment author was deleted is still deleted whole.
|
|
|
57
58
|
`Project.delete` lets the owner delete a Project for good, archived or not, in one atomic
|
|
58
59
|
Mutation: its Issues, their Comments, its Tags, and every Edge that holds one of them. An Issue of
|
|
59
60
|
another Project that one of its Issues tracks, or that tracks one of them, stays, untracked, with
|
|
60
|
-
its status. The Mutation holds at most 2,048 writes: one per Edge, Issue, Tag and Comment, and one
|
|
61
|
+
its status, and a Node one of its Issues is about stays as it was. The Mutation holds at most 2,048 writes: one per Edge, Issue, Tag and Comment, and one
|
|
61
62
|
for the Project. A larger Project is refused (`PROJECT_TOO_LARGE_TO_DELETE`) until some Issues or
|
|
62
63
|
Comments are deleted, which only an open Project allows. The Edges are read from the graph, each
|
|
63
64
|
Class counted before it is listed, so the read stays within that bound whatever the Project holds.
|
|
@@ -125,26 +126,37 @@ duplicate matching, or background processing.
|
|
|
125
126
|
Other creation methods retain their existing retry semantics. Set-style changes converge naturally;
|
|
126
127
|
stale concurrent edits reject through atomic mutation preconditions.
|
|
127
128
|
|
|
129
|
+
An Issue is about Nodes of any Domain, such as a Product or an Area, through `issue_is_about`; the
|
|
130
|
+
Issues Schema names no other Domain. `Issue.setTopics` replaces the whole set under the same Policy
|
|
131
|
+
as its Tags, and reads each Node under the caller's authority: a Node the caller may not read is
|
|
132
|
+
refused exactly as one that does not exist (`INVALID_ISSUE_TOPIC`). The links are visible inside
|
|
133
|
+
the Issue's Project; a reader who may not read the Node sees the link alone, as hidden. Deleting
|
|
134
|
+
the Node, or uninstalling its Domain destructively, removes the links with it.
|
|
135
|
+
|
|
128
136
|
## View
|
|
129
137
|
|
|
130
138
|
The mounted View is one full-width application under a top bar: Inbox, Issues and Projects, a
|
|
131
139
|
Project switcher that every screen keeps in its URL, a command palette (`⌘K`), New issue (`N`) and search (`/`).
|
|
132
|
-
Every screen, filter and Issue has its own URL. People appear as "You" for the caller and
|
|
133
|
-
|
|
140
|
+
Every screen, filter and Issue has its own URL. People appear as "You" for the caller and by the
|
|
141
|
+
first and last name of their Shell profile for anyone else, else the name the profile carries. A
|
|
142
|
+
profile is read under the caller's authority, within the Shell accounts and profiles the Domain is
|
|
143
|
+
granted at installation, so a Shell workspace member reads everyone's; an Identity that is not a
|
|
144
|
+
Shell account, or whose profile the caller may not read, appears as a short id. A screen reads the
|
|
145
|
+
names of the people it shows once, beyond those the screens around it already read.
|
|
134
146
|
|
|
135
147
|
- **Inbox** triages one open Issue at a time, highest priority first: Accept and Close (`A`,
|
|
136
148
|
`C`) move to the next Issue at once, and a refused triage puts the Issue back. The
|
|
137
149
|
Issue in focus shows its description, report environment and Comments, and takes a reply,
|
|
138
150
|
priority, assignee and Tags without leaving the queue.
|
|
139
151
|
- **Issues** lists the Issues of one status, Accepted by default, with each status's count.
|
|
140
|
-
Priority, assignee, Tags and order filters run on the server and read a page at a time;
|
|
141
|
-
several Tags, an Issue has every one. The search box matches the Issues read so far and offers
|
|
152
|
+
Priority, assignee, Tags, About and order filters run on the server and read a page at a time;
|
|
153
|
+
with several Tags or Nodes, an Issue has every one. The search box matches the Issues read so far and offers
|
|
142
154
|
to read further. Rows are selected with
|
|
143
155
|
the mouse or `x` and changed together: status, assignee and priority. A tracked Issue keeps its
|
|
144
156
|
status, and the change says so.
|
|
145
157
|
- **An Issue's page** shows its title, description and Comments as one Markdown timeline, with
|
|
146
158
|
Write and Preview tabs, editing and deleting under the Schema's Policies. A side column holds
|
|
147
|
-
status, assignee, priority, Tags, parent, sub-Issues with their progress, tracking, details,
|
|
159
|
+
status, assignee, priority, Tags, what it is about, parent, sub-Issues with their progress, tracking, details,
|
|
148
160
|
report environment, archival and, for the Project owner, deletion. A tracked Issue names the
|
|
149
161
|
Issue it follows in place of its status control; an Issue of a Project the reader is not part of
|
|
150
162
|
shows as hidden.
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { schema } from './schema.js';
|
|
2
2
|
export type { IssuesDomain, IssuesSchema } from './schema.js';
|
|
3
3
|
export { Project, project_has_member, project_owned_by } from './modules/project/index.js';
|
|
4
|
-
export { Issue, issue_assigned_to, issue_reported_by, issue_subtask_of, project_contains_issue, } from './modules/issue/index.js';
|
|
4
|
+
export { Issue, issue_assigned_to, issue_is_about, issue_reported_by, issue_subtask_of, project_contains_issue, } from './modules/issue/index.js';
|
|
5
5
|
export { Comment, comment_authored_by, issue_has_comment } from './modules/comment/index.js';
|
|
6
6
|
export { Tag, issue_tagged_with, project_contains_tag } from './modules/tag/index.js';
|
|
7
7
|
export { reportContentValue, reportContextValue, receiveReportInput, reportReceiptValue, type ReportContent, } from './modules/issue/index.js';
|
package/dist/schema/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { schema } from './schema.js';
|
|
2
2
|
export { Project, project_has_member, project_owned_by } from './modules/project/index.js';
|
|
3
|
-
export { Issue, issue_assigned_to, issue_reported_by, issue_subtask_of, project_contains_issue, } from './modules/issue/index.js';
|
|
3
|
+
export { Issue, issue_assigned_to, issue_is_about, issue_reported_by, issue_subtask_of, project_contains_issue, } from './modules/issue/index.js';
|
|
4
4
|
export { Comment, comment_authored_by, issue_has_comment } from './modules/comment/index.js';
|
|
5
5
|
export { Tag, issue_tagged_with, project_contains_tag } from './modules/tag/index.js';
|
|
6
6
|
export { reportContentValue, reportContextValue, receiveReportInput, reportReceiptValue, } from './modules/issue/index.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { K, edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { ownsOrBelongsToProjectOfIssueOfAuthoredComment } from '../policies/owns-or-belongs-to-project-of-issue-of-authored-comment.js';
|
|
3
3
|
import { Comment } from './comment.js';
|
|
4
4
|
export const comment_authored_by = edgeClass.directed({
|
|
5
5
|
description: 'The immutable author of one Comment. Deleting the author removes this Edge; the Comment stays.',
|
|
6
6
|
source: { as: 'author', accepts: [K.classes.Identity], outgoing: '0..*' },
|
|
7
7
|
target: { as: 'comment', accepts: [() => Comment], incoming: '0..1' },
|
|
8
8
|
policies: {
|
|
9
|
-
read: () =>
|
|
10
|
-
traverse: () =>
|
|
9
|
+
read: () => ownsOrBelongsToProjectOfIssueOfAuthoredComment,
|
|
10
|
+
traverse: () => ownsOrBelongsToProjectOfIssueOfAuthoredComment,
|
|
11
11
|
},
|
|
12
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 { ownsOrBelongsToProjectOfIssueOfCommentOrReportedIssueOfComment } from '../policies/owns-or-belongs-to-project-of-issue-of-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),
|
|
@@ -15,7 +15,7 @@ export const Comment = nodeClass({
|
|
|
15
15
|
},
|
|
16
16
|
methods: { edit: editCommentMethod, delete: deleteCommentMethod },
|
|
17
17
|
policies: {
|
|
18
|
-
read: () =>
|
|
19
|
-
traverse: () =>
|
|
18
|
+
read: () => ownsOrBelongsToProjectOfIssueOfCommentOrReportedIssueOfComment,
|
|
19
|
+
traverse: () => ownsOrBelongsToProjectOfIssueOfCommentOrReportedIssueOfComment,
|
|
20
20
|
},
|
|
21
21
|
});
|
|
@@ -10,7 +10,7 @@ export declare const issue_has_comment: import("@astrale-os/sdk/schema").Directe
|
|
|
10
10
|
readonly abstract: false;
|
|
11
11
|
readonly depth: 1;
|
|
12
12
|
readonly properties: "archived" | "assigneeId" | "body" | "createdAt" | "description" | "name" | "priority" | "reference" | "report" | "reportRequestId" | "reporterId" | "status" | "updatedAt";
|
|
13
|
-
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "track" | "transition" | "untrack" | "update";
|
|
13
|
+
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "setTopics" | "track" | "transition" | "untrack" | "update";
|
|
14
14
|
})[];
|
|
15
15
|
readonly outgoing: "0..*";
|
|
16
16
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
2
|
import { Issue } from '../../issue/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { ownsOrBelongsToProjectOfIssueWithCommentOrReportedIssueWithComment } from '../policies/owns-or-belongs-to-project-of-issue-with-comment-or-reported-issue-with-comment.js';
|
|
4
4
|
import { Comment } from './comment.js';
|
|
5
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: {
|
|
9
|
+
policies: {
|
|
10
|
+
read: () => ownsOrBelongsToProjectOfIssueWithCommentOrReportedIssueWithComment,
|
|
11
|
+
traverse: () => ownsOrBelongsToProjectOfIssueWithCommentOrReportedIssueWithComment,
|
|
12
|
+
},
|
|
10
13
|
});
|
|
@@ -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 { authoredComment } from '../policies/authored-comment.js';
|
|
5
5
|
export const deleteCommentMethod = method({
|
|
6
6
|
description: 'Delete this Comment as its author.',
|
|
7
7
|
auth: 'authorized',
|
|
8
|
-
policy: ({ check, self }) => check(
|
|
8
|
+
policy: ({ check, self }) => check(authoredComment, self),
|
|
9
9
|
input: z.strictObject({}),
|
|
10
10
|
output: z.strictObject({ commentId: nodeIdValue, deleted: z.literal(true) }),
|
|
11
11
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { method } from '@astrale-os/sdk/schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
3
|
+
import { authoredComment } from '../policies/authored-comment.js';
|
|
4
4
|
import { commentValue } from '../types/comment.js';
|
|
5
5
|
export const editCommentMethod = method({
|
|
6
6
|
description: 'Edit this Comment as its author.',
|
|
7
7
|
auth: 'authorized',
|
|
8
|
-
policy: ({ check, self }) => check(
|
|
8
|
+
policy: ({ check, self }) => check(authoredComment, self),
|
|
9
9
|
input: z.strictObject({ body: z.string().min(1).max(50_000) }),
|
|
10
10
|
output: commentValue,
|
|
11
11
|
});
|
|
@@ -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 { ownsOrBelongsToProjectOfIssueOfCommentOrReportedIssueOfComment, authoredComment, ownsOrBelongsToProjectOfIssueOfAuthoredComment, ownsOrBelongsToProjectOfIssueWithCommentOrReportedIssueWithComment, } 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 { ownsOrBelongsToProjectOfIssueOfCommentOrReportedIssueOfComment, authoredComment, ownsOrBelongsToProjectOfIssueOfAuthoredComment, ownsOrBelongsToProjectOfIssueWithCommentOrReportedIssueWithComment, } from './policies/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const authoredComment: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
2
|
import { comment_authored_by } from '../classes/comment-authored-by.js';
|
|
3
|
-
export const
|
|
3
|
+
export const authoredComment = policy({
|
|
4
4
|
description: 'The caller is the immutable author of this Comment.',
|
|
5
5
|
match: ({ edge, object, subject }) => edge({ source: subject, class: () => comment_authored_by, target: object }),
|
|
6
6
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export { ownsOrBelongsToProjectOfIssueOfCommentOrReportedIssueOfComment } from './owns-or-belongs-to-project-of-issue-of-comment-or-reported-issue-of-comment.js';
|
|
2
|
+
export { authoredComment } from './authored-comment.js';
|
|
3
|
+
export { ownsOrBelongsToProjectOfIssueOfAuthoredComment } from './owns-or-belongs-to-project-of-issue-of-authored-comment.js';
|
|
4
|
+
export { ownsOrBelongsToProjectOfIssueWithCommentOrReportedIssueWithComment } from './owns-or-belongs-to-project-of-issue-with-comment-or-reported-issue-with-comment.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export { ownsOrBelongsToProjectOfIssueOfCommentOrReportedIssueOfComment } from './owns-or-belongs-to-project-of-issue-of-comment-or-reported-issue-of-comment.js';
|
|
2
|
+
export { authoredComment } from './authored-comment.js';
|
|
3
|
+
export { ownsOrBelongsToProjectOfIssueOfAuthoredComment } from './owns-or-belongs-to-project-of-issue-of-authored-comment.js';
|
|
4
|
+
export { ownsOrBelongsToProjectOfIssueWithCommentOrReportedIssueWithComment } from './owns-or-belongs-to-project-of-issue-with-comment-or-reported-issue-with-comment.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ownsOrBelongsToProjectOfIssueOfAuthoredComment: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -2,8 +2,8 @@ import { policy } from '@astrale-os/sdk/schema';
|
|
|
2
2
|
import { Issue, project_contains_issue } from '../../issue/index.js';
|
|
3
3
|
import { Project, project_has_member, project_owned_by } from '../../project/index.js';
|
|
4
4
|
import { issue_has_comment } from '../classes/issue-has-comment.js';
|
|
5
|
-
export const
|
|
6
|
-
description: 'The caller owns or belongs to the Project containing the
|
|
5
|
+
export const ownsOrBelongsToProjectOfIssueOfAuthoredComment = policy({
|
|
6
|
+
description: 'The caller owns or belongs to the Project containing the Issue of this Comment.',
|
|
7
7
|
match: ({ allOf, anyOf, edge, exists, subject, target }) => anyOf(exists(({ node }) => {
|
|
8
8
|
const issue = node(() => Issue);
|
|
9
9
|
const project = node(() => Project);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ownsOrBelongsToProjectOfIssueOfCommentOrReportedIssueOfComment: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -2,7 +2,7 @@ import { policy } from '@astrale-os/sdk/schema';
|
|
|
2
2
|
import { Issue, 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
|
import { issue_has_comment } from '../classes/issue-has-comment.js';
|
|
5
|
-
export const
|
|
5
|
+
export const ownsOrBelongsToProjectOfIssueOfCommentOrReportedIssueOfComment = policy({
|
|
6
6
|
description: 'The caller owns or belongs to the Project containing this Comment, or reported its Issue.',
|
|
7
7
|
match: ({ allOf, anyOf, edge, exists, object, subject }) => anyOf(exists(({ node }) => {
|
|
8
8
|
const project = node(() => Project);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ownsOrBelongsToProjectOfIssueWithCommentOrReportedIssueWithComment: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
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
|
-
export const
|
|
4
|
+
export const ownsOrBelongsToProjectOfIssueWithCommentOrReportedIssueWithComment = policy({
|
|
5
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);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { issue_assigned_to } from './issue-assigned-to.js';
|
|
2
|
+
export { issue_is_about } from './issue-is-about.js';
|
|
2
3
|
export { issue_reported_by } from './issue-reported-by.js';
|
|
3
4
|
export { issue_subtask_of } from './issue-subtask-of.js';
|
|
4
5
|
export { issue_tracked_by } from './issue-tracked-by.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { issue_assigned_to } from './issue-assigned-to.js';
|
|
2
|
+
export { issue_is_about } from './issue-is-about.js';
|
|
2
3
|
export { issue_reported_by } from './issue-reported-by.js';
|
|
3
4
|
export { issue_subtask_of } from './issue-subtask-of.js';
|
|
4
5
|
export { issue_tracked_by } from './issue-tracked-by.js';
|
|
@@ -17,7 +17,7 @@ export declare const issue_assigned_to: import("@astrale-os/sdk/schema").Directe
|
|
|
17
17
|
readonly abstract: false;
|
|
18
18
|
readonly depth: 1;
|
|
19
19
|
readonly properties: "archived" | "assigneeId" | "body" | "createdAt" | "description" | "name" | "priority" | "reference" | "report" | "reportRequestId" | "reporterId" | "status" | "updatedAt";
|
|
20
|
-
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "track" | "transition" | "untrack" | "update";
|
|
20
|
+
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "setTopics" | "track" | "transition" | "untrack" | "update";
|
|
21
21
|
})[];
|
|
22
22
|
readonly incoming: "0..1";
|
|
23
23
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { K, edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { ownsOrBelongsToProjectOfAssignedIssue } from '../policies/owns-or-belongs-to-project-of-assigned-issue.js';
|
|
3
3
|
import { Issue } from './issue.js';
|
|
4
4
|
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: {
|
|
8
|
+
policies: {
|
|
9
|
+
read: () => ownsOrBelongsToProjectOfAssignedIssue,
|
|
10
|
+
traverse: () => ownsOrBelongsToProjectOfAssignedIssue,
|
|
11
|
+
},
|
|
9
12
|
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Its target end accepts any Node, so it derives `detach`: deleting the Node, or uninstalling its
|
|
3
|
+
* Domain with its data, removes the Edge and leaves the Issue as it was.
|
|
4
|
+
*/
|
|
5
|
+
export declare const issue_is_about: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
6
|
+
readonly depth: 0;
|
|
7
|
+
readonly abstract: false;
|
|
8
|
+
readonly extends: readonly [];
|
|
9
|
+
readonly properties: never;
|
|
10
|
+
readonly source: {
|
|
11
|
+
readonly as: "issue";
|
|
12
|
+
readonly accepts: readonly (() => {
|
|
13
|
+
readonly kind: 'node';
|
|
14
|
+
readonly abstract: false;
|
|
15
|
+
readonly depth: 1;
|
|
16
|
+
readonly properties: "archived" | "assigneeId" | "body" | "createdAt" | "description" | "name" | "priority" | "reference" | "report" | "reportRequestId" | "reporterId" | "status" | "updatedAt";
|
|
17
|
+
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "setTopics" | "track" | "transition" | "untrack" | "update";
|
|
18
|
+
})[];
|
|
19
|
+
readonly outgoing: "0..*";
|
|
20
|
+
};
|
|
21
|
+
readonly target: {
|
|
22
|
+
readonly as: "topic";
|
|
23
|
+
readonly accepts: readonly (import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
|
|
24
|
+
readonly origin: "kernel.astrale.ai";
|
|
25
|
+
})[];
|
|
26
|
+
readonly incoming: "0..*";
|
|
27
|
+
};
|
|
28
|
+
readonly constraints: Record<never, never>;
|
|
29
|
+
readonly effectiveProperties: never;
|
|
30
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { K, edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { ownsOrBelongsToProjectOfIssueWithTopic } from '../policies/owns-or-belongs-to-project-of-issue-with-topic.js';
|
|
3
|
+
import { Issue } from './issue.js';
|
|
4
|
+
/**
|
|
5
|
+
* Its target end accepts any Node, so it derives `detach`: deleting the Node, or uninstalling its
|
|
6
|
+
* Domain with its data, removes the Edge and leaves the Issue as it was.
|
|
7
|
+
*/
|
|
8
|
+
export const issue_is_about = edgeClass.directed({
|
|
9
|
+
description: 'One Issue is about one Node of any Domain: a Product, an Area, another Issue…',
|
|
10
|
+
source: { as: 'issue', accepts: [() => Issue], outgoing: '0..*' },
|
|
11
|
+
target: { as: 'topic', accepts: [K.classes.Node], incoming: '0..*' },
|
|
12
|
+
policies: {
|
|
13
|
+
read: () => ownsOrBelongsToProjectOfIssueWithTopic,
|
|
14
|
+
traverse: () => ownsOrBelongsToProjectOfIssueWithTopic,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -17,7 +17,7 @@ export declare const issue_reported_by: import("@astrale-os/sdk/schema").Directe
|
|
|
17
17
|
readonly abstract: false;
|
|
18
18
|
readonly depth: 1;
|
|
19
19
|
readonly properties: "archived" | "assigneeId" | "body" | "createdAt" | "description" | "name" | "priority" | "reference" | "report" | "reportRequestId" | "reporterId" | "status" | "updatedAt";
|
|
20
|
-
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "track" | "transition" | "untrack" | "update";
|
|
20
|
+
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "setTopics" | "track" | "transition" | "untrack" | "update";
|
|
21
21
|
})[];
|
|
22
22
|
readonly incoming: "0..1";
|
|
23
23
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { K, edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { ownsOrBelongsToProjectOfReportedIssueOrReportedIssue } from '../policies/owns-or-belongs-to-project-of-reported-issue-or-reported-issue.js';
|
|
3
3
|
import { Issue } from './issue.js';
|
|
4
4
|
export const issue_reported_by = edgeClass.directed({
|
|
5
5
|
description: 'The immutable reporter of one Issue. Deleting the reporter removes this Edge; the Issue stays.',
|
|
6
6
|
source: { as: 'reporter', accepts: [K.classes.Identity], outgoing: '0..*' },
|
|
7
7
|
target: { as: 'issue', accepts: [() => Issue], incoming: '0..1' },
|
|
8
|
-
policies: {
|
|
8
|
+
policies: {
|
|
9
|
+
read: () => ownsOrBelongsToProjectOfReportedIssueOrReportedIssue,
|
|
10
|
+
traverse: () => ownsOrBelongsToProjectOfReportedIssueOrReportedIssue,
|
|
11
|
+
},
|
|
9
12
|
});
|
|
@@ -10,7 +10,7 @@ export declare const issue_subtask_of: import("@astrale-os/sdk/schema").Directed
|
|
|
10
10
|
readonly abstract: false;
|
|
11
11
|
readonly depth: 1;
|
|
12
12
|
readonly properties: "archived" | "assigneeId" | "body" | "createdAt" | "description" | "name" | "priority" | "reference" | "report" | "reportRequestId" | "reporterId" | "status" | "updatedAt";
|
|
13
|
-
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "track" | "transition" | "untrack" | "update";
|
|
13
|
+
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "setTopics" | "track" | "transition" | "untrack" | "update";
|
|
14
14
|
})[];
|
|
15
15
|
readonly outgoing: "0..1";
|
|
16
16
|
};
|
|
@@ -21,7 +21,7 @@ export declare const issue_subtask_of: import("@astrale-os/sdk/schema").Directed
|
|
|
21
21
|
readonly abstract: false;
|
|
22
22
|
readonly depth: 1;
|
|
23
23
|
readonly properties: "archived" | "assigneeId" | "body" | "createdAt" | "description" | "name" | "priority" | "reference" | "report" | "reportRequestId" | "reporterId" | "status" | "updatedAt";
|
|
24
|
-
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "track" | "transition" | "untrack" | "update";
|
|
24
|
+
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "setTopics" | "track" | "transition" | "untrack" | "update";
|
|
25
25
|
})[];
|
|
26
26
|
readonly incoming: "0..*";
|
|
27
27
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { ownsOrBelongsToProjectOfChildIssue } from '../policies/owns-or-belongs-to-project-of-child-issue.js';
|
|
3
3
|
import { Issue } from './issue.js';
|
|
4
4
|
export const issue_subtask_of = edgeClass.directed({
|
|
5
5
|
description: 'One Issue is an acyclic subtask of at most one Issue in the same Project.',
|
|
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: {
|
|
9
|
+
policies: {
|
|
10
|
+
read: () => ownsOrBelongsToProjectOfChildIssue,
|
|
11
|
+
traverse: () => ownsOrBelongsToProjectOfChildIssue,
|
|
12
|
+
},
|
|
10
13
|
});
|
|
@@ -10,7 +10,7 @@ export declare const issue_tracked_by: import("@astrale-os/sdk/schema").Directed
|
|
|
10
10
|
readonly abstract: false;
|
|
11
11
|
readonly depth: 1;
|
|
12
12
|
readonly properties: "archived" | "assigneeId" | "body" | "createdAt" | "description" | "name" | "priority" | "reference" | "report" | "reportRequestId" | "reporterId" | "status" | "updatedAt";
|
|
13
|
-
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "track" | "transition" | "untrack" | "update";
|
|
13
|
+
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "setTopics" | "track" | "transition" | "untrack" | "update";
|
|
14
14
|
})[];
|
|
15
15
|
readonly outgoing: "0..1";
|
|
16
16
|
};
|
|
@@ -21,7 +21,7 @@ export declare const issue_tracked_by: import("@astrale-os/sdk/schema").Directed
|
|
|
21
21
|
readonly abstract: false;
|
|
22
22
|
readonly depth: 1;
|
|
23
23
|
readonly properties: "archived" | "assigneeId" | "body" | "createdAt" | "description" | "name" | "priority" | "reference" | "report" | "reportRequestId" | "reporterId" | "status" | "updatedAt";
|
|
24
|
-
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "track" | "transition" | "untrack" | "update";
|
|
24
|
+
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "setTopics" | "track" | "transition" | "untrack" | "update";
|
|
25
25
|
})[];
|
|
26
26
|
readonly incoming: "0..*";
|
|
27
27
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { ownsOrBelongsToProjectOfTrackedOrTrackingIssue } from '../policies/owns-or-belongs-to-project-of-tracked-or-tracking-issue.js';
|
|
3
3
|
import { Issue } from './issue.js';
|
|
4
4
|
export const issue_tracked_by = edgeClass.directed({
|
|
5
5
|
description: 'One Issue is tracked by at most one other Issue, in any Project, and follows its status events; an Issue that tracks others is tracked by none.',
|
|
6
6
|
source: { as: 'tracked', accepts: [() => Issue], outgoing: '0..1' },
|
|
7
7
|
target: { as: 'tracking', accepts: [() => Issue], incoming: '0..*' },
|
|
8
8
|
constraints: { noSelf: true, acyclic: true },
|
|
9
|
-
policies: {
|
|
9
|
+
policies: {
|
|
10
|
+
read: () => ownsOrBelongsToProjectOfTrackedOrTrackingIssue,
|
|
11
|
+
traverse: () => ownsOrBelongsToProjectOfTrackedOrTrackingIssue,
|
|
12
|
+
},
|
|
10
13
|
});
|
|
@@ -147,6 +147,15 @@ export declare const Issue: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
|
147
147
|
tagIds: string[];
|
|
148
148
|
};
|
|
149
149
|
}, "authorized", false, false, undefined, undefined>>;
|
|
150
|
+
setTopics: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
151
|
+
topicIds: string[];
|
|
152
|
+
}, {
|
|
153
|
+
readonly mode: 'value';
|
|
154
|
+
readonly value: {
|
|
155
|
+
issueId: string;
|
|
156
|
+
topicIds: string[];
|
|
157
|
+
};
|
|
158
|
+
}, "authorized", false, false, undefined, undefined>>;
|
|
150
159
|
setParent: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
151
160
|
parentId: string | null;
|
|
152
161
|
}, {
|
|
@@ -9,11 +9,12 @@ import { deleteIssueMethod } from '../functions/delete-issue.js';
|
|
|
9
9
|
import { editIssueMethod } from '../functions/edit-issue.js';
|
|
10
10
|
import { setIssueParentMethod } from '../functions/set-issue-parent.js';
|
|
11
11
|
import { setIssueTagsMethod } from '../functions/set-issue-tags.js';
|
|
12
|
+
import { setIssueTopicsMethod } from '../functions/set-issue-topics.js';
|
|
12
13
|
import { trackIssueMethod } from '../functions/track-issue.js';
|
|
13
14
|
import { transitionIssueMethod } from '../functions/transition-issue.js';
|
|
14
15
|
import { untrackIssueMethod } from '../functions/untrack-issue.js';
|
|
15
16
|
import { updateIssueMethod } from '../functions/update-issue.js';
|
|
16
|
-
import {
|
|
17
|
+
import { ownsOrBelongsToProjectOfIssueOrReportedIssue } from '../policies/owns-or-belongs-to-project-of-issue-or-reported-issue.js';
|
|
17
18
|
import { issueStatus } from '../states/index.js';
|
|
18
19
|
import { issueDescriptionValue, issuePriorityValue } from '../types/issue.js';
|
|
19
20
|
import { reportContentValue } from '../types/report.js';
|
|
@@ -45,6 +46,7 @@ export const Issue = nodeClass({
|
|
|
45
46
|
transition: transitionIssueMethod,
|
|
46
47
|
assign: assignIssueMethod,
|
|
47
48
|
setTags: setIssueTagsMethod,
|
|
49
|
+
setTopics: setIssueTopicsMethod,
|
|
48
50
|
setParent: setIssueParentMethod,
|
|
49
51
|
track: trackIssueMethod,
|
|
50
52
|
untrack: untrackIssueMethod,
|
|
@@ -53,7 +55,7 @@ export const Issue = nodeClass({
|
|
|
53
55
|
delete: deleteIssueMethod,
|
|
54
56
|
},
|
|
55
57
|
policies: {
|
|
56
|
-
read: () =>
|
|
57
|
-
traverse: () =>
|
|
58
|
+
read: () => ownsOrBelongsToProjectOfIssueOrReportedIssue,
|
|
59
|
+
traverse: () => ownsOrBelongsToProjectOfIssueOrReportedIssue,
|
|
58
60
|
},
|
|
59
61
|
});
|
|
@@ -21,7 +21,7 @@ export declare const project_contains_issue: import("@astrale-os/sdk/schema").Di
|
|
|
21
21
|
readonly abstract: false;
|
|
22
22
|
readonly depth: 1;
|
|
23
23
|
readonly properties: "archived" | "assigneeId" | "body" | "createdAt" | "description" | "name" | "priority" | "reference" | "report" | "reportRequestId" | "reporterId" | "status" | "updatedAt";
|
|
24
|
-
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "track" | "transition" | "untrack" | "update";
|
|
24
|
+
readonly methods: "addComment" | "archive" | "assign" | "delete" | "edit" | "setParent" | "setTags" | "setTopics" | "track" | "transition" | "untrack" | "update";
|
|
25
25
|
})[];
|
|
26
26
|
readonly incoming: "1";
|
|
27
27
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { Project } from '../../project/index.js';
|
|
3
|
-
import { TraverseProjectIssue } from '../policies/traverse-project-issue.js';
|
|
2
|
+
import { Project, ownsOrBelongsToContainingProject } from '../../project/index.js';
|
|
4
3
|
import { Issue } from './issue.js';
|
|
5
4
|
export const project_contains_issue = edgeClass.directed({
|
|
6
5
|
description: 'One Project contains and numbers one Issue.',
|
|
7
6
|
source: { as: 'project', accepts: [() => Project], outgoing: '0..*' },
|
|
8
7
|
target: { as: 'issue', accepts: [() => Issue], incoming: '1' },
|
|
9
|
-
policies: {
|
|
8
|
+
policies: {
|
|
9
|
+
read: () => ownsOrBelongsToContainingProject,
|
|
10
|
+
traverse: () => ownsOrBelongsToContainingProject,
|
|
11
|
+
},
|
|
10
12
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { method } from '@astrale-os/sdk/schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { commentValue } from '../../comment/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { ownsOrBelongsToProjectOfIssue } from '../policies/owns-or-belongs-to-project-of-issue.js';
|
|
5
5
|
export const addIssueCommentMethod = method({
|
|
6
6
|
description: 'Add one authored Comment to this Issue.',
|
|
7
7
|
auth: 'authorized',
|
|
8
|
-
policy: ({ check, self }) => check(
|
|
8
|
+
policy: ({ check, self }) => check(ownsOrBelongsToProjectOfIssue, self),
|
|
9
9
|
input: z.strictObject({ body: z.string().min(1).max(50_000) }),
|
|
10
10
|
output: commentValue,
|
|
11
11
|
});
|
|
@@ -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 { ownsOrBelongsToProjectOfIssueOrReportedIssue } from '../policies/owns-or-belongs-to-project-of-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(ownsOrBelongsToProjectOfIssueOrReportedIssue, self),
|
|
9
9
|
input: z.strictObject({}),
|
|
10
10
|
output: z.strictObject({ issueId: nodeIdValue, archived: z.literal(true) }),
|
|
11
11
|
});
|