@cellaware/utils 8.8.4 → 8.9.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.
@@ -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;
@@ -13,6 +13,9 @@ export declare const CHATWMS_DEFAULT_LANGUAGE: string;
13
13
  export type ChatWMSTheme = 'light' | 'dark';
14
14
  export declare const CHATWMS_THEME_LIGHT: ChatWMSTheme;
15
15
  export declare const CHATWMS_THEME_DARK: ChatWMSTheme;
16
+ export type ChatWMSAnalystOption = 'conversational' | 'direct';
17
+ export declare const CHATWMS_ANALYST_OPTION_CONVERSATIONAL: ChatWMSAnalystOption;
18
+ export declare const CHATWMS_ANALYST_OPTION_DIRECT: ChatWMSAnalystOption;
16
19
  export type ChatWMSDateFormat = 'MMDDYYYY' | 'DDMMYYYY' | 'YYYYMMDD';
17
20
  export declare const CHATWMS_DEFAULT_DATE_FORMAT: ChatWMSDateFormat;
18
21
  export interface ChatWMSUserSettings {
@@ -20,6 +23,7 @@ export interface ChatWMSUserSettings {
20
23
  userDetails: string;
21
24
  language: string;
22
25
  theme: ChatWMSTheme;
26
+ analystOption?: ChatWMSAnalystOption;
23
27
  developer?: boolean;
24
28
  dateFormat?: ChatWMSDateFormat;
25
29
  clientId: string;
@@ -28,6 +28,8 @@ export function chatwmsExtractUserDataFromHeaders(request) {
28
28
  export const CHATWMS_DEFAULT_LANGUAGE = 'English';
29
29
  export const CHATWMS_THEME_LIGHT = 'light';
30
30
  export const CHATWMS_THEME_DARK = 'dark';
31
+ export const CHATWMS_ANALYST_OPTION_CONVERSATIONAL = 'conversational';
32
+ export const CHATWMS_ANALYST_OPTION_DIRECT = 'direct';
31
33
  export const CHATWMS_DEFAULT_DATE_FORMAT = 'MMDDYYYY';
32
34
  export function chatwmsInitUserSettings() {
33
35
  return {
@@ -1,3 +1,3 @@
1
- import { ModelName } from "./model";
1
+ import { ModelName } from "./model.js";
2
2
  export declare function getLLMCostPerToken(modelName: ModelName): any;
3
3
  export declare function getLLMTransactionCost(tokenUsage: any, modelName: ModelName): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "8.8.4",
3
+ "version": "8.9.0",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",