@sequenceholdings/orm 2.7.1 → 2.8.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 +18 -4
- package/dist/authoring.cjs +21 -0
- package/dist/authoring.cjs.map +1 -1
- package/dist/authoring.d.cts +1 -1
- package/dist/authoring.d.ts +1 -1
- package/dist/authoring.js +21 -0
- package/dist/authoring.js.map +1 -1
- package/dist/canonical.d.cts +71 -71
- package/dist/canonical.d.ts +71 -71
- package/dist/cli.cjs +3460 -3337
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +13 -1
- package/dist/cli.d.ts +13 -1
- package/dist/cli.js +3459 -3338
- package/dist/cli.js.map +1 -1
- package/dist/client.cjs +24 -6
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +12 -3
- package/dist/client.d.ts +12 -3
- package/dist/client.js +24 -6
- package/dist/client.js.map +1 -1
- package/dist/compiler.cjs +844 -15
- package/dist/compiler.cjs.map +1 -1
- package/dist/compiler.d.cts +12 -2
- package/dist/compiler.d.ts +12 -2
- package/dist/compiler.js +844 -17
- package/dist/compiler.js.map +1 -1
- package/dist/index.cjs +21 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -57
- package/dist/index.d.ts +57 -57
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/dist/ir.d.cts +72 -72
- package/dist/ir.d.ts +72 -72
- package/dist/sdl.cjs +3 -3
- package/dist/sdl.cjs.map +1 -1
- package/dist/sdl.d.cts +2 -0
- package/dist/sdl.d.ts +2 -0
- package/dist/sdl.js +3 -3
- package/dist/sdl.js.map +1 -1
- package/package.json +1 -1
- package/templates/orm-namespace/graphql/example/queries.ts +52 -5
- package/templates/orm-namespace/schema/tables.ts +5 -2
- package/templates/orm-namespace/sequence.config.ts +6 -4
- package/dist/{definition-DjfC7Lll.d.cts → definition-B99BsOAO.d.cts} +4 -4
- package/dist/{definition-DjfC7Lll.d.ts → definition-B99BsOAO.d.ts} +4 -4
package/dist/sdl.d.cts
CHANGED
|
@@ -20,6 +20,8 @@ declare class SdlGenerationError extends Error {
|
|
|
20
20
|
constructor(message: string);
|
|
21
21
|
}
|
|
22
22
|
interface GenerateSdlOptions {
|
|
23
|
+
/** Expose keyed synced relations as read roots for synthesized defaults. */
|
|
24
|
+
includeSyncedReads?: boolean;
|
|
23
25
|
/**
|
|
24
26
|
* Server-pinned columns per table (computed by the compiler from write
|
|
25
27
|
* policies — a column referenced via claim comparison, e.g.
|
package/dist/sdl.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ declare class SdlGenerationError extends Error {
|
|
|
20
20
|
constructor(message: string);
|
|
21
21
|
}
|
|
22
22
|
interface GenerateSdlOptions {
|
|
23
|
+
/** Expose keyed synced relations as read roots for synthesized defaults. */
|
|
24
|
+
includeSyncedReads?: boolean;
|
|
23
25
|
/**
|
|
24
26
|
* Server-pinned columns per table (computed by the compiler from write
|
|
25
27
|
* policies — a column referenced via claim comparison, e.g.
|
package/dist/sdl.js
CHANGED
|
@@ -1800,7 +1800,7 @@ var PLATFORM_USER_FIELDS = [
|
|
|
1800
1800
|
];
|
|
1801
1801
|
function generateSdl(canonical, options = {}) {
|
|
1802
1802
|
const def = composeNamespace(normalizeCanonical(canonicalDefinitionSchema.parse(canonical))).definition;
|
|
1803
|
-
const exposed = canonicalRelations(def).filter((table) => table.source === void 0 && table.
|
|
1803
|
+
const exposed = canonicalRelations(def).filter((table) => table.internal !== true && (table.source === void 0 || options.includeSyncedReads === true && (table.primaryKey?.length ?? 0) > 0));
|
|
1804
1804
|
const cellsByTable = new Map(exposed.map((table) => [table.table, trackedCells(table)]));
|
|
1805
1805
|
const tables = exposed.map((table) => ({ ...table, columns: table.columns.filter((column) => column.cell === void 0) }));
|
|
1806
1806
|
if (tables.length === 0) {
|
|
@@ -2110,10 +2110,10 @@ function renderResolvedMutationFields(table, names) {
|
|
|
2110
2110
|
return lines;
|
|
2111
2111
|
}
|
|
2112
2112
|
function allowsInsert(table) {
|
|
2113
|
-
return table.policies.write !== void 0 || table.policies.insert !== void 0;
|
|
2113
|
+
return table.source === void 0 && (table.policies.write !== void 0 || table.policies.insert !== void 0);
|
|
2114
2114
|
}
|
|
2115
2115
|
function allowsUpdate(table) {
|
|
2116
|
-
return table.policies.write !== void 0 || table.policies.update !== void 0;
|
|
2116
|
+
return table.source === void 0 && (table.policies.write !== void 0 || table.policies.update !== void 0);
|
|
2117
2117
|
}
|
|
2118
2118
|
function allowsOnConflict(table) {
|
|
2119
2119
|
if (!allowsInsert(table) || !allowsUpdate(table)) return false;
|