@sequenceholdings/orm 2.7.1 → 2.8.2

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/index.js CHANGED
@@ -315,6 +315,22 @@ function toPlatformUser(options) {
315
315
  function isSeqLink(value) {
316
316
  return typeof value === "object" && value !== null && value.kind === LINK_BRAND;
317
317
  }
318
+ var TABLE_CONFIG_KEYS = /* @__PURE__ */ new Set([
319
+ "displayName",
320
+ "description",
321
+ "renamedFrom",
322
+ "primaryKey",
323
+ "indexes",
324
+ "checks",
325
+ "foreignKeys",
326
+ "links",
327
+ "policies",
328
+ "cowMutations",
329
+ "cellMetadata",
330
+ "cellRevisions",
331
+ "materializes",
332
+ "internal"
333
+ ]);
318
334
  function isSeqTable(value) {
319
335
  return typeof value === "object" && value !== null && value.kind === TABLE_BRAND;
320
336
  }
@@ -329,6 +345,11 @@ function assertIdentifier({ value, what, file, pattern = IDENTIFIER_PATTERN }) {
329
345
  function defineTable(name2, columns, config = {}) {
330
346
  const file = activeAuthoringContext()?.currentFile;
331
347
  assertIdentifier({ value: name2, what: "table name", file });
348
+ for (const key of Object.keys(config)) {
349
+ if (!TABLE_CONFIG_KEYS.has(key)) {
350
+ throw new OrmDefinitionError(`table "${name2}": unknown defineTable option "${key}"`, file);
351
+ }
352
+ }
332
353
  const entries = Object.entries(columns);
333
354
  if (entries.length === 0) {
334
355
  throw new OrmDefinitionError(`table "${name2}" declares no columns`, file);