@qrvey/cd-package-registry 1.0.0-beta → 1.0.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,4 +1,4 @@
1
- import { IsString, MaxLength, IsOptional, IsObject, IsArray, IsInt, IsNumber, IsBoolean, ValidateIf, IsDateString, IsEmail, Min, IsEnum, IsDate, IsIn, ValidateNested, Matches, Allow, MinLength, IsDefined, IsISO8601, IsNotEmpty, getMetadataStorage, validateSync } from 'class-validator';
1
+ import { IsString, MaxLength, IsOptional, IsObject, ValidatorConstraint, IsArray, IsInt, IsNumber, IsBoolean, ValidateIf, Validate, IsDateString, IsEmail, Min, IsEnum, IsDate, IsIn, ValidateNested, Matches, Allow, MinLength, IsDefined, IsISO8601, IsNotEmpty, getMetadataStorage, validateSync } from 'class-validator';
2
2
  import { Type, Transform, plainToInstance } from 'class-transformer';
3
3
  import 'reflect-metadata';
4
4
  import { LoggerService } from '@qrvey/telemetry';
@@ -190,6 +190,39 @@ function _ts_metadata2(k, v) {
190
190
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
191
191
  }
192
192
  __name(_ts_metadata2, "_ts_metadata");
193
+ var _a;
194
+ var JsonCustomSchemaConstraint = (_a = class {
195
+ validate(value) {
196
+ if (value === null || value === void 0) return true;
197
+ if (typeof value === "object") {
198
+ if (Array.isArray(value)) return false;
199
+ if (Object.keys(value).length === 0) return false;
200
+ return true;
201
+ }
202
+ if (typeof value === "string") {
203
+ if (value.trim().length === 0) return false;
204
+ try {
205
+ const parsed = JSON.parse(value);
206
+ if (typeof parsed !== "object" || parsed === null) return false;
207
+ if (Array.isArray(parsed)) return false;
208
+ if (Object.keys(parsed).length === 0) return false;
209
+ return true;
210
+ } catch (e) {
211
+ return false;
212
+ }
213
+ }
214
+ return false;
215
+ }
216
+ defaultMessage() {
217
+ return "jsonCustomSchema must be a non-empty JSON object or a valid JSON string representing a non-empty object";
218
+ }
219
+ }, __name(_a, "JsonCustomSchemaConstraint"), _a);
220
+ JsonCustomSchemaConstraint = _ts_decorate2([
221
+ ValidatorConstraint({
222
+ name: "jsonCustomSchemaValidation",
223
+ async: false
224
+ })
225
+ ], JsonCustomSchemaConstraint);
193
226
  var CONNECTOR_TYPES = {
194
227
  FILE_UPLOAD: "fileUpload",
195
228
  ELASTICSEARCH: "Elasticsearch",
@@ -557,7 +590,7 @@ _ts_decorate2([
557
590
  ], ConnectionAssetDto.prototype, "hasHeader", void 0);
558
591
  _ts_decorate2([
559
592
  IsOptional(),
560
- IsObject(),
593
+ Validate(JsonCustomSchemaConstraint),
561
594
  _ts_metadata2("design:type", Object)
562
595
  ], ConnectionAssetDto.prototype, "jsonCustomSchema", void 0);
563
596
  _ts_decorate2([
@@ -2007,8 +2040,8 @@ _ts_decorate9([
2007
2040
  IsString(),
2008
2041
  IsEnum(ItemTypes),
2009
2042
  Transform(({ value }) => {
2010
- var _a2;
2011
- return ((_a2 = value == null ? void 0 : value.toLowerCase) == null ? void 0 : _a2.call(value)) || value;
2043
+ var _a3;
2044
+ return ((_a3 = value == null ? void 0 : value.toLowerCase) == null ? void 0 : _a3.call(value)) || value;
2012
2045
  }),
2013
2046
  _ts_metadata9("design:type", String)
2014
2047
  ], BaseItemDto.prototype, "type", void 0);
@@ -3695,8 +3728,8 @@ function _ts_metadata19(k, v) {
3695
3728
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
3696
3729
  }
3697
3730
  __name(_ts_metadata19, "_ts_metadata");
3698
- var _a;
3699
- var BaseTokenAssetDto = (_a = class {
3731
+ var _a2;
3732
+ var BaseTokenAssetDto = (_a2 = class {
3700
3733
  constructor() {
3701
3734
  __publicField(this, "data");
3702
3735
  __publicField(this, "type");
@@ -3704,7 +3737,7 @@ var BaseTokenAssetDto = (_a = class {
3704
3737
  __publicField(this, "createDate");
3705
3738
  __publicField(this, "modifyDate");
3706
3739
  }
3707
- }, __name(_a, "BaseTokenAssetDto"), _a);
3740
+ }, __name(_a2, "BaseTokenAssetDto"), _a2);
3708
3741
  _ts_decorate19([
3709
3742
  IsDefined(),
3710
3743
  IsObject(),
@@ -4647,9 +4680,9 @@ var _DatasetDependencyValidator = class _DatasetDependencyValidator {
4647
4680
  this.options = options;
4648
4681
  }
4649
4682
  getDependencyKeys(input) {
4650
- var _a2, _b;
4683
+ var _a3, _b;
4651
4684
  return {
4652
- keys: (_b = (_a2 = input.datasources) == null ? void 0 : _a2.map((ds) => ({
4685
+ keys: (_b = (_a3 = input.datasources) == null ? void 0 : _a3.map((ds) => ({
4653
4686
  connectionId: ds.connectionId
4654
4687
  }))) != null ? _b : []
4655
4688
  };
@@ -4666,9 +4699,9 @@ var _DatasetDependencyValidator = class _DatasetDependencyValidator {
4666
4699
  };
4667
4700
  }
4668
4701
  validateWithContext(input, context) {
4669
- var _a2;
4702
+ var _a3;
4670
4703
  const errors = [];
4671
- (_a2 = input.datasources) == null ? void 0 : _a2.forEach((ds) => {
4704
+ (_a3 = input.datasources) == null ? void 0 : _a3.forEach((ds) => {
4672
4705
  const connections = context.connections.get(ds.connectionId);
4673
4706
  if (!connections) {
4674
4707
  errors.push({
@@ -4702,11 +4735,11 @@ var _DashboardContentElementDependencyValidatorService = class _DashboardContent
4702
4735
  this.options = options;
4703
4736
  }
4704
4737
  getDependencyKeys(input) {
4705
- var _a2, _b, _c, _d;
4738
+ var _a3, _b, _c, _d;
4706
4739
  return {
4707
4740
  keys: [
4708
4741
  {
4709
- qrveyId: (_b = (_a2 = input.itemData) == null ? void 0 : _a2.qrveyId) != null ? _b : "",
4742
+ qrveyId: (_b = (_a3 = input.itemData) == null ? void 0 : _a3.qrveyId) != null ? _b : "",
4710
4743
  metricId: (_c = input.itemData) == null ? void 0 : _c.metricId,
4711
4744
  chartId: (_d = input.itemData) == null ? void 0 : _d.chartId
4712
4745
  }
@@ -4718,9 +4751,9 @@ var _DashboardContentElementDependencyValidatorService = class _DashboardContent
4718
4751
  const charts = uniqueBy(keys != null ? keys : [], "chartId");
4719
4752
  const visualizations = await this.fetchVisualizationsByIds(metrics.concat(charts));
4720
4753
  const visualizationMap = new Map(visualizations.map((d) => {
4721
- var _a2;
4754
+ var _a3;
4722
4755
  return [
4723
- (_a2 = d.chartid) != null ? _a2 : d.metricid,
4756
+ (_a3 = d.chartid) != null ? _a3 : d.metricid,
4724
4757
  d
4725
4758
  ];
4726
4759
  }));
@@ -4729,9 +4762,9 @@ var _DashboardContentElementDependencyValidatorService = class _DashboardContent
4729
4762
  };
4730
4763
  }
4731
4764
  validateWithContext(input, context) {
4732
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
4765
+ var _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j;
4733
4766
  const errors = [];
4734
- const visualization = context.visualizations.get((_d = (_c = (_a2 = input.itemData) == null ? void 0 : _a2.chartId) != null ? _c : (_b = input.itemData) == null ? void 0 : _b.metricId) != null ? _d : "");
4767
+ const visualization = context.visualizations.get((_d = (_c = (_a3 = input.itemData) == null ? void 0 : _a3.chartId) != null ? _c : (_b = input.itemData) == null ? void 0 : _b.metricId) != null ? _d : "");
4735
4768
  if (!visualization && (((_e = input.itemData) == null ? void 0 : _e.chartId) || ((_f = input.itemData) == null ? void 0 : _f.metricId))) {
4736
4769
  if ((_g = input.itemData) == null ? void 0 : _g.chartId) {
4737
4770
  errors.push({