@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.4](https://github.com/astrale-os/domains/compare/issues-v0.1.3...issues-v0.1.4) (2026-08-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **domains:** remove Property visibility annotations from V1 schemas ([#118](https://github.com/astrale-os/domains/issues/118)) ([215e5e0](https://github.com/astrale-os/domains/commit/215e5e0ca3b849cb56fcccc685d4e3fc51cc41f5))
|
|
9
|
+
* **issues:** restore native reporting continuity ([#119](https://github.com/astrale-os/domains/issues/119)) ([4c0738d](https://github.com/astrale-os/domains/commit/4c0738d05fb5b1281b1d480376960fd494b98840))
|
|
10
|
+
* **states:** adopt intrinsic property transitions ([#108](https://github.com/astrale-os/domains/issues/108)) ([0d137c2](https://github.com/astrale-os/domains/commit/0d137c2832e8f9b732b337086ccb17ad0c49bb4e))
|
|
11
|
+
|
|
3
12
|
## [0.1.3](https://github.com/astrale-os/domains/compare/issues-v0.1.2...issues-v0.1.3) (2026-08-27)
|
|
4
13
|
|
|
5
14
|
|
package/README.md
CHANGED
|
@@ -22,10 +22,11 @@ Tag
|
|
|
22
22
|
name; Project-local slug; optional color; belongs to one Project
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
The public
|
|
25
|
+
The public callable surface keeps observation Project-owned and mutations receiver-owned:
|
|
26
26
|
|
|
27
27
|
```text
|
|
28
28
|
Project.create
|
|
29
|
+
Project.list
|
|
29
30
|
Project.update | addMember | removeMember | createIssue | createTag | archive
|
|
30
31
|
Issue.update | assign | setTags | setParent | addComment | archive
|
|
31
32
|
Comment.edit | delete
|
|
@@ -37,20 +38,23 @@ execution ceiling after its containment and Node removals. Larger Tags must firs
|
|
|
37
38
|
enough Issues through `Issue.setTags`; the Workflow rejects them explicitly instead of submitting an
|
|
38
39
|
oversized Mutation with a backend-dependent failure.
|
|
39
40
|
|
|
40
|
-
`Project.create`
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
`Project.create` and `Project.list` require authentication. `Project.list` returns only Projects the
|
|
42
|
+
caller owns or has joined, with their visible Issues and Comment threads nested for one CLI/agent
|
|
43
|
+
observation. Receiver Methods use Schema-owned Policies: Project owners administer metadata,
|
|
44
|
+
membership, Tags, and archival; owners and members contribute to Issues; only a Comment author edits
|
|
45
|
+
or deletes it. Reads are visible only through a Project the caller owns or has joined.
|
|
44
46
|
|
|
45
47
|
Ownership, membership, reporting, assignment, and authorship remain graph-native Policy facts. The
|
|
46
48
|
owning Project, Issue, or Comment also stores the corresponding Identity IDs privately, updated in
|
|
47
|
-
the same atomic Mutation as each edge. Recipes and Workflows can therefore validate current
|
|
48
|
-
without requesting authority over every possible concrete Identity subtype from
|
|
49
|
+
the same atomic Mutation as each edge. Recipes and Workflows can therefore validate current
|
|
50
|
+
collaboration state without requesting authority over every possible concrete Identity subtype from
|
|
51
|
+
another Domain.
|
|
49
52
|
Those private execution fields are not a second public model and never replace the Policy edges.
|
|
50
53
|
|
|
51
54
|
There is no Domain `Command`, receipt, universal idempotency layer, activity log, or undo system.
|
|
52
|
-
`Project.create`
|
|
53
|
-
whose Query and Mutation effects use stable steps. Set-style changes converge
|
|
55
|
+
`Project.create` and `Project.list` are Actions; the seventeen multi-step receiver operations are
|
|
56
|
+
explicit Workflows whose Query and Mutation effects use stable steps. Set-style changes converge
|
|
57
|
+
naturally and stale
|
|
54
58
|
concurrent writes reject through atomic Mutation preconditions. Creation retries have no Domain
|
|
55
59
|
replay guarantee; generic invocation idempotency belongs to the platform when it exists.
|
|
56
60
|
|
|
@@ -63,16 +67,6 @@ shortcuts whenever the user is not typing. The selected Issue description and it
|
|
|
63
67
|
inbox as one continuous Markdown conversation with strict Mermaid diagrams. Project, Issue, and Tag
|
|
64
68
|
creation and Project membership administration intentionally remain API-first.
|
|
65
69
|
|
|
66
|
-
## Breaking migration
|
|
67
|
-
|
|
68
|
-
`Tracker` to `Project`, the status revision (`in_progress` to `accepted`, `canceled` to `closed`, and
|
|
69
|
-
the new `deferred` outcome), receiver Methods, and Command removal are one
|
|
70
|
-
deliberate breaking revision. A reinstall does not migrate installed graph keys. Use the private
|
|
71
|
-
[legacy snapshot/import workflow](https://github.com/astrale-os/domains/tree/main/issues/scripts/legacy-issues-import)
|
|
72
|
-
before production cutover. It retains excluded source data for audit, deprovisions the exact
|
|
73
|
-
digest-confirmed legacy graph before uninstall, and replays owner-authored legacy aggregates through
|
|
74
|
-
the supported public Project receiver API while writing step-level old-to-new Node ID checkpoints.
|
|
75
|
-
|
|
76
70
|
## Development
|
|
77
71
|
|
|
78
72
|
Dependency changes must refresh both `issues/pnpm-lock.yaml` and the workspace-root `pnpm-lock.yaml`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type EventOf, type StateOf
|
|
2
|
-
export declare const
|
|
1
|
+
import { type EventOf, type StateOf } from '@astrale-os/sdk/state';
|
|
2
|
+
export declare const issueStatus: import("@astrale-os/sdk/state").StateMachine<{
|
|
3
3
|
readonly open: {
|
|
4
4
|
readonly accept: "accepted";
|
|
5
5
|
readonly defer: "deferred";
|
|
@@ -23,8 +23,5 @@ export declare const issueLifecycle: import("@astrale-os/sdk/state").StateMachin
|
|
|
23
23
|
readonly reopen: "open";
|
|
24
24
|
};
|
|
25
25
|
}, "open">;
|
|
26
|
-
export type IssueStatus = StateOf<typeof
|
|
27
|
-
export type IssueEvent = EventOf<typeof
|
|
28
|
-
export type AllowedIssueTransition = Extract<TransitionDecision<typeof issueLifecycle, IssueStatus, IssueEvent>, {
|
|
29
|
-
readonly kind: 'allowed';
|
|
30
|
-
}>;
|
|
26
|
+
export type IssueStatus = StateOf<typeof issueStatus>;
|
|
27
|
+
export type IssueEvent = EventOf<typeof issueStatus>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { stateMachine
|
|
2
|
-
export const
|
|
1
|
+
import { stateMachine } from '@astrale-os/sdk/state';
|
|
2
|
+
export const issueStatus = stateMachine({
|
|
3
3
|
initial: 'open',
|
|
4
4
|
transitions: {
|
|
5
5
|
open: { accept: 'accepted', defer: 'deferred', close: 'closed' },
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { schema } from './schema.js';
|
|
2
2
|
export type { IssuesDomain, IssuesSchema } from './schema.js';
|
|
3
|
-
export {
|
|
4
|
-
export { Issue, issue_assigned_to, issue_reported_by, issue_subtask_of, project_contains_issue, } from './issue/index.js';
|
|
5
|
-
export {
|
|
6
|
-
export { Tag, issue_tagged_with, project_contains_tag } from './tag/index.js';
|
|
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';
|
|
5
|
+
export { Comment, comment_authored_by, issue_has_comment } from './modules/comment/index.js';
|
|
6
|
+
export { Tag, issue_tagged_with, project_contains_tag } from './modules/tag/index.js';
|
package/dist/schema/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { schema } from './schema.js';
|
|
2
|
-
export {
|
|
3
|
-
export { Issue, issue_assigned_to, issue_reported_by, issue_subtask_of, project_contains_issue, } from './issue/index.js';
|
|
4
|
-
export {
|
|
5
|
-
export { Tag, issue_tagged_with, project_contains_tag } from './tag/index.js';
|
|
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';
|
|
4
|
+
export { Comment, comment_authored_by, issue_has_comment } from './modules/comment/index.js';
|
|
5
|
+
export { Tag, issue_tagged_with, project_contains_tag } from './modules/tag/index.js';
|
package/dist/schema/{comment/relationships.d.ts → modules/comment/classes/comment-authored-by.d.ts}
RENAMED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
export declare const issue_has_comment: 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: "comment";
|
|
12
|
-
readonly incoming: "1";
|
|
13
|
-
};
|
|
14
|
-
readonly constraints: Record<never, never>;
|
|
15
|
-
readonly effectiveProperties: never;
|
|
16
|
-
}>;
|
|
17
1
|
export declare const comment_authored_by: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
18
2
|
readonly depth: 0;
|
|
19
3
|
readonly abstract: false;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { K, edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { TraverseCommentRelationship } from '../policies/traverse-comment-relationship.js';
|
|
3
|
+
import { Comment } from './comment.js';
|
|
4
|
+
export const comment_authored_by = edgeClass.directed({
|
|
5
|
+
description: 'The immutable author of one Comment.',
|
|
6
|
+
source: { as: 'author', accepts: [K.classes.Identity], outgoing: '0..*' },
|
|
7
|
+
target: { as: 'comment', accepts: [() => Comment], incoming: '1' },
|
|
8
|
+
policies: { traverse: () => TraverseCommentRelationship },
|
|
9
|
+
});
|
|
@@ -63,4 +63,4 @@ export declare const Comment: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
63
63
|
};
|
|
64
64
|
}, "authorized", false, "default">>, "edit", "self">;
|
|
65
65
|
readonly effectiveStaticMethods: never;
|
|
66
|
-
}
|
|
66
|
+
}> & import("@astrale-os/sdk/schema").StateClass<Readonly<Omit<Readonly<Record<never, never>>, never> & {}>>;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { K, nodeClass, property } from '@astrale-os/sdk/schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { nodeIdValue } from '
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { nodeIdValue } from '../../../types/index.js';
|
|
4
|
+
import { deleteCommentMethod } from '../functions/delete-comment.js';
|
|
5
|
+
import { editCommentMethod } from '../functions/edit-comment.js';
|
|
6
|
+
import { ContributeToComment } from '../policies/contribute-to-comment.js';
|
|
6
7
|
export const Comment = nodeClass({
|
|
7
8
|
description: 'One authored discussion entry attached to an Issue.',
|
|
8
9
|
icon: 'message-square',
|
|
9
10
|
extends: [K.classes.Timestamped],
|
|
10
11
|
properties: {
|
|
11
12
|
body: z.string().min(1).max(50_000),
|
|
12
|
-
authorId: property(nodeIdValue, {
|
|
13
|
+
authorId: property(nodeIdValue, {}),
|
|
13
14
|
},
|
|
14
15
|
methods: { edit: editCommentMethod, delete: deleteCommentMethod },
|
|
15
16
|
policies: { read: () => ContributeToComment },
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const issue_has_comment: 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: "comment";
|
|
12
|
+
readonly incoming: "1";
|
|
13
|
+
};
|
|
14
|
+
readonly constraints: Record<never, never>;
|
|
15
|
+
readonly effectiveProperties: never;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { Issue } from '../../issue/index.js';
|
|
3
|
+
import { TraverseIssueComment } from '../policies/traverse-issue-comment.js';
|
|
4
|
+
import { Comment } from './comment.js';
|
|
5
|
+
export const issue_has_comment = edgeClass.directed({
|
|
6
|
+
description: 'One Issue contains one Comment.',
|
|
7
|
+
source: { as: 'issue', accepts: [() => Issue], outgoing: '0..*' },
|
|
8
|
+
target: { as: 'comment', accepts: [() => Comment], incoming: '1' },
|
|
9
|
+
policies: { traverse: () => TraverseIssueComment },
|
|
10
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const deleteCommentMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
2
|
+
readonly mode: 'value';
|
|
3
|
+
readonly value: {
|
|
4
|
+
commentId: 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 { EditOwnComment } from '../policies/edit-own-comment.js';
|
|
5
|
+
export const deleteCommentMethod = method({
|
|
6
|
+
description: 'Delete this Comment as its author.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(EditOwnComment, self),
|
|
9
|
+
input: z.strictObject({}),
|
|
10
|
+
output: z.strictObject({ commentId: nodeIdValue, deleted: z.literal(true) }),
|
|
11
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const editCommentMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
body: string;
|
|
3
|
+
}, {
|
|
4
|
+
readonly mode: 'value';
|
|
5
|
+
readonly value: {
|
|
6
|
+
id: string;
|
|
7
|
+
body: string;
|
|
8
|
+
};
|
|
9
|
+
}, "authorized", false, "default">>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { EditOwnComment } from '../policies/edit-own-comment.js';
|
|
4
|
+
import { commentValue } from '../types/comment.js';
|
|
5
|
+
export const editCommentMethod = method({
|
|
6
|
+
description: 'Edit this Comment as its author.',
|
|
7
|
+
auth: 'authorized',
|
|
8
|
+
policy: ({ check, self }) => check(EditOwnComment, self),
|
|
9
|
+
input: z.strictObject({ body: z.string().min(1).max(50_000) }),
|
|
10
|
+
output: commentValue,
|
|
11
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { commentValue } from './types/index.js';
|
|
2
|
+
export { comment_authored_by, Comment, issue_has_comment } from './classes/index.js';
|
|
3
|
+
export { deleteCommentMethod, editCommentMethod } from './functions/index.js';
|
|
4
|
+
export { ContributeToComment, EditOwnComment, TraverseCommentRelationship, TraverseIssueComment, } from './policies/index.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { commentValue } from './types/index.js';
|
|
2
|
+
export { comment_authored_by, Comment, issue_has_comment } from './classes/index.js';
|
|
3
|
+
export { deleteCommentMethod, editCommentMethod } from './functions/index.js';
|
|
4
|
+
export { ContributeToComment, EditOwnComment, TraverseCommentRelationship, TraverseIssueComment, } from './policies/index.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { Issue, project_contains_issue } from '
|
|
3
|
-
import { Project, project_has_member, project_owned_by } from '
|
|
4
|
-
import { issue_has_comment } from '
|
|
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
5
|
export const ContributeToComment = policy({
|
|
6
6
|
description: 'The caller owns or belongs to the Project containing this Comment.',
|
|
7
7
|
match: ({ allOf, anyOf, edge, exists, object, subject }) => exists(({ node }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { comment_authored_by } from '
|
|
2
|
+
import { comment_authored_by } from '../classes/comment-authored-by.js';
|
|
3
3
|
export const EditOwnComment = 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 }),
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ContributeToComment } from './contribute-to-comment.js';
|
|
2
|
+
export { EditOwnComment } from './edit-own-comment.js';
|
|
3
|
+
export { TraverseCommentRelationship } from './traverse-comment-relationship.js';
|
|
4
|
+
export { TraverseIssueComment } from './traverse-issue-comment.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ContributeToComment } from './contribute-to-comment.js';
|
|
2
|
+
export { EditOwnComment } from './edit-own-comment.js';
|
|
3
|
+
export { TraverseCommentRelationship } from './traverse-comment-relationship.js';
|
|
4
|
+
export { TraverseIssueComment } from './traverse-issue-comment.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { Issue, project_contains_issue } from '
|
|
3
|
-
import { Project, project_has_member, project_owned_by } from '
|
|
4
|
-
import { comment_authored_by
|
|
5
|
-
|
|
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 { comment_authored_by } from '../classes/comment-authored-by.js';
|
|
5
|
+
import { issue_has_comment } from '../classes/issue-has-comment.js';
|
|
6
6
|
export const TraverseCommentRelationship = policy({
|
|
7
7
|
description: 'The caller owns or belongs to the Project containing the source Comment.',
|
|
8
8
|
match: ({ allOf, anyOf, edge, exists, source, subject, target }) => anyOf(exists(({ node }) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TraverseIssueComment: 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_has_comment } from '../classes/issue-has-comment.js';
|
|
5
|
+
export const TraverseIssueComment = policy({
|
|
6
|
+
description: 'Issue Comment containment is 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_has_comment, 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_has_comment, 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 { commentValue } from './comment.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { commentValue } from './comment.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { issue_assigned_to } from './issue-assigned-to.js';
|
|
2
|
+
export { issue_reported_by } from './issue-reported-by.js';
|
|
3
|
+
export { issue_subtask_of } from './issue-subtask-of.js';
|
|
4
|
+
export { Issue } from './issue.js';
|
|
5
|
+
export { project_contains_issue } from './project-contains-issue.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { issue_assigned_to } from './issue-assigned-to.js';
|
|
2
|
+
export { issue_reported_by } from './issue-reported-by.js';
|
|
3
|
+
export { issue_subtask_of } from './issue-subtask-of.js';
|
|
4
|
+
export { Issue } from './issue.js';
|
|
5
|
+
export { project_contains_issue } from './project-contains-issue.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const issue_assigned_to: 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: "assignee";
|
|
8
|
+
readonly outgoing: "0..*";
|
|
9
|
+
};
|
|
10
|
+
readonly target: {
|
|
11
|
+
readonly as: "issue";
|
|
12
|
+
readonly incoming: "0..1";
|
|
13
|
+
};
|
|
14
|
+
readonly constraints: Record<never, never>;
|
|
15
|
+
readonly effectiveProperties: never;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { K, edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { TraverseIssueAssignee } from '../policies/traverse-issue-assignee.js';
|
|
3
|
+
import { Issue } from './issue.js';
|
|
4
|
+
export const issue_assigned_to = edgeClass.directed({
|
|
5
|
+
description: 'The optional current assignee of one Issue.',
|
|
6
|
+
source: { as: 'assignee', accepts: [K.classes.Identity], outgoing: '0..*' },
|
|
7
|
+
target: { as: 'issue', accepts: [() => Issue], incoming: '0..1' },
|
|
8
|
+
policies: { traverse: () => TraverseIssueAssignee },
|
|
9
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const issue_reported_by: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
2
|
+
readonly depth: 0;
|
|
3
|
+
readonly abstract: false;
|
|
4
|
+
readonly extends: readonly [];
|
|
5
|
+
readonly properties: never;
|
|
6
|
+
readonly source: {
|
|
7
|
+
readonly as: "reporter";
|
|
8
|
+
readonly outgoing: "0..*";
|
|
9
|
+
};
|
|
10
|
+
readonly target: {
|
|
11
|
+
readonly as: "issue";
|
|
12
|
+
readonly incoming: "1";
|
|
13
|
+
};
|
|
14
|
+
readonly constraints: Record<never, never>;
|
|
15
|
+
readonly effectiveProperties: never;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { K, edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { TraverseIssueReporter } from '../policies/traverse-issue-reporter.js';
|
|
3
|
+
import { Issue } from './issue.js';
|
|
4
|
+
export const issue_reported_by = edgeClass.directed({
|
|
5
|
+
description: 'The immutable reporter of one Issue.',
|
|
6
|
+
source: { as: 'reporter', accepts: [K.classes.Identity], outgoing: '0..*' },
|
|
7
|
+
target: { as: 'issue', accepts: [() => Issue], incoming: '1' },
|
|
8
|
+
policies: { traverse: () => TraverseIssueReporter },
|
|
9
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const issue_subtask_of: 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: "child";
|
|
8
|
+
readonly outgoing: "0..1";
|
|
9
|
+
};
|
|
10
|
+
readonly target: {
|
|
11
|
+
readonly as: "parent";
|
|
12
|
+
readonly incoming: "0..*";
|
|
13
|
+
};
|
|
14
|
+
readonly constraints: {
|
|
15
|
+
readonly noSelf: true;
|
|
16
|
+
readonly acyclic: true;
|
|
17
|
+
};
|
|
18
|
+
readonly effectiveProperties: never;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { TraverseIssueParent } from '../policies/traverse-issue-parent.js';
|
|
3
|
+
import { Issue } from './issue.js';
|
|
4
|
+
export const issue_subtask_of = edgeClass.directed({
|
|
5
|
+
description: 'One Issue is an acyclic subtask of at most one Issue in the same Project.',
|
|
6
|
+
source: { as: 'child', accepts: [() => Issue], outgoing: '0..1' },
|
|
7
|
+
target: { as: 'parent', accepts: [() => Issue], incoming: '0..*' },
|
|
8
|
+
constraints: { noSelf: true, acyclic: true },
|
|
9
|
+
policies: { traverse: () => TraverseIssueParent },
|
|
10
|
+
});
|
|
@@ -54,7 +54,7 @@ export declare const Issue: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
54
54
|
readonly reference: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "reference", "self">;
|
|
55
55
|
readonly reporterId: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "reporterId", "self">;
|
|
56
56
|
readonly assigneeId: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string | undefined, string | undefined, false, "assigneeId", "self">;
|
|
57
|
-
readonly status: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<unknown, "accepted" | "closed" | "deferred" | "open" | "resolved",
|
|
57
|
+
readonly status: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<unknown, "accepted" | "closed" | "deferred" | "open" | "resolved", true, "status", "self">;
|
|
58
58
|
readonly priority: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<number, number, true, "priority", "self">;
|
|
59
59
|
readonly archived: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<boolean, boolean, true, "archived", "self">;
|
|
60
60
|
};
|
|
@@ -141,7 +141,7 @@ export declare const Issue: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
141
141
|
};
|
|
142
142
|
}, "authorized", false, "default">>;
|
|
143
143
|
};
|
|
144
|
-
readonly effectiveProperties: (import("@astrale-os/sdk/schema").AuthoredPropertyProjection<boolean, boolean, true, "archived", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string | undefined, string | undefined, false, "assigneeId", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<number, number, true, "priority", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "reference", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "reporterId", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<unknown, "accepted" | "closed" | "deferred" | "open" | "resolved",
|
|
144
|
+
readonly effectiveProperties: (import("@astrale-os/sdk/schema").AuthoredPropertyProjection<boolean, boolean, true, "archived", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string | undefined, string | undefined, false, "assigneeId", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<number, number, true, "priority", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "reference", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "reporterId", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<unknown, "accepted" | "closed" | "deferred" | "open" | "resolved", true, "status", "self">) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, false> & {
|
|
145
145
|
readonly name: "description";
|
|
146
146
|
readonly key: "kernel.astrale.ai:class.Descriptable.property.description";
|
|
147
147
|
}) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
|
|
@@ -230,4 +230,29 @@ export declare const Issue: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
230
230
|
};
|
|
231
231
|
}, "authorized", false, "default">>, "addComment", "self">;
|
|
232
232
|
readonly effectiveStaticMethods: never;
|
|
233
|
-
}
|
|
233
|
+
}> & import("@astrale-os/sdk/schema").StateClass<Readonly<Omit<Readonly<Record<never, never>>, "status"> & {
|
|
234
|
+
readonly status: import("@astrale-os/sdk/state").StateMachine<{
|
|
235
|
+
readonly open: {
|
|
236
|
+
readonly accept: "accepted";
|
|
237
|
+
readonly defer: "deferred";
|
|
238
|
+
readonly close: "closed";
|
|
239
|
+
};
|
|
240
|
+
readonly accepted: {
|
|
241
|
+
readonly resolve: "resolved";
|
|
242
|
+
readonly defer: "deferred";
|
|
243
|
+
readonly close: "closed";
|
|
244
|
+
};
|
|
245
|
+
readonly deferred: {
|
|
246
|
+
readonly reopen: "open";
|
|
247
|
+
readonly accept: "accepted";
|
|
248
|
+
readonly close: "closed";
|
|
249
|
+
};
|
|
250
|
+
readonly resolved: {
|
|
251
|
+
readonly reopen: "open";
|
|
252
|
+
readonly close: "closed";
|
|
253
|
+
};
|
|
254
|
+
readonly closed: {
|
|
255
|
+
readonly reopen: "open";
|
|
256
|
+
};
|
|
257
|
+
}, "open">;
|
|
258
|
+
}>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { K, nodeClass, property, stateProperty } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { nodeIdValue } from '../../../types/index.js';
|
|
4
|
+
import { issueStatus } from '../../../.runtime/states/issue/index.js';
|
|
5
|
+
import { addIssueCommentMethod } from '../functions/add-issue-comment.js';
|
|
6
|
+
import { archiveIssueMethod } from '../functions/archive-issue.js';
|
|
7
|
+
import { assignIssueMethod } from '../functions/assign-issue.js';
|
|
8
|
+
import { setIssueParentMethod } from '../functions/set-issue-parent.js';
|
|
9
|
+
import { setIssueTagsMethod } from '../functions/set-issue-tags.js';
|
|
10
|
+
import { transitionIssueMethod } from '../functions/transition-issue.js';
|
|
11
|
+
import { updateIssueMethod } from '../functions/update-issue.js';
|
|
12
|
+
import { ContributeToIssue } from '../policies/contribute-to-issue.js';
|
|
13
|
+
export const Issue = nodeClass({
|
|
14
|
+
description: 'One immutable-reference work item contained by exactly one Project.',
|
|
15
|
+
icon: 'circle-dot',
|
|
16
|
+
extends: [K.classes.Named, K.classes.Descriptable, K.classes.Timestamped],
|
|
17
|
+
properties: {
|
|
18
|
+
reference: z.string().min(1).max(32),
|
|
19
|
+
reporterId: property(nodeIdValue, {}),
|
|
20
|
+
assigneeId: property(nodeIdValue.optional(), {}),
|
|
21
|
+
status: stateProperty(issueStatus),
|
|
22
|
+
priority: z.number().int().min(0).max(4),
|
|
23
|
+
archived: z.boolean(),
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
update: updateIssueMethod,
|
|
27
|
+
transition: transitionIssueMethod,
|
|
28
|
+
assign: assignIssueMethod,
|
|
29
|
+
setTags: setIssueTagsMethod,
|
|
30
|
+
setParent: setIssueParentMethod,
|
|
31
|
+
addComment: addIssueCommentMethod,
|
|
32
|
+
archive: archiveIssueMethod,
|
|
33
|
+
},
|
|
34
|
+
policies: { read: () => ContributeToIssue },
|
|
35
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const project_contains_issue: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
2
|
+
readonly depth: 0;
|
|
3
|
+
readonly abstract: false;
|
|
4
|
+
readonly extends: readonly [];
|
|
5
|
+
readonly properties: never;
|
|
6
|
+
readonly source: {
|
|
7
|
+
readonly as: "project";
|
|
8
|
+
readonly outgoing: "0..*";
|
|
9
|
+
};
|
|
10
|
+
readonly target: {
|
|
11
|
+
readonly as: "issue";
|
|
12
|
+
readonly incoming: "1";
|
|
13
|
+
};
|
|
14
|
+
readonly constraints: Record<never, never>;
|
|
15
|
+
readonly effectiveProperties: never;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { Project } from '../../project/index.js';
|
|
3
|
+
import { TraverseProjectIssue } from '../policies/traverse-project-issue.js';
|
|
4
|
+
import { Issue } from './issue.js';
|
|
5
|
+
export const project_contains_issue = edgeClass.directed({
|
|
6
|
+
description: 'One Project contains and numbers one Issue.',
|
|
7
|
+
source: { as: 'project', accepts: [() => Project], outgoing: '0..*' },
|
|
8
|
+
target: { as: 'issue', accepts: [() => Issue], incoming: '1' },
|
|
9
|
+
policies: { traverse: () => TraverseProjectIssue },
|
|
10
|
+
});
|