@astrale-domains/issues 0.9.0 → 0.9.1

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.
@@ -10,7 +10,7 @@ export declare const project_contains_issue: import("@astrale-os/sdk/schema").Di
10
10
  readonly abstract: false;
11
11
  readonly depth: 1;
12
12
  readonly properties: "archived" | "createdAt" | "description" | "key" | "memberIds" | "name" | "nextIssueNumber" | "ownerId" | "updatedAt";
13
- readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
13
+ readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "deliverReport" | "deliveryStatus" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
14
14
  })[];
15
15
  readonly outgoing: "0..*";
16
16
  };
@@ -17,7 +17,7 @@ export declare const project_has_member: import("@astrale-os/sdk/schema").Direct
17
17
  readonly abstract: false;
18
18
  readonly depth: 1;
19
19
  readonly properties: "archived" | "createdAt" | "description" | "key" | "memberIds" | "name" | "nextIssueNumber" | "ownerId" | "updatedAt";
20
- readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
20
+ readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "deliverReport" | "deliveryStatus" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
21
21
  })[];
22
22
  readonly incoming: "0..*";
23
23
  };
@@ -17,7 +17,7 @@ export declare const project_owned_by: import("@astrale-os/sdk/schema").Directed
17
17
  readonly abstract: false;
18
18
  readonly depth: 1;
19
19
  readonly properties: "archived" | "createdAt" | "description" | "key" | "memberIds" | "name" | "nextIssueNumber" | "ownerId" | "updatedAt";
20
- readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
20
+ readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "deliverReport" | "deliveryStatus" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
21
21
  })[];
22
22
  readonly incoming: "0..1";
23
23
  };
@@ -17,7 +17,7 @@ export declare const project_receives_reports_from: import("@astrale-os/sdk/sche
17
17
  readonly abstract: false;
18
18
  readonly depth: 1;
19
19
  readonly properties: "archived" | "createdAt" | "description" | "key" | "memberIds" | "name" | "nextIssueNumber" | "ownerId" | "updatedAt";
20
- readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
20
+ readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "deliverReport" | "deliveryStatus" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
21
21
  })[];
22
22
  readonly incoming: "0..1";
23
23
  };
@@ -124,6 +124,65 @@ export declare const Project: import("@astrale-os/sdk/schema").AuthoredNodeClass
124
124
  reference: string;
125
125
  };
126
126
  }, "authorized", false, false, undefined, undefined>>;
127
+ deliverReport: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
128
+ body: string;
129
+ context?: {
130
+ observedAt: string;
131
+ cli: {
132
+ version: string;
133
+ platform: string;
134
+ arch: string;
135
+ };
136
+ runtime: {
137
+ node: string;
138
+ bun?: string | undefined;
139
+ };
140
+ project?: {
141
+ name: string;
142
+ version?: string | undefined;
143
+ packages: {
144
+ name: string;
145
+ declared?: string | undefined;
146
+ version?: string | undefined;
147
+ source: "installed" | "local" | "unresolved";
148
+ commit?: string | undefined;
149
+ dirty?: boolean | undefined;
150
+ }[];
151
+ } | undefined;
152
+ instance?: {
153
+ name: string;
154
+ issuer?: string | undefined;
155
+ url?: string | undefined;
156
+ } | undefined;
157
+ } | undefined;
158
+ title: string;
159
+ requestId: string;
160
+ reporterId: string;
161
+ sender: string;
162
+ projectId: string;
163
+ }, {
164
+ readonly mode: 'value';
165
+ readonly value: {
166
+ id: string;
167
+ reference: string;
168
+ };
169
+ }, "authorized", true, false, undefined, undefined>>;
170
+ deliveryStatus: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
171
+ sender: string;
172
+ destination: {
173
+ projectId: string;
174
+ } | {
175
+ key: string;
176
+ };
177
+ }, {
178
+ readonly mode: 'value';
179
+ readonly value: {
180
+ projectId: string;
181
+ ownerId: string;
182
+ key: string;
183
+ memberIds: string[];
184
+ } | null;
185
+ }, "authorized", true, false, undefined, undefined>>;
127
186
  createTag: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
128
187
  name: string;
129
188
  color?: string | undefined;
@@ -11,6 +11,7 @@ import { deleteProjectMethod } from '../functions/delete-project.js';
11
11
  import { handoverReportingProjectMethod } from '../functions/handover-reporting-project.js';
12
12
  import { receiveProjectReportMethod } from '../functions/receive-project-report.js';
13
13
  import { removeProjectMemberMethod } from '../functions/remove-project-member.js';
14
+ import { deliverReportMethod, deliveryStatusMethod } from '../functions/report-delivery.js';
14
15
  import { updateProjectMethod } from '../functions/update-project.js';
15
16
  import { ownsOrBelongsToProject } from '../policies/owns-or-belongs-to-project.js';
16
17
  import { submitsReportsToProject } from '../policies/submits-reports-to-project.js';
@@ -33,6 +34,8 @@ export const Project = nodeClass({
33
34
  createIssue: createProjectIssueMethod,
34
35
  handoverReporting: handoverReportingProjectMethod,
35
36
  receiveReport: receiveProjectReportMethod,
37
+ deliverReport: deliverReportMethod,
38
+ deliveryStatus: deliveryStatusMethod,
36
39
  createTag: createProjectTagMethod,
37
40
  archive: archiveProjectMethod,
38
41
  delete: deleteProjectMethod,
@@ -0,0 +1,35 @@
1
+ import { K, method, path } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { receiveReportInput, reportReceiptValue } from '../../issue/index.js';
4
+ import { nodeIdValue } from '../../../types/index.js';
5
+ import { callingReportDomain } from '../policies/calling-report-domain.js';
6
+ const sender = path(K.classes.Domain);
7
+ export const deliveryStatusMethod = method({
8
+ description: 'Read this Domain’s report delivery standing on the Project.',
9
+ static: true,
10
+ auth: 'authorized',
11
+ input: z.strictObject({
12
+ sender,
13
+ destination: z.union([
14
+ z.strictObject({ projectId: nodeIdValue }),
15
+ z.strictObject({ key: z.string().min(2).max(10) }),
16
+ ]),
17
+ }),
18
+ policy: ({ check, input }) => check(callingReportDomain, input.sender),
19
+ output: z
20
+ .strictObject({
21
+ projectId: nodeIdValue,
22
+ ownerId: nodeIdValue,
23
+ key: z.string(),
24
+ memberIds: z.array(nodeIdValue),
25
+ })
26
+ .nullable(),
27
+ });
28
+ export const deliverReportMethod = method({
29
+ description: 'Deliver a report through the authenticated Domain’s registered Project intake.',
30
+ static: true,
31
+ auth: 'authorized',
32
+ input: receiveReportInput.extend({ sender, projectId: nodeIdValue }),
33
+ policy: ({ check, input }) => check(callingReportDomain, input.sender),
34
+ output: reportReceiptValue,
35
+ });
@@ -5,3 +5,4 @@ export { ownsOrBelongsToProject, ownsOrBelongsToContainingProject, ownsProject,
5
5
  export { project_receives_reports_from } from './classes/index.js';
6
6
  export { sendsProjectReports } from './policies/index.js';
7
7
  export { submitsReportsToProject } from './policies/index.js';
8
+ export { callingReportDomain } from './policies/calling-report-domain.js';
@@ -5,3 +5,4 @@ export { ownsOrBelongsToProject, ownsOrBelongsToContainingProject, ownsProject,
5
5
  export { project_receives_reports_from } from './classes/index.js';
6
6
  export { sendsProjectReports } from './policies/index.js';
7
7
  export { submitsReportsToProject } from './policies/index.js';
8
+ export { callingReportDomain } from './policies/calling-report-domain.js';
@@ -0,0 +1,2 @@
1
+ /** Bind a reporting integration to its own installed Domain identity. */
2
+ export declare const callingReportDomain: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,5 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ /** Bind a reporting integration to its own installed Domain identity. */
3
+ export const callingReportDomain = policy({
4
+ match: ({ sameNode, subject, object }) => sameNode(subject, object),
5
+ });
@@ -10,7 +10,7 @@ export declare const project_contains_tag: import("@astrale-os/sdk/schema").Dire
10
10
  readonly abstract: false;
11
11
  readonly depth: 1;
12
12
  readonly properties: "archived" | "createdAt" | "description" | "key" | "memberIds" | "name" | "nextIssueNumber" | "ownerId" | "updatedAt";
13
- readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
13
+ readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "deliverReport" | "deliveryStatus" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
14
14
  })[];
15
15
  readonly outgoing: "0..*";
16
16
  };
@@ -130,6 +130,65 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
130
130
  reference: string;
131
131
  };
132
132
  }, "authorized", false, false, undefined, undefined>>;
133
+ deliverReport: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
134
+ body: string;
135
+ context?: {
136
+ observedAt: string;
137
+ cli: {
138
+ version: string;
139
+ platform: string;
140
+ arch: string;
141
+ };
142
+ runtime: {
143
+ node: string;
144
+ bun?: string | undefined;
145
+ };
146
+ project?: {
147
+ name: string;
148
+ version?: string | undefined;
149
+ packages: {
150
+ name: string;
151
+ declared?: string | undefined;
152
+ version?: string | undefined;
153
+ source: "installed" | "local" | "unresolved";
154
+ commit?: string | undefined;
155
+ dirty?: boolean | undefined;
156
+ }[];
157
+ } | undefined;
158
+ instance?: {
159
+ name: string;
160
+ issuer?: string | undefined;
161
+ url?: string | undefined;
162
+ } | undefined;
163
+ } | undefined;
164
+ title: string;
165
+ requestId: string;
166
+ reporterId: string;
167
+ sender: string;
168
+ projectId: string;
169
+ }, {
170
+ readonly mode: 'value';
171
+ readonly value: {
172
+ id: string;
173
+ reference: string;
174
+ };
175
+ }, "authorized", true, false, undefined, undefined>>;
176
+ deliveryStatus: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
177
+ sender: string;
178
+ destination: {
179
+ projectId: string;
180
+ } | {
181
+ key: string;
182
+ };
183
+ }, {
184
+ readonly mode: 'value';
185
+ readonly value: {
186
+ projectId: string;
187
+ ownerId: string;
188
+ key: string;
189
+ memberIds: string[];
190
+ } | null;
191
+ }, "authorized", true, false, undefined, undefined>>;
133
192
  createTag: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
134
193
  name: string;
135
194
  color?: string | undefined;
@@ -445,7 +504,7 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
445
504
  readonly abstract: false;
446
505
  readonly depth: 1;
447
506
  readonly properties: "archived" | "createdAt" | "description" | "key" | "memberIds" | "name" | "nextIssueNumber" | "ownerId" | "updatedAt";
448
- readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
507
+ readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "deliverReport" | "deliveryStatus" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
449
508
  })[];
450
509
  readonly incoming: "0..1";
451
510
  };
@@ -507,7 +566,7 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
507
566
  readonly abstract: false;
508
567
  readonly depth: 1;
509
568
  readonly properties: "archived" | "createdAt" | "description" | "key" | "memberIds" | "name" | "nextIssueNumber" | "ownerId" | "updatedAt";
510
- readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
569
+ readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "deliverReport" | "deliveryStatus" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
511
570
  })[];
512
571
  readonly incoming: "0..1";
513
572
  };
@@ -533,7 +592,7 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
533
592
  readonly abstract: false;
534
593
  readonly depth: 1;
535
594
  readonly properties: "archived" | "createdAt" | "description" | "key" | "memberIds" | "name" | "nextIssueNumber" | "ownerId" | "updatedAt";
536
- readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
595
+ readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "deliverReport" | "deliveryStatus" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
537
596
  })[];
538
597
  readonly incoming: "0..*";
539
598
  };
@@ -552,7 +611,7 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
552
611
  readonly abstract: false;
553
612
  readonly depth: 1;
554
613
  readonly properties: "archived" | "createdAt" | "description" | "key" | "memberIds" | "name" | "nextIssueNumber" | "ownerId" | "updatedAt";
555
- readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
614
+ readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "deliverReport" | "deliveryStatus" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
556
615
  })[];
557
616
  readonly outgoing: "0..*";
558
617
  };
@@ -756,7 +815,7 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
756
815
  readonly abstract: false;
757
816
  readonly depth: 1;
758
817
  readonly properties: "archived" | "createdAt" | "description" | "key" | "memberIds" | "name" | "nextIssueNumber" | "ownerId" | "updatedAt";
759
- readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
818
+ readonly methods: "addMember" | "archive" | "create" | "createIssue" | "createTag" | "delete" | "deliverReport" | "deliveryStatus" | "handoverReporting" | "receiveReport" | "removeMember" | "update";
760
819
  })[];
761
820
  readonly outgoing: "0..*";
762
821
  };
@@ -834,6 +893,7 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"is
834
893
  }>;
835
894
  };
836
895
  readonly policies: {
896
+ readonly callingReportDomain: import("@astrale-os/sdk/schema").Policy;
837
897
  readonly sendsProjectReports: import("@astrale-os/sdk/schema").Policy;
838
898
  readonly submitsReportsToProject: import("@astrale-os/sdk/schema").Policy;
839
899
  readonly ownsProject: import("@astrale-os/sdk/schema").Policy;
@@ -2,7 +2,7 @@ import { ShellSchema } from '@astrale-domains/shell';
2
2
  import { KernelSchema, defineSchema, domainIcon, view } from '@astrale-os/sdk/schema';
3
3
  import { Comment, comment_authored_by, issue_has_comment, ownsOrBelongsToProjectOfIssueOfCommentOrReportedIssueOfComment, authoredComment, ownsOrBelongsToProjectOfIssueOfAuthoredComment, ownsOrBelongsToProjectOfIssueWithCommentOrReportedIssueWithComment, } from './modules/comment/index.js';
4
4
  import { Issue, ownsOrBelongsToProjectOfIssue, ownsOrBelongsToProjectOfIssueOrReportedIssue, ownsProjectOfIssue, reportedIssue, ownsOrBelongsToProjectOfAssignedIssue, ownsOrBelongsToProjectOfChildIssue, ownsOrBelongsToProjectOfReportedIssueOrReportedIssue, ownsOrBelongsToProjectOfIssueWithTopic, ownsOrBelongsToProjectOfTrackedOrTrackingIssue, issue_assigned_to, issue_is_about, issue_reported_by, issue_subtask_of, issue_tracked_by, project_contains_issue, } from './modules/issue/index.js';
5
- import { Project, project_receives_reports_from, sendsProjectReports, submitsReportsToProject, ownsOrBelongsToProject, ownsOrBelongsToContainingProject, ownsProject, ownsOrBelongsToProjectOfMembership, ownsOrBelongsToProjectOfOwnership, project_has_member, project_owned_by, } from './modules/project/index.js';
5
+ import { Project, project_receives_reports_from, callingReportDomain, sendsProjectReports, submitsReportsToProject, ownsOrBelongsToProject, ownsOrBelongsToContainingProject, ownsProject, ownsOrBelongsToProjectOfMembership, ownsOrBelongsToProjectOfOwnership, project_has_member, project_owned_by, } from './modules/project/index.js';
6
6
  import { Tag, ownsOrBelongsToProjectOfTag, ownsProjectOfTag, ownsOrBelongsToProjectOfTaggedIssue, issue_tagged_with, project_contains_tag, } from './modules/tag/index.js';
7
7
  const origin = 'issues.astrale.ai';
8
8
  const classes = {
@@ -25,6 +25,7 @@ const classes = {
25
25
  issue_is_about,
26
26
  };
27
27
  const policies = {
28
+ callingReportDomain,
28
29
  sendsProjectReports,
29
30
  submitsReportsToProject,
30
31
  ownsProject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-domains/issues",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/astrale-os/domains.git",