mirror of
https://github.com/vercel/commerce.git
synced 2025-07-25 11:11:24 +00:00
.vscode
assets
components
config
framework
bigcommerce
commerce
saleor
shopify
swell
vendure
api
endpoints
operations
get-all-pages.ts
get-all-product-paths.ts
get-all-products.ts
get-customer-wishlist.ts
get-page.ts
get-product.ts
get-site-info.ts
login.ts
utils
index.ts
auth
cart
customer
product
types
utils
wishlist
.env.template
README.md
codegen.json
commerce.config.json
fetcher.ts
index.tsx
next.config.js
provider.ts
schema.d.ts
schema.graphql
lib
pages
public
.editorconfig
.env.template
.gitignore
.prettierignore
.prettierrc
README.md
codegen.bigcommerce.json
codegen.json
commerce.config.json
global.d.ts
license.md
next-env.d.ts
next.config.js
package.json
postcss.config.js
tailwind.config.js
tsconfig.json
yarn.lock
42 lines
949 B
TypeScript
42 lines
949 B
TypeScript
import { VendureConfig } from '../'
|
|
import { OperationContext } from '@commerce/api/operations'
|
|
import { Provider } from '../../../bigcommerce/api'
|
|
|
|
export type Page = any
|
|
|
|
export type GetAllPagesResult<
|
|
T extends { pages: any[] } = { pages: Page[] }
|
|
> = T
|
|
|
|
export default function getAllPagesOperation({
|
|
commerce,
|
|
}: OperationContext<Provider>) {
|
|
async function getAllPages(opts?: {
|
|
config?: Partial<VendureConfig>
|
|
preview?: boolean
|
|
}): Promise<GetAllPagesResult>
|
|
|
|
async function getAllPages<T extends { pages: any[] }>(opts: {
|
|
url: string
|
|
config?: Partial<VendureConfig>
|
|
preview?: boolean
|
|
}): Promise<GetAllPagesResult<T>>
|
|
|
|
async function getAllPages({
|
|
config: cfg,
|
|
preview,
|
|
}: {
|
|
url?: string
|
|
config?: Partial<VendureConfig>
|
|
preview?: boolean
|
|
} = {}): Promise<GetAllPagesResult> {
|
|
const config = commerce.getConfig(cfg)
|
|
|
|
return {
|
|
pages: [],
|
|
}
|
|
}
|
|
|
|
return getAllPages
|
|
}
|