@cadenza.io/service 2.17.11 → 2.17.12

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.
@@ -8314,6 +8314,19 @@ function normalizeArrayResponse(value, keys) {
8314
8314
  }
8315
8315
  return [];
8316
8316
  }
8317
+ function buildQueryResponseKeys(tableName) {
8318
+ const camelCased = tableName.replace(
8319
+ /_([a-z])/g,
8320
+ (_match, char) => char.toUpperCase()
8321
+ );
8322
+ return [
8323
+ `${tableName}Rows`,
8324
+ `${tableName}s`,
8325
+ tableName,
8326
+ `${camelCased}s`,
8327
+ camelCased
8328
+ ];
8329
+ }
8317
8330
  function normalizeIntentMap(raw) {
8318
8331
  const intentName = String(raw.intentName ?? raw.intent_name ?? "").trim();
8319
8332
  const serviceName = String(raw.serviceName ?? raw.service_name ?? "").trim();
@@ -8383,12 +8396,7 @@ function createSSRInquiryBridge(options = {}) {
8383
8396
  { queryData },
8384
8397
  timeoutMs
8385
8398
  );
8386
- return normalizeArrayResponse(response, [
8387
- `${tableName}Rows`,
8388
- `${tableName}s`,
8389
- tableName,
8390
- tableName.replace(/_([a-z])/g, (_match, char) => char.toUpperCase())
8391
- ]);
8399
+ return normalizeArrayResponse(response, buildQueryResponseKeys(tableName));
8392
8400
  };
8393
8401
  return {
8394
8402
  async inquire(inquiry, context = {}, inquiryOptions = {}) {