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.
52 lines (51 loc) • 1.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Themes = void 0;
const infrastructure_1 = require("../infrastructure");
/**
* A service for manage Shopify shop's theme.
*/
class Themes extends infrastructure_1.BaseService {
constructor(shopDomain, accessToken) {
super(shopDomain, accessToken, 'themes');
}
/**
* Creates a theme by providing the public URL of a ZIP file that contains the theme.
* @param themes The theme being created.
*/
create(theme) {
return this.createRequest('POST', `.json`, '', { theme });
}
/**
* Gets a tsingle hemes with the given id.
* @param id Id of the theme to retrieve.
* @param options Options for filtering the result.
*/
get(id, options) {
return this.createRequest('GET', `${id}.json`, '', options);
}
/**
* Updates an existing theme.
* @param id Id of the themes being updated.
* @param themes The updated theme.
*/
update(id, themes) {
return this.createRequest('PUT', `${id}.json`, 'themes', { themes });
}
/**
* Gets a list of all themes on the shop.
* @param options Options for filtering the results.
*/
list(options) {
return this.createRequest('GET', `.json`, 'themes', options);
}
/**
* Deletes the themes with the given id.
* @param id Id of the theme being deleted.
*/
delete(id) {
return this.createRequest('DELETE', `${id}.json`);
}
}
exports.Themes = Themes;
exports.default = Themes;