mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
Fixed imports
This commit is contained in:
parent
50b5984bce
commit
40dcb39451
@ -6,7 +6,7 @@ import {
|
||||
GetAllPagesQuery,
|
||||
GetAllPagesQueryVariables,
|
||||
PageEdge,
|
||||
} from '../../schema'
|
||||
} from '../../../schema'
|
||||
import { normalizePages } from '../../utils'
|
||||
import type { ShopifyConfig, Provider } from '..'
|
||||
import type { GetAllPagesOperation, Page } from '../../types/page'
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
GetAllProductPathsQuery,
|
||||
GetAllProductPathsQueryVariables,
|
||||
ProductEdge,
|
||||
} from '../../schema'
|
||||
} from '../../../schema'
|
||||
import type { ShopifyConfig, Provider } from '..'
|
||||
import { getAllProductsQuery } from '../../utils'
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
GetAllProductsQuery,
|
||||
GetAllProductsQueryVariables,
|
||||
Product as ShopifyProduct,
|
||||
} from '../../schema'
|
||||
} from '../../../schema'
|
||||
import type { ShopifyConfig, Provider } from '..'
|
||||
import getAllProductsQuery from '../../utils/queries/get-all-products-query'
|
||||
import { normalizeProduct } from '../../utils'
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
GetPageQuery,
|
||||
GetPageQueryVariables,
|
||||
Page as ShopifyPage,
|
||||
} from '../../schema'
|
||||
} from '../../../schema'
|
||||
import { GetPageOperation } from '../../types/page'
|
||||
import getPageQuery from '../../utils/queries/get-page-query'
|
||||
|
||||
|
@ -5,7 +5,10 @@ import type {
|
||||
import { GetProductOperation } from '../../types/product'
|
||||
import { normalizeProduct, getProductQuery } from '../../utils'
|
||||
import type { ShopifyConfig, Provider } from '..'
|
||||
import { GetProductBySlugQuery, Product as ShopifyProduct } from '../../schema'
|
||||
import {
|
||||
GetProductBySlugQuery,
|
||||
Product as ShopifyProduct,
|
||||
} from '../../../schema'
|
||||
|
||||
export default function getProductOperation({
|
||||
commerce,
|
||||
|
@ -2,7 +2,7 @@ import type {
|
||||
OperationContext,
|
||||
OperationOptions,
|
||||
} from '@commerce/api/operations'
|
||||
import { GetSiteInfoQueryVariables } from '../../schema'
|
||||
import { GetSiteInfoQueryVariables } from '../../../schema'
|
||||
import type { ShopifyConfig, Provider } from '..'
|
||||
import { GetSiteInfoOperation } from '../../types/site'
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
setCustomerToken,
|
||||
throwUserErrors,
|
||||
} from '../../utils'
|
||||
import { CustomerAccessTokenCreateMutation } from '../../schema'
|
||||
import { CustomerAccessTokenCreateMutation } from '../../../schema'
|
||||
|
||||
export default function loginOperation({
|
||||
commerce,
|
||||
|
@ -10,7 +10,7 @@ import {
|
||||
throwUserErrors,
|
||||
customerAccessTokenCreateMutation,
|
||||
} from '../utils'
|
||||
import { Mutation, MutationCustomerAccessTokenCreateArgs } from '../schema'
|
||||
import { Mutation, MutationCustomerAccessTokenCreateArgs } from '../../schema'
|
||||
|
||||
export default useLogin as UseLogin<typeof handler>
|
||||
|
||||
|
@ -4,7 +4,7 @@ import { CommerceError } from '@commerce/utils/errors'
|
||||
import useSignup, { UseSignup } from '@commerce/auth/use-signup'
|
||||
import type { SignupHook } from '../types/signup'
|
||||
import useCustomer from '../customer/use-customer'
|
||||
import { Mutation, MutationCustomerCreateArgs } from '../schema'
|
||||
import { Mutation, MutationCustomerCreateArgs } from '../../schema'
|
||||
|
||||
import {
|
||||
handleAutomaticLogin,
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
checkoutToCart,
|
||||
checkoutCreate,
|
||||
} from '../utils'
|
||||
import { Mutation, MutationCheckoutLineItemsAddArgs } from '../schema'
|
||||
import { Mutation, MutationCheckoutLineItemsAddArgs } from '../../schema'
|
||||
|
||||
export default useAddItem as UseAddItem<typeof handler>
|
||||
|
||||
|
@ -24,7 +24,7 @@ import {
|
||||
checkoutToCart,
|
||||
} from '../utils'
|
||||
|
||||
import { Mutation, MutationCheckoutLineItemsRemoveArgs } from '../schema'
|
||||
import { Mutation, MutationCheckoutLineItemsRemoveArgs } from '../../schema'
|
||||
|
||||
export const handler = {
|
||||
fetchOptions: {
|
||||
|
@ -15,7 +15,7 @@ import {
|
||||
checkoutLineItemUpdateMutation,
|
||||
checkoutToCart,
|
||||
} from '../utils'
|
||||
import { Mutation, MutationCheckoutLineItemsUpdateArgs } from '../schema'
|
||||
import { Mutation, MutationCheckoutLineItemsUpdateArgs } from '../../schema'
|
||||
|
||||
export type UpdateItemActionInput<T = any> = T extends LineItem
|
||||
? Partial<UpdateItemHook['actionInput']>
|
||||
|
@ -2,7 +2,7 @@ import useCustomer, { UseCustomer } from '@commerce/customer/use-customer'
|
||||
import type { CustomerHook } from '../types/customer'
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import { getCustomerQuery, getCustomerToken } from '../utils'
|
||||
import { GetCustomerQuery, GetCustomerQueryVariables } from '../schema'
|
||||
import { GetCustomerQuery, GetCustomerQueryVariables } from '../../schema'
|
||||
|
||||
export default useCustomer as UseCustomer<typeof handler>
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
GetProductsFromCollectionQueryVariables,
|
||||
Product as ShopifyProduct,
|
||||
ProductEdge,
|
||||
} from '../schema'
|
||||
} from '../../schema'
|
||||
|
||||
import {
|
||||
getAllProductsQuery,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as Core from '@commerce/types/login'
|
||||
import type { CustomerAccessTokenCreateInput } from '../schema'
|
||||
import type { CustomerAccessTokenCreateInput } from '../../schema'
|
||||
|
||||
export * from '@commerce/types/login'
|
||||
|
||||
|
@ -12,7 +12,7 @@ import {
|
||||
CheckoutLineItemInput,
|
||||
Mutation,
|
||||
MutationCheckoutCreateArgs,
|
||||
} from '../schema'
|
||||
} from '../../schema'
|
||||
import { FetcherOptions } from '@commerce/utils/types'
|
||||
|
||||
export const checkoutCreate = async (
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
CheckoutUserError,
|
||||
Checkout,
|
||||
Maybe,
|
||||
} from '../schema'
|
||||
} from '../../schema'
|
||||
|
||||
import { normalizeCart } from './normalize'
|
||||
import throwUserErrors from './throw-user-errors'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {
|
||||
GetAllProductVendorsQuery,
|
||||
GetAllProductVendorsQueryVariables,
|
||||
} from '../schema'
|
||||
} from '../../schema'
|
||||
import { ShopifyConfig } from '../api'
|
||||
import getAllProductVendors from './queries/get-all-product-vendors-query'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { Category } from '../types/site'
|
||||
import { ShopifyConfig } from '../api'
|
||||
import { CollectionEdge } from '../schema'
|
||||
import { CollectionEdge } from '../../schema'
|
||||
import { normalizeCategory } from './normalize'
|
||||
import getSiteCollectionsQuery from './queries/get-all-collections-query'
|
||||
|
||||
|
@ -4,8 +4,8 @@ import throwUserErrors from './throw-user-errors'
|
||||
import {
|
||||
MutationCustomerActivateArgs,
|
||||
MutationCustomerActivateByUrlArgs,
|
||||
} from '../schema'
|
||||
import { Mutation } from '../schema'
|
||||
} from '../../schema'
|
||||
import { Mutation } from '../../schema'
|
||||
import { customerActivateByUrlMutation } from './mutations'
|
||||
|
||||
const handleAccountActivation = async (
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FetcherOptions } from '@commerce/utils/types'
|
||||
import { CustomerAccessTokenCreateInput } from '../schema'
|
||||
import { CustomerAccessTokenCreateInput } from '../../schema'
|
||||
import { setCustomerToken } from './customer-token'
|
||||
import { customerAccessTokenCreateMutation } from './mutations'
|
||||
import throwUserErrors from './throw-user-errors'
|
||||
|
@ -15,7 +15,7 @@ import {
|
||||
Page as ShopifyPage,
|
||||
PageEdge,
|
||||
Collection,
|
||||
} from '../schema'
|
||||
} from '../../schema'
|
||||
import { colorMap } from '@lib/colors'
|
||||
|
||||
const money = ({ amount, currencyCode }: MoneyV2) => {
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
CheckoutUserError,
|
||||
CustomerErrorCode,
|
||||
CustomerUserError,
|
||||
} from '../schema'
|
||||
} from '../../schema'
|
||||
|
||||
export type UserErrors = Array<CheckoutUserError | CustomerUserError>
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Shopify doesn't have a wishlist
|
||||
|
||||
import { HookFetcher } from '@commerce/utils/types'
|
||||
import { Product } from '../schema'
|
||||
import { Product } from '../../schema'
|
||||
|
||||
const defaultOpts = {}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Page } from '../../schema'
|
||||
import { Page } from '../../../schema'
|
||||
import { SwellConfig, Provider } from '..'
|
||||
import { OperationContext, OperationOptions } from '@commerce/api/operations'
|
||||
import { GetPageOperation } from '../../types/page'
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
CustomerUserError,
|
||||
Mutation,
|
||||
MutationCheckoutCreateArgs,
|
||||
} from '../schema'
|
||||
} from '../../schema'
|
||||
import useLogin, { UseLogin } from '@commerce/auth/use-login'
|
||||
import { LoginHook } from '../types/login'
|
||||
import { setCustomerToken } from '../utils'
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
CheckoutLineItemsRemovePayload,
|
||||
CheckoutLineItemsUpdatePayload,
|
||||
Maybe,
|
||||
} from '../../schema'
|
||||
} from '../../../schema'
|
||||
import { normalizeCart } from '../../utils'
|
||||
|
||||
export type CheckoutPayload =
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Customer } from '../types/customer'
|
||||
import { Product, ProductOption } from '../types/product'
|
||||
import { MoneyV2 } from '../schema'
|
||||
import { MoneyV2 } from '../../schema'
|
||||
|
||||
import type {
|
||||
Cart,
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Swell doesn't have a wishlist
|
||||
|
||||
import { HookFetcher } from '@commerce/utils/types'
|
||||
import { Product } from '../schema'
|
||||
import { Product } from '../../schema'
|
||||
|
||||
const defaultOpts = {}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { OperationContext, OperationOptions } from '@commerce/api/operations'
|
||||
import type { GetAllProductPathsQuery } from '../../schema'
|
||||
import type { GetAllProductPathsQuery } from '../../../schema'
|
||||
import { Provider } from '../index'
|
||||
import { getAllProductPathsQuery } from '../../utils/queries/get-all-product-paths-query'
|
||||
import { GetAllProductPathsOperation } from '@commerce/types/product'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Product } from '@commerce/types/product'
|
||||
import { Provider, VendureConfig } from '../'
|
||||
import { GetAllProductsQuery } from '../../schema'
|
||||
import { GetAllProductsQuery } from '../../../schema'
|
||||
import { normalizeSearchResult } from '../../utils/normalize'
|
||||
import { getAllProductsQuery } from '../../utils/queries/get-all-products-query'
|
||||
import { OperationContext } from '@commerce/api/operations'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Product } from '@commerce/types/product'
|
||||
import { OperationContext } from '@commerce/api/operations'
|
||||
import { Provider, VendureConfig } from '../'
|
||||
import { GetProductQuery } from '../../schema'
|
||||
import { GetProductQuery } from '../../../schema'
|
||||
import { getProductQuery } from '../../utils/queries/get-product-query'
|
||||
|
||||
export default function getProductOperation({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Provider, VendureConfig } from '../'
|
||||
import { GetCollectionsQuery } from '../../schema'
|
||||
import { GetCollectionsQuery } from '../../../schema'
|
||||
import { arrayToTree } from '../../utils/array-to-tree'
|
||||
import { getCollectionsQuery } from '../../utils/queries/get-collections-query'
|
||||
import { OperationContext } from '@commerce/api/operations'
|
||||
|
@ -5,7 +5,7 @@ import type {
|
||||
} from '@commerce/api/operations'
|
||||
import { ValidationError } from '@commerce/utils/errors'
|
||||
import type { LoginOperation } from '../../types/login'
|
||||
import type { LoginMutation } from '../../schema'
|
||||
import type { LoginMutation } from '../../../schema'
|
||||
import { Provider, VendureConfig } from '..'
|
||||
import { loginMutation } from '../../utils/mutations/log-in-mutation'
|
||||
|
||||
|
@ -4,7 +4,7 @@ import useLogin, { UseLogin } from '@commerce/auth/use-login'
|
||||
import { LoginHook } from '../types/login'
|
||||
import { CommerceError, ValidationError } from '@commerce/utils/errors'
|
||||
import useCustomer from '../customer/use-customer'
|
||||
import { LoginMutation, LoginMutationVariables } from '../schema'
|
||||
import { LoginMutation, LoginMutationVariables } from '../../schema'
|
||||
import { loginMutation } from '../utils/mutations/log-in-mutation'
|
||||
|
||||
export default useLogin as UseLogin<typeof handler>
|
||||
|
@ -2,7 +2,7 @@ import { useCallback } from 'react'
|
||||
import { MutationHook } from '@commerce/utils/types'
|
||||
import useLogout, { UseLogout } from '@commerce/auth/use-logout'
|
||||
import useCustomer from '../customer/use-customer'
|
||||
import { LogoutMutation } from '../schema'
|
||||
import { LogoutMutation } from '../../schema'
|
||||
import { logoutMutation } from '../utils/mutations/log-out-mutation'
|
||||
import { LogoutHook } from '../types/logout'
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
RegisterCustomerInput,
|
||||
SignupMutation,
|
||||
SignupMutationVariables,
|
||||
} from '../schema'
|
||||
} from '../../schema'
|
||||
import { signupMutation } from '../utils/mutations/sign-up-mutation'
|
||||
import { SignupHook } from '../types/signup'
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { CommerceError } from '@commerce/utils/errors'
|
||||
import { MutationHook } from '@commerce/utils/types'
|
||||
import { useCallback } from 'react'
|
||||
import useCart from './use-cart'
|
||||
import { AddItemToOrderMutation } from '../schema'
|
||||
import { AddItemToOrderMutation } from '../../schema'
|
||||
import { normalizeCart } from '../utils/normalize'
|
||||
import { addItemToOrderMutation } from '../utils/mutations/add-item-to-order-mutation'
|
||||
import { AddItemHook } from '../types/cart'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import useCart, { UseCart } from '@commerce/cart/use-cart'
|
||||
import { ActiveOrderQuery, CartFragment } from '../schema'
|
||||
import { ActiveOrderQuery, CartFragment } from '../../schema'
|
||||
import { normalizeCart } from '../utils/normalize'
|
||||
import { useMemo } from 'react'
|
||||
import { getCartQuery } from '../utils/queries/get-cart-query'
|
||||
|
@ -12,7 +12,7 @@ import useCart from './use-cart'
|
||||
import {
|
||||
RemoveOrderLineMutation,
|
||||
RemoveOrderLineMutationVariables,
|
||||
} from '../schema'
|
||||
} from '../../schema'
|
||||
import { normalizeCart } from '../utils/normalize'
|
||||
import { RemoveItemHook } from '../types/cart'
|
||||
import { removeOrderLineMutation } from '../utils/mutations/remove-order-line-mutation'
|
||||
|
@ -11,7 +11,7 @@ import useCart from './use-cart'
|
||||
import {
|
||||
AdjustOrderLineMutation,
|
||||
AdjustOrderLineMutationVariables,
|
||||
} from '../schema'
|
||||
} from '../../schema'
|
||||
import { normalizeCart } from '../utils/normalize'
|
||||
import { adjustOrderLineMutation } from '../utils/mutations/adjust-order-line-mutation'
|
||||
import { UpdateItemHook } from '../types/cart'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import useCustomer, { UseCustomer } from '@commerce/customer/use-customer'
|
||||
import { ActiveCustomerQuery } from '../schema'
|
||||
import { ActiveCustomerQuery } from '../../schema'
|
||||
import { activeCustomerQuery } from '../utils/queries/active-customer-query'
|
||||
import { CustomerHook } from '../types/customer'
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import useSearch, { UseSearch } from '@commerce/product/use-search'
|
||||
import { Product } from '@commerce/types/product'
|
||||
import { SearchQuery, SearchQueryVariables } from '../schema'
|
||||
import { SearchQuery, SearchQueryVariables } from '../../schema'
|
||||
import { normalizeSearchResult } from '../utils/normalize'
|
||||
import { searchQuery } from '../utils/queries/search-query'
|
||||
import { SearchProductsHook } from '../types/product'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as Core from '@commerce/types/login'
|
||||
import type { LoginMutationVariables } from '../schema'
|
||||
import type { LoginMutationVariables } from '../../schema'
|
||||
import { LoginBody, LoginTypes } from '@commerce/types/login'
|
||||
|
||||
export * from '@commerce/types/login'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Product } from '@commerce/types/product'
|
||||
import { Cart } from '@commerce/types/cart'
|
||||
import { CartFragment, SearchResultFragment } from '../schema'
|
||||
import { CartFragment, SearchResultFragment } from '../../schema'
|
||||
|
||||
export function normalizeSearchResult(item: SearchResultFragment): Product {
|
||||
return {
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Vendure doesn't have a built-in wishlist
|
||||
|
||||
import { HookFetcher } from '@commerce/utils/types'
|
||||
import { Product } from '../schema'
|
||||
import { Product } from '../../schema'
|
||||
|
||||
const defaultOpts = {}
|
||||
|
||||
|
65
package-lock.json
generated
65
package-lock.json
generated
@ -1442,6 +1442,10 @@
|
||||
"resolved": "packages/ordercloud",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@vercel/commerce-saleor": {
|
||||
"resolved": "packages/saleor",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@vercel/fetch": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/fetch/-/fetch-6.1.1.tgz",
|
||||
@ -9659,6 +9663,42 @@
|
||||
"node": ">=4.2.0"
|
||||
}
|
||||
},
|
||||
"packages/saleor": {
|
||||
"version": "0.0.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vercel/commerce": "^0.0.1",
|
||||
"@vercel/fetch": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^15.12.4",
|
||||
"@types/react": "^17.0.8",
|
||||
"lint-staged": "^12.1.7",
|
||||
"next": "^12.0.3",
|
||||
"prettier": "^2.5.1",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"typescript": "^4.6.0-dev.20220108"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"next": "^12",
|
||||
"react": "^17",
|
||||
"react-dom": "^17"
|
||||
}
|
||||
},
|
||||
"packages/saleor/node_modules/typescript": {
|
||||
"version": "4.6.0-dev.20220114",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.0-dev.20220114.tgz",
|
||||
"integrity": "sha512-WcHfPkRCvsoV3BozLL1T8Eb7VPlsoA6yyRLFxoR1zVOyUdILHGL9GzXG5e2yzMCg4rQBTkTYZmkXTBZUwO5ONA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.2.0"
|
||||
}
|
||||
},
|
||||
"site": {
|
||||
"name": "next-commerce",
|
||||
"version": "0.0.1",
|
||||
@ -10905,7 +10945,30 @@
|
||||
"prettier": "^2.5.1",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"stripe": "*",
|
||||
"stripe": "^8.197.0",
|
||||
"typescript": "^4.6.0-dev.20220108"
|
||||
},
|
||||
"dependencies": {
|
||||
"typescript": {
|
||||
"version": "4.6.0-dev.20220114",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.0-dev.20220114.tgz",
|
||||
"integrity": "sha512-WcHfPkRCvsoV3BozLL1T8Eb7VPlsoA6yyRLFxoR1zVOyUdILHGL9GzXG5e2yzMCg4rQBTkTYZmkXTBZUwO5ONA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@vercel/commerce-saleor": {
|
||||
"version": "file:packages/saleor",
|
||||
"requires": {
|
||||
"@types/node": "^15.12.4",
|
||||
"@types/react": "^17.0.8",
|
||||
"@vercel/commerce": "^0.0.1",
|
||||
"@vercel/fetch": "^6.1.1",
|
||||
"lint-staged": "^12.1.7",
|
||||
"next": "^12.0.3",
|
||||
"prettier": "^2.5.1",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"typescript": "^4.6.0-dev.20220108"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { GetLoggedInCustomerQuery } from '../../../schema'
|
||||
import type { GetLoggedInCustomerQuery } from '../../../../schema'
|
||||
import type { CustomerEndpoint } from '.'
|
||||
|
||||
export const getLoggedInCustomerQuery = /* GraphQL */ `
|
||||
|
@ -2,7 +2,7 @@ import type {
|
||||
OperationContext,
|
||||
OperationOptions,
|
||||
} from '@vercel/commerce/api/operations'
|
||||
import type { GetAllProductPathsQuery } from '../../schema'
|
||||
import type { GetAllProductPathsQuery } from '../../../schema'
|
||||
import type { GetAllProductPathsOperation } from '../../types/product'
|
||||
import type { RecursivePartial, RecursiveRequired } from '../utils/types'
|
||||
import filterEdges from '../utils/filter-edges'
|
||||
|
@ -5,7 +5,7 @@ import type {
|
||||
import type {
|
||||
GetAllProductsQuery,
|
||||
GetAllProductsQueryVariables,
|
||||
} from '../../schema'
|
||||
} from '../../../schema'
|
||||
import type { GetAllProductsOperation } from '../../types/product'
|
||||
import type { RecursivePartial, RecursiveRequired } from '../utils/types'
|
||||
import filterEdges from '../utils/filter-edges'
|
||||
|
@ -3,7 +3,7 @@ import type {
|
||||
OperationOptions,
|
||||
} from '@vercel/commerce/api/operations'
|
||||
import type { GetProductOperation } from '../../types/product'
|
||||
import type { GetProductQuery, GetProductQueryVariables } from '../../schema'
|
||||
import type { GetProductQuery, GetProductQueryVariables } from '../../../schema'
|
||||
import setProductLocaleMeta from '../utils/set-product-locale-meta'
|
||||
import { productInfoFragment } from '../fragments/product'
|
||||
import { BigcommerceConfig, Provider } from '..'
|
||||
|
@ -3,7 +3,7 @@ import type {
|
||||
OperationOptions,
|
||||
} from '@vercel/commerce/api/operations'
|
||||
import type { GetSiteInfoOperation } from '../../types/site'
|
||||
import type { GetSiteInfoQuery } from '../../schema'
|
||||
import type { GetSiteInfoQuery } from '../../../schema'
|
||||
import filterEdges from '../utils/filter-edges'
|
||||
import type { BigcommerceConfig, Provider } from '..'
|
||||
import { categoryTreeItemFragment } from '../fragments/category-tree'
|
||||
|
@ -4,7 +4,7 @@ import type {
|
||||
OperationOptions,
|
||||
} from '@vercel/commerce/api/operations'
|
||||
import type { LoginOperation } from '../../types/login'
|
||||
import type { LoginMutation } from '../../schema'
|
||||
import type { LoginMutation } from '../../../schema'
|
||||
import type { RecursivePartial } from '../utils/types'
|
||||
import concatHeader from '../utils/concat-cookie'
|
||||
import type { BigcommerceConfig, Provider } from '..'
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { GetCustomerIdQuery } from '../../schema'
|
||||
import type { GetCustomerIdQuery } from '../../../schema'
|
||||
import type { BigcommerceConfig } from '../'
|
||||
|
||||
export const getCustomerIdQuery = /* GraphQL */ `
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as Core from '@vercel/commerce/types/login'
|
||||
import type { LoginMutationVariables } from '../schema'
|
||||
import type { LoginMutationVariables } from '../../schema'
|
||||
|
||||
export * from '@vercel/commerce/types/login'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as Core from '@vercel/commerce/types/site'
|
||||
import type { GetSiteInfoQuery, GetSiteInfoQueryVariables } from '../schema'
|
||||
import type { GetSiteInfoQuery, GetSiteInfoQueryVariables } from '../../schema'
|
||||
|
||||
export * from '@vercel/commerce/types/site'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import CookieHandler from '../../../api/utils/cookie-handler'
|
||||
import { normalizeCart } from '../../../lib/normalize'
|
||||
import { Cart } from '../../../../schema'
|
||||
import { Cart } from '../../../../../schema'
|
||||
import type { CartEndpoint } from '.'
|
||||
import { getCartQuery } from '../../queries/get-cart-query'
|
||||
|
||||
|
@ -5,7 +5,7 @@ import type { KiboCommerceConfig, KiboCommerceProvider } from '..'
|
||||
import { normalizePage } from '../../lib/normalize'
|
||||
import { getPageQuery } from '../queries/get-page-query'
|
||||
import type { Page, GetPageQueryParams } from "../../types/page";
|
||||
import type { Document } from '../../../schema'
|
||||
import type { Document } from '../../../../schema'
|
||||
|
||||
export default function getPageOperation({
|
||||
commerce,
|
||||
|
@ -1,6 +1,6 @@
|
||||
import update from './immutability'
|
||||
import getSlug from './get-slug'
|
||||
import type { PrCategory, CustomerAccountInput, Document } from '../../schema'
|
||||
import type { PrCategory, CustomerAccountInput, Document } from '../../../schema'
|
||||
import { Page } from '../types/page';
|
||||
import { Customer } from '../types/customer'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as Core from '@vercel/commerce/types/login'
|
||||
import type { CustomerUserAuthInfoInput } from '../../schema'
|
||||
import type { CustomerUserAuthInfoInput } from '../../../schema'
|
||||
|
||||
export * from '@vercel/commerce/types/login'
|
||||
|
||||
|
2
packages/saleor/.prettierignore
Normal file
2
packages/saleor/.prettierignore
Normal file
@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
dist
|
6
packages/saleor/.prettierrc
Normal file
6
packages/saleor/.prettierrc
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false
|
||||
}
|
73
packages/saleor/package.json
Normal file
73
packages/saleor/package.json
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
"name": "@vercel/commerce-saleor",
|
||||
"version": "0.0.1",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "rm -fr dist/* && tsc",
|
||||
"dev": "npm run build -- --watch",
|
||||
"prettier-fix": "prettier --write ."
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./dist/index.js",
|
||||
"./*": [
|
||||
"./dist/*.js",
|
||||
"./dist/*/index.js"
|
||||
],
|
||||
"./next.config": "./dist/next.config.cjs"
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"dist/*",
|
||||
"dist/*/index"
|
||||
],
|
||||
"next.config": [
|
||||
"dist/next.config.d.cts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"schema.d.ts"
|
||||
],
|
||||
"publishConfig": {
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"src/*.d.ts",
|
||||
"src/*/index.d.ts"
|
||||
],
|
||||
"next.config": [
|
||||
"dist/next.config.d.cts"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/commerce": "^0.0.1",
|
||||
"@vercel/fetch": "^6.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"next": "^12",
|
||||
"react": "^17",
|
||||
"react-dom": "^17"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^15.12.4",
|
||||
"@types/react": "^17.0.8",
|
||||
"lint-staged": "^12.1.7",
|
||||
"next": "^12.0.3",
|
||||
"prettier": "^2.5.1",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"typescript": "^4.6.0-dev.20220108"
|
||||
},
|
||||
"lint-staged": {
|
||||
"**/*.{js,jsx,ts,tsx,json}": [
|
||||
"prettier --write",
|
||||
"git add"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import { CommerceAPI, GetAPISchema, createEndpoint } from '@commerce/api'
|
||||
import checkoutEndpoint from '@commerce/api/endpoints/checkout'
|
||||
import { CheckoutSchema } from '@commerce/types/checkout'
|
||||
import { CommerceAPI, GetAPISchema, createEndpoint } from '@vercel/commerce/api'
|
||||
import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout'
|
||||
import { CheckoutSchema } from '@vercel/commerce/types/checkout'
|
||||
|
||||
export type CheckoutAPI = GetAPISchema<CommerceAPI, CheckoutSchema>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { CommerceAPI, CommerceAPIConfig, getCommerceApi as commerceApi } from '@commerce/api'
|
||||
import { CommerceAPI, CommerceAPIConfig, getCommerceApi as commerceApi } from '@vercel/commerce/api'
|
||||
import * as operations from './operations'
|
||||
import * as Const from '../const'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { OperationContext } from '@commerce/api/operations'
|
||||
import type { OperationContext } from '@vercel/commerce/api/operations'
|
||||
|
||||
import { QueryPagesArgs, PageCountableEdge } from '../../schema'
|
||||
import { QueryPagesArgs, PageCountableEdge } from '../../../schema'
|
||||
import type { SaleorConfig, Provider } from '..'
|
||||
import * as Query from '../../utils/queries'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { OperationContext } from '@commerce/api/operations'
|
||||
import { ProductCountableEdge } from '../../schema'
|
||||
import type { OperationContext } from '@vercel/commerce/api/operations'
|
||||
import { ProductCountableEdge } from '../../../schema'
|
||||
import type { Provider, SaleorConfig } from '..'
|
||||
|
||||
import { getAllProductsPathsQuery } from '../../utils/queries'
|
||||
|
@ -1,12 +1,12 @@
|
||||
import type { OperationContext } from '@commerce/api/operations'
|
||||
import { Product } from '@commerce/types/product'
|
||||
import type { OperationContext } from '@vercel/commerce/api/operations'
|
||||
import { Product } from '@vercel/commerce/types/product'
|
||||
|
||||
import { ProductCountableEdge } from '../../schema'
|
||||
import { ProductCountableEdge } from '../../../schema'
|
||||
import type { Provider, SaleorConfig } from '..'
|
||||
import { normalizeProduct } from '../../utils'
|
||||
|
||||
import * as Query from '../../utils/queries'
|
||||
import { GraphQLFetcherResult } from '@commerce/api'
|
||||
import { GraphQLFetcherResult } from '@vercel/commerce/api'
|
||||
|
||||
type ReturnType = {
|
||||
products: Product[]
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { OperationContext } from '@commerce/api/operations'
|
||||
import type { OperationContext } from '@vercel/commerce/api/operations'
|
||||
import type { Provider, SaleorConfig } from '..'
|
||||
import { QueryPageArgs } from '../../schema'
|
||||
import { QueryPageArgs } from '../../../schema'
|
||||
|
||||
import * as Query from '../../utils/queries'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { OperationContext } from '@commerce/api/operations'
|
||||
import type { OperationContext } from '@vercel/commerce/api/operations'
|
||||
import { normalizeProduct } from '../../utils'
|
||||
import type { Provider, SaleorConfig } from '..'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { OperationContext } from '@commerce/api/operations'
|
||||
import { Category } from '@commerce/types/site'
|
||||
import type { OperationContext } from '@vercel/commerce/api/operations'
|
||||
import { Category } from '@vercel/commerce/types/site'
|
||||
import type { SaleorConfig, Provider } from '..'
|
||||
|
||||
import { getCategories, getVendors } from '../../utils'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { ServerResponse } from 'http'
|
||||
import type { OperationContext } from '@commerce/api/operations'
|
||||
import type { OperationContext } from '@vercel/commerce/api/operations'
|
||||
import type { Provider, SaleorConfig } from '..'
|
||||
import { throwUserErrors } from '../../utils'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ProductCountableEdge } from '../../schema'
|
||||
import { ProductCountableEdge } from '../../../schema'
|
||||
import { SaleorConfig } from '..'
|
||||
|
||||
const fetchAllProducts = async ({
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { GraphQLFetcher } from '@commerce/api'
|
||||
import type { GraphQLFetcher } from '@vercel/commerce/api'
|
||||
import fetch from './fetch'
|
||||
|
||||
import { API_URL } from '../../const'
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { useCallback } from 'react'
|
||||
|
||||
import type { MutationHook } from '@commerce/utils/types'
|
||||
import { CommerceError } from '@commerce/utils/errors'
|
||||
import type { MutationHook } from '@vercel/commerce/utils/types'
|
||||
import { CommerceError } from '@vercel/commerce/utils/errors'
|
||||
import useCustomer from '../customer/use-customer'
|
||||
import * as mutation from '../utils/mutations'
|
||||
import { Mutation, MutationTokenCreateArgs } from '../schema'
|
||||
import useLogin, { UseLogin } from '@commerce/auth/use-login'
|
||||
import { Mutation, MutationTokenCreateArgs } from '../../schema'
|
||||
import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login'
|
||||
import { setCSRFToken, setToken, throwUserErrors, checkoutAttach, getCheckoutId } from '../utils'
|
||||
import { LoginHook } from '@commerce/types/login'
|
||||
import { LoginHook } from '@vercel/commerce/types/login'
|
||||
|
||||
export default useLogin as UseLogin<typeof handler>
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { useCallback } from 'react'
|
||||
import type { MutationHook } from '@commerce/utils/types'
|
||||
import useLogout, { UseLogout } from '@commerce/auth/use-logout'
|
||||
import type { MutationHook } from '@vercel/commerce/utils/types'
|
||||
import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout'
|
||||
import useCustomer from '../customer/use-customer'
|
||||
import * as mutation from '../utils/mutations'
|
||||
import { setCSRFToken, setToken, setCheckoutToken } from '../utils/customer-token'
|
||||
import { LogoutHook } from '@commerce/types/logout'
|
||||
import { LogoutHook } from '@vercel/commerce/types/logout'
|
||||
|
||||
export default useLogout as UseLogout<typeof handler>
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { useCallback } from 'react'
|
||||
import type { MutationHook } from '@commerce/utils/types'
|
||||
import { CommerceError } from '@commerce/utils/errors'
|
||||
import useSignup, { UseSignup } from '@commerce/auth/use-signup'
|
||||
import type { MutationHook } from '@vercel/commerce/utils/types'
|
||||
import { CommerceError } from '@vercel/commerce/utils/errors'
|
||||
import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup'
|
||||
import useCustomer from '../customer/use-customer'
|
||||
import { AccountRegisterInput, Mutation, MutationAccountRegisterArgs } from '../schema'
|
||||
import { AccountRegisterInput, Mutation, MutationAccountRegisterArgs } from '../../schema'
|
||||
|
||||
import * as mutation from '../utils/mutations'
|
||||
import { handleAutomaticLogin, throwUserErrors } from '../utils'
|
||||
import { SignupHook } from '@commerce/types/signup'
|
||||
import { SignupHook } from '@vercel/commerce/types/signup'
|
||||
|
||||
export default useSignup as UseSignup<typeof handler>
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
import { useCallback } from 'react'
|
||||
import type { MutationHook } from '@commerce/utils/types'
|
||||
import { CommerceError } from '@commerce/utils/errors'
|
||||
import useAddItem, { UseAddItem } from '@commerce/cart/use-add-item'
|
||||
import type { MutationHook } from '@vercel/commerce/utils/types'
|
||||
import { CommerceError } from '@vercel/commerce/utils/errors'
|
||||
import useAddItem, { UseAddItem } from '@vercel/commerce/cart/use-add-item'
|
||||
import useCart from './use-cart'
|
||||
|
||||
import * as mutation from '../utils/mutations'
|
||||
|
||||
import { getCheckoutId, checkoutToCart } from '../utils'
|
||||
|
||||
import { Mutation, MutationCheckoutLinesAddArgs } from '../schema'
|
||||
import { AddItemHook } from '@commerce/types/cart'
|
||||
import { Mutation, MutationCheckoutLinesAddArgs } from '../../schema'
|
||||
import { AddItemHook } from '@vercel/commerce/types/cart'
|
||||
|
||||
export default useAddItem as UseAddItem<typeof handler>
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { useMemo } from 'react'
|
||||
import useCommerceCart, { UseCart } from '@commerce/cart/use-cart'
|
||||
import useCommerceCart, { UseCart } from '@vercel/commerce/cart/use-cart'
|
||||
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import { SWRHook } from '@vercel/commerce/utils/types'
|
||||
import { checkoutCreate, checkoutToCart, getCheckoutId } from '../utils'
|
||||
import * as query from '../utils/queries'
|
||||
import { GetCartHook } from '@commerce/types/cart'
|
||||
import { GetCartHook } from '@vercel/commerce/types/cart'
|
||||
|
||||
export default useCommerceCart as UseCart<typeof handler>
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { useCallback } from 'react'
|
||||
import type { MutationHookContext, HookFetcherContext, MutationHook } from '@commerce/utils/types'
|
||||
import useRemoveItem, { UseRemoveItem } from '@commerce/cart/use-remove-item'
|
||||
import type { MutationHookContext, HookFetcherContext, MutationHook } from '@vercel/commerce/utils/types'
|
||||
import useRemoveItem, { UseRemoveItem } from '@vercel/commerce/cart/use-remove-item'
|
||||
import useCart from './use-cart'
|
||||
import * as mutation from '../utils/mutations'
|
||||
import { getCheckoutId, checkoutToCart } from '../utils'
|
||||
import { Mutation, MutationCheckoutLineDeleteArgs } from '../schema'
|
||||
import { Mutation, MutationCheckoutLineDeleteArgs } from '../../schema'
|
||||
import { LineItem, RemoveItemHook } from '../types/cart'
|
||||
|
||||
export default useRemoveItem as UseRemoveItem<typeof handler>
|
||||
|
@ -1,15 +1,15 @@
|
||||
import { useCallback } from 'react'
|
||||
import debounce from 'lodash.debounce'
|
||||
import type { HookFetcherContext, MutationHookContext } from '@commerce/utils/types'
|
||||
import { ValidationError } from '@commerce/utils/errors'
|
||||
import useUpdateItem, { UseUpdateItem } from '@commerce/cart/use-update-item'
|
||||
import type { HookFetcherContext, MutationHookContext } from '@vercel/commerce/utils/types'
|
||||
import { ValidationError } from '@vercel/commerce/utils/errors'
|
||||
import useUpdateItem, { UseUpdateItem } from '@vercel/commerce/cart/use-update-item'
|
||||
|
||||
import useCart from './use-cart'
|
||||
import { handler as removeItemHandler } from './use-remove-item'
|
||||
import type { LineItem } from '../types'
|
||||
import { checkoutToCart } from '../utils'
|
||||
import { getCheckoutId } from '../utils'
|
||||
import { Mutation, MutationCheckoutLinesUpdateArgs } from '../schema'
|
||||
import { Mutation, MutationCheckoutLinesUpdateArgs } from '../../schema'
|
||||
|
||||
import * as mutation from '../utils/mutations'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import useCheckout, { UseCheckout } from '@commerce/checkout/use-checkout'
|
||||
import { SWRHook } from '@vercel/commerce/utils/types'
|
||||
import useCheckout, { UseCheckout } from '@vercel/commerce/checkout/use-checkout'
|
||||
|
||||
export default useCheckout as UseCheckout<typeof handler>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import useAddItem, { UseAddItem } from '@commerce/customer/address/use-add-item'
|
||||
import { MutationHook } from '@commerce/utils/types'
|
||||
import useAddItem, { UseAddItem } from '@vercel/commerce/customer/address/use-add-item'
|
||||
import { MutationHook } from '@vercel/commerce/utils/types'
|
||||
|
||||
export default useAddItem as UseAddItem<typeof handler>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import useAddItem, { UseAddItem } from '@commerce/customer/card/use-add-item'
|
||||
import { MutationHook } from '@commerce/utils/types'
|
||||
import useAddItem, { UseAddItem } from '@vercel/commerce/customer/card/use-add-item'
|
||||
import { MutationHook } from '@vercel/commerce/utils/types'
|
||||
|
||||
export default useAddItem as UseAddItem<typeof handler>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import useCustomer, { UseCustomer } from '@commerce/customer/use-customer'
|
||||
import { CustomerHook } from '@commerce/types/customer'
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import useCustomer, { UseCustomer } from '@vercel/commerce/customer/use-customer'
|
||||
import { CustomerHook } from '@vercel/commerce/types/customer'
|
||||
import { SWRHook } from '@vercel/commerce/utils/types'
|
||||
|
||||
import * as query from '../utils/queries'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Fetcher } from '@commerce/utils/types'
|
||||
import { Fetcher } from '@vercel/commerce/utils/types'
|
||||
import { API_URL } from './const'
|
||||
import { getToken, handleFetchResponse } from './utils'
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { getCommerceProvider, useCommerce as useCoreCommerce } from '@commerce'
|
||||
import { getCommerceProvider, useCommerce as useCoreCommerce } from '@vercel/commerce'
|
||||
import { saleorProvider, SaleorProvider } from './provider'
|
||||
|
||||
export { saleorProvider }
|
||||
|
@ -1,2 +1,2 @@
|
||||
export * from '@commerce/product/use-price'
|
||||
export { default } from '@commerce/product/use-price'
|
||||
export * from '@vercel/commerce/product/use-price'
|
||||
export { default } from '@vercel/commerce/product/use-price'
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import { Product } from '@commerce/types/product'
|
||||
import useSearch, { UseSearch } from '@commerce/product/use-search'
|
||||
import { SWRHook } from '@vercel/commerce/utils/types'
|
||||
import { Product } from '@vercel/commerce/types/product'
|
||||
import useSearch, { UseSearch } from '@vercel/commerce/product/use-search'
|
||||
|
||||
import { ProductCountableEdge } from '../schema'
|
||||
import { ProductCountableEdge } from '../../schema'
|
||||
import { getSearchVariables, normalizeProduct } from '../utils'
|
||||
|
||||
import * as query from '../utils/queries'
|
||||
import { SearchProductsHook } from '@commerce/types/product'
|
||||
import { SearchProductsHook } from '@vercel/commerce/types/product'
|
||||
|
||||
export default useSearch as UseSearch<typeof handler>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { Cart as CoreCart } from '@commerce/types'
|
||||
import { CheckoutLine } from './schema'
|
||||
import type { Cart as CoreCart } from '@vercel/commerce/types'
|
||||
import { CheckoutLine } from '../schema'
|
||||
|
||||
export type SaleorCheckout = {
|
||||
id: string
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as Core from '@commerce/types/cart'
|
||||
import * as Core from '@vercel/commerce/types/cart'
|
||||
|
||||
export * from '@commerce/types/cart'
|
||||
export * from '@vercel/commerce/types/cart'
|
||||
|
||||
export type SaleorCart = {}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as mutation from './mutations'
|
||||
import { CheckoutCustomerAttach } from '../schema'
|
||||
import { CheckoutCustomerAttach } from '../../schema'
|
||||
|
||||
export const checkoutAttach = async (fetch: any, { variables, headers }: any): Promise<CheckoutCustomerAttach> => {
|
||||
const data = await fetch({
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
import * as mutation from './mutations'
|
||||
import { CheckoutCreate } from '../schema'
|
||||
import { CHECKOUT_ID_COOKIE } from '@framework/const'
|
||||
import { CheckoutCreate } from '../../schema'
|
||||
import { CHECKOUT_ID_COOKIE } from '../const'
|
||||
|
||||
export const checkoutCreate = async (fetch: any): Promise<CheckoutCreate> => {
|
||||
const data = await fetch({ query: mutation.CheckoutCreate })
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Cart } from '../types'
|
||||
import { CommerceError } from '@commerce/utils/errors'
|
||||
import { CommerceError } from '@vercel/commerce/utils/errors'
|
||||
|
||||
import {
|
||||
CheckoutLinesAdd,
|
||||
@ -9,7 +9,7 @@ import {
|
||||
Checkout,
|
||||
Maybe,
|
||||
CheckoutLineDelete,
|
||||
} from '../schema'
|
||||
} from '../../schema'
|
||||
|
||||
import { normalizeCart } from './normalize'
|
||||
import throwUserErrors from './throw-user-errors'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Category } from '@commerce/types/site'
|
||||
import { Category } from '@vercel/commerce/types/site'
|
||||
import { SaleorConfig } from '../api'
|
||||
import { CollectionCountableEdge } from '../schema'
|
||||
import { CollectionCountableEdge } from '../../schema'
|
||||
import * as query from './queries'
|
||||
|
||||
const getCategories = async (config: SaleorConfig): Promise<Category[]> => {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { FetcherError } from '@commerce/utils/errors'
|
||||
import { FetcherError } from '@vercel/commerce/utils/errors'
|
||||
|
||||
export function getError(errors: any[], status: number) {
|
||||
errors = errors ?? [{ message: 'Failed to fetch Saleor API' }]
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FetcherOptions } from '@commerce/utils/types'
|
||||
import { CreateToken, Mutation, MutationTokenCreateArgs } from '../schema'
|
||||
import { FetcherOptions } from '@vercel/commerce/utils/types'
|
||||
import { CreateToken, Mutation, MutationTokenCreateArgs } from '../../schema'
|
||||
import { setToken, setCSRFToken } from './customer-token'
|
||||
import * as mutation from './mutations'
|
||||
import throwUserErrors from './throw-user-errors'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Product } from '@commerce/types/product'
|
||||
import { Product } from '@vercel/commerce/types/product'
|
||||
|
||||
import { Product as SaleorProduct, Checkout, CheckoutLine, Money, ProductVariant } from '../schema'
|
||||
import { Product as SaleorProduct, Checkout, CheckoutLine, Money, ProductVariant } from '../../schema'
|
||||
|
||||
import type { Cart, LineItem } from '../types'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ValidationError } from '@commerce/utils/errors'
|
||||
import { ValidationError } from '@vercel/commerce/utils/errors'
|
||||
|
||||
import { CheckoutError, CheckoutErrorCode, AppError, AccountError, AccountErrorCode } from '../schema'
|
||||
import { CheckoutError, CheckoutErrorCode, AppError, AccountError, AccountErrorCode } from '../../schema'
|
||||
|
||||
export type UserErrors = Array<CheckoutError | AccountError | AppError>
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user