@cellaware/utils 8.8.3 → 8.8.4
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/chatwms/cosmos.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { DatagridCondition } from "./datagrid.js";
|
|
2
2
|
import { SqlCacheContext } from "./developer.js";
|
|
3
|
+
export declare const COSMOS_SYSTEM_FIELDS: string[];
|
|
4
|
+
export declare function stripCosmosSystemFields(obj: any): any;
|
|
3
5
|
export interface CosmosVariable {
|
|
4
6
|
key: string;
|
|
5
7
|
value: any;
|
package/dist/chatwms/cosmos.js
CHANGED
|
@@ -2,6 +2,13 @@ import { getQueryMatches } from "../util.js";
|
|
|
2
2
|
import { chatwmsCosmosSelect } from "./azure/cosmos.js";
|
|
3
3
|
import { COSMOS_CONTEXT_NAME, chatwmsGetClientId } from "./client.js";
|
|
4
4
|
import { codifyCondition } from "./datagrid.js";
|
|
5
|
+
export const COSMOS_SYSTEM_FIELDS = ['id', '_rid', '_self', '_etag', '_attachments', '_ts'];
|
|
6
|
+
export function stripCosmosSystemFields(obj) {
|
|
7
|
+
for (const field of COSMOS_SYSTEM_FIELDS) {
|
|
8
|
+
delete obj[field];
|
|
9
|
+
}
|
|
10
|
+
return obj;
|
|
11
|
+
}
|
|
5
12
|
const COSMOS_SQL_ACTION_WORDS_REGEX = /\b(insert|update|delete|create|alter|drop|commit|rollback)\b/gmi;
|
|
6
13
|
const COSMOS_SQL_SELECT_REGEX = /\b(select)\b/gmi;
|
|
7
14
|
const COSMOS_SQL_FROM_REGEX = /\b(from)\b/gmi;
|