@qrvey/cd-package-registry 1.0.0-beta → 1.0.1-beta

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/cjs/index.js CHANGED
@@ -192,6 +192,39 @@ function _ts_metadata2(k, v) {
192
192
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
193
193
  }
194
194
  __name(_ts_metadata2, "_ts_metadata");
195
+ var _a;
196
+ var JsonCustomSchemaConstraint = (_a = class {
197
+ validate(value) {
198
+ if (value === null || value === void 0) return true;
199
+ if (typeof value === "object") {
200
+ if (Array.isArray(value)) return false;
201
+ if (Object.keys(value).length === 0) return false;
202
+ return true;
203
+ }
204
+ if (typeof value === "string") {
205
+ if (value.trim().length === 0) return false;
206
+ try {
207
+ const parsed = JSON.parse(value);
208
+ if (typeof parsed !== "object" || parsed === null) return false;
209
+ if (Array.isArray(parsed)) return false;
210
+ if (Object.keys(parsed).length === 0) return false;
211
+ return true;
212
+ } catch (e) {
213
+ return false;
214
+ }
215
+ }
216
+ return false;
217
+ }
218
+ defaultMessage() {
219
+ return "jsonCustomSchema must be a non-empty JSON object or a valid JSON string representing a non-empty object";
220
+ }
221
+ }, __name(_a, "JsonCustomSchemaConstraint"), _a);
222
+ JsonCustomSchemaConstraint = _ts_decorate2([
223
+ classValidator.ValidatorConstraint({
224
+ name: "jsonCustomSchemaValidation",
225
+ async: false
226
+ })
227
+ ], JsonCustomSchemaConstraint);
195
228
  var CONNECTOR_TYPES = {
196
229
  FILE_UPLOAD: "fileUpload",
197
230
  ELASTICSEARCH: "Elasticsearch",
@@ -559,7 +592,7 @@ _ts_decorate2([
559
592
  ], ConnectionAssetDto.prototype, "hasHeader", void 0);
560
593
  _ts_decorate2([
561
594
  classValidator.IsOptional(),
562
- classValidator.IsObject(),
595
+ classValidator.Validate(JsonCustomSchemaConstraint),
563
596
  _ts_metadata2("design:type", Object)
564
597
  ], ConnectionAssetDto.prototype, "jsonCustomSchema", void 0);
565
598
  _ts_decorate2([
@@ -2009,8 +2042,8 @@ _ts_decorate9([
2009
2042
  classValidator.IsString(),
2010
2043
  classValidator.IsEnum(ItemTypes),
2011
2044
  classTransformer.Transform(({ value }) => {
2012
- var _a2;
2013
- return ((_a2 = value == null ? void 0 : value.toLowerCase) == null ? void 0 : _a2.call(value)) || value;
2045
+ var _a3;
2046
+ return ((_a3 = value == null ? void 0 : value.toLowerCase) == null ? void 0 : _a3.call(value)) || value;
2014
2047
  }),
2015
2048
  _ts_metadata9("design:type", String)
2016
2049
  ], BaseItemDto.prototype, "type", void 0);
@@ -3697,8 +3730,8 @@ function _ts_metadata19(k, v) {
3697
3730
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
3698
3731
  }
3699
3732
  __name(_ts_metadata19, "_ts_metadata");
3700
- var _a;
3701
- var BaseTokenAssetDto = (_a = class {
3733
+ var _a2;
3734
+ var BaseTokenAssetDto = (_a2 = class {
3702
3735
  constructor() {
3703
3736
  __publicField(this, "data");
3704
3737
  __publicField(this, "type");
@@ -3706,7 +3739,7 @@ var BaseTokenAssetDto = (_a = class {
3706
3739
  __publicField(this, "createDate");
3707
3740
  __publicField(this, "modifyDate");
3708
3741
  }
3709
- }, __name(_a, "BaseTokenAssetDto"), _a);
3742
+ }, __name(_a2, "BaseTokenAssetDto"), _a2);
3710
3743
  _ts_decorate19([
3711
3744
  classValidator.IsDefined(),
3712
3745
  classValidator.IsObject(),
@@ -4649,9 +4682,9 @@ var _DatasetDependencyValidator = class _DatasetDependencyValidator {
4649
4682
  this.options = options;
4650
4683
  }
4651
4684
  getDependencyKeys(input) {
4652
- var _a2, _b;
4685
+ var _a3, _b;
4653
4686
  return {
4654
- keys: (_b = (_a2 = input.datasources) == null ? void 0 : _a2.map((ds) => ({
4687
+ keys: (_b = (_a3 = input.datasources) == null ? void 0 : _a3.map((ds) => ({
4655
4688
  connectionId: ds.connectionId
4656
4689
  }))) != null ? _b : []
4657
4690
  };
@@ -4668,9 +4701,9 @@ var _DatasetDependencyValidator = class _DatasetDependencyValidator {
4668
4701
  };
4669
4702
  }
4670
4703
  validateWithContext(input, context) {
4671
- var _a2;
4704
+ var _a3;
4672
4705
  const errors = [];
4673
- (_a2 = input.datasources) == null ? void 0 : _a2.forEach((ds) => {
4706
+ (_a3 = input.datasources) == null ? void 0 : _a3.forEach((ds) => {
4674
4707
  const connections = context.connections.get(ds.connectionId);
4675
4708
  if (!connections) {
4676
4709
  errors.push({
@@ -4704,11 +4737,11 @@ var _DashboardContentElementDependencyValidatorService = class _DashboardContent
4704
4737
  this.options = options;
4705
4738
  }
4706
4739
  getDependencyKeys(input) {
4707
- var _a2, _b, _c, _d;
4740
+ var _a3, _b, _c, _d;
4708
4741
  return {
4709
4742
  keys: [
4710
4743
  {
4711
- qrveyId: (_b = (_a2 = input.itemData) == null ? void 0 : _a2.qrveyId) != null ? _b : "",
4744
+ qrveyId: (_b = (_a3 = input.itemData) == null ? void 0 : _a3.qrveyId) != null ? _b : "",
4712
4745
  metricId: (_c = input.itemData) == null ? void 0 : _c.metricId,
4713
4746
  chartId: (_d = input.itemData) == null ? void 0 : _d.chartId
4714
4747
  }
@@ -4720,9 +4753,9 @@ var _DashboardContentElementDependencyValidatorService = class _DashboardContent
4720
4753
  const charts = uniqueBy(keys != null ? keys : [], "chartId");
4721
4754
  const visualizations = await this.fetchVisualizationsByIds(metrics.concat(charts));
4722
4755
  const visualizationMap = new Map(visualizations.map((d) => {
4723
- var _a2;
4756
+ var _a3;
4724
4757
  return [
4725
- (_a2 = d.chartid) != null ? _a2 : d.metricid,
4758
+ (_a3 = d.chartid) != null ? _a3 : d.metricid,
4726
4759
  d
4727
4760
  ];
4728
4761
  }));
@@ -4731,9 +4764,9 @@ var _DashboardContentElementDependencyValidatorService = class _DashboardContent
4731
4764
  };
4732
4765
  }
4733
4766
  validateWithContext(input, context) {
4734
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
4767
+ var _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j;
4735
4768
  const errors = [];
4736
- 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 : "");
4769
+ 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 : "");
4737
4770
  if (!visualization && (((_e = input.itemData) == null ? void 0 : _e.chartId) || ((_f = input.itemData) == null ? void 0 : _f.metricId))) {
4738
4771
  if ((_g = input.itemData) == null ? void 0 : _g.chartId) {
4739
4772
  errors.push({