@medicine-wheel/app 0.15.4 → 0.15.5
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/app/api/ceremonies/route.ts +20 -1
- package/package.json +25 -25
|
@@ -16,6 +16,7 @@ export async function GET(request: Request) {
|
|
|
16
16
|
const episodePath = searchParams.get("episode_path");
|
|
17
17
|
const circleId = searchParams.get("circle_id");
|
|
18
18
|
const closes = searchParams.get("closes");
|
|
19
|
+
const subjectId = searchParams.get("subject_id");
|
|
19
20
|
|
|
20
21
|
const limit = parseLimit(searchParams.get("limit"));
|
|
21
22
|
if (limit instanceof NextResponse) return limit;
|
|
@@ -57,6 +58,11 @@ export async function GET(request: Request) {
|
|
|
57
58
|
ceremonies = ceremonies.filter((c) => c.closes === closes);
|
|
58
59
|
}
|
|
59
60
|
|
|
61
|
+
// `?subject_id=<node id>` answers "which ceremonies gathered around this node" (#146).
|
|
62
|
+
if (subjectId) {
|
|
63
|
+
ceremonies = ceremonies.filter((c) => c.subject_id === subjectId);
|
|
64
|
+
}
|
|
65
|
+
|
|
60
66
|
const matched = ceremonies.length;
|
|
61
67
|
if (limit !== null && ceremonies.length > limit) {
|
|
62
68
|
ceremonies = ceremonies.slice(0, limit);
|
|
@@ -69,7 +75,7 @@ export async function GET(request: Request) {
|
|
|
69
75
|
// `total` is the whole store, `matched` what the filters selected. When
|
|
70
76
|
// count < matched the caller holds a page and can now see that it does.
|
|
71
77
|
total,
|
|
72
|
-
...(direction || type || episodePath || circleId || closes ? { matched } : {}),
|
|
78
|
+
...(direction || type || episodePath || circleId || closes || subjectId ? { matched } : {}),
|
|
73
79
|
truncated: ceremonies.length < matched,
|
|
74
80
|
});
|
|
75
81
|
} catch (error: unknown) {
|
|
@@ -123,6 +129,18 @@ export async function POST(request: Request) {
|
|
|
123
129
|
}
|
|
124
130
|
}
|
|
125
131
|
|
|
132
|
+
if (body.subject_id !== undefined) {
|
|
133
|
+
if (typeof body.subject_id !== "string" || !body.subject_id) {
|
|
134
|
+
return NextResponse.json({ error: "subject_id must be a node id" }, { status: 400 });
|
|
135
|
+
}
|
|
136
|
+
if (!(await store.getNode(body.subject_id))) {
|
|
137
|
+
return NextResponse.json(
|
|
138
|
+
{ error: `Cannot hold a ceremony about a node that does not exist: ${body.subject_id}`, hint: "Create the node first on /nodes." },
|
|
139
|
+
{ status: 404 },
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
126
144
|
const ceremony = {
|
|
127
145
|
id: body.id || crypto.randomUUID(),
|
|
128
146
|
type: body.type,
|
|
@@ -138,6 +156,7 @@ export async function POST(request: Request) {
|
|
|
138
156
|
...(typeof body.source === "string" && body.source ? { source: body.source } : {}),
|
|
139
157
|
...(typeof body.closes === "string" ? { closes: body.closes } : {}),
|
|
140
158
|
...(typeof body.circle_id === "string" ? { circle_id: body.circle_id } : {}),
|
|
159
|
+
...(typeof body.subject_id === "string" ? { subject_id: body.subject_id } : {}),
|
|
141
160
|
};
|
|
142
161
|
|
|
143
162
|
await store.logCeremony(ceremony);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medicine-wheel/app",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.5",
|
|
4
4
|
"description": "Medicine Wheel — Interactive visual layer for Indigenous relational research with Four Directions, ceremonies, and narrative arcs",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mw": "dist/cli/mw.js",
|
|
@@ -89,30 +89,30 @@
|
|
|
89
89
|
"release:major": "npm run version:major && npm run publish:all && npm run release:commit"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@medicine-wheel/ceremonial-diary": "^0.15.
|
|
93
|
-
"@medicine-wheel/ceremony-protocol": "^0.15.
|
|
94
|
-
"@medicine-wheel/community-review": "^0.15.
|
|
95
|
-
"@medicine-wheel/consent-lifecycle": "^0.15.
|
|
96
|
-
"@medicine-wheel/creative-orientation": "^0.15.
|
|
97
|
-
"@medicine-wheel/data-store": "^0.15.
|
|
98
|
-
"@medicine-wheel/data-store-postgres": "^0.15.
|
|
99
|
-
"@medicine-wheel/fire-keeper": "^0.15.
|
|
100
|
-
"@medicine-wheel/github-ceremony": "^0.15.
|
|
101
|
-
"@medicine-wheel/graph-viz": "^0.15.
|
|
102
|
-
"@medicine-wheel/honcho": "^0.15.
|
|
103
|
-
"@medicine-wheel/importance-unit": "^0.15.
|
|
104
|
-
"@medicine-wheel/mcp": "^4.15.
|
|
105
|
-
"@medicine-wheel/narrative-cluster": "^0.15.
|
|
106
|
-
"@medicine-wheel/narrative-engine": "^0.15.
|
|
107
|
-
"@medicine-wheel/ontology-core": "^0.15.
|
|
108
|
-
"@medicine-wheel/perception-layer": "^0.15.
|
|
109
|
-
"@medicine-wheel/prompt-decomposition": "^0.15.
|
|
110
|
-
"@medicine-wheel/relational-index": "^0.15.
|
|
111
|
-
"@medicine-wheel/relational-query": "^0.15.
|
|
112
|
-
"@medicine-wheel/session-reader": "^0.15.
|
|
113
|
-
"@medicine-wheel/storage-provider": "^0.15.
|
|
114
|
-
"@medicine-wheel/transformation-tracker": "^0.15.
|
|
115
|
-
"@medicine-wheel/ui-components": "^0.15.
|
|
92
|
+
"@medicine-wheel/ceremonial-diary": "^0.15.5",
|
|
93
|
+
"@medicine-wheel/ceremony-protocol": "^0.15.5",
|
|
94
|
+
"@medicine-wheel/community-review": "^0.15.5",
|
|
95
|
+
"@medicine-wheel/consent-lifecycle": "^0.15.5",
|
|
96
|
+
"@medicine-wheel/creative-orientation": "^0.15.5",
|
|
97
|
+
"@medicine-wheel/data-store": "^0.15.5",
|
|
98
|
+
"@medicine-wheel/data-store-postgres": "^0.15.5",
|
|
99
|
+
"@medicine-wheel/fire-keeper": "^0.15.5",
|
|
100
|
+
"@medicine-wheel/github-ceremony": "^0.15.5",
|
|
101
|
+
"@medicine-wheel/graph-viz": "^0.15.5",
|
|
102
|
+
"@medicine-wheel/honcho": "^0.15.5",
|
|
103
|
+
"@medicine-wheel/importance-unit": "^0.15.5",
|
|
104
|
+
"@medicine-wheel/mcp": "^4.15.5",
|
|
105
|
+
"@medicine-wheel/narrative-cluster": "^0.15.5",
|
|
106
|
+
"@medicine-wheel/narrative-engine": "^0.15.5",
|
|
107
|
+
"@medicine-wheel/ontology-core": "^0.15.5",
|
|
108
|
+
"@medicine-wheel/perception-layer": "^0.15.5",
|
|
109
|
+
"@medicine-wheel/prompt-decomposition": "^0.15.5",
|
|
110
|
+
"@medicine-wheel/relational-index": "^0.15.5",
|
|
111
|
+
"@medicine-wheel/relational-query": "^0.15.5",
|
|
112
|
+
"@medicine-wheel/session-reader": "^0.15.5",
|
|
113
|
+
"@medicine-wheel/storage-provider": "^0.15.5",
|
|
114
|
+
"@medicine-wheel/transformation-tracker": "^0.15.5",
|
|
115
|
+
"@medicine-wheel/ui-components": "^0.15.5",
|
|
116
116
|
"@neondatabase/serverless": "^0.10.0",
|
|
117
117
|
"@xyflow/react": "^12.3.0",
|
|
118
118
|
"clsx": "^2.1.1",
|