@infrab4a/connect 1.0.0-beta.10 → 1.0.0-beta.12

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.
@@ -35,13 +35,13 @@
35
35
  configurable: true
36
36
  });
37
37
  BaseModel.toInstance = function (data) {
38
- return classTransformer.plainToClass(this, data || {});
38
+ return classTransformer.plainToInstance(this, data || {});
39
39
  };
40
40
  BaseModel.isModel = function (value) {
41
41
  return value instanceof this;
42
42
  };
43
43
  BaseModel.prototype.toPlain = function () {
44
- return classTransformer.classToPlain(this);
44
+ return classTransformer.instanceToPlain(this);
45
45
  };
46
46
  return BaseModel;
47
47
  }());
@@ -2889,7 +2889,7 @@
2889
2889
  if (filter.operator === exports.Where.ISNOTNULL)
2890
2890
  return false;
2891
2891
  var converter = fieldOption.to ? fieldOption.to : function (value) { return value; };
2892
- return Array.isArray(filter.value) && [exports.Where.IN, exports.Where.NOTIN].includes(filter.operator)
2892
+ return Array.isArray(filter.value) && !fieldOption.fields && [exports.Where.IN, exports.Where.NOTIN].includes(filter.operator)
2893
2893
  ? filter.value.map(function (fieldValue) { return converter(fieldValue); })
2894
2894
  : converter(filter.value);
2895
2895
  };
@@ -3389,6 +3389,7 @@
3389
3389
  {
3390
3390
  conditions: {
3391
3391
  columnName: 'tag_condition',
3392
+ type: HasuraGraphQLColumnType.Jsonb,
3392
3393
  from: function (tags, row) { return ({ brand: row.brand_condition, tags: tags }); },
3393
3394
  bindPersistData: function (value) {
3394
3395
  return {
@@ -3396,6 +3397,9 @@
3396
3397
  tag_condition: "{\"" + value.tags.join('","') + "\"}",
3397
3398
  };
3398
3399
  },
3400
+ bindFindFilter: function (sentence) {
3401
+ return Object.assign(Object.assign({}, (sentence.brand ? { brand_condition: sentence.brand } : {})), (sentence.tags ? { tag_condition: sentence.tags } : {}));
3402
+ },
3399
3403
  },
3400
3404
  },
3401
3405
  'filters',
@@ -3621,7 +3625,10 @@
3621
3625
  categories: {
3622
3626
  columnName: 'categories',
3623
3627
  fields: ['category_id'],
3624
- to: function (categories) { return categories.map(function (categoryId) { return ({ category_id: +categoryId }); }); },
3628
+ bindPersistData: function (value) { return ({
3629
+ categories: { data: value.map(function (category) { return ({ category_id: +category }); }) },
3630
+ }); },
3631
+ to: function (categories) { return categories.map(function (categoryId) { return +categoryId; }); },
3625
3632
  from: function (categories) { return (categories === null || categories === void 0 ? void 0 : categories.map(function (category) { var _a; return (_a = category === null || category === void 0 ? void 0 : category.category_id) === null || _a === void 0 ? void 0 : _a.toString(); })) || []; },
3626
3633
  },
3627
3634
  },