@messaia/cdk 22.0.0-rc.10 → 22.0.0-rc.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.
package/fesm2022/messaia-cdk.mjs
CHANGED
|
@@ -14516,6 +14516,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
14516
14516
|
const parseProjectionString = (projection) => {
|
|
14517
14517
|
/* Handle array input: join and proceed to cleaning */
|
|
14518
14518
|
let input = Array.isArray(projection) ? projection.join(',') : projection;
|
|
14519
|
+
/* Normalize count-style pseudo field calls and preserve explicit aliases when provided */
|
|
14520
|
+
input = input
|
|
14521
|
+
.replace(/\b([a-zA-Z_][a-zA-Z0-9_]*)(?:\.|\$)(?:count|Count)\(\)\s*:\s*([a-zA-Z_][a-zA-Z0-9_]*)/g, '$1$count:$2')
|
|
14522
|
+
.replace(/\b([a-zA-Z_][a-zA-Z0-9_]*)(?:\.|\$)(?:count|Count)\(\)(?!\s*:)/g, '$1$count:$1Count');
|
|
14523
|
+
/* Normalize orderBy pseudo field calls into API projection field format */
|
|
14524
|
+
input = input.replace(/\b([a-zA-Z_][a-zA-Z0-9_]*)(?:\.|\$)orderBy\(([^)]*)\)/g, '$1$orderBy($2)');
|
|
14525
|
+
/* Normalize filter pseudo field calls into API projection field format */
|
|
14526
|
+
input = input.replace(/\b([a-zA-Z_][a-zA-Z0-9_]*)(?:\.|\$)filter\(([^)]*)\)/g, '$1$filter($2)');
|
|
14519
14527
|
/* If it's already a clean, flat, comma-separated string without braces, return it */
|
|
14520
14528
|
if (!input.includes('{') && !input.includes('}')) {
|
|
14521
14529
|
return input.replace(/\s+/g, '');
|
|
@@ -14530,6 +14538,7 @@ const parseProjectionString = (projection) => {
|
|
|
14530
14538
|
cleaned = cleaned.replace(/,\s*\)/g, ')');
|
|
14531
14539
|
/* Replace spaces between alphanumeric characters with commas and remove all remaining whitespace */
|
|
14532
14540
|
return cleaned
|
|
14541
|
+
.replace(/(\)\$[a-zA-Z_][a-zA-Z0-9_]*\([^)]*\))\s+([a-zA-Z0-9_])/g, '$1,$2')
|
|
14533
14542
|
.replace(/([a-zA-Z0-9])\s+([a-zA-Z0-9])/g, '$1,$2')
|
|
14534
14543
|
.replace(/\)([a-zA-Z_])/g, '),$1')
|
|
14535
14544
|
.replace(/\s+/g, '');
|