@infomaximum/widget-sdk 6.0.0-8 → 6.0.0-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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [6.0.0-9](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-8...v6.0.0-9) (2025-09-12)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * исправлен баг с подстановкой значений в template строки ([12166b5](https://github.com/Infomaximum/widget-sdk/commit/12166b587b74e0ff912822b0d065463b8f23121e))
11
+
5
12
  ## [6.0.0-8](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-7...v6.0.0-8) (2025-09-11)
6
13
 
7
14
  ## [6.0.0-7](https://github.com/Infomaximum/widget-sdk/compare/v6.0.0-6...v6.0.0-7) (2025-09-10)
package/dist/index.d.ts CHANGED
@@ -1997,7 +1997,7 @@ declare const prepareMeasureAggregationParams: (value: Extract<IWidgetMeasure["v
1997
1997
  outerAggregation: EOuterAggregation;
1998
1998
  eventNameFormula: string;
1999
1999
  caseCaseIdFormula: string;
2000
- eventName: string | null;
2000
+ eventName: string;
2001
2001
  objectFilters: string;
2002
2002
  filters: string;
2003
2003
  eventTimeFormula: string;
@@ -2042,7 +2042,7 @@ declare const prepareDurationParams: (value: TWidgetIndicatorDurationValue) => {
2042
2042
  endEventAggregationName: string;
2043
2043
  } | null;
2044
2044
 
2045
- declare function getEventMeasureFormula({ value }: IProcessIndicator, process: IWidgetProcess): string;
2045
+ declare function getEventMeasureFormula({ value }: IProcessIndicator, process: Omit<IWidgetProcess, "isValid">): string;
2046
2046
 
2047
2047
  declare enum EEventMeasureTemplateNames {
2048
2048
  eventsCount = "eventsCount",
@@ -2053,7 +2053,7 @@ declare const eventMeasureTemplateFormulas: {
2053
2053
  readonly reworksCount: "count() - uniqExact({caseCaseIdFormula})";
2054
2054
  };
2055
2055
 
2056
- declare function getTransitionMeasureFormula({ value }: IProcessIndicator, process: IWidgetProcess): string;
2056
+ declare function getTransitionMeasureFormula({ value }: IProcessIndicator, process: Omit<IWidgetProcess, "isValid">): string;
2057
2057
 
2058
2058
  declare enum ETransitionMeasureTemplateNames {
2059
2059
  transitionsCount = "transitionsCount",
@@ -2069,7 +2069,7 @@ declare const countExecutionsTemplate = "process(countIf({eventNameFormula} in '
2069
2069
  /** @deprecated - следует использовать fillTemplateSql */
2070
2070
  declare function fillTemplateString(templateString: string, params: Record<string, any>): string;
2071
2071
  /** Функция для безопасного заполнения SQL шаблонов с защитой от однострочных SQL комментариев в подставляемых значениях. */
2072
- declare function fillTemplateSql(templateString: string, params: Record<string, any>): string;
2072
+ declare function fillTemplateSql(templateString: string, params: Record<string, string>): string;
2073
2073
 
2074
2074
  declare function generateColumnFormula(tableName: string, columnName: string): string;
2075
2075
 
package/dist/index.esm.js CHANGED
@@ -807,17 +807,13 @@ function fillTemplateSql(templateString, params) {
807
807
  try {
808
808
  for (var _b = __values(Object.entries(params)), _c = _b.next(); !_c.done; _c = _b.next()) {
809
809
  var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
810
- if (!value) {
811
- newParams[key] = value;
812
- break;
813
- }
814
810
  /** Эвристическая проверка на возможное присутствие sql-комментария в значении подставляемом в template
815
811
  */
816
- if (typeof value === "string" && value.indexOf("--") >= 0) {
812
+ if (String(value).indexOf("--") >= 0) {
817
813
  newParams[key] = "".concat(value, "\n");
818
- break;
814
+ continue;
819
815
  }
820
- newParams[key] = value;
816
+ newParams[key] = String(value);
821
817
  }
822
818
  }
823
819
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -1146,6 +1142,7 @@ var EMeasureAggregationTemplateName;
1146
1142
  })(EMeasureAggregationTemplateName || (EMeasureAggregationTemplateName = {}));
1147
1143
  /** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
1148
1144
  var prepareMeasureAggregationParams = function (value) {
1145
+ var _a;
1149
1146
  if ((!value.anyEvent && !value.eventName) ||
1150
1147
  !value.caseCaseIdFormula ||
1151
1148
  !value.eventNameFormula ||
@@ -1158,7 +1155,7 @@ var prepareMeasureAggregationParams = function (value) {
1158
1155
  outerAggregation: value.outerAggregation,
1159
1156
  eventNameFormula: value.eventNameFormula,
1160
1157
  caseCaseIdFormula: value.caseCaseIdFormula,
1161
- eventName: value.eventName,
1158
+ eventName: (_a = value.eventName) !== null && _a !== void 0 ? _a : "",
1162
1159
  objectFilters: "1",
1163
1160
  filters: convertFiltersToFormula(value.filters),
1164
1161
  eventTimeFormula: "",
package/dist/index.js CHANGED
@@ -808,17 +808,13 @@ function fillTemplateSql(templateString, params) {
808
808
  try {
809
809
  for (var _b = __values(Object.entries(params)), _c = _b.next(); !_c.done; _c = _b.next()) {
810
810
  var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
811
- if (!value) {
812
- newParams[key] = value;
813
- break;
814
- }
815
811
  /** Эвристическая проверка на возможное присутствие sql-комментария в значении подставляемом в template
816
812
  */
817
- if (typeof value === "string" && value.indexOf("--") >= 0) {
813
+ if (String(value).indexOf("--") >= 0) {
818
814
  newParams[key] = "".concat(value, "\n");
819
- break;
815
+ continue;
820
816
  }
821
- newParams[key] = value;
817
+ newParams[key] = String(value);
822
818
  }
823
819
  }
824
820
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -1147,6 +1143,7 @@ exports.EMeasureAggregationTemplateName = void 0;
1147
1143
  })(exports.EMeasureAggregationTemplateName || (exports.EMeasureAggregationTemplateName = {}));
1148
1144
  /** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
1149
1145
  var prepareMeasureAggregationParams = function (value) {
1146
+ var _a;
1150
1147
  if ((!value.anyEvent && !value.eventName) ||
1151
1148
  !value.caseCaseIdFormula ||
1152
1149
  !value.eventNameFormula ||
@@ -1159,7 +1156,7 @@ var prepareMeasureAggregationParams = function (value) {
1159
1156
  outerAggregation: value.outerAggregation,
1160
1157
  eventNameFormula: value.eventNameFormula,
1161
1158
  caseCaseIdFormula: value.caseCaseIdFormula,
1162
- eventName: value.eventName,
1159
+ eventName: (_a = value.eventName) !== null && _a !== void 0 ? _a : "",
1163
1160
  objectFilters: "1",
1164
1161
  filters: convertFiltersToFormula(value.filters),
1165
1162
  eventTimeFormula: "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infomaximum/widget-sdk",
3
- "version": "6.0.0-8",
3
+ "version": "6.0.0-9",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",