@astrale-domains/issues 0.1.2 → 0.1.3

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 (71) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +71 -15
  3. package/dist/schema/.runtime/states/issue/index.d.ts +30 -0
  4. package/dist/schema/.runtime/states/issue/index.js +11 -0
  5. package/dist/schema/comment/class.d.ts +35 -3
  6. package/dist/schema/comment/class.js +11 -2
  7. package/dist/schema/comment/contribute-to-comment-policy.d.ts +1 -0
  8. package/dist/schema/comment/contribute-to-comment-policy.js +12 -0
  9. package/dist/schema/comment/edit-own-comment-policy.d.ts +1 -0
  10. package/dist/schema/comment/edit-own-comment-policy.js +6 -0
  11. package/dist/schema/comment/index.d.ts +3 -0
  12. package/dist/schema/comment/index.js +3 -0
  13. package/dist/schema/comment/methods.js +18 -0
  14. package/dist/schema/comment/relationships.d.ts +4 -4
  15. package/dist/schema/comment/relationships.js +10 -5
  16. package/dist/schema/comment/traverse-comment-relationship-policy.d.ts +2 -0
  17. package/dist/schema/comment/traverse-comment-relationship-policy.js +17 -0
  18. package/dist/schema/index.d.ts +5 -6
  19. package/dist/schema/index.js +4 -5
  20. package/dist/schema/issue/class.d.ts +163 -4
  21. package/dist/schema/issue/class.js +21 -9
  22. package/dist/schema/issue/contribute-to-issue-policy.d.ts +1 -0
  23. package/dist/schema/issue/contribute-to-issue-policy.js +10 -0
  24. package/dist/schema/issue/index.d.ts +3 -1
  25. package/dist/schema/issue/index.js +3 -1
  26. package/dist/schema/issue/methods.js +66 -0
  27. package/dist/schema/issue/relationships.d.ts +15 -60
  28. package/dist/schema/issue/relationships.js +21 -15
  29. package/dist/schema/issue/traverse-issue-relationship-policy.d.ts +5 -0
  30. package/dist/schema/issue/traverse-issue-relationship-policy.js +55 -0
  31. package/dist/schema/project/class.d.ts +234 -0
  32. package/dist/schema/project/class.js +27 -0
  33. package/dist/schema/project/contribute-to-project-policy.d.ts +1 -0
  34. package/dist/schema/project/contribute-to-project-policy.js +6 -0
  35. package/dist/schema/project/index.d.ts +5 -0
  36. package/dist/schema/project/index.js +5 -0
  37. package/dist/schema/project/manage-project-policy.d.ts +1 -0
  38. package/dist/schema/project/manage-project-policy.js +6 -0
  39. package/dist/schema/project/methods.js +68 -0
  40. package/dist/schema/{command → project}/relationships.d.ts +9 -9
  41. package/dist/schema/project/relationships.js +15 -0
  42. package/dist/schema/project/traverse-project-relationship-policy.d.ts +4 -0
  43. package/dist/schema/project/traverse-project-relationship-policy.js +20 -0
  44. package/dist/schema/{application/index.d.ts → schema.d.ts} +454 -335
  45. package/dist/schema/schema.js +44 -0
  46. package/dist/schema/tag/class.d.ts +39 -2
  47. package/dist/schema/tag/class.js +6 -1
  48. package/dist/schema/tag/contribute-to-tag-policy.d.ts +1 -0
  49. package/dist/schema/tag/contribute-to-tag-policy.js +10 -0
  50. package/dist/schema/tag/index.d.ts +3 -1
  51. package/dist/schema/tag/index.js +3 -1
  52. package/dist/schema/tag/manage-tag-policy.d.ts +1 -0
  53. package/dist/schema/tag/manage-tag-policy.js +10 -0
  54. package/dist/schema/tag/methods.js +21 -0
  55. package/dist/schema/tag/relationships.d.ts +2 -2
  56. package/dist/schema/tag/relationships.js +11 -7
  57. package/dist/schema/value/index.js +34 -0
  58. package/package.json +16 -6
  59. package/dist/schema/application/functions.js +0 -156
  60. package/dist/schema/application/index.js +0 -49
  61. package/dist/schema/command/class.d.ts +0 -38
  62. package/dist/schema/command/class.js +0 -13
  63. package/dist/schema/command/index.d.ts +0 -2
  64. package/dist/schema/command/index.js +0 -2
  65. package/dist/schema/command/relationships.js +0 -14
  66. package/dist/schema/tracker/class.d.ts +0 -73
  67. package/dist/schema/tracker/class.js +0 -10
  68. package/dist/schema/tracker/index.d.ts +0 -2
  69. package/dist/schema/tracker/index.js +0 -2
  70. package/dist/schema/tracker/relationships.d.ts +0 -16
  71. package/dist/schema/tracker/relationships.js +0 -7
@@ -0,0 +1,234 @@
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 update: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
76
+ name?: string | undefined;
77
+ description?: string | undefined;
78
+ }, {
79
+ readonly mode: 'value';
80
+ readonly value: {
81
+ id: string;
82
+ key: string;
83
+ name: string;
84
+ description: string;
85
+ archived: boolean;
86
+ };
87
+ }, "authorized", false, "default">>;
88
+ readonly addMember: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
89
+ memberId: string;
90
+ }, {
91
+ readonly mode: 'value';
92
+ readonly value: {
93
+ projectId: string;
94
+ memberId: string;
95
+ changed: boolean;
96
+ };
97
+ }, "authorized", false, "default">>;
98
+ readonly removeMember: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
99
+ memberId: string;
100
+ }, {
101
+ readonly mode: 'value';
102
+ readonly value: {
103
+ projectId: string;
104
+ memberId: string;
105
+ changed: boolean;
106
+ };
107
+ }, "authorized", false, "default">>;
108
+ readonly createIssue: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
109
+ title: string;
110
+ description?: string | undefined;
111
+ priority?: number | undefined;
112
+ }, {
113
+ readonly mode: 'value';
114
+ readonly value: {
115
+ id: string;
116
+ reference: string;
117
+ title: string;
118
+ description: string;
119
+ status: "accepted" | "closed" | "deferred" | "open" | "resolved";
120
+ priority: number;
121
+ archived: boolean;
122
+ };
123
+ }, "authorized", false, "default">>;
124
+ readonly createTag: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
125
+ name: string;
126
+ color?: string | undefined;
127
+ }, {
128
+ readonly mode: 'value';
129
+ readonly value: {
130
+ id: string;
131
+ name: string;
132
+ slug: string;
133
+ color?: string | undefined;
134
+ };
135
+ }, "authorized", false, "default">>;
136
+ readonly archive: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
137
+ readonly mode: 'value';
138
+ readonly value: {
139
+ projectId: string;
140
+ archived: true;
141
+ };
142
+ }, "authorized", false, "default">>;
143
+ };
144
+ 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> & {
145
+ readonly name: "description";
146
+ readonly key: "kernel.astrale.ai:class.Descriptable.property.description";
147
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
148
+ readonly name: "createdAt";
149
+ readonly key: "kernel.astrale.ai:class.Timestamped.property.createdAt";
150
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
151
+ readonly name: "name";
152
+ readonly key: "kernel.astrale.ai:class.Named.property.name";
153
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
154
+ readonly name: "updatedAt";
155
+ readonly key: "kernel.astrale.ai:class.Timestamped.property.updatedAt";
156
+ });
157
+ readonly effectiveInstanceMethods: import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
158
+ readonly mode: 'value';
159
+ readonly value: {
160
+ projectId: string;
161
+ archived: true;
162
+ };
163
+ }, "authorized", false, "default">>, "archive", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
164
+ name?: string | undefined;
165
+ description?: string | undefined;
166
+ }, {
167
+ readonly mode: 'value';
168
+ readonly value: {
169
+ id: string;
170
+ key: string;
171
+ name: string;
172
+ description: string;
173
+ archived: boolean;
174
+ };
175
+ }, "authorized", false, "default">>, "update", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
176
+ memberId: string;
177
+ }, {
178
+ readonly mode: 'value';
179
+ readonly value: {
180
+ projectId: string;
181
+ memberId: string;
182
+ changed: boolean;
183
+ };
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
+ }, "authorized", false, "default">>, "removeMember", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
194
+ title: string;
195
+ description?: string | undefined;
196
+ priority?: number | undefined;
197
+ }, {
198
+ readonly mode: 'value';
199
+ readonly value: {
200
+ id: string;
201
+ reference: string;
202
+ title: string;
203
+ description: string;
204
+ status: "accepted" | "closed" | "deferred" | "open" | "resolved";
205
+ priority: number;
206
+ archived: boolean;
207
+ };
208
+ }, "authorized", false, "default">>, "createIssue", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
209
+ name: string;
210
+ color?: string | undefined;
211
+ }, {
212
+ readonly mode: 'value';
213
+ readonly value: {
214
+ id: string;
215
+ name: string;
216
+ slug: string;
217
+ color?: string | undefined;
218
+ };
219
+ }, "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<{
221
+ key: string;
222
+ name: string;
223
+ description?: string | undefined;
224
+ }, {
225
+ readonly mode: 'value';
226
+ readonly value: {
227
+ id: string;
228
+ key: string;
229
+ name: string;
230
+ description: string;
231
+ archived: boolean;
232
+ };
233
+ }, "authenticated", true, "default">>, "create", "self">;
234
+ }>;
@@ -0,0 +1,27 @@
1
+ import { K, nodeClass, property } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { nodeIdValue } from '../value/index.js';
4
+ import { ContributeToProject } from './contribute-to-project-policy.js';
5
+ import { addProjectMemberMethod, archiveProjectMethod, createProjectIssueMethod, createProjectMethod, createProjectTagMethod, removeProjectMemberMethod, updateProjectMethod, } from './methods.js';
6
+ export const Project = nodeClass({
7
+ description: 'A collaborative namespace for numbered Issues, Tags, and membership.',
8
+ icon: 'folder-kanban',
9
+ extends: [K.classes.Named, K.classes.Descriptable, K.classes.Timestamped],
10
+ properties: {
11
+ key: z.string().min(2).max(10),
12
+ ownerId: property(nodeIdValue, { visibility: 'private' }),
13
+ memberIds: property(z.array(nodeIdValue).max(256), { visibility: 'private' }),
14
+ nextIssueNumber: property(z.number().int().min(1), { visibility: 'private' }),
15
+ archived: z.boolean(),
16
+ },
17
+ methods: {
18
+ create: createProjectMethod,
19
+ update: updateProjectMethod,
20
+ addMember: addProjectMemberMethod,
21
+ removeMember: removeProjectMemberMethod,
22
+ createIssue: createProjectIssueMethod,
23
+ createTag: createProjectTagMethod,
24
+ archive: archiveProjectMethod,
25
+ },
26
+ policies: { read: () => ContributeToProject },
27
+ });
@@ -0,0 +1 @@
1
+ export declare const ContributeToProject: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,6 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { project_has_member, project_owned_by } from './relationships.js';
3
+ export const ContributeToProject = policy({
4
+ description: 'The caller owns or is a member of this Project.',
5
+ match: ({ anyOf, edge, object, subject }) => anyOf(edge({ source: subject, class: () => project_owned_by, target: object }), edge({ source: subject, class: () => project_has_member, target: object })),
6
+ });
@@ -0,0 +1,5 @@
1
+ export { Project } from './class.js';
2
+ export { ContributeToProject } from './contribute-to-project-policy.js';
3
+ export { ManageProject } from './manage-project-policy.js';
4
+ export { project_has_member, project_owned_by } from './relationships.js';
5
+ export { TraverseProjectIssue, TraverseProjectMember, TraverseProjectOwner, TraverseProjectTag, } from './traverse-project-relationship-policy.js';
@@ -0,0 +1,5 @@
1
+ export { Project } from './class.js';
2
+ export { ContributeToProject } from './contribute-to-project-policy.js';
3
+ export { ManageProject } from './manage-project-policy.js';
4
+ export { project_has_member, project_owned_by } from './relationships.js';
5
+ export { TraverseProjectIssue, TraverseProjectMember, TraverseProjectOwner, TraverseProjectTag, } from './traverse-project-relationship-policy.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 './relationships.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,68 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { issueValue, membershipChangeValue, nodeIdValue, projectValue, tagValue, } from '../value/index.js';
4
+ import { ContributeToProject } from './contribute-to-project-policy.js';
5
+ import { ManageProject } from './manage-project-policy.js';
6
+ export const createProjectMethod = method({
7
+ description: 'Create one Project owned by the authenticated caller.',
8
+ static: true,
9
+ auth: 'authenticated',
10
+ input: z.strictObject({
11
+ key: z.string().min(1).max(40),
12
+ name: z.string().min(1).max(120),
13
+ description: z.string().max(5_000).optional(),
14
+ }),
15
+ output: projectValue,
16
+ });
17
+ export const updateProjectMethod = method({
18
+ description: 'Update mutable Project metadata.',
19
+ auth: 'authorized',
20
+ policy: ({ check, self }) => check(ManageProject, self),
21
+ input: z.strictObject({
22
+ name: z.string().min(1).max(120).optional(),
23
+ description: z.string().max(5_000).optional(),
24
+ }),
25
+ output: projectValue,
26
+ });
27
+ export const addProjectMemberMethod = method({
28
+ description: 'Add one Identity as a Project member.',
29
+ auth: 'authorized',
30
+ policy: ({ check, self }) => check(ManageProject, self),
31
+ input: z.strictObject({ memberId: nodeIdValue }),
32
+ output: membershipChangeValue,
33
+ });
34
+ export const removeProjectMemberMethod = method({
35
+ description: 'Remove one unassigned Identity from Project membership.',
36
+ auth: 'authorized',
37
+ policy: ({ check, self }) => check(ManageProject, self),
38
+ input: z.strictObject({ memberId: nodeIdValue }),
39
+ output: membershipChangeValue,
40
+ });
41
+ export const createProjectIssueMethod = method({
42
+ description: 'Create one atomically numbered Issue in this Project.',
43
+ auth: 'authorized',
44
+ policy: ({ check, self }) => check(ContributeToProject, self),
45
+ input: z.strictObject({
46
+ title: z.string().min(1).max(200),
47
+ description: z.string().max(50_000).optional(),
48
+ priority: z.number().int().min(0).max(4).optional(),
49
+ }),
50
+ output: issueValue,
51
+ });
52
+ export const createProjectTagMethod = method({
53
+ description: 'Create one Project-local Tag.',
54
+ auth: 'authorized',
55
+ policy: ({ check, self }) => check(ManageProject, self),
56
+ input: z.strictObject({
57
+ name: z.string().min(1).max(64),
58
+ color: z.string().optional(),
59
+ }),
60
+ output: tagValue,
61
+ });
62
+ export const archiveProjectMethod = method({
63
+ description: 'Archive this Project without deleting its aggregate.',
64
+ auth: 'authorized',
65
+ policy: ({ check, self }) => check(ManageProject, self),
66
+ input: z.strictObject({}),
67
+ output: z.strictObject({ projectId: nodeIdValue, archived: z.literal(true) }),
68
+ });
@@ -1,30 +1,30 @@
1
- export declare const command_requested_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: "command";
8
- readonly outgoing: "1";
7
+ readonly as: "owner";
8
+ readonly outgoing: "0..*";
9
9
  };
10
10
  readonly target: {
11
- readonly as: "requester";
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;
16
16
  }>;
17
- export declare const command_targets_primary: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
17
+ export declare const project_has_member: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
18
18
  readonly depth: 0;
19
19
  readonly abstract: false;
20
20
  readonly extends: readonly [];
21
21
  readonly properties: never;
22
22
  readonly source: {
23
- readonly as: "command";
24
- readonly outgoing: "0..1";
23
+ readonly as: "member";
24
+ readonly outgoing: "0..*";
25
25
  };
26
26
  readonly target: {
27
- readonly as: "primary";
27
+ readonly as: "project";
28
28
  readonly incoming: "0..*";
29
29
  };
30
30
  readonly constraints: Record<never, never>;
@@ -0,0 +1,15 @@
1
+ import { K, edgeClass } from '@astrale-os/sdk/schema';
2
+ import { Project } from './class.js';
3
+ import { TraverseProjectMember, TraverseProjectOwner, } from './traverse-project-relationship-policy.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
+ });
10
+ export const project_has_member = edgeClass.directed({
11
+ description: 'An Identity admitted to collaborate in one Project.',
12
+ source: { as: 'member', accepts: [K.classes.Identity], outgoing: '0..*' },
13
+ target: { as: 'project', accepts: [() => Project], incoming: '0..*' },
14
+ policies: { traverse: () => TraverseProjectMember },
15
+ });
@@ -0,0 +1,4 @@
1
+ export declare const TraverseProjectOwner: import("@astrale-os/sdk/schema").Policy;
2
+ export declare const TraverseProjectMember: import("@astrale-os/sdk/schema").Policy;
3
+ export declare const TraverseProjectIssue: import("@astrale-os/sdk/schema").Policy;
4
+ export declare const TraverseProjectTag: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,20 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { project_contains_issue } from '../issue/index.js';
3
+ import { project_contains_tag } from '../tag/index.js';
4
+ import { project_has_member, project_owned_by } from './relationships.js';
5
+ export const TraverseProjectOwner = policy({
6
+ description: 'Project ownership is visible only to that Project owner and members.',
7
+ 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 }))),
8
+ });
9
+ export const TraverseProjectMember = policy({
10
+ description: 'Project membership is visible only to that Project owner and members.',
11
+ 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 }))),
12
+ });
13
+ export const TraverseProjectIssue = policy({
14
+ description: 'Project Issue containment is visible only to that Project owner and members.',
15
+ 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 }))),
16
+ });
17
+ export const TraverseProjectTag = policy({
18
+ description: 'Project Tag containment is visible only to that Project owner and members.',
19
+ 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 }))),
20
+ });