@labdigital/commercetools-mock 1.7.0 → 1.8.1
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/index.cjs +54 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +54 -30
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers.ts +19 -6
- package/src/product-projection-search.ts +27 -8
- package/src/repositories/associate-role.ts +7 -0
- package/src/repositories/product-projection.ts +4 -16
- package/src/services/abstract.ts +2 -7
- package/src/services/product-projection.ts +22 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import * as ctp from '@commercetools/platform-sdk';
|
|
3
3
|
import { Project, ResourceIdentifier, QueryParam, AssociateRoleDraft, AssociateRole, AssociateRoleSetNameAction, AssociateRoleSetPermissionsAction, AssociateRoleChangeBuyerAssignableAction, AssociateRoleSetCustomFieldAction, AssociateRoleAddPermissionAction, AssociateRoleRemovePermissionAction, AttributeGroupDraft, AttributeGroup, AttributeGroupSetAttributesAction, AttributeGroupChangeNameAction, AttributeGroupSetDescriptionAction, AttributeGroupSetKeyAction, BusinessUnit, CartDraft, Cart, CartAddLineItemAction, CartChangeLineItemQuantityAction, CartRemoveLineItemAction, CartSetBillingAddressAction, CartSetShippingMethodAction, CartSetCountryAction, CartSetCustomerEmailAction, CartSetCustomFieldAction, CartSetCustomTypeAction, CartSetLocaleAction, CartSetShippingAddressAction, LineItemDraft, LineItem, CartDiscountDraft, CartDiscount, CartDiscountUpdateAction, AssetDraft, Asset, CategoryDraft, Category, CategoryChangeAssetNameAction, CategoryChangeSlugAction, CategorySetKeyAction, CategorySetAssetDescriptionAction, CategorySetAssetSourcesAction, CategorySetDescriptionAction, CategorySetMetaDescriptionAction, CategorySetMetaKeywordsAction, CategorySetMetaTitleAction, CategorySetCustomTypeAction, CategorySetCustomFieldAction, CategoryRemoveAssetAction, CategoryAddAssetAction, ChannelDraft, Channel, ChannelUpdateAction, CustomObjectDraft, CustomObject, CustomerDraft, Customer, CustomerChangeEmailAction, CustomerSetAuthenticationModeAction, CustomerSetCustomFieldAction, CustomerGroupDraft, CustomerGroup, CustomerGroupSetKeyAction, CustomerGroupChangeNameAction, CustomerGroupSetCustomTypeAction, CustomerGroupSetCustomFieldAction, DiscountCodeDraft, DiscountCode, DiscountCodeUpdateAction, Extension, ExtensionDraft, ExtensionUpdateAction, InventoryEntryDraft, InventoryEntry, InventoryEntryChangeQuantityAction, InventoryEntrySetExpectedDeliveryAction, InventoryEntrySetCustomFieldAction, InventoryEntrySetCustomTypeAction, InventoryEntrySetRestockableInDaysAction, OrderFromCartDraft, Order, CartReference, OrderImportDraft, OrderAddPaymentAction, OrderChangeOrderStateAction, OrderChangePaymentStateAction, OrderTransitionStateAction, OrderSetBillingAddressAction, OrderSetCustomerEmailAction, OrderSetCustomFieldAction, OrderSetCustomTypeAction, OrderSetLocaleAction, OrderSetOrderNumberAction, OrderSetShippingAddressAction, OrderSetStoreAction, MyOrderFromCartDraft, OrderEditDraft, OrderEdit, OrderEditUpdateAction, PaymentDraft, Payment, TransactionDraft, Transaction, PaymentSetCustomFieldAction, PaymentSetCustomTypeAction, PaymentAddTransactionAction, PaymentChangeTransactionStateAction, PaymentTransitionStateAction, ProductDraft, Product, ProductUpdateAction, ProductDiscountDraft, ProductDiscount, ProductDiscountUpdateAction, ProductProjectionPagedSearchResponse, ProductProjection, FacetResults, TermFacetResult, FilteredFacetResult, RangeFacetResult, ProductSelectionDraft, ProductSelection, ReviewUpdateAction, Review, ProductTypeDraft, ProductType, AttributeDefinitionDraft, AttributeDefinition, ProductTypeUpdateAction, ProjectUpdateAction, QuoteDraft, Quote, QuoteUpdateAction, QuoteRequestDraft, QuoteRequest, QuoteRequestUpdateAction, ReviewDraft, ShippingMethodDraft, ShippingMethod, ShippingMethodUpdateAction, ShoppingListDraft, ShoppingList, StagedQuoteDraft, StagedQuote, StagedQuoteUpdateAction, StandalonePriceDraft, StandalonePrice, ChannelResourceIdentifier, ChannelReference, DiscountedPriceDraft, StandalonePriceChangeActiveAction, StandalonePriceChangeValueAction, StandalonePriceSetDiscountedPriceAction, StateDraft, State, StateUpdateAction, StoreDraft, Store, StoreUpdateAction, SubscriptionDraft, Subscription, TaxCategoryDraft, TaxCategory, TaxCategoryUpdateAction, TypeDraft, Type, TypeUpdateAction, ZoneDraft, Zone, ZoneUpdateAction, BaseResource, UpdateAction } from '@commercetools/platform-sdk';
|
|
4
|
-
import { ParsedQs } from 'qs';
|
|
5
4
|
|
|
6
5
|
type GetParams$1 = {
|
|
7
6
|
expand?: string[];
|
|
@@ -37,6 +36,7 @@ declare class AssociateRoleRepository extends AbstractResourceRepository<'associ
|
|
|
37
36
|
setName: (context: RepositoryContext, resource: Writable<AssociateRole>, { name }: AssociateRoleSetNameAction) => void;
|
|
38
37
|
setPermissions: (context: RepositoryContext, resource: Writable<AssociateRole>, { permissions }: AssociateRoleSetPermissionsAction) => void;
|
|
39
38
|
setBuyerAssignable: (context: RepositoryContext, resource: Writable<AssociateRole>, { buyerAssignable }: AssociateRoleChangeBuyerAssignableAction) => void;
|
|
39
|
+
changeBuyerAssignable: (context: RepositoryContext, resource: Writable<AssociateRole>, { buyerAssignable }: AssociateRoleChangeBuyerAssignableAction) => void;
|
|
40
40
|
setCustomFields: (context: RepositoryContext, resource: Writable<AssociateRole>, { name, value }: AssociateRoleSetCustomFieldAction) => void;
|
|
41
41
|
addPermission: (context: RepositoryContext, resource: Writable<AssociateRole>, { permission }: AssociateRoleAddPermissionAction) => void;
|
|
42
42
|
removePermission: (context: RepositoryContext, resource: Writable<AssociateRole>, { permission }: AssociateRoleRemovePermissionAction) => void;
|
|
@@ -274,9 +274,9 @@ declare class ProductProjectionSearch {
|
|
|
274
274
|
* - counting products
|
|
275
275
|
* - correct dataType
|
|
276
276
|
*/
|
|
277
|
-
termFacet(facet: string, products: ProductProjection[]): TermFacetResult;
|
|
278
|
-
filterFacet(source: string, filters: FilterExpression[] | undefined, products: ProductProjection[]): FilteredFacetResult;
|
|
279
|
-
rangeFacet(source: string, ranges: RangeExpression[] | undefined, products: ProductProjection[]): RangeFacetResult;
|
|
277
|
+
termFacet(facet: string, products: ProductProjection[], countProducts: boolean): TermFacetResult;
|
|
278
|
+
filterFacet(source: string, filters: FilterExpression[] | undefined, products: ProductProjection[], countProducts: boolean): FilteredFacetResult;
|
|
279
|
+
rangeFacet(source: string, ranges: RangeExpression[] | undefined, products: ProductProjection[], countProducts: boolean): RangeFacetResult;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
type ProductProjectionQueryParams = {
|
|
@@ -285,7 +285,7 @@ type ProductProjectionQueryParams = {
|
|
|
285
285
|
priceCountry?: string;
|
|
286
286
|
priceCustomerGroup?: string;
|
|
287
287
|
priceChannel?: string;
|
|
288
|
-
localeProjection?: string
|
|
288
|
+
localeProjection?: string;
|
|
289
289
|
storeProjection?: string;
|
|
290
290
|
expand?: string | string[];
|
|
291
291
|
sort?: string | string[];
|
|
@@ -308,7 +308,7 @@ declare class ProductProjectionRepository extends AbstractResourceRepository<'pr
|
|
|
308
308
|
limit: number;
|
|
309
309
|
results: ProductProjection[];
|
|
310
310
|
};
|
|
311
|
-
search(context: RepositoryContext, query:
|
|
311
|
+
search(context: RepositoryContext, query: ProductProjectionQueryParams): ctp.ProductProjectionPagedSearchResponse;
|
|
312
312
|
actions: {};
|
|
313
313
|
}
|
|
314
314
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import * as ctp from '@commercetools/platform-sdk';
|
|
3
3
|
import { Project, ResourceIdentifier, QueryParam, AssociateRoleDraft, AssociateRole, AssociateRoleSetNameAction, AssociateRoleSetPermissionsAction, AssociateRoleChangeBuyerAssignableAction, AssociateRoleSetCustomFieldAction, AssociateRoleAddPermissionAction, AssociateRoleRemovePermissionAction, AttributeGroupDraft, AttributeGroup, AttributeGroupSetAttributesAction, AttributeGroupChangeNameAction, AttributeGroupSetDescriptionAction, AttributeGroupSetKeyAction, BusinessUnit, CartDraft, Cart, CartAddLineItemAction, CartChangeLineItemQuantityAction, CartRemoveLineItemAction, CartSetBillingAddressAction, CartSetShippingMethodAction, CartSetCountryAction, CartSetCustomerEmailAction, CartSetCustomFieldAction, CartSetCustomTypeAction, CartSetLocaleAction, CartSetShippingAddressAction, LineItemDraft, LineItem, CartDiscountDraft, CartDiscount, CartDiscountUpdateAction, AssetDraft, Asset, CategoryDraft, Category, CategoryChangeAssetNameAction, CategoryChangeSlugAction, CategorySetKeyAction, CategorySetAssetDescriptionAction, CategorySetAssetSourcesAction, CategorySetDescriptionAction, CategorySetMetaDescriptionAction, CategorySetMetaKeywordsAction, CategorySetMetaTitleAction, CategorySetCustomTypeAction, CategorySetCustomFieldAction, CategoryRemoveAssetAction, CategoryAddAssetAction, ChannelDraft, Channel, ChannelUpdateAction, CustomObjectDraft, CustomObject, CustomerDraft, Customer, CustomerChangeEmailAction, CustomerSetAuthenticationModeAction, CustomerSetCustomFieldAction, CustomerGroupDraft, CustomerGroup, CustomerGroupSetKeyAction, CustomerGroupChangeNameAction, CustomerGroupSetCustomTypeAction, CustomerGroupSetCustomFieldAction, DiscountCodeDraft, DiscountCode, DiscountCodeUpdateAction, Extension, ExtensionDraft, ExtensionUpdateAction, InventoryEntryDraft, InventoryEntry, InventoryEntryChangeQuantityAction, InventoryEntrySetExpectedDeliveryAction, InventoryEntrySetCustomFieldAction, InventoryEntrySetCustomTypeAction, InventoryEntrySetRestockableInDaysAction, OrderFromCartDraft, Order, CartReference, OrderImportDraft, OrderAddPaymentAction, OrderChangeOrderStateAction, OrderChangePaymentStateAction, OrderTransitionStateAction, OrderSetBillingAddressAction, OrderSetCustomerEmailAction, OrderSetCustomFieldAction, OrderSetCustomTypeAction, OrderSetLocaleAction, OrderSetOrderNumberAction, OrderSetShippingAddressAction, OrderSetStoreAction, MyOrderFromCartDraft, OrderEditDraft, OrderEdit, OrderEditUpdateAction, PaymentDraft, Payment, TransactionDraft, Transaction, PaymentSetCustomFieldAction, PaymentSetCustomTypeAction, PaymentAddTransactionAction, PaymentChangeTransactionStateAction, PaymentTransitionStateAction, ProductDraft, Product, ProductUpdateAction, ProductDiscountDraft, ProductDiscount, ProductDiscountUpdateAction, ProductProjectionPagedSearchResponse, ProductProjection, FacetResults, TermFacetResult, FilteredFacetResult, RangeFacetResult, ProductSelectionDraft, ProductSelection, ReviewUpdateAction, Review, ProductTypeDraft, ProductType, AttributeDefinitionDraft, AttributeDefinition, ProductTypeUpdateAction, ProjectUpdateAction, QuoteDraft, Quote, QuoteUpdateAction, QuoteRequestDraft, QuoteRequest, QuoteRequestUpdateAction, ReviewDraft, ShippingMethodDraft, ShippingMethod, ShippingMethodUpdateAction, ShoppingListDraft, ShoppingList, StagedQuoteDraft, StagedQuote, StagedQuoteUpdateAction, StandalonePriceDraft, StandalonePrice, ChannelResourceIdentifier, ChannelReference, DiscountedPriceDraft, StandalonePriceChangeActiveAction, StandalonePriceChangeValueAction, StandalonePriceSetDiscountedPriceAction, StateDraft, State, StateUpdateAction, StoreDraft, Store, StoreUpdateAction, SubscriptionDraft, Subscription, TaxCategoryDraft, TaxCategory, TaxCategoryUpdateAction, TypeDraft, Type, TypeUpdateAction, ZoneDraft, Zone, ZoneUpdateAction, BaseResource, UpdateAction } from '@commercetools/platform-sdk';
|
|
4
|
-
import { ParsedQs } from 'qs';
|
|
5
4
|
|
|
6
5
|
type GetParams$1 = {
|
|
7
6
|
expand?: string[];
|
|
@@ -37,6 +36,7 @@ declare class AssociateRoleRepository extends AbstractResourceRepository<'associ
|
|
|
37
36
|
setName: (context: RepositoryContext, resource: Writable<AssociateRole>, { name }: AssociateRoleSetNameAction) => void;
|
|
38
37
|
setPermissions: (context: RepositoryContext, resource: Writable<AssociateRole>, { permissions }: AssociateRoleSetPermissionsAction) => void;
|
|
39
38
|
setBuyerAssignable: (context: RepositoryContext, resource: Writable<AssociateRole>, { buyerAssignable }: AssociateRoleChangeBuyerAssignableAction) => void;
|
|
39
|
+
changeBuyerAssignable: (context: RepositoryContext, resource: Writable<AssociateRole>, { buyerAssignable }: AssociateRoleChangeBuyerAssignableAction) => void;
|
|
40
40
|
setCustomFields: (context: RepositoryContext, resource: Writable<AssociateRole>, { name, value }: AssociateRoleSetCustomFieldAction) => void;
|
|
41
41
|
addPermission: (context: RepositoryContext, resource: Writable<AssociateRole>, { permission }: AssociateRoleAddPermissionAction) => void;
|
|
42
42
|
removePermission: (context: RepositoryContext, resource: Writable<AssociateRole>, { permission }: AssociateRoleRemovePermissionAction) => void;
|
|
@@ -274,9 +274,9 @@ declare class ProductProjectionSearch {
|
|
|
274
274
|
* - counting products
|
|
275
275
|
* - correct dataType
|
|
276
276
|
*/
|
|
277
|
-
termFacet(facet: string, products: ProductProjection[]): TermFacetResult;
|
|
278
|
-
filterFacet(source: string, filters: FilterExpression[] | undefined, products: ProductProjection[]): FilteredFacetResult;
|
|
279
|
-
rangeFacet(source: string, ranges: RangeExpression[] | undefined, products: ProductProjection[]): RangeFacetResult;
|
|
277
|
+
termFacet(facet: string, products: ProductProjection[], countProducts: boolean): TermFacetResult;
|
|
278
|
+
filterFacet(source: string, filters: FilterExpression[] | undefined, products: ProductProjection[], countProducts: boolean): FilteredFacetResult;
|
|
279
|
+
rangeFacet(source: string, ranges: RangeExpression[] | undefined, products: ProductProjection[], countProducts: boolean): RangeFacetResult;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
type ProductProjectionQueryParams = {
|
|
@@ -285,7 +285,7 @@ type ProductProjectionQueryParams = {
|
|
|
285
285
|
priceCountry?: string;
|
|
286
286
|
priceCustomerGroup?: string;
|
|
287
287
|
priceChannel?: string;
|
|
288
|
-
localeProjection?: string
|
|
288
|
+
localeProjection?: string;
|
|
289
289
|
storeProjection?: string;
|
|
290
290
|
expand?: string | string[];
|
|
291
291
|
sort?: string | string[];
|
|
@@ -308,7 +308,7 @@ declare class ProductProjectionRepository extends AbstractResourceRepository<'pr
|
|
|
308
308
|
limit: number;
|
|
309
309
|
results: ProductProjection[];
|
|
310
310
|
};
|
|
311
|
-
search(context: RepositoryContext, query:
|
|
311
|
+
search(context: RepositoryContext, query: ProductProjectionQueryParams): ctp.ProductProjectionPagedSearchResponse;
|
|
312
312
|
actions: {};
|
|
313
313
|
}
|
|
314
314
|
|
package/dist/index.js
CHANGED
|
@@ -45,14 +45,22 @@ var nestedLookup = (obj, path) => {
|
|
|
45
45
|
}
|
|
46
46
|
return val;
|
|
47
47
|
};
|
|
48
|
-
var
|
|
48
|
+
var queryParamsArray = (input) => {
|
|
49
49
|
if (input == void 0) {
|
|
50
|
-
return
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
const values = Array.isArray(input) ? input : [input];
|
|
53
|
+
if (values.length < 1) {
|
|
54
|
+
return void 0;
|
|
51
55
|
}
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
return values;
|
|
57
|
+
};
|
|
58
|
+
var queryParamsValue = (value) => {
|
|
59
|
+
const values = queryParamsArray(value);
|
|
60
|
+
if (values && values.length > 0) {
|
|
61
|
+
return values[0];
|
|
54
62
|
}
|
|
55
|
-
return
|
|
63
|
+
return void 0;
|
|
56
64
|
};
|
|
57
65
|
var cloneObject = (o) => JSON.parse(JSON.stringify(o));
|
|
58
66
|
|
|
@@ -1734,6 +1742,9 @@ var AssociateRoleRepository = class extends AbstractResourceRepository {
|
|
|
1734
1742
|
setBuyerAssignable: (context, resource, { buyerAssignable }) => {
|
|
1735
1743
|
resource.buyerAssignable = buyerAssignable;
|
|
1736
1744
|
},
|
|
1745
|
+
changeBuyerAssignable: (context, resource, { buyerAssignable }) => {
|
|
1746
|
+
resource.buyerAssignable = buyerAssignable;
|
|
1747
|
+
},
|
|
1737
1748
|
setCustomFields: (context, resource, { name, value }) => {
|
|
1738
1749
|
if (!resource.custom) {
|
|
1739
1750
|
return;
|
|
@@ -4182,25 +4193,36 @@ var ProductProjectionSearch = class {
|
|
|
4182
4193
|
getFacets(params, products) {
|
|
4183
4194
|
if (!params.facet)
|
|
4184
4195
|
return {};
|
|
4185
|
-
const staged = false;
|
|
4186
4196
|
const result = {};
|
|
4187
|
-
|
|
4197
|
+
const regexp = new RegExp(/ counting products$/);
|
|
4198
|
+
for (let facet of params.facet) {
|
|
4199
|
+
let countProducts = false;
|
|
4200
|
+
if (facet.endsWith(" counting products")) {
|
|
4201
|
+
facet = facet.replace(regexp, "");
|
|
4202
|
+
countProducts = true;
|
|
4203
|
+
}
|
|
4188
4204
|
const expression = generateFacetFunc(facet);
|
|
4189
4205
|
if (expression.type === "TermExpression") {
|
|
4190
|
-
result[facet] = this.termFacet(
|
|
4206
|
+
result[facet] = this.termFacet(
|
|
4207
|
+
expression.source,
|
|
4208
|
+
products,
|
|
4209
|
+
countProducts
|
|
4210
|
+
);
|
|
4191
4211
|
}
|
|
4192
4212
|
if (expression.type === "RangeExpression") {
|
|
4193
4213
|
result[expression.source] = this.rangeFacet(
|
|
4194
4214
|
expression.source,
|
|
4195
4215
|
expression.children,
|
|
4196
|
-
products
|
|
4216
|
+
products,
|
|
4217
|
+
countProducts
|
|
4197
4218
|
);
|
|
4198
4219
|
}
|
|
4199
4220
|
if (expression.type === "FilterExpression") {
|
|
4200
4221
|
result[expression.source] = this.filterFacet(
|
|
4201
4222
|
expression.source,
|
|
4202
4223
|
expression.children,
|
|
4203
|
-
products
|
|
4224
|
+
products,
|
|
4225
|
+
countProducts
|
|
4204
4226
|
);
|
|
4205
4227
|
}
|
|
4206
4228
|
}
|
|
@@ -4211,7 +4233,7 @@ var ProductProjectionSearch = class {
|
|
|
4211
4233
|
* - counting products
|
|
4212
4234
|
* - correct dataType
|
|
4213
4235
|
*/
|
|
4214
|
-
termFacet(facet, products) {
|
|
4236
|
+
termFacet(facet, products, countProducts) {
|
|
4215
4237
|
const result = {
|
|
4216
4238
|
type: "terms",
|
|
4217
4239
|
dataType: "text",
|
|
@@ -4256,7 +4278,7 @@ var ProductProjectionSearch = class {
|
|
|
4256
4278
|
}
|
|
4257
4279
|
return result;
|
|
4258
4280
|
}
|
|
4259
|
-
filterFacet(source, filters, products) {
|
|
4281
|
+
filterFacet(source, filters, products, countProducts) {
|
|
4260
4282
|
let count = 0;
|
|
4261
4283
|
if (source.startsWith("variants.")) {
|
|
4262
4284
|
for (const p of products) {
|
|
@@ -4275,7 +4297,7 @@ var ProductProjectionSearch = class {
|
|
|
4275
4297
|
count
|
|
4276
4298
|
};
|
|
4277
4299
|
}
|
|
4278
|
-
rangeFacet(source, ranges, products) {
|
|
4300
|
+
rangeFacet(source, ranges, products, countProducts) {
|
|
4279
4301
|
const counts = ranges?.map((range) => {
|
|
4280
4302
|
if (source.startsWith("variants.")) {
|
|
4281
4303
|
const values = [];
|
|
@@ -4397,16 +4419,7 @@ var ProductProjectionRepository = class extends AbstractResourceRepository {
|
|
|
4397
4419
|
};
|
|
4398
4420
|
}
|
|
4399
4421
|
search(context, query) {
|
|
4400
|
-
|
|
4401
|
-
filter: QueryParamsAsArray(query.filter),
|
|
4402
|
-
"filter.query": QueryParamsAsArray(query["filter.query"]),
|
|
4403
|
-
facet: QueryParamsAsArray(query.facet),
|
|
4404
|
-
offset: query.offset ? Number(query.offset) : void 0,
|
|
4405
|
-
limit: query.limit ? Number(query.limit) : void 0,
|
|
4406
|
-
expand: QueryParamsAsArray(query.expand),
|
|
4407
|
-
staged: query.staged === "true"
|
|
4408
|
-
});
|
|
4409
|
-
return results;
|
|
4422
|
+
return this._searchService.search(context.projectKey, query);
|
|
4410
4423
|
}
|
|
4411
4424
|
actions = {};
|
|
4412
4425
|
};
|
|
@@ -5411,12 +5424,7 @@ var AbstractService = class {
|
|
|
5411
5424
|
}
|
|
5412
5425
|
// No idea what i'm doing
|
|
5413
5426
|
_parseParam(value) {
|
|
5414
|
-
|
|
5415
|
-
return value;
|
|
5416
|
-
} else if (value !== void 0) {
|
|
5417
|
-
return [`${value}`];
|
|
5418
|
-
}
|
|
5419
|
-
return void 0;
|
|
5427
|
+
return queryParamsArray(value);
|
|
5420
5428
|
}
|
|
5421
5429
|
};
|
|
5422
5430
|
|
|
@@ -5859,9 +5867,25 @@ var ProductProjectionService = class extends AbstractService {
|
|
|
5859
5867
|
return response.status(200).send(result);
|
|
5860
5868
|
}
|
|
5861
5869
|
search(request, response) {
|
|
5870
|
+
const query = request.query;
|
|
5871
|
+
const searchParams = {
|
|
5872
|
+
filter: queryParamsArray(query.filter),
|
|
5873
|
+
"filter.query": queryParamsArray(query["filter.query"]),
|
|
5874
|
+
facet: queryParamsArray(query.facet),
|
|
5875
|
+
expand: queryParamsArray(query.expand),
|
|
5876
|
+
staged: queryParamsValue(query.staged) === "true",
|
|
5877
|
+
localeProjection: queryParamsValue(query.localeProjection),
|
|
5878
|
+
storeProjection: queryParamsValue(query.storeProjection),
|
|
5879
|
+
priceChannel: queryParamsValue(query.priceChannel),
|
|
5880
|
+
priceCountry: queryParamsValue(query.priceCountry),
|
|
5881
|
+
priceCurrency: queryParamsValue(query.priceCurrency),
|
|
5882
|
+
priceCustomerGroup: queryParamsValue(query.priceCustomerGroup),
|
|
5883
|
+
offset: query.offset ? Number(queryParamsValue(query.offset)) : void 0,
|
|
5884
|
+
limit: query.limit ? Number(queryParamsValue(query.limit)) : void 0
|
|
5885
|
+
};
|
|
5862
5886
|
const resource = this.repository.search(
|
|
5863
5887
|
getRepositoryContext(request),
|
|
5864
|
-
|
|
5888
|
+
searchParams
|
|
5865
5889
|
);
|
|
5866
5890
|
return response.status(200).send(resource);
|
|
5867
5891
|
}
|