@vtex/api
Version:
VTEX I/O API client
38 lines (37 loc) • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Catalog = void 0;
const HttpClient_1 = require("../../../HttpClient");
const JanusClient_1 = require("../JanusClient");
const BASE_URL = '/api/catalog_system';
const routes = {
salesChannel: (salesChannelId) => `${BASE_URL}/pub/saleschannel/${salesChannelId}`,
defaultSalesChannel: () => `${BASE_URL}/pub/saleschannel/default`,
};
class Catalog extends JanusClient_1.JanusClient {
getSalesChannel(id, config) {
const metric = 'catalog-saleschannel';
return this.http.get(routes.salesChannel(id), {
inflightKey: HttpClient_1.inflightUrlWithQuery,
metric,
...config,
tracing: {
requestSpanNameSuffix: metric,
...config === null || config === void 0 ? void 0 : config.tracing,
},
});
}
getDefaultSalesChannel(config) {
const metric = 'catalog-saleschannel-default';
return this.http.get(routes.defaultSalesChannel(), {
inflightKey: HttpClient_1.inflightUrlWithQuery,
metric,
...config,
tracing: {
requestSpanNameSuffix: metric,
...config === null || config === void 0 ? void 0 : config.tracing,
},
});
}
}
exports.Catalog = Catalog;