@wix/motion-edm-autogen-query-wrapper
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -136,4 +136,6 @@ "use strict"; | ||
build() { | ||
var _toScalaCompatibleFil; | ||
return { | ||
filter: toScalaCompatibleFilter(this.getFilterModel()), | ||
filter: (_toScalaCompatibleFil = toScalaCompatibleFilter(this.getFilterModel())) != null ? _toScalaCompatibleFil : {}, | ||
sort: this.sort, | ||
@@ -140,0 +142,0 @@ paging: this.paging |
@@ -40,2 +40,4 @@ "use strict"; | ||
try { | ||
var _pagingMetadata$curso5, _pagingMetadata$curso6, _pagingMetadata$curso7, _pagingMetadata$curso8; | ||
const query = this._buildQuery(); | ||
@@ -59,4 +61,4 @@ | ||
limit: this._pagingLimit, | ||
totalCount: pagingMetadata.total, | ||
tooManyToCount: pagingMetadata.tooManyToCount, | ||
totalCount: pagingMetadata == null ? void 0 : pagingMetadata.total, | ||
tooManyToCount: pagingMetadata == null ? void 0 : pagingMetadata.tooManyToCount, | ||
originQuery: this | ||
@@ -70,6 +72,14 @@ }); | ||
originQuery: this, | ||
fetchNextPage: () => this._copyWithCursor(pagingMetadata.cursors.next).find(options), | ||
fetchPrevPage: () => this._copyWithCursor(pagingMetadata.cursors.prev).find(options), | ||
prevCursor: pagingMetadata.cursors.prev, | ||
nextCursor: pagingMetadata.cursors.next | ||
fetchNextPage: () => { | ||
var _pagingMetadata$curso, _pagingMetadata$curso2; | ||
return this._copyWithCursor((_pagingMetadata$curso = pagingMetadata == null ? void 0 : (_pagingMetadata$curso2 = pagingMetadata.cursors) == null ? void 0 : _pagingMetadata$curso2.next) != null ? _pagingMetadata$curso : '').find(options); | ||
}, | ||
fetchPrevPage: () => { | ||
var _pagingMetadata$curso3, _pagingMetadata$curso4; | ||
return this._copyWithCursor((_pagingMetadata$curso3 = pagingMetadata == null ? void 0 : (_pagingMetadata$curso4 = pagingMetadata.cursors) == null ? void 0 : _pagingMetadata$curso4.prev) != null ? _pagingMetadata$curso3 : '').find(options); | ||
}, | ||
prevCursor: (_pagingMetadata$curso5 = pagingMetadata == null ? void 0 : (_pagingMetadata$curso6 = pagingMetadata.cursors) == null ? void 0 : _pagingMetadata$curso6.prev) != null ? _pagingMetadata$curso5 : '', | ||
nextCursor: (_pagingMetadata$curso7 = pagingMetadata == null ? void 0 : (_pagingMetadata$curso8 = pagingMetadata.cursors) == null ? void 0 : _pagingMetadata$curso8.next) != null ? _pagingMetadata$curso7 : '' | ||
}); | ||
@@ -76,0 +86,0 @@ } catch (error) { |
@@ -132,4 +132,5 @@ import { __extends, __spreadArray } from "tslib"; | ||
PlatformizedQueryBuilder.prototype.build = function () { | ||
var _a; | ||
return { | ||
filter: toScalaCompatibleFilter(this.getFilterModel()), | ||
filter: (_a = toScalaCompatibleFilter(this.getFilterModel())) !== null && _a !== void 0 ? _a : {}, | ||
sort: this.sort, | ||
@@ -136,0 +137,0 @@ paging: this.paging, |
@@ -28,10 +28,11 @@ import { __assign, __awaiter, __extends, __generator } from "tslib"; | ||
PlatformizedQueryMethodWrapper.prototype.find = function (options) { | ||
var _a, _b, _c, _d; | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var query, request, response, _a, _b, items, _c, pagingMetadata_1, error_1; | ||
var query, request, response, _e, _f, items, _g, pagingMetadata_1, error_1; | ||
var _this = this; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
return __generator(this, function (_h) { | ||
switch (_h.label) { | ||
case 0: | ||
_d.trys.push([0, 2, , 3]); | ||
_h.trys.push([0, 2, , 3]); | ||
query = this._buildQuery(); | ||
@@ -41,4 +42,4 @@ request = this.requestTransformer(query, options); | ||
case 1: | ||
response = _d.sent(); | ||
_a = this.responseTransformer(response), _b = ITEMS_RESULT_PROPERTY_NAME, items = _a[_b], _c = PAGING_METADATA_RESULT_PROPERTY_NAME, pagingMetadata_1 = _a[_c]; | ||
response = _h.sent(); | ||
_e = this.responseTransformer(response), _f = ITEMS_RESULT_PROPERTY_NAME, items = _e[_f], _g = PAGING_METADATA_RESULT_PROPERTY_NAME, pagingMetadata_1 = _e[_g]; | ||
if (this.pagingMethod === PagingMethods.Offset) { | ||
@@ -51,4 +52,4 @@ return [2 /*return*/, new OffsetBasedIterator({ | ||
limit: this._pagingLimit, | ||
totalCount: pagingMetadata_1.total, | ||
tooManyToCount: pagingMetadata_1.tooManyToCount, | ||
totalCount: pagingMetadata_1 === null || pagingMetadata_1 === void 0 ? void 0 : pagingMetadata_1.total, | ||
tooManyToCount: pagingMetadata_1 === null || pagingMetadata_1 === void 0 ? void 0 : pagingMetadata_1.tooManyToCount, | ||
originQuery: this, | ||
@@ -62,12 +63,14 @@ })]; | ||
fetchNextPage: function () { | ||
return _this._copyWithCursor(pagingMetadata_1.cursors.next).find(options); | ||
var _a, _b; | ||
return _this._copyWithCursor((_b = (_a = pagingMetadata_1 === null || pagingMetadata_1 === void 0 ? void 0 : pagingMetadata_1.cursors) === null || _a === void 0 ? void 0 : _a.next) !== null && _b !== void 0 ? _b : '').find(options); | ||
}, | ||
fetchPrevPage: function () { | ||
return _this._copyWithCursor(pagingMetadata_1.cursors.prev).find(options); | ||
var _a, _b; | ||
return _this._copyWithCursor((_b = (_a = pagingMetadata_1 === null || pagingMetadata_1 === void 0 ? void 0 : pagingMetadata_1.cursors) === null || _a === void 0 ? void 0 : _a.prev) !== null && _b !== void 0 ? _b : '').find(options); | ||
}, | ||
prevCursor: pagingMetadata_1.cursors.prev, | ||
nextCursor: pagingMetadata_1.cursors.next, | ||
prevCursor: (_b = (_a = pagingMetadata_1 === null || pagingMetadata_1 === void 0 ? void 0 : pagingMetadata_1.cursors) === null || _a === void 0 ? void 0 : _a.prev) !== null && _b !== void 0 ? _b : '', | ||
nextCursor: (_d = (_c = pagingMetadata_1 === null || pagingMetadata_1 === void 0 ? void 0 : pagingMetadata_1.cursors) === null || _c === void 0 ? void 0 : _c.next) !== null && _d !== void 0 ? _d : '', | ||
})]; | ||
case 2: | ||
error_1 = _d.sent(); | ||
error_1 = _h.sent(); | ||
return [2 /*return*/, this.errorTransformer(error_1)]; | ||
@@ -74,0 +77,0 @@ case 3: return [2 /*return*/]; |
{ | ||
"name": "@wix/motion-edm-autogen-query-wrapper", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"main": "dist/cjs/index.js", | ||
@@ -70,3 +70,3 @@ "module": "dist/esm/index.js", | ||
}, | ||
"falconPackageHash": "bf5070401c2620e0a81d50b6bdbf2b1f09bf9fd47cf65662dec47da2" | ||
"falconPackageHash": "2b320251f96493c80b858e4afc0300249ed3bab53001294f83e7fd5e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4261588
38045