@medicine-wheel/storage-provider 0.16.0 → 0.17.0
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/dist/interface.d.ts +1 -0
- package/dist/jsonl.js +2 -0
- package/dist/neon.js +9 -4
- package/package.json +2 -2
package/dist/interface.d.ts
CHANGED
package/dist/jsonl.js
CHANGED
|
@@ -158,6 +158,7 @@ export class JsonlProvider {
|
|
|
158
158
|
? { ceremony_honored: patch.ceremony_honored }
|
|
159
159
|
: {}),
|
|
160
160
|
...(patch.obligations !== undefined ? { obligations: patch.obligations } : {}),
|
|
161
|
+
...(patch.description !== undefined ? { description: patch.description } : {}),
|
|
161
162
|
};
|
|
162
163
|
edges[index] = next;
|
|
163
164
|
writeJsonl(this.edgesFile, edges);
|
|
@@ -346,6 +347,7 @@ export class JsonlProvider {
|
|
|
346
347
|
ceremony_honored: Boolean(edge.ceremony_honored),
|
|
347
348
|
last_ceremony: edge.last_ceremony ?? edge.ceremony_id,
|
|
348
349
|
obligations: Array.isArray(edge.obligations) ? edge.obligations : [],
|
|
350
|
+
...(typeof edge.description === 'string' && edge.description ? { description: edge.description } : {}),
|
|
349
351
|
created_at: edge.created_at,
|
|
350
352
|
};
|
|
351
353
|
}
|
package/dist/neon.js
CHANGED
|
@@ -122,15 +122,17 @@ export class NeonProvider {
|
|
|
122
122
|
// ── Edge Operations ──
|
|
123
123
|
async createEdge(edge) {
|
|
124
124
|
await this.db `
|
|
125
|
-
INSERT INTO edges (from_id, to_id, relationship_type, strength, ceremony_honored, last_ceremony, obligations, created_at)
|
|
125
|
+
INSERT INTO edges (from_id, to_id, relationship_type, strength, ceremony_honored, last_ceremony, obligations, description, created_at)
|
|
126
126
|
VALUES (${edge.from_id}, ${edge.to_id}, ${edge.relationship_type}, ${edge.strength},
|
|
127
|
-
${edge.ceremony_honored}, ${edge.last_ceremony || null}, ${JSON.stringify(edge.obligations)},
|
|
127
|
+
${edge.ceremony_honored}, ${edge.last_ceremony || null}, ${JSON.stringify(edge.obligations)},
|
|
128
|
+
${edge.description || null}, ${edge.created_at})
|
|
128
129
|
ON CONFLICT (from_id, to_id) DO UPDATE SET
|
|
129
130
|
relationship_type = EXCLUDED.relationship_type,
|
|
130
131
|
strength = EXCLUDED.strength,
|
|
131
132
|
ceremony_honored = EXCLUDED.ceremony_honored,
|
|
132
133
|
last_ceremony = EXCLUDED.last_ceremony,
|
|
133
|
-
obligations = EXCLUDED.obligations
|
|
134
|
+
obligations = EXCLUDED.obligations,
|
|
135
|
+
description = EXCLUDED.description
|
|
134
136
|
`;
|
|
135
137
|
}
|
|
136
138
|
async getEdge(fromId, toId) {
|
|
@@ -180,13 +182,15 @@ export class NeonProvider {
|
|
|
180
182
|
? { ceremony_honored: patch.ceremony_honored }
|
|
181
183
|
: {}),
|
|
182
184
|
...(patch.obligations !== undefined ? { obligations: patch.obligations } : {}),
|
|
185
|
+
...(patch.description !== undefined ? { description: patch.description } : {}),
|
|
183
186
|
};
|
|
184
187
|
await this.db `
|
|
185
188
|
UPDATE edges SET
|
|
186
189
|
relationship_type = ${next.relationship_type},
|
|
187
190
|
strength = ${next.strength},
|
|
188
191
|
ceremony_honored = ${next.ceremony_honored},
|
|
189
|
-
obligations = ${JSON.stringify(next.obligations)}
|
|
192
|
+
obligations = ${JSON.stringify(next.obligations)},
|
|
193
|
+
description = ${next.description || null}
|
|
190
194
|
WHERE from_id = ${fromId} AND to_id = ${toId}
|
|
191
195
|
`;
|
|
192
196
|
return next;
|
|
@@ -208,6 +212,7 @@ export class NeonProvider {
|
|
|
208
212
|
ceremony_honored: row.ceremony_honored,
|
|
209
213
|
last_ceremony: row.last_ceremony || undefined,
|
|
210
214
|
obligations: parseJsonValue(row.obligations, []),
|
|
215
|
+
...(typeof row.description === 'string' && row.description ? { description: row.description } : {}),
|
|
211
216
|
created_at: toIsoString(row.created_at),
|
|
212
217
|
};
|
|
213
218
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medicine-wheel/storage-provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@neondatabase/serverless": "^0.10.0",
|
|
18
18
|
"@upstash/redis": "^1.34.3",
|
|
19
|
-
"@medicine-wheel/ontology-core": "^0.
|
|
19
|
+
"@medicine-wheel/ontology-core": "^0.17.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"typescript": "^5.7.0"
|