@cellaware/utils 3.3.28 → 3.3.30

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,17 @@
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
+ export declare const PRODUCT_PARTITION_KEY = "/productId";
2
+ /**
3
+ * Default `partitionKey` is '/clientId'
4
+ */
5
+ export declare function chatwmsCosmosSelect(collectionId: string, query: string, partitionKey?: string): Promise<any[]>;
6
+ /**
7
+ * Default `partitionKey` is '/clientId'
8
+ */
9
+ export declare function chatwmsCosmosInsert(collectionId: string, data: any, partitionKey?: string): Promise<boolean>;
10
+ /**
11
+ * Default `partitionKey` is '/clientId'
12
+ */
13
+ export declare function chatwmsCosmosDelete(collectionId: string, query: string, partitionKey?: string): Promise<boolean>;
14
+ /**
15
+ * Default `partitionKey` is '/clientId'
16
+ */
17
+ export declare function chatwmsCosmosUpdate(collectionId: string, query: string, data: any, partitionKey?: string): Promise<boolean>;
@@ -1,15 +1,28 @@
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
+ export const PRODUCT_PARTITION_KEY = '/productId';
5
+ /**
6
+ * Default `partitionKey` is '/clientId'
7
+ */
8
+ export async function chatwmsCosmosSelect(collectionId, query, partitionKey) {
9
+ return cosmosSelect(DATABASE_ID, collectionId, partitionKey ?? PARTITION_KEY, query);
6
10
  }
7
- export async function chatwmsCosmosInsert(collectionId, data) {
8
- return cosmosInsert(DATABASE_ID, collectionId, PARTITION_KEY, data);
11
+ /**
12
+ * Default `partitionKey` is '/clientId'
13
+ */
14
+ export async function chatwmsCosmosInsert(collectionId, data, partitionKey) {
15
+ return cosmosInsert(DATABASE_ID, collectionId, partitionKey ?? PARTITION_KEY, data);
9
16
  }
10
- export async function chatwmsCosmosDelete(collectionId, query) {
11
- return cosmosDelete(DATABASE_ID, collectionId, PARTITION_KEY, query);
17
+ /**
18
+ * Default `partitionKey` is '/clientId'
19
+ */
20
+ export async function chatwmsCosmosDelete(collectionId, query, partitionKey) {
21
+ return cosmosDelete(DATABASE_ID, collectionId, partitionKey ?? PARTITION_KEY, query);
12
22
  }
13
- export async function chatwmsCosmosUpdate(collectionId, query, data) {
14
- return cosmosUpdate(DATABASE_ID, collectionId, PARTITION_KEY, query, data);
23
+ /**
24
+ * Default `partitionKey` is '/clientId'
25
+ */
26
+ export async function chatwmsCosmosUpdate(collectionId, query, data, partitionKey) {
27
+ return cosmosUpdate(DATABASE_ID, collectionId, partitionKey ?? PARTITION_KEY, query, data);
15
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "3.3.28",
3
+ "version": "3.3.30",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",