@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,14 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { tagValue } from '../../tag/index.js';
4
+ import { ManageProject } from '../policies/manage-project.js';
5
+ export const createProjectTagMethod = method({
6
+ description: 'Create one Project-local Tag.',
7
+ auth: 'authorized',
8
+ policy: ({ check, self }) => check(ManageProject, self),
9
+ input: z.strictObject({
10
+ name: z.string().min(1).max(64),
11
+ color: z.string().optional(),
12
+ }),
13
+ output: tagValue,
14
+ });
@@ -0,0 +1,14 @@
1
+ export declare const createProjectMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
2
+ key: string;
3
+ name: string;
4
+ description?: string | undefined;
5
+ }, {
6
+ readonly mode: 'value';
7
+ readonly value: {
8
+ id: string;
9
+ key: string;
10
+ name: string;
11
+ description: string;
12
+ archived: boolean;
13
+ };
14
+ }, "authenticated", true, "default">>;
@@ -0,0 +1,14 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { projectValue } from '../types/project.js';
4
+ export const createProjectMethod = method({
5
+ description: 'Create one Project owned by the authenticated caller.',
6
+ static: true,
7
+ auth: 'authenticated',
8
+ input: z.strictObject({
9
+ key: z.string().min(1).max(40),
10
+ name: z.string().min(1).max(120),
11
+ description: z.string().max(5_000).optional(),
12
+ }),
13
+ output: projectValue,
14
+ });
@@ -0,0 +1,8 @@
1
+ export { addProjectMemberMethod } from './add-project-member.js';
2
+ export { archiveProjectMethod } from './archive-project.js';
3
+ export { createProjectIssueMethod } from './create-project-issue.js';
4
+ export { createProjectTagMethod } from './create-project-tag.js';
5
+ export { createProjectMethod } from './create-project.js';
6
+ export { listProjectsMethod } from './list-projects.js';
7
+ export { removeProjectMemberMethod } from './remove-project-member.js';
8
+ export { updateProjectMethod } from './update-project.js';
@@ -0,0 +1,8 @@
1
+ export { addProjectMemberMethod } from './add-project-member.js';
2
+ export { archiveProjectMethod } from './archive-project.js';
3
+ export { createProjectIssueMethod } from './create-project-issue.js';
4
+ export { createProjectTagMethod } from './create-project-tag.js';
5
+ export { createProjectMethod } from './create-project.js';
6
+ export { listProjectsMethod } from './list-projects.js';
7
+ export { removeProjectMemberMethod } from './remove-project-member.js';
8
+ export { updateProjectMethod } from './update-project.js';
@@ -0,0 +1,25 @@
1
+ export declare const listProjectsMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
2
+ readonly mode: 'value';
3
+ readonly value: {
4
+ projects: {
5
+ id: string;
6
+ key: string;
7
+ name: string;
8
+ description: string;
9
+ archived: boolean;
10
+ issues: {
11
+ id: string;
12
+ reference: string;
13
+ title: string;
14
+ description: string;
15
+ status: "accepted" | "closed" | "deferred" | "open" | "resolved";
16
+ priority: number;
17
+ archived: boolean;
18
+ comments: {
19
+ id: string;
20
+ body: string;
21
+ }[];
22
+ }[];
23
+ }[];
24
+ };
25
+ }, "authenticated", true, "default">>;
@@ -0,0 +1,16 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { commentValue } from '../../comment/index.js';
4
+ import { issueValue } from '../../issue/index.js';
5
+ import { projectValue } from '../types/project.js';
6
+ export const listProjectsMethod = method({
7
+ description: 'List the caller-visible Projects with their Issues.',
8
+ static: true,
9
+ auth: 'authenticated',
10
+ input: z.strictObject({}),
11
+ output: z.strictObject({
12
+ projects: z.array(projectValue.extend({
13
+ issues: z.array(issueValue.extend({ comments: z.array(commentValue) })),
14
+ })),
15
+ }),
16
+ });
@@ -0,0 +1,10 @@
1
+ export declare const removeProjectMemberMethod: 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 removeProjectMemberMethod = method({
7
+ description: 'Remove one unassigned Identity from Project membership.',
8
+ auth: 'authorized',
9
+ policy: ({ check, self }) => check(ManageProject, self),
10
+ input: z.strictObject({ memberId: nodeIdValue }),
11
+ output: membershipChangeValue,
12
+ });
@@ -0,0 +1,13 @@
1
+ export declare const updateProjectMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
2
+ name?: string | undefined;
3
+ description?: string | undefined;
4
+ }, {
5
+ readonly mode: 'value';
6
+ readonly value: {
7
+ id: string;
8
+ key: string;
9
+ name: string;
10
+ description: string;
11
+ archived: boolean;
12
+ };
13
+ }, "authorized", false, "default">>;
@@ -0,0 +1,14 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { ManageProject } from '../policies/manage-project.js';
4
+ import { projectValue } from '../types/project.js';
5
+ export const updateProjectMethod = method({
6
+ description: 'Update mutable Project metadata.',
7
+ auth: 'authorized',
8
+ policy: ({ check, self }) => check(ManageProject, self),
9
+ input: z.strictObject({
10
+ name: z.string().min(1).max(120).optional(),
11
+ description: z.string().max(5_000).optional(),
12
+ }),
13
+ output: projectValue,
14
+ });
@@ -0,0 +1,4 @@
1
+ export { membershipChangeValue, projectValue } from './types/index.js';
2
+ export { project_has_member, project_owned_by, Project } from './classes/index.js';
3
+ export { addProjectMemberMethod, archiveProjectMethod, createProjectIssueMethod, createProjectTagMethod, createProjectMethod, listProjectsMethod, removeProjectMemberMethod, updateProjectMethod, } from './functions/index.js';
4
+ export { ContributeToProject, ManageProject, TraverseProjectMember, TraverseProjectOwner, } from './policies/index.js';
@@ -0,0 +1,4 @@
1
+ export { membershipChangeValue, projectValue } from './types/index.js';
2
+ export { project_has_member, project_owned_by, Project } from './classes/index.js';
3
+ export { addProjectMemberMethod, archiveProjectMethod, createProjectIssueMethod, createProjectTagMethod, createProjectMethod, listProjectsMethod, removeProjectMemberMethod, updateProjectMethod, } from './functions/index.js';
4
+ export { ContributeToProject, ManageProject, TraverseProjectMember, TraverseProjectOwner, } from './policies/index.js';
@@ -0,0 +1 @@
1
+ export declare const ContributeToProject: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,7 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { project_has_member } from '../classes/project-has-member.js';
3
+ import { project_owned_by } from '../classes/project-owned-by.js';
4
+ export const ContributeToProject = policy({
5
+ description: 'The caller owns or is a member of this Project.',
6
+ match: ({ anyOf, edge, object, subject }) => anyOf(edge({ source: subject, class: () => project_owned_by, target: object }), edge({ source: subject, class: () => project_has_member, target: object })),
7
+ });
@@ -0,0 +1,4 @@
1
+ export { ContributeToProject } from './contribute-to-project.js';
2
+ export { ManageProject } from './manage-project.js';
3
+ export { TraverseProjectMember } from './traverse-project-member.js';
4
+ export { TraverseProjectOwner } from './traverse-project-owner.js';
@@ -0,0 +1,4 @@
1
+ export { ContributeToProject } from './contribute-to-project.js';
2
+ export { ManageProject } from './manage-project.js';
3
+ export { TraverseProjectMember } from './traverse-project-member.js';
4
+ export { TraverseProjectOwner } from './traverse-project-owner.js';
@@ -0,0 +1 @@
1
+ export declare const ManageProject: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,6 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { project_owned_by } from '../classes/project-owned-by.js';
3
+ export const ManageProject = policy({
4
+ description: 'The caller is the exact owner of this Project.',
5
+ match: ({ edge, object, subject }) => edge({ source: subject, class: () => project_owned_by, target: object }),
6
+ });
@@ -0,0 +1 @@
1
+ export declare const TraverseProjectMember: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,7 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { project_has_member } from '../classes/project-has-member.js';
3
+ import { project_owned_by } from '../classes/project-owned-by.js';
4
+ export const TraverseProjectMember = policy({
5
+ description: 'Project membership is visible only to that Project owner and members.',
6
+ match: ({ allOf, anyOf, edge, source, subject, target }) => anyOf(allOf(edge({ source, class: () => project_has_member, target }), edge({ source: subject, class: () => project_owned_by, target })), allOf(edge({ source, class: () => project_has_member, target }), edge({ source: subject, class: () => project_has_member, target }))),
7
+ });
@@ -0,0 +1 @@
1
+ export declare const TraverseProjectOwner: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,7 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { project_has_member } from '../classes/project-has-member.js';
3
+ import { project_owned_by } from '../classes/project-owned-by.js';
4
+ export const TraverseProjectOwner = policy({
5
+ description: 'Project ownership is visible only to that Project owner and members.',
6
+ match: ({ allOf, anyOf, edge, source, subject, target }) => anyOf(allOf(edge({ source, class: () => project_owned_by, target }), edge({ source: subject, class: () => project_owned_by, target })), allOf(edge({ source, class: () => project_owned_by, target }), edge({ source: subject, class: () => project_has_member, target }))),
7
+ });
@@ -0,0 +1,2 @@
1
+ export { membershipChangeValue } from './membership-change.js';
2
+ export { projectValue } from './project.js';
@@ -0,0 +1,2 @@
1
+ export { membershipChangeValue } from './membership-change.js';
2
+ export { projectValue } from './project.js';
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ export declare const membershipChangeValue: z.ZodObject<{
3
+ projectId: z.ZodString;
4
+ memberId: z.ZodString;
5
+ changed: z.ZodBoolean;
6
+ }, z.core.$strict>;
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { nodeIdValue } from '../../../types/index.js';
3
+ export const membershipChangeValue = z.strictObject({
4
+ projectId: nodeIdValue,
5
+ memberId: nodeIdValue,
6
+ changed: z.boolean(),
7
+ });
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ export declare const projectValue: z.ZodObject<{
3
+ id: z.ZodString;
4
+ key: z.ZodString;
5
+ name: z.ZodString;
6
+ description: z.ZodString;
7
+ archived: z.ZodBoolean;
8
+ }, z.core.$strict>;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import { nodeIdValue } from '../../../types/index.js';
3
+ export const projectValue = z.strictObject({
4
+ id: nodeIdValue,
5
+ key: z.string().min(2).max(10),
6
+ name: z.string().min(1).max(120),
7
+ description: z.string().max(5_000),
8
+ archived: z.boolean(),
9
+ });
@@ -0,0 +1,3 @@
1
+ export { issue_tagged_with } from './issue-tagged-with.js';
2
+ export { project_contains_tag } from './project-contains-tag.js';
3
+ export { Tag } from './tag.js';
@@ -0,0 +1,3 @@
1
+ export { issue_tagged_with } from './issue-tagged-with.js';
2
+ export { project_contains_tag } from './project-contains-tag.js';
3
+ export { Tag } from './tag.js';
@@ -0,0 +1,16 @@
1
+ export declare const issue_tagged_with: 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: "tag";
12
+ readonly incoming: "0..*";
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 { TraverseIssueTag } from '../policies/traverse-issue-tag.js';
4
+ import { Tag } from './tag.js';
5
+ export const issue_tagged_with = edgeClass.directed({
6
+ description: 'One Issue is classified by one Tag from the same Project.',
7
+ source: { as: 'issue', accepts: [() => Issue], outgoing: '0..*' },
8
+ target: { as: 'tag', accepts: [() => Tag], incoming: '0..*' },
9
+ policies: { traverse: () => TraverseIssueTag },
10
+ });
@@ -0,0 +1,16 @@
1
+ export declare const project_contains_tag: 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: "tag";
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 { TraverseProjectTag } from '../policies/traverse-project-tag.js';
4
+ import { Tag } from './tag.js';
5
+ export const project_contains_tag = edgeClass.directed({
6
+ description: 'One Project owns one local Tag vocabulary entry.',
7
+ source: { as: 'project', accepts: [() => Project], outgoing: '0..*' },
8
+ target: { as: 'tag', accepts: [() => Tag], incoming: '1' },
9
+ policies: { traverse: () => TraverseProjectTag },
10
+ });
@@ -38,7 +38,27 @@ export declare const Tag: import("@astrale-os/sdk/schema").NodeClass<{
38
38
  readonly slug: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "slug", "self">;
39
39
  readonly color: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "color", "self">;
40
40
  };
41
- readonly methods: Readonly<Record<never, never>>;
41
+ readonly methods: {
42
+ readonly edit: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
43
+ name?: string | undefined;
44
+ color?: string | null | undefined;
45
+ }, {
46
+ readonly mode: 'value';
47
+ readonly value: {
48
+ id: string;
49
+ name: string;
50
+ slug: string;
51
+ color?: string | undefined;
52
+ };
53
+ }, "authorized", false, "default">>;
54
+ readonly delete: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
55
+ readonly mode: 'value';
56
+ readonly value: {
57
+ tagId: string;
58
+ deleted: true;
59
+ };
60
+ }, "authorized", false, "default">>;
61
+ };
42
62
  readonly effectiveProperties: (import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "color", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "slug", "self">) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
43
63
  readonly name: "createdAt";
44
64
  readonly key: "kernel.astrale.ai:class.Timestamped.property.createdAt";
@@ -49,6 +69,23 @@ export declare const Tag: import("@astrale-os/sdk/schema").NodeClass<{
49
69
  readonly name: "updatedAt";
50
70
  readonly key: "kernel.astrale.ai:class.Timestamped.property.updatedAt";
51
71
  });
52
- readonly effectiveInstanceMethods: never;
72
+ readonly effectiveInstanceMethods: import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
73
+ readonly mode: 'value';
74
+ readonly value: {
75
+ tagId: string;
76
+ deleted: true;
77
+ };
78
+ }, "authorized", false, "default">>, "delete", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
79
+ name?: string | undefined;
80
+ color?: string | null | undefined;
81
+ }, {
82
+ readonly mode: 'value';
83
+ readonly value: {
84
+ id: string;
85
+ name: string;
86
+ slug: string;
87
+ color?: string | undefined;
88
+ };
89
+ }, "authorized", false, "default">>, "edit", "self">;
53
90
  readonly effectiveStaticMethods: never;
54
- }>;
91
+ }> & import("@astrale-os/sdk/schema").StateClass<Readonly<Omit<Readonly<Record<never, never>>, never> & {}>>;
@@ -0,0 +1,16 @@
1
+ import { K, nodeClass, property } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { deleteTagMethod } from '../functions/delete-tag.js';
4
+ import { editTagMethod } from '../functions/edit-tag.js';
5
+ import { ContributeToTag } from '../policies/contribute-to-tag.js';
6
+ export const Tag = nodeClass({
7
+ description: 'One Project-local label with a canonical slug.',
8
+ icon: 'tag',
9
+ extends: [K.classes.Named, K.classes.Timestamped],
10
+ properties: {
11
+ slug: z.string().min(1).max(80),
12
+ color: property(z.string().min(7).max(7), { required: false }),
13
+ },
14
+ methods: { edit: editTagMethod, delete: deleteTagMethod },
15
+ policies: { read: () => ContributeToTag },
16
+ });
@@ -0,0 +1,7 @@
1
+ export declare const deleteTagMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
2
+ readonly mode: 'value';
3
+ readonly value: {
4
+ tagId: 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 { ManageTag } from '../policies/manage-tag.js';
5
+ export const deleteTagMethod = method({
6
+ description: 'Detach and delete this Project-local Tag when it labels at most 2,046 Issues; unlink larger sets first.',
7
+ auth: 'authorized',
8
+ policy: ({ check, self }) => check(ManageTag, self),
9
+ input: z.strictObject({}),
10
+ output: z.strictObject({ tagId: nodeIdValue, deleted: z.literal(true) }),
11
+ });
@@ -0,0 +1,12 @@
1
+ export declare const editTagMethod: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
2
+ name?: string | undefined;
3
+ color?: string | null | 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">>;
@@ -0,0 +1,14 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { ManageTag } from '../policies/manage-tag.js';
4
+ import { tagValue } from '../types/tag.js';
5
+ export const editTagMethod = method({
6
+ description: 'Edit this Project-local Tag.',
7
+ auth: 'authorized',
8
+ policy: ({ check, self }) => check(ManageTag, self),
9
+ input: z.strictObject({
10
+ name: z.string().min(1).max(64).optional(),
11
+ color: z.string().nullable().optional(),
12
+ }),
13
+ output: tagValue,
14
+ });
@@ -0,0 +1,2 @@
1
+ export { deleteTagMethod } from './delete-tag.js';
2
+ export { editTagMethod } from './edit-tag.js';
@@ -0,0 +1,2 @@
1
+ export { deleteTagMethod } from './delete-tag.js';
2
+ export { editTagMethod } from './edit-tag.js';
@@ -0,0 +1,4 @@
1
+ export { tagValue } from './types/index.js';
2
+ export { issue_tagged_with, project_contains_tag, Tag } from './classes/index.js';
3
+ export { deleteTagMethod, editTagMethod } from './functions/index.js';
4
+ export { ContributeToTag, ManageTag, TraverseIssueTag, TraverseProjectTag, } from './policies/index.js';
@@ -0,0 +1,4 @@
1
+ export { tagValue } from './types/index.js';
2
+ export { issue_tagged_with, project_contains_tag, Tag } from './classes/index.js';
3
+ export { deleteTagMethod, editTagMethod } from './functions/index.js';
4
+ export { ContributeToTag, ManageTag, TraverseIssueTag, TraverseProjectTag, } from './policies/index.js';
@@ -0,0 +1 @@
1
+ export declare const ContributeToTag: import("@astrale-os/sdk/schema").Policy;
@@ -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_tag } from '../classes/project-contains-tag.js';
4
+ export const ContributeToTag = policy({
5
+ description: 'The caller owns or belongs to the Project containing this Tag.',
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_tag, target: object }));
9
+ }),
10
+ });
@@ -0,0 +1,4 @@
1
+ export { ContributeToTag } from './contribute-to-tag.js';
2
+ export { ManageTag } from './manage-tag.js';
3
+ export { TraverseIssueTag } from './traverse-issue-tag.js';
4
+ export { TraverseProjectTag } from './traverse-project-tag.js';
@@ -0,0 +1,4 @@
1
+ export { ContributeToTag } from './contribute-to-tag.js';
2
+ export { ManageTag } from './manage-tag.js';
3
+ export { TraverseIssueTag } from './traverse-issue-tag.js';
4
+ export { TraverseProjectTag } from './traverse-project-tag.js';
@@ -0,0 +1 @@
1
+ export declare const ManageTag: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,10 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { Project, project_owned_by } from '../../project/index.js';
3
+ import { project_contains_tag } from '../classes/project-contains-tag.js';
4
+ export const ManageTag = policy({
5
+ description: 'The caller owns the Project containing this Tag.',
6
+ match: ({ allOf, edge, exists, object, subject }) => exists(({ node }) => {
7
+ const project = node(() => Project);
8
+ return allOf(edge({ source: subject, class: () => project_owned_by, target: project }), edge({ source: project, class: () => project_contains_tag, target: object }));
9
+ }),
10
+ });
@@ -0,0 +1 @@
1
+ export declare const TraverseIssueTag: 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_tagged_with } from '../classes/issue-tagged-with.js';
5
+ export const TraverseIssueTag = policy({
6
+ description: 'Issue Tag 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_tagged_with, 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_tagged_with, 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 TraverseProjectTag: 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_tag } from '../classes/project-contains-tag.js';
4
+ export const TraverseProjectTag = policy({
5
+ description: 'Project Tag 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_tag, target }), edge({ source: subject, class: () => project_owned_by, target: source })), allOf(edge({ source, class: () => project_contains_tag, target }), edge({ source: subject, class: () => project_has_member, target: source }))),
7
+ });
@@ -0,0 +1 @@
1
+ export { tagValue } from './tag.js';
@@ -0,0 +1 @@
1
+ export { tagValue } from './tag.js';
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const tagValue: z.ZodObject<{
3
+ id: z.ZodString;
4
+ name: z.ZodString;
5
+ slug: z.ZodString;
6
+ color: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strict>;
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { nodeIdValue } from '../../../types/index.js';
3
+ export const tagValue = z.strictObject({
4
+ id: nodeIdValue,
5
+ name: z.string().min(1).max(64),
6
+ slug: z.string().min(1).max(80),
7
+ color: z.string().min(7).max(7).optional(),
8
+ });