"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const sdk_1 = require("../sdk");
var Products;
(function (Products) {
    function findByCategoryId(categoryId) {
        return sdk_1.clientExecute({
            uri: sdk_1.getServices()
                .productProjectionsSearch.filter(`categories.id:subtree("${categoryId}")`)
                .perPage(20)
                .build(),
            method: sdk_1.methods.GET
        });
    }
    Products.findByCategoryId = findByCategoryId;
    function findBySearchQuery(q, language = 'en') {
        return sdk_1.clientExecute({
            uri: sdk_1.getServices()
                .productProjectionsSearch.text(q, language)
                .fuzzy(true)
                .perPage(20)
                .build(),
            method: sdk_1.methods.GET
        });
    }
    Products.findBySearchQuery = findBySearchQuery;
    function findById(productId) {
        return sdk_1.clientExecute({
            uri: sdk_1.getServices()
                .productProjections.byId(productId)
                .build(),
            method: sdk_1.methods.GET
        });
    }
    Products.findById = findById;
})(Products = exports.Products || (exports.Products = {}));
//# sourceMappingURL=products.js.map