UNPKG

shipstation-node

Version:
45 lines (44 loc) 1.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Tags = void 0; const BaseResource_1 = require("../../BaseResource"); /** * [Official Documentation](https://docs.shipstation.com/openapi/tags) * * Tags are text-based identifiers you can add to shipments to help in your shipment management workflows. */ class Tags extends BaseResource_1.BaseResource { constructor(shipstation) { super(shipstation, 'tags'); } /** * [Official Documentation](https://docs.shipstation.com/openapi/tags/list_tags) * * Get a list of all tags associated with an account. * * @returns A list of tags for the account. */ async get() { return this.shipstation.request({ url: this.baseUrl, method: 'GET' }); } /** * [Official Documentation](https://docs.shipstation.com/openapi/tags/create_tag) * * Create a new Tag for customizing how you track your shipments * * @param tagName Tags are arbitrary strings that you can use to categorize shipments. For example, you may want to * use tags to distinguish between domestic and international shipments, or between insured and uninsured shipments. * Or maybe you want to create a tag for each of your customers so you can easily retrieve every shipment for a * customer. */ async create(tagName) { return this.shipstation.request({ url: `${this.baseUrl}/${tagName}`, method: 'POST' }); } } exports.Tags = Tags;