UNPKG

shopify-admin-api

Version:

Shopify Admin API is a NodeJS library built to help developers easily authenticate and make calls against the Shopify API. It was inspired by and borrows heavily from ShopifySharp.

42 lines (41 loc) 1.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Locations = void 0; const infrastructure_1 = require("../infrastructure"); /** * A service for manipulating a shops Locations API. */ class Locations extends infrastructure_1.BaseService { constructor(shopDomain, accessToken) { super(shopDomain, accessToken, "locations"); } /** * Gets a location with the given id. * @param id Id of the location being retrieved. * @param options Options for filtering the result. */ get(id, options) { return this.createRequest("GET", `${id}.json`, "location", options); } /** * Lists up to 250 locations. * @param options Options for filtering the results. */ list(options) { return this.createRequest("GET", `.json`, "locations", options); } /** * Counts the amount of locations. */ count() { return this.createRequest("GET", `count.json`, "count"); } /** * Lists all the inventory levels on a location. */ inventoryLevels(locationId) { return this.createRequest("GET", `${locationId}/inventory_levels.json`, "inventory_levels"); } } exports.Locations = Locations; exports.default = Locations;