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