@cadenza.io/service 1.5.0 → 1.5.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/index.js CHANGED
@@ -2277,20 +2277,34 @@ var DatabaseController = class _DatabaseController {
2277
2277
  }
2278
2278
  for (const [tableName, table] of Object.entries(schema.tables)) {
2279
2279
  if (!table.fields || typeof table.fields !== "object") {
2280
+ console.log(tableName, "missing fields");
2280
2281
  throw new Error(`Invalid table ${tableName}: missing fields`);
2281
2282
  }
2282
2283
  for (const [fieldName, field] of Object.entries(table.fields)) {
2283
2284
  if (!fieldName.split("").every((c) => /[a-z_]/.test(c))) {
2285
+ console.log(tableName, "field not lowercase", fieldName);
2284
2286
  throw new Error(
2285
2287
  `Invalid field name ${fieldName} for ${tableName}. Field names must only contain lowercase alphanumeric characters and underscores`
2286
2288
  );
2287
2289
  }
2288
2290
  if (!Object.values(SCHEMA_TYPES).includes(field.type)) {
2291
+ console.log(
2292
+ tableName,
2293
+ "field invalid type",
2294
+ fieldName,
2295
+ field.type
2296
+ );
2289
2297
  throw new Error(
2290
2298
  `Invalid type ${field.type} for ${tableName}.${fieldName}`
2291
2299
  );
2292
2300
  }
2293
2301
  if (field.references && !field.references.match(/^[\w]+[(\w)]+$/)) {
2302
+ console.log(
2303
+ tableName,
2304
+ "invalid reference",
2305
+ fieldName,
2306
+ field.references
2307
+ );
2294
2308
  throw new Error(
2295
2309
  `Invalid reference ${field.references} for ${tableName}.${fieldName}`
2296
2310
  );
@@ -2300,11 +2314,23 @@ var DatabaseController = class _DatabaseController {
2300
2314
  const triggers = (_a2 = table.customSignals.triggers) == null ? void 0 : _a2[op];
2301
2315
  const emissions = (_b2 = table.customSignals.emissions) == null ? void 0 : _b2[op];
2302
2316
  if (triggers && !Array.isArray(triggers) && typeof triggers !== "object") {
2317
+ console.log(
2318
+ tableName,
2319
+ "invalid triggers",
2320
+ op,
2321
+ triggers
2322
+ );
2303
2323
  throw new Error(
2304
2324
  `Invalid triggers for ${tableName}.${op}`
2305
2325
  );
2306
2326
  }
2307
2327
  if (emissions && !Array.isArray(emissions) && typeof emissions !== "object") {
2328
+ console.log(
2329
+ tableName,
2330
+ "invalid emissions",
2331
+ op,
2332
+ emissions
2333
+ );
2308
2334
  throw new Error(
2309
2335
  `Invalid emissions for ${tableName}.${op}`
2310
2336
  );