@cellaware/utils 5.3.5 → 5.4.0

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.
@@ -15,3 +15,7 @@ export declare function chatwmsCosmosDelete(collectionId: string, query: string,
15
15
  * Default `partitionKey` is '/clientId'
16
16
  */
17
17
  export declare function chatwmsCosmosUpdate(collectionId: string, query: string, data: any, partitionKey?: string): Promise<boolean>;
18
+ /**
19
+ * Default `partitionKey` is '/clientId'
20
+ */
21
+ export declare function chatwmsCosmosUpsert(collectionId: string, query: string, data: any, partitionKey?: string): Promise<boolean>;
@@ -1,4 +1,4 @@
1
- import { cosmosDelete, cosmosInsert, cosmosSelect, cosmosUpdate } from "../../azure/cosmos.js";
1
+ import { cosmosDelete, cosmosInsert, cosmosSelect, cosmosUpdate, cosmosUpsert } from "../../azure/cosmos.js";
2
2
  const DATABASE_ID = 'chatwms';
3
3
  const PARTITION_KEY = '/clientId';
4
4
  export const PRODUCT_PARTITION_KEY = '/productId';
@@ -26,3 +26,9 @@ export async function chatwmsCosmosDelete(collectionId, query, partitionKey) {
26
26
  export async function chatwmsCosmosUpdate(collectionId, query, data, partitionKey) {
27
27
  return cosmosUpdate(DATABASE_ID, collectionId, partitionKey ?? PARTITION_KEY, query, data);
28
28
  }
29
+ /**
30
+ * Default `partitionKey` is '/clientId'
31
+ */
32
+ export async function chatwmsCosmosUpsert(collectionId, query, data, partitionKey) {
33
+ return cosmosUpsert(DATABASE_ID, collectionId, partitionKey ?? PARTITION_KEY, query, data);
34
+ }
@@ -21,10 +21,10 @@ export interface ChatWMSProduct extends ChatWMSProductBase {
21
21
  tables: ChatWMSProductTable[];
22
22
  notes: ChatWMSProductNote[];
23
23
  examples: ChatWMSProductExample[];
24
- columnDescriptions: any;
25
- columnComments: any;
26
- tableMappings: any;
27
- columnMappings: any;
24
+ columnDescriptions: ChatWMSProductColumnDescription[];
25
+ columnComments: ChatWMSProductColumnComment[];
26
+ tableMappings: ChatWMSProductTableMapping[];
27
+ columnMappings: ChatWMSProductColumnMapping[];
28
28
  analysis: any[];
29
29
  }
30
30
  export declare function initChatWMSProduct(): ChatWMSProduct;
@@ -49,3 +49,21 @@ export interface ChatWMSProductExample {
49
49
  specification: string;
50
50
  query: string;
51
51
  }
52
+ export interface ChatWMSProductColumnDescription {
53
+ columnName: string;
54
+ description: string;
55
+ }
56
+ export interface ChatWMSProductColumnComment {
57
+ columnName: string;
58
+ tableName?: string;
59
+ description: string;
60
+ }
61
+ export interface ChatWMSProductTableMapping {
62
+ dstTableName: string;
63
+ srcTableName: string;
64
+ }
65
+ export interface ChatWMSProductColumnMapping {
66
+ dstTableName: string;
67
+ dstColumnName: string;
68
+ srcColumnName: string;
69
+ }
@@ -34,10 +34,10 @@ export function initChatWMSProduct() {
34
34
  tables: [],
35
35
  notes: [],
36
36
  examples: [],
37
- columnDescriptions: {},
38
- columnComments: {},
39
- tableMappings: {},
40
- columnMappings: {},
37
+ columnDescriptions: [],
38
+ columnComments: [],
39
+ tableMappings: [],
40
+ columnMappings: [],
41
41
  analysis: []
42
42
  };
43
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "5.3.5",
3
+ "version": "5.4.0",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",