mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
merge main (#1)
* Update README.md to include information on how to add a custom provider (#250) * Update README.md * Updated commerce readme Co-authored-by: Luis Alvarez D <luis@vercel.com> * Remove unused provider config (#459) * Updated core types for commerce provider * Updated bigcommerce provider * Added util method for provider creation * Removed unrequired code from saleor * Updated shopify provider * Updated providers and local setup * Updated saleor setup * Updated swell * Updated vendure * Updated swell-js usage * Removed unrequired import from saleor Co-authored-by: Isiko Saidiali <54436062+SaidiAli@users.noreply.github.com> Co-authored-by: Luis Alvarez D <luis@vercel.com>
This commit is contained in:
committed by
GitHub
parent
0e7e7b7d5f
commit
abaf7220dc
@@ -1,5 +1,5 @@
|
||||
import type { CommerceAPIConfig } from '@commerce/api'
|
||||
|
||||
import { CommerceAPI, CommerceAPIConfig, getCommerceApi as commerceApi } from '@commerce/api'
|
||||
import * as operations from './operations'
|
||||
import * as Const from '../const'
|
||||
|
||||
if (!Const.API_URL) {
|
||||
@@ -27,23 +27,12 @@ const config: SaleorConfig = {
|
||||
storeChannel: Const.API_CHANNEL,
|
||||
}
|
||||
|
||||
import {
|
||||
CommerceAPI,
|
||||
getCommerceApi as commerceApi,
|
||||
} from '@commerce/api'
|
||||
|
||||
import * as operations from './operations'
|
||||
|
||||
export interface ShopifyConfig extends CommerceAPIConfig {}
|
||||
|
||||
export const provider = { config, operations }
|
||||
|
||||
export type Provider = typeof provider
|
||||
|
||||
export type SaleorAPI<P extends Provider = Provider> = CommerceAPI<P>
|
||||
|
||||
export function getCommerceApi<P extends Provider>(
|
||||
customProvider: P = provider as any
|
||||
): SaleorAPI<P> {
|
||||
export function getCommerceApi<P extends Provider>(customProvider: P = provider as any): SaleorAPI<P> {
|
||||
return commerceApi(customProvider)
|
||||
}
|
||||
|
Reference in New Issue
Block a user