@infrab4a/connect 4.23.0-beta.4 → 4.23.0-beta.5

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/index.cjs.js CHANGED
@@ -336,20 +336,17 @@ tslib.__decorate([
336
336
  class ProductErrors extends BaseModel {
337
337
  constructor() {
338
338
  super(...arguments);
339
- this.errors = {};
339
+ this.errors = [];
340
340
  }
341
- setErrors(source, errors) {
342
- this.errors[source] = errors;
343
- this.hasErrors = Object.values(this.errors).flat().length > 0;
341
+ setErrors(errors) {
342
+ this.errors = errors;
343
+ this.hasErrors = this.errors.length > 0;
344
344
  }
345
- getErrors(source) {
346
- return this.errors[source];
347
- }
348
- getAllErrors() {
345
+ getErrors() {
349
346
  return this.errors;
350
347
  }
351
348
  static get identifiersFields() {
352
- return ['productId'];
349
+ return ['productId', 'source'];
353
350
  }
354
351
  }
355
352
  tslib.__decorate([
@@ -5842,6 +5839,7 @@ class ProductErrorsHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHas
5842
5839
  from: (value) => value.toString(),
5843
5840
  },
5844
5841
  },
5842
+ 'source',
5845
5843
  { hasErrors: { columnName: 'has_errors' } },
5846
5844
  { createdAt: { columnName: 'created_at' } },
5847
5845
  { updatedAt: { columnName: 'updated_at' } },
package/index.esm.js CHANGED
@@ -330,20 +330,17 @@ __decorate([
330
330
  class ProductErrors extends BaseModel {
331
331
  constructor() {
332
332
  super(...arguments);
333
- this.errors = {};
333
+ this.errors = [];
334
334
  }
335
- setErrors(source, errors) {
336
- this.errors[source] = errors;
337
- this.hasErrors = Object.values(this.errors).flat().length > 0;
335
+ setErrors(errors) {
336
+ this.errors = errors;
337
+ this.hasErrors = this.errors.length > 0;
338
338
  }
339
- getErrors(source) {
340
- return this.errors[source];
341
- }
342
- getAllErrors() {
339
+ getErrors() {
343
340
  return this.errors;
344
341
  }
345
342
  static get identifiersFields() {
346
- return ['productId'];
343
+ return ['productId', 'source'];
347
344
  }
348
345
  }
349
346
  __decorate([
@@ -5836,6 +5833,7 @@ class ProductErrorsHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHas
5836
5833
  from: (value) => value.toString(),
5837
5834
  },
5838
5835
  },
5836
+ 'source',
5839
5837
  { hasErrors: { columnName: 'has_errors' } },
5840
5838
  { createdAt: { columnName: 'created_at' } },
5841
5839
  { updatedAt: { columnName: 'updated_at' } },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.23.0-beta.4",
3
+ "version": "4.23.0-beta.5",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -1,16 +1,16 @@
1
1
  import { BaseModel } from '../../generic/model';
2
2
  import { Product } from './product';
3
- type ProductErrorsIdentifiers = 'productId';
3
+ type ProductErrorsIdentifiers = 'productId' | 'source';
4
4
  export declare class ProductErrors extends BaseModel<ProductErrors, ProductErrorsIdentifiers> {
5
- private errors;
6
5
  productId: string;
6
+ source: string;
7
+ errors: string[];
7
8
  hasErrors: boolean;
8
9
  createdAt: Date;
9
10
  updatedAt: Date;
10
11
  product: Product;
11
- setErrors(source: string, errors: string[]): void;
12
- getErrors(source: string): string[];
13
- getAllErrors(): Record<string, string[]>;
12
+ setErrors(errors: string[]): void;
13
+ getErrors(): string[];
14
14
  static get identifiersFields(): ProductErrorsIdentifiers[];
15
15
  }
16
16
  export {};