UNPKG

@commercelayer/sdk

Version:
59 lines (56 loc) 2.69 kB
'use strict'; var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs'); // src/resources/taxjar_accounts.ts var TaxjarAccounts = class _TaxjarAccounts extends chunkU22VLCMN_cjs.ApiResource { static TYPE = "taxjar_accounts"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _TaxjarAccounts.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _TaxjarAccounts.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _TaxjarAccounts.TYPE } : id, options); } async markets(taxjarAccountId, params, options) { const _taxjarAccountId = taxjarAccountId.id || taxjarAccountId; return this.resources.fetch({ type: "markets" }, `taxjar_accounts/${_taxjarAccountId}/markets`, params, options); } async attachments(taxjarAccountId, params, options) { const _taxjarAccountId = taxjarAccountId.id || taxjarAccountId; return this.resources.fetch({ type: "attachments" }, `taxjar_accounts/${_taxjarAccountId}/attachments`, params, options); } async events(taxjarAccountId, params, options) { const _taxjarAccountId = taxjarAccountId.id || taxjarAccountId; return this.resources.fetch({ type: "events" }, `taxjar_accounts/${_taxjarAccountId}/events`, params, options); } async versions(taxjarAccountId, params, options) { const _taxjarAccountId = taxjarAccountId.id || taxjarAccountId; return this.resources.fetch({ type: "versions" }, `taxjar_accounts/${_taxjarAccountId}/versions`, params, options); } async event_stores(taxjarAccountId, params, options) { const _taxjarAccountId = taxjarAccountId.id || taxjarAccountId; return this.resources.fetch({ type: "event_stores" }, `taxjar_accounts/${_taxjarAccountId}/event_stores`, params, options); } async tax_categories(taxjarAccountId, params, options) { const _taxjarAccountId = taxjarAccountId.id || taxjarAccountId; return this.resources.fetch({ type: "tax_categories" }, `taxjar_accounts/${_taxjarAccountId}/tax_categories`, params, options); } isTaxjarAccount(resource) { return resource.type && resource.type === _TaxjarAccounts.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _TaxjarAccounts.TYPE; } }; var instance = new TaxjarAccounts(); var taxjar_accounts_default = instance; exports.taxjar_accounts_default = taxjar_accounts_default; //# sourceMappingURL=chunk-KT2FGWBT.cjs.map //# sourceMappingURL=chunk-KT2FGWBT.cjs.map