UNPKG

@shopify/cli-kit

Version:

A set of utilities, interfaces, and models that are common across all the platform features

51 lines (50 loc) 2.54 kB
import { Result, Checksum, Key, Theme, ThemeAsset } from './types.js'; import { MetafieldOwnerType } from '../../../cli/api/graphql/admin/generated/types.js'; import { AdminSession } from '../session.js'; export type ThemeParams = Partial<Pick<Theme, 'name' | 'role' | 'processing' | 'src'>>; export type AssetParams = Pick<ThemeAsset, 'key'> & Partial<Pick<ThemeAsset, 'value' | 'attachment'>>; export declare function fetchTheme(id: number, session: AdminSession): Promise<Theme | undefined>; export declare function fetchThemes(session: AdminSession): Promise<Theme[]>; export declare function themeCreate(params: ThemeParams, session: AdminSession): Promise<Theme | undefined>; export declare function fetchThemeAssets(id: number, filenames: Key[], session: AdminSession): Promise<ThemeAsset[]>; export declare function deleteThemeAssets(id: number, filenames: Key[], session: AdminSession): Promise<Result[]>; export declare function bulkUploadThemeAssets(id: number, assets: AssetParams[], session: AdminSession): Promise<Result[]>; export declare function fetchChecksums(id: number, session: AdminSession): Promise<Checksum[]>; export declare function themeUpdate(id: number, params: ThemeParams, session: AdminSession): Promise<Theme | undefined>; export declare function themePublish(id: number, session: AdminSession): Promise<Theme | undefined>; export declare function themeDelete(id: number, session: AdminSession): Promise<boolean | undefined>; export interface ThemeDuplicateResult { theme?: Theme; userErrors: { field?: string[] | null; message: string; }[]; requestId?: string; } export declare function themeDuplicate(id: number, name: string | undefined, session: AdminSession): Promise<ThemeDuplicateResult>; export declare function metafieldDefinitionsByOwnerType(type: MetafieldOwnerType, session: AdminSession): Promise<{ key: string; namespace: string; name: string; description: string | null | undefined; type: { name: string; category: string; }; }[]>; export declare function passwordProtected(session: AdminSession): Promise<boolean>; type OnlineStoreThemeFileBody = { __typename: 'OnlineStoreThemeFileBodyBase64'; contentBase64: string; } | { __typename: 'OnlineStoreThemeFileBodyText'; content: string; } | { __typename: 'OnlineStoreThemeFileBodyUrl'; url: string; }; export declare function parseThemeFileContent(body: OnlineStoreThemeFileBody): Promise<{ value?: string; attachment?: string; }>; export {};