@cellaware/utils 3.3.27 → 3.3.29

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,4 +1,16 @@
1
- export declare function chatwmsCosmosSelect(collectionId: string, query: string): Promise<any[]>;
2
- export declare function chatwmsCosmosInsert(collectionId: string, data: any): Promise<boolean>;
3
- export declare function chatwmsCosmosDelete(collectionId: string, query: string): Promise<boolean>;
4
- export declare function chatwmsCosmosUpdate(collectionId: string, query: string, data: any): Promise<boolean>;
1
+ /**
2
+ * Default `partitionKey` is '/clientId'
3
+ */
4
+ export declare function chatwmsCosmosSelect(collectionId: string, query: string, partitionKey?: string): Promise<any[]>;
5
+ /**
6
+ * Default `partitionKey` is '/clientId'
7
+ */
8
+ export declare function chatwmsCosmosInsert(collectionId: string, data: any, partitionKey?: string): Promise<boolean>;
9
+ /**
10
+ * Default `partitionKey` is '/clientId'
11
+ */
12
+ export declare function chatwmsCosmosDelete(collectionId: string, query: string, partitionKey?: string): Promise<boolean>;
13
+ /**
14
+ * Default `partitionKey` is '/clientId'
15
+ */
16
+ export declare function chatwmsCosmosUpdate(collectionId: string, query: string, data: any, partitionKey?: string): Promise<boolean>;
@@ -1,15 +1,27 @@
1
1
  import { cosmosDelete, cosmosInsert, cosmosSelect, cosmosUpdate } from "../../azure/cosmos.js";
2
2
  const DATABASE_ID = 'chatwms';
3
3
  const PARTITION_KEY = '/clientId';
4
- export async function chatwmsCosmosSelect(collectionId, query) {
5
- return cosmosSelect(DATABASE_ID, collectionId, PARTITION_KEY, query);
4
+ /**
5
+ * Default `partitionKey` is '/clientId'
6
+ */
7
+ export async function chatwmsCosmosSelect(collectionId, query, partitionKey) {
8
+ return cosmosSelect(DATABASE_ID, collectionId, partitionKey ?? PARTITION_KEY, query);
6
9
  }
7
- export async function chatwmsCosmosInsert(collectionId, data) {
8
- return cosmosInsert(DATABASE_ID, collectionId, PARTITION_KEY, data);
10
+ /**
11
+ * Default `partitionKey` is '/clientId'
12
+ */
13
+ export async function chatwmsCosmosInsert(collectionId, data, partitionKey) {
14
+ return cosmosInsert(DATABASE_ID, collectionId, partitionKey ?? PARTITION_KEY, data);
9
15
  }
10
- export async function chatwmsCosmosDelete(collectionId, query) {
11
- return cosmosDelete(DATABASE_ID, collectionId, PARTITION_KEY, query);
16
+ /**
17
+ * Default `partitionKey` is '/clientId'
18
+ */
19
+ export async function chatwmsCosmosDelete(collectionId, query, partitionKey) {
20
+ return cosmosDelete(DATABASE_ID, collectionId, partitionKey ?? PARTITION_KEY, query);
12
21
  }
13
- export async function chatwmsCosmosUpdate(collectionId, query, data) {
14
- return cosmosUpdate(DATABASE_ID, collectionId, PARTITION_KEY, query, data);
22
+ /**
23
+ * Default `partitionKey` is '/clientId'
24
+ */
25
+ export async function chatwmsCosmosUpdate(collectionId, query, data, partitionKey) {
26
+ return cosmosUpdate(DATABASE_ID, collectionId, partitionKey ?? PARTITION_KEY, query, data);
15
27
  }
package/dist/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Extracts `version` from `package.json`.
3
3
  */
4
- export declare function getVersion(): any;
4
+ export declare function getVersion(): string;
package/dist/version.js CHANGED
@@ -8,5 +8,5 @@ export function getVersion() {
8
8
  throw new Error(`VERSION: '${path}' not found`);
9
9
  }
10
10
  const content = JSON.parse(fs.readFileSync(path, 'utf8'));
11
- return content.version;
11
+ return content.version ?? '';
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "3.3.27",
3
+ "version": "3.3.29",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",