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.
68 lines (67 loc) • 2.34 kB
TypeScript
import * as Options from '../options';
import { BaseService } from '../infrastructure';
import { Comment } from '../interfaces';
/**
* A service for manipulating Shopify's Blog Comments API.
*/
export declare class Comments extends BaseService {
constructor(shopDomain: string, accessToken: string);
/**
* Creates a comment for an article.
* @param comment partial comment object with properties for creation
*
* required fields:
* * body (is rendered from Textile markup into HTML in `body_html` field),
* * author
* * email
*/
create(comment: Partial<Comment>): Promise<Comment>;
/**
* Updates a comment of an article.
* @param id The id of the comment to update.
* @param comment partial comment object with properties to update
*/
update(id: number, comment: Partial<Comment>): Promise<Comment>;
/**
* Gets a count of comments
* @param options Options for filtering the result.
*/
count(options?: Options.CommentCountOptions): Promise<Comment>;
/**
* Gets a commect with the given id.
* @param id The id of the comment to get.
* @param options Options for filtering the result.
*/
get(id: number, options?: Options.CommentGetOptions): Promise<Comment>;
/**
* Retrieves a list of up to 250 comments.
* @param options Options for pagination and filtering the result.
*/
list(options?: Options.CommentListOptions): Promise<Comment[]>;
/**
* Marks the commect with the given id as spam.
* @param id The id of the comment to mark as spam.
*/
spam(id: number): Promise<Comment>;
/**
* Marks the commect with the given id as not spam.
* @param id The id of the comment to mark as not spam.
*/
notSpam(id: number): Promise<Comment>;
/**
* Approves the comment with the given id.
* @param id The id of the comment to approve.
*/
approve(id: number): Promise<Comment>;
/**
* Removes the comment with the given id.
* @param id The id of the comment to remove.
*/
remove(id: number): Promise<Comment>;
/**
* Restores the removed comment with the given id.
* @param id The id of the removed comment to restore.
*/
restore(id: number): Promise<Comment>;
}
export default Comments;