@cellaware/utils 8.8.4 → 8.8.5

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.
@@ -1,6 +1,8 @@
1
1
  export declare const CHATWMS_DATABASE_ID = "chatwms";
2
2
  export declare const CLIENT_PARTITION_KEY = "/clientId";
3
3
  export declare const PRODUCT_PARTITION_KEY = "/productId";
4
+ export declare const COSMOS_SYSTEM_FIELDS: string[];
5
+ export declare function stripCosmosSystemFields(obj: any): any;
4
6
  /**
5
7
  * Default `partitionKey` is '/clientId'
6
8
  */
@@ -4,6 +4,13 @@ const PARTITION_KEY = '/clientId';
4
4
  export const CHATWMS_DATABASE_ID = DATABASE_ID;
5
5
  export const CLIENT_PARTITION_KEY = PARTITION_KEY;
6
6
  export const PRODUCT_PARTITION_KEY = '/productId';
7
+ export const COSMOS_SYSTEM_FIELDS = ['id', '_rid', '_self', '_etag', '_attachments', '_ts'];
8
+ export function stripCosmosSystemFields(obj) {
9
+ for (const field of COSMOS_SYSTEM_FIELDS) {
10
+ delete obj[field];
11
+ }
12
+ return obj;
13
+ }
7
14
  /**
8
15
  * Default `partitionKey` is '/clientId'
9
16
  */
@@ -1,7 +1,5 @@
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;
5
3
  export interface CosmosVariable {
6
4
  key: string;
7
5
  value: any;
@@ -2,13 +2,6 @@ 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
- }
12
5
  const COSMOS_SQL_ACTION_WORDS_REGEX = /\b(insert|update|delete|create|alter|drop|commit|rollback)\b/gmi;
13
6
  const COSMOS_SQL_SELECT_REGEX = /\b(select)\b/gmi;
14
7
  const COSMOS_SQL_FROM_REGEX = /\b(from)\b/gmi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "8.8.4",
3
+ "version": "8.8.5",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",