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
9b014d0a99
commit
5e740abb09
110
package-lock.json
generated
110
package-lock.json
generated
@ -1438,6 +1438,10 @@
|
||||
"resolved": "packages/local",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@vercel/commerce-ordercloud": {
|
||||
"resolved": "packages/ordercloud",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@vercel/fetch": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/fetch/-/fetch-6.1.1.tgz",
|
||||
@ -7654,6 +7658,20 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.10.3",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
|
||||
"integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/querystring-es3": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz",
|
||||
@ -8453,6 +8471,18 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/stripe": {
|
||||
"version": "8.197.0",
|
||||
"resolved": "https://registry.npmjs.org/stripe/-/stripe-8.197.0.tgz",
|
||||
"integrity": "sha512-EQLgqFiX1wNQEeve6QnUcGIby6XtXXzbzEWPJiZ68qFj02YFjNjLLxl9atueKgUQ+YRbrMAlrc6ECwvm+cf/Rw==",
|
||||
"dependencies": {
|
||||
"@types/node": ">=8.1.0",
|
||||
"qs": "^6.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^8.1 || >=10.*"
|
||||
}
|
||||
},
|
||||
"node_modules/styled-jsx": {
|
||||
"version": "5.0.0-beta.3",
|
||||
"resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.0.0-beta.3.tgz",
|
||||
@ -9517,6 +9547,7 @@
|
||||
}
|
||||
},
|
||||
"packages/kibocommerce": {
|
||||
"name": "@vercel/commerce-kibocommerce",
|
||||
"version": "0.0.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@ -9590,6 +9621,44 @@
|
||||
"node": ">=4.2.0"
|
||||
}
|
||||
},
|
||||
"packages/ordercloud": {
|
||||
"name": "@vercel/commerce-ordercloud",
|
||||
"version": "0.0.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vercel/commerce": "^0.0.1",
|
||||
"@vercel/fetch": "^6.1.1",
|
||||
"stripe": "^8.197.0"
|
||||
},
|
||||
"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/ordercloud/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",
|
||||
@ -10824,6 +10893,30 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@vercel/commerce-ordercloud": {
|
||||
"version": "file:packages/ordercloud",
|
||||
"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",
|
||||
"stripe": "*",
|
||||
"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/fetch": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/fetch/-/fetch-6.1.1.tgz",
|
||||
@ -15567,6 +15660,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"qs": {
|
||||
"version": "6.10.3",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
|
||||
"integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
|
||||
"requires": {
|
||||
"side-channel": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"querystring-es3": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz",
|
||||
@ -16165,6 +16266,15 @@
|
||||
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
|
||||
"dev": true
|
||||
},
|
||||
"stripe": {
|
||||
"version": "8.197.0",
|
||||
"resolved": "https://registry.npmjs.org/stripe/-/stripe-8.197.0.tgz",
|
||||
"integrity": "sha512-EQLgqFiX1wNQEeve6QnUcGIby6XtXXzbzEWPJiZ68qFj02YFjNjLLxl9atueKgUQ+YRbrMAlrc6ECwvm+cf/Rw==",
|
||||
"requires": {
|
||||
"@types/node": ">=8.1.0",
|
||||
"qs": "^6.6.0"
|
||||
}
|
||||
},
|
||||
"styled-jsx": {
|
||||
"version": "5.0.0-beta.3",
|
||||
"resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.0.0-beta.3.tgz",
|
||||
|
73
packages/ordercloud/package.json
Normal file
73
packages/ordercloud/package.json
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
"name": "@vercel/commerce-ordercloud",
|
||||
"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"
|
||||
],
|
||||
"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",
|
||||
"stripe": "^8.197.0"
|
||||
},
|
||||
"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,8 +1,8 @@
|
||||
import type { CartSchema } from '../../../types/cart'
|
||||
import type { OrdercloudAPI } from '../..'
|
||||
|
||||
import { GetAPISchema, createEndpoint } from '@commerce/api'
|
||||
import cartEndpoint from '@commerce/api/endpoints/cart'
|
||||
import { GetAPISchema, createEndpoint } from '@vercel/commerce/api'
|
||||
import cartEndpoint from '@vercel/commerce/api/endpoints/cart'
|
||||
|
||||
import getCart from './get-cart'
|
||||
import addItem from './add-item'
|
||||
|
@ -1,9 +1,9 @@
|
||||
import type { OrdercloudAPI } from '../../../../api'
|
||||
|
||||
import { createEndpoint, GetAPISchema } from '@commerce/api'
|
||||
import { ProductsSchema } from '@commerce/types/product'
|
||||
import { createEndpoint, GetAPISchema } from '@vercel/commerce/api'
|
||||
import { ProductsSchema } from '@vercel/commerce/types/product'
|
||||
import getProducts from './get-products'
|
||||
import productsEndpoint from '@commerce/api/endpoints/catalog/products'
|
||||
import productsEndpoint from '@vercel/commerce/api/endpoints/catalog/products'
|
||||
|
||||
export type ProductsAPI = GetAPISchema<OrdercloudAPI, ProductsSchema>
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { CheckoutSchema } from '../../../types/checkout'
|
||||
import type { OrdercloudAPI } from '../..'
|
||||
|
||||
import { GetAPISchema, createEndpoint } from '@commerce/api'
|
||||
import checkoutEndpoint from '@commerce/api/endpoints/checkout'
|
||||
import { GetAPISchema, createEndpoint } from '@vercel/commerce/api'
|
||||
import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout'
|
||||
|
||||
import getCheckout from './get-checkout'
|
||||
import submitCheckout from './submit-checkout'
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { CustomerAddressSchema } from '../../../../types/customer/address'
|
||||
import type { OrdercloudAPI } from '../../..'
|
||||
|
||||
import { GetAPISchema, createEndpoint } from '@commerce/api'
|
||||
import customerAddressEndpoint from '@commerce/api/endpoints/customer/address'
|
||||
import { GetAPISchema, createEndpoint } from '@vercel/commerce/api'
|
||||
import customerAddressEndpoint from '@vercel/commerce/api/endpoints/customer/address'
|
||||
|
||||
import getAddresses from './get-addresses'
|
||||
import addItem from './add-item'
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { CustomerCardSchema } from '../../../../types/customer/card'
|
||||
import type { OrdercloudAPI } from '../../..'
|
||||
|
||||
import { GetAPISchema, createEndpoint } from '@commerce/api'
|
||||
import customerCardEndpoint from '@commerce/api/endpoints/customer/card'
|
||||
import { GetAPISchema, createEndpoint } from '@vercel/commerce/api'
|
||||
import customerCardEndpoint from '@vercel/commerce/api/endpoints/customer/card'
|
||||
|
||||
import getCards from './get-cards'
|
||||
import addItem from './add-item'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { CommerceAPI, CommerceAPIConfig } from '@commerce/api'
|
||||
import { getCommerceApi as commerceApi } from '@commerce/api'
|
||||
import type { CommerceAPI, CommerceAPIConfig } from '@vercel/commerce/api'
|
||||
import { getCommerceApi as commerceApi } from '@vercel/commerce/api'
|
||||
import { createBuyerFetcher, createMiddlewareFetcher } from './utils/fetch-rest'
|
||||
import createGraphqlFetcher from './utils/fetch-graphql'
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type { OrdercloudConfig } from '../'
|
||||
|
||||
import { GetAllPagesOperation } from '@commerce/types/page'
|
||||
import { GetAllPagesOperation } from '@vercel/commerce/types/page'
|
||||
|
||||
export type Page = { url: string }
|
||||
export type GetAllPagesResult = { pages: Page[] }
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { OperationContext } from '@commerce/api/operations'
|
||||
import type { GetAllProductPathsOperation } from '@commerce/types/product'
|
||||
import type { OperationContext } from '@vercel/commerce/api/operations'
|
||||
import type { GetAllProductPathsOperation } from '@vercel/commerce/types/product'
|
||||
|
||||
import type { RawProduct } from '../../types/product'
|
||||
import type { OrdercloudConfig, Provider } from '../'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { GetAllProductsOperation } from '@commerce/types/product'
|
||||
import type { OperationContext } from '@commerce/api/operations'
|
||||
import type { GetAllProductsOperation } from '@vercel/commerce/types/product'
|
||||
import type { OperationContext } from '@vercel/commerce/api/operations'
|
||||
|
||||
import type { RawProduct } from '../../types/product'
|
||||
import type { OrdercloudConfig, Provider } from '../index'
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { GetPageOperation } from '@commerce/types/page'
|
||||
import { GetPageOperation } from '@vercel/commerce/types/page'
|
||||
|
||||
export type Page = any
|
||||
export type GetPageResult = { page?: Page }
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { OperationContext } from '@commerce/api/operations'
|
||||
import type { GetProductOperation } from '@commerce/types/product'
|
||||
import type { OperationContext } from '@vercel/commerce/api/operations'
|
||||
import type { GetProductOperation } from '@vercel/commerce/types/product'
|
||||
|
||||
import type { RawProduct, RawSpec, RawVariant } from '../../types/product'
|
||||
import type { OrdercloudConfig, Provider } from '../index'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { OperationContext } from '@commerce/api/operations'
|
||||
import type { Category, GetSiteInfoOperation } from '@commerce/types/site'
|
||||
import type { OperationContext } from '@vercel/commerce/api/operations'
|
||||
import type { Category, GetSiteInfoOperation } from '@vercel/commerce/types/site'
|
||||
|
||||
import type { RawCategory } from '../../types/category'
|
||||
import type { OrdercloudConfig, Provider } from '../index'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import type { GraphQLFetcher } from '@commerce/api'
|
||||
import type { GraphQLFetcher } from '@vercel/commerce/api'
|
||||
import type { OrdercloudConfig } from '../'
|
||||
|
||||
import { FetcherError } from '@commerce/utils/errors'
|
||||
import { FetcherError } from '@vercel/commerce/utils/errors'
|
||||
|
||||
const fetchGraphqlApi: (getConfig: () => OrdercloudConfig) => GraphQLFetcher =
|
||||
() => async () => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import vercelFetch from '@vercel/fetch'
|
||||
import { FetcherError } from '@commerce/utils/errors'
|
||||
import { FetcherError } from '@vercel/commerce/utils/errors'
|
||||
import { CustomNodeJsGlobal } from '../../types/node';
|
||||
|
||||
import { OrdercloudConfig } from '../index'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MutationHook } from '@commerce/utils/types'
|
||||
import useLogin, { UseLogin } from '@commerce/auth/use-login'
|
||||
import { MutationHook } from '@vercel/commerce/utils/types'
|
||||
import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login'
|
||||
|
||||
export default useLogin as UseLogin<typeof handler>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MutationHook } from '@commerce/utils/types'
|
||||
import useLogout, { UseLogout } from '@commerce/auth/use-logout'
|
||||
import { MutationHook } from '@vercel/commerce/utils/types'
|
||||
import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout'
|
||||
|
||||
export default useLogout as UseLogout<typeof handler>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { useCallback } from 'react'
|
||||
import useCustomer from '../customer/use-customer'
|
||||
import { MutationHook } from '@commerce/utils/types'
|
||||
import useSignup, { UseSignup } from '@commerce/auth/use-signup'
|
||||
import { MutationHook } from '@vercel/commerce/utils/types'
|
||||
import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup'
|
||||
|
||||
export default useSignup as UseSignup<typeof handler>
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import type { AddItemHook } from '@commerce/types/cart'
|
||||
import type { MutationHook } from '@commerce/utils/types'
|
||||
import type { AddItemHook } from '@vercel/commerce/types/cart'
|
||||
import type { MutationHook } from '@vercel/commerce/utils/types'
|
||||
|
||||
import { useCallback } from 'react'
|
||||
import { CommerceError } from '@commerce/utils/errors'
|
||||
import useAddItem, { UseAddItem } from '@commerce/cart/use-add-item'
|
||||
import { CommerceError } from '@vercel/commerce/utils/errors'
|
||||
import useAddItem, { UseAddItem } from '@vercel/commerce/cart/use-add-item'
|
||||
import useCart from './use-cart'
|
||||
|
||||
export default useAddItem as UseAddItem<typeof handler>
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { GetCartHook } from '@commerce/types/cart'
|
||||
import type { GetCartHook } from '@vercel/commerce/types/cart'
|
||||
|
||||
import { useMemo } from 'react'
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import useCart, { UseCart } from '@commerce/cart/use-cart'
|
||||
import { SWRHook } from '@vercel/commerce/utils/types'
|
||||
import useCart, { UseCart } from '@vercel/commerce/cart/use-cart'
|
||||
|
||||
export default useCart as UseCart<typeof handler>
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
import type {
|
||||
MutationHookContext,
|
||||
HookFetcherContext,
|
||||
} from '@commerce/utils/types'
|
||||
import type { Cart, LineItem, RemoveItemHook } from '@commerce/types/cart'
|
||||
} from '@vercel/commerce/utils/types'
|
||||
import type { Cart, LineItem, RemoveItemHook } from '@vercel/commerce/types/cart'
|
||||
|
||||
import { useCallback } from 'react'
|
||||
|
||||
import { ValidationError } from '@commerce/utils/errors'
|
||||
import useRemoveItem, { UseRemoveItem } from '@commerce/cart/use-remove-item'
|
||||
import { ValidationError } from '@vercel/commerce/utils/errors'
|
||||
import useRemoveItem, { UseRemoveItem } from '@vercel/commerce/cart/use-remove-item'
|
||||
|
||||
import useCart from './use-cart'
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
import type {
|
||||
HookFetcherContext,
|
||||
MutationHookContext,
|
||||
} from '@commerce/utils/types'
|
||||
import type { UpdateItemHook, LineItem } from '@commerce/types/cart'
|
||||
} from '@vercel/commerce/utils/types'
|
||||
import type { UpdateItemHook, LineItem } from '@vercel/commerce/types/cart'
|
||||
|
||||
import { useCallback } from 'react'
|
||||
import debounce from 'lodash.debounce'
|
||||
|
||||
import { MutationHook } from '@commerce/utils/types'
|
||||
import { ValidationError } from '@commerce/utils/errors'
|
||||
import useUpdateItem, { UseUpdateItem } from '@commerce/cart/use-update-item'
|
||||
import { MutationHook } from '@vercel/commerce/utils/types'
|
||||
import { ValidationError } from '@vercel/commerce/utils/errors'
|
||||
import useUpdateItem, { UseUpdateItem } from '@vercel/commerce/cart/use-update-item'
|
||||
|
||||
import { handler as removeItemHandler } from './use-remove-item'
|
||||
import useCart from './use-cart'
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { GetCheckoutHook } from '@commerce/types/checkout'
|
||||
import type { GetCheckoutHook } from '@vercel/commerce/types/checkout'
|
||||
|
||||
import { useMemo } from 'react'
|
||||
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'
|
||||
import useSubmitCheckout from './use-submit-checkout'
|
||||
|
||||
export default useCheckout as UseCheckout<typeof handler>
|
||||
|
@ -1,10 +1,10 @@
|
||||
import type { SubmitCheckoutHook } from '@commerce/types/checkout'
|
||||
import type { MutationHook } from '@commerce/utils/types'
|
||||
import type { SubmitCheckoutHook } from '@vercel/commerce/types/checkout'
|
||||
import type { MutationHook } from '@vercel/commerce/utils/types'
|
||||
|
||||
import { useCallback } from 'react'
|
||||
import useSubmitCheckout, {
|
||||
UseSubmitCheckout,
|
||||
} from '@commerce/checkout/use-submit-checkout'
|
||||
} from '@vercel/commerce/checkout/use-submit-checkout'
|
||||
|
||||
export default useSubmitCheckout as UseSubmitCheckout<typeof handler>
|
||||
|
||||
@ -14,7 +14,7 @@ export const handler: MutationHook<SubmitCheckoutHook> = {
|
||||
method: 'POST',
|
||||
},
|
||||
async fetcher({ input: item, options, fetch }) {
|
||||
// @TODO: Make form validations in here, import generic error like import { CommerceError } from '@commerce/utils/errors'
|
||||
// @TODO: Make form validations in here, import generic error like import { CommerceError } from '@vercel/commerce/utils/errors'
|
||||
// Get payment and delivery information in here
|
||||
|
||||
const data = await fetch({
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { AddItemHook } from '@commerce/types/customer/address'
|
||||
import type { MutationHook } from '@commerce/utils/types'
|
||||
import type { AddItemHook } from '@vercel/commerce/types/customer/address'
|
||||
import type { MutationHook } from '@vercel/commerce/utils/types'
|
||||
|
||||
import { useCallback } from 'react'
|
||||
import useAddItem, { UseAddItem } from '@commerce/customer/address/use-add-item'
|
||||
import useAddItem, { UseAddItem } from '@vercel/commerce/customer/address/use-add-item'
|
||||
import useAddresses from './use-addresses'
|
||||
|
||||
export default useAddItem as UseAddItem<typeof handler>
|
||||
|
@ -1,10 +1,10 @@
|
||||
import type { GetAddressesHook } from '@commerce/types/customer/address'
|
||||
import type { GetAddressesHook } from '@vercel/commerce/types/customer/address'
|
||||
|
||||
import { useMemo } from 'react'
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import { SWRHook } from '@vercel/commerce/utils/types'
|
||||
import useAddresses, {
|
||||
UseAddresses,
|
||||
} from '@commerce/customer/address/use-addresses'
|
||||
} from '@vercel/commerce/customer/address/use-addresses'
|
||||
|
||||
export default useAddresses as UseAddresses<typeof handler>
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
import type {
|
||||
MutationHookContext,
|
||||
HookFetcherContext,
|
||||
} from '@commerce/utils/types'
|
||||
import type { Address, RemoveItemHook } from '@commerce/types/customer/address'
|
||||
} from '@vercel/commerce/utils/types'
|
||||
import type { Address, RemoveItemHook } from '@vercel/commerce/types/customer/address'
|
||||
|
||||
import { useCallback } from 'react'
|
||||
|
||||
import { ValidationError } from '@commerce/utils/errors'
|
||||
import { ValidationError } from '@vercel/commerce/utils/errors'
|
||||
import useRemoveItem, {
|
||||
UseRemoveItem,
|
||||
} from '@commerce/customer/address/use-remove-item'
|
||||
} from '@vercel/commerce/customer/address/use-remove-item'
|
||||
|
||||
import useAddresses from './use-addresses'
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
import type {
|
||||
HookFetcherContext,
|
||||
MutationHookContext,
|
||||
} from '@commerce/utils/types'
|
||||
import type { UpdateItemHook, Address } from '@commerce/types/customer/address'
|
||||
} from '@vercel/commerce/utils/types'
|
||||
import type { UpdateItemHook, Address } from '@vercel/commerce/types/customer/address'
|
||||
|
||||
import { useCallback } from 'react'
|
||||
|
||||
import { MutationHook } from '@commerce/utils/types'
|
||||
import { MutationHook } from '@vercel/commerce/utils/types'
|
||||
import useUpdateItem, {
|
||||
UseUpdateItem,
|
||||
} from '@commerce/customer/address/use-update-item'
|
||||
} from '@vercel/commerce/customer/address/use-update-item'
|
||||
|
||||
import useAddresses from './use-addresses'
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { AddItemHook } from '@commerce/types/customer/card'
|
||||
import type { MutationHook } from '@commerce/utils/types'
|
||||
import type { AddItemHook } from '@vercel/commerce/types/customer/card'
|
||||
import type { MutationHook } from '@vercel/commerce/utils/types'
|
||||
|
||||
import { useCallback } from 'react'
|
||||
import useAddItem, { UseAddItem } from '@commerce/customer/card/use-add-item'
|
||||
import useAddItem, { UseAddItem } from '@vercel/commerce/customer/card/use-add-item'
|
||||
import useCards from './use-cards'
|
||||
|
||||
export default useAddItem as UseAddItem<typeof handler>
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { GetCardsHook } from '@commerce/types/customer/card'
|
||||
import type { GetCardsHook } from '@vercel/commerce/types/customer/card'
|
||||
|
||||
import { useMemo } from 'react'
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import useCard, { UseCards } from '@commerce/customer/card/use-cards'
|
||||
import { SWRHook } from '@vercel/commerce/utils/types'
|
||||
import useCard, { UseCards } from '@vercel/commerce/customer/card/use-cards'
|
||||
|
||||
export default useCard as UseCards<typeof handler>
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
import type {
|
||||
MutationHookContext,
|
||||
HookFetcherContext,
|
||||
} from '@commerce/utils/types'
|
||||
import type { Card, RemoveItemHook } from '@commerce/types/customer/card'
|
||||
} from '@vercel/commerce/utils/types'
|
||||
import type { Card, RemoveItemHook } from '@vercel/commerce/types/customer/card'
|
||||
|
||||
import { useCallback } from 'react'
|
||||
|
||||
import { ValidationError } from '@commerce/utils/errors'
|
||||
import { ValidationError } from '@vercel/commerce/utils/errors'
|
||||
import useRemoveItem, {
|
||||
UseRemoveItem,
|
||||
} from '@commerce/customer/card/use-remove-item'
|
||||
} from '@vercel/commerce/customer/card/use-remove-item'
|
||||
|
||||
import useCards from './use-cards'
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
import type {
|
||||
HookFetcherContext,
|
||||
MutationHookContext,
|
||||
} from '@commerce/utils/types'
|
||||
import type { UpdateItemHook, Card } from '@commerce/types/customer/card'
|
||||
} from '@vercel/commerce/utils/types'
|
||||
import type { UpdateItemHook, Card } from '@vercel/commerce/types/customer/card'
|
||||
|
||||
import { useCallback } from 'react'
|
||||
|
||||
import { MutationHook } from '@commerce/utils/types'
|
||||
import { MutationHook } from '@vercel/commerce/utils/types'
|
||||
import useUpdateItem, {
|
||||
UseUpdateItem,
|
||||
} from '@commerce/customer/card/use-update-item'
|
||||
} from '@vercel/commerce/customer/card/use-update-item'
|
||||
|
||||
import useCards from './use-cards'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import useCustomer, { UseCustomer } from '@commerce/customer/use-customer'
|
||||
import { SWRHook } from '@vercel/commerce/utils/types'
|
||||
import useCustomer, { UseCustomer } from '@vercel/commerce/customer/use-customer'
|
||||
|
||||
export default useCustomer as UseCustomer<typeof handler>
|
||||
export const handler: SWRHook<any> = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Fetcher } from '@commerce/utils/types'
|
||||
import { Fetcher } from '@vercel/commerce/utils/types'
|
||||
|
||||
const clientFetcher: Fetcher = async ({ method, url, body }) => {
|
||||
const response = await fetch(url!, {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ordercloudProvider, OrdercloudProvider } from './provider'
|
||||
import { getCommerceProvider, useCommerce as useCoreCommerce } from '@commerce'
|
||||
import { getCommerceProvider, useCommerce as useCoreCommerce } from '@vercel/commerce'
|
||||
|
||||
export { ordercloudProvider }
|
||||
export type { OrdercloudProvider }
|
||||
|
@ -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,6 +1,6 @@
|
||||
import { SWRHook } from '@commerce/utils/types'
|
||||
import useSearch, { UseSearch } from '@commerce/product/use-search'
|
||||
import { SearchProductsHook } from '@commerce/types/product'
|
||||
import { SWRHook } from '@vercel/commerce/utils/types'
|
||||
import useSearch, { UseSearch } from '@vercel/commerce/product/use-search'
|
||||
import { SearchProductsHook } from '@vercel/commerce/types/product'
|
||||
export default useSearch as UseSearch<typeof handler>
|
||||
|
||||
export const handler: SWRHook<SearchProductsHook> = {
|
||||
|
@ -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 interface OrdercloudCart {
|
||||
ID: string
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as Core from '@commerce/types/checkout'
|
||||
import * as Core from '@vercel/commerce/types/checkout'
|
||||
|
||||
export type CheckoutTypes = Core.CheckoutTypes
|
||||
export type CheckoutSchema = Core.CheckoutSchema<CheckoutTypes>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as Core from '@commerce/types/customer/address'
|
||||
import * as Core from '@vercel/commerce/types/customer/address'
|
||||
|
||||
export type CustomerAddressTypes = Core.CustomerAddressTypes
|
||||
export type CustomerAddressSchema =
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as Core from '@commerce/types/customer/card'
|
||||
import * as Core from '@vercel/commerce/types/customer/card'
|
||||
|
||||
export type CustomerCardTypes = Core.CustomerCardTypes
|
||||
export type CustomerCardSchema = Core.CustomerCardSchema<CustomerCardTypes>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { Product } from '@commerce/types/product'
|
||||
import type { Product } from '@vercel/commerce/types/product'
|
||||
|
||||
import type { RawProduct } from '../types/product'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HookFetcher } from '@commerce/utils/types'
|
||||
import type { Product } from '@commerce/types/product'
|
||||
import { HookFetcher } from '@vercel/commerce/utils/types'
|
||||
import type { Product } from '@vercel/commerce/types/product'
|
||||
|
||||
const defaultOpts = {}
|
||||
|
||||
|
22
packages/ordercloud/tsconfig.json
Normal file
22
packages/ordercloud/tsconfig.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"outDir": "dist",
|
||||
"baseUrl": "src",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"declaration": true,
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"pretty": true,
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user