@sequenceholdings/orm 2.6.2 → 2.7.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 +75 -1
- package/dist/authoring.cjs +9 -0
- package/dist/authoring.cjs.map +1 -1
- package/dist/authoring.d.cts +6 -0
- package/dist/authoring.d.ts +6 -0
- package/dist/authoring.js +9 -0
- package/dist/authoring.js.map +1 -1
- package/dist/cli.cjs +89 -29
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +89 -29
- package/dist/cli.js.map +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +4 -1
- package/dist/client.d.ts +4 -1
- package/dist/client.js.map +1 -1
- package/dist/compiler.cjs +68 -29
- package/dist/compiler.cjs.map +1 -1
- package/dist/compiler.js +68 -29
- package/dist/compiler.js.map +1 -1
- package/dist/index.cjs +82 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +81 -5
- package/dist/index.js.map +1 -1
- package/dist/ir.cjs +19 -3
- package/dist/ir.cjs.map +1 -1
- package/dist/ir.d.cts +13 -6
- package/dist/ir.d.ts +13 -6
- package/dist/ir.js +18 -4
- package/dist/ir.js.map +1 -1
- package/dist/predicate-v2.cjs +24 -2
- package/dist/predicate-v2.cjs.map +1 -1
- package/dist/predicate-v2.d.cts +4 -0
- package/dist/predicate-v2.d.ts +4 -0
- package/dist/predicate-v2.js +24 -2
- package/dist/predicate-v2.js.map +1 -1
- package/dist/sdl.cjs +16 -2
- package/dist/sdl.cjs.map +1 -1
- package/dist/sdl.js +16 -2
- package/dist/sdl.js.map +1 -1
- package/package.json +1 -1
- package/src/codegen-gql/preset.cjs +45 -8
- package/templates/orm-namespace/codegen.ts +5 -0
package/dist/authoring.d.cts
CHANGED
|
@@ -611,6 +611,12 @@ interface SyncedTableConfig {
|
|
|
611
611
|
/** Reflected read-only source as a safe qualified identifier: `<schema>.<table>`. */
|
|
612
612
|
source: string;
|
|
613
613
|
description?: string;
|
|
614
|
+
/**
|
|
615
|
+
* View dependency only: keep the reflected source and its read policy, but
|
|
616
|
+
* exclude direct GraphQL and SQL access. Requires a keyed source contract.
|
|
617
|
+
* Publish the permitted result through a managed view instead.
|
|
618
|
+
*/
|
|
619
|
+
internal?: boolean;
|
|
614
620
|
/**
|
|
615
621
|
* Primary-key property/column names, mutually exclusive with column-level
|
|
616
622
|
* `.primaryKey()`. Explicit `[]` declares a read-only bag with no row identity.
|
package/dist/authoring.d.ts
CHANGED
|
@@ -611,6 +611,12 @@ interface SyncedTableConfig {
|
|
|
611
611
|
/** Reflected read-only source as a safe qualified identifier: `<schema>.<table>`. */
|
|
612
612
|
source: string;
|
|
613
613
|
description?: string;
|
|
614
|
+
/**
|
|
615
|
+
* View dependency only: keep the reflected source and its read policy, but
|
|
616
|
+
* exclude direct GraphQL and SQL access. Requires a keyed source contract.
|
|
617
|
+
* Publish the permitted result through a managed view instead.
|
|
618
|
+
*/
|
|
619
|
+
internal?: boolean;
|
|
614
620
|
/**
|
|
615
621
|
* Primary-key property/column names, mutually exclusive with column-level
|
|
616
622
|
* `.primaryKey()`. Explicit `[]` declares a read-only bag with no row identity.
|
package/dist/authoring.js
CHANGED
|
@@ -384,6 +384,7 @@ function defineSyncedTable(name2, columnsOrConfig, maybeConfig) {
|
|
|
384
384
|
if (config.primaryKey !== void 0) tableConfig.primaryKey = config.primaryKey;
|
|
385
385
|
if (config.links !== void 0) tableConfig.links = config.links;
|
|
386
386
|
if (config.policies !== void 0) tableConfig.policies = { read: config.policies.read };
|
|
387
|
+
if (config.internal === true) tableConfig.internal = true;
|
|
387
388
|
const table = {
|
|
388
389
|
kind: TABLE_BRAND,
|
|
389
390
|
tableName: name2,
|
|
@@ -2745,6 +2746,11 @@ function serializeNamespace(input) {
|
|
|
2745
2746
|
enumsByName.set(ref.name, ref);
|
|
2746
2747
|
}
|
|
2747
2748
|
const canonicalTables = tables.map((table) => buildCanonicalTable({ table, relationsByName, enumsByName }));
|
|
2749
|
+
for (const table of tables) {
|
|
2750
|
+
if (table.source !== void 0 && table.config.internal === true && config.exports && Object.hasOwn(config.exports, table.tableName)) {
|
|
2751
|
+
throw new OrmDefinitionError(`internal synced source "${table.tableName}" cannot be exported; export a permitted managed view instead`, table.file);
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2748
2754
|
const canonicalEnums = [...enumsByName.values()].map((ref) => ({
|
|
2749
2755
|
name: ref.name,
|
|
2750
2756
|
values: [...ref.values]
|
|
@@ -3078,6 +3084,9 @@ function buildCanonicalLink({
|
|
|
3078
3084
|
if (!relationsByName.has(targetName)) {
|
|
3079
3085
|
return fail(`targets ${relationKind(target)} "${targetName}" which is not part of this namespace`);
|
|
3080
3086
|
}
|
|
3087
|
+
if (isSeqTable(target) && target.source !== void 0 && target.config.internal === true) {
|
|
3088
|
+
return fail(`targets internal synced source "${targetName}"; expose a permitted managed view instead`);
|
|
3089
|
+
}
|
|
3081
3090
|
if (link.enforce && (!isSeqTable(relation) || !isSeqTable(target))) {
|
|
3082
3091
|
return fail("cannot enforce a PostgreSQL foreign key involving a view");
|
|
3083
3092
|
}
|