@astrale-domains/issues 0.3.2 → 0.3.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.
- package/README.md +40 -9
- package/dist/schema/index.d.ts +2 -1
- package/dist/schema/index.js +2 -1
- package/dist/schema/modules/comment/classes/comment.d.ts +1 -1
- package/dist/schema/modules/issue/classes/index.d.ts +1 -0
- package/dist/schema/modules/issue/classes/index.js +1 -0
- package/dist/schema/modules/issue/classes/issue-duplicate-candidate.d.ts +18 -0
- package/dist/schema/modules/issue/classes/issue-duplicate-candidate.js +10 -0
- package/dist/schema/modules/issue/classes/issue.d.ts +41 -2
- package/dist/schema/modules/issue/classes/issue.js +4 -0
- package/dist/schema/modules/issue/index.d.ts +3 -3
- package/dist/schema/modules/issue/index.js +3 -3
- package/dist/schema/modules/issue/policies/index.d.ts +1 -0
- package/dist/schema/modules/issue/policies/index.js +1 -0
- package/dist/schema/modules/issue/policies/traverse-duplicate-candidate.d.ts +1 -0
- package/dist/schema/modules/issue/policies/traverse-duplicate-candidate.js +10 -0
- package/dist/schema/modules/issue/types/index.d.ts +1 -0
- package/dist/schema/modules/issue/types/index.js +1 -0
- package/dist/schema/modules/issue/types/report.d.ts +207 -0
- package/dist/schema/modules/issue/types/report.js +56 -0
- package/dist/schema/modules/project/classes/project.d.ts +103 -3
- package/dist/schema/modules/project/classes/project.js +6 -0
- package/dist/schema/modules/project/functions/complete-project-report.d.ts +10 -0
- package/dist/schema/modules/project/functions/complete-project-report.js +11 -0
- package/dist/schema/modules/project/functions/index.d.ts +3 -0
- package/dist/schema/modules/project/functions/index.js +3 -0
- package/dist/schema/modules/project/functions/list-project-reports.d.ts +49 -0
- package/dist/schema/modules/project/functions/list-project-reports.js +14 -0
- package/dist/schema/modules/project/functions/receive-project-report.d.ts +41 -0
- package/dist/schema/modules/project/functions/receive-project-report.js +10 -0
- package/dist/schema/modules/tag/classes/tag.d.ts +2 -2
- package/dist/schema/schema.d.ts +166 -8
- package/dist/schema/schema.js +3 -1
- package/package.json +8 -8
- package/CHANGELOG.md +0 -181
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Issues Domain
|
|
2
2
|
|
|
3
3
|
`issues.astrale.ai` owns collaborative Projects, numbered Issues, Comments, and Project-local Tags.
|
|
4
|
-
It is
|
|
4
|
+
It is an Astrale Application with Schema Policies, receiver Methods, atomic Mutations, and an
|
|
5
5
|
inbox-first Shell View.
|
|
6
6
|
|
|
7
7
|
The graph Schema depends only on Kernel: collaboration edges target any `Identity` subtype.
|
|
@@ -30,8 +30,8 @@ The public callable surface keeps observation Project-owned and mutations receiv
|
|
|
30
30
|
```text
|
|
31
31
|
Project.create
|
|
32
32
|
Project.list
|
|
33
|
-
Project.update | addMember | removeMember | createIssue | createTag | archive
|
|
34
|
-
Issue.update | assign | setTags | setParent | addComment | archive
|
|
33
|
+
Project.update | addMember | removeMember | createIssue | receiveReport | listReports | completeReport | createTag | archive
|
|
34
|
+
Issue.update | transition | assign | setTags | setParent | addComment | archive
|
|
35
35
|
Comment.edit | delete
|
|
36
36
|
Tag.edit | delete
|
|
37
37
|
```
|
|
@@ -54,12 +54,43 @@ collaboration state without requesting authority over every possible concrete Id
|
|
|
54
54
|
another Domain.
|
|
55
55
|
Those private execution fields are not a second public model and never replace the Policy edges.
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
`Project.receiveReport` is the owner-only intake for trusted integrations such as Admin. Its owner
|
|
58
|
+
supplies a verified `reporterId`, an opaque `requestId`, `title`, `body`, and optional structured
|
|
59
|
+
`context`. The public Admin facade must derive the reporter from authentication; ordinary senders
|
|
60
|
+
must not receive this privileged owner capability or Project membership.
|
|
61
|
+
|
|
62
|
+
One atomic mutation allocates the number, creates the Issue and reporter/containment edges, retains
|
|
63
|
+
the original report, and sets `reportPending`. A query precondition fences the exact
|
|
64
|
+
Project/reporter/request triple. A retry with identical content returns the original `{ id, reference }`,
|
|
65
|
+
even after triage edits or archival; changed content under the same key is rejected. Independent
|
|
66
|
+
request IDs remain independent reports. Known counter/key contention is retried up to eight attempts;
|
|
67
|
+
unknown outcomes propagate, so the sender must retain the original payload and key until confirmation.
|
|
68
|
+
The inline Workflow runner is not the source of durability: the graph receipt and atomic preconditions are.
|
|
69
|
+
|
|
70
|
+
Context describes current client observations, separate from mutable Issue text. Missing versions and
|
|
71
|
+
instance coordinates remain unknown. Creating a report does not grant access to this or other Issues.
|
|
72
|
+
The generic domain has no Admin dependency. Admin setup, instance resolution, and scheduling remain
|
|
73
|
+
integration-owned.
|
|
74
|
+
|
|
75
|
+
The Project owner processes reports through two methods:
|
|
76
|
+
|
|
77
|
+
- `Project.listReports({ pending?, cursor? })` returns up to 32 original reports, their reporters,
|
|
78
|
+
receipt times, and an opaque continuation cursor. Continue with the same pending filter. Omitting
|
|
79
|
+
the filter also includes completed originals. This method does not drain the collection.
|
|
80
|
+
- `Project.completeReport({ issueId, duplicateCandidateId? })` acknowledges processing, optionally
|
|
81
|
+
adding one same-Project `issue_duplicate_candidate` edge in the same transaction. It preserves
|
|
82
|
+
all existing candidate edges, original evidence, and human edits. The edge is a triage suggestion,
|
|
83
|
+
not a merge. Traversal requires participation in the Project containing both endpoints.
|
|
84
|
+
|
|
85
|
+
Completion guards the observed candidate set and pending state. Known concurrent changes reject
|
|
86
|
+
without partial writes; the scheduler should reread and retry. Replaying a completed report returns
|
|
87
|
+
`changed: false`, without applying a new candidate. Only acknowledge after integration-owned effects
|
|
88
|
+
are durably recorded; those effects must also be idempotent because a worker can stop between them
|
|
89
|
+
and acknowledgement. A failed report remains pending. An integration must resume pagination rather
|
|
90
|
+
than repeatedly processing only the first page, so a persistent failure cannot starve later reports.
|
|
91
|
+
|
|
92
|
+
Other creation methods retain their existing retry semantics. Set-style changes converge naturally;
|
|
93
|
+
stale concurrent edits reject through atomic mutation preconditions.
|
|
63
94
|
|
|
64
95
|
The mounted View defaults to a focused open-Issue Inbox with queue progress and keyboard or button
|
|
65
96
|
navigation. Accepted work has a dedicated discussion view, while Browse searches and filters the
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { schema } from './schema.js';
|
|
2
2
|
export type { IssuesDomain, IssuesSchema } from './schema.js';
|
|
3
3
|
export { Project, project_has_member, project_owned_by } from './modules/project/index.js';
|
|
4
|
-
export { Issue, issue_assigned_to, issue_reported_by, issue_subtask_of, project_contains_issue, } from './modules/issue/index.js';
|
|
4
|
+
export { Issue, issue_assigned_to, issue_duplicate_candidate, issue_reported_by, issue_subtask_of, project_contains_issue, } from './modules/issue/index.js';
|
|
5
5
|
export { Comment, comment_authored_by, issue_has_comment } from './modules/comment/index.js';
|
|
6
6
|
export { Tag, issue_tagged_with, project_contains_tag } from './modules/tag/index.js';
|
|
7
|
+
export { reportContentValue, reportContextValue, receiveReportInput, reportReceiptValue, reportRecordValue, reportPageValue, type ReportContent, } from './modules/issue/index.js';
|
package/dist/schema/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { schema } from './schema.js';
|
|
2
2
|
export { Project, project_has_member, project_owned_by } from './modules/project/index.js';
|
|
3
|
-
export { Issue, issue_assigned_to, issue_reported_by, issue_subtask_of, project_contains_issue, } from './modules/issue/index.js';
|
|
3
|
+
export { Issue, issue_assigned_to, issue_duplicate_candidate, issue_reported_by, issue_subtask_of, project_contains_issue, } from './modules/issue/index.js';
|
|
4
4
|
export { Comment, comment_authored_by, issue_has_comment } from './modules/comment/index.js';
|
|
5
5
|
export { Tag, issue_tagged_with, project_contains_tag } from './modules/tag/index.js';
|
|
6
|
+
export { reportContentValue, reportContextValue, receiveReportInput, reportReceiptValue, reportRecordValue, reportPageValue, } from './modules/issue/index.js';
|
|
@@ -5,7 +5,7 @@ export declare const Comment: import("@astrale-os/sdk/schema").AuthoredNodeClass
|
|
|
5
5
|
readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Timestamped">];
|
|
6
6
|
readonly properties: {
|
|
7
7
|
body: z.ZodString;
|
|
8
|
-
authorId: import("@astrale-os/sdk/schema").
|
|
8
|
+
authorId: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {}>;
|
|
9
9
|
};
|
|
10
10
|
readonly methods: {
|
|
11
11
|
edit: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
@@ -3,3 +3,4 @@ export { issue_reported_by } from './issue-reported-by.js';
|
|
|
3
3
|
export { issue_subtask_of } from './issue-subtask-of.js';
|
|
4
4
|
export { Issue } from './issue.js';
|
|
5
5
|
export { project_contains_issue } from './project-contains-issue.js';
|
|
6
|
+
export { issue_duplicate_candidate } from './issue-duplicate-candidate.js';
|
|
@@ -3,3 +3,4 @@ export { issue_reported_by } from './issue-reported-by.js';
|
|
|
3
3
|
export { issue_subtask_of } from './issue-subtask-of.js';
|
|
4
4
|
export { Issue } from './issue.js';
|
|
5
5
|
export { project_contains_issue } from './project-contains-issue.js';
|
|
6
|
+
export { issue_duplicate_candidate } from './issue-duplicate-candidate.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const issue_duplicate_candidate: 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: "report";
|
|
8
|
+
readonly outgoing: "0..*";
|
|
9
|
+
};
|
|
10
|
+
readonly target: {
|
|
11
|
+
readonly as: "candidate";
|
|
12
|
+
readonly incoming: "0..*";
|
|
13
|
+
};
|
|
14
|
+
readonly constraints: {
|
|
15
|
+
readonly noSelf: true;
|
|
16
|
+
};
|
|
17
|
+
readonly effectiveProperties: never;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { TraverseDuplicateCandidate } from '../policies/traverse-duplicate-candidate.js';
|
|
3
|
+
import { Issue } from './issue.js';
|
|
4
|
+
export const issue_duplicate_candidate = edgeClass.directed({
|
|
5
|
+
description: 'A retained report may describe the same problem as another Issue; a suggestion for triage, not a merge or canonical identity.',
|
|
6
|
+
source: { as: 'report', accepts: [() => Issue], outgoing: '0..*' },
|
|
7
|
+
target: { as: 'candidate', accepts: [() => Issue], incoming: '0..*' },
|
|
8
|
+
constraints: { noSelf: true },
|
|
9
|
+
policies: { traverse: () => TraverseDuplicateCandidate },
|
|
10
|
+
});
|
|
@@ -5,8 +5,8 @@ export declare const Issue: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
|
5
5
|
readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Named">, import("@astrale-os/sdk/schema").KernelClass<"Descriptable">, import("@astrale-os/sdk/schema").KernelClass<"Timestamped">];
|
|
6
6
|
readonly properties: {
|
|
7
7
|
reference: z.ZodString;
|
|
8
|
-
reporterId: import("@astrale-os/sdk/schema").
|
|
9
|
-
assigneeId: import("@astrale-os/sdk/schema").
|
|
8
|
+
reporterId: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {}>;
|
|
9
|
+
assigneeId: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodOptional<z.ZodString>, {}>;
|
|
10
10
|
status: import("@astrale-os/sdk/schema").StateProperty<import("@astrale-os/sdk/schema").StateMachine<{
|
|
11
11
|
readonly open: {
|
|
12
12
|
readonly accept: "accepted";
|
|
@@ -36,6 +36,45 @@ export declare const Issue: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
|
36
36
|
}>;
|
|
37
37
|
priority: z.ZodNumber;
|
|
38
38
|
archived: z.ZodBoolean;
|
|
39
|
+
reportRequestId: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodOptional<z.ZodString>, {}>;
|
|
40
|
+
report: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodOptional<z.ZodObject<{
|
|
41
|
+
title: z.ZodString;
|
|
42
|
+
body: z.ZodString;
|
|
43
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
observedAt: z.ZodString;
|
|
45
|
+
cli: z.ZodObject<{
|
|
46
|
+
version: z.ZodString;
|
|
47
|
+
platform: z.ZodString;
|
|
48
|
+
arch: z.ZodString;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
runtime: z.ZodObject<{
|
|
51
|
+
node: z.ZodString;
|
|
52
|
+
bun: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
project: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
version: z.ZodOptional<z.ZodString>;
|
|
57
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
declared: z.ZodOptional<z.ZodString>;
|
|
60
|
+
version: z.ZodOptional<z.ZodString>;
|
|
61
|
+
source: z.ZodEnum<{
|
|
62
|
+
installed: "installed";
|
|
63
|
+
local: "local";
|
|
64
|
+
unresolved: "unresolved";
|
|
65
|
+
}>;
|
|
66
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
67
|
+
dirty: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
+
}, z.core.$strict>>;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
instance: z.ZodOptional<z.ZodObject<{
|
|
71
|
+
name: z.ZodString;
|
|
72
|
+
issuer: z.ZodOptional<z.ZodString>;
|
|
73
|
+
url: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strict>>;
|
|
75
|
+
}, z.core.$strict>>;
|
|
76
|
+
}, z.core.$strict>>, {}>;
|
|
77
|
+
reportPending: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodOptional<z.ZodBoolean>, {}>;
|
|
39
78
|
};
|
|
40
79
|
readonly methods: {
|
|
41
80
|
update: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
@@ -11,6 +11,7 @@ import { transitionIssueMethod } from '../functions/transition-issue.js';
|
|
|
11
11
|
import { updateIssueMethod } from '../functions/update-issue.js';
|
|
12
12
|
import { ContributeToIssue } from '../policies/contribute-to-issue.js';
|
|
13
13
|
import { issueStatus } from '../states/index.js';
|
|
14
|
+
import { reportContentValue } from '../types/report.js';
|
|
14
15
|
export const Issue = nodeClass({
|
|
15
16
|
description: 'One immutable-reference work item contained by exactly one Project.',
|
|
16
17
|
icon: classIcon.lucide(CircleDot),
|
|
@@ -22,6 +23,9 @@ export const Issue = nodeClass({
|
|
|
22
23
|
status: stateProperty(issueStatus),
|
|
23
24
|
priority: z.number().int().min(0).max(4),
|
|
24
25
|
archived: z.boolean(),
|
|
26
|
+
reportRequestId: property(z.string().min(1).max(128).optional(), {}),
|
|
27
|
+
report: property(reportContentValue.optional(), {}),
|
|
28
|
+
reportPending: property(z.boolean().optional(), {}),
|
|
25
29
|
},
|
|
26
30
|
methods: {
|
|
27
31
|
update: updateIssueMethod,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { issueValue } from './types/index.js';
|
|
1
|
+
export { issueValue, reportContentValue, reportContextValue, receiveReportInput, reportReceiptValue, reportRecordValue, reportPageValue, type ReportContent, } from './types/index.js';
|
|
2
2
|
export { issueStatus, type IssueEvent, type IssueStatus } from './states/index.js';
|
|
3
|
-
export { issue_assigned_to, issue_reported_by, issue_subtask_of, Issue, project_contains_issue, } from './classes/index.js';
|
|
3
|
+
export { issue_assigned_to, issue_duplicate_candidate, issue_reported_by, issue_subtask_of, Issue, project_contains_issue, } from './classes/index.js';
|
|
4
4
|
export { addIssueCommentMethod, archiveIssueMethod, assignIssueMethod, setIssueParentMethod, setIssueTagsMethod, transitionIssueMethod, updateIssueMethod, } from './functions/index.js';
|
|
5
|
-
export { ContributeToIssue, TraverseIssueAssignee, TraverseIssueParent, TraverseIssueReporter, TraverseProjectIssue, } from './policies/index.js';
|
|
5
|
+
export { ContributeToIssue, TraverseDuplicateCandidate, TraverseIssueAssignee, TraverseIssueParent, TraverseIssueReporter, TraverseProjectIssue, } from './policies/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { issueValue } from './types/index.js';
|
|
1
|
+
export { issueValue, reportContentValue, reportContextValue, receiveReportInput, reportReceiptValue, reportRecordValue, reportPageValue, } from './types/index.js';
|
|
2
2
|
export { issueStatus } from './states/index.js';
|
|
3
|
-
export { issue_assigned_to, issue_reported_by, issue_subtask_of, Issue, project_contains_issue, } from './classes/index.js';
|
|
3
|
+
export { issue_assigned_to, issue_duplicate_candidate, issue_reported_by, issue_subtask_of, Issue, project_contains_issue, } from './classes/index.js';
|
|
4
4
|
export { addIssueCommentMethod, archiveIssueMethod, assignIssueMethod, setIssueParentMethod, setIssueTagsMethod, transitionIssueMethod, updateIssueMethod, } from './functions/index.js';
|
|
5
|
-
export { ContributeToIssue, TraverseIssueAssignee, TraverseIssueParent, TraverseIssueReporter, TraverseProjectIssue, } from './policies/index.js';
|
|
5
|
+
export { ContributeToIssue, TraverseDuplicateCandidate, TraverseIssueAssignee, TraverseIssueParent, TraverseIssueReporter, TraverseProjectIssue, } from './policies/index.js';
|
|
@@ -3,3 +3,4 @@ export { TraverseIssueAssignee } from './traverse-issue-assignee.js';
|
|
|
3
3
|
export { TraverseIssueParent } from './traverse-issue-parent.js';
|
|
4
4
|
export { TraverseIssueReporter } from './traverse-issue-reporter.js';
|
|
5
5
|
export { TraverseProjectIssue } from './traverse-project-issue.js';
|
|
6
|
+
export { TraverseDuplicateCandidate } from './traverse-duplicate-candidate.js';
|
|
@@ -3,3 +3,4 @@ export { TraverseIssueAssignee } from './traverse-issue-assignee.js';
|
|
|
3
3
|
export { TraverseIssueParent } from './traverse-issue-parent.js';
|
|
4
4
|
export { TraverseIssueReporter } from './traverse-issue-reporter.js';
|
|
5
5
|
export { TraverseProjectIssue } from './traverse-project-issue.js';
|
|
6
|
+
export { TraverseDuplicateCandidate } from './traverse-duplicate-candidate.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TraverseDuplicateCandidate: 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_issue } from '../classes/project-contains-issue.js';
|
|
4
|
+
export const TraverseDuplicateCandidate = policy({
|
|
5
|
+
description: 'The caller participates in the Project containing both candidate duplicate Issues.',
|
|
6
|
+
match: ({ allOf, anyOf, edge, exists, source, target, subject }) => exists(({ node }) => {
|
|
7
|
+
const project = node(() => Project);
|
|
8
|
+
return allOf(edge({ source: project, class: () => project_contains_issue, target: source }), edge({ source: project, class: () => project_contains_issue, target }), anyOf(edge({ source: subject, class: () => project_owned_by, target: project }), edge({ source: subject, class: () => project_has_member, target: project })));
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Observations at submission time; never evidence of a historical deployed build. */
|
|
3
|
+
export declare const reportContextValue: z.ZodObject<{
|
|
4
|
+
observedAt: z.ZodString;
|
|
5
|
+
cli: z.ZodObject<{
|
|
6
|
+
version: z.ZodString;
|
|
7
|
+
platform: z.ZodString;
|
|
8
|
+
arch: z.ZodString;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
runtime: z.ZodObject<{
|
|
11
|
+
node: z.ZodString;
|
|
12
|
+
bun: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
project: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
version: z.ZodOptional<z.ZodString>;
|
|
17
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
declared: z.ZodOptional<z.ZodString>;
|
|
20
|
+
version: z.ZodOptional<z.ZodString>;
|
|
21
|
+
source: z.ZodEnum<{
|
|
22
|
+
installed: "installed";
|
|
23
|
+
local: "local";
|
|
24
|
+
unresolved: "unresolved";
|
|
25
|
+
}>;
|
|
26
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
27
|
+
dirty: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
}, z.core.$strict>>;
|
|
29
|
+
}, z.core.$strict>>;
|
|
30
|
+
instance: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
issuer: z.ZodOptional<z.ZodString>;
|
|
33
|
+
url: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strict>>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
export declare const reportContentValue: z.ZodObject<{
|
|
37
|
+
title: z.ZodString;
|
|
38
|
+
body: z.ZodString;
|
|
39
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
40
|
+
observedAt: z.ZodString;
|
|
41
|
+
cli: z.ZodObject<{
|
|
42
|
+
version: z.ZodString;
|
|
43
|
+
platform: z.ZodString;
|
|
44
|
+
arch: z.ZodString;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
runtime: z.ZodObject<{
|
|
47
|
+
node: z.ZodString;
|
|
48
|
+
bun: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
project: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
version: z.ZodOptional<z.ZodString>;
|
|
53
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
declared: z.ZodOptional<z.ZodString>;
|
|
56
|
+
version: z.ZodOptional<z.ZodString>;
|
|
57
|
+
source: z.ZodEnum<{
|
|
58
|
+
installed: "installed";
|
|
59
|
+
local: "local";
|
|
60
|
+
unresolved: "unresolved";
|
|
61
|
+
}>;
|
|
62
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
63
|
+
dirty: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
}, z.core.$strict>>;
|
|
65
|
+
}, z.core.$strict>>;
|
|
66
|
+
instance: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
name: z.ZodString;
|
|
68
|
+
issuer: z.ZodOptional<z.ZodString>;
|
|
69
|
+
url: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.core.$strict>>;
|
|
71
|
+
}, z.core.$strict>>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
export declare const receiveReportInput: z.ZodObject<{
|
|
74
|
+
title: z.ZodString;
|
|
75
|
+
body: z.ZodString;
|
|
76
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
77
|
+
observedAt: z.ZodString;
|
|
78
|
+
cli: z.ZodObject<{
|
|
79
|
+
version: z.ZodString;
|
|
80
|
+
platform: z.ZodString;
|
|
81
|
+
arch: z.ZodString;
|
|
82
|
+
}, z.core.$strict>;
|
|
83
|
+
runtime: z.ZodObject<{
|
|
84
|
+
node: z.ZodString;
|
|
85
|
+
bun: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
project: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
version: z.ZodOptional<z.ZodString>;
|
|
90
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
declared: z.ZodOptional<z.ZodString>;
|
|
93
|
+
version: z.ZodOptional<z.ZodString>;
|
|
94
|
+
source: z.ZodEnum<{
|
|
95
|
+
installed: "installed";
|
|
96
|
+
local: "local";
|
|
97
|
+
unresolved: "unresolved";
|
|
98
|
+
}>;
|
|
99
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
100
|
+
dirty: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
+
}, z.core.$strict>>;
|
|
102
|
+
}, z.core.$strict>>;
|
|
103
|
+
instance: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
issuer: z.ZodOptional<z.ZodString>;
|
|
106
|
+
url: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, z.core.$strict>>;
|
|
108
|
+
}, z.core.$strict>>;
|
|
109
|
+
requestId: z.ZodString;
|
|
110
|
+
reporterId: z.ZodString;
|
|
111
|
+
}, z.core.$strict>;
|
|
112
|
+
export declare const reportReceiptValue: z.ZodObject<{
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
reference: z.ZodString;
|
|
115
|
+
}, z.core.$strict>;
|
|
116
|
+
export type ReportContent = z.infer<typeof reportContentValue>;
|
|
117
|
+
export declare const reportRecordValue: z.ZodObject<{
|
|
118
|
+
id: z.ZodString;
|
|
119
|
+
reference: z.ZodString;
|
|
120
|
+
reporterId: z.ZodString;
|
|
121
|
+
content: z.ZodObject<{
|
|
122
|
+
title: z.ZodString;
|
|
123
|
+
body: z.ZodString;
|
|
124
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
125
|
+
observedAt: z.ZodString;
|
|
126
|
+
cli: z.ZodObject<{
|
|
127
|
+
version: z.ZodString;
|
|
128
|
+
platform: z.ZodString;
|
|
129
|
+
arch: z.ZodString;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
runtime: z.ZodObject<{
|
|
132
|
+
node: z.ZodString;
|
|
133
|
+
bun: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strict>;
|
|
135
|
+
project: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
name: z.ZodString;
|
|
137
|
+
version: z.ZodOptional<z.ZodString>;
|
|
138
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
139
|
+
name: z.ZodString;
|
|
140
|
+
declared: z.ZodOptional<z.ZodString>;
|
|
141
|
+
version: z.ZodOptional<z.ZodString>;
|
|
142
|
+
source: z.ZodEnum<{
|
|
143
|
+
installed: "installed";
|
|
144
|
+
local: "local";
|
|
145
|
+
unresolved: "unresolved";
|
|
146
|
+
}>;
|
|
147
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
148
|
+
dirty: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
+
}, z.core.$strict>>;
|
|
150
|
+
}, z.core.$strict>>;
|
|
151
|
+
instance: z.ZodOptional<z.ZodObject<{
|
|
152
|
+
name: z.ZodString;
|
|
153
|
+
issuer: z.ZodOptional<z.ZodString>;
|
|
154
|
+
url: z.ZodOptional<z.ZodString>;
|
|
155
|
+
}, z.core.$strict>>;
|
|
156
|
+
}, z.core.$strict>>;
|
|
157
|
+
}, z.core.$strict>;
|
|
158
|
+
pending: z.ZodBoolean;
|
|
159
|
+
receivedAt: z.ZodString;
|
|
160
|
+
}, z.core.$strict>;
|
|
161
|
+
export declare const reportPageValue: z.ZodObject<{
|
|
162
|
+
reports: z.ZodArray<z.ZodObject<{
|
|
163
|
+
id: z.ZodString;
|
|
164
|
+
reference: z.ZodString;
|
|
165
|
+
reporterId: z.ZodString;
|
|
166
|
+
content: z.ZodObject<{
|
|
167
|
+
title: z.ZodString;
|
|
168
|
+
body: z.ZodString;
|
|
169
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
observedAt: z.ZodString;
|
|
171
|
+
cli: z.ZodObject<{
|
|
172
|
+
version: z.ZodString;
|
|
173
|
+
platform: z.ZodString;
|
|
174
|
+
arch: z.ZodString;
|
|
175
|
+
}, z.core.$strict>;
|
|
176
|
+
runtime: z.ZodObject<{
|
|
177
|
+
node: z.ZodString;
|
|
178
|
+
bun: z.ZodOptional<z.ZodString>;
|
|
179
|
+
}, z.core.$strict>;
|
|
180
|
+
project: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
name: z.ZodString;
|
|
182
|
+
version: z.ZodOptional<z.ZodString>;
|
|
183
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
184
|
+
name: z.ZodString;
|
|
185
|
+
declared: z.ZodOptional<z.ZodString>;
|
|
186
|
+
version: z.ZodOptional<z.ZodString>;
|
|
187
|
+
source: z.ZodEnum<{
|
|
188
|
+
installed: "installed";
|
|
189
|
+
local: "local";
|
|
190
|
+
unresolved: "unresolved";
|
|
191
|
+
}>;
|
|
192
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
193
|
+
dirty: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
+
}, z.core.$strict>>;
|
|
195
|
+
}, z.core.$strict>>;
|
|
196
|
+
instance: z.ZodOptional<z.ZodObject<{
|
|
197
|
+
name: z.ZodString;
|
|
198
|
+
issuer: z.ZodOptional<z.ZodString>;
|
|
199
|
+
url: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, z.core.$strict>>;
|
|
201
|
+
}, z.core.$strict>>;
|
|
202
|
+
}, z.core.$strict>;
|
|
203
|
+
pending: z.ZodBoolean;
|
|
204
|
+
receivedAt: z.ZodString;
|
|
205
|
+
}, z.core.$strict>>;
|
|
206
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { nodeIdValue } from '../../../types/index.js';
|
|
3
|
+
const coordinate = z.string().min(1).max(2_048);
|
|
4
|
+
const version = z.string().max(128);
|
|
5
|
+
/** Observations at submission time; never evidence of a historical deployed build. */
|
|
6
|
+
export const reportContextValue = z.strictObject({
|
|
7
|
+
observedAt: z.string().min(1).max(64),
|
|
8
|
+
cli: z.strictObject({ version, platform: z.string().max(64), arch: z.string().max(64) }),
|
|
9
|
+
runtime: z.strictObject({ node: version, bun: version.optional() }),
|
|
10
|
+
project: z
|
|
11
|
+
.strictObject({
|
|
12
|
+
name: z.string().max(200),
|
|
13
|
+
version: version.optional(),
|
|
14
|
+
packages: z
|
|
15
|
+
.array(z.strictObject({
|
|
16
|
+
name: z.string().min(1).max(200),
|
|
17
|
+
declared: z.string().max(128).optional(),
|
|
18
|
+
version: version.optional(),
|
|
19
|
+
source: z.enum(['installed', 'local', 'unresolved']),
|
|
20
|
+
commit: z.string().min(40).max(64).optional(),
|
|
21
|
+
dirty: z.boolean().optional(),
|
|
22
|
+
}))
|
|
23
|
+
.max(64),
|
|
24
|
+
})
|
|
25
|
+
.optional(),
|
|
26
|
+
instance: z
|
|
27
|
+
.strictObject({
|
|
28
|
+
name: z.string().max(200),
|
|
29
|
+
issuer: coordinate.optional(),
|
|
30
|
+
url: coordinate.optional(),
|
|
31
|
+
})
|
|
32
|
+
.optional(),
|
|
33
|
+
});
|
|
34
|
+
export const reportContentValue = z.strictObject({
|
|
35
|
+
title: z.string().min(1).max(200),
|
|
36
|
+
body: z.string().min(1).max(50_000),
|
|
37
|
+
context: reportContextValue.optional(),
|
|
38
|
+
});
|
|
39
|
+
export const receiveReportInput = reportContentValue.extend({
|
|
40
|
+
requestId: z.string().min(1).max(128),
|
|
41
|
+
reporterId: nodeIdValue,
|
|
42
|
+
});
|
|
43
|
+
export const reportReceiptValue = z.strictObject({
|
|
44
|
+
id: nodeIdValue,
|
|
45
|
+
reference: z.string().min(1).max(32),
|
|
46
|
+
});
|
|
47
|
+
export const reportRecordValue = reportReceiptValue.extend({
|
|
48
|
+
reporterId: nodeIdValue,
|
|
49
|
+
content: reportContentValue,
|
|
50
|
+
pending: z.boolean(),
|
|
51
|
+
receivedAt: z.string().min(1).max(64),
|
|
52
|
+
});
|
|
53
|
+
export const reportPageValue = z.strictObject({
|
|
54
|
+
reports: z.array(reportRecordValue).max(32),
|
|
55
|
+
cursor: z.string().optional(),
|
|
56
|
+
});
|