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

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