@maioradv/cms-basic-lib 1.4.5 → 1.4.7

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.
@@ -13,4 +13,5 @@ export type QueryBundleGQLDto = PaginatedGQLQueryDto & {
13
13
  };
14
14
  export type FindAllBundleGQLDto = WithRelations<Bundle, {
15
15
  BundleVariant: BundleVariant[];
16
+ BundleProduct: BundleProduct[];
16
17
  }>;
@@ -30,11 +30,18 @@ exports.BundlesResolvers = {
30
30
  }
31
31
  price
32
32
  fullPrice
33
- productId
33
+ bundleId
34
34
  published
35
35
  createdAt
36
36
  updatedAt
37
37
  }
38
+ BundleProduct {
39
+ bundleId
40
+ productId
41
+ position
42
+ createdAt
43
+ updatedAt
44
+ }
38
45
  translations {
39
46
  key
40
47
  locale
@@ -58,6 +58,7 @@ export type CreateBundleVariantDto = OmitRequire<BundleVariant, 'id' | 'createdA
58
58
  export type UpdateBundleVariantDto = Partial<CreateBundleVariantDto>;
59
59
  export type FindAllBundleDto = WithRelations<Bundle, {
60
60
  BundleVariant: BundleVariant[];
61
+ BundleProduct: BundleProduct[];
61
62
  }>;
62
63
  export type FindOneBundleDto = WithRelations<Bundle, {
63
64
  BundleProduct: WithRelation<BundleProduct, 'Product', Product>[];
package/dist/model.js CHANGED
@@ -22,6 +22,7 @@ class ApiModule {
22
22
  }
23
23
  }
24
24
  async _graphql(resolver, variables) {
25
+ var _a, _b;
25
26
  try {
26
27
  const response = await this.client.request({
27
28
  method: 'post',
@@ -36,6 +37,10 @@ class ApiModule {
36
37
  return response.data.data[resolver.name];
37
38
  }
38
39
  catch (error) {
40
+ if ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.errors) {
41
+ const GQLError = new Error(error.response.data.errors.map(e => e.message).join(', '));
42
+ throw new error_1.GraphApiError(GQLError);
43
+ }
39
44
  throw new error_1.GraphApiError(error);
40
45
  }
41
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maioradv/cms-basic-lib",
3
- "version": "1.4.5",
3
+ "version": "1.4.7",
4
4
  "description": "JS lib for Maior CMS Basic Api",
5
5
  "repository": "https://github.com/maioradv/cms-basic-lib.git",
6
6
  "author": "Maior ADV Srl",