@maioradv/cms-basic-lib 1.4.4 → 1.4.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/dist/bundles/graphql.js +1 -1
- package/dist/collections/types.d.ts +4 -2
- package/dist/model.js +5 -0
- package/package.json +1 -1
package/dist/bundles/graphql.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bundle, BundleCollection } from "../bundles/types";
|
|
1
|
+
import { Bundle, BundleCollection, BundleVariant } from "../bundles/types";
|
|
2
2
|
import { BooleanClause, NumberClause, StringClause, WhereClausesDto } from "../core/dto/clauses";
|
|
3
3
|
import { Sorting, SortingParamsDto } from "../core/dto/sorting";
|
|
4
4
|
import { QueryParamsDto } from "../core/utils/queryParams";
|
|
@@ -71,7 +71,9 @@ export type QueryCollectionProductsDto = Omit<QueryParamsDto<SortingParamsDto<{}
|
|
|
71
71
|
search?: StringClause;
|
|
72
72
|
published?: BooleanClause;
|
|
73
73
|
}>>, 'sorting'>;
|
|
74
|
-
export type FindAllCollectionBundlesDto = WithRelation<BundleCollection, 'Bundle', Bundle
|
|
74
|
+
export type FindAllCollectionBundlesDto = WithRelation<BundleCollection, 'Bundle', WithRelations<Bundle, {
|
|
75
|
+
BundleVariant: BundleVariant[];
|
|
76
|
+
}>>;
|
|
75
77
|
export type QueryCollectionBundlesDto = Omit<QueryParamsDto<SortingParamsDto<{}>, WhereClausesDto<{
|
|
76
78
|
includeAttributes?: NumberClause;
|
|
77
79
|
excludeAttributes?: NumberClause;
|
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
|
}
|