@cadenza.io/service 2.17.62 → 2.17.64

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
@@ -6587,6 +6587,7 @@ var SCHEMA_TYPES = [
6587
6587
  var import_pg = require("pg");
6588
6588
  var import_lodash_es = require("lodash-es");
6589
6589
  var AUTHORITY_SYNC_DEBUG_PREFIX = "[CADENZA_DB_TASK_DEBUG]";
6590
+ var AUTHORITY_SYNC_DEBUG_ENABLED = typeof process !== "undefined" && typeof process.env === "object" && process.env.CADENZA_DB_TASK_DEBUG === "true";
6590
6591
  var AUTHORITY_SYNC_DEBUG_TASK_NAMES = /* @__PURE__ */ new Set([
6591
6592
  "Query service_instance",
6592
6593
  "Query service_instance_transport",
@@ -6601,6 +6602,9 @@ var AUTHORITY_SYNC_DEBUG_TASK_NAMES = /* @__PURE__ */ new Set([
6601
6602
  ]);
6602
6603
  var AUTHORITY_SYNC_DEBUG_ROUTINE_NAMES = /* @__PURE__ */ new Set(["Sync services"]);
6603
6604
  function logAuthoritySyncDebug(event, payload) {
6605
+ if (!AUTHORITY_SYNC_DEBUG_ENABLED) {
6606
+ return;
6607
+ }
6604
6608
  console.log(`${AUTHORITY_SYNC_DEBUG_PREFIX} ${event}`, payload);
6605
6609
  }
6606
6610
  function resolveAuthoritySyncPayloadName(payload, tableName) {
@@ -6619,6 +6623,9 @@ function resolveAuthoritySyncPayloadName(payload, tableName) {
6619
6623
  return null;
6620
6624
  }
6621
6625
  function shouldDebugAuthoritySyncPayload(tableName, payload) {
6626
+ if (!AUTHORITY_SYNC_DEBUG_ENABLED) {
6627
+ return false;
6628
+ }
6622
6629
  if (tableName !== "task" && tableName !== "task_to_routine_map") {
6623
6630
  return false;
6624
6631
  }
@@ -8957,6 +8964,7 @@ var AUTHORITY_QUERY_RESULT_KEYS = {
8957
8964
  };
8958
8965
  var EARLY_SYNC_REQUEST_DELAYS_MS = [2e3, 1e4, 3e4];
8959
8966
  var SYNC_DEBUG_PREFIX = "[CADENZA_SYNC_DEBUG]";
8967
+ var SYNC_DEBUG_ENABLED = typeof process !== "undefined" && typeof process.env === "object" && process.env.CADENZA_SYNC_DEBUG === "true";
8960
8968
  var SYNC_DEBUG_TABLES = /* @__PURE__ */ new Set(["intent_to_task_map"]);
8961
8969
  var SYNC_DEBUG_TASK_NAMES = /* @__PURE__ */ new Set([
8962
8970
  "Query service_instance",
@@ -8992,16 +9000,16 @@ var SYNC_DEBUG_INTENT_NAMES = /* @__PURE__ */ new Set([
8992
9000
  "query-pg-cadenza-db-postgres-actor-signal_to_task_map"
8993
9001
  ]);
8994
9002
  function shouldDebugSyncTable(tableName) {
8995
- return SYNC_DEBUG_TABLES.has(tableName);
9003
+ return SYNC_DEBUG_ENABLED && SYNC_DEBUG_TABLES.has(tableName);
8996
9004
  }
8997
9005
  function shouldDebugSyncTaskName(taskName) {
8998
- return typeof taskName === "string" && SYNC_DEBUG_TASK_NAMES.has(taskName);
9006
+ return SYNC_DEBUG_ENABLED && typeof taskName === "string" && SYNC_DEBUG_TASK_NAMES.has(taskName);
8999
9007
  }
9000
9008
  function shouldDebugSyncRoutineName(routineName) {
9001
- return typeof routineName === "string" && SYNC_DEBUG_ROUTINE_NAMES.has(routineName);
9009
+ return SYNC_DEBUG_ENABLED && typeof routineName === "string" && SYNC_DEBUG_ROUTINE_NAMES.has(routineName);
9002
9010
  }
9003
9011
  function shouldDebugSyncIntentName(intentName) {
9004
- return typeof intentName === "string" && SYNC_DEBUG_INTENT_NAMES.has(intentName);
9012
+ return SYNC_DEBUG_ENABLED && typeof intentName === "string" && SYNC_DEBUG_INTENT_NAMES.has(intentName);
9005
9013
  }
9006
9014
  function summarizeSyncDebugValue(value, depth = 0) {
9007
9015
  if (value === null || value === void 0) {