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.

48 lines (47 loc) 1.55 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CarrierServices = void 0; const infrastructure_1 = require("../infrastructure"); /** * A service for manipulating Shopify's CarrierService API. */ class CarrierServices extends infrastructure_1.BaseService { constructor(shopDomain, accessToken) { super(shopDomain, accessToken, "carrier_services"); } /** * Creates a new Carrier Service. */ create(carrierService) { return this.createRequest("POST", ".json", "carrier_service", { carrier_service: carrierService }); } /** * Updates a new Carrier Service. */ update(id, carrierService) { return this.createRequest("PUT", `${id}.json`, "carrier_service", { carrier_service: carrierService }); } /** * Gets a carrier service with the given id. * @param id The id of the carrier servuce to get. */ get(id) { return this.createRequest("GET", `${id}.json`, "carrier_service"); } /** * Deletes a carrier service with the given id. * @param id The id of the carrier service to delete. * @return Promise<{}> returns an empty object on success */ delete(id) { return this.createRequest("DELETE", `${id}.json`, "carrier_service"); } /** * Retrieves a list of carrier services for the shop. */ list() { return this.createRequest("GET", `.json`, "carrier_service"); } } exports.CarrierServices = CarrierServices; exports.default = CarrierServices;