@medicine-wheel/app 0.15.5 → 0.15.6
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/[id]/route.ts +36 -0
- package/package.json +25 -25
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NextResponse } from "next/server";
|
|
2
2
|
import { createProvider, detectProvider } from "@medicine-wheel/storage-provider";
|
|
3
|
+
import { getAllBeats } from "@/lib/store";
|
|
3
4
|
|
|
4
5
|
type RouteContext = { params: Promise<{ id: string }> };
|
|
5
6
|
|
|
@@ -22,3 +23,38 @@ export async function GET(_request: Request, context: RouteContext) {
|
|
|
22
23
|
return NextResponse.json({ error: message }, { status: 500 });
|
|
23
24
|
}
|
|
24
25
|
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Remove one ceremony record (0.15.6, #146). A ceremony someone took part in is
|
|
29
|
+
* never removed: the wheel refuses (409) while a closing, a turn (a beat that
|
|
30
|
+
* names it) or a diary entry holds it, the way a node is refused while
|
|
31
|
+
* relations hold it. What remains removable is a record nobody entered, such
|
|
32
|
+
* as one a test run wrote to the wrong wheel.
|
|
33
|
+
*/
|
|
34
|
+
export async function DELETE(_request: Request, context: RouteContext) {
|
|
35
|
+
try {
|
|
36
|
+
const { id } = await context.params;
|
|
37
|
+
const store = await createProvider();
|
|
38
|
+
const ceremony = await store.getCeremony(id);
|
|
39
|
+
if (!ceremony) {
|
|
40
|
+
return NextResponse.json({ error: `Ceremony not found: ${id}` }, { status: 404 });
|
|
41
|
+
}
|
|
42
|
+
const closings = (await store.getAllCeremonies(Number.MAX_SAFE_INTEGER)).filter((c) => c.closes === id).length;
|
|
43
|
+
const turns = getAllBeats().filter((b) => Array.isArray(b.ceremonies) && b.ceremonies.includes(id)).length;
|
|
44
|
+
const diary = (await store.listDiaryEntries()).filter((e) => e.metadata?.ceremony_id === id).length;
|
|
45
|
+
if (closings + turns + diary > 0) {
|
|
46
|
+
return NextResponse.json(
|
|
47
|
+
{
|
|
48
|
+
error: `Ceremony ${id} is held by ${closings} closing(s), ${turns} turn(s) and ${diary} diary entr${diary === 1 ? "y" : "ies"} — nothing was removed.`,
|
|
49
|
+
holders: { closings, turns, diary },
|
|
50
|
+
},
|
|
51
|
+
{ status: 409 },
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
await store.deleteCeremony(id);
|
|
55
|
+
return NextResponse.json({ success: true, deleted: { id }, provider: detectProvider() });
|
|
56
|
+
} catch (error: unknown) {
|
|
57
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
58
|
+
return NextResponse.json({ error: message }, { status: 500 });
|
|
59
|
+
}
|
|
60
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medicine-wheel/app",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.6",
|
|
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.6",
|
|
93
|
+
"@medicine-wheel/ceremony-protocol": "^0.15.6",
|
|
94
|
+
"@medicine-wheel/community-review": "^0.15.6",
|
|
95
|
+
"@medicine-wheel/consent-lifecycle": "^0.15.6",
|
|
96
|
+
"@medicine-wheel/creative-orientation": "^0.15.6",
|
|
97
|
+
"@medicine-wheel/data-store": "^0.15.6",
|
|
98
|
+
"@medicine-wheel/data-store-postgres": "^0.15.6",
|
|
99
|
+
"@medicine-wheel/fire-keeper": "^0.15.6",
|
|
100
|
+
"@medicine-wheel/github-ceremony": "^0.15.6",
|
|
101
|
+
"@medicine-wheel/graph-viz": "^0.15.6",
|
|
102
|
+
"@medicine-wheel/honcho": "^0.15.6",
|
|
103
|
+
"@medicine-wheel/importance-unit": "^0.15.6",
|
|
104
|
+
"@medicine-wheel/mcp": "^4.15.6",
|
|
105
|
+
"@medicine-wheel/narrative-cluster": "^0.15.6",
|
|
106
|
+
"@medicine-wheel/narrative-engine": "^0.15.6",
|
|
107
|
+
"@medicine-wheel/ontology-core": "^0.15.6",
|
|
108
|
+
"@medicine-wheel/perception-layer": "^0.15.6",
|
|
109
|
+
"@medicine-wheel/prompt-decomposition": "^0.15.6",
|
|
110
|
+
"@medicine-wheel/relational-index": "^0.15.6",
|
|
111
|
+
"@medicine-wheel/relational-query": "^0.15.6",
|
|
112
|
+
"@medicine-wheel/session-reader": "^0.15.6",
|
|
113
|
+
"@medicine-wheel/storage-provider": "^0.15.6",
|
|
114
|
+
"@medicine-wheel/transformation-tracker": "^0.15.6",
|
|
115
|
+
"@medicine-wheel/ui-components": "^0.15.6",
|
|
116
116
|
"@neondatabase/serverless": "^0.10.0",
|
|
117
117
|
"@xyflow/react": "^12.3.0",
|
|
118
118
|
"clsx": "^2.1.1",
|