0.2.0
Deno lib for Shopify
Repository
Current version released
4 years ago
Versions
Deno Shopify
Configuration
import { Shopify } from "https://deno.land/x/deno_shopify@v0.1.2/mod.ts";
const shop = new Shopify({
apiKey: "...",
password: "...",
myshopify: "[...].myshopify.com",
});
Themes
Get all themes
Returns an object array of Theme
getThemes(): Promise<Theme[]>
Get theme
Returns the Theme associated object
getTheme(themeId: number): Promise<Theme>
Get the main theme
Returns the actual main Theme of your Shop
mainTheme(): Promise<Theme | null>
Create theme
Create and returns a new Theme.
Shopify documentation
createTheme(theme: {
name: string;
src: string;
role: "main" | "unpublished"
}): Promise<Theme>
Update theme
Update and returns a Theme.
Shopify documentation
async updateTheme(
themeId: number,
config: {
name?: string;
role?: "main" | "unpublished"
},
): Promise<Theme>
Delete theme
Delete and returns a Theme.
Shopify documentation
async deleteTheme(themeId: string): Promise<Theme>
Assets
Get an asset
Retrieve an Asset.
Shopify documentation object
async getAssets(themeId: number): Promise<Asset[]>
Create an asset
Create and returns an Asset.
Shopify documentation object
async createAsset(
themeId: number,
path: string,
value: {
value?: string;
attachment?: string;
src?: string;
source_key?: string;
},
): Promise<Asset>
Delete an asset
async deleteAsset(
themeId: string,
path: string,
): Promise<{ message: string }>
Pages
Get pages
Returns an object array of Page with Endpoints
getPages(params?: PageEndpoints): Promise<Page[]>
Get page
Returns the Page associated object with Endpoints
async getPage(pageId: number): Promise<Page>
Count pages
Returns the number of pages with Endpoints
async countPages(params?: PageEndpoints): Promise<number>
Create page
Create a new Page
async createPage(params: PageCreate): Promise<Page>
Update page
Update a Page
async updatePage(pageId: number, params: PageCreate): Promise<Page>
Delete page
Delete a Page
async deletePage(pageId: number): Promise<void>