@cellaware/utils 8.7.7 → 8.7.9
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.
package/dist/chatwms/cosmos.js
CHANGED
|
@@ -6,7 +6,7 @@ const COSMOS_SQL_ACTION_WORDS_REGEX = /\b(insert|update|delete|create|alter|drop
|
|
|
6
6
|
const COSMOS_SQL_SELECT_REGEX = /\b(select)\b/gmi;
|
|
7
7
|
const COSMOS_SQL_FROM_REGEX = /\b(from)\b/gmi;
|
|
8
8
|
const COSMOS_SQL_WHERE_REGEX = /\b(where)\b/gmi;
|
|
9
|
-
const COSMOS_SQL_APPROVED_TABLES_REGEX = /\b(alert_executions|alert_subscriptions|alerts|client_configs|conversation_details|conversation_feedback|conversation_headers|conversation_metadata|conversation_removed_details|conversation_sampled_details|conversation_sampled_metadata|dashboard_usage|dashboard_widgets|dashboards|errors_temp|notifications|notifications_poll|report_lines|report_schedules|report_usage|reports|subscription_integrations|user_roles)\b/gmi;
|
|
9
|
+
const COSMOS_SQL_APPROVED_TABLES_REGEX = /\b(active_users|alert_executions|alert_subscriptions|alerts|client_configs|conversation_details|conversation_feedback|conversation_headers|conversation_metadata|conversation_removed_details|conversation_sampled_details|conversation_sampled_metadata|dashboard_usage|dashboard_widgets|dashboards|errors_temp|notifications|notifications_poll|report_lines|report_schedules|report_usage|reports|subscription_integrations|user_roles)\b/gmi;
|
|
10
10
|
const _SUBQUERY_QUERY_PLACEHOLDER_UNWRAPPED = '{{query}}';
|
|
11
11
|
const SUBQUERY_QUERY_PLACEHOLDER = `(${_SUBQUERY_QUERY_PLACEHOLDER_UNWRAPPED})`;
|
|
12
12
|
const VARIABLE_COSMOS_USER_ID = '__USER_ID__';
|
|
@@ -60,6 +60,10 @@ const COSMOS_DATE_VARIABLES = [
|
|
|
60
60
|
{ key: VARIABLE_COSMOS_CURRENT_YEAR_CLAUSE, value: 'DateTimePart("year", TimestampToDateTime(c._ts * 1000)) = DateTimePart("year", GetCurrentDateTime())' }
|
|
61
61
|
];
|
|
62
62
|
const COSMOS_TABLES = [
|
|
63
|
+
{
|
|
64
|
+
table_name: 'active_users',
|
|
65
|
+
table_description: 'Active Users'
|
|
66
|
+
},
|
|
63
67
|
{
|
|
64
68
|
table_name: 'alert_executions',
|
|
65
69
|
table_description: 'Alert Executions'
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* **Note:** will throw message 'An error occurred. Please try again in a moment.' if none provided.
|
|
5
5
|
*/
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function assertResponseOk(res: Response, message?: string): Response;
|
|
7
7
|
export interface ChatWMSResponse {
|
|
8
8
|
ok: boolean;
|
|
9
9
|
error: string;
|
package/dist/chatwms/response.js
CHANGED
|
@@ -4,7 +4,7 @@ const RESPONSE_ERROR_MESSAGE = 'An error occurred. Please try again in a moment.
|
|
|
4
4
|
*
|
|
5
5
|
* **Note:** will throw message 'An error occurred. Please try again in a moment.' if none provided.
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
7
|
+
export function assertResponseOk(res, message) {
|
|
8
8
|
if (!res.ok) {
|
|
9
9
|
throw new Error(message ?? RESPONSE_ERROR_MESSAGE);
|
|
10
10
|
}
|