@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
55 lines (52 loc) • 2.56 kB
JavaScript
;
var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs');
// src/resources/talon_one_accounts.ts
var TalonOneAccounts = class _TalonOneAccounts extends chunkU22VLCMN_cjs.ApiResource {
static TYPE = "talon_one_accounts";
async create(resource, params, options) {
return this.resources.create({ ...resource, type: _TalonOneAccounts.TYPE }, params, options);
}
async update(resource, params, options) {
return this.resources.update({ ...resource, type: _TalonOneAccounts.TYPE }, params, options);
}
async delete(id, options) {
await this.resources.delete(typeof id === "string" ? { id, type: _TalonOneAccounts.TYPE } : id, options);
}
async markets(talonOneAccountId, params, options) {
const _talonOneAccountId = talonOneAccountId.id || talonOneAccountId;
return this.resources.fetch({ type: "markets" }, `talon_one_accounts/${_talonOneAccountId}/markets`, params, options);
}
async discount_engine_items(talonOneAccountId, params, options) {
const _talonOneAccountId = talonOneAccountId.id || talonOneAccountId;
return this.resources.fetch({ type: "discount_engine_items" }, `talon_one_accounts/${_talonOneAccountId}/discount_engine_items`, params, options);
}
async attachments(talonOneAccountId, params, options) {
const _talonOneAccountId = talonOneAccountId.id || talonOneAccountId;
return this.resources.fetch({ type: "attachments" }, `talon_one_accounts/${_talonOneAccountId}/attachments`, params, options);
}
async versions(talonOneAccountId, params, options) {
const _talonOneAccountId = talonOneAccountId.id || talonOneAccountId;
return this.resources.fetch({ type: "versions" }, `talon_one_accounts/${_talonOneAccountId}/versions`, params, options);
}
async event_stores(talonOneAccountId, params, options) {
const _talonOneAccountId = talonOneAccountId.id || talonOneAccountId;
return this.resources.fetch({ type: "event_stores" }, `talon_one_accounts/${_talonOneAccountId}/event_stores`, params, options);
}
isTalonOneAccount(resource) {
return resource.type && resource.type === _TalonOneAccounts.TYPE;
}
relationship(id) {
return super.relationshipOneToOne(id);
}
relationshipToMany(...ids) {
return super.relationshipOneToMany(...ids);
}
type() {
return _TalonOneAccounts.TYPE;
}
};
var instance = new TalonOneAccounts();
var talon_one_accounts_default = instance;
exports.talon_one_accounts_default = talon_one_accounts_default;
//# sourceMappingURL=chunk-IQQNG3U2.cjs.map
//# sourceMappingURL=chunk-IQQNG3U2.cjs.map