UNPKG

@pfantato/printful-ts

Version:

Typescript SDK to integrate with Printful

21 lines (20 loc) 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StoresService = void 0; const constants_1 = require("@printful-ts/constants"); const schemas_1 = require("@printful-ts/schemas"); const printful_api_service_1 = require("./printful-api.service"); class StoresService extends printful_api_service_1.PrintfulApiService { async listStores(store_id, options = {}) { return await this.request(constants_1.STORES_RESOURCE, Object.assign(Object.assign({}, options), { store_id }), schemas_1.ListStoresResponse); } async getStore(store_id, options = {}) { return await this.request(`${constants_1.STORES_RESOURCE}/${store_id}`, Object.assign(Object.assign({}, options), { store_id }), schemas_1.GetStoreResponse); } async getStoreStatistics(store_id, params, options = {}) { const searchParams = schemas_1.GetStoreStatisticsSearchParams.parse(params); return await this.request(`${constants_1.STORES_RESOURCE}/${store_id}/statistics`, Object.assign(Object.assign({}, options), { store_id, searchParams }), schemas_1.GetStoreStatisticsResponse); } } exports.StoresService = StoresService;