Create needed files

This commit is contained in:
goncy
2021-08-27 14:10:55 -03:00
parent 017380515c
commit f428d5d5d4
8 changed files with 63 additions and 12 deletions

View File

@@ -0,0 +1,22 @@
import type { OrdercloudConfig } from '../'
import { GetAllPagesOperation } from '@commerce/types/page'
export type Page = { url: string }
export type GetAllPagesResult = { pages: Page[] }
export default function getAllPagesOperation() {
async function getAllPages<T extends GetAllPagesOperation>({
config,
preview,
}: {
url?: string
config?: Partial<OrdercloudConfig>
preview?: boolean
} = {}): Promise<T['data']> {
return Promise.resolve({
pages: [],
})
}
return getAllPages
}

View File

@@ -0,0 +1,15 @@
import { GetPageOperation } from "@commerce/types/page"
export type Page = any
export type GetPageResult = { page?: Page }
export type PageVariables = {
id: number
}
export default function getPageOperation() {
async function getPage<T extends GetPageOperation>(): Promise<T['data']> {
return Promise.resolve({})
}
return getPage
}

View File

@@ -1,3 +1,5 @@
export { default as getAllPages } from './get-all-pages'
export { default as getPage } from './get-page'
export { default as getSiteInfo } from './get-site-info'
export { default as getProduct } from './get-product'
export { default as getAllProducts } from './get-all-products'