@astrale-domains/issues 0.1.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.
- package/README.md +36 -0
- package/dist/schema/application/functions.js +156 -0
- package/dist/schema/application/index.d.ts +701 -0
- package/dist/schema/application/index.js +49 -0
- package/dist/schema/command/class.d.ts +38 -0
- package/dist/schema/command/class.js +13 -0
- package/dist/schema/command/index.d.ts +2 -0
- package/dist/schema/command/index.js +2 -0
- package/dist/schema/command/relationships.d.ts +32 -0
- package/dist/schema/command/relationships.js +14 -0
- package/dist/schema/comment/class.d.ts +34 -0
- package/dist/schema/comment/class.js +7 -0
- package/dist/schema/comment/index.d.ts +2 -0
- package/dist/schema/comment/index.js +2 -0
- package/dist/schema/comment/relationships.d.ts +32 -0
- package/dist/schema/comment/relationships.js +11 -0
- package/dist/schema/index.d.ts +7 -0
- package/dist/schema/index.js +6 -0
- package/dist/schema/issue/class.d.ts +74 -0
- package/dist/schema/issue/class.js +17 -0
- package/dist/schema/issue/index.d.ts +2 -0
- package/dist/schema/issue/index.js +2 -0
- package/dist/schema/issue/relationships.d.ts +112 -0
- package/dist/schema/issue/relationships.js +23 -0
- package/dist/schema/tag/class.d.ts +54 -0
- package/dist/schema/tag/class.js +10 -0
- package/dist/schema/tag/index.d.ts +2 -0
- package/dist/schema/tag/index.js +2 -0
- package/dist/schema/tag/relationships.d.ts +32 -0
- package/dist/schema/tag/relationships.js +12 -0
- package/dist/schema/tracker/class.d.ts +73 -0
- package/dist/schema/tracker/class.js +10 -0
- package/dist/schema/tracker/index.d.ts +2 -0
- package/dist/schema/tracker/index.js +2 -0
- package/dist/schema/tracker/relationships.d.ts +16 -0
- package/dist/schema/tracker/relationships.js +7 -0
- package/package.json +75 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Issues Domain
|
|
2
|
+
|
|
3
|
+
`issues.astrale.ai` owns caller-scoped Trackers, numbered Issues, Comments, Tags, Issue relations, and replay-safe command receipts.
|
|
4
|
+
|
|
5
|
+
This is a current Astrale Application, not the former repository/module abstraction:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
schema/ public Classes, relationships, Functions, and application View
|
|
9
|
+
states/ closed Issue lifecycle
|
|
10
|
+
rules/ pure normalization, transitions, and receipt decisions
|
|
11
|
+
queries/ named owner-scoped graph observations
|
|
12
|
+
mutations/ atomic graph changes and receipt preconditions
|
|
13
|
+
actions/ one-operation list handler
|
|
14
|
+
workflows/ authorization observation, replay, and Mutation coordination
|
|
15
|
+
views/ Shell-bound Tracker projection
|
|
16
|
+
ui/ Domain-free presentation
|
|
17
|
+
frontend/ Vite and TanStack Router application
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Every mutation creates a `Command` receipt in the same MutationAST as its business change. The receipt key is scoped through `command_requested_by`; its mutation precondition proves the key is unused. A repeated call reads the receipt, verifies the kind and fingerprint, and returns the retained target rather than submitting the change again. Reusing a key for different input fails closed.
|
|
21
|
+
|
|
22
|
+
The deleted Events Domain is not replaced by a fake package or hidden adapter. Issues no longer owns an Events outbox. Event publication can return later only as an explicit provider-neutral Integration with a real consumer and delivery contract.
|
|
23
|
+
|
|
24
|
+
## Development
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm install
|
|
28
|
+
pnpm typecheck
|
|
29
|
+
pnpm test
|
|
30
|
+
pnpm lint
|
|
31
|
+
pnpm frontend:build
|
|
32
|
+
pnpm build
|
|
33
|
+
pnpm package
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Domain source imports Kernel concepts through semantic `@astrale-os/sdk/*` facades and owns no `.spec` tree.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { func } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const id = z.string().min(1);
|
|
4
|
+
const idempotencyKey = z.string().min(1).max(200);
|
|
5
|
+
const status = z.enum(['open', 'in_progress', 'resolved', 'canceled']);
|
|
6
|
+
const priority = z.number().int().min(0).max(4);
|
|
7
|
+
const tracker = z.strictObject({
|
|
8
|
+
id,
|
|
9
|
+
key: z.string().min(2).max(10),
|
|
10
|
+
name: z.string().min(1),
|
|
11
|
+
description: z.string(),
|
|
12
|
+
});
|
|
13
|
+
const issue = z.strictObject({
|
|
14
|
+
id,
|
|
15
|
+
reference: z.string().min(1),
|
|
16
|
+
title: z.string().min(1),
|
|
17
|
+
description: z.string(),
|
|
18
|
+
status,
|
|
19
|
+
priority,
|
|
20
|
+
});
|
|
21
|
+
const comment = z.strictObject({ id, body: z.string().min(1) });
|
|
22
|
+
const tag = z.strictObject({
|
|
23
|
+
id,
|
|
24
|
+
name: z.string().min(1),
|
|
25
|
+
slug: z.string().min(1),
|
|
26
|
+
color: z.string().optional(),
|
|
27
|
+
});
|
|
28
|
+
export const listTrackers = func({
|
|
29
|
+
description: 'List Trackers owned by the authenticated caller.',
|
|
30
|
+
auth: 'authenticated',
|
|
31
|
+
input: z.strictObject({}),
|
|
32
|
+
output: z.array(tracker),
|
|
33
|
+
});
|
|
34
|
+
export const createTracker = func({
|
|
35
|
+
description: 'Create one caller-owned Tracker.',
|
|
36
|
+
auth: 'authenticated',
|
|
37
|
+
input: z.strictObject({
|
|
38
|
+
key: z.string().min(1),
|
|
39
|
+
name: z.string().min(1).max(120),
|
|
40
|
+
description: z.string().max(5_000).optional(),
|
|
41
|
+
idempotencyKey,
|
|
42
|
+
}),
|
|
43
|
+
output: tracker,
|
|
44
|
+
});
|
|
45
|
+
export const listIssues = func({
|
|
46
|
+
description: 'List Issues in one caller-owned Tracker.',
|
|
47
|
+
auth: 'authenticated',
|
|
48
|
+
input: z.strictObject({ trackerId: id }),
|
|
49
|
+
output: z.array(issue),
|
|
50
|
+
});
|
|
51
|
+
export const createIssue = func({
|
|
52
|
+
description: 'Create one numbered Issue in a caller-owned Tracker.',
|
|
53
|
+
auth: 'authenticated',
|
|
54
|
+
input: z.strictObject({
|
|
55
|
+
trackerId: id,
|
|
56
|
+
title: z.string().min(1).max(200),
|
|
57
|
+
description: z.string().max(50_000).optional(),
|
|
58
|
+
priority: priority.optional(),
|
|
59
|
+
idempotencyKey,
|
|
60
|
+
}),
|
|
61
|
+
output: issue,
|
|
62
|
+
});
|
|
63
|
+
export const updateIssue = func({
|
|
64
|
+
description: 'Update one caller-owned Issue.',
|
|
65
|
+
auth: 'authenticated',
|
|
66
|
+
input: z.strictObject({
|
|
67
|
+
issueId: id,
|
|
68
|
+
title: z.string().min(1).max(200).optional(),
|
|
69
|
+
description: z.string().max(50_000).optional(),
|
|
70
|
+
status: status.optional(),
|
|
71
|
+
priority: priority.optional(),
|
|
72
|
+
idempotencyKey,
|
|
73
|
+
}),
|
|
74
|
+
output: issue,
|
|
75
|
+
});
|
|
76
|
+
export const deleteIssue = func({
|
|
77
|
+
description: 'Delete one caller-owned Issue.',
|
|
78
|
+
auth: 'authenticated',
|
|
79
|
+
input: z.strictObject({ issueId: id, idempotencyKey }),
|
|
80
|
+
output: z.strictObject({ deleted: z.literal(true) }),
|
|
81
|
+
});
|
|
82
|
+
export const addComment = func({
|
|
83
|
+
description: 'Add one Comment to a caller-owned Issue.',
|
|
84
|
+
auth: 'authenticated',
|
|
85
|
+
input: z.strictObject({ issueId: id, body: z.string().min(1).max(50_000), idempotencyKey }),
|
|
86
|
+
output: comment,
|
|
87
|
+
});
|
|
88
|
+
export const editComment = func({
|
|
89
|
+
description: 'Edit one Comment in a caller-owned Tracker.',
|
|
90
|
+
auth: 'authenticated',
|
|
91
|
+
input: z.strictObject({ commentId: id, body: z.string().min(1).max(50_000), idempotencyKey }),
|
|
92
|
+
output: comment,
|
|
93
|
+
});
|
|
94
|
+
export const deleteComment = func({
|
|
95
|
+
description: 'Delete one Comment in a caller-owned Tracker.',
|
|
96
|
+
auth: 'authenticated',
|
|
97
|
+
input: z.strictObject({ commentId: id, idempotencyKey }),
|
|
98
|
+
output: z.strictObject({ deleted: z.literal(true) }),
|
|
99
|
+
});
|
|
100
|
+
export const createTag = func({
|
|
101
|
+
description: 'Create one Tag in a caller-owned Tracker.',
|
|
102
|
+
auth: 'authenticated',
|
|
103
|
+
input: z.strictObject({
|
|
104
|
+
trackerId: id,
|
|
105
|
+
name: z.string().min(1).max(64),
|
|
106
|
+
color: z.string().optional(),
|
|
107
|
+
idempotencyKey,
|
|
108
|
+
}),
|
|
109
|
+
output: tag,
|
|
110
|
+
});
|
|
111
|
+
export const editTag = func({
|
|
112
|
+
description: 'Edit one Tag in a caller-owned Tracker.',
|
|
113
|
+
auth: 'authenticated',
|
|
114
|
+
input: z.strictObject({
|
|
115
|
+
tagId: id,
|
|
116
|
+
name: z.string().min(1).max(64).optional(),
|
|
117
|
+
color: z.string().optional(),
|
|
118
|
+
idempotencyKey,
|
|
119
|
+
}),
|
|
120
|
+
output: tag,
|
|
121
|
+
});
|
|
122
|
+
export const deleteTag = func({
|
|
123
|
+
description: 'Delete one Tag in a caller-owned Tracker.',
|
|
124
|
+
auth: 'authenticated',
|
|
125
|
+
input: z.strictObject({ tagId: id, idempotencyKey }),
|
|
126
|
+
output: z.strictObject({ deleted: z.literal(true) }),
|
|
127
|
+
});
|
|
128
|
+
export const changeIssueTag = func({
|
|
129
|
+
description: 'Add or remove a Tracker-local Tag on an Issue.',
|
|
130
|
+
auth: 'authenticated',
|
|
131
|
+
input: z.strictObject({
|
|
132
|
+
issueId: id,
|
|
133
|
+
tagId: id,
|
|
134
|
+
change: z.enum(['add', 'remove']),
|
|
135
|
+
idempotencyKey,
|
|
136
|
+
}),
|
|
137
|
+
output: z.strictObject({ issueId: id, changed: z.boolean() }),
|
|
138
|
+
});
|
|
139
|
+
export const relateIssue = func({
|
|
140
|
+
description: 'Add or remove one relation between caller-owned Issues.',
|
|
141
|
+
auth: 'authenticated',
|
|
142
|
+
input: z.strictObject({
|
|
143
|
+
issueId: id,
|
|
144
|
+
targetId: id,
|
|
145
|
+
relation: z.enum(['blocks', 'duplicates', 'relates_to', 'subtask_of']),
|
|
146
|
+
change: z.enum(['add', 'remove']),
|
|
147
|
+
idempotencyKey,
|
|
148
|
+
}),
|
|
149
|
+
output: z.strictObject({ issueId: id, changed: z.boolean() }),
|
|
150
|
+
});
|
|
151
|
+
export const exportTracker = func({
|
|
152
|
+
description: 'Export the current visible Issue snapshot for one Tracker.',
|
|
153
|
+
auth: 'authenticated',
|
|
154
|
+
input: z.strictObject({ trackerId: id }),
|
|
155
|
+
output: z.strictObject({ issues: z.array(issue) }),
|
|
156
|
+
});
|