@nicia-ai/typegraph 0.28.0 → 0.28.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/dist/backend/postgres/index.cjs +55 -55
- package/dist/backend/postgres/index.js +3 -3
- package/dist/backend/sqlite/index.cjs +13 -13
- package/dist/backend/sqlite/index.js +3 -3
- package/dist/backend/sqlite/libsql.cjs +6 -6
- package/dist/backend/sqlite/libsql.js +3 -3
- package/dist/backend/sqlite/local.cjs +6 -6
- package/dist/backend/sqlite/local.js +3 -3
- package/dist/{chunk-X53YKGHR.js → chunk-5MTOKWDA.js} +3 -3
- package/dist/{chunk-X53YKGHR.js.map → chunk-5MTOKWDA.js.map} +1 -1
- package/dist/chunk-FFHW2JEK.cjs +55 -0
- package/dist/chunk-FFHW2JEK.cjs.map +1 -0
- package/dist/{chunk-33K3ZYFG.cjs → chunk-NMOE2ZEU.cjs} +44 -44
- package/dist/{chunk-33K3ZYFG.cjs.map → chunk-NMOE2ZEU.cjs.map} +1 -1
- package/dist/{chunk-2E4VTD2E.cjs → chunk-NYQFPGYP.cjs} +5 -5
- package/dist/{chunk-2E4VTD2E.cjs.map → chunk-NYQFPGYP.cjs.map} +1 -1
- package/dist/chunk-O57GYGYK.js +51 -0
- package/dist/chunk-O57GYGYK.js.map +1 -0
- package/dist/{chunk-UKG7XHZ3.js → chunk-PGU2XKMA.js} +3 -3
- package/dist/{chunk-UKG7XHZ3.js.map → chunk-PGU2XKMA.js.map} +1 -1
- package/dist/{chunk-DFHLG75V.js → chunk-TKM2WDT4.js} +3 -3
- package/dist/{chunk-DFHLG75V.js.map → chunk-TKM2WDT4.js.map} +1 -1
- package/dist/{chunk-ZGEMI7MJ.cjs → chunk-WZH2MKHW.cjs} +15 -15
- package/dist/{chunk-ZGEMI7MJ.cjs.map → chunk-WZH2MKHW.cjs.map} +1 -1
- package/dist/index.cjs +64 -64
- package/dist/index.js +3 -3
- package/dist/schema/index.cjs +26 -26
- package/dist/schema/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-5H3BAMTB.js +0 -32
- package/dist/chunk-5H3BAMTB.js.map +0 -1
- package/dist/chunk-IUIWCFG3.cjs +0 -36
- package/dist/chunk-IUIWCFG3.cjs.map +0 -1
package/dist/chunk-IUIWCFG3.cjs
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// src/schema/canonical.ts
|
|
4
|
-
function sortedReplacer(_key, value) {
|
|
5
|
-
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
6
|
-
const sorted = {};
|
|
7
|
-
for (const key of Object.keys(value).toSorted()) {
|
|
8
|
-
sorted[key] = value[key];
|
|
9
|
-
}
|
|
10
|
-
return sorted;
|
|
11
|
-
}
|
|
12
|
-
return value;
|
|
13
|
-
}
|
|
14
|
-
function canonicalEqual(a, b) {
|
|
15
|
-
return JSON.stringify(a, sortedReplacer) === JSON.stringify(b, sortedReplacer);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// src/utils/sql-errors.ts
|
|
19
|
-
var MISSING_TABLE_PATTERNS = [
|
|
20
|
-
"no such table",
|
|
21
|
-
// SQLite
|
|
22
|
-
"does not exist",
|
|
23
|
-
// PostgreSQL ("relation ... does not exist")
|
|
24
|
-
"SQLITE_ERROR"
|
|
25
|
-
// D1 / Durable Objects error code
|
|
26
|
-
];
|
|
27
|
-
function isMissingTableError(error) {
|
|
28
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
29
|
-
return MISSING_TABLE_PATTERNS.some((pattern) => message.includes(pattern));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
exports.canonicalEqual = canonicalEqual;
|
|
33
|
-
exports.isMissingTableError = isMissingTableError;
|
|
34
|
-
exports.sortedReplacer = sortedReplacer;
|
|
35
|
-
//# sourceMappingURL=chunk-IUIWCFG3.cjs.map
|
|
36
|
-
//# sourceMappingURL=chunk-IUIWCFG3.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schema/canonical.ts","../src/utils/sql-errors.ts"],"names":[],"mappings":";;;AAiBO,SAAS,cAAA,CAAe,MAAc,KAAA,EAAyB;AACpE,EAAA,IAAI,KAAA,KAAU,QAAQ,OAAO,KAAA,KAAU,YAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxE,IAAA,MAAM,SAAkC,EAAC;AACzC,IAAA,KAAA,MAAW,OAAO,MAAA,CAAO,IAAA,CAAK,KAAK,CAAA,CAAE,UAAS,EAAG;AAC/C,MAAA,MAAA,CAAO,GAAG,CAAA,GAAK,KAAA,CAAkC,GAAG,CAAA;AAAA,IACtD;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,KAAA;AACT;AAaO,SAAS,cAAA,CAAe,GAAY,CAAA,EAAqB;AAC9D,EAAA,OACE,IAAA,CAAK,UAAU,CAAA,EAAG,cAAc,MAAM,IAAA,CAAK,SAAA,CAAU,GAAG,cAAc,CAAA;AAE1E;;;ACjCA,IAAM,sBAAA,GAAyB;AAAA,EAC7B,eAAA;AAAA;AAAA,EACA,gBAAA;AAAA;AAAA,EACA;AAAA;AACF,CAAA;AAEO,SAAS,oBAAoB,KAAA,EAAyB;AAC3D,EAAA,MAAM,UAAU,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,OAAO,KAAK,CAAA;AACrE,EAAA,OAAO,uBAAuB,IAAA,CAAK,CAAC,YAAY,OAAA,CAAQ,QAAA,CAAS,OAAO,CAAC,CAAA;AAC3E","file":"chunk-IUIWCFG3.cjs","sourcesContent":["/**\n * Canonical-form helpers for deterministic schema serialization.\n *\n * Used by both content-hashing (`computeSchemaHash`) and structural diffing\n * (`computeSchemaDiff`) to ensure that semantically-equivalent objects with\n * differently-ordered keys produce identical canonical strings.\n */\n\n/**\n * `JSON.stringify` replacer that sorts object keys recursively.\n *\n * Apply via `JSON.stringify(value, sortedReplacer)` to obtain output in\n * which sibling keys at every depth appear in lexicographic order.\n *\n * Arrays are passed through unchanged — array order is semantically\n * meaningful and must not be normalized.\n */\nexport function sortedReplacer(_key: string, value: unknown): unknown {\n if (value !== null && typeof value === \"object\" && !Array.isArray(value)) {\n const sorted: Record<string, unknown> = {};\n for (const key of Object.keys(value).toSorted()) {\n sorted[key] = (value as Record<string, unknown>)[key];\n }\n return sorted;\n }\n return value;\n}\n\n/**\n * Compare two values for canonical-form equality.\n *\n * Returns `true` when both values produce identical JSON under `sortedReplacer`\n * — i.e., they have the same JSON structure regardless of object key order.\n * Used by diff machinery to detect semantic changes in JSON-shaped fields.\n *\n * Note: callers must handle `undefined` themselves — `JSON.stringify(undefined)`\n * returns `undefined`, so two `undefined` inputs would compare equal here, which\n * may or may not be the desired semantics depending on context.\n */\nexport function canonicalEqual(a: unknown, b: unknown): boolean {\n return (\n JSON.stringify(a, sortedReplacer) === JSON.stringify(b, sortedReplacer)\n );\n}\n","/**\n * Cross-dialect detection of \"this relation does not exist yet\" errors.\n *\n * Shared so the schema bootstrap (`loadActiveSchemaWithBootstrap`) and\n * the durable contribution-materialization gate (#135) agree on what a\n * missing-table failure looks like, and — critically — so neither one\n * swallows a genuine system fault (connection/permission/driver error)\n * as a benign \"not bootstrapped yet\".\n */\n\nconst MISSING_TABLE_PATTERNS = [\n \"no such table\", // SQLite\n \"does not exist\", // PostgreSQL (\"relation ... does not exist\")\n \"SQLITE_ERROR\", // D1 / Durable Objects error code\n] as const;\n\nexport function isMissingTableError(error: unknown): boolean {\n const message = error instanceof Error ? error.message : String(error);\n return MISSING_TABLE_PATTERNS.some((pattern) => message.includes(pattern));\n}\n"]}
|