@sequenceholdings/orm 2.7.0 → 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/dist/cli.cjs CHANGED
@@ -6289,6 +6289,11 @@ function serializeNamespace(input) {
6289
6289
  enumsByName.set(ref.name, ref);
6290
6290
  }
6291
6291
  const canonicalTables = tables.map((table) => buildCanonicalTable({ table, relationsByName, enumsByName }));
6292
+ for (const table of tables) {
6293
+ if (table.source !== void 0 && table.config.internal === true && config.exports && Object.hasOwn(config.exports, table.tableName)) {
6294
+ throw new OrmDefinitionError(`internal synced source "${table.tableName}" cannot be exported; export a permitted managed view instead`, table.file);
6295
+ }
6296
+ }
6292
6297
  const canonicalEnums = [...enumsByName.values()].map((ref) => ({
6293
6298
  name: ref.name,
6294
6299
  values: [...ref.values]
@@ -6622,6 +6627,9 @@ function buildCanonicalLink({
6622
6627
  if (!relationsByName.has(targetName)) {
6623
6628
  return fail4(`targets ${relationKind(target)} "${targetName}" which is not part of this namespace`);
6624
6629
  }
6630
+ if (isSeqTable(target) && target.source !== void 0 && target.config.internal === true) {
6631
+ return fail4(`targets internal synced source "${targetName}"; expose a permitted managed view instead`);
6632
+ }
6625
6633
  if (link.enforce && (!isSeqTable(relation) || !isSeqTable(target))) {
6626
6634
  return fail4("cannot enforce a PostgreSQL foreign key involving a view");
6627
6635
  }