@astrale-domains/issues 0.1.2 → 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 (190) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +65 -15
  3. package/dist/schema/.runtime/states/issue/index.d.ts +27 -0
  4. package/dist/schema/.runtime/states/issue/index.js +11 -0
  5. package/dist/schema/index.d.ts +6 -7
  6. package/dist/schema/index.js +5 -6
  7. package/dist/schema/{comment/relationships.d.ts → modules/comment/classes/comment-authored-by.d.ts} +2 -18
  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} +36 -4
  10. package/dist/schema/modules/comment/classes/comment.js +17 -0
  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/modules/comment/policies/contribute-to-comment.d.ts +1 -0
  24. package/dist/schema/modules/comment/policies/contribute-to-comment.js +12 -0
  25. package/dist/schema/modules/comment/policies/edit-own-comment.d.ts +1 -0
  26. package/dist/schema/modules/comment/policies/edit-own-comment.js +6 -0
  27. package/dist/schema/modules/comment/policies/index.d.ts +4 -0
  28. package/dist/schema/modules/comment/policies/index.js +4 -0
  29. package/dist/schema/modules/comment/policies/traverse-comment-relationship.d.ts +1 -0
  30. package/dist/schema/modules/comment/policies/traverse-comment-relationship.js +17 -0
  31. package/dist/schema/modules/comment/policies/traverse-issue-comment.d.ts +1 -0
  32. package/dist/schema/modules/comment/policies/traverse-issue-comment.js +14 -0
  33. package/dist/schema/modules/comment/types/comment.d.ts +5 -0
  34. package/dist/schema/modules/comment/types/comment.js +6 -0
  35. package/dist/schema/modules/comment/types/index.d.ts +1 -0
  36. package/dist/schema/modules/comment/types/index.js +1 -0
  37. package/dist/schema/modules/issue/classes/index.d.ts +5 -0
  38. package/dist/schema/modules/issue/classes/index.js +5 -0
  39. package/dist/schema/modules/issue/classes/issue-assigned-to.d.ts +16 -0
  40. package/dist/schema/modules/issue/classes/issue-assigned-to.js +9 -0
  41. package/dist/schema/modules/issue/classes/issue-reported-by.d.ts +16 -0
  42. package/dist/schema/modules/issue/classes/issue-reported-by.js +9 -0
  43. package/dist/schema/modules/issue/classes/issue-subtask-of.d.ts +19 -0
  44. package/dist/schema/modules/issue/classes/issue-subtask-of.js +10 -0
  45. package/dist/schema/modules/issue/classes/issue.d.ts +258 -0
  46. package/dist/schema/modules/issue/classes/issue.js +35 -0
  47. package/dist/schema/modules/issue/classes/project-contains-issue.d.ts +16 -0
  48. package/dist/schema/modules/issue/classes/project-contains-issue.js +10 -0
  49. package/dist/schema/modules/issue/functions/add-issue-comment.d.ts +9 -0
  50. package/dist/schema/modules/issue/functions/add-issue-comment.js +11 -0
  51. package/dist/schema/modules/issue/functions/archive-issue.d.ts +7 -0
  52. package/dist/schema/modules/issue/functions/archive-issue.js +11 -0
  53. package/dist/schema/modules/issue/functions/assign-issue.d.ts +9 -0
  54. package/dist/schema/modules/issue/functions/assign-issue.js +11 -0
  55. package/dist/schema/modules/issue/functions/index.d.ts +7 -0
  56. package/dist/schema/modules/issue/functions/index.js +7 -0
  57. package/dist/schema/modules/issue/functions/set-issue-parent.d.ts +9 -0
  58. package/dist/schema/modules/issue/functions/set-issue-parent.js +11 -0
  59. package/dist/schema/modules/issue/functions/set-issue-tags.d.ts +9 -0
  60. package/dist/schema/modules/issue/functions/set-issue-tags.js +11 -0
  61. package/dist/schema/modules/issue/functions/transition-issue.d.ts +22 -0
  62. package/dist/schema/modules/issue/functions/transition-issue.js +20 -0
  63. package/dist/schema/modules/issue/functions/update-issue.d.ts +16 -0
  64. package/dist/schema/modules/issue/functions/update-issue.js +15 -0
  65. package/dist/schema/modules/issue/index.d.ts +4 -0
  66. package/dist/schema/modules/issue/index.js +4 -0
  67. package/dist/schema/modules/issue/policies/contribute-to-issue.d.ts +1 -0
  68. package/dist/schema/modules/issue/policies/contribute-to-issue.js +10 -0
  69. package/dist/schema/modules/issue/policies/index.d.ts +5 -0
  70. package/dist/schema/modules/issue/policies/index.js +5 -0
  71. package/dist/schema/modules/issue/policies/traverse-issue-assignee.d.ts +1 -0
  72. package/dist/schema/modules/issue/policies/traverse-issue-assignee.js +14 -0
  73. package/dist/schema/modules/issue/policies/traverse-issue-parent.d.ts +1 -0
  74. package/dist/schema/modules/issue/policies/traverse-issue-parent.js +14 -0
  75. package/dist/schema/modules/issue/policies/traverse-issue-reporter.d.ts +1 -0
  76. package/dist/schema/modules/issue/policies/traverse-issue-reporter.js +14 -0
  77. package/dist/schema/modules/issue/policies/traverse-project-issue.d.ts +1 -0
  78. package/dist/schema/modules/issue/policies/traverse-project-issue.js +7 -0
  79. package/dist/schema/modules/issue/types/index.d.ts +1 -0
  80. package/dist/schema/modules/issue/types/index.js +1 -0
  81. package/dist/schema/modules/issue/types/issue.d.ts +10 -0
  82. package/dist/schema/modules/issue/types/issue.js +12 -0
  83. package/dist/schema/modules/project/classes/index.d.ts +3 -0
  84. package/dist/schema/modules/project/classes/index.js +3 -0
  85. package/dist/schema/modules/project/classes/project-has-member.d.ts +16 -0
  86. package/dist/schema/modules/project/classes/project-has-member.js +9 -0
  87. package/dist/schema/{tracker/relationships.d.ts → modules/project/classes/project-owned-by.d.ts} +5 -5
  88. package/dist/schema/modules/project/classes/project-owned-by.js +9 -0
  89. package/dist/schema/modules/project/classes/project.d.ts +283 -0
  90. package/dist/schema/modules/project/classes/project.js +35 -0
  91. package/dist/schema/modules/project/functions/add-project-member.d.ts +10 -0
  92. package/dist/schema/modules/project/functions/add-project-member.js +12 -0
  93. package/dist/schema/modules/project/functions/archive-project.d.ts +7 -0
  94. package/dist/schema/modules/project/functions/archive-project.js +11 -0
  95. package/dist/schema/modules/project/functions/create-project-issue.d.ts +16 -0
  96. package/dist/schema/modules/project/functions/create-project-issue.js +15 -0
  97. package/dist/schema/modules/project/functions/create-project-tag.d.ts +12 -0
  98. package/dist/schema/modules/project/functions/create-project-tag.js +14 -0
  99. package/dist/schema/modules/project/functions/create-project.d.ts +14 -0
  100. package/dist/schema/modules/project/functions/create-project.js +14 -0
  101. package/dist/schema/modules/project/functions/index.d.ts +8 -0
  102. package/dist/schema/modules/project/functions/index.js +8 -0
  103. package/dist/schema/modules/project/functions/list-projects.d.ts +25 -0
  104. package/dist/schema/modules/project/functions/list-projects.js +16 -0
  105. package/dist/schema/modules/project/functions/remove-project-member.d.ts +10 -0
  106. package/dist/schema/modules/project/functions/remove-project-member.js +12 -0
  107. package/dist/schema/modules/project/functions/update-project.d.ts +13 -0
  108. package/dist/schema/modules/project/functions/update-project.js +14 -0
  109. package/dist/schema/modules/project/index.d.ts +4 -0
  110. package/dist/schema/modules/project/index.js +4 -0
  111. package/dist/schema/modules/project/policies/contribute-to-project.d.ts +1 -0
  112. package/dist/schema/modules/project/policies/contribute-to-project.js +7 -0
  113. package/dist/schema/modules/project/policies/index.d.ts +4 -0
  114. package/dist/schema/modules/project/policies/index.js +4 -0
  115. package/dist/schema/modules/project/policies/manage-project.d.ts +1 -0
  116. package/dist/schema/modules/project/policies/manage-project.js +6 -0
  117. package/dist/schema/modules/project/policies/traverse-project-member.d.ts +1 -0
  118. package/dist/schema/modules/project/policies/traverse-project-member.js +7 -0
  119. package/dist/schema/modules/project/policies/traverse-project-owner.d.ts +1 -0
  120. package/dist/schema/modules/project/policies/traverse-project-owner.js +7 -0
  121. package/dist/schema/modules/project/types/index.d.ts +2 -0
  122. package/dist/schema/modules/project/types/index.js +2 -0
  123. package/dist/schema/modules/project/types/membership-change.d.ts +6 -0
  124. package/dist/schema/modules/project/types/membership-change.js +7 -0
  125. package/dist/schema/modules/project/types/project.d.ts +8 -0
  126. package/dist/schema/modules/project/types/project.js +9 -0
  127. package/dist/schema/modules/tag/classes/index.d.ts +3 -0
  128. package/dist/schema/modules/tag/classes/index.js +3 -0
  129. package/dist/schema/modules/tag/classes/issue-tagged-with.d.ts +16 -0
  130. package/dist/schema/modules/tag/classes/issue-tagged-with.js +10 -0
  131. package/dist/schema/modules/tag/classes/project-contains-tag.d.ts +16 -0
  132. package/dist/schema/modules/tag/classes/project-contains-tag.js +10 -0
  133. package/dist/schema/{tag/class.d.ts → modules/tag/classes/tag.d.ts} +40 -3
  134. package/dist/schema/modules/tag/classes/tag.js +16 -0
  135. package/dist/schema/modules/tag/functions/delete-tag.d.ts +7 -0
  136. package/dist/schema/modules/tag/functions/delete-tag.js +11 -0
  137. package/dist/schema/modules/tag/functions/edit-tag.d.ts +12 -0
  138. package/dist/schema/modules/tag/functions/edit-tag.js +14 -0
  139. package/dist/schema/modules/tag/functions/index.d.ts +2 -0
  140. package/dist/schema/modules/tag/functions/index.js +2 -0
  141. package/dist/schema/modules/tag/index.d.ts +4 -0
  142. package/dist/schema/modules/tag/index.js +4 -0
  143. package/dist/schema/modules/tag/policies/contribute-to-tag.d.ts +1 -0
  144. package/dist/schema/modules/tag/policies/contribute-to-tag.js +10 -0
  145. package/dist/schema/modules/tag/policies/index.d.ts +4 -0
  146. package/dist/schema/modules/tag/policies/index.js +4 -0
  147. package/dist/schema/modules/tag/policies/manage-tag.d.ts +1 -0
  148. package/dist/schema/modules/tag/policies/manage-tag.js +10 -0
  149. package/dist/schema/modules/tag/policies/traverse-issue-tag.d.ts +1 -0
  150. package/dist/schema/modules/tag/policies/traverse-issue-tag.js +14 -0
  151. package/dist/schema/modules/tag/policies/traverse-project-tag.d.ts +1 -0
  152. package/dist/schema/modules/tag/policies/traverse-project-tag.js +7 -0
  153. package/dist/schema/modules/tag/types/index.d.ts +1 -0
  154. package/dist/schema/modules/tag/types/index.js +1 -0
  155. package/dist/schema/modules/tag/types/tag.d.ts +7 -0
  156. package/dist/schema/modules/tag/types/tag.js +8 -0
  157. package/dist/schema/schema.d.ts +902 -0
  158. package/dist/schema/schema.js +49 -0
  159. package/dist/schema/types/index.js +1 -0
  160. package/dist/schema/types/node-id.js +2 -0
  161. package/package.json +28 -20
  162. package/dist/schema/application/functions.js +0 -156
  163. package/dist/schema/application/index.d.ts +0 -701
  164. package/dist/schema/application/index.js +0 -49
  165. package/dist/schema/command/class.d.ts +0 -38
  166. package/dist/schema/command/class.js +0 -13
  167. package/dist/schema/command/index.d.ts +0 -2
  168. package/dist/schema/command/index.js +0 -2
  169. package/dist/schema/command/relationships.d.ts +0 -32
  170. package/dist/schema/command/relationships.js +0 -14
  171. package/dist/schema/comment/class.js +0 -7
  172. package/dist/schema/comment/index.d.ts +0 -2
  173. package/dist/schema/comment/index.js +0 -2
  174. package/dist/schema/comment/relationships.js +0 -11
  175. package/dist/schema/issue/class.d.ts +0 -74
  176. package/dist/schema/issue/class.js +0 -17
  177. package/dist/schema/issue/index.d.ts +0 -2
  178. package/dist/schema/issue/index.js +0 -2
  179. package/dist/schema/issue/relationships.d.ts +0 -112
  180. package/dist/schema/issue/relationships.js +0 -23
  181. package/dist/schema/tag/class.js +0 -10
  182. package/dist/schema/tag/index.d.ts +0 -2
  183. package/dist/schema/tag/index.js +0 -2
  184. package/dist/schema/tag/relationships.d.ts +0 -32
  185. package/dist/schema/tag/relationships.js +0 -12
  186. package/dist/schema/tracker/class.d.ts +0 -73
  187. package/dist/schema/tracker/class.js +0 -10
  188. package/dist/schema/tracker/index.d.ts +0 -2
  189. package/dist/schema/tracker/index.js +0 -2
  190. package/dist/schema/tracker/relationships.js +0 -7
@@ -0,0 +1,10 @@
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 '../classes/project-contains-issue.js';
4
+ export const ContributeToIssue = policy({
5
+ description: 'The caller owns or belongs to the Project containing this Issue.',
6
+ match: ({ allOf, anyOf, edge, exists, object, subject }) => exists(({ node }) => {
7
+ const project = node(() => Project);
8
+ return allOf(anyOf(edge({ source: subject, class: () => project_owned_by, target: project }), edge({ source: subject, class: () => project_has_member, target: project })), edge({ source: project, class: () => project_contains_issue, target: object }));
9
+ }),
10
+ });
@@ -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';
@@ -0,0 +1,16 @@
1
+ export declare const project_has_member: 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: "member";
8
+ readonly outgoing: "0..*";
9
+ };
10
+ readonly target: {
11
+ readonly as: "project";
12
+ readonly incoming: "0..*";
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 { 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
+ });
@@ -1,15 +1,15 @@
1
- export declare const tracker_owned_by: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
1
+ export declare const project_owned_by: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
2
2
  readonly depth: 0;
3
3
  readonly abstract: false;
4
4
  readonly extends: readonly [];
5
5
  readonly properties: never;
6
6
  readonly source: {
7
- readonly as: "tracker";
8
- readonly outgoing: "1";
7
+ readonly as: "owner";
8
+ readonly outgoing: "0..*";
9
9
  };
10
10
  readonly target: {
11
- readonly as: "owner";
12
- readonly incoming: "0..*";
11
+ readonly as: "project";
12
+ readonly incoming: "1";
13
13
  };
14
14
  readonly constraints: Record<never, never>;
15
15
  readonly effectiveProperties: never;
@@ -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
+ });
@@ -0,0 +1,283 @@
1
+ export declare const Project: import("@astrale-os/sdk/schema").NodeClass<{
2
+ readonly depth: 1;
3
+ readonly abstract: false;
4
+ readonly extends: readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
5
+ readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Named"> & {
6
+ readonly origin: "kernel.astrale.ai";
7
+ };
8
+ readonly kind: 'node';
9
+ readonly abstract: true;
10
+ }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Named"> & {
11
+ readonly origin: "kernel.astrale.ai";
12
+ }, "kernel.astrale.ai:class.Named", readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
13
+ readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
14
+ readonly origin: "kernel.astrale.ai";
15
+ };
16
+ readonly kind: 'node';
17
+ readonly abstract: true;
18
+ }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
19
+ readonly origin: "kernel.astrale.ai";
20
+ }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "name", "kernel.astrale.ai:class.Named.property.name">, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "name", "kernel.astrale.ai:class.Named.property.name">, never, never>, import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
21
+ readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Descriptable"> & {
22
+ readonly origin: "kernel.astrale.ai";
23
+ };
24
+ readonly kind: 'node';
25
+ readonly abstract: true;
26
+ }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Descriptable"> & {
27
+ readonly origin: "kernel.astrale.ai";
28
+ }, "kernel.astrale.ai:class.Descriptable", readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
29
+ readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
30
+ readonly origin: "kernel.astrale.ai";
31
+ };
32
+ readonly kind: 'node';
33
+ readonly abstract: true;
34
+ }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
35
+ readonly origin: "kernel.astrale.ai";
36
+ }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, false, "description", "kernel.astrale.ai:class.Descriptable.property.description">, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, false, "description", "kernel.astrale.ai:class.Descriptable.property.description">, never, never>, import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
37
+ readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Timestamped"> & {
38
+ readonly origin: "kernel.astrale.ai";
39
+ };
40
+ readonly kind: 'node';
41
+ readonly abstract: true;
42
+ }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Timestamped"> & {
43
+ readonly origin: "kernel.astrale.ai";
44
+ }, "kernel.astrale.ai:class.Timestamped", readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
45
+ readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
46
+ readonly origin: "kernel.astrale.ai";
47
+ };
48
+ readonly kind: 'node';
49
+ readonly abstract: true;
50
+ }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
51
+ readonly origin: "kernel.astrale.ai";
52
+ }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "createdAt", "kernel.astrale.ai:class.Timestamped.property.createdAt"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "updatedAt", "kernel.astrale.ai:class.Timestamped.property.updatedAt">, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "createdAt", "kernel.astrale.ai:class.Timestamped.property.createdAt"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "updatedAt", "kernel.astrale.ai:class.Timestamped.property.updatedAt">, never, never>];
53
+ readonly properties: {
54
+ readonly key: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "key", "self">;
55
+ readonly ownerId: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "ownerId", "self">;
56
+ readonly memberIds: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string[], string[], true, "memberIds", "self">;
57
+ readonly nextIssueNumber: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<number, number, true, "nextIssueNumber", "self">;
58
+ readonly archived: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<boolean, boolean, true, "archived", "self">;
59
+ };
60
+ readonly methods: {
61
+ readonly create: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
62
+ key: string;
63
+ name: string;
64
+ description?: string | undefined;
65
+ }, {
66
+ readonly mode: 'value';
67
+ readonly value: {
68
+ id: string;
69
+ key: string;
70
+ name: string;
71
+ description: string;
72
+ archived: boolean;
73
+ };
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">>;
100
+ readonly update: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
101
+ name?: string | undefined;
102
+ description?: string | undefined;
103
+ }, {
104
+ readonly mode: 'value';
105
+ readonly value: {
106
+ id: string;
107
+ key: string;
108
+ name: string;
109
+ description: string;
110
+ archived: boolean;
111
+ };
112
+ }, "authorized", false, "default">>;
113
+ readonly addMember: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
114
+ memberId: string;
115
+ }, {
116
+ readonly mode: 'value';
117
+ readonly value: {
118
+ projectId: string;
119
+ memberId: string;
120
+ changed: boolean;
121
+ };
122
+ }, "authorized", false, "default">>;
123
+ readonly removeMember: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
124
+ memberId: string;
125
+ }, {
126
+ readonly mode: 'value';
127
+ readonly value: {
128
+ projectId: string;
129
+ memberId: string;
130
+ changed: boolean;
131
+ };
132
+ }, "authorized", false, "default">>;
133
+ readonly createIssue: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
134
+ title: string;
135
+ description?: string | undefined;
136
+ priority?: number | undefined;
137
+ }, {
138
+ readonly mode: 'value';
139
+ readonly value: {
140
+ id: string;
141
+ reference: string;
142
+ title: string;
143
+ description: string;
144
+ status: "accepted" | "closed" | "deferred" | "open" | "resolved";
145
+ priority: number;
146
+ archived: boolean;
147
+ };
148
+ }, "authorized", false, "default">>;
149
+ readonly createTag: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
150
+ name: string;
151
+ color?: string | undefined;
152
+ }, {
153
+ readonly mode: 'value';
154
+ readonly value: {
155
+ id: string;
156
+ name: string;
157
+ slug: string;
158
+ color?: string | undefined;
159
+ };
160
+ }, "authorized", false, "default">>;
161
+ readonly archive: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
162
+ readonly mode: 'value';
163
+ readonly value: {
164
+ projectId: string;
165
+ archived: true;
166
+ };
167
+ }, "authorized", false, "default">>;
168
+ };
169
+ readonly effectiveProperties: (import("@astrale-os/sdk/schema").AuthoredPropertyProjection<boolean, boolean, true, "archived", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "key", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string[], string[], true, "memberIds", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<number, number, true, "nextIssueNumber", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "ownerId", "self">) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, false> & {
170
+ readonly name: "description";
171
+ readonly key: "kernel.astrale.ai:class.Descriptable.property.description";
172
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
173
+ readonly name: "createdAt";
174
+ readonly key: "kernel.astrale.ai:class.Timestamped.property.createdAt";
175
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
176
+ readonly name: "name";
177
+ readonly key: "kernel.astrale.ai:class.Named.property.name";
178
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
179
+ readonly name: "updatedAt";
180
+ readonly key: "kernel.astrale.ai:class.Timestamped.property.updatedAt";
181
+ });
182
+ readonly effectiveInstanceMethods: import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
183
+ readonly mode: 'value';
184
+ readonly value: {
185
+ projectId: string;
186
+ archived: true;
187
+ };
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<{
198
+ name?: string | undefined;
199
+ description?: string | undefined;
200
+ }, {
201
+ readonly mode: 'value';
202
+ readonly value: {
203
+ id: string;
204
+ key: string;
205
+ name: string;
206
+ description: string;
207
+ archived: boolean;
208
+ };
209
+ }, "authorized", false, "default">>, "update", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
210
+ memberId: string;
211
+ }, {
212
+ readonly mode: 'value';
213
+ readonly value: {
214
+ projectId: string;
215
+ memberId: string;
216
+ changed: boolean;
217
+ };
218
+ }, "authorized", false, "default">>, "removeMember", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
219
+ title: string;
220
+ description?: string | undefined;
221
+ priority?: number | undefined;
222
+ }, {
223
+ readonly mode: 'value';
224
+ readonly value: {
225
+ id: string;
226
+ reference: string;
227
+ title: string;
228
+ description: string;
229
+ status: "accepted" | "closed" | "deferred" | "open" | "resolved";
230
+ priority: number;
231
+ archived: boolean;
232
+ };
233
+ }, "authorized", false, "default">>, "createIssue", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
234
+ name: string;
235
+ color?: string | undefined;
236
+ }, {
237
+ readonly mode: 'value';
238
+ readonly value: {
239
+ id: string;
240
+ name: string;
241
+ slug: string;
242
+ color?: string | undefined;
243
+ };
244
+ }, "authorized", false, "default">>, "createTag", "self">;
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<{
270
+ key: string;
271
+ name: string;
272
+ description?: string | undefined;
273
+ }, {
274
+ readonly mode: 'value';
275
+ readonly value: {
276
+ id: string;
277
+ key: string;
278
+ name: string;
279
+ description: string;
280
+ archived: boolean;
281
+ };
282
+ }, "authenticated", true, "default">>, "create", "self">;
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
+ });
@@ -0,0 +1,16 @@
1
+ export declare const createProjectIssueMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
2
+ title: string;
3
+ description?: string | undefined;
4
+ priority?: number | undefined;
5
+ }, {
6
+ readonly mode: 'value';
7
+ readonly value: {
8
+ id: string;
9
+ reference: string;
10
+ title: string;
11
+ description: string;
12
+ status: "accepted" | "closed" | "deferred" | "open" | "resolved";
13
+ priority: number;
14
+ archived: boolean;
15
+ };
16
+ }, "authorized", false, "default">>;
@@ -0,0 +1,15 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { issueValue } from '../../issue/index.js';
4
+ import { ContributeToProject } from '../policies/contribute-to-project.js';
5
+ export const createProjectIssueMethod = method({
6
+ description: 'Create one atomically numbered Issue in this Project.',
7
+ auth: 'authorized',
8
+ policy: ({ check, self }) => check(ContributeToProject, self),
9
+ input: z.strictObject({
10
+ title: z.string().min(1).max(200),
11
+ description: z.string().max(50_000).optional(),
12
+ priority: z.number().int().min(0).max(4).optional(),
13
+ }),
14
+ output: issueValue,
15
+ });
@@ -0,0 +1,12 @@
1
+ export declare const createProjectTagMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
2
+ name: string;
3
+ color?: string | undefined;
4
+ }, {
5
+ readonly mode: 'value';
6
+ readonly value: {
7
+ id: string;
8
+ name: string;
9
+ slug: string;
10
+ color?: string | undefined;
11
+ };
12
+ }, "authorized", false, "default">>;