diff --git a/.gitignore b/.gitignore index 22f1bf4f3..b7301fe56 100644 --- a/.gitignore +++ b/.gitignore @@ -2,18 +2,19 @@ # dependencies node_modules -/.pnp +.pnp .pnp.js # testing -/coverage +coverage # next.js -.next/ -out/ +.next +out # production -/build +build +dist # misc .DS_Store @@ -34,3 +35,6 @@ yarn-error.log* # vercel .vercel + +# Turborepo +.turbo diff --git a/.prettierignore b/.prettierignore index 105738ca9..1c8b279ce 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,5 @@ +# Every package defines its prettier config node_modules +dist .next -public \ No newline at end of file +public diff --git a/.prettierrc b/.prettierrc index 91990a859..e1076edfa 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,13 +2,5 @@ "semi": false, "singleQuote": true, "tabWidth": 2, - "useTabs": false, - "overrides": [ - { - "files": ["framework/saleor/**/*"], - "options": { - "printWidth": 120 - } - } - ] + "useTabs": false } diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c83e26348..60907f7fd 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,8 @@ { - "recommendations": ["esbenp.prettier-vscode"] + "recommendations": [ + "esbenp.prettier-vscode", + "csstools.postcss", + "bradlc.vscode-tailwindcss", + "ms-vscode.vscode-typescript-next" + ] } diff --git a/README.md b/README.md index 2eeea375b..d93068f06 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fcommerce&project-name=commerce&repo-name=commerce&demo-title=Next.js%20Commerce&demo-description=An%20all-in-one%20starter%20kit%20for%20high-performance%20e-commerce%20sites.&demo-url=https%3A%2F%2Fdemo.vercel.store&demo-image=https%3A%2F%2Fbigcommerce-demo-asset-ksvtgfvnd.vercel.app%2Fbigcommerce.png&integration-ids=oac_MuWZiE4jtmQ2ejZQaQ7ncuDT) +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fcommerce&project-name=commerce&repo-name=commerce&demo-title=Next.js%20Commerce&demo-description=An%20all-in-one%20starter%20kit%20for%20high-performance%20e-commerce%20sites.&demo-url=https%3A%2F%2Fdemo.vercel.store&demo-image=https%3A%2F%2Fbigcommerce-demo-asset-ksvtgfvnd.vercel.app%2Fbigcommerce.png&integration-ids=oac_MuWZiE4jtmQ2ejZQaQ7ncuDT,oac_9HSKtXld74NG0srzdxSiBGty&skippable-integrations=1&root-directory=site&build-command=cd%20..%20%26%26%20yarn%20build) # Next.js Commerce @@ -12,6 +12,10 @@ Demo live at: [demo.vercel.store](https://demo.vercel.store/) - BigCommerce Demo: https://bigcommerce.vercel.store/ - Vendure Demo: https://vendure.vercel.store - Saleor Demo: https://saleor.vercel.store/ +- Ordercloud Demo: https://ordercloud.vercel.store/ +- Spree Demo: https://spree.vercel.store/ +- Kibo Commerce Demo: https://kibocommerce.vercel.store/ +- Commerce.js Demo: https://commercejs.vercel.store/ ## Features @@ -27,42 +31,32 @@ Demo live at: [demo.vercel.store](https://demo.vercel.store/) ## Integrations -Next.js Commerce integrates out-of-the-box with BigCommerce, Shopify, Swell, Saleor and Vendure. We plan to support all major ecommerce backends. +Next.js Commerce integrates out-of-the-box with BigCommerce, Shopify, Swell, Saleor, Vendure, Spree and Commerce.js. We plan to support all major ecommerce backends. ## Considerations -- `framework/commerce` contains all types, helpers and functions to be used as base to build a new **provider**. -- **Providers** live under `framework`'s root folder and they will extend Next.js Commerce types and functionality (`framework/commerce`). +- `packages/commerce` contains all types, helpers and functions to be used as base to build a new **provider**. +- **Providers** live under `packages`'s root folder and they will extend Next.js Commerce types and functionality (`packages/commerce`). - We have a **Features API** to ensure feature parity between the UI and the Provider. The UI should update accordingly and no extra code should be bundled. All extra configuration for features will live under `features` in `commerce.config.json` and if needed it can also be accessed programatically. - Each **provider** should add its corresponding `next.config.js` and `commerce.config.json` adding specific data related to the provider. For example in case of BigCommerce, the images CDN and additional API routes. -- **Providers don't depend on anything that's specific to the application they're used in**. They only depend on `framework/commerce`, on their own framework folder and on some dependencies included in `package.json` ## Configuration ### How to change providers -Open `.env.local` and change the value of `COMMERCE_PROVIDER` to the provider you would like to use, then set the environment variables for that provider (use `.env.template` as the base). +Open `site/.env.local` and change the value of `COMMERCE_PROVIDER` to the provider you would like to use, then set the environment variables for that provider (use `site/.env.template` as the base). The setup for Shopify would look like this for example: ``` -COMMERCE_PROVIDER=shopify +COMMERCE_PROVIDER=@vercel/commerce-shopify NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN=xxxxxxx.myshopify.com ``` -And check that the `tsconfig.json` resolves to the chosen provider: - -``` - "@framework": ["framework/shopify"], - "@framework/*": ["framework/shopify/*"] -``` - -That's it! - ### Features -Every provider defines the features that it supports under `framework/{provider}/commerce.config.json` +Every provider defines the features that it supports under `packages/{provider}/src/commerce.config.json` #### Features Available @@ -79,7 +73,7 @@ For example: Turning `cart` off will disable Cart capabilities. > NOTE: The selected provider should support the feature that you are toggling. (This means that you can't turn wishlist on if the provider doesn't support this functionality out the box) -- Open `commerce.config.json` +- Open `site/commerce.config.json` - You'll see a config file like this: ```json { @@ -94,7 +88,7 @@ For example: Turning `cart` off will disable Cart capabilities. ### How to create a new provider -Follow our docs for [Adding a new Commerce Provider](framework/commerce/new-provider.md). +Follow our docs for [Adding a new Commerce Provider](packages/commerce/new-provider.md). If you succeeded building a provider, submit a PR with a valid demo and we'll review it asap. @@ -104,17 +98,17 @@ Our commitment to Open Source can be found [here](https://vercel.com/oss). 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device. 2. Create a new branch `git checkout -b MY_BRANCH_NAME` -3. Install yarn: `npm install -g yarn` -4. Install the dependencies: `yarn` -5. Duplicate `.env.template` and rename it to `.env.local` -6. Add proper store values to `.env.local` -7. Run `yarn dev` to build and watch for code changes +3. Install the dependencies: `yarn` +4. Duplicate `site/.env.template` and rename it to `site/.env.local` +5. Add proper store values to `site/.env.local` +6. Run `cd site` and `yarn dev` to build and watch for code changes +7. Run `yarn turbo run build` to check the build after your changes ## Work in progress We're using Github Projects to keep track of issues in progress and todo's. Here is our [Board](https://github.com/vercel/commerce/projects/1) -People actively working on this project: @okbel & @lfades. +People actively working on this project: @okbel, @lfades, @dominiksipowicz, @gbibeaul. ## Troubleshoot @@ -141,7 +135,7 @@ If your project was started with a "Deploy with Vercel" button, you can use Verc 2. Link local instance with Vercel and Github accounts (creates .vercel file): `vercel link` 3. Download your environment variables: `vercel env pull .env.local` -Next, you're free to customize the starter. More updates coming soon. Stay tuned. +Next, you're free to customize the starter. More updates coming soon. Stay tuned.. @@ -153,3 +147,40 @@ After Email confirmation, Checkout should be manually enabled through BigCommerc
BigCommerce team has been notified and they plan to add more details about this subject. + +
+When run locally I get `Error: Cannot find module '...@vercel/commerce/dist/config'` + +```bash +commerce/site +❯ yarn dev +yarn run v1.22.17 +$ next dev +ready - started server on 0.0.0.0:3000, url: http://localhost:3000 +info - Loaded env from /commerce/site/.env.local +error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error +Error: Cannot find module '/Users/dom/work/vercel/commerce/node_modules/@vercel/commerce/dist/config.cjs' + at createEsmNotFoundErr (node:internal/modules/cjs/loader:960:15) + at finalizeEsmResolution (node:internal/modules/cjs/loader:953:15) + at resolveExports (node:internal/modules/cjs/loader:482:14) + at Function.Module._findPath (node:internal/modules/cjs/loader:522:31) + at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27) + at Function.mod._resolveFilename (/Users/dom/work/vercel/commerce/node_modules/next/dist/build/webpack/require-hook.js:179:28) + at Function.Module._load (node:internal/modules/cjs/loader:778:27) + at Module.require (node:internal/modules/cjs/loader:1005:19) + at require (node:internal/modules/cjs/helpers:102:18) + at Object. (/Users/dom/work/vercel/commerce/site/commerce-config.js:9:14) { + code: 'MODULE_NOT_FOUND', + path: '/Users/dom/work/vercel/commerce/node_modules/@vercel/commerce/package.json' +} +error Command failed with exit code 1. +info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. +``` + +The error usually occurs when running yarn dev inside of the `/site/` folder after installing a fresh repository. + +In order to fix this, run `yarn dev` in the monorepo root folder first. + +> Using `yarn dev` from the root is recommended for developing, which will run watch mode on all packages. + +
diff --git a/components/checkout/PaymentMethodView/PaymentMethodView.tsx b/components/checkout/PaymentMethodView/PaymentMethodView.tsx deleted file mode 100644 index ebf558fec..000000000 --- a/components/checkout/PaymentMethodView/PaymentMethodView.tsx +++ /dev/null @@ -1,184 +0,0 @@ -import { FC } from 'react' -import cn from 'classnames' -import { - CardNumberElement, - CardExpiryElement, - CardCvcElement, - useStripe, - useElements -} from '@stripe/react-stripe-js' -import { Button, Text } from '@components/ui' -import { useUI } from '@components/ui/context' -import s from './PaymentMethodView.module.css' -import SidebarLayout from '@components/common/SidebarLayout' -import countries from '@lib/countries' - -const PaymentMethodView: FC = () => { - const { paymentMethodDetails, setPaymentMethodDetails, setSidebarView } = useUI() - const { address } = paymentMethodDetails - const stripe = useStripe() - const elements = useElements() - - const handleSubmit = async () => { - if (!stripe || !elements) { - return - } - - const card = elements.getElement(CardNumberElement) - - const { error, paymentMethod } = await stripe.createPaymentMethod({ - type: 'card', - card - }) - - if (error) { - console.error(error) - } - - setPaymentMethodDetails({ address, paymentMethod }) - setSidebarView('CHECKOUT_VIEW') - } - - const updateAddressData = ({ target }: any) => setPaymentMethodDetails({ - ...paymentMethodDetails, - address: { - ...paymentMethodDetails.address, - [target.name]: target.value, - }, - }) - - return ( - -
- Payment Method -
-
- - -
-
-
- - -
-
- - -
-
- - -
-
-
-
-
- - -
-
- - -
-
-
- - -
-
- - -
-
- - -
-
-
- - -
-
- - -
-
-
- - -
-
- - -
-
-
-
- -
-
- ) -} - -export default PaymentMethodView diff --git a/components/checkout/ShippingView/ShippingView.tsx b/components/checkout/ShippingView/ShippingView.tsx deleted file mode 100644 index 7ffd9a8c2..000000000 --- a/components/checkout/ShippingView/ShippingView.tsx +++ /dev/null @@ -1,207 +0,0 @@ -import { FC } from 'react' -import cn from 'classnames' -import s from './ShippingView.module.css' -import Button from '@components/ui/Button' -import { useUI } from '@components/ui/context' -import SidebarLayout from '@components/common/SidebarLayout' -import countries from '@lib/countries' -import useAddShippingAddress from '@framework/cart/use-add-shipping-address' - -const PaymentMethodView: FC = () => { - const addShippingAddress = useAddShippingAddress() - const { - paymentMethodDetails, - setShippingAddress, - setSidebarView, - setUseBillingAddressForShipping, - shippingAddress, - useBillingAddressForShipping, - } = useUI() - - const handleUseBillingAddressForShipping = (event) => { - setUseBillingAddressForShipping(event.target.value === 'true') - - if (event.target.value === 'true') { - setShippingAddress({ - firstName: paymentMethodDetails.address?.firstName, - lastName: paymentMethodDetails.address?.lastName, - company: paymentMethodDetails.address?.company, - addressLine1: paymentMethodDetails.address?.addressLine1, - addressLine2: paymentMethodDetails.address?.addressLine2, - postalCode: paymentMethodDetails.address?.postalCode, - city: paymentMethodDetails.address?.city, - country: paymentMethodDetails.address?.country, - }) - } - } - - const updateAddressData = ({ target }: any) => setShippingAddress({ - ...shippingAddress, - [target.name]: target.value, - }) - - return ( - { - // add shipping address to cart - await addShippingAddress({ address: shippingAddress }) - setSidebarView('CHECKOUT_VIEW') - }}> -
-

- Shipping -

-
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
-
- - -
-
- - -
-
- - -
-
- - -
-
-
- - -
-
- - -
-
-
- - -
-
- - -
-
-
-
- -
-
- ) -} - -export default PaymentMethodView diff --git a/components/common/FeatureBar/FeatureBar.module.css b/components/common/FeatureBar/FeatureBar.module.css deleted file mode 100644 index a3cb61cd2..000000000 --- a/components/common/FeatureBar/FeatureBar.module.css +++ /dev/null @@ -1,7 +0,0 @@ -.root { - @apply text-center p-6 bg-primary text-sm flex-row justify-center items-center font-medium fixed bottom-0 w-full z-30 transition-all duration-300 ease-out; - - @screen md { - @apply flex text-left; - } -} diff --git a/components/common/Head/Head.tsx b/components/common/Head/Head.tsx deleted file mode 100644 index b2c0c997b..000000000 --- a/components/common/Head/Head.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { FC } from 'react' -import NextHead from 'next/head' -import { DefaultSeo } from 'next-seo' -import config from '@config/seo.json' - -const Head: FC = () => { - return ( - <> - - - - - - - ) -} - -export default Head diff --git a/components/common/Searchbar/Searchbar.tsx b/components/common/Searchbar/Searchbar.tsx deleted file mode 100644 index 0fc276d02..000000000 --- a/components/common/Searchbar/Searchbar.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { FC, InputHTMLAttributes, useEffect, useMemo } from 'react' -import cn from 'classnames' -import s from './Searchbar.module.css' -import { useRouter } from 'next/router' - -interface Props { - className?: string - id?: string -} - -const Searchbar: FC = ({ className, id = 'search' }) => { - const router = useRouter() - - useEffect(() => { - router.prefetch('/search') - }, []) - - const handleKeyUp = (e: React.KeyboardEvent) => { - e.preventDefault() - - if (e.key === 'Enter') { - const q = e.currentTarget.value - - router.push( - { - pathname: `/search`, - query: q ? { q } : {}, - }, - undefined, - { shallow: true } - ) - } - } - - return useMemo( - () => ( -
- - -
- - - -
-
- ), - [] - ) -} - -export default Searchbar diff --git a/components/product/ProductOptions/ProductOptions.tsx b/components/product/ProductOptions/ProductOptions.tsx deleted file mode 100644 index 9261406bc..000000000 --- a/components/product/ProductOptions/ProductOptions.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { Swatch } from '@components/product' -import type { ProductOption } from '@commerce/types/product' -import { SelectedOptions } from '../helpers' -import React from 'react' -interface ProductOptionsProps { - options: ProductOption[] - selectedOptions: SelectedOptions - setSelectedOptions: React.Dispatch> -} - -const ProductOptions: React.FC = React.memo( - ({ options, selectedOptions, setSelectedOptions }) => { - return ( -
- {options.map((opt) => ( -
-

- {opt.displayName} -

-
- {opt.values.map((v, i: number) => { - const active = selectedOptions[opt.displayName.toLowerCase()] - return ( - { - setSelectedOptions((selectedOptions) => { - return { - ...selectedOptions, - [opt.displayName.toLowerCase()]: - v.label.toLowerCase(), - } - }) - }} - /> - ) - })} -
-
- ))} -
- ) - } -) - -export default ProductOptions diff --git a/components/product/ProductSliderControl/ProductSliderControl.tsx b/components/product/ProductSliderControl/ProductSliderControl.tsx deleted file mode 100644 index 4e767b5db..000000000 --- a/components/product/ProductSliderControl/ProductSliderControl.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import cn from 'classnames' -import React from 'react' -import s from './ProductSliderControl.module.css' -import { ArrowLeft, ArrowRight } from '@components/icons' - -interface ProductSliderControl { - onPrev: React.MouseEventHandler - onNext: React.MouseEventHandler -} - -const ProductSliderControl: React.FC = React.memo( - ({ onPrev, onNext }) => ( -
- - -
- ) -) -export default ProductSliderControl diff --git a/components/product/Swatch/Swatch.tsx b/components/product/Swatch/Swatch.tsx deleted file mode 100644 index d04e77a78..000000000 --- a/components/product/Swatch/Swatch.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import cn from 'classnames' -import React from 'react' -import s from './Swatch.module.css' -import { Check } from '@components/icons' -import Button, { ButtonProps } from '@components/ui/Button' -import { isDark } from '@lib/colors' -interface SwatchProps { - active?: boolean - children?: any - className?: string - variant?: 'size' | 'color' | string - color?: string - label?: string | null -} - -const Swatch: React.FC & SwatchProps> = React.memo( - ({ - active, - className, - color = '', - label = null, - variant = 'size', - ...props - }) => { - variant = variant?.toLowerCase() - - if (label) { - label = label?.toLowerCase() - } - - const swatchClassName = cn( - s.swatch, - { - [s.color]: color, - [s.active]: active, - [s.size]: variant === 'size', - [s.dark]: color ? isDark(color) : false, - [s.textLabel]: !color && label && label.length > 3, - }, - className - ) - - return ( - - ) - } -) - -export default Swatch diff --git a/components/ui/Rating/Rating.tsx b/components/ui/Rating/Rating.tsx deleted file mode 100644 index 259e642ea..000000000 --- a/components/ui/Rating/Rating.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React, { FC } from 'react' -import rangeMap from '@lib/range-map' -import { Star } from '@components/icons' -import cn from 'classnames' - -export interface RatingProps { - value: number -} - -const Quantity: React.FC = React.memo(({ value = 5 }) => { - return ( -
- {rangeMap(5, (i) => ( - = Math.floor(value), - })} - > - - - ))} -
- ) -}) - -export default Quantity diff --git a/components/ui/Sidebar/Sidebar.tsx b/components/ui/Sidebar/Sidebar.tsx deleted file mode 100644 index ce0eeefe2..000000000 --- a/components/ui/Sidebar/Sidebar.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { FC, useEffect, useRef } from 'react' -import s from './Sidebar.module.css' -import cn from 'classnames' -import { - disableBodyScroll, - enableBodyScroll, - clearAllBodyScrollLocks, -} from 'body-scroll-lock' - -interface SidebarProps { - children: any - onClose: () => void -} - -const Sidebar: FC = ({ children, onClose }) => { - const ref = useRef() as React.MutableRefObject - - useEffect(() => { - if (ref.current) { - disableBodyScroll(ref.current, { reserveScrollBarGap: true }) - } - return () => { - if (ref && ref.current) { - enableBodyScroll(ref.current) - } - clearAllBodyScrollLocks() - } - }, []) - - return ( -
-
-
-
-
-
- {children} -
-
-
-
-
- ) -} - -export default Sidebar diff --git a/components/ui/Text/Text.module.css b/components/ui/Text/Text.module.css deleted file mode 100644 index f572fdf18..000000000 --- a/components/ui/Text/Text.module.css +++ /dev/null @@ -1,15 +0,0 @@ -.body { - @apply text-base leading-7 max-w-6xl mx-auto; -} - -.heading { - @apply text-5xl pt-1 pb-2 font-semibold tracking-wide cursor-pointer mb-2; -} - -.pageHeading { - @apply pt-1 pb-4 text-2xl leading-7 font-bold tracking-wide; -} - -.sectionHeading { - @apply pt-1 pb-2 text-2xl font-bold tracking-wide cursor-pointer mb-2; -} diff --git a/framework/bigcommerce/index.tsx b/framework/bigcommerce/index.tsx deleted file mode 100644 index 024e54b56..000000000 --- a/framework/bigcommerce/index.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import type { ReactNode } from 'react' -import { - CommerceConfig, - CommerceProvider as CoreCommerceProvider, - useCommerce as useCoreCommerce, -} from '@commerce' -import { bigcommerceProvider } from './provider' -import type { BigcommerceProvider } from './provider' - -export { bigcommerceProvider } -export type { BigcommerceProvider } - -export const bigcommerceConfig: CommerceConfig = { - locale: 'en-us', - cartCookie: 'bc_cartId', -} - -export type BigcommerceConfig = Partial - -export type BigcommerceProps = { - children?: ReactNode - locale: string -} & BigcommerceConfig - -export function CommerceProvider({ children, ...config }: BigcommerceProps) { - return ( - - {children} - - ) -} - -export const useCommerce = () => useCoreCommerce() diff --git a/framework/bigcommerce/types/checkout.ts b/framework/bigcommerce/types/checkout.ts deleted file mode 100644 index 4e2412ef6..000000000 --- a/framework/bigcommerce/types/checkout.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/checkout' diff --git a/framework/bigcommerce/types/common.ts b/framework/bigcommerce/types/common.ts deleted file mode 100644 index b52c33a4d..000000000 --- a/framework/bigcommerce/types/common.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/common' diff --git a/framework/bigcommerce/types/customer.ts b/framework/bigcommerce/types/customer.ts deleted file mode 100644 index 427bc0b03..000000000 --- a/framework/bigcommerce/types/customer.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as Core from '@commerce/types/customer' - -export * from '@commerce/types/customer' - -export type CustomerSchema = Core.CustomerSchema diff --git a/framework/bigcommerce/types/login.ts b/framework/bigcommerce/types/login.ts deleted file mode 100644 index 24d5077ff..000000000 --- a/framework/bigcommerce/types/login.ts +++ /dev/null @@ -1,8 +0,0 @@ -import * as Core from '@commerce/types/login' -import type { LoginMutationVariables } from '../schema' - -export * from '@commerce/types/login' - -export type LoginOperation = Core.LoginOperation & { - variables: LoginMutationVariables -} diff --git a/framework/bigcommerce/types/logout.ts b/framework/bigcommerce/types/logout.ts deleted file mode 100644 index 9f0a466af..000000000 --- a/framework/bigcommerce/types/logout.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/logout' diff --git a/framework/bigcommerce/types/product.ts b/framework/bigcommerce/types/product.ts deleted file mode 100644 index c776d58fa..000000000 --- a/framework/bigcommerce/types/product.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/product' diff --git a/framework/bigcommerce/types/signup.ts b/framework/bigcommerce/types/signup.ts deleted file mode 100644 index 58543c6f6..000000000 --- a/framework/bigcommerce/types/signup.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/signup' diff --git a/framework/commerce/config.js b/framework/commerce/config.js deleted file mode 100644 index 5ab550f84..000000000 --- a/framework/commerce/config.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * This file is expected to be used in next.config.js only - */ - -const path = require('path') -const fs = require('fs') -const merge = require('deepmerge') -const prettier = require('prettier') - -const PROVIDERS = [ - 'bigcommerce', - 'shopify', - 'swell', - 'vendure', - 'reactioncommerce', - 'saleor', - 'local', -] - -function getProviderName() { - return ( - process.env.COMMERCE_PROVIDER || - (process.env.BIGCOMMERCE_STOREFRONT_API_URL - ? 'bigcommerce' - : process.env.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN - ? 'shopify' - : process.env.NEXT_PUBLIC_SWELL_STORE_ID - ? 'swell' - : 'local') - ) -} - -function withCommerceConfig(nextConfig = {}) { - const commerce = nextConfig.commerce || {} - const name = commerce.provider || getProviderName() - - if (!name) { - throw new Error( - `The commerce provider is missing, please add a valid provider name or its environment variables` - ) - } - if (!PROVIDERS.includes(name)) { - throw new Error( - `The commerce provider "${name}" can't be found, please use one of "${PROVIDERS.join( - ', ' - )}"` - ) - } - - const commerceNextConfig = require(path.join('../', name, 'next.config')) - const config = merge(nextConfig, commerceNextConfig) - - config.env = config.env || {} - - Object.entries(config.commerce.features).forEach(([k, v]) => { - if (v) config.env[`COMMERCE_${k.toUpperCase()}_ENABLED`] = true - }) - - // Update paths in `tsconfig.json` to point to the selected provider - if (config.commerce.updateTSConfig !== false) { - const tsconfigPath = path.join(process.cwd(), 'tsconfig.json') - const tsconfig = require(tsconfigPath) - - tsconfig.compilerOptions.paths['@framework'] = [`framework/${name}`] - tsconfig.compilerOptions.paths['@framework/*'] = [`framework/${name}/*`] - - // When running for production it may be useful to exclude the other providers - // from TS checking - if (process.env.VERCEL) { - const exclude = tsconfig.exclude.filter( - (item) => !item.startsWith('framework/') - ) - - tsconfig.exclude = PROVIDERS.reduce((exclude, current) => { - if (current !== name) exclude.push(`framework/${current}`) - return exclude - }, exclude) - } - - fs.writeFileSync( - tsconfigPath, - prettier.format(JSON.stringify(tsconfig), { parser: 'json' }) - ) - } - - return config -} - -module.exports = { withCommerceConfig, getProviderName } diff --git a/framework/commerce/types/checkout.ts b/framework/commerce/types/checkout.ts deleted file mode 100644 index 9e3c7ecfa..000000000 --- a/framework/commerce/types/checkout.ts +++ /dev/null @@ -1,10 +0,0 @@ -export type CheckoutSchema = { - endpoint: { - options: {} - handlers: { - checkout: { - data: null - } - } - } -} diff --git a/framework/local/index.tsx b/framework/local/index.tsx deleted file mode 100644 index 2ec304f63..000000000 --- a/framework/local/index.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import * as React from 'react' -import { ReactNode } from 'react' -import { localProvider } from './provider' -import { - CommerceConfig, - CommerceProvider as CoreCommerceProvider, - useCommerce as useCoreCommerce, -} from '@commerce' - -export const localConfig: CommerceConfig = { - locale: 'en-us', - cartCookie: 'session', -} - -export function CommerceProvider({ - children, - ...config -}: { - children?: ReactNode - locale: string -} & Partial) { - return ( - - {children} - - ) -} - -export const useCommerce = () => useCoreCommerce() diff --git a/framework/local/product/use-price.tsx b/framework/local/product/use-price.tsx deleted file mode 100644 index 0174faf5e..000000000 --- a/framework/local/product/use-price.tsx +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@commerce/product/use-price' -export { default } from '@commerce/product/use-price' diff --git a/framework/reactioncommerce/product/use-price.tsx b/framework/reactioncommerce/product/use-price.tsx deleted file mode 100644 index 0174faf5e..000000000 --- a/framework/reactioncommerce/product/use-price.tsx +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@commerce/product/use-price' -export { default } from '@commerce/product/use-price' diff --git a/framework/saleor/api/endpoints/customer.ts b/framework/saleor/api/endpoints/customer.ts deleted file mode 100644 index d09c976c3..000000000 --- a/framework/saleor/api/endpoints/customer.ts +++ /dev/null @@ -1 +0,0 @@ -export default function (_commerce: any) {} diff --git a/framework/saleor/commerce.config.json b/framework/saleor/commerce.config.json deleted file mode 100644 index d5a1ac35d..000000000 --- a/framework/saleor/commerce.config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "provider": "saleor", - "features": { - "wishlist": false, - "customCheckout": true - } -} diff --git a/framework/saleor/index.tsx b/framework/saleor/index.tsx deleted file mode 100644 index 5c9e61ec8..000000000 --- a/framework/saleor/index.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import * as React from 'react' -import { ReactNode } from 'react' - -import { CommerceConfig, CommerceProvider as CoreCommerceProvider, useCommerce as useCoreCommerce } from '@commerce' - -import { saleorProvider, SaleorProvider } from './provider' -import * as Const from './const' - -export { saleorProvider } -export type { SaleorProvider } - -export const saleorConfig: CommerceConfig = { - locale: 'en-us', - cartCookie: Const.CHECKOUT_ID_COOKIE, -} - -export type SaleorConfig = Partial - -export type SaleorProps = { - children?: ReactNode - locale: string -} & SaleorConfig - -export function CommerceProvider({ children, ...config }: SaleorProps) { - return ( - - {children} - - ) -} - -export const useCommerce = () => useCoreCommerce() diff --git a/framework/saleor/product/use-price.tsx b/framework/saleor/product/use-price.tsx deleted file mode 100644 index 0174faf5e..000000000 --- a/framework/saleor/product/use-price.tsx +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@commerce/product/use-price' -export { default } from '@commerce/product/use-price' diff --git a/framework/shopify/api/endpoints/customer.ts b/framework/shopify/api/endpoints/customer.ts deleted file mode 100644 index d09c976c3..000000000 --- a/framework/shopify/api/endpoints/customer.ts +++ /dev/null @@ -1 +0,0 @@ -export default function (_commerce: any) {} diff --git a/framework/shopify/index.tsx b/framework/shopify/index.tsx deleted file mode 100644 index 46ed106c5..000000000 --- a/framework/shopify/index.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import * as React from 'react' -import { ReactNode } from 'react' - -import { - CommerceConfig, - CommerceProvider as CoreCommerceProvider, - useCommerce as useCoreCommerce, -} from '@commerce' - -import { shopifyProvider } from './provider' -import type { ShopifyProvider } from './provider' -import { SHOPIFY_CHECKOUT_ID_COOKIE } from './const' - -export { shopifyProvider } -export type { ShopifyProvider } - -export const shopifyConfig: CommerceConfig = { - locale: 'en-us', - cartCookie: SHOPIFY_CHECKOUT_ID_COOKIE, -} - -export type ShopifyConfig = Partial - -export type ShopifyProps = { - children?: ReactNode - locale: string -} & ShopifyConfig - -export function CommerceProvider({ children, ...config }: ShopifyProps) { - return ( - - {children} - - ) -} - -export const useCommerce = () => useCoreCommerce() diff --git a/framework/shopify/product/use-price.tsx b/framework/shopify/product/use-price.tsx deleted file mode 100644 index 0174faf5e..000000000 --- a/framework/shopify/product/use-price.tsx +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@commerce/product/use-price' -export { default } from '@commerce/product/use-price' diff --git a/framework/shopify/types/checkout.ts b/framework/shopify/types/checkout.ts deleted file mode 100644 index 4e2412ef6..000000000 --- a/framework/shopify/types/checkout.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/checkout' diff --git a/framework/shopify/types/common.ts b/framework/shopify/types/common.ts deleted file mode 100644 index b52c33a4d..000000000 --- a/framework/shopify/types/common.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/common' diff --git a/framework/shopify/types/customer.ts b/framework/shopify/types/customer.ts deleted file mode 100644 index 427bc0b03..000000000 --- a/framework/shopify/types/customer.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as Core from '@commerce/types/customer' - -export * from '@commerce/types/customer' - -export type CustomerSchema = Core.CustomerSchema diff --git a/framework/shopify/types/login.ts b/framework/shopify/types/login.ts deleted file mode 100644 index 964ac89e2..000000000 --- a/framework/shopify/types/login.ts +++ /dev/null @@ -1,8 +0,0 @@ -import * as Core from '@commerce/types/login' -import type { CustomerAccessTokenCreateInput } from '../schema' - -export * from '@commerce/types/login' - -export type LoginOperation = Core.LoginOperation & { - variables: CustomerAccessTokenCreateInput -} diff --git a/framework/shopify/types/logout.ts b/framework/shopify/types/logout.ts deleted file mode 100644 index 9f0a466af..000000000 --- a/framework/shopify/types/logout.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/logout' diff --git a/framework/shopify/types/product.ts b/framework/shopify/types/product.ts deleted file mode 100644 index c776d58fa..000000000 --- a/framework/shopify/types/product.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/product' diff --git a/framework/shopify/types/signup.ts b/framework/shopify/types/signup.ts deleted file mode 100644 index 58543c6f6..000000000 --- a/framework/shopify/types/signup.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/signup' diff --git a/framework/shopify/types/site.ts b/framework/shopify/types/site.ts deleted file mode 100644 index bfef69cf9..000000000 --- a/framework/shopify/types/site.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/site' diff --git a/framework/shopify/types/wishlist.ts b/framework/shopify/types/wishlist.ts deleted file mode 100644 index 8907fbf82..000000000 --- a/framework/shopify/types/wishlist.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/wishlist' diff --git a/framework/shopify/utils/checkout-create.ts b/framework/shopify/utils/checkout-create.ts deleted file mode 100644 index 359d16315..000000000 --- a/framework/shopify/utils/checkout-create.ts +++ /dev/null @@ -1,33 +0,0 @@ -import Cookies from 'js-cookie' - -import { - SHOPIFY_CHECKOUT_ID_COOKIE, - SHOPIFY_CHECKOUT_URL_COOKIE, - SHOPIFY_COOKIE_EXPIRE, -} from '../const' - -import checkoutCreateMutation from './mutations/checkout-create' -import { CheckoutCreatePayload } from '../schema' - -export const checkoutCreate = async ( - fetch: any -): Promise => { - const data = await fetch({ - query: checkoutCreateMutation, - }) - - const checkout = data.checkoutCreate?.checkout - const checkoutId = checkout?.id - - if (checkoutId) { - const options = { - expires: SHOPIFY_COOKIE_EXPIRE, - } - Cookies.set(SHOPIFY_CHECKOUT_ID_COOKIE, checkoutId, options) - Cookies.set(SHOPIFY_CHECKOUT_URL_COOKIE, checkout.webUrl, options) - } - - return checkout -} - -export default checkoutCreate diff --git a/framework/swell/api/endpoints/customer.ts b/framework/swell/api/endpoints/customer.ts deleted file mode 100644 index d09c976c3..000000000 --- a/framework/swell/api/endpoints/customer.ts +++ /dev/null @@ -1 +0,0 @@ -export default function (_commerce: any) {} diff --git a/framework/swell/index.tsx b/framework/swell/index.tsx deleted file mode 100644 index 28f60b394..000000000 --- a/framework/swell/index.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import * as React from 'react' -import swell from 'swell-js' -import { ReactNode } from 'react' - -import { - CommerceConfig, - CommerceProvider as CoreCommerceProvider, - useCommerce as useCoreCommerce, -} from '@commerce' - -import { swellProvider, SwellProvider } from './provider' -import { - SWELL_CHECKOUT_ID_COOKIE, - SWELL_STORE_ID, - SWELL_PUBLIC_KEY, -} from './const' -swell.init(SWELL_STORE_ID, SWELL_PUBLIC_KEY) - -export { swellProvider } -export type { SwellProvider } - -export const swellConfig: any = { - locale: 'en-us', - cartCookie: SWELL_CHECKOUT_ID_COOKIE, - swell, -} - -export type SwellConfig = Partial - -export type SwellProps = { - children?: ReactNode - locale: string -} & SwellConfig - -export function CommerceProvider({ children, ...config }: SwellProps) { - return ( - - {children} - - ) -} - -export const useCommerce = () => useCoreCommerce() diff --git a/framework/swell/product/use-price.tsx b/framework/swell/product/use-price.tsx deleted file mode 100644 index 0174faf5e..000000000 --- a/framework/swell/product/use-price.tsx +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@commerce/product/use-price' -export { default } from '@commerce/product/use-price' diff --git a/framework/swell/types/cart.ts b/framework/swell/types/cart.ts deleted file mode 100644 index 6ed5c6c64..000000000 --- a/framework/swell/types/cart.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/cart' diff --git a/framework/swell/types/checkout.ts b/framework/swell/types/checkout.ts deleted file mode 100644 index 4e2412ef6..000000000 --- a/framework/swell/types/checkout.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/checkout' diff --git a/framework/swell/types/common.ts b/framework/swell/types/common.ts deleted file mode 100644 index b52c33a4d..000000000 --- a/framework/swell/types/common.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/common' diff --git a/framework/swell/types/customer.ts b/framework/swell/types/customer.ts deleted file mode 100644 index 87c9afcc4..000000000 --- a/framework/swell/types/customer.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/customer' diff --git a/framework/swell/types/login.ts b/framework/swell/types/login.ts deleted file mode 100644 index ab11a420a..000000000 --- a/framework/swell/types/login.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as Core from '@commerce/types/login' -import { LoginBody, LoginTypes } from '@commerce/types/login' - -export * from '@commerce/types/login' - -export type LoginHook = { - data: null - actionInput: LoginBody - fetcherInput: LoginBody - body: T['body'] -} diff --git a/framework/swell/types/logout.ts b/framework/swell/types/logout.ts deleted file mode 100644 index 9f0a466af..000000000 --- a/framework/swell/types/logout.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/logout' diff --git a/framework/swell/types/page.ts b/framework/swell/types/page.ts deleted file mode 100644 index 20ec8ea38..000000000 --- a/framework/swell/types/page.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/page' diff --git a/framework/swell/types/product.ts b/framework/swell/types/product.ts deleted file mode 100644 index c776d58fa..000000000 --- a/framework/swell/types/product.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/product' diff --git a/framework/swell/types/signup.ts b/framework/swell/types/signup.ts deleted file mode 100644 index 58543c6f6..000000000 --- a/framework/swell/types/signup.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/signup' diff --git a/framework/swell/types/site.ts b/framework/swell/types/site.ts deleted file mode 100644 index bfef69cf9..000000000 --- a/framework/swell/types/site.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/site' diff --git a/framework/swell/types/wishlist.ts b/framework/swell/types/wishlist.ts deleted file mode 100644 index 8907fbf82..000000000 --- a/framework/swell/types/wishlist.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/wishlist' diff --git a/framework/vendure/index.tsx b/framework/vendure/index.tsx deleted file mode 100644 index 47e60c7df..000000000 --- a/framework/vendure/index.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import * as React from 'react' -import { ReactNode } from 'react' -import { - CommerceConfig, - CommerceProvider as CoreCommerceProvider, - useCommerce as useCoreCommerce, -} from '@commerce' -import { vendureProvider } from './provider' - -export const vendureConfig: CommerceConfig = { - locale: 'en-us', - cartCookie: 'session', -} - -export type VendureConfig = Partial - -export type VendureProps = { - children?: ReactNode - locale: string -} & VendureConfig - -export function CommerceProvider({ children, ...config }: VendureProps) { - return ( - - {children} - - ) -} - -export const useCommerce = () => useCoreCommerce() diff --git a/framework/vendure/product/use-price.tsx b/framework/vendure/product/use-price.tsx deleted file mode 100644 index 0174faf5e..000000000 --- a/framework/vendure/product/use-price.tsx +++ /dev/null @@ -1,2 +0,0 @@ -export * from '@commerce/product/use-price' -export { default } from '@commerce/product/use-price' diff --git a/framework/vendure/types/cart.ts b/framework/vendure/types/cart.ts deleted file mode 100644 index 6ed5c6c64..000000000 --- a/framework/vendure/types/cart.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/cart' diff --git a/framework/vendure/types/checkout.ts b/framework/vendure/types/checkout.ts deleted file mode 100644 index 4e2412ef6..000000000 --- a/framework/vendure/types/checkout.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/checkout' diff --git a/framework/vendure/types/common.ts b/framework/vendure/types/common.ts deleted file mode 100644 index b52c33a4d..000000000 --- a/framework/vendure/types/common.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/common' diff --git a/framework/vendure/types/customer.ts b/framework/vendure/types/customer.ts deleted file mode 100644 index 87c9afcc4..000000000 --- a/framework/vendure/types/customer.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/customer' diff --git a/framework/vendure/types/login.ts b/framework/vendure/types/login.ts deleted file mode 100644 index 16bae8f65..000000000 --- a/framework/vendure/types/login.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as Core from '@commerce/types/login' -import type { LoginMutationVariables } from '../schema' -import { LoginBody, LoginTypes } from '@commerce/types/login' - -export * from '@commerce/types/login' - -export type LoginHook = { - data: null - actionInput: LoginBody - fetcherInput: LoginBody - body: T['body'] -} diff --git a/framework/vendure/types/logout.ts b/framework/vendure/types/logout.ts deleted file mode 100644 index 9f0a466af..000000000 --- a/framework/vendure/types/logout.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/logout' diff --git a/framework/vendure/types/page.ts b/framework/vendure/types/page.ts deleted file mode 100644 index 20ec8ea38..000000000 --- a/framework/vendure/types/page.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/page' diff --git a/framework/vendure/types/product.ts b/framework/vendure/types/product.ts deleted file mode 100644 index c776d58fa..000000000 --- a/framework/vendure/types/product.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/product' diff --git a/framework/vendure/types/signup.ts b/framework/vendure/types/signup.ts deleted file mode 100644 index 58543c6f6..000000000 --- a/framework/vendure/types/signup.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/signup' diff --git a/framework/vendure/types/site.ts b/framework/vendure/types/site.ts deleted file mode 100644 index bfef69cf9..000000000 --- a/framework/vendure/types/site.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/site' diff --git a/framework/vendure/types/wishlist.ts b/framework/vendure/types/wishlist.ts deleted file mode 100644 index 8907fbf82..000000000 --- a/framework/vendure/types/wishlist.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@commerce/types/wishlist' diff --git a/next-env.d.ts b/next-env.d.ts deleted file mode 100644 index c6643fda1..000000000 --- a/next-env.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -/// -/// diff --git a/package.json b/package.json index c31a8798a..fc97f30b9 100644 --- a/package.json +++ b/package.json @@ -1,121 +1,27 @@ { - "name": "nextjs-commerce", - "version": "1.0.0", - "scripts": { - "dev": "NODE_OPTIONS='--inspect' next dev -p 4000", - "build": "next build", - "start": "next start", - "analyze": "BUNDLE_ANALYZE=both yarn build", - "prettier-fix": "prettier --write .", - "find:unused": "npx next-unused", - "generate": "graphql-codegen", - "generate:reactioncommerce": "graphql-codegen --config framework/reactioncommerce/codegen.json", - "generate:shopify": "DOTENV_CONFIG_PATH=./.env.local graphql-codegen -r dotenv/config --config framework/shopify/codegen.json", - "generate:vendure": "graphql-codegen --config framework/vendure/codegen.json", - "generate:definitions": "node framework/bigcommerce/scripts/generate-definitions.js" - }, - "sideEffects": false, + "name": "commerce", "license": "MIT", - "engines": { - "node": ">=14.x" - }, - "dependencies": { - "@react-spring/web": "^9.2.1", - "@stripe/react-stripe-js": "^1.4.1", - "@stripe/stripe-js": "^1.16.0", - "@vercel/fetch": "^6.1.0", - "autoprefixer": "^10.2.6", - "body-scroll-lock": "^3.1.5", - "classnames": "^2.3.1", - "cookie": "^0.4.1", - "email-validator": "^2.0.4", - "immutability-helper": "^3.1.1", - "js-cookie": "^2.2.1", - "keen-slider": "^5.5.1", - "lodash.debounce": "^4.0.8", - "lodash.random": "^3.2.0", - "lodash.throttle": "^4.1.1", - "next": "^11.0.0", - "next-seo": "^4.26.0", - "next-themes": "^0.0.14", - "postcss": "^8.3.5", - "postcss-nesting": "^8.0.1", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "react-fast-marquee": "^1.1.4", - "react-merge-refs": "^1.1.0", - "react-use-measure": "^2.0.4", - "swell-js": "^4.0.0-next.0", - "swr": "^0.5.6", - "tabbable": "^5.2.0", - "tailwindcss": "^2.2.2", - "uuidv4": "^6.2.10" + "private": true, + "workspaces": [ + "site", + "packages/*" + ], + "scripts": { + "build": "turbo run build --scope=next-commerce --include-dependencies --no-deps", + "dev": "turbo run dev", + "start": "turbo run start", + "types": "turbo run types", + "prettier-fix": "prettier --write ." }, "devDependencies": { - "@graphql-codegen/cli": "^1.21.5", - "@graphql-codegen/schema-ast": "^1.18.3", - "@graphql-codegen/typescript": "^1.22.2", - "@graphql-codegen/typescript-operations": "^1.18.1", - "@next/bundle-analyzer": "^10.2.3", - "@types/body-scroll-lock": "^2.6.1", - "@types/cookie": "^0.4.0", - "@types/js-cookie": "^2.2.6", - "@types/lodash.debounce": "^4.0.6", - "@types/lodash.random": "^3.2.6", - "@types/lodash.throttle": "^4.1.6", - "@types/node": "^15.12.4", - "@types/react": "^17.0.8", - "deepmerge": "^4.2.2", - "graphql": "^15.5.1", - "husky": "^6.0.0", - "lint-staged": "^11.0.0", - "postcss-flexbugs-fixes": "^5.0.2", - "postcss-preset-env": "^6.7.0", - "prettier": "^2.3.0", - "typescript": "4.3.4" + "husky": "^7.0.4", + "prettier": "^2.5.1", + "turbo": "^1.1.2" }, "husky": { "hooks": { - "pre-commit": "lint-staged" + "pre-commit": "turbo run lint" } }, - "lint-staged": { - "**/*.{js,jsx,ts,tsx}": [ - "prettier --write", - "git add" - ], - "**/*.{md,mdx,json}": [ - "prettier --write", - "git add" - ] - }, - "next-unused": { - "alias": { - "@lib/*": [ - "lib/*" - ], - "@assets/*": [ - "assets/*" - ], - "@config/*": [ - "config/*" - ], - "@components/*": [ - "components/*" - ], - "@utils/*": [ - "utils/*" - ] - }, - "debug": true, - "include": [ - "components", - "lib", - "pages" - ], - "exclude": [], - "entrypoints": [ - "pages" - ] - } + "packageManager": "yarn@1.22.17" } diff --git a/framework/bigcommerce/.env.template b/packages/bigcommerce/.env.template similarity index 100% rename from framework/bigcommerce/.env.template rename to packages/bigcommerce/.env.template diff --git a/packages/bigcommerce/.prettierignore b/packages/bigcommerce/.prettierignore new file mode 100644 index 000000000..f06235c46 --- /dev/null +++ b/packages/bigcommerce/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/bigcommerce/.prettierrc b/packages/bigcommerce/.prettierrc new file mode 100644 index 000000000..e1076edfa --- /dev/null +++ b/packages/bigcommerce/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/framework/bigcommerce/README.md b/packages/bigcommerce/README.md similarity index 97% rename from framework/bigcommerce/README.md rename to packages/bigcommerce/README.md index 7f62a5f3f..1e8c6cb08 100644 --- a/framework/bigcommerce/README.md +++ b/packages/bigcommerce/README.md @@ -9,7 +9,7 @@ With the deploy button below you'll be able to have a [BigCommerce](https://www. If you already have a BigCommerce account and want to use your current store, then copy the `.env.template` file in this directory to `.env.local` in the main directory (which will be ignored by Git): ```bash -cp framework/bigcommerce/.env.template .env.local +cp packages/bigcommerce/.env.template .env.local ``` Then, set the environment variables in `.env.local` to match the ones from your store. diff --git a/codegen.bigcommerce.json b/packages/bigcommerce/codegen.json similarity index 73% rename from codegen.bigcommerce.json rename to packages/bigcommerce/codegen.json index 1f14e88ac..7346508f7 100644 --- a/codegen.bigcommerce.json +++ b/packages/bigcommerce/codegen.json @@ -8,16 +8,16 @@ }, "documents": [ { - "./framework/bigcommerce/api/**/*.ts": { + "./src/api/**/*.ts": { "noRequire": true } } ], "generates": { - "./framework/bigcommerce/schema.d.ts": { + "./schema.d.ts": { "plugins": ["typescript", "typescript-operations"] }, - "./framework/bigcommerce/schema.graphql": { + "./schema.graphql": { "plugins": ["schema-ast"] } }, diff --git a/packages/bigcommerce/package.json b/packages/bigcommerce/package.json new file mode 100644 index 000000000..34b8ac614 --- /dev/null +++ b/packages/bigcommerce/package.json @@ -0,0 +1,86 @@ +{ + "name": "@vercel/commerce-bigcommerce", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "release": "taskr release", + "build": "taskr build", + "dev": "taskr", + "types": "tsc --emitDeclarationOnly", + "generate:definitions": "node scripts/generate-definitions.js" + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], + "./next.config": "./dist/next.config.cjs" + }, + "typesVersions": { + "*": { + "*": [ + "src/*", + "src/*/index" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + }, + "files": [ + "dist" + ], + "publishConfig": { + "typesVersions": { + "*": { + "*": [ + "dist/*.d.ts", + "dist/*/index.d.ts" + ], + "config": [ + "dist/next.config.d.cts" + ] + } + } + }, + "dependencies": { + "@vercel/fetch": "^6.1.1", + "cookie": "^0.4.1", + "immutability-helper": "^3.1.1", + "jsonwebtoken": "^8.5.1", + "lodash.debounce": "^4.0.8", + "uuidv4": "^6.2.12" + }, + "peerDependencies": { + "next": "^12", + "react": "^17", + "react-dom": "^17" + }, + "devDependencies": { + "@taskr/clear": "^1.1.0", + "@taskr/esnext": "^1.1.0", + "@taskr/watch": "^1.1.0", + "@types/cookie": "^0.4.1", + "@types/jsonwebtoken": "^8.5.7", + "@types/lodash.debounce": "^4.0.6", + "@types/node": "^17.0.8", + "@types/react": "^17.0.38", + "lint-staged": "^12.1.7", + "next": "^12.0.8", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "taskr": "^1.1.0", + "taskr-swc": "^0.0.1", + "typescript": "^4.5.4" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,json}": [ + "prettier --write", + "git add" + ] + } +} diff --git a/framework/bigcommerce/schema.d.ts b/packages/bigcommerce/schema.d.ts similarity index 100% rename from framework/bigcommerce/schema.d.ts rename to packages/bigcommerce/schema.d.ts diff --git a/framework/bigcommerce/schema.graphql b/packages/bigcommerce/schema.graphql similarity index 100% rename from framework/bigcommerce/schema.graphql rename to packages/bigcommerce/schema.graphql diff --git a/framework/bigcommerce/scripts/generate-definitions.js b/packages/bigcommerce/scripts/generate-definitions.js similarity index 100% rename from framework/bigcommerce/scripts/generate-definitions.js rename to packages/bigcommerce/scripts/generate-definitions.js diff --git a/framework/bigcommerce/api/definitions/catalog.ts b/packages/bigcommerce/src/api/definitions/catalog.ts similarity index 100% rename from framework/bigcommerce/api/definitions/catalog.ts rename to packages/bigcommerce/src/api/definitions/catalog.ts diff --git a/framework/bigcommerce/api/definitions/store-content.ts b/packages/bigcommerce/src/api/definitions/store-content.ts similarity index 100% rename from framework/bigcommerce/api/definitions/store-content.ts rename to packages/bigcommerce/src/api/definitions/store-content.ts diff --git a/framework/bigcommerce/api/definitions/wishlist.ts b/packages/bigcommerce/src/api/definitions/wishlist.ts similarity index 100% rename from framework/bigcommerce/api/definitions/wishlist.ts rename to packages/bigcommerce/src/api/definitions/wishlist.ts diff --git a/framework/bigcommerce/api/endpoints/cart/add-item.ts b/packages/bigcommerce/src/api/endpoints/cart/add-item.ts similarity index 88% rename from framework/bigcommerce/api/endpoints/cart/add-item.ts rename to packages/bigcommerce/src/api/endpoints/cart/add-item.ts index 52ef1223d..d2bb7ad6d 100644 --- a/framework/bigcommerce/api/endpoints/cart/add-item.ts +++ b/packages/bigcommerce/src/api/endpoints/cart/add-item.ts @@ -27,11 +27,11 @@ const addItem: CartEndpoint['handlers']['addItem'] = async ({ } const { data } = cartId ? await config.storeApiFetch( - `/v3/carts/${cartId}/items?include=line_items.physical_items.options`, + `/v3/carts/${cartId}/items?include=line_items.physical_items.options,line_items.digital_items.options`, options ) : await config.storeApiFetch( - '/v3/carts?include=line_items.physical_items.options', + '/v3/carts?include=line_items.physical_items.options,line_items.digital_items.options', options ) diff --git a/framework/bigcommerce/api/endpoints/cart/get-cart.ts b/packages/bigcommerce/src/api/endpoints/cart/get-cart.ts similarity index 96% rename from framework/bigcommerce/api/endpoints/cart/get-cart.ts rename to packages/bigcommerce/src/api/endpoints/cart/get-cart.ts index d3bb309e2..b6a7d88e9 100644 --- a/framework/bigcommerce/api/endpoints/cart/get-cart.ts +++ b/packages/bigcommerce/src/api/endpoints/cart/get-cart.ts @@ -15,7 +15,7 @@ const getCart: CartEndpoint['handlers']['getCart'] = async ({ if (cartId) { try { result = await config.storeApiFetch( - `/v3/carts/${cartId}?include=line_items.physical_items.options` + `/v3/carts/${cartId}?include=line_items.physical_items.options,line_items.digital_items.options` ) } catch (error) { if (error instanceof BigcommerceApiError && error.status === 404) { diff --git a/framework/bigcommerce/api/endpoints/cart/index.ts b/packages/bigcommerce/src/api/endpoints/cart/index.ts similarity index 81% rename from framework/bigcommerce/api/endpoints/cart/index.ts rename to packages/bigcommerce/src/api/endpoints/cart/index.ts index ae2414d70..376651178 100644 --- a/framework/bigcommerce/api/endpoints/cart/index.ts +++ b/packages/bigcommerce/src/api/endpoints/cart/index.ts @@ -1,5 +1,5 @@ -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 type { CartSchema } from '../../../types/cart' import type { BigcommerceAPI } from '../..' import getCart from './get-cart' diff --git a/framework/bigcommerce/api/endpoints/cart/remove-item.ts b/packages/bigcommerce/src/api/endpoints/cart/remove-item.ts similarity index 100% rename from framework/bigcommerce/api/endpoints/cart/remove-item.ts rename to packages/bigcommerce/src/api/endpoints/cart/remove-item.ts diff --git a/framework/bigcommerce/api/endpoints/cart/update-item.ts b/packages/bigcommerce/src/api/endpoints/cart/update-item.ts similarity index 100% rename from framework/bigcommerce/api/endpoints/cart/update-item.ts rename to packages/bigcommerce/src/api/endpoints/cart/update-item.ts diff --git a/framework/bigcommerce/api/endpoints/catalog/products/get-products.ts b/packages/bigcommerce/src/api/endpoints/catalog/products/get-products.ts similarity index 97% rename from framework/bigcommerce/api/endpoints/catalog/products/get-products.ts rename to packages/bigcommerce/src/api/endpoints/catalog/products/get-products.ts index 6dde39e28..f88a231e1 100644 --- a/framework/bigcommerce/api/endpoints/catalog/products/get-products.ts +++ b/packages/bigcommerce/src/api/endpoints/catalog/products/get-products.ts @@ -1,4 +1,4 @@ -import { Product } from '@commerce/types/product' +import { Product } from '@vercel/commerce/types/product' import { ProductsEndpoint } from '.' const SORT: { [key: string]: string | undefined } = { diff --git a/framework/bigcommerce/api/endpoints/catalog/products/index.ts b/packages/bigcommerce/src/api/endpoints/catalog/products/index.ts similarity index 76% rename from framework/bigcommerce/api/endpoints/catalog/products/index.ts rename to packages/bigcommerce/src/api/endpoints/catalog/products/index.ts index 555740f60..24472434d 100644 --- a/framework/bigcommerce/api/endpoints/catalog/products/index.ts +++ b/packages/bigcommerce/src/api/endpoints/catalog/products/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import productsEndpoint from '@commerce/api/endpoints/catalog/products' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import productsEndpoint from '@vercel/commerce/api/endpoints/catalog/products' import type { ProductsSchema } from '../../../../types/product' import type { BigcommerceAPI } from '../../..' import getProducts from './get-products' diff --git a/framework/bigcommerce/api/endpoints/checkout/checkout.ts b/packages/bigcommerce/src/api/endpoints/checkout/get-checkout.ts similarity index 93% rename from framework/bigcommerce/api/endpoints/checkout/checkout.ts rename to packages/bigcommerce/src/api/endpoints/checkout/get-checkout.ts index 15c834557..e98e6ca54 100644 --- a/framework/bigcommerce/api/endpoints/checkout/checkout.ts +++ b/packages/bigcommerce/src/api/endpoints/checkout/get-checkout.ts @@ -5,7 +5,7 @@ import { uuid } from 'uuidv4' const fullCheckout = true -const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({ +const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ req, res, config, @@ -42,7 +42,7 @@ const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({ store_hash: config.storeHash, customer_id: customerId, channel_id: config.storeChannelId, - redirect_to: data.checkout_url, + redirect_to: data.checkout_url.replace(config.storeUrl, ""), } let token = jwt.sign(payload, config.storeApiClientSecret!, { algorithm: 'HS256', @@ -87,4 +87,4 @@ const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({ res.end() } -export default checkout +export default getCheckout diff --git a/framework/bigcommerce/api/endpoints/checkout/index.ts b/packages/bigcommerce/src/api/endpoints/checkout/index.ts similarity index 58% rename from framework/bigcommerce/api/endpoints/checkout/index.ts rename to packages/bigcommerce/src/api/endpoints/checkout/index.ts index eaba32e47..83bc4ae08 100644 --- a/framework/bigcommerce/api/endpoints/checkout/index.ts +++ b/packages/bigcommerce/src/api/endpoints/checkout/index.ts @@ -1,14 +1,14 @@ -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 type { CheckoutSchema } from '../../../types/checkout' import type { BigcommerceAPI } from '../..' -import checkout from './checkout' +import getCheckout from './get-checkout' export type CheckoutAPI = GetAPISchema export type CheckoutEndpoint = CheckoutAPI['endpoint'] -export const handlers: CheckoutEndpoint['handlers'] = { checkout } +export const handlers: CheckoutEndpoint['handlers'] = { getCheckout } const checkoutApi = createEndpoint({ handler: checkoutEndpoint, diff --git a/framework/local/api/endpoints/cart/index.ts b/packages/bigcommerce/src/api/endpoints/customer/address.ts similarity index 100% rename from framework/local/api/endpoints/cart/index.ts rename to packages/bigcommerce/src/api/endpoints/customer/address.ts diff --git a/framework/local/api/endpoints/catalog/index.ts b/packages/bigcommerce/src/api/endpoints/customer/card.ts similarity index 100% rename from framework/local/api/endpoints/catalog/index.ts rename to packages/bigcommerce/src/api/endpoints/customer/card.ts diff --git a/framework/bigcommerce/api/endpoints/customer/get-logged-in-customer.ts b/packages/bigcommerce/src/api/endpoints/customer/get-logged-in-customer.ts similarity index 94% rename from framework/bigcommerce/api/endpoints/customer/get-logged-in-customer.ts rename to packages/bigcommerce/src/api/endpoints/customer/get-logged-in-customer.ts index 50bd5cf3f..4c93730f6 100644 --- a/framework/bigcommerce/api/endpoints/customer/get-logged-in-customer.ts +++ b/packages/bigcommerce/src/api/endpoints/customer/get-logged-in-customer.ts @@ -1,4 +1,4 @@ -import type { GetLoggedInCustomerQuery } from '../../../schema' +import type { GetLoggedInCustomerQuery } from '../../../../schema' import type { CustomerEndpoint } from '.' export const getLoggedInCustomerQuery = /* GraphQL */ ` diff --git a/framework/bigcommerce/api/endpoints/customer/index.ts b/packages/bigcommerce/src/api/endpoints/customer/index.ts similarity index 78% rename from framework/bigcommerce/api/endpoints/customer/index.ts rename to packages/bigcommerce/src/api/endpoints/customer/index.ts index cb0f6787a..5efff392c 100644 --- a/framework/bigcommerce/api/endpoints/customer/index.ts +++ b/packages/bigcommerce/src/api/endpoints/customer/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import customerEndpoint from '@commerce/api/endpoints/customer' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import customerEndpoint from '@vercel/commerce/api/endpoints/customer' import type { CustomerSchema } from '../../../types/customer' import type { BigcommerceAPI } from '../..' import getLoggedInCustomer from './get-logged-in-customer' diff --git a/framework/bigcommerce/api/endpoints/login/index.ts b/packages/bigcommerce/src/api/endpoints/login/index.ts similarity index 75% rename from framework/bigcommerce/api/endpoints/login/index.ts rename to packages/bigcommerce/src/api/endpoints/login/index.ts index 2b454c7c2..1ad6f7102 100644 --- a/framework/bigcommerce/api/endpoints/login/index.ts +++ b/packages/bigcommerce/src/api/endpoints/login/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import loginEndpoint from '@commerce/api/endpoints/login' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import loginEndpoint from '@vercel/commerce/api/endpoints/login' import type { LoginSchema } from '../../../types/login' import type { BigcommerceAPI } from '../..' import login from './login' diff --git a/framework/bigcommerce/api/endpoints/login/login.ts b/packages/bigcommerce/src/api/endpoints/login/login.ts similarity index 95% rename from framework/bigcommerce/api/endpoints/login/login.ts rename to packages/bigcommerce/src/api/endpoints/login/login.ts index f55c3b54f..0ebc5b110 100644 --- a/framework/bigcommerce/api/endpoints/login/login.ts +++ b/packages/bigcommerce/src/api/endpoints/login/login.ts @@ -1,4 +1,4 @@ -import { FetcherError } from '@commerce/utils/errors' +import { FetcherError } from '@vercel/commerce/utils/errors' import type { LoginEndpoint } from '.' const invalidCredentials = /invalid credentials/i diff --git a/framework/bigcommerce/api/endpoints/logout/index.ts b/packages/bigcommerce/src/api/endpoints/logout/index.ts similarity index 76% rename from framework/bigcommerce/api/endpoints/logout/index.ts rename to packages/bigcommerce/src/api/endpoints/logout/index.ts index 0dbb23bab..94a246f4b 100644 --- a/framework/bigcommerce/api/endpoints/logout/index.ts +++ b/packages/bigcommerce/src/api/endpoints/logout/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import logoutEndpoint from '@commerce/api/endpoints/logout' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import logoutEndpoint from '@vercel/commerce/api/endpoints/logout' import type { LogoutSchema } from '../../../types/logout' import type { BigcommerceAPI } from '../..' import logout from './logout' diff --git a/framework/bigcommerce/api/endpoints/logout/logout.ts b/packages/bigcommerce/src/api/endpoints/logout/logout.ts similarity index 100% rename from framework/bigcommerce/api/endpoints/logout/logout.ts rename to packages/bigcommerce/src/api/endpoints/logout/logout.ts diff --git a/framework/bigcommerce/api/endpoints/signup/index.ts b/packages/bigcommerce/src/api/endpoints/signup/index.ts similarity index 76% rename from framework/bigcommerce/api/endpoints/signup/index.ts rename to packages/bigcommerce/src/api/endpoints/signup/index.ts index 6ce8be271..64521f964 100644 --- a/framework/bigcommerce/api/endpoints/signup/index.ts +++ b/packages/bigcommerce/src/api/endpoints/signup/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import signupEndpoint from '@commerce/api/endpoints/signup' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import signupEndpoint from '@vercel/commerce/api/endpoints/signup' import type { SignupSchema } from '../../../types/signup' import type { BigcommerceAPI } from '../..' import signup from './signup' diff --git a/framework/bigcommerce/api/endpoints/signup/signup.ts b/packages/bigcommerce/src/api/endpoints/signup/signup.ts similarity index 100% rename from framework/bigcommerce/api/endpoints/signup/signup.ts rename to packages/bigcommerce/src/api/endpoints/signup/signup.ts diff --git a/framework/bigcommerce/api/endpoints/wishlist/add-item.ts b/packages/bigcommerce/src/api/endpoints/wishlist/add-item.ts similarity index 100% rename from framework/bigcommerce/api/endpoints/wishlist/add-item.ts rename to packages/bigcommerce/src/api/endpoints/wishlist/add-item.ts diff --git a/framework/bigcommerce/api/endpoints/wishlist/get-wishlist.ts b/packages/bigcommerce/src/api/endpoints/wishlist/get-wishlist.ts similarity index 100% rename from framework/bigcommerce/api/endpoints/wishlist/get-wishlist.ts rename to packages/bigcommerce/src/api/endpoints/wishlist/get-wishlist.ts diff --git a/framework/bigcommerce/api/endpoints/wishlist/index.ts b/packages/bigcommerce/src/api/endpoints/wishlist/index.ts similarity index 80% rename from framework/bigcommerce/api/endpoints/wishlist/index.ts rename to packages/bigcommerce/src/api/endpoints/wishlist/index.ts index 31af234ce..87728225d 100644 --- a/framework/bigcommerce/api/endpoints/wishlist/index.ts +++ b/packages/bigcommerce/src/api/endpoints/wishlist/index.ts @@ -1,5 +1,5 @@ -import { GetAPISchema, createEndpoint } from '@commerce/api' -import wishlistEndpoint from '@commerce/api/endpoints/wishlist' +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import wishlistEndpoint from '@vercel/commerce/api/endpoints/wishlist' import type { WishlistSchema } from '../../../types/wishlist' import type { BigcommerceAPI } from '../..' import getWishlist from './get-wishlist' diff --git a/framework/bigcommerce/api/endpoints/wishlist/remove-item.ts b/packages/bigcommerce/src/api/endpoints/wishlist/remove-item.ts similarity index 100% rename from framework/bigcommerce/api/endpoints/wishlist/remove-item.ts rename to packages/bigcommerce/src/api/endpoints/wishlist/remove-item.ts diff --git a/framework/bigcommerce/api/fragments/category-tree.ts b/packages/bigcommerce/src/api/fragments/category-tree.ts similarity index 100% rename from framework/bigcommerce/api/fragments/category-tree.ts rename to packages/bigcommerce/src/api/fragments/category-tree.ts diff --git a/framework/bigcommerce/api/fragments/product.ts b/packages/bigcommerce/src/api/fragments/product.ts similarity index 98% rename from framework/bigcommerce/api/fragments/product.ts rename to packages/bigcommerce/src/api/fragments/product.ts index d266b8c92..734e0ab63 100644 --- a/framework/bigcommerce/api/fragments/product.ts +++ b/packages/bigcommerce/src/api/fragments/product.ts @@ -58,7 +58,7 @@ export const productInfoFragment = /* GraphQL */ ` } } } - variants { + variants(first: 250) { edges { node { entityId diff --git a/framework/bigcommerce/api/index.ts b/packages/bigcommerce/src/api/index.ts similarity index 99% rename from framework/bigcommerce/api/index.ts rename to packages/bigcommerce/src/api/index.ts index ecc0d0e0e..b4999642b 100644 --- a/framework/bigcommerce/api/index.ts +++ b/packages/bigcommerce/src/api/index.ts @@ -3,7 +3,7 @@ import { CommerceAPI, CommerceAPIConfig, getCommerceApi as commerceApi, -} from '@commerce/api' +} from '@vercel/commerce/api' import createFetchGraphqlApi from './utils/fetch-graphql-api' import createFetchStoreApi from './utils/fetch-store-api' diff --git a/framework/bigcommerce/api/operations/get-all-pages.ts b/packages/bigcommerce/src/api/operations/get-all-pages.ts similarity index 97% rename from framework/bigcommerce/api/operations/get-all-pages.ts rename to packages/bigcommerce/src/api/operations/get-all-pages.ts index 3a9b64b1f..3117b73fc 100644 --- a/framework/bigcommerce/api/operations/get-all-pages.ts +++ b/packages/bigcommerce/src/api/operations/get-all-pages.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { Page, GetAllPagesOperation } from '../../types/page' import type { RecursivePartial, RecursiveRequired } from '../utils/types' import { BigcommerceConfig, Provider } from '..' diff --git a/framework/bigcommerce/api/operations/get-all-product-paths.ts b/packages/bigcommerce/src/api/operations/get-all-product-paths.ts similarity index 94% rename from framework/bigcommerce/api/operations/get-all-product-paths.ts rename to packages/bigcommerce/src/api/operations/get-all-product-paths.ts index da7b457eb..90cdab6fd 100644 --- a/framework/bigcommerce/api/operations/get-all-product-paths.ts +++ b/packages/bigcommerce/src/api/operations/get-all-product-paths.ts @@ -1,8 +1,8 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' -import type { GetAllProductPathsQuery } from '../../schema' +} from '@vercel/commerce/api/operations' +import type { GetAllProductPathsQuery } from '../../../schema' import type { GetAllProductPathsOperation } from '../../types/product' import type { RecursivePartial, RecursiveRequired } from '../utils/types' import filterEdges from '../utils/filter-edges' diff --git a/framework/bigcommerce/api/operations/get-all-products.ts b/packages/bigcommerce/src/api/operations/get-all-products.ts similarity index 98% rename from framework/bigcommerce/api/operations/get-all-products.ts rename to packages/bigcommerce/src/api/operations/get-all-products.ts index c2652f5bf..2833ffcd7 100644 --- a/framework/bigcommerce/api/operations/get-all-products.ts +++ b/packages/bigcommerce/src/api/operations/get-all-products.ts @@ -1,11 +1,11 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' 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' diff --git a/framework/bigcommerce/api/operations/get-customer-wishlist.ts b/packages/bigcommerce/src/api/operations/get-customer-wishlist.ts similarity index 96% rename from framework/bigcommerce/api/operations/get-customer-wishlist.ts rename to packages/bigcommerce/src/api/operations/get-customer-wishlist.ts index fc9487ffe..dc0dd0d9a 100644 --- a/framework/bigcommerce/api/operations/get-customer-wishlist.ts +++ b/packages/bigcommerce/src/api/operations/get-customer-wishlist.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { GetCustomerWishlistOperation, Wishlist, @@ -53,7 +53,7 @@ export default function getCustomerWishlistOperation({ if (ids?.length) { const graphqlData = await commerce.getAllProducts({ - variables: { first: 100, ids }, + variables: { first: 50, ids }, config, }) // Put the products in an object that we can use to get them by id diff --git a/framework/bigcommerce/api/operations/get-page.ts b/packages/bigcommerce/src/api/operations/get-page.ts similarity index 97% rename from framework/bigcommerce/api/operations/get-page.ts rename to packages/bigcommerce/src/api/operations/get-page.ts index 6a1fea9d0..dc38e5088 100644 --- a/framework/bigcommerce/api/operations/get-page.ts +++ b/packages/bigcommerce/src/api/operations/get-page.ts @@ -1,7 +1,7 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { GetPageOperation, Page } from '../../types/page' import type { RecursivePartial, RecursiveRequired } from '../utils/types' import type { BigcommerceConfig, Provider } from '..' diff --git a/framework/bigcommerce/api/operations/get-product.ts b/packages/bigcommerce/src/api/operations/get-product.ts similarity index 97% rename from framework/bigcommerce/api/operations/get-product.ts rename to packages/bigcommerce/src/api/operations/get-product.ts index fb356e952..c7457de2a 100644 --- a/framework/bigcommerce/api/operations/get-product.ts +++ b/packages/bigcommerce/src/api/operations/get-product.ts @@ -1,9 +1,9 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} 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 '..' @@ -21,7 +21,7 @@ export const getProductQuery = /* GraphQL */ ` __typename ... on Product { ...productInfo - variants { + variants(first: 250) { edges { node { entityId diff --git a/framework/bigcommerce/api/operations/get-site-info.ts b/packages/bigcommerce/src/api/operations/get-site-info.ts similarity index 95% rename from framework/bigcommerce/api/operations/get-site-info.ts rename to packages/bigcommerce/src/api/operations/get-site-info.ts index 0dd94dd9d..ad0dd5ebd 100644 --- a/framework/bigcommerce/api/operations/get-site-info.ts +++ b/packages/bigcommerce/src/api/operations/get-site-info.ts @@ -1,9 +1,9 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} 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' diff --git a/framework/bigcommerce/api/operations/login.ts b/packages/bigcommerce/src/api/operations/login.ts similarity index 95% rename from framework/bigcommerce/api/operations/login.ts rename to packages/bigcommerce/src/api/operations/login.ts index 021ba3c65..f5349998f 100644 --- a/framework/bigcommerce/api/operations/login.ts +++ b/packages/bigcommerce/src/api/operations/login.ts @@ -2,9 +2,9 @@ import type { ServerResponse } from 'http' import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} 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 '..' diff --git a/framework/bigcommerce/api/utils/concat-cookie.ts b/packages/bigcommerce/src/api/utils/concat-cookie.ts similarity index 100% rename from framework/bigcommerce/api/utils/concat-cookie.ts rename to packages/bigcommerce/src/api/utils/concat-cookie.ts diff --git a/framework/bigcommerce/api/utils/errors.ts b/packages/bigcommerce/src/api/utils/errors.ts similarity index 100% rename from framework/bigcommerce/api/utils/errors.ts rename to packages/bigcommerce/src/api/utils/errors.ts diff --git a/framework/bigcommerce/api/utils/fetch-graphql-api.ts b/packages/bigcommerce/src/api/utils/fetch-graphql-api.ts similarity index 88% rename from framework/bigcommerce/api/utils/fetch-graphql-api.ts rename to packages/bigcommerce/src/api/utils/fetch-graphql-api.ts index 8cc76c067..ad385fee6 100644 --- a/framework/bigcommerce/api/utils/fetch-graphql-api.ts +++ b/packages/bigcommerce/src/api/utils/fetch-graphql-api.ts @@ -1,5 +1,5 @@ -import { FetcherError } from '@commerce/utils/errors' -import type { GraphQLFetcher } from '@commerce/api' +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { GraphQLFetcher } from '@vercel/commerce/api' import type { BigcommerceConfig } from '../index' import fetch from './fetch' diff --git a/framework/bigcommerce/api/utils/fetch-store-api.ts b/packages/bigcommerce/src/api/utils/fetch-store-api.ts similarity index 92% rename from framework/bigcommerce/api/utils/fetch-store-api.ts rename to packages/bigcommerce/src/api/utils/fetch-store-api.ts index 1e44b28f9..a44e8957b 100644 --- a/framework/bigcommerce/api/utils/fetch-store-api.ts +++ b/packages/bigcommerce/src/api/utils/fetch-store-api.ts @@ -1,11 +1,11 @@ -import type { RequestInit, Response } from '@vercel/fetch' +import type { FetchOptions, Response } from '@vercel/fetch' import type { BigcommerceConfig } from '../index' import { BigcommerceApiError, BigcommerceNetworkError } from './errors' import fetch from './fetch' const fetchStoreApi = (getConfig: () => BigcommerceConfig) => - async (endpoint: string, options?: RequestInit): Promise => { + async (endpoint: string, options?: FetchOptions): Promise => { const config = getConfig() let res: Response @@ -19,7 +19,7 @@ const fetchStoreApi = 'X-Auth-Client': config.storeApiClientId, }, }) - } catch (error) { + } catch (error: any) { throw new BigcommerceNetworkError( `Fetch to Bigcommerce failed: ${error.message}` ) diff --git a/packages/bigcommerce/src/api/utils/fetch.ts b/packages/bigcommerce/src/api/utils/fetch.ts new file mode 100644 index 000000000..26f9ab674 --- /dev/null +++ b/packages/bigcommerce/src/api/utils/fetch.ts @@ -0,0 +1,3 @@ +import vercelFetch from '@vercel/fetch' + +export default vercelFetch() diff --git a/framework/bigcommerce/api/utils/filter-edges.ts b/packages/bigcommerce/src/api/utils/filter-edges.ts similarity index 100% rename from framework/bigcommerce/api/utils/filter-edges.ts rename to packages/bigcommerce/src/api/utils/filter-edges.ts diff --git a/framework/bigcommerce/api/utils/get-cart-cookie.ts b/packages/bigcommerce/src/api/utils/get-cart-cookie.ts similarity index 100% rename from framework/bigcommerce/api/utils/get-cart-cookie.ts rename to packages/bigcommerce/src/api/utils/get-cart-cookie.ts diff --git a/framework/bigcommerce/api/utils/get-customer-id.ts b/packages/bigcommerce/src/api/utils/get-customer-id.ts similarity index 91% rename from framework/bigcommerce/api/utils/get-customer-id.ts rename to packages/bigcommerce/src/api/utils/get-customer-id.ts index 7efeeed3c..7344e017b 100644 --- a/framework/bigcommerce/api/utils/get-customer-id.ts +++ b/packages/bigcommerce/src/api/utils/get-customer-id.ts @@ -1,4 +1,4 @@ -import type { GetCustomerIdQuery } from '../../schema' +import type { GetCustomerIdQuery } from '../../../schema' import type { BigcommerceConfig } from '../' export const getCustomerIdQuery = /* GraphQL */ ` diff --git a/framework/bigcommerce/api/utils/parse-item.ts b/packages/bigcommerce/src/api/utils/parse-item.ts similarity index 94% rename from framework/bigcommerce/api/utils/parse-item.ts rename to packages/bigcommerce/src/api/utils/parse-item.ts index 14c9ac53d..bb59a6ec4 100644 --- a/framework/bigcommerce/api/utils/parse-item.ts +++ b/packages/bigcommerce/src/api/utils/parse-item.ts @@ -10,7 +10,7 @@ type BCCartItemBody = { product_id: number variant_id: number quantity?: number - option_selections?: OptionSelections + option_selections?: OptionSelections[] } export const parseWishlistItem = ( diff --git a/framework/bigcommerce/api/utils/set-product-locale-meta.ts b/packages/bigcommerce/src/api/utils/set-product-locale-meta.ts similarity index 100% rename from framework/bigcommerce/api/utils/set-product-locale-meta.ts rename to packages/bigcommerce/src/api/utils/set-product-locale-meta.ts diff --git a/framework/bigcommerce/api/utils/types.ts b/packages/bigcommerce/src/api/utils/types.ts similarity index 100% rename from framework/bigcommerce/api/utils/types.ts rename to packages/bigcommerce/src/api/utils/types.ts diff --git a/framework/bigcommerce/auth/index.ts b/packages/bigcommerce/src/auth/index.ts similarity index 100% rename from framework/bigcommerce/auth/index.ts rename to packages/bigcommerce/src/auth/index.ts diff --git a/framework/bigcommerce/auth/use-login.tsx b/packages/bigcommerce/src/auth/use-login.tsx similarity index 67% rename from framework/bigcommerce/auth/use-login.tsx rename to packages/bigcommerce/src/auth/use-login.tsx index cbc46e6fc..a71f15983 100644 --- a/framework/bigcommerce/auth/use-login.tsx +++ b/packages/bigcommerce/src/auth/use-login.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' -import useLogin, { UseLogin } from '@commerce/auth/use-login' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login' import type { LoginHook } from '../types/login' import useCustomer from '../customer/use-customer' @@ -15,8 +15,7 @@ export const handler: MutationHook = { async fetcher({ input: { email, password }, options, fetch }) { if (!(email && password)) { throw new CommerceError({ - message: - 'An email and password are required to login', + message: 'An email and password are required to login', }) } @@ -28,15 +27,15 @@ export const handler: MutationHook = { useHook: ({ fetch }) => () => { - const { revalidate } = useCustomer() + const { mutate } = useCustomer() return useCallback( async function login(input) { const data = await fetch({ input }) - await revalidate() + await mutate() return data }, - [fetch, revalidate] + [fetch, mutate] ) }, } diff --git a/framework/bigcommerce/auth/use-logout.tsx b/packages/bigcommerce/src/auth/use-logout.tsx similarity index 81% rename from framework/bigcommerce/auth/use-logout.tsx rename to packages/bigcommerce/src/auth/use-logout.tsx index 1e8e9c666..bc5c3a4c0 100644 --- a/framework/bigcommerce/auth/use-logout.tsx +++ b/packages/bigcommerce/src/auth/use-logout.tsx @@ -1,6 +1,6 @@ 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 type { LogoutHook } from '../types/logout' import useCustomer from '../customer/use-customer' diff --git a/framework/bigcommerce/auth/use-signup.tsx b/packages/bigcommerce/src/auth/use-signup.tsx similarity index 76% rename from framework/bigcommerce/auth/use-signup.tsx rename to packages/bigcommerce/src/auth/use-signup.tsx index 8f183685f..b06126df6 100644 --- a/framework/bigcommerce/auth/use-signup.tsx +++ b/packages/bigcommerce/src/auth/use-signup.tsx @@ -1,7 +1,7 @@ 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 type { SignupHook } from '../types/signup' import useCustomer from '../customer/use-customer' @@ -32,15 +32,15 @@ export const handler: MutationHook = { useHook: ({ fetch }) => () => { - const { revalidate } = useCustomer() + const { mutate } = useCustomer() return useCallback( async function signup(input) { const data = await fetch({ input }) - await revalidate() + await mutate() return data }, - [fetch, revalidate] + [fetch, mutate] ) }, } diff --git a/framework/bigcommerce/cart/index.ts b/packages/bigcommerce/src/cart/index.ts similarity index 100% rename from framework/bigcommerce/cart/index.ts rename to packages/bigcommerce/src/cart/index.ts diff --git a/framework/bigcommerce/cart/use-add-item.tsx b/packages/bigcommerce/src/cart/use-add-item.tsx similarity index 77% rename from framework/bigcommerce/cart/use-add-item.tsx rename to packages/bigcommerce/src/cart/use-add-item.tsx index bdad1862c..f65e82bc7 100644 --- a/framework/bigcommerce/cart/use-add-item.tsx +++ b/packages/bigcommerce/src/cart/use-add-item.tsx @@ -1,8 +1,8 @@ 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 { AddItemHook } from '@commerce/types/cart' +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 type { AddItemHook } from '@vercel/commerce/types/cart' import useCart from './use-cart' export default useAddItem as UseAddItem diff --git a/framework/bigcommerce/cart/use-cart.tsx b/packages/bigcommerce/src/cart/use-cart.tsx similarity index 78% rename from framework/bigcommerce/cart/use-cart.tsx rename to packages/bigcommerce/src/cart/use-cart.tsx index 53fd3471c..f8c4691bf 100644 --- a/framework/bigcommerce/cart/use-cart.tsx +++ b/packages/bigcommerce/src/cart/use-cart.tsx @@ -1,7 +1,7 @@ import { useMemo } from 'react' -import { SWRHook } from '@commerce/utils/types' -import useCart, { UseCart } from '@commerce/cart/use-cart' -import type { GetCartHook } from '@commerce/types/cart' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCart, { UseCart } from '@vercel/commerce/cart/use-cart' +import type { GetCartHook } from '@vercel/commerce/types/cart' export default useCart as UseCart diff --git a/framework/bigcommerce/cart/use-remove-item.tsx b/packages/bigcommerce/src/cart/use-remove-item.tsx similarity index 84% rename from framework/bigcommerce/cart/use-remove-item.tsx rename to packages/bigcommerce/src/cart/use-remove-item.tsx index daf155c26..8bea34f41 100644 --- a/framework/bigcommerce/cart/use-remove-item.tsx +++ b/packages/bigcommerce/src/cart/use-remove-item.tsx @@ -2,10 +2,10 @@ import { useCallback } from 'react' import type { MutationHookContext, HookFetcherContext, -} from '@commerce/utils/types' -import { ValidationError } from '@commerce/utils/errors' -import useRemoveItem, { UseRemoveItem } from '@commerce/cart/use-remove-item' -import type { Cart, LineItem, RemoveItemHook } from '@commerce/types/cart' +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' +import useRemoveItem, { UseRemoveItem } from '@vercel/commerce/cart/use-remove-item' +import type { Cart, LineItem, RemoveItemHook } from '@vercel/commerce/types/cart' import useCart from './use-cart' export type RemoveItemFn = T extends LineItem diff --git a/framework/bigcommerce/cart/use-update-item.tsx b/packages/bigcommerce/src/cart/use-update-item.tsx similarity index 89% rename from framework/bigcommerce/cart/use-update-item.tsx rename to packages/bigcommerce/src/cart/use-update-item.tsx index a4c7d178e..b15690ed7 100644 --- a/framework/bigcommerce/cart/use-update-item.tsx +++ b/packages/bigcommerce/src/cart/use-update-item.tsx @@ -3,10 +3,10 @@ import debounce from 'lodash.debounce' import type { MutationHookContext, HookFetcherContext, -} from '@commerce/utils/types' -import { ValidationError } from '@commerce/utils/errors' -import useUpdateItem, { UseUpdateItem } from '@commerce/cart/use-update-item' -import type { LineItem, UpdateItemHook } from '@commerce/types/cart' +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' +import useUpdateItem, { UseUpdateItem } from '@vercel/commerce/cart/use-update-item' +import type { LineItem, UpdateItemHook } from '@vercel/commerce/types/cart' import { handler as removeItemHandler } from './use-remove-item' import useCart from './use-cart' diff --git a/packages/bigcommerce/src/checkout/use-checkout.tsx b/packages/bigcommerce/src/checkout/use-checkout.tsx new file mode 100644 index 000000000..cab52bb60 --- /dev/null +++ b/packages/bigcommerce/src/checkout/use-checkout.tsx @@ -0,0 +1,14 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { UseCheckout } from '@vercel/commerce/checkout/use-checkout' + +export default useCheckout as UseCheckout + +export const handler: SWRHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ useData }) => + async (input) => ({}), +} diff --git a/framework/bigcommerce/commerce.config.json b/packages/bigcommerce/src/commerce.config.json similarity index 100% rename from framework/bigcommerce/commerce.config.json rename to packages/bigcommerce/src/commerce.config.json diff --git a/packages/bigcommerce/src/customer/address/use-add-item.tsx b/packages/bigcommerce/src/customer/address/use-add-item.tsx new file mode 100644 index 000000000..fabd11b1d --- /dev/null +++ b/packages/bigcommerce/src/customer/address/use-add-item.tsx @@ -0,0 +1,15 @@ +import useAddItem, { UseAddItem } from '@vercel/commerce/customer/address/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/packages/bigcommerce/src/customer/card/use-add-item.tsx b/packages/bigcommerce/src/customer/card/use-add-item.tsx new file mode 100644 index 000000000..938e6cd61 --- /dev/null +++ b/packages/bigcommerce/src/customer/card/use-add-item.tsx @@ -0,0 +1,15 @@ +import useAddItem, { UseAddItem } from '@vercel/commerce/customer/card/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/framework/bigcommerce/customer/index.ts b/packages/bigcommerce/src/customer/index.ts similarity index 100% rename from framework/bigcommerce/customer/index.ts rename to packages/bigcommerce/src/customer/index.ts diff --git a/framework/bigcommerce/customer/use-customer.tsx b/packages/bigcommerce/src/customer/use-customer.tsx similarity index 79% rename from framework/bigcommerce/customer/use-customer.tsx rename to packages/bigcommerce/src/customer/use-customer.tsx index ddecc2fcf..36bf88617 100644 --- a/framework/bigcommerce/customer/use-customer.tsx +++ b/packages/bigcommerce/src/customer/use-customer.tsx @@ -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' import type { CustomerHook } from '../types/customer' export default useCustomer as UseCustomer diff --git a/framework/bigcommerce/fetcher.ts b/packages/bigcommerce/src/fetcher.ts similarity index 88% rename from framework/bigcommerce/fetcher.ts rename to packages/bigcommerce/src/fetcher.ts index f8ca0c578..bc8a6b9aa 100644 --- a/framework/bigcommerce/fetcher.ts +++ b/packages/bigcommerce/src/fetcher.ts @@ -1,5 +1,5 @@ -import { FetcherError } from '@commerce/utils/errors' -import type { Fetcher } from '@commerce/utils/types' +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { Fetcher } from '@vercel/commerce/utils/types' async function getText(res: Response) { try { diff --git a/packages/bigcommerce/src/index.tsx b/packages/bigcommerce/src/index.tsx new file mode 100644 index 000000000..a7de60924 --- /dev/null +++ b/packages/bigcommerce/src/index.tsx @@ -0,0 +1,9 @@ +import { getCommerceProvider, useCommerce as useCoreCommerce } from '@vercel/commerce' +import { bigcommerceProvider, BigcommerceProvider } from './provider' + +export { bigcommerceProvider } +export type { BigcommerceProvider } + +export const CommerceProvider = getCommerceProvider(bigcommerceProvider) + +export const useCommerce = () => useCoreCommerce() diff --git a/framework/bigcommerce/lib/get-slug.ts b/packages/bigcommerce/src/lib/get-slug.ts similarity index 100% rename from framework/bigcommerce/lib/get-slug.ts rename to packages/bigcommerce/src/lib/get-slug.ts diff --git a/framework/bigcommerce/lib/immutability.ts b/packages/bigcommerce/src/lib/immutability.ts similarity index 100% rename from framework/bigcommerce/lib/immutability.ts rename to packages/bigcommerce/src/lib/immutability.ts diff --git a/framework/bigcommerce/lib/normalize.ts b/packages/bigcommerce/src/lib/normalize.ts similarity index 93% rename from framework/bigcommerce/lib/normalize.ts rename to packages/bigcommerce/src/lib/normalize.ts index cd1c3ce5a..059e3f871 100644 --- a/framework/bigcommerce/lib/normalize.ts +++ b/packages/bigcommerce/src/lib/normalize.ts @@ -8,11 +8,7 @@ import getSlug from './get-slug' function normalizeProductOption(productOption: any) { const { - node: { - entityId, - values: { edges }, - ...rest - }, + node: { entityId, values: { edges = [] } = {}, ...rest }, } = productOption return { @@ -91,7 +87,10 @@ export function normalizeCart(data: BigcommerceCart): Cart { createdAt: data.created_time, currency: data.currency, taxesIncluded: data.tax_included, - lineItems: data.line_items.physical_items.map(normalizeLineItem), + lineItems: [ + ...data.line_items.physical_items.map(normalizeLineItem), + ...data.line_items.digital_items.map(normalizeLineItem), + ], lineItemsSubtotalPrice: data.base_amount, subtotalPrice: data.base_amount + data.discount_amount, totalPrice: data.cart_amount, @@ -119,6 +118,7 @@ function normalizeLineItem(item: any): LineItem { price: item.sale_price, listPrice: item.list_price, }, + options: item.options, path: item.url.split('/')[3], discounts: item.discounts.map((discount: any) => ({ value: discount.discounted_amount, diff --git a/framework/bigcommerce/next.config.js b/packages/bigcommerce/src/next.config.cjs similarity index 100% rename from framework/bigcommerce/next.config.js rename to packages/bigcommerce/src/next.config.cjs diff --git a/framework/bigcommerce/product/index.ts b/packages/bigcommerce/src/product/index.ts similarity index 100% rename from framework/bigcommerce/product/index.ts rename to packages/bigcommerce/src/product/index.ts diff --git a/packages/bigcommerce/src/product/use-price.tsx b/packages/bigcommerce/src/product/use-price.tsx new file mode 100644 index 000000000..fd42d7033 --- /dev/null +++ b/packages/bigcommerce/src/product/use-price.tsx @@ -0,0 +1,2 @@ +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/framework/bigcommerce/product/use-search.tsx b/packages/bigcommerce/src/product/use-search.tsx similarity index 91% rename from framework/bigcommerce/product/use-search.tsx rename to packages/bigcommerce/src/product/use-search.tsx index 76fab00a4..fd918e341 100644 --- a/framework/bigcommerce/product/use-search.tsx +++ b/packages/bigcommerce/src/product/use-search.tsx @@ -1,5 +1,5 @@ -import { SWRHook } from '@commerce/utils/types' -import useSearch, { UseSearch } from '@commerce/product/use-search' +import { SWRHook } from '@vercel/commerce/utils/types' +import useSearch, { UseSearch } from '@vercel/commerce/product/use-search' import type { SearchProductsHook } from '../types/product' export default useSearch as UseSearch diff --git a/framework/bigcommerce/provider.ts b/packages/bigcommerce/src/provider.ts similarity index 100% rename from framework/bigcommerce/provider.ts rename to packages/bigcommerce/src/provider.ts diff --git a/framework/bigcommerce/types/cart.ts b/packages/bigcommerce/src/types/cart.ts similarity index 92% rename from framework/bigcommerce/types/cart.ts rename to packages/bigcommerce/src/types/cart.ts index 83076ea09..3b5d8288b 100644 --- a/framework/bigcommerce/types/cart.ts +++ b/packages/bigcommerce/src/types/cart.ts @@ -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' // TODO: this type should match: // https://developer.bigcommerce.com/api-reference/cart-checkout/server-server-cart-api/cart/getacart#responses @@ -40,7 +40,7 @@ export type OptionSelections = { export type CartItemBody = Core.CartItemBody & { productId: string // The product id is always required for BC - optionSelections?: OptionSelections + optionSelections?: OptionSelections[] } export type CartTypes = { diff --git a/packages/bigcommerce/src/types/checkout.ts b/packages/bigcommerce/src/types/checkout.ts new file mode 100644 index 000000000..d139db685 --- /dev/null +++ b/packages/bigcommerce/src/types/checkout.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/checkout' diff --git a/packages/bigcommerce/src/types/common.ts b/packages/bigcommerce/src/types/common.ts new file mode 100644 index 000000000..23b8daa11 --- /dev/null +++ b/packages/bigcommerce/src/types/common.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/common' diff --git a/packages/bigcommerce/src/types/customer.ts b/packages/bigcommerce/src/types/customer.ts new file mode 100644 index 000000000..6e66366be --- /dev/null +++ b/packages/bigcommerce/src/types/customer.ts @@ -0,0 +1,5 @@ +import * as Core from '@vercel/commerce/types/customer' + +export * from '@vercel/commerce/types/customer' + +export type CustomerSchema = Core.CustomerSchema diff --git a/framework/bigcommerce/types/index.ts b/packages/bigcommerce/src/types/index.ts similarity index 100% rename from framework/bigcommerce/types/index.ts rename to packages/bigcommerce/src/types/index.ts diff --git a/packages/bigcommerce/src/types/login.ts b/packages/bigcommerce/src/types/login.ts new file mode 100644 index 000000000..eff27ca46 --- /dev/null +++ b/packages/bigcommerce/src/types/login.ts @@ -0,0 +1,8 @@ +import * as Core from '@vercel/commerce/types/login' +import type { LoginMutationVariables } from '../../schema' + +export * from '@vercel/commerce/types/login' + +export type LoginOperation = Core.LoginOperation & { + variables: LoginMutationVariables +} diff --git a/packages/bigcommerce/src/types/logout.ts b/packages/bigcommerce/src/types/logout.ts new file mode 100644 index 000000000..1de06f8dc --- /dev/null +++ b/packages/bigcommerce/src/types/logout.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/logout' diff --git a/framework/bigcommerce/types/page.ts b/packages/bigcommerce/src/types/page.ts similarity index 68% rename from framework/bigcommerce/types/page.ts rename to packages/bigcommerce/src/types/page.ts index 2bccfade2..ccbc29f7b 100644 --- a/framework/bigcommerce/types/page.ts +++ b/packages/bigcommerce/src/types/page.ts @@ -1,5 +1,5 @@ -import * as Core from '@commerce/types/page' -export * from '@commerce/types/page' +import * as Core from '@vercel/commerce/types/page' +export * from '@vercel/commerce/types/page' export type Page = Core.Page diff --git a/packages/bigcommerce/src/types/product.ts b/packages/bigcommerce/src/types/product.ts new file mode 100644 index 000000000..72ca02f02 --- /dev/null +++ b/packages/bigcommerce/src/types/product.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/product' diff --git a/packages/bigcommerce/src/types/signup.ts b/packages/bigcommerce/src/types/signup.ts new file mode 100644 index 000000000..3f0d1af5a --- /dev/null +++ b/packages/bigcommerce/src/types/signup.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/signup' diff --git a/framework/bigcommerce/types/site.ts b/packages/bigcommerce/src/types/site.ts similarity index 77% rename from framework/bigcommerce/types/site.ts rename to packages/bigcommerce/src/types/site.ts index 12dd7038c..5c3074cc9 100644 --- a/framework/bigcommerce/types/site.ts +++ b/packages/bigcommerce/src/types/site.ts @@ -1,7 +1,7 @@ -import * as Core from '@commerce/types/site' -import type { GetSiteInfoQuery, GetSiteInfoQueryVariables } from '../schema' +import * as Core from '@vercel/commerce/types/site' +import type { GetSiteInfoQuery, GetSiteInfoQueryVariables } from '../../schema' -export * from '@commerce/types/site' +export * from '@vercel/commerce/types/site' export type BCCategory = NonNullable< GetSiteInfoQuery['site']['categoryTree'] diff --git a/framework/bigcommerce/types/wishlist.ts b/packages/bigcommerce/src/types/wishlist.ts similarity index 85% rename from framework/bigcommerce/types/wishlist.ts rename to packages/bigcommerce/src/types/wishlist.ts index 9e9c52353..67cf58c26 100644 --- a/framework/bigcommerce/types/wishlist.ts +++ b/packages/bigcommerce/src/types/wishlist.ts @@ -1,8 +1,8 @@ -import * as Core from '@commerce/types/wishlist' +import * as Core from '@vercel/commerce/types/wishlist' import { definitions } from '../api/definitions/wishlist' import type { ProductEdge } from '../api/operations/get-all-products' -export * from '@commerce/types/wishlist' +export * from '@vercel/commerce/types/wishlist' export type WishlistItem = NonNullable< definitions['wishlist_Full']['items'] diff --git a/framework/bigcommerce/wishlist/index.ts b/packages/bigcommerce/src/wishlist/index.ts similarity index 100% rename from framework/bigcommerce/wishlist/index.ts rename to packages/bigcommerce/src/wishlist/index.ts diff --git a/framework/bigcommerce/wishlist/use-add-item.tsx b/packages/bigcommerce/src/wishlist/use-add-item.tsx similarity index 74% rename from framework/bigcommerce/wishlist/use-add-item.tsx rename to packages/bigcommerce/src/wishlist/use-add-item.tsx index 6b3f7778d..c9e237b0b 100644 --- a/framework/bigcommerce/wishlist/use-add-item.tsx +++ b/packages/bigcommerce/src/wishlist/use-add-item.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' -import useAddItem, { UseAddItem } from '@commerce/wishlist/use-add-item' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useAddItem, { UseAddItem } from '@vercel/commerce/wishlist/use-add-item' import type { AddItemHook } from '../types/wishlist' import useCustomer from '../customer/use-customer' import useWishlist from './use-wishlist' @@ -17,7 +17,7 @@ export const handler: MutationHook = { ({ fetch }) => () => { const { data: customer } = useCustomer() - const { revalidate } = useWishlist() + const { mutate } = useWishlist() return useCallback( async function addItem(item) { @@ -30,10 +30,10 @@ export const handler: MutationHook = { // TODO: add validations before doing the fetch const data = await fetch({ input: { item } }) - await revalidate() + await mutate() return data }, - [fetch, revalidate, customer] + [fetch, mutate, customer] ) }, } diff --git a/framework/bigcommerce/wishlist/use-remove-item.tsx b/packages/bigcommerce/src/wishlist/use-remove-item.tsx similarity index 76% rename from framework/bigcommerce/wishlist/use-remove-item.tsx rename to packages/bigcommerce/src/wishlist/use-remove-item.tsx index bb8e6415e..40ca0da04 100644 --- a/framework/bigcommerce/wishlist/use-remove-item.tsx +++ b/packages/bigcommerce/src/wishlist/use-remove-item.tsx @@ -1,9 +1,9 @@ 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 useRemoveItem, { UseRemoveItem, -} from '@commerce/wishlist/use-remove-item' +} from '@vercel/commerce/wishlist/use-remove-item' import type { RemoveItemHook } from '../types/wishlist' import useCustomer from '../customer/use-customer' import useWishlist from './use-wishlist' @@ -19,7 +19,7 @@ export const handler: MutationHook = { ({ fetch }) => ({ wishlist } = {}) => { const { data: customer } = useCustomer() - const { revalidate } = useWishlist(wishlist) + const { mutate } = useWishlist(wishlist) return useCallback( async function removeItem(input) { @@ -31,10 +31,10 @@ export const handler: MutationHook = { } const data = await fetch({ input: { itemId: String(input.id) } }) - await revalidate() + await mutate() return data }, - [fetch, revalidate, customer] + [fetch, mutate, customer] ) }, } diff --git a/framework/bigcommerce/wishlist/use-wishlist.tsx b/packages/bigcommerce/src/wishlist/use-wishlist.tsx similarity index 90% rename from framework/bigcommerce/wishlist/use-wishlist.tsx rename to packages/bigcommerce/src/wishlist/use-wishlist.tsx index 7c09f835a..e77d6885b 100644 --- a/framework/bigcommerce/wishlist/use-wishlist.tsx +++ b/packages/bigcommerce/src/wishlist/use-wishlist.tsx @@ -1,6 +1,6 @@ import { useMemo } from 'react' -import { SWRHook } from '@commerce/utils/types' -import useWishlist, { UseWishlist } from '@commerce/wishlist/use-wishlist' +import { SWRHook } from '@vercel/commerce/utils/types' +import useWishlist, { UseWishlist } from '@vercel/commerce/wishlist/use-wishlist' import type { GetWishlistHook } from '../types/wishlist' import useCustomer from '../customer/use-customer' diff --git a/packages/bigcommerce/taskfile.js b/packages/bigcommerce/taskfile.js new file mode 100644 index 000000000..39b1b2a86 --- /dev/null +++ b/packages/bigcommerce/taskfile.js @@ -0,0 +1,20 @@ +export async function build(task, opts) { + await task + .source('src/**/*.+(ts|tsx|js)') + .swc({ dev: opts.dev, outDir: 'dist', baseUrl: 'src' }) + .target('dist') + .source('src/**/*.+(cjs|json)') + .target('dist') + task.$.log('Compiled src files') +} + +export async function release(task) { + await task.clear('dist').start('build') +} + +export default async function dev(task) { + const opts = { dev: true } + await task.clear('dist') + await task.start('build', opts) + await task.watch('src/**/*.+(ts|tsx|js|cjs|json)', 'build', opts) +} diff --git a/packages/bigcommerce/tsconfig.json b/packages/bigcommerce/tsconfig.json new file mode 100644 index 000000000..cd04ab2ff --- /dev/null +++ b/packages/bigcommerce/tsconfig.json @@ -0,0 +1,21 @@ +{ + "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, + "incremental": true, + "jsx": "react-jsx" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/commerce/.prettierignore b/packages/commerce/.prettierignore new file mode 100644 index 000000000..f06235c46 --- /dev/null +++ b/packages/commerce/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/commerce/.prettierrc b/packages/commerce/.prettierrc new file mode 100644 index 000000000..e1076edfa --- /dev/null +++ b/packages/commerce/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/framework/commerce/README.md b/packages/commerce/README.md similarity index 100% rename from framework/commerce/README.md rename to packages/commerce/README.md diff --git a/packages/commerce/fixup.mjs b/packages/commerce/fixup.mjs new file mode 100755 index 000000000..b276f5c14 --- /dev/null +++ b/packages/commerce/fixup.mjs @@ -0,0 +1,5 @@ +import { readFile, writeFile } from 'fs/promises' + +const packageJson = await readFile('package.json', 'utf8') + +writeFile('dist/package.json', packageJson, 'utf8') diff --git a/framework/commerce/new-provider.md b/packages/commerce/new-provider.md similarity index 52% rename from framework/commerce/new-provider.md rename to packages/commerce/new-provider.md index 8c2feeab2..546b933f6 100644 --- a/framework/commerce/new-provider.md +++ b/packages/commerce/new-provider.md @@ -1,96 +1,85 @@ # Adding a new Commerce Provider +🔔 New providers are on hold [until we have a new API for commerce](https://github.com/vercel/commerce/pull/252) 🔔 + A commerce provider is a headless e-commerce platform that integrates with the [Commerce Framework](./README.md). Right now we have the following providers: -- BigCommerce ([framework/bigcommerce](../bigcommerce)) -- Saleor ([framework/saleor](../saleor)) -- Shopify ([framework/shopify](../shopify)) +- Local ([packages/local](../local)) +- Shopify ([packages/shopify](../shopify)) +- Swell ([packages/swell](../swell)) +- BigCommerce ([packages/bigcommerce](../bigcommerce)) +- Vendure ([packages/vendure](../vendure)) +- Saleor ([packages/saleor](../saleor)) +- OrderCloud ([packages/ordercloud](../ordercloud)) +- Spree ([packages/spree](../spree)) +- Kibo Commerce ([packages/kibocommerce](../kibocommerce)) +- Commerce.js ([packages/commercejs](../commercejs)) -Adding a commerce provider means adding a new folder in `framework` with a folder structure like the next one: +Adding a commerce provider means adding a new folder in `packages` with a folder structure like the next one: -- `api` - - index.ts -- `product` - - usePrice - - useSearch - - getProduct - - getAllProducts -- `wishlist` - - useWishlist - - useAddItem - - useRemoveItem -- `auth` - - useLogin - - useLogout - - useSignup -- `customer` - - useCustomer - - getCustomerId - - getCustomerWistlist -- `cart` - - useCart - - useAddItem - - useRemoveItem - - useUpdateItem +- `src` + - `api` + - index.ts + - `product` + - usePrice + - useSearch + - getProduct + - getAllProducts + - `wishlist` + - useWishlist + - useAddItem + - useRemoveItem + - `auth` + - useLogin + - useLogout + - useSignup + - `customer` + - useCustomer + - getCustomerId + - getCustomerWistlist + - `cart` + - useCart + - useAddItem + - useRemoveItem + - useUpdateItem + - `index.ts` + - `provider.ts` + - `commerce.config.json` + - `next.config.cjs` +- `package.json` +- `tsconfig.json` - `env.template` -- `index.ts` -- `provider.ts` -- `commerce.config.json` -- `next.config.js` - `README.md` `provider.ts` exports a provider object with handlers for the [Commerce Hooks](./README.md#commerce-hooks) and `api/index.ts` exports a Node.js provider for the [Commerce API](./README.md#commerce-api) > **Important:** We use TypeScript for every provider and expect its usage for every new one. -The app imports from the provider directly instead of the core commerce folder (`framework/commerce`), but all providers are interchangeable and to achieve it every provider always has to implement the core types and helpers. +The app imports from the provider directly instead of the core commerce folder (`packages/commerce`), but all providers are interchangeable and to achieve it every provider always has to implement the core types and helpers. -The provider folder should only depend on `framework/commerce` and dependencies in the main `package.json`. In the future we'll move the `framework` folder to a package that can be shared easily for multiple apps. +## Updating the list of known providers + +Open [/site/commerce-config.js](/site/commerce-config.js) and add the provider name to the list in `PROVIDERS`. + +Then, open [/site/.env.template](/site/.env.template) and add the provider name to the list there too. ## Adding the provider hooks Using BigCommerce as an example. The first thing to do is export a `CommerceProvider` component that includes a `provider` object with all the handlers that can be used for hooks: ```tsx -import type { ReactNode } from 'react' -import { - CommerceConfig, - CommerceProvider as CoreCommerceProvider, - useCommerce as useCoreCommerce, -} from '@commerce' -import { bigcommerceProvider } from './provider' -import type { BigcommerceProvider } from './provider' +import { getCommerceProvider, useCommerce as useCoreCommerce } from '@vercel/commerce' +import { bigcommerceProvider, BigcommerceProvider } from './provider' export { bigcommerceProvider } export type { BigcommerceProvider } -export const bigcommerceConfig: CommerceConfig = { - locale: 'en-us', - cartCookie: 'bc_cartId', -} - -export type BigcommerceConfig = Partial - -export type BigcommerceProps = { - children?: ReactNode - locale: string -} & BigcommerceConfig - -export function CommerceProvider({ children, ...config }: BigcommerceProps) { - return ( - - {children} - - ) -} +export const CommerceProvider = getCommerceProvider(bigcommerceProvider) export const useCommerce = () => useCoreCommerce() ``` -The exported types and components extend from the core ones exported by `@commerce`, which refers to `framework/commerce`. +The exported types and components extend from the core ones exported by `@vercel/commerce`, which refers to `packages/commerce`. The `bigcommerceProvider` object looks like this: @@ -131,33 +120,23 @@ export const bigcommerceProvider = { export type BigcommerceProvider = typeof bigcommerceProvider ``` -The provider object, in this case `bigcommerceProvider`, has to match the `Provider` type defined in [framework/commerce](./index.ts). +The provider object, in this case `bigcommerceProvider`, has to match the `Provider` type defined in [packages/commerce](./src/index.tsx). A hook handler, like `useCart`, looks like this: ```tsx import { useMemo } from 'react' -import { SWRHook } from '@commerce/utils/types' -import useCart, { UseCart, FetchCartInput } from '@commerce/cart/use-cart' -import { normalizeCart } from '../lib/normalize' -import type { Cart } from '../types' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCart, { UseCart } from '@vercel/commerce/cart/use-cart' +import type { GetCartHook } from '@vercel/commerce/types/cart' export default useCart as UseCart -export const handler: SWRHook< - Cart | null, - {}, - FetchCartInput, - { isEmpty?: boolean } -> = { +export const handler: SWRHook = { fetchOptions: { url: '/api/cart', method: 'GET', }, - async fetcher({ input: { cartId }, options, fetch }) { - const data = cartId ? await fetch(options) : null - return data && normalizeCart(data) - }, useHook: ({ useData }) => (input) => { @@ -185,21 +164,15 @@ In the case of data fetching hooks like `useCart` each handler has to implement ```tsx 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 { normalizeCart } from '../lib/normalize' -import type { - Cart, - BigcommerceCart, - CartItemBody, - AddCartItemBody, -} from '../types' +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 type { AddItemHook } from '@vercel/commerce/types/cart' import useCart from './use-cart' export default useAddItem as UseAddItem -export const handler: MutationHook = { +export const handler: MutationHook = { fetchOptions: { url: '/api/cart', method: 'POST', @@ -214,12 +187,12 @@ export const handler: MutationHook = { }) } - const data = await fetch({ + const data = await fetch({ ...options, body: { item }, }) - return normalizeCart(data) + return data }, useHook: ({ fetch }) => @@ -238,8 +211,26 @@ export const handler: MutationHook = { } ``` -## Adding the Node.js provider API +## Showing progress and features +When creating a PR for a new provider, include this list in the PR description and mark the progress as you push so we can organize the code review. Not all points are required (but advised) so make sure to keep the list up to date. -TODO +**Status** -> The commerce API is currently going through a refactor in https://github.com/vercel/commerce/pull/252 - We'll update the docs once the API is released. +* [ ] CommerceProvider +* [ ] Schema & TS types +* [ ] API Operations - Get all collections +* [ ] API Operations - Get all pages +* [ ] API Operations - Get all products +* [ ] API Operations - Get page +* [ ] API Operations - Get product +* [ ] API Operations - Get Shop Info (categories and vendors working — `vendors` query still a WIP PR on Reaction) +* [ ] Hook - Add Item +* [ ] Hook - Remove Item +* [ ] Hook - Update Item +* [ ] Hook - Get Cart (account-tied carts working, anonymous carts working, cart reconciliation working) +* [ ] Auth (based on a WIP PR on Reaction - still need to implement refresh tokens) +* [ ] Customer information +* [ ] Product attributes - Size, Colors +* [ ] Custom checkout +* [ ] Typing (in progress) +* [ ] Tests diff --git a/packages/commerce/package.json b/packages/commerce/package.json new file mode 100644 index 000000000..17343a8b2 --- /dev/null +++ b/packages/commerce/package.json @@ -0,0 +1,83 @@ +{ + "name": "@vercel/commerce", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "release": "taskr release", + "build": "taskr build", + "dev": "taskr", + "types": "tsc --emitDeclarationOnly", + "prettier-fix": "prettier --write ." + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], + "./config": "./dist/config.cjs" + }, + "typesVersions": { + "*": { + "*": [ + "src/*", + "src/*/index" + ], + "config": [ + "dist/config.d.cts" + ] + } + }, + "files": [ + "dist" + ], + "publishConfig": { + "typesVersions": { + "*": { + "*": [ + "dist/*.d.ts", + "dist/*/index.d.ts" + ], + "config": [ + "dist/config.d.cts" + ] + } + } + }, + "dependencies": { + "@vercel/fetch": "^6.1.1", + "deepmerge": "^4.2.2", + "import-cwd": "^3.0.0", + "js-cookie": "^3.0.1", + "swr": "^1.2.0" + }, + "peerDependencies": { + "next": "^12", + "react": "^17", + "react-dom": "^17" + }, + "devDependencies": { + "@taskr/clear": "^1.1.0", + "@taskr/esnext": "^1.1.0", + "@taskr/watch": "^1.1.0", + "@types/js-cookie": "^3.0.1", + "@types/node": "^17.0.8", + "@types/react": "^17.0.38", + "lint-staged": "^12.1.7", + "next": "^12.0.8", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "taskr": "^1.1.0", + "taskr-swc": "^0.0.1", + "typescript": "^4.5.4" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,json}": [ + "prettier --write", + "git add" + ] + } +} diff --git a/framework/commerce/api/endpoints/cart.ts b/packages/commerce/src/api/endpoints/cart.ts similarity index 100% rename from framework/commerce/api/endpoints/cart.ts rename to packages/commerce/src/api/endpoints/cart.ts diff --git a/framework/commerce/api/endpoints/catalog/products.ts b/packages/commerce/src/api/endpoints/catalog/products.ts similarity index 100% rename from framework/commerce/api/endpoints/catalog/products.ts rename to packages/commerce/src/api/endpoints/catalog/products.ts diff --git a/framework/commerce/api/endpoints/checkout.ts b/packages/commerce/src/api/endpoints/checkout.ts similarity index 56% rename from framework/commerce/api/endpoints/checkout.ts rename to packages/commerce/src/api/endpoints/checkout.ts index b39239a6a..0168e7065 100644 --- a/framework/commerce/api/endpoints/checkout.ts +++ b/packages/commerce/src/api/endpoints/checkout.ts @@ -1,25 +1,39 @@ import type { CheckoutSchema } from '../../types/checkout' +import type { GetAPISchema } from '..' + import { CommerceAPIError } from '../utils/errors' import isAllowedOperation from '../utils/is-allowed-operation' -import type { GetAPISchema } from '..' const checkoutEndpoint: GetAPISchema< any, CheckoutSchema >['endpoint']['handler'] = async (ctx) => { - const { req, res, handlers } = ctx + const { req, res, handlers, config } = ctx if ( !isAllowedOperation(req, res, { - GET: handlers['checkout'], + GET: handlers['getCheckout'], + POST: handlers['submitCheckout'], }) ) { return } + const { cookies } = req + const cartId = cookies[config.cartCookie] + try { - const body = null - return await handlers['checkout']({ ...ctx, body }) + // Create checkout + if (req.method === 'GET') { + const body = { ...req.body, cartId } + return await handlers['getCheckout']({ ...ctx, body }) + } + + // Create checkout + if (req.method === 'POST' && handlers['submitCheckout']) { + const body = { ...req.body, cartId } + return await handlers['submitCheckout']({ ...ctx, body }) + } } catch (error) { console.error(error) diff --git a/packages/commerce/src/api/endpoints/customer/address.ts b/packages/commerce/src/api/endpoints/customer/address.ts new file mode 100644 index 000000000..d5ede697a --- /dev/null +++ b/packages/commerce/src/api/endpoints/customer/address.ts @@ -0,0 +1,65 @@ +import type { CustomerAddressSchema } from '../../../types/customer/address' +import type { GetAPISchema } from '../..' + +import { CommerceAPIError } from '../../utils/errors' +import isAllowedOperation from '../../utils/is-allowed-operation' + +const customerShippingEndpoint: GetAPISchema< + any, + CustomerAddressSchema +>['endpoint']['handler'] = async (ctx) => { + const { req, res, handlers, config } = ctx + + if ( + !isAllowedOperation(req, res, { + GET: handlers['getAddresses'], + POST: handlers['addItem'], + PUT: handlers['updateItem'], + DELETE: handlers['removeItem'], + }) + ) { + return + } + + const { cookies } = req + + // Cart id might be usefull for anonymous shopping + const cartId = cookies[config.cartCookie] + + try { + // Return customer addresses + if (req.method === 'GET') { + const body = { cartId } + return await handlers['getAddresses']({ ...ctx, body }) + } + + // Create or add an item to customer addresses list + if (req.method === 'POST') { + const body = { ...req.body, cartId } + return await handlers['addItem']({ ...ctx, body }) + } + + // Update item in customer addresses list + if (req.method === 'PUT') { + const body = { ...req.body, cartId } + return await handlers['updateItem']({ ...ctx, body }) + } + + // Remove an item from customer addresses list + if (req.method === 'DELETE') { + const body = { ...req.body, cartId } + return await handlers['removeItem']({ ...ctx, body }) + } + } catch (error) { + console.error(error) + + const message = + error instanceof CommerceAPIError + ? 'An unexpected error ocurred with the Commerce API' + : 'An unexpected error ocurred' + + res.status(500).json({ data: null, errors: [{ message }] }) + } +} + +export default customerShippingEndpoint diff --git a/packages/commerce/src/api/endpoints/customer/card.ts b/packages/commerce/src/api/endpoints/customer/card.ts new file mode 100644 index 000000000..7c0158e16 --- /dev/null +++ b/packages/commerce/src/api/endpoints/customer/card.ts @@ -0,0 +1,63 @@ +import type { CustomerCardSchema } from '../../../types/customer/card' +import type { GetAPISchema } from '../..' +import { CommerceAPIError } from '../../utils/errors' +import isAllowedOperation from '../../utils/is-allowed-operation' + +const customerCardEndpoint: GetAPISchema< + any, + CustomerCardSchema +>['endpoint']['handler'] = async (ctx) => { + const { req, res, handlers, config } = ctx + + if ( + !isAllowedOperation(req, res, { + GET: handlers['getCards'], + POST: handlers['addItem'], + PUT: handlers['updateItem'], + DELETE: handlers['removeItem'], + }) + ) { + return + } + + const { cookies } = req + + // Cart id might be usefull for anonymous shopping + const cartId = cookies[config.cartCookie] + + try { + // Create or add a card + if (req.method === 'GET') { + const body = { ...req.body } + return await handlers['getCards']({ ...ctx, body }) + } + + // Create or add an item to customer cards + if (req.method === 'POST') { + const body = { ...req.body, cartId } + return await handlers['addItem']({ ...ctx, body }) + } + + // Update item in customer cards + if (req.method === 'PUT') { + const body = { ...req.body, cartId } + return await handlers['updateItem']({ ...ctx, body }) + } + + // Remove an item from customer cards + if (req.method === 'DELETE') { + const body = { ...req.body, cartId } + return await handlers['removeItem']({ ...ctx, body }) + } + } catch (error) { + console.error(error) + + const message = + error instanceof CommerceAPIError + ? 'An unexpected error ocurred with the Commerce API' + : 'An unexpected error ocurred' + + res.status(500).json({ data: null, errors: [{ message }] }) + } + +export default customerCardEndpoint diff --git a/framework/commerce/api/endpoints/customer.ts b/packages/commerce/src/api/endpoints/customer/index.ts similarity index 75% rename from framework/commerce/api/endpoints/customer.ts rename to packages/commerce/src/api/endpoints/customer/index.ts index 6372c494f..eb2a048b7 100644 --- a/framework/commerce/api/endpoints/customer.ts +++ b/packages/commerce/src/api/endpoints/customer/index.ts @@ -1,7 +1,8 @@ -import type { CustomerSchema } from '../../types/customer' -import { CommerceAPIError } from '../utils/errors' -import isAllowedOperation from '../utils/is-allowed-operation' -import type { GetAPISchema } from '..' +import type { CustomerSchema } from '../../../types/customer' +import type { GetAPISchema } from '../..' + +import { CommerceAPIError } from '../../utils/errors' +import isAllowedOperation from '../../utils/is-allowed-operation' const customerEndpoint: GetAPISchema< any, diff --git a/framework/commerce/api/endpoints/login.ts b/packages/commerce/src/api/endpoints/login.ts similarity index 96% rename from framework/commerce/api/endpoints/login.ts rename to packages/commerce/src/api/endpoints/login.ts index bc071b751..6f69629b1 100644 --- a/framework/commerce/api/endpoints/login.ts +++ b/packages/commerce/src/api/endpoints/login.ts @@ -12,6 +12,7 @@ const loginEndpoint: GetAPISchema< if ( !isAllowedOperation(req, res, { POST: handlers['login'], + GET: handlers['login'], }) ) { return diff --git a/framework/commerce/api/endpoints/logout.ts b/packages/commerce/src/api/endpoints/logout.ts similarity index 100% rename from framework/commerce/api/endpoints/logout.ts rename to packages/commerce/src/api/endpoints/logout.ts diff --git a/framework/commerce/api/endpoints/signup.ts b/packages/commerce/src/api/endpoints/signup.ts similarity index 100% rename from framework/commerce/api/endpoints/signup.ts rename to packages/commerce/src/api/endpoints/signup.ts diff --git a/framework/commerce/api/endpoints/wishlist.ts b/packages/commerce/src/api/endpoints/wishlist.ts similarity index 100% rename from framework/commerce/api/endpoints/wishlist.ts rename to packages/commerce/src/api/endpoints/wishlist.ts diff --git a/framework/commerce/api/index.ts b/packages/commerce/src/api/index.ts similarity index 91% rename from framework/commerce/api/index.ts rename to packages/commerce/src/api/index.ts index e296aea39..aba455c22 100644 --- a/framework/commerce/api/index.ts +++ b/packages/commerce/src/api/index.ts @@ -1,5 +1,5 @@ import type { NextApiHandler } from 'next' -import type { RequestInit, Response } from '@vercel/fetch' +import type { FetchOptions, Response } from '@vercel/fetch' import type { APIEndpoint, APIHandler } from './utils/types' import type { CartSchema } from '../types/cart' import type { CustomerSchema } from '../types/customer' @@ -9,6 +9,8 @@ import type { SignupSchema } from '../types/signup' import type { ProductsSchema } from '../types/product' import type { WishlistSchema } from '../types/wishlist' import type { CheckoutSchema } from '../types/checkout' +import type { CustomerCardSchema } from '../types/customer/card' +import type { CustomerAddressSchema } from '../types/customer/address' import { defaultOperations, OPERATIONS, @@ -25,6 +27,8 @@ export type APISchemas = | ProductsSchema | WishlistSchema | CheckoutSchema + | CustomerCardSchema + | CustomerAddressSchema export type GetAPISchema< C extends CommerceAPI, @@ -59,8 +63,8 @@ export type EndpointHandlers< [H in keyof E['handlers']]: APIHandler< C, EndpointHandlers, - E['handlers'][H]['data'], - E['handlers'][H]['body'], + NonNullable['data'], + NonNullable['body'], E['options'] > } @@ -154,7 +158,7 @@ export interface CommerceAPIConfig { fetch( query: string, queryData?: CommerceAPIFetchOptions, - fetchOptions?: RequestInit + fetchOptions?: FetchOptions ): Promise> } @@ -164,7 +168,7 @@ export type GraphQLFetcher< > = ( query: string, queryData?: CommerceAPIFetchOptions, - fetchOptions?: RequestInit + fetchOptions?: FetchOptions ) => Promise export interface GraphQLFetcherResult { diff --git a/framework/commerce/api/operations.ts b/packages/commerce/src/api/operations.ts similarity index 100% rename from framework/commerce/api/operations.ts rename to packages/commerce/src/api/operations.ts diff --git a/framework/commerce/api/utils/errors.ts b/packages/commerce/src/api/utils/errors.ts similarity index 100% rename from framework/commerce/api/utils/errors.ts rename to packages/commerce/src/api/utils/errors.ts diff --git a/framework/commerce/api/utils/is-allowed-method.ts b/packages/commerce/src/api/utils/is-allowed-method.ts similarity index 100% rename from framework/commerce/api/utils/is-allowed-method.ts rename to packages/commerce/src/api/utils/is-allowed-method.ts diff --git a/framework/commerce/api/utils/is-allowed-operation.ts b/packages/commerce/src/api/utils/is-allowed-operation.ts similarity index 100% rename from framework/commerce/api/utils/is-allowed-operation.ts rename to packages/commerce/src/api/utils/is-allowed-operation.ts diff --git a/framework/commerce/api/utils/types.ts b/packages/commerce/src/api/utils/types.ts similarity index 100% rename from framework/commerce/api/utils/types.ts rename to packages/commerce/src/api/utils/types.ts diff --git a/framework/commerce/auth/use-login.tsx b/packages/commerce/src/auth/use-login.tsx similarity index 100% rename from framework/commerce/auth/use-login.tsx rename to packages/commerce/src/auth/use-login.tsx diff --git a/framework/commerce/auth/use-logout.tsx b/packages/commerce/src/auth/use-logout.tsx similarity index 100% rename from framework/commerce/auth/use-logout.tsx rename to packages/commerce/src/auth/use-logout.tsx diff --git a/framework/commerce/auth/use-signup.tsx b/packages/commerce/src/auth/use-signup.tsx similarity index 100% rename from framework/commerce/auth/use-signup.tsx rename to packages/commerce/src/auth/use-signup.tsx diff --git a/framework/commerce/cart/use-add-item.tsx b/packages/commerce/src/cart/use-add-item.tsx similarity index 100% rename from framework/commerce/cart/use-add-item.tsx rename to packages/commerce/src/cart/use-add-item.tsx diff --git a/framework/commerce/cart/use-add-shipping-address.tsx b/packages/commerce/src/cart/use-add-shipping-address.tsx similarity index 100% rename from framework/commerce/cart/use-add-shipping-address.tsx rename to packages/commerce/src/cart/use-add-shipping-address.tsx diff --git a/framework/commerce/cart/use-cart.tsx b/packages/commerce/src/cart/use-cart.tsx similarity index 100% rename from framework/commerce/cart/use-cart.tsx rename to packages/commerce/src/cart/use-cart.tsx diff --git a/framework/commerce/cart/use-remove-item.tsx b/packages/commerce/src/cart/use-remove-item.tsx similarity index 100% rename from framework/commerce/cart/use-remove-item.tsx rename to packages/commerce/src/cart/use-remove-item.tsx diff --git a/framework/commerce/cart/use-update-item.tsx b/packages/commerce/src/cart/use-update-item.tsx similarity index 100% rename from framework/commerce/cart/use-update-item.tsx rename to packages/commerce/src/cart/use-update-item.tsx diff --git a/packages/commerce/src/checkout/use-checkout.ts b/packages/commerce/src/checkout/use-checkout.ts new file mode 100644 index 000000000..0fe74cb28 --- /dev/null +++ b/packages/commerce/src/checkout/use-checkout.ts @@ -0,0 +1,34 @@ +import type { SWRHook, HookFetcherFn } from '../utils/types' +import type { GetCheckoutHook } from '../types/checkout' + +import Cookies from 'js-cookie' + +import { useHook, useSWRHook } from '../utils/use-hook' +import { Provider, useCommerce } from '..' + +export type UseCheckout< + H extends SWRHook> = SWRHook +> = ReturnType + +export const fetcher: HookFetcherFn = async ({ + options, + input: { cartId }, + fetch, +}) => { + return cartId ? await fetch(options) : null +} + +const fn = (provider: Provider) => provider.checkout?.useCheckout! + +const useCheckout: UseCheckout = (input) => { + const hook = useHook(fn) + const { cartCookie } = useCommerce() + const fetcherFn = hook.fetcher ?? fetcher + const wrapper: typeof fetcher = (context) => { + context.input.cartId = Cookies.get(cartCookie) + return fetcherFn(context) + } + return useSWRHook({ ...hook, fetcher: wrapper })(input) +} + +export default useCheckout diff --git a/packages/commerce/src/checkout/use-submit-checkout.tsx b/packages/commerce/src/checkout/use-submit-checkout.tsx new file mode 100644 index 000000000..a5d865002 --- /dev/null +++ b/packages/commerce/src/checkout/use-submit-checkout.tsx @@ -0,0 +1,23 @@ +import type { HookFetcherFn, MutationHook } from '../utils/types' +import type { SubmitCheckoutHook } from '../types/checkout' +import type { Provider } from '..' + +import { useHook, useMutationHook } from '../utils/use-hook' +import { mutationFetcher } from '../utils/default-fetcher' + +export type UseSubmitCheckout< + H extends MutationHook< + SubmitCheckoutHook + > = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.checkout?.useSubmitCheckout! + +const useSubmitCheckout: UseSubmitCheckout = (...args) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(...args) +} + +export default useSubmitCheckout diff --git a/packages/commerce/src/config.cjs b/packages/commerce/src/config.cjs new file mode 100644 index 000000000..add0061a9 --- /dev/null +++ b/packages/commerce/src/config.cjs @@ -0,0 +1,35 @@ +/** + * This file is expected to be used in next.config.js only + */ + +const path = require('path') +const merge = require('deepmerge') +const importCwd = require('import-cwd') + +function withCommerceConfig(nextConfig = {}) { + const commerce = nextConfig.commerce || {} + const { provider } = commerce + + if (!provider) { + throw new Error( + `The commerce provider is missing, please add a valid provider name` + ) + } + + const commerceNextConfig = importCwd(path.join(provider, 'next.config')) + const config = merge(nextConfig, commerceNextConfig) + const features = merge( + config.commerce.features, + config.commerce[provider]?.features ?? {} + ) + + config.env = config.env || {} + + Object.entries(features).forEach(([k, v]) => { + if (v) config.env[`COMMERCE_${k.toUpperCase()}_ENABLED`] = true + }) + + return config +} + +module.exports = { withCommerceConfig } diff --git a/packages/commerce/src/customer/address/use-add-item.tsx b/packages/commerce/src/customer/address/use-add-item.tsx new file mode 100644 index 000000000..94c45142e --- /dev/null +++ b/packages/commerce/src/customer/address/use-add-item.tsx @@ -0,0 +1,21 @@ +import type { HookFetcherFn, MutationHook } from '../../utils/types' +import type { AddItemHook } from '../../types/customer/address' +import type { Provider } from '../..' + +import { useHook, useMutationHook } from '../../utils/use-hook' +import { mutationFetcher } from '../../utils/default-fetcher' + +export type UseAddItem< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.customer?.address?.useAddItem! + +const useAddItem: UseAddItem = (...args) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(...args) +} + +export default useAddItem diff --git a/packages/commerce/src/customer/address/use-addresses.tsx b/packages/commerce/src/customer/address/use-addresses.tsx new file mode 100644 index 000000000..7fc12924c --- /dev/null +++ b/packages/commerce/src/customer/address/use-addresses.tsx @@ -0,0 +1,34 @@ +import type { SWRHook, HookFetcherFn } from '../../utils/types' +import type { GetAddressesHook } from '../../types/customer/address' + +import Cookies from 'js-cookie' + +import { useHook, useSWRHook } from '../../utils/use-hook' +import { Provider, useCommerce } from '../..' + +export type UseAddresses< + H extends SWRHook> = SWRHook +> = ReturnType + +export const fetcher: HookFetcherFn = async ({ + options, + input: { cartId }, + fetch, +}) => { + return cartId ? await fetch(options) : null +} + +const fn = (provider: Provider) => provider.customer?.address?.useAddresses! + +const useAddresses: UseAddresses = (input) => { + const hook = useHook(fn) + const { cartCookie } = useCommerce() + const fetcherFn = hook.fetcher ?? fetcher + const wrapper: typeof fetcher = (context) => { + context.input.cartId = Cookies.get(cartCookie) + return fetcherFn(context) + } + return useSWRHook({ ...hook, fetcher: wrapper })(input) +} + +export default useAddresses diff --git a/packages/commerce/src/customer/address/use-remove-item.tsx b/packages/commerce/src/customer/address/use-remove-item.tsx new file mode 100644 index 000000000..820a65dad --- /dev/null +++ b/packages/commerce/src/customer/address/use-remove-item.tsx @@ -0,0 +1,21 @@ +import type { HookFetcherFn, MutationHook } from '../../utils/types' +import type { RemoveItemHook } from '../../types/customer/address' +import type { Provider } from '../..' + +import { useHook, useMutationHook } from '../../utils/use-hook' +import { mutationFetcher } from '../../utils/default-fetcher' + +export type UseRemoveItem< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.customer?.address?.useRemoveItem! + +const useRemoveItem: UseRemoveItem = (input) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(input) +} + +export default useRemoveItem diff --git a/packages/commerce/src/customer/address/use-update-item.tsx b/packages/commerce/src/customer/address/use-update-item.tsx new file mode 100644 index 000000000..d05882296 --- /dev/null +++ b/packages/commerce/src/customer/address/use-update-item.tsx @@ -0,0 +1,21 @@ +import type { HookFetcherFn, MutationHook } from '../../utils/types' +import type { UpdateItemHook } from '../../types/customer/address' +import type { Provider } from '../..' + +import { useHook, useMutationHook } from '../../utils/use-hook' +import { mutationFetcher } from '../../utils/default-fetcher' + +export type UseUpdateItem< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.customer?.address?.useUpdateItem! + +const useUpdateItem: UseUpdateItem = (input) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(input) +} + +export default useUpdateItem diff --git a/packages/commerce/src/customer/card/use-add-item.tsx b/packages/commerce/src/customer/card/use-add-item.tsx new file mode 100644 index 000000000..7b4ffdb17 --- /dev/null +++ b/packages/commerce/src/customer/card/use-add-item.tsx @@ -0,0 +1,21 @@ +import type { HookFetcherFn, MutationHook } from '../../utils/types' +import type { AddItemHook } from '../../types/customer/card' +import type { Provider } from '../..' + +import { useHook, useMutationHook } from '../../utils/use-hook' +import { mutationFetcher } from '../../utils/default-fetcher' + +export type UseAddItem< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.customer?.card?.useAddItem! + +const useAddItem: UseAddItem = (...args) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(...args) +} + +export default useAddItem diff --git a/packages/commerce/src/customer/card/use-cards.tsx b/packages/commerce/src/customer/card/use-cards.tsx new file mode 100644 index 000000000..57099504f --- /dev/null +++ b/packages/commerce/src/customer/card/use-cards.tsx @@ -0,0 +1,34 @@ +import type { SWRHook, HookFetcherFn } from '../../utils/types' +import type { GetCardsHook } from '../../types/customer/card' + +import Cookies from 'js-cookie' + +import { useHook, useSWRHook } from '../../utils/use-hook' +import { Provider, useCommerce } from '../..' + +export type UseCards< + H extends SWRHook> = SWRHook +> = ReturnType + +export const fetcher: HookFetcherFn = async ({ + options, + input: { cartId }, + fetch, +}) => { + return cartId ? await fetch(options) : null +} + +const fn = (provider: Provider) => provider.customer?.card?.useCards! + +const useCards: UseCards = (input) => { + const hook = useHook(fn) + const { cartCookie } = useCommerce() + const fetcherFn = hook.fetcher ?? fetcher + const wrapper: typeof fetcher = (context) => { + context.input.cartId = Cookies.get(cartCookie) + return fetcherFn(context) + } + return useSWRHook({ ...hook, fetcher: wrapper })(input) +} + +export default useCards diff --git a/packages/commerce/src/customer/card/use-remove-item.tsx b/packages/commerce/src/customer/card/use-remove-item.tsx new file mode 100644 index 000000000..1d85fa636 --- /dev/null +++ b/packages/commerce/src/customer/card/use-remove-item.tsx @@ -0,0 +1,21 @@ +import type { HookFetcherFn, MutationHook } from '../../utils/types' +import type { RemoveItemHook } from '../../types/customer/card' +import type { Provider } from '../..' + +import { useHook, useMutationHook } from '../../utils/use-hook' +import { mutationFetcher } from '../../utils/default-fetcher' + +export type UseRemoveItem< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.customer?.card?.useRemoveItem! + +const useRemoveItem: UseRemoveItem = (input) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(input) +} + +export default useRemoveItem diff --git a/packages/commerce/src/customer/card/use-update-item.tsx b/packages/commerce/src/customer/card/use-update-item.tsx new file mode 100644 index 000000000..cd8837d7f --- /dev/null +++ b/packages/commerce/src/customer/card/use-update-item.tsx @@ -0,0 +1,21 @@ +import type { HookFetcherFn, MutationHook } from '../../utils/types' +import type { UpdateItemHook } from '../../types/customer/card' +import type { Provider } from '../..' + +import { useHook, useMutationHook } from '../../utils/use-hook' +import { mutationFetcher } from '../../utils/default-fetcher' + +export type UseUpdateItem< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider?.customer?.card?.useUpdateItem! + +const useUpdateItem: UseUpdateItem = (input) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(input) +} + +export default useUpdateItem diff --git a/framework/commerce/customer/use-customer.tsx b/packages/commerce/src/customer/use-customer.tsx similarity index 100% rename from framework/commerce/customer/use-customer.tsx rename to packages/commerce/src/customer/use-customer.tsx diff --git a/framework/commerce/index.tsx b/packages/commerce/src/index.tsx similarity index 53% rename from framework/commerce/index.tsx rename to packages/commerce/src/index.tsx index 1f4376231..5259c3a6f 100644 --- a/framework/commerce/index.tsx +++ b/packages/commerce/src/index.tsx @@ -15,7 +15,8 @@ import type { Signup, Login, Logout, -} from '@commerce/types' + Checkout, +} from './types' import type { Fetcher, SWRHook, MutationHook } from './utils/types' @@ -30,6 +31,10 @@ export type Provider = CommerceConfig & { useUpdateItem?: MutationHook useRemoveItem?: MutationHook } + checkout?: { + useCheckout?: SWRHook + useSubmitCheckout?: MutationHook + } wishlist?: { useWishlist?: SWRHook useAddItem?: MutationHook @@ -37,6 +42,18 @@ export type Provider = CommerceConfig & { } customer?: { useCustomer?: SWRHook + card?: { + useCards?: SWRHook + useAddItem?: MutationHook + useUpdateItem?: MutationHook + useRemoveItem?: MutationHook + } + address?: { + useAddresses?: SWRHook + useAddItem?: MutationHook + useUpdateItem?: MutationHook + useRemoveItem?: MutationHook + } } products?: { useSearch?: SWRHook @@ -48,51 +65,60 @@ export type Provider = CommerceConfig & { } } -export type CommerceProps

= { - children?: ReactNode - provider: P - config: CommerceConfig -} - -export type CommerceConfig = Omit< - CommerceContextValue, - 'providerRef' | 'fetcherRef' -> - -export type CommerceContextValue

= { - providerRef: MutableRefObject

- fetcherRef: MutableRefObject +export type CommerceConfig = { locale: string cartCookie: string } -export function CommerceProvider

({ +export type CommerceContextValue

= { + providerRef: MutableRefObject

+ fetcherRef: MutableRefObject +} & CommerceConfig + +export type CommerceProps

= { + children?: ReactNode + provider: P +} + +/** + * These are the properties every provider should allow when implementing + * the core commerce provider + */ +export type CommerceProviderProps = { + children?: ReactNode +} & Partial + +export function CoreCommerceProvider

({ provider, children, - config, }: CommerceProps

) { - if (!config) { - throw new Error('CommerceProvider requires a valid config object') - } - const providerRef = useRef(provider) // TODO: Remove the fetcherRef const fetcherRef = useRef(provider.fetcher) - // Because the config is an object, if the parent re-renders this provider - // will re-render every consumer unless we memoize the config + // If the parent re-renders this provider will re-render every + // consumer unless we memoize the config + const { locale, cartCookie } = providerRef.current const cfg = useMemo( - () => ({ - providerRef, - fetcherRef, - locale: config.locale, - cartCookie: config.cartCookie, - }), - [config.locale, config.cartCookie] + () => ({ providerRef, fetcherRef, locale, cartCookie }), + [locale, cartCookie] ) return {children} } +export function getCommerceProvider

(provider: P) { + return function CommerceProvider({ + children, + ...props + }: CommerceProviderProps) { + return ( + + {children} + + ) + } +} + export function useCommerce

() { return useContext(Commerce) as CommerceContextValue

} diff --git a/framework/commerce/product/use-price.tsx b/packages/commerce/src/product/use-price.tsx similarity index 100% rename from framework/commerce/product/use-price.tsx rename to packages/commerce/src/product/use-price.tsx diff --git a/framework/commerce/product/use-search.tsx b/packages/commerce/src/product/use-search.tsx similarity index 100% rename from framework/commerce/product/use-search.tsx rename to packages/commerce/src/product/use-search.tsx diff --git a/framework/commerce/types/cart.ts b/packages/commerce/src/types/cart.ts similarity index 100% rename from framework/commerce/types/cart.ts rename to packages/commerce/src/types/cart.ts diff --git a/packages/commerce/src/types/checkout.ts b/packages/commerce/src/types/checkout.ts new file mode 100644 index 000000000..417604fdb --- /dev/null +++ b/packages/commerce/src/types/checkout.ts @@ -0,0 +1,57 @@ +import type { UseSubmitCheckout } from '../checkout/use-submit-checkout' +import type { Address, AddressFields } from './customer/address' +import type { Card, CardFields } from './customer/card' + +// Index +export type Checkout = any + +export type CheckoutTypes = { + card?: Card | CardFields + address?: Address | AddressFields + checkout?: Checkout + hasPayment?: boolean + hasShipping?: boolean +} + +export type SubmitCheckoutHook = { + data: T + input?: T + fetcherInput: T + body: { item: T } + actionInput: T +} + +export type GetCheckoutHook = { + data: T['checkout'] | null + input: {} + fetcherInput: { cartId?: string } + swrState: { isEmpty: boolean } + mutations: { submit: UseSubmitCheckout } +} + +export type CheckoutHooks = { + submitCheckout?: SubmitCheckoutHook + getCheckout: GetCheckoutHook +} + +export type GetCheckoutHandler = + GetCheckoutHook & { + body: { cartId: string } + } + +export type SubmitCheckoutHandler = + SubmitCheckoutHook & { + body: { cartId: string } + } + +export type CheckoutHandlers = { + getCheckout: GetCheckoutHandler + submitCheckout?: SubmitCheckoutHandler +} + +export type CheckoutSchema = { + endpoint: { + options: {} + handlers: CheckoutHandlers + } +} diff --git a/framework/commerce/types/common.ts b/packages/commerce/src/types/common.ts similarity index 100% rename from framework/commerce/types/common.ts rename to packages/commerce/src/types/common.ts diff --git a/packages/commerce/src/types/customer/address.ts b/packages/commerce/src/types/customer/address.ts new file mode 100644 index 000000000..8dc6ffc0d --- /dev/null +++ b/packages/commerce/src/types/customer/address.ts @@ -0,0 +1,111 @@ +export interface Address { + id: string + mask: string +} + +export interface AddressFields { + type: string + firstName: string + lastName: string + company: string + streetNumber: string + apartments: string + zipCode: string + city: string + country: string +} + +export type CustomerAddressTypes = { + address?: Address + fields: AddressFields +} + +export type GetAddressesHook< + T extends CustomerAddressTypes = CustomerAddressTypes +> = { + data: T['address'][] | null + input: {} + fetcherInput: { cartId?: string } + swrState: { isEmpty: boolean } +} + +export type AddItemHook = + { + data: T['address'] + input?: T['fields'] + fetcherInput: T['fields'] + body: { item: T['fields'] } + actionInput: T['fields'] + } + +export type UpdateItemHook< + T extends CustomerAddressTypes = CustomerAddressTypes +> = { + data: T['address'] | null + input: { item?: T['fields']; wait?: number } + fetcherInput: { itemId: string; item: T['fields'] } + body: { itemId: string; item: T['fields'] } + actionInput: T['fields'] & { id: string } +} + +export type RemoveItemHook< + T extends CustomerAddressTypes = CustomerAddressTypes +> = { + data: T['address'] | null + input: { item?: T['address'] } + fetcherInput: { itemId: string } + body: { itemId: string } + actionInput: { id: string } +} + +export type CustomerAddressHooks< + T extends CustomerAddressTypes = CustomerAddressTypes +> = { + getAddresses: GetAddressesHook + addItem: AddItemHook + updateItem: UpdateItemHook + removeItem: RemoveItemHook +} + +export type AddressHandler< + T extends CustomerAddressTypes = CustomerAddressTypes +> = GetAddressesHook & { + body: { cartId?: string } +} + +export type AddItemHandler< + T extends CustomerAddressTypes = CustomerAddressTypes +> = AddItemHook & { + body: { cartId: string } +} + +export type UpdateItemHandler< + T extends CustomerAddressTypes = CustomerAddressTypes +> = UpdateItemHook & { + data: T['address'] + body: { cartId: string } +} + +export type RemoveItemHandler< + T extends CustomerAddressTypes = CustomerAddressTypes +> = RemoveItemHook & { + body: { cartId: string } +} + +export type CustomerAddressHandlers< + T extends CustomerAddressTypes = CustomerAddressTypes +> = { + getAddresses: GetAddressesHook + addItem: AddItemHandler + updateItem: UpdateItemHandler + removeItem: RemoveItemHandler +} + +export type CustomerAddressSchema< + T extends CustomerAddressTypes = CustomerAddressTypes +> = { + endpoint: { + options: {} + handlers: CustomerAddressHandlers + } +} diff --git a/packages/commerce/src/types/customer/card.ts b/packages/commerce/src/types/customer/card.ts new file mode 100644 index 000000000..e9b220dcc --- /dev/null +++ b/packages/commerce/src/types/customer/card.ts @@ -0,0 +1,102 @@ +export interface Card { + id: string + mask: string + provider: string +} + +export interface CardFields { + cardHolder: string + cardNumber: string + cardExpireDate: string + cardCvc: string + firstName: string + lastName: string + company: string + streetNumber: string + zipCode: string + city: string + country: string +} + +export type CustomerCardTypes = { + card?: Card + fields: CardFields +} + +export type GetCardsHook = { + data: T['card'][] | null + input: {} + fetcherInput: { cartId?: string } + swrState: { isEmpty: boolean } +} + +export type AddItemHook = { + data: T['card'] + input?: T['fields'] + fetcherInput: T['fields'] + body: { item: T['fields'] } + actionInput: T['fields'] +} + +export type UpdateItemHook = { + data: T['card'] | null + input: { item?: T['fields']; wait?: number } + fetcherInput: { itemId: string; item: T['fields'] } + body: { itemId: string; item: T['fields'] } + actionInput: T['fields'] & { id: string } +} + +export type RemoveItemHook = { + data: T['card'] | null + input: { item?: T['card'] } + fetcherInput: { itemId: string } + body: { itemId: string } + actionInput: { id: string } +} + +export type CustomerCardHooks = + { + getCards: GetCardsHook + addItem: AddItemHook + updateItem: UpdateItemHook + removeItem: RemoveItemHook + } + +export type CardsHandler = + GetCardsHook & { + body: { cartId?: string } + } + +export type AddItemHandler = + AddItemHook & { + body: { cartId: string } + } + +export type UpdateItemHandler = + UpdateItemHook & { + data: T['card'] + body: { cartId: string } + } + +export type RemoveItemHandler = + RemoveItemHook & { + body: { cartId: string } + } + +export type CustomerCardHandlers< + T extends CustomerCardTypes = CustomerCardTypes +> = { + getCards: GetCardsHook + addItem: AddItemHandler + updateItem: UpdateItemHandler + removeItem: RemoveItemHandler +} + +export type CustomerCardSchema< + T extends CustomerCardTypes = CustomerCardTypes +> = { + endpoint: { + options: {} + handlers: CustomerCardHandlers + } +} diff --git a/framework/commerce/types/customer.ts b/packages/commerce/src/types/customer/index.ts similarity index 87% rename from framework/commerce/types/customer.ts rename to packages/commerce/src/types/customer/index.ts index ba90acdf4..f0b210f62 100644 --- a/framework/commerce/types/customer.ts +++ b/packages/commerce/src/types/customer/index.ts @@ -1,3 +1,6 @@ +export * as Card from './card' +export * as Address from './address' + // TODO: define this type export type Customer = any diff --git a/framework/commerce/types/index.ts b/packages/commerce/src/types/index.ts similarity index 100% rename from framework/commerce/types/index.ts rename to packages/commerce/src/types/index.ts diff --git a/framework/commerce/types/login.ts b/packages/commerce/src/types/login.ts similarity index 100% rename from framework/commerce/types/login.ts rename to packages/commerce/src/types/login.ts diff --git a/framework/commerce/types/logout.ts b/packages/commerce/src/types/logout.ts similarity index 100% rename from framework/commerce/types/logout.ts rename to packages/commerce/src/types/logout.ts diff --git a/framework/commerce/types/page.ts b/packages/commerce/src/types/page.ts similarity index 100% rename from framework/commerce/types/page.ts rename to packages/commerce/src/types/page.ts diff --git a/framework/commerce/types/product.ts b/packages/commerce/src/types/product.ts similarity index 100% rename from framework/commerce/types/product.ts rename to packages/commerce/src/types/product.ts diff --git a/framework/commerce/types/signup.ts b/packages/commerce/src/types/signup.ts similarity index 100% rename from framework/commerce/types/signup.ts rename to packages/commerce/src/types/signup.ts diff --git a/framework/commerce/types/site.ts b/packages/commerce/src/types/site.ts similarity index 100% rename from framework/commerce/types/site.ts rename to packages/commerce/src/types/site.ts diff --git a/framework/commerce/types/wishlist.ts b/packages/commerce/src/types/wishlist.ts similarity index 100% rename from framework/commerce/types/wishlist.ts rename to packages/commerce/src/types/wishlist.ts diff --git a/framework/commerce/utils/default-fetcher.ts b/packages/commerce/src/utils/default-fetcher.ts similarity index 100% rename from framework/commerce/utils/default-fetcher.ts rename to packages/commerce/src/utils/default-fetcher.ts diff --git a/framework/commerce/utils/define-property.ts b/packages/commerce/src/utils/define-property.ts similarity index 58% rename from framework/commerce/utils/define-property.ts rename to packages/commerce/src/utils/define-property.ts index 875aaaa82..e89735226 100644 --- a/framework/commerce/utils/define-property.ts +++ b/packages/commerce/src/utils/define-property.ts @@ -11,16 +11,18 @@ type InferValue = Desc extends { ? Record : never -type DefineProperty = - Desc extends { writable: any; set(val: any): any } - ? never - : Desc extends { writable: any; get(): any } - ? never - : Desc extends { writable: false } - ? Readonly> - : Desc extends { writable: true } - ? InferValue - : Readonly> +type DefineProperty< + Prop extends PropertyKey, + Desc extends PropertyDescriptor +> = Desc extends { writable: any; set(val: any): any } + ? never + : Desc extends { writable: any; get(): any } + ? never + : Desc extends { writable: false } + ? Readonly> + : Desc extends { writable: true } + ? InferValue + : Readonly> export default function defineProperty< Obj extends object, diff --git a/framework/commerce/utils/errors.ts b/packages/commerce/src/utils/errors.ts similarity index 100% rename from framework/commerce/utils/errors.ts rename to packages/commerce/src/utils/errors.ts diff --git a/framework/commerce/utils/types.ts b/packages/commerce/src/utils/types.ts similarity index 89% rename from framework/commerce/utils/types.ts rename to packages/commerce/src/utils/types.ts index 751cea4a5..317fea165 100644 --- a/framework/commerce/utils/types.ts +++ b/packages/commerce/src/utils/types.ts @@ -1,4 +1,4 @@ -import type { ConfigInterface } from 'swr' +import type { SWRConfiguration } from 'swr' import type { CommerceError } from './errors' import type { ResponseState } from './use-data' @@ -10,10 +10,9 @@ export type Override = Omit & K /** * Returns the properties in T with the properties in type K changed from optional to required */ -export type PickRequired = Omit & - { - [P in K]-?: NonNullable - } +export type PickRequired = Omit & { + [P in K]-?: NonNullable +} /** * Core fetcher added by CommerceProvider @@ -87,6 +86,8 @@ export type HookSchemaBase = { export type SWRHookSchemaBase = HookSchemaBase & { // Custom state added to the response object of SWR swrState?: {} + // Instances of MutationSchemaBase that the hook returns for better DX + mutations?: Record['useHook']>> } export type MutationSchemaBase = HookSchemaBase & { @@ -102,7 +103,7 @@ export type SWRHook = { context: SWRHookContext ): HookFunction< H['input'] & { swrOptions?: SwrOptions }, - ResponseState & H['swrState'] + ResponseState & H['swrState'] & H['mutations'] > fetchOptions: HookFetcherOptions fetcher?: HookFetcherFn @@ -139,7 +140,7 @@ export type MutationHookContext = { : (context: { input: H['fetcherInput'] }) => H['data'] | Promise } -export type SwrOptions = ConfigInterface< +export type SwrOptions = SWRConfiguration< Data, CommerceError, HookFetcher diff --git a/framework/commerce/utils/use-data.tsx b/packages/commerce/src/utils/use-data.tsx similarity index 100% rename from framework/commerce/utils/use-data.tsx rename to packages/commerce/src/utils/use-data.tsx diff --git a/framework/commerce/utils/use-hook.ts b/packages/commerce/src/utils/use-hook.ts similarity index 100% rename from framework/commerce/utils/use-hook.ts rename to packages/commerce/src/utils/use-hook.ts diff --git a/framework/commerce/wishlist/index.ts b/packages/commerce/src/wishlist/index.ts similarity index 100% rename from framework/commerce/wishlist/index.ts rename to packages/commerce/src/wishlist/index.ts diff --git a/framework/commerce/wishlist/use-add-item.tsx b/packages/commerce/src/wishlist/use-add-item.tsx similarity index 100% rename from framework/commerce/wishlist/use-add-item.tsx rename to packages/commerce/src/wishlist/use-add-item.tsx diff --git a/framework/commerce/wishlist/use-remove-item.tsx b/packages/commerce/src/wishlist/use-remove-item.tsx similarity index 100% rename from framework/commerce/wishlist/use-remove-item.tsx rename to packages/commerce/src/wishlist/use-remove-item.tsx diff --git a/framework/commerce/wishlist/use-wishlist.tsx b/packages/commerce/src/wishlist/use-wishlist.tsx similarity index 100% rename from framework/commerce/wishlist/use-wishlist.tsx rename to packages/commerce/src/wishlist/use-wishlist.tsx diff --git a/packages/commerce/taskfile.js b/packages/commerce/taskfile.js new file mode 100644 index 000000000..39b1b2a86 --- /dev/null +++ b/packages/commerce/taskfile.js @@ -0,0 +1,20 @@ +export async function build(task, opts) { + await task + .source('src/**/*.+(ts|tsx|js)') + .swc({ dev: opts.dev, outDir: 'dist', baseUrl: 'src' }) + .target('dist') + .source('src/**/*.+(cjs|json)') + .target('dist') + task.$.log('Compiled src files') +} + +export async function release(task) { + await task.clear('dist').start('build') +} + +export default async function dev(task) { + const opts = { dev: true } + await task.clear('dist') + await task.start('build', opts) + await task.watch('src/**/*.+(ts|tsx|js|cjs|json)', 'build', opts) +} diff --git a/packages/commerce/tsconfig.json b/packages/commerce/tsconfig.json new file mode 100644 index 000000000..cd04ab2ff --- /dev/null +++ b/packages/commerce/tsconfig.json @@ -0,0 +1,21 @@ +{ + "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, + "incremental": true, + "jsx": "react-jsx" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/commercejs/.env.template b/packages/commercejs/.env.template new file mode 100644 index 000000000..daeb86c06 --- /dev/null +++ b/packages/commercejs/.env.template @@ -0,0 +1,7 @@ +COMMERCE_PROVIDER=commercejs + +# Public key for your Commerce.js account +NEXT_PUBLIC_COMMERCEJS_PUBLIC_KEY= + +# The URL for the current deployment, optional but should be used for production deployments +NEXT_PUBLIC_COMMERCEJS_DEPLOYMENT_URL= diff --git a/packages/commercejs/.prettierignore b/packages/commercejs/.prettierignore new file mode 100644 index 000000000..f06235c46 --- /dev/null +++ b/packages/commercejs/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/commercejs/.prettierrc b/packages/commercejs/.prettierrc new file mode 100644 index 000000000..e1076edfa --- /dev/null +++ b/packages/commercejs/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/commercejs/README.md b/packages/commercejs/README.md new file mode 100644 index 000000000..20aaf70e5 --- /dev/null +++ b/packages/commercejs/README.md @@ -0,0 +1,13 @@ +# [Commerce.js](https://commercejs.com/) Provider + +**Demo:** https://commercejs.vercel.store/ + +To use this provider you must have a [Commerce.js account](https://commercejs.com/) and you should add some products in the Commerce.js dashboard. + +Next, copy the `.env.template` file in this directory to `.env.local` in the main directory (which will be ignored by Git): + +```bash +cp packages/commercejs/.env.template .env.local +``` + +Then, set the environment variables in `.env.local` to match the ones from your store. You'll need your Commerce.js public API key, which can be found in your Commerce.js dashboard in the `Developer -> API keys` section. diff --git a/packages/commercejs/global.d.ts b/packages/commercejs/global.d.ts new file mode 100644 index 000000000..3fc378752 --- /dev/null +++ b/packages/commercejs/global.d.ts @@ -0,0 +1 @@ +declare module '@components/checkout/context' diff --git a/packages/commercejs/package.json b/packages/commercejs/package.json new file mode 100644 index 000000000..f1ae97dba --- /dev/null +++ b/packages/commercejs/package.json @@ -0,0 +1,80 @@ +{ + "name": "@vercel/commerce-commercejs", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "release": "taskr release", + "build": "taskr build", + "dev": "taskr", + "types": "tsc --emitDeclarationOnly", + "prettier-fix": "prettier --write ." + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], + "./next.config": "./dist/next.config.cjs" + }, + "typesVersions": { + "*": { + "*": [ + "src/*", + "src/*/index" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + }, + "files": [ + "dist" + ], + "publishConfig": { + "typesVersions": { + "*": { + "*": [ + "dist/*.d.ts", + "dist/*/index.d.ts" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + } + }, + "dependencies": { + "@chec/commerce.js": "^2.8.0", + "@vercel/commerce": "^0.0.1" + }, + "peerDependencies": { + "next": "^12", + "react": "^17", + "react-dom": "^17" + }, + "devDependencies": { + "@taskr/clear": "^1.1.0", + "@taskr/esnext": "^1.1.0", + "@taskr/watch": "^1.1.0", + "@types/chec__commerce.js": "^2.8.4", + "@types/node": "^17.0.8", + "@types/react": "^17.0.38", + "lint-staged": "^12.1.7", + "next": "^12.0.8", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "taskr": "^1.1.0", + "taskr-swc": "^0.0.1", + "typescript": "^4.5.4" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,json}": [ + "prettier --write", + "git add" + ] + } +} diff --git a/framework/local/api/endpoints/checkout/index.ts b/packages/commercejs/src/api/endpoints/cart/index.ts similarity index 100% rename from framework/local/api/endpoints/checkout/index.ts rename to packages/commercejs/src/api/endpoints/cart/index.ts diff --git a/framework/local/api/endpoints/customer/index.ts b/packages/commercejs/src/api/endpoints/catalog/index.ts similarity index 100% rename from framework/local/api/endpoints/customer/index.ts rename to packages/commercejs/src/api/endpoints/catalog/index.ts diff --git a/framework/local/api/endpoints/login/index.ts b/packages/commercejs/src/api/endpoints/catalog/products/index.ts similarity index 100% rename from framework/local/api/endpoints/login/index.ts rename to packages/commercejs/src/api/endpoints/catalog/products/index.ts diff --git a/framework/local/api/endpoints/catalog/products.ts b/packages/commercejs/src/api/endpoints/checkout/get-checkout.ts similarity index 100% rename from framework/local/api/endpoints/catalog/products.ts rename to packages/commercejs/src/api/endpoints/checkout/get-checkout.ts diff --git a/packages/commercejs/src/api/endpoints/checkout/index.ts b/packages/commercejs/src/api/endpoints/checkout/index.ts new file mode 100644 index 000000000..1072902e6 --- /dev/null +++ b/packages/commercejs/src/api/endpoints/checkout/index.ts @@ -0,0 +1,23 @@ +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout' +import type { CheckoutSchema } from '../../../types/checkout' +import type { CommercejsAPI } from '../..' + +import submitCheckout from './submit-checkout' +import getCheckout from './get-checkout' + +export type CheckoutAPI = GetAPISchema + +export type CheckoutEndpoint = CheckoutAPI['endpoint'] + +export const handlers: CheckoutEndpoint['handlers'] = { + submitCheckout, + getCheckout, +} + +const checkoutApi = createEndpoint({ + handler: checkoutEndpoint, + handlers, +}) + +export default checkoutApi diff --git a/packages/commercejs/src/api/endpoints/checkout/submit-checkout.ts b/packages/commercejs/src/api/endpoints/checkout/submit-checkout.ts new file mode 100644 index 000000000..e0f3012cc --- /dev/null +++ b/packages/commercejs/src/api/endpoints/checkout/submit-checkout.ts @@ -0,0 +1,44 @@ +import type { CardFields } from '@vercel/commerce/types/customer/card' +import type { AddressFields } from '@vercel/commerce/types/customer/address' +import type { CheckoutEndpoint } from '.' +import sdkFetcherFunction from '../../utils/sdk-fetch' +import { normalizeTestCheckout } from '../../../utils/normalize-checkout' + +const submitCheckout: CheckoutEndpoint['handlers']['submitCheckout'] = async ({ + res, + body: { item, cartId }, + config: { sdkFetch }, +}) => { + const sdkFetcher: typeof sdkFetcherFunction = sdkFetch + + // Generate a checkout token + const { id: checkoutToken } = await sdkFetcher( + 'checkout', + 'generateTokenFrom', + 'cart', + cartId + ) + + const shippingMethods = await sdkFetcher( + 'checkout', + 'getShippingOptions', + checkoutToken, + { + country: 'US', + } + ) + + const shippingMethodToUse = shippingMethods?.[0]?.id || '' + const checkoutData = normalizeTestCheckout({ + paymentInfo: item?.card as CardFields, + shippingInfo: item?.address as AddressFields, + shippingOption: shippingMethodToUse, + }) + + // Capture the order + await sdkFetcher('checkout', 'capture', checkoutToken, checkoutData) + + res.status(200).json({ data: null, errors: [] }) +} + +export default submitCheckout diff --git a/framework/local/api/endpoints/logout/index.ts b/packages/commercejs/src/api/endpoints/customer/address/index.ts similarity index 100% rename from framework/local/api/endpoints/logout/index.ts rename to packages/commercejs/src/api/endpoints/customer/address/index.ts diff --git a/framework/local/api/endpoints/signup/index.ts b/packages/commercejs/src/api/endpoints/customer/card/index.ts similarity index 100% rename from framework/local/api/endpoints/signup/index.ts rename to packages/commercejs/src/api/endpoints/customer/card/index.ts diff --git a/framework/reactioncommerce/api/endpoints/checkout/index.ts b/packages/commercejs/src/api/endpoints/customer/index.ts similarity index 100% rename from framework/reactioncommerce/api/endpoints/checkout/index.ts rename to packages/commercejs/src/api/endpoints/customer/index.ts diff --git a/packages/commercejs/src/api/endpoints/login/index.ts b/packages/commercejs/src/api/endpoints/login/index.ts new file mode 100644 index 000000000..a6dbb4432 --- /dev/null +++ b/packages/commercejs/src/api/endpoints/login/index.ts @@ -0,0 +1,18 @@ +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import loginEndpoint from '@vercel/commerce/api/endpoints/login' +import type { LoginSchema } from '../../../types/login' +import type { CommercejsAPI } from '../..' +import login from './login' + +export type LoginAPI = GetAPISchema + +export type LoginEndpoint = LoginAPI['endpoint'] + +export const handlers: LoginEndpoint['handlers'] = { login } + +const loginApi = createEndpoint({ + handler: loginEndpoint, + handlers, +}) + +export default loginApi diff --git a/packages/commercejs/src/api/endpoints/login/login.ts b/packages/commercejs/src/api/endpoints/login/login.ts new file mode 100644 index 000000000..b9088ad22 --- /dev/null +++ b/packages/commercejs/src/api/endpoints/login/login.ts @@ -0,0 +1,33 @@ +import { serialize } from 'cookie' +import sdkFetcherFunction from '../../utils/sdk-fetch' +import { getDeploymentUrl } from '../../../utils/get-deployment-url' +import type { LoginEndpoint } from '.' + +const login: LoginEndpoint['handlers']['login'] = async ({ + req, + res, + config: { sdkFetch, customerCookie }, +}) => { + const sdkFetcher: typeof sdkFetcherFunction = sdkFetch + const redirectUrl = getDeploymentUrl() + try { + const loginToken = req.query?.token as string + if (!loginToken) { + res.redirect(redirectUrl) + } + const { jwt } = await sdkFetcher('customer', 'getToken', loginToken, false) + res.setHeader( + 'Set-Cookie', + serialize(customerCookie, jwt, { + secure: process.env.NODE_ENV === 'production', + maxAge: 60 * 60 * 24, + path: '/', + }) + ) + res.redirect(redirectUrl) + } catch { + res.redirect(redirectUrl) + } +} + +export default login diff --git a/framework/reactioncommerce/api/endpoints/customers/index.ts b/packages/commercejs/src/api/endpoints/logout/index.ts similarity index 100% rename from framework/reactioncommerce/api/endpoints/customers/index.ts rename to packages/commercejs/src/api/endpoints/logout/index.ts diff --git a/framework/vendure/api/endpoints/cart/index.ts b/packages/commercejs/src/api/endpoints/signup/index.ts similarity index 100% rename from framework/vendure/api/endpoints/cart/index.ts rename to packages/commercejs/src/api/endpoints/signup/index.ts diff --git a/framework/local/api/endpoints/wishlist/index.tsx b/packages/commercejs/src/api/endpoints/wishlist/index.tsx similarity index 100% rename from framework/local/api/endpoints/wishlist/index.tsx rename to packages/commercejs/src/api/endpoints/wishlist/index.tsx diff --git a/packages/commercejs/src/api/index.ts b/packages/commercejs/src/api/index.ts new file mode 100644 index 000000000..1bc821865 --- /dev/null +++ b/packages/commercejs/src/api/index.ts @@ -0,0 +1,46 @@ +import type { CommerceAPI, CommerceAPIConfig } from '@vercel/commerce/api' +import { getCommerceApi as commerceApi } from '@vercel/commerce/api' + +import getAllPages from './operations/get-all-pages' +import getPage from './operations/get-page' +import getSiteInfo from './operations/get-site-info' +import getAllProductPaths from './operations/get-all-product-paths' +import getAllProducts from './operations/get-all-products' +import getProduct from './operations/get-product' +import sdkFetch from './utils/sdk-fetch' +import createGraphqlFetcher from './utils/graphql-fetch' +import { API_URL, CART_COOKIE, CUSTOMER_COOKIE } from '../constants' + +export interface CommercejsConfig extends CommerceAPIConfig { + sdkFetch: typeof sdkFetch +} + +const config: CommercejsConfig = { + commerceUrl: API_URL, + cartCookie: CART_COOKIE, + cartCookieMaxAge: 2592000, + customerCookie: CUSTOMER_COOKIE, + apiToken: '', + fetch: createGraphqlFetcher(() => getCommerceApi().getConfig()), + sdkFetch, +} + +const operations = { + getAllPages, + getPage, + getSiteInfo, + getAllProductPaths, + getAllProducts, + getProduct, +} + +export const provider = { config, operations } + +export type Provider = typeof provider +export type CommercejsAPI

= CommerceAPI

+ +export function getCommerceApi

( + customProvider: P = provider as any +): CommercejsAPI

{ + return commerceApi(customProvider as any) +} diff --git a/packages/commercejs/src/api/operations/get-all-pages.ts b/packages/commercejs/src/api/operations/get-all-pages.ts new file mode 100644 index 000000000..c8c9e41b2 --- /dev/null +++ b/packages/commercejs/src/api/operations/get-all-pages.ts @@ -0,0 +1,21 @@ +import type { CommercejsConfig } from '..' +import { GetAllPagesOperation } from '../../types/page' + +export type Page = { url: string } +export type GetAllPagesResult = { pages: Page[] } + +export default function getAllPagesOperation() { + async function getAllPages({ + config, + preview, + }: { + url?: string + config?: Partial + preview?: boolean + } = {}): Promise { + return Promise.resolve({ + pages: [], + }) + } + return getAllPages +} diff --git a/packages/commercejs/src/api/operations/get-all-product-paths.ts b/packages/commercejs/src/api/operations/get-all-product-paths.ts new file mode 100644 index 000000000..03b7eee96 --- /dev/null +++ b/packages/commercejs/src/api/operations/get-all-product-paths.ts @@ -0,0 +1,35 @@ +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { + GetAllProductPathsOperation, + CommercejsProduct, +} from '../../types/product' + +import type { CommercejsConfig, Provider } from '..' + +export type GetAllProductPathsResult = { + products: Array<{ path: string }> +} + +export default function getAllProductPathsOperation({ + commerce, +}: OperationContext) { + async function getAllProductPaths({ + config, + }: { + config?: Partial + } = {}): Promise { + const { sdkFetch } = commerce.getConfig(config) + const { data } = await sdkFetch('products', 'list') + + // Match a path for every product retrieved + const productPaths = data.map(({ permalink }: CommercejsProduct) => ({ + path: `/${permalink}`, + })) + + return { + products: productPaths, + } + } + + return getAllProductPaths +} diff --git a/packages/commercejs/src/api/operations/get-all-products.ts b/packages/commercejs/src/api/operations/get-all-products.ts new file mode 100644 index 000000000..485ea22ee --- /dev/null +++ b/packages/commercejs/src/api/operations/get-all-products.ts @@ -0,0 +1,29 @@ +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { GetAllProductsOperation } from '../../types/product' +import type { CommercejsConfig, Provider } from '../index' + +import { normalizeProduct } from '../../utils/normalize-product' + +export default function getAllProductsOperation({ + commerce, +}: OperationContext) { + async function getAllProducts({ + config, + }: { + config?: Partial + } = {}): Promise { + const { sdkFetch } = commerce.getConfig(config) + const { data } = await sdkFetch('products', 'list', { + sortBy: 'sort_order', + }) + + const productsFormatted = + data?.map((product: any) => normalizeProduct(product)) || [] + + return { + products: productsFormatted, + } + } + + return getAllProducts +} diff --git a/packages/commercejs/src/api/operations/get-page.ts b/packages/commercejs/src/api/operations/get-page.ts new file mode 100644 index 000000000..f4b69c90d --- /dev/null +++ b/packages/commercejs/src/api/operations/get-page.ts @@ -0,0 +1,15 @@ +import { GetPageOperation } from '../../types/page' + +export type Page = any +export type GetPageResult = { page?: Page } + +export type PageVariables = { + id: number +} + +export default function getPageOperation() { + async function getPage(): Promise { + return Promise.resolve({}) + } + return getPage +} diff --git a/packages/commercejs/src/api/operations/get-product.ts b/packages/commercejs/src/api/operations/get-product.ts new file mode 100644 index 000000000..c8fa5901b --- /dev/null +++ b/packages/commercejs/src/api/operations/get-product.ts @@ -0,0 +1,44 @@ +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { GetProductOperation } from '../../types/product' +import type { CommercejsConfig, Provider } from '../index' +import { normalizeProduct } from '../../utils/normalize-product' + +export default function getProductOperation({ + commerce, +}: OperationContext) { + async function getProduct({ + config, + variables, + }: { + query?: string + variables?: T['variables'] + config?: Partial + preview?: boolean + } = {}): Promise { + const { sdkFetch } = commerce.getConfig(config) + + // Fetch a product by its permalink. + const product = await sdkFetch( + 'products', + 'retrieve', + variables?.slug || '', + { + type: 'permalink', + } + ) + + const { data: variants } = await sdkFetch( + 'products', + 'getVariants', + product.id + ) + + const productFormatted = normalizeProduct(product, variants) + + return { + product: productFormatted, + } + } + + return getProduct +} diff --git a/packages/commercejs/src/api/operations/get-site-info.ts b/packages/commercejs/src/api/operations/get-site-info.ts new file mode 100644 index 000000000..0b4046d7c --- /dev/null +++ b/packages/commercejs/src/api/operations/get-site-info.ts @@ -0,0 +1,36 @@ +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { Category, GetSiteInfoOperation } from '../../types/site' +import { normalizeCategory } from '../../utils/normalize-category' +import type { CommercejsConfig, Provider } from '../index' + +export type GetSiteInfoResult< + T extends { categories: any[]; brands: any[] } = { + categories: Category[] + brands: any[] + } +> = T + +export default function getSiteInfoOperation({ + commerce, +}: OperationContext) { + async function getSiteInfo({ + config, + }: { + query?: string + variables?: any + config?: Partial + preview?: boolean + } = {}): Promise { + const { sdkFetch } = commerce.getConfig(config) + const { data: categories } = await sdkFetch('categories', 'list') + + const formattedCategories = categories.map(normalizeCategory) + + return { + categories: formattedCategories, + brands: [], + } + } + + return getSiteInfo +} diff --git a/packages/commercejs/src/api/operations/index.ts b/packages/commercejs/src/api/operations/index.ts new file mode 100644 index 000000000..84b04a978 --- /dev/null +++ b/packages/commercejs/src/api/operations/index.ts @@ -0,0 +1,6 @@ +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' +export { default as getAllProductPaths } from './get-all-product-paths' diff --git a/packages/commercejs/src/api/utils/graphql-fetch.ts b/packages/commercejs/src/api/utils/graphql-fetch.ts new file mode 100644 index 000000000..64ebf4d6b --- /dev/null +++ b/packages/commercejs/src/api/utils/graphql-fetch.ts @@ -0,0 +1,14 @@ +import type { GraphQLFetcher } from '@vercel/commerce/api' +import type { CommercejsConfig } from '../' + +import { FetcherError } from '@vercel/commerce/utils/errors' + +const fetchGraphqlApi: (getConfig: () => CommercejsConfig) => GraphQLFetcher = + () => async () => { + throw new FetcherError({ + errors: [{ message: 'GraphQL fetch is not implemented' }], + status: 500, + }) + } + +export default fetchGraphqlApi diff --git a/packages/commercejs/src/api/utils/sdk-fetch.ts b/packages/commercejs/src/api/utils/sdk-fetch.ts new file mode 100644 index 000000000..d080c54b4 --- /dev/null +++ b/packages/commercejs/src/api/utils/sdk-fetch.ts @@ -0,0 +1,21 @@ +import { commerce } from '../../lib/commercejs' +import Commerce from '@chec/commerce.js' + +type MethodKeys = { + [K in keyof T]: T[K] extends (...args: any) => infer R ? K : never +}[keyof T] + +// Calls the relevant Commerce.js SDK method based on resource and method arguments. +export default async function sdkFetch< + Resource extends keyof Commerce, + Method extends MethodKeys +>( + resource: Resource, + method: Method, + ...variables: Parameters +): Promise> { + //@ts-ignore + // Provider TODO: Fix types here. + const data = await commerce[resource][method](...variables) + return data +} diff --git a/framework/local/auth/index.ts b/packages/commercejs/src/auth/index.ts similarity index 100% rename from framework/local/auth/index.ts rename to packages/commercejs/src/auth/index.ts diff --git a/packages/commercejs/src/auth/use-login.tsx b/packages/commercejs/src/auth/use-login.tsx new file mode 100644 index 000000000..4287d39d6 --- /dev/null +++ b/packages/commercejs/src/auth/use-login.tsx @@ -0,0 +1,34 @@ +import { useCallback } from 'react' +import { MutationHook } from '@vercel/commerce/utils/types' +import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login' +import type { LoginHook } from '@vercel/commerce/types/login' +import { getDeploymentUrl } from '../utils/get-deployment-url' + +export default useLogin as UseLogin + +const getLoginCallbackUrl = () => { + const baseUrl = getDeploymentUrl() + const API_ROUTE_PATH = 'api/login' + return `${baseUrl}/${API_ROUTE_PATH}` +} + +export const handler: MutationHook = { + fetchOptions: { + query: 'customer', + method: 'login', + }, + async fetcher({ input, options: { query, method }, fetch }) { + await fetch({ + query, + method, + variables: [input.email, getLoginCallbackUrl()], + }) + return null + }, + useHook: ({ fetch }) => + function useHook() { + return useCallback(async function login(input) { + return fetch({ input }) + }, []) + }, +} diff --git a/packages/commercejs/src/auth/use-logout.tsx b/packages/commercejs/src/auth/use-logout.tsx new file mode 100644 index 000000000..7c60f3442 --- /dev/null +++ b/packages/commercejs/src/auth/use-logout.tsx @@ -0,0 +1,27 @@ +import { useCallback } from 'react' +import Cookies from 'js-cookie' +import { MutationHook } from '@vercel/commerce/utils/types' +import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout' +import type { LogoutHook } from '@vercel/commerce/types/logout' +import useCustomer from '../customer/use-customer' +import { CUSTOMER_COOKIE } from '../constants' + +export default useLogout as UseLogout + +export const handler: MutationHook = { + fetchOptions: { + query: '_', + method: '_', + }, + useHook: () => () => { + const { mutate } = useCustomer() + return useCallback( + async function logout() { + Cookies.remove(CUSTOMER_COOKIE) + await mutate(null, false) + return null + }, + [mutate] + ) + }, +} diff --git a/packages/commercejs/src/auth/use-signup.tsx b/packages/commercejs/src/auth/use-signup.tsx new file mode 100644 index 000000000..1cc9538e7 --- /dev/null +++ b/packages/commercejs/src/auth/use-signup.tsx @@ -0,0 +1,17 @@ +import { MutationHook } from '@vercel/commerce/utils/types' +import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup' + +export default useSignup as UseSignup + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher() { + return null + }, + useHook: + ({ fetch }) => + () => + () => {}, +} diff --git a/framework/local/cart/index.ts b/packages/commercejs/src/cart/index.ts similarity index 100% rename from framework/local/cart/index.ts rename to packages/commercejs/src/cart/index.ts diff --git a/packages/commercejs/src/cart/use-add-item.tsx b/packages/commercejs/src/cart/use-add-item.tsx new file mode 100644 index 000000000..3bbad1147 --- /dev/null +++ b/packages/commercejs/src/cart/use-add-item.tsx @@ -0,0 +1,45 @@ +import type { AddItemHook } from '@vercel/commerce/types/cart' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { useCallback } from 'react' +import useAddItem, { UseAddItem } from '@vercel/commerce/cart/use-add-item' +import type { CommercejsCart } from '../types/cart' +import { normalizeCart } from '../utils/normalize-cart' +import useCart from './use-cart' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: 'cart', + method: 'add', + }, + async fetcher({ input: item, options, fetch }) { + // Frontend stringifies variantId even if undefined. + const hasVariant = !item.variantId || item.variantId !== 'undefined' + + const variables = [item.productId, item?.quantity || 1] + if (hasVariant) { + variables.push(item.variantId) + } + + const { cart } = await fetch<{ cart: CommercejsCart }>({ + query: options.query, + method: options.method, + variables, + }) + return normalizeCart(cart) + }, + useHook: ({ fetch }) => + function useHook() { + const { mutate } = useCart() + + return useCallback( + async function addItem(input) { + const cart = await fetch({ input }) + await mutate(cart, false) + return cart + }, + [mutate] + ) + }, +} diff --git a/packages/commercejs/src/cart/use-cart.tsx b/packages/commercejs/src/cart/use-cart.tsx new file mode 100644 index 000000000..57592ec37 --- /dev/null +++ b/packages/commercejs/src/cart/use-cart.tsx @@ -0,0 +1,41 @@ +import { useMemo } from 'react' +import type { GetCartHook } from '@vercel/commerce/types/cart' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCart, { UseCart } from '@vercel/commerce/cart/use-cart' +import type { CommercejsCart } from '../types/cart' +import { normalizeCart } from '../utils/normalize-cart' + +export default useCart as UseCart + +export const handler: SWRHook = { + fetchOptions: { + query: 'cart', + method: 'retrieve', + }, + async fetcher({ options, fetch }) { + const cart = await fetch({ + query: options.query, + method: options.method, + }) + return normalizeCart(cart) + }, + useHook: ({ useData }) => + function useHook(input) { + const response = useData({ + swrOptions: { revalidateOnFocus: false, ...input?.swrOptions }, + }) + + return useMemo( + () => + Object.create(response, { + isEmpty: { + get() { + return (response.data?.lineItems?.length ?? 0) <= 0 + }, + enumerable: true, + }, + }), + [response] + ) + }, +} diff --git a/packages/commercejs/src/cart/use-remove-item.tsx b/packages/commercejs/src/cart/use-remove-item.tsx new file mode 100644 index 000000000..c9e57872d --- /dev/null +++ b/packages/commercejs/src/cart/use-remove-item.tsx @@ -0,0 +1,36 @@ +import { useCallback } from 'react' +import type { MutationHook } from '@vercel/commerce/utils/types' +import type { RemoveItemHook } from '@vercel/commerce/types/cart' +import useRemoveItem, { UseRemoveItem } from '@vercel/commerce/cart/use-remove-item' +import type { CommercejsCart } from '../types/cart' +import { normalizeCart } from '../utils/normalize-cart' +import useCart from './use-cart' + +export default useRemoveItem as UseRemoveItem + +export const handler: MutationHook = { + fetchOptions: { + query: 'cart', + method: 'remove', + }, + async fetcher({ input, options, fetch }) { + const { cart } = await fetch<{ cart: CommercejsCart }>({ + query: options.query, + method: options.method, + variables: input.itemId, + }) + return normalizeCart(cart) + }, + useHook: ({ fetch }) => + function useHook() { + const { mutate } = useCart() + return useCallback( + async function removeItem(input) { + const cart = await fetch({ input: { itemId: input.id } }) + await mutate(cart, false) + return cart + }, + [mutate] + ) + }, +} diff --git a/packages/commercejs/src/cart/use-update-item.tsx b/packages/commercejs/src/cart/use-update-item.tsx new file mode 100644 index 000000000..1546be036 --- /dev/null +++ b/packages/commercejs/src/cart/use-update-item.tsx @@ -0,0 +1,76 @@ +import type { UpdateItemHook, LineItem } from '@vercel/commerce/types/cart' +import type { + HookFetcherContext, + MutationHookContext, +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' +import debounce from 'lodash.debounce' +import { useCallback } from 'react' +import useUpdateItem, { UseUpdateItem } from '@vercel/commerce/cart/use-update-item' +import type { CommercejsCart } from '../types/cart' +import { normalizeCart } from '../utils/normalize-cart' +import useCart from './use-cart' + +export default useUpdateItem as UseUpdateItem + +export type UpdateItemActionInput = T extends LineItem + ? Partial + : UpdateItemHook['actionInput'] + +export const handler = { + fetchOptions: { + query: 'cart', + method: 'update', + }, + async fetcher({ input, options, fetch }: HookFetcherContext) { + const variables = [input.itemId, { quantity: input.item.quantity }] + const { cart } = await fetch<{ cart: CommercejsCart }>({ + query: options.query, + method: options.method, + variables, + }) + return normalizeCart(cart) + }, + useHook: + ({ fetch }: MutationHookContext) => + ( + ctx: { + item?: T + wait?: number + } = {} + ) => { + // eslint-disable-next-line react-hooks/rules-of-hooks + const { mutate } = useCart() as any + const { item } = ctx + + // eslint-disable-next-line react-hooks/rules-of-hooks + return useCallback( + debounce(async (input: UpdateItemActionInput) => { + const itemId = input.id ?? item?.id + const productId = input.productId ?? item?.productId + const variantId = input.productId ?? item?.variantId + const quantity = input?.quantity ?? item?.quantity + + if (!itemId || !productId || !variantId) { + throw new ValidationError({ + message: 'Invalid input for updating cart item', + }) + } + + const cart = await fetch({ + input: { + itemId, + item: { + quantity, + productId, + variantId, + }, + }, + }) + await mutate(cart, false) + return cart + }, ctx.wait ?? 500), + [mutate, item] + ) + }, +} diff --git a/packages/commercejs/src/checkout/index.ts b/packages/commercejs/src/checkout/index.ts new file mode 100644 index 000000000..306621059 --- /dev/null +++ b/packages/commercejs/src/checkout/index.ts @@ -0,0 +1,2 @@ +export { default as useSubmitCheckout } from './use-submit-checkout' +export { default as useCheckout } from './use-checkout' diff --git a/packages/commercejs/src/checkout/use-checkout.tsx b/packages/commercejs/src/checkout/use-checkout.tsx new file mode 100644 index 000000000..52a19a740 --- /dev/null +++ b/packages/commercejs/src/checkout/use-checkout.tsx @@ -0,0 +1,52 @@ +import type { GetCheckoutHook } from '@vercel/commerce/types/checkout' + +import { useMemo } from 'react' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { UseCheckout } from '@vercel/commerce/checkout/use-checkout' +import useSubmitCheckout from './use-submit-checkout' +import { useCheckoutContext } from '@components/checkout/context' + +export default useCheckout as UseCheckout + +export const handler: SWRHook = { + fetchOptions: { + query: '_', + method: '_', + }, + useHook: () => + function useHook() { + const { cardFields, addressFields } = useCheckoutContext() + const submit = useSubmitCheckout() + + // Basic validation - check that at least one field has a value. + const hasEnteredCard = Object.values(cardFields).some( + (fieldValue) => !!fieldValue + ) + const hasEnteredAddress = Object.values(addressFields).some( + (fieldValue) => !!fieldValue + ) + + const response = useMemo( + () => ({ + data: { + hasPayment: hasEnteredCard, + hasShipping: hasEnteredAddress, + }, + }), + [hasEnteredCard, hasEnteredAddress] + ) + + return useMemo( + () => + Object.create(response, { + submit: { + get() { + return submit + }, + enumerable: true, + }, + }), + [submit, response] + ) + }, +} diff --git a/packages/commercejs/src/checkout/use-submit-checkout.tsx b/packages/commercejs/src/checkout/use-submit-checkout.tsx new file mode 100644 index 000000000..2cb723281 --- /dev/null +++ b/packages/commercejs/src/checkout/use-submit-checkout.tsx @@ -0,0 +1,38 @@ +import type { SubmitCheckoutHook } from '@vercel/commerce/types/checkout' +import type { MutationHook } from '@vercel/commerce/utils/types' + +import { useCallback } from 'react' +import useSubmitCheckout, { + UseSubmitCheckout, +} from '@vercel/commerce/checkout/use-submit-checkout' +import { useCheckoutContext } from '@components/checkout/context' + +export default useSubmitCheckout as UseSubmitCheckout + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/checkout', + method: 'POST', + }, + async fetcher({ input: item, options, fetch }) { + const data = await fetch({ + ...options, + body: { item }, + }) + return data + }, + useHook: ({ fetch }) => + function useHook() { + const { cardFields, addressFields } = useCheckoutContext() + + return useCallback( + async function onSubmitCheckout(input) { + const data = await fetch({ + input: { card: cardFields, address: addressFields }, + }) + return data + }, + [cardFields, addressFields] + ) + }, +} diff --git a/packages/commercejs/src/commerce.config.json b/packages/commercejs/src/commerce.config.json new file mode 100644 index 000000000..ba52b04c4 --- /dev/null +++ b/packages/commercejs/src/commerce.config.json @@ -0,0 +1,10 @@ +{ + "provider": "commercejs", + "features": { + "cart": true, + "search": true, + "customCheckout": true, + "customerAuth": true, + "wishlist": false + } +} diff --git a/packages/commercejs/src/constants.ts b/packages/commercejs/src/constants.ts new file mode 100644 index 000000000..33a767793 --- /dev/null +++ b/packages/commercejs/src/constants.ts @@ -0,0 +1,4 @@ +export const CART_COOKIE = 'commercejs_cart_id' +export const CUSTOMER_COOKIE = 'commercejs_customer_token' +export const API_URL = 'https://api.chec.io/v1' +export const LOCALE = 'en-us' diff --git a/packages/commercejs/src/customer/address/index.ts b/packages/commercejs/src/customer/address/index.ts new file mode 100644 index 000000000..1fb07c055 --- /dev/null +++ b/packages/commercejs/src/customer/address/index.ts @@ -0,0 +1,2 @@ +export { default as useAddresses } from './use-addresses' +export { default as useAddItem } from './use-add-item' diff --git a/packages/commercejs/src/customer/address/use-add-item.tsx b/packages/commercejs/src/customer/address/use-add-item.tsx new file mode 100644 index 000000000..0f02059b1 --- /dev/null +++ b/packages/commercejs/src/customer/address/use-add-item.tsx @@ -0,0 +1,25 @@ +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 '@vercel/commerce/customer/address/use-add-item' +import { useCheckoutContext } from '@components/checkout/context' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '_', + method: '_', + }, + useHook: () => + function useHook() { + const { setAddressFields } = useCheckoutContext() + return useCallback( + async function addItem(input) { + setAddressFields(input) + return undefined + }, + [setAddressFields] + ) + }, +} diff --git a/packages/commercejs/src/customer/address/use-addresses.tsx b/packages/commercejs/src/customer/address/use-addresses.tsx new file mode 100644 index 000000000..a56255dfb --- /dev/null +++ b/packages/commercejs/src/customer/address/use-addresses.tsx @@ -0,0 +1,34 @@ +import type { GetAddressesHook } from '@vercel/commerce/types/customer/address' + +import { useMemo } from 'react' +import { SWRHook } from '@vercel/commerce/utils/types' +import useAddresses, { + UseAddresses, +} from '@vercel/commerce/customer/address/use-addresses' + +export default useAddresses as UseAddresses + +export const handler: SWRHook = { + fetchOptions: { + url: '_', + method: '_', + }, + useHook: () => + function useHook() { + return useMemo( + () => + Object.create( + {}, + { + isEmpty: { + get() { + return true + }, + enumerable: true, + }, + } + ), + [] + ) + }, +} diff --git a/packages/commercejs/src/customer/card/index.ts b/packages/commercejs/src/customer/card/index.ts new file mode 100644 index 000000000..4048ca29a --- /dev/null +++ b/packages/commercejs/src/customer/card/index.ts @@ -0,0 +1,2 @@ +export { default as useCards } from './use-cards' +export { default as useAddItem } from './use-add-item' diff --git a/packages/commercejs/src/customer/card/use-add-item.tsx b/packages/commercejs/src/customer/card/use-add-item.tsx new file mode 100644 index 000000000..d4c179b18 --- /dev/null +++ b/packages/commercejs/src/customer/card/use-add-item.tsx @@ -0,0 +1,25 @@ +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 '@vercel/commerce/customer/card/use-add-item' +import { useCheckoutContext } from '@components/checkout/context' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + url: '_', + method: '_', + }, + useHook: () => + function useHook() { + const { setCardFields } = useCheckoutContext() + return useCallback( + async function addItem(input) { + setCardFields(input) + return undefined + }, + [setCardFields] + ) + }, +} diff --git a/packages/commercejs/src/customer/card/use-cards.tsx b/packages/commercejs/src/customer/card/use-cards.tsx new file mode 100644 index 000000000..7c956a67c --- /dev/null +++ b/packages/commercejs/src/customer/card/use-cards.tsx @@ -0,0 +1,31 @@ +import type { GetCardsHook } from '@vercel/commerce/types/customer/card' +import { useMemo } from 'react' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCard, { UseCards } from '@vercel/commerce/customer/card/use-cards' + +export default useCard as UseCards + +export const handler: SWRHook = { + fetchOptions: { + query: '_', + method: '_', + }, + useHook: () => + function useHook() { + return useMemo( + () => + Object.create( + {}, + { + isEmpty: { + get() { + return true + }, + enumerable: true, + }, + } + ), + [] + ) + }, +} diff --git a/framework/local/customer/index.ts b/packages/commercejs/src/customer/index.ts similarity index 100% rename from framework/local/customer/index.ts rename to packages/commercejs/src/customer/index.ts diff --git a/packages/commercejs/src/customer/use-customer.tsx b/packages/commercejs/src/customer/use-customer.tsx new file mode 100644 index 000000000..4906223fd --- /dev/null +++ b/packages/commercejs/src/customer/use-customer.tsx @@ -0,0 +1,44 @@ +import Cookies from 'js-cookie' +import { decode } from 'jsonwebtoken' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCustomer, { UseCustomer } from '@vercel/commerce/customer/use-customer' +import { CUSTOMER_COOKIE, API_URL } from '../constants' +import type { CustomerHook } from '../types/customer' + +export default useCustomer as UseCustomer +export const handler: SWRHook = { + fetchOptions: { + query: 'customer', + method: '_request', + }, + async fetcher({ options, fetch }) { + const token = Cookies.get(CUSTOMER_COOKIE) + if (!token) { + return null + } + + const decodedToken = decode(token) as { cid: string } + const customer = await fetch({ + query: options.query, + method: options.method, + variables: [ + `${API_URL}/customers/${decodedToken.cid}`, + 'get', + null, + {}, + token, + ], + }) + return customer + }, + useHook: + ({ useData }) => + (input) => { + return useData({ + swrOptions: { + revalidateOnFocus: false, + ...input?.swrOptions, + }, + }) + }, +} diff --git a/packages/commercejs/src/fetcher.ts b/packages/commercejs/src/fetcher.ts new file mode 100644 index 000000000..ab47ae9c8 --- /dev/null +++ b/packages/commercejs/src/fetcher.ts @@ -0,0 +1,61 @@ +import { commerce } from './lib/commercejs' +import type { Fetcher } from '@vercel/commerce/utils/types' +import { FetcherError } from '@vercel/commerce/utils/errors' + +function isValidSDKQuery(query?: string): query is keyof typeof commerce { + if (!query) return false + return query in commerce +} + +// Fetches from an API route within /api/endpoints directory +const customFetcher: Fetcher = async ({ method, url, body }) => { + const response = await fetch(url!, { + method, + body: body ? JSON.stringify(body) : undefined, + headers: { + 'Content-Type': 'application/json', + }, + }) + .then((response) => response.json()) + .then((response) => response.data) + + return response +} + +const fetcher: Fetcher = async ({ url, query, method, variables, body }) => { + // If a URL is passed, it means that the fetch needs to be passed on to a custom API route. + const isCustomFetch = !!url + if (isCustomFetch) { + const data = await customFetcher({ url, method, body }) + return data + } + + // Fetch using the Commerce.js SDK, but make sure that it's a valid method. + if (!isValidSDKQuery(query)) { + throw new FetcherError({ + errors: [ + { message: `Query ${query} does not exist on Commerce.js SDK.` }, + ], + status: 400, + }) + } + + const resource: any = commerce[query] + + if (!method || !resource[method]) { + throw new FetcherError({ + errors: [ + { + message: `Method ${method} does not exist on Commerce.js SDK ${query} resource.`, + }, + ], + status: 400, + }) + } + + const variablesArgument = Array.isArray(variables) ? variables : [variables] + const data = await resource[method](...variablesArgument) + return data +} + +export default fetcher diff --git a/packages/commercejs/src/index.tsx b/packages/commercejs/src/index.tsx new file mode 100644 index 000000000..9da7c1103 --- /dev/null +++ b/packages/commercejs/src/index.tsx @@ -0,0 +1,9 @@ +import { commercejsProvider, CommercejsProvider } from './provider' +import { getCommerceProvider, useCommerce as useCoreCommerce } from '@vercel/commerce' + +export { commercejsProvider } +export type { CommercejsProvider } + +export const CommerceProvider = getCommerceProvider(commercejsProvider) + +export const useCommerce = () => useCoreCommerce() diff --git a/packages/commercejs/src/lib/commercejs.ts b/packages/commercejs/src/lib/commercejs.ts new file mode 100644 index 000000000..8acea540b --- /dev/null +++ b/packages/commercejs/src/lib/commercejs.ts @@ -0,0 +1,11 @@ +import Commerce from '@chec/commerce.js' + +const commercejsPublicKey = process.env + .NEXT_PUBLIC_COMMERCEJS_PUBLIC_KEY as string +const devEnvironment = process.env.NODE_ENV === 'development' + +if (devEnvironment && !commercejsPublicKey) { + throw Error('A Commerce.js public API key must be provided') +} + +export const commerce = new Commerce(commercejsPublicKey, devEnvironment) diff --git a/packages/commercejs/src/next.config.cjs b/packages/commercejs/src/next.config.cjs new file mode 100644 index 000000000..0c9e96b4c --- /dev/null +++ b/packages/commercejs/src/next.config.cjs @@ -0,0 +1,16 @@ +const commerce = require('./commerce.config.json') + +module.exports = { + commerce, + images: { + domains: ['cdn.chec.io'], + }, + rewrites() { + return [ + { + source: '/api/login/:token', + destination: '/api/login?token=:token', + }, + ] + }, +} diff --git a/framework/local/product/index.ts b/packages/commercejs/src/product/index.ts similarity index 100% rename from framework/local/product/index.ts rename to packages/commercejs/src/product/index.ts diff --git a/packages/commercejs/src/product/use-price.tsx b/packages/commercejs/src/product/use-price.tsx new file mode 100644 index 000000000..fd42d7033 --- /dev/null +++ b/packages/commercejs/src/product/use-price.tsx @@ -0,0 +1,2 @@ +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/packages/commercejs/src/product/use-search.tsx b/packages/commercejs/src/product/use-search.tsx new file mode 100644 index 000000000..ec8ad618f --- /dev/null +++ b/packages/commercejs/src/product/use-search.tsx @@ -0,0 +1,53 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useSearch, { UseSearch } from '@vercel/commerce/product/use-search' +import { SearchProductsHook } from '@vercel/commerce/types/product' +import type { CommercejsProduct } from '../types/product' +import { getProductSearchVariables } from '../utils/product-search' +import { normalizeProduct } from '../utils/normalize-product' + +export default useSearch as UseSearch + +export const handler: SWRHook = { + fetchOptions: { + query: 'products', + method: 'list', + }, + async fetcher({ input, options, fetch }) { + const { data, meta } = await fetch<{ + data: CommercejsProduct[] + meta: { + pagination: { + total: number + } + } + }>({ + query: options.query, + method: options.method, + variables: getProductSearchVariables(input), + }) + + const formattedProducts = + data?.map((product) => normalizeProduct(product)) || [] + + return { + products: formattedProducts, + found: meta.pagination.total > 0, + } + }, + useHook: + ({ useData }) => + (input = {}) => { + return useData({ + input: [ + ['search', input.search], + ['categoryId', input.categoryId], + ['brandId', input.brandId], + ['sort', input.sort], + ], + swrOptions: { + revalidateOnFocus: false, + ...input.swrOptions, + }, + }) + }, +} diff --git a/packages/commercejs/src/provider.ts b/packages/commercejs/src/provider.ts new file mode 100644 index 000000000..d596fa9b2 --- /dev/null +++ b/packages/commercejs/src/provider.ts @@ -0,0 +1,55 @@ +import { handler as useCart } from './cart/use-cart' +import { handler as useAddItem } from './cart/use-add-item' +import { handler as useUpdateItem } from './cart/use-update-item' +import { handler as useRemoveItem } from './cart/use-remove-item' + +import { handler as useCustomer } from './customer/use-customer' +import { handler as useSearch } from './product/use-search' + +import { handler as useLogin } from './auth/use-login' +import { handler as useLogout } from './auth/use-logout' +import { handler as useSignup } from './auth/use-signup' + +import { handler as useCheckout } from './checkout/use-checkout' +import { handler as useSubmitCheckout } from './checkout/use-submit-checkout' + +import { handler as useCards } from './customer/card/use-cards' +import { handler as useAddCardItem } from './customer/card/use-add-item' + +import { handler as useAddresses } from './customer/address/use-addresses' +import { handler as useAddAddressItem } from './customer/address/use-add-item' + +import { CART_COOKIE, CUSTOMER_COOKIE, LOCALE } from './constants' +import { default as sdkFetcher } from './fetcher' + +export const commercejsProvider = { + locale: LOCALE, + cartCookie: CART_COOKIE, + customerCookie: CUSTOMER_COOKIE, + fetcher: sdkFetcher, + cart: { + useCart, + useAddItem, + useUpdateItem, + useRemoveItem, + }, + checkout: { + useCheckout, + useSubmitCheckout, + }, + customer: { + useCustomer, + card: { + useCards, + useAddItem: useAddCardItem, + }, + address: { + useAddresses, + useAddItem: useAddAddressItem, + }, + }, + products: { useSearch }, + auth: { useLogin, useLogout, useSignup }, +} + +export type CommercejsProvider = typeof commercejsProvider diff --git a/packages/commercejs/src/types/cart.ts b/packages/commercejs/src/types/cart.ts new file mode 100644 index 000000000..9de68397b --- /dev/null +++ b/packages/commercejs/src/types/cart.ts @@ -0,0 +1,4 @@ +export * from '@vercel/commerce/types/cart' + +export type { Cart as CommercejsCart } from '@chec/commerce.js/types/cart' +export type { LineItem as CommercejsLineItem } from '@chec/commerce.js/types/line-item' diff --git a/packages/commercejs/src/types/checkout.ts b/packages/commercejs/src/types/checkout.ts new file mode 100644 index 000000000..970d5cfad --- /dev/null +++ b/packages/commercejs/src/types/checkout.ts @@ -0,0 +1,3 @@ +export * from '@vercel/commerce/types/checkout' + +export type { CheckoutCapture as CommercejsCheckoutCapture } from '@chec/commerce.js/types/checkout-capture' diff --git a/packages/commercejs/src/types/common.ts b/packages/commercejs/src/types/common.ts new file mode 100644 index 000000000..23b8daa11 --- /dev/null +++ b/packages/commercejs/src/types/common.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/common' diff --git a/packages/commercejs/src/types/customer.ts b/packages/commercejs/src/types/customer.ts new file mode 100644 index 000000000..c637055b9 --- /dev/null +++ b/packages/commercejs/src/types/customer.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/customer' diff --git a/framework/shopify/types/index.ts b/packages/commercejs/src/types/index.ts similarity index 100% rename from framework/shopify/types/index.ts rename to packages/commercejs/src/types/index.ts diff --git a/packages/commercejs/src/types/login.ts b/packages/commercejs/src/types/login.ts new file mode 100644 index 000000000..0706a2f1f --- /dev/null +++ b/packages/commercejs/src/types/login.ts @@ -0,0 +1,9 @@ +import { LoginBody, LoginTypes } from '@vercel/commerce/types/login' +export * from '@vercel/commerce/types/login' + +export type LoginHook = { + data: null + actionInput: LoginBody + fetcherInput: LoginBody + body: T['body'] +} diff --git a/packages/commercejs/src/types/logout.ts b/packages/commercejs/src/types/logout.ts new file mode 100644 index 000000000..1de06f8dc --- /dev/null +++ b/packages/commercejs/src/types/logout.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/logout' diff --git a/packages/commercejs/src/types/page.ts b/packages/commercejs/src/types/page.ts new file mode 100644 index 000000000..12f6b02d7 --- /dev/null +++ b/packages/commercejs/src/types/page.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/page' diff --git a/packages/commercejs/src/types/product.ts b/packages/commercejs/src/types/product.ts new file mode 100644 index 000000000..7cdab703e --- /dev/null +++ b/packages/commercejs/src/types/product.ts @@ -0,0 +1,4 @@ +export * from '@vercel/commerce/types/product' + +export type { Product as CommercejsProduct } from '@chec/commerce.js/types/product' +export type { Variant as CommercejsVariant } from '@chec/commerce.js/types/variant' diff --git a/packages/commercejs/src/types/signup.ts b/packages/commercejs/src/types/signup.ts new file mode 100644 index 000000000..3f0d1af5a --- /dev/null +++ b/packages/commercejs/src/types/signup.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/signup' diff --git a/packages/commercejs/src/types/site.ts b/packages/commercejs/src/types/site.ts new file mode 100644 index 000000000..346278b43 --- /dev/null +++ b/packages/commercejs/src/types/site.ts @@ -0,0 +1,3 @@ +export * from '@vercel/commerce/types/site' + +export type { Category as CommercejsCategory } from '@chec/commerce.js/types/category' diff --git a/packages/commercejs/src/types/wishlist.ts b/packages/commercejs/src/types/wishlist.ts new file mode 100644 index 000000000..af92d9f63 --- /dev/null +++ b/packages/commercejs/src/types/wishlist.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/wishlist' diff --git a/packages/commercejs/src/utils/get-deployment-url.ts b/packages/commercejs/src/utils/get-deployment-url.ts new file mode 100644 index 000000000..b0926abc7 --- /dev/null +++ b/packages/commercejs/src/utils/get-deployment-url.ts @@ -0,0 +1,12 @@ +export const getDeploymentUrl = () => { + // Custom environment variable. + if (process.env.NEXT_PUBLIC_COMMERCEJS_DEPLOYMENT_URL) { + return process.env.NEXT_PUBLIC_COMMERCEJS_DEPLOYMENT_URL + } + // Automatic Vercel deployment URL. + if (process.env.NEXT_PUBLIC_VERCEL_URL) { + return `https://${process.env.NEXT_PUBLIC_VERCEL_URL}` + } + // Assume local development. + return 'http://localhost:3000' +} diff --git a/packages/commercejs/src/utils/normalize-cart.ts b/packages/commercejs/src/utils/normalize-cart.ts new file mode 100644 index 000000000..c01ea6dea --- /dev/null +++ b/packages/commercejs/src/utils/normalize-cart.ts @@ -0,0 +1,74 @@ +import type { + Cart, + LineItem, + CommercejsCart, + CommercejsLineItem, +} from '../types/cart' + +type CommercejsLineItemType = CommercejsLineItem & { image: { url: string } } + +const normalizeLineItem = ( + commercejsLineItem: CommercejsLineItemType +): LineItem => { + const { + id, + sku, + quantity, + price, + product_id, + product_name, + permalink, + variant, + image, + selected_options, + } = commercejsLineItem + return { + id, + variantId: variant?.id ?? '', + productId: product_id, + name: product_name, + quantity, + discounts: [], + path: permalink, + options: selected_options?.map(({ group_name, option_name }) => ({ + name: group_name, + value: option_name, + })), + variant: { + id: variant?.id ?? id, + sku: variant?.sku ?? sku, + name: product_name, + requiresShipping: false, + price: variant?.price?.raw ?? price.raw, + listPrice: variant?.price?.raw ?? price.raw, + image: { + url: image?.url, + }, + }, + } +} + +export const normalizeCart = (commercejsCart: CommercejsCart): Cart => { + const { + id, + created, + subtotal: { raw: rawPrice }, + currency, + line_items, + } = commercejsCart + + return { + id, + createdAt: new Date(created * 1000).toISOString(), + currency: { + code: currency.code, + }, + taxesIncluded: false, + lineItems: line_items.map((item) => { + return normalizeLineItem(item as CommercejsLineItemType) + }), + lineItemsSubtotalPrice: rawPrice, + subtotalPrice: rawPrice, + totalPrice: rawPrice, + } +} diff --git a/packages/commercejs/src/utils/normalize-category.ts b/packages/commercejs/src/utils/normalize-category.ts new file mode 100644 index 000000000..41900928e --- /dev/null +++ b/packages/commercejs/src/utils/normalize-category.ts @@ -0,0 +1,14 @@ +import type { Category } from '@vercel/commerce/types/site' +import type { Category as CommercejsCategory } from '@chec/commerce.js/types/category' + +export function normalizeCategory( + commercejsCatgeory: CommercejsCategory +): Category { + const { id, name, slug } = commercejsCatgeory + return { + id, + name, + slug, + path: slug, + } +} diff --git a/packages/commercejs/src/utils/normalize-checkout.ts b/packages/commercejs/src/utils/normalize-checkout.ts new file mode 100644 index 000000000..db136e0b8 --- /dev/null +++ b/packages/commercejs/src/utils/normalize-checkout.ts @@ -0,0 +1,63 @@ +import type { CardFields } from '@vercel/commerce/types/customer/card' +import type { AddressFields } from '@vercel/commerce/types/customer/address' +import type { CommercejsCheckoutCapture } from '../types/checkout' + +/** + * Creates a checkout payload suitable for test checkouts. + * 1. Hard-codes the payment values for the Commerce.js test gateway. + * 2. Hard-codes the email until an email field exists on the checkout form. + * 3. Gets as much as much checkout info as possible from the checkout form, and uses fallback values. + */ +export function normalizeTestCheckout({ + paymentInfo, + shippingInfo, + shippingOption, +}: { + paymentInfo?: CardFields + shippingInfo?: AddressFields + shippingOption: string +}): CommercejsCheckoutCapture { + const firstName = + shippingInfo?.firstName || paymentInfo?.firstName || 'Nextjs' + const lastName = shippingInfo?.lastName || paymentInfo?.lastName || 'Commerce' + const fullName = `${firstName} ${lastName}` + const postalCode = shippingInfo?.zipCode || paymentInfo?.zipCode || '94103' + const street = + shippingInfo?.streetNumber || paymentInfo?.streetNumber || 'Test Street' + const townCity = shippingInfo?.city || paymentInfo?.city || 'Test Town' + + return { + payment: { + gateway: 'test_gateway', + card: { + number: '4242 4242 4242 4242', + expiry_month: '01', + expiry_year: '2024', + cvc: '123', + postal_zip_code: postalCode, + }, + }, + customer: { + email: 'nextcommerce@test.com', + firstname: firstName, + lastname: lastName, + }, + shipping: { + name: fullName, + street, + town_city: townCity, + country: 'US', + }, + billing: { + name: fullName, + street, + town_city: townCity, + postal_zip_code: postalCode, + county_state: 'California', + country: 'US', + }, + fulfillment: { + shipping_method: shippingOption, + }, + } +} diff --git a/packages/commercejs/src/utils/normalize-product.ts b/packages/commercejs/src/utils/normalize-product.ts new file mode 100644 index 000000000..86c42d922 --- /dev/null +++ b/packages/commercejs/src/utils/normalize-product.ts @@ -0,0 +1,77 @@ +import type { + Product, + CommercejsProduct, + CommercejsVariant, +} from '../types/product' + +function getOptionsFromVariantGroups( + variantGroups: CommercejsProduct['variant_groups'] +): Product['options'] { + const optionsFromVariantGroups = variantGroups.map( + ({ id, name: variantName, options }) => ({ + id, + displayName: variantName, + values: options.map(({ name: optionName }) => ({ + label: optionName, + })), + }) + ) + return optionsFromVariantGroups +} + +function normalizeVariants( + variants: Array = [], + variantGroups: CommercejsProduct['variant_groups'] +) { + if (!Array.isArray(variants)) return [] + return variants?.map((variant) => ({ + id: variant.id, + options: Object.entries(variant.options).map( + ([variantGroupId, variantOptionId]) => { + const variantGroupFromId = variantGroups.find( + (group) => group.id === variantGroupId + ) + const valueLabel = variantGroupFromId?.options.find( + (option) => option.id === variantOptionId + )?.name + + return { + id: variantOptionId, + displayName: variantGroupFromId?.name || '', + __typename: 'MultipleChoiceOption' as 'MultipleChoiceOption', + values: [ + { + label: valueLabel || '', + }, + ], + } + } + ), + })) +} + +export function normalizeProduct( + commercejsProduct: CommercejsProduct, + commercejsProductVariants: Array = [] +): Product { + const { id, name, description, permalink, assets, price, variant_groups } = + commercejsProduct + return { + id, + name, + description, + descriptionHtml: description, + slug: permalink, + path: permalink, + images: assets.map(({ url, description, filename }) => ({ + url, + alt: description || filename, + })), + price: { + value: price.raw, + currencyCode: 'USD', + }, + variants: normalizeVariants(commercejsProductVariants, variant_groups), + options: getOptionsFromVariantGroups(variant_groups), + } +} diff --git a/packages/commercejs/src/utils/product-search.ts b/packages/commercejs/src/utils/product-search.ts new file mode 100644 index 000000000..9a4d42982 --- /dev/null +++ b/packages/commercejs/src/utils/product-search.ts @@ -0,0 +1,54 @@ +import { SearchProductsBody } from '@vercel/commerce/types/product' + +const getFilterVariables = ({ + search, + categoryId, +}: { + search?: string + categoryId?: string | number +}) => { + let filterVariables: { [key: string]: any } = {} + if (search) { + filterVariables.query = search + } + if (categoryId) { + filterVariables['category_id'] = categoryId + } + return filterVariables +} + +const getSortVariables = ({ sort }: { sort?: string }) => { + let sortVariables: { [key: string]: any } = {} + switch (sort) { + case 'trending-desc': + case 'latest-desc': + sortVariables = { + sortBy: 'updated', + sortDirection: 'desc', + } + break + case 'price-asc': + sortVariables = { + sortBy: 'price', + sortDirection: 'asc', + } + break + case 'price-desc': + sortVariables = { + sortBy: 'price', + sortDirection: 'desc', + } + break + } + return sortVariables +} + +export const getProductSearchVariables = (input: SearchProductsBody) => { + const { search, categoryId, sort } = input + const filterVariables = getFilterVariables({ search, categoryId }) + const sortVariables = getSortVariables({ sort }) + return { + ...filterVariables, + ...sortVariables, + } +} diff --git a/framework/local/wishlist/use-add-item.tsx b/packages/commercejs/src/wishlist/use-add-item.tsx similarity index 100% rename from framework/local/wishlist/use-add-item.tsx rename to packages/commercejs/src/wishlist/use-add-item.tsx diff --git a/framework/local/wishlist/use-remove-item.tsx b/packages/commercejs/src/wishlist/use-remove-item.tsx similarity index 100% rename from framework/local/wishlist/use-remove-item.tsx rename to packages/commercejs/src/wishlist/use-remove-item.tsx diff --git a/packages/commercejs/src/wishlist/use-wishlist.tsx b/packages/commercejs/src/wishlist/use-wishlist.tsx new file mode 100644 index 000000000..781614394 --- /dev/null +++ b/packages/commercejs/src/wishlist/use-wishlist.tsx @@ -0,0 +1,40 @@ +import { HookFetcher } from '@vercel/commerce/utils/types' + +export type Wishlist = { + items: [ + { + product_id: number + variant_id: number + id: number + product: any + } + ] +} + +export interface UseWishlistOptions { + includeProducts?: boolean +} + +export interface UseWishlistInput extends UseWishlistOptions { + customerId?: number +} + +export const fetcher: HookFetcher = () => { + return null +} + +export function extendHook( + customFetcher: typeof fetcher, + // swrOptions?: SwrOptions + swrOptions?: any +) { + const useWishlist = ({ includeProducts }: UseWishlistOptions = {}) => { + return { data: null } + } + + useWishlist.extend = extendHook + + return useWishlist +} + +export default extendHook(fetcher) diff --git a/packages/commercejs/taskfile.js b/packages/commercejs/taskfile.js new file mode 100644 index 000000000..39b1b2a86 --- /dev/null +++ b/packages/commercejs/taskfile.js @@ -0,0 +1,20 @@ +export async function build(task, opts) { + await task + .source('src/**/*.+(ts|tsx|js)') + .swc({ dev: opts.dev, outDir: 'dist', baseUrl: 'src' }) + .target('dist') + .source('src/**/*.+(cjs|json)') + .target('dist') + task.$.log('Compiled src files') +} + +export async function release(task) { + await task.clear('dist').start('build') +} + +export default async function dev(task) { + const opts = { dev: true } + await task.clear('dist') + await task.start('build', opts) + await task.watch('src/**/*.+(ts|tsx|js|cjs|json)', 'build', opts) +} diff --git a/packages/commercejs/tsconfig.json b/packages/commercejs/tsconfig.json new file mode 100644 index 000000000..8f98f047b --- /dev/null +++ b/packages/commercejs/tsconfig.json @@ -0,0 +1,21 @@ +{ + "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, + "incremental": true, + "jsx": "react-jsx" + }, + "include": ["src", "global.d.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/kibocommerce/.env.template b/packages/kibocommerce/.env.template new file mode 100644 index 000000000..75cfe67ff --- /dev/null +++ b/packages/kibocommerce/.env.template @@ -0,0 +1,7 @@ +COMMERCE_PROVIDER=kibocommerce +KIBO_API_URL= +KIBO_CART_COOKIE= +KIBO_CUSTOMER_COOKIE= +KIBO_CLIENT_ID= +KIBO_SHARED_SECRET= +KIBO_AUTH_URL= diff --git a/packages/kibocommerce/.prettierignore b/packages/kibocommerce/.prettierignore new file mode 100644 index 000000000..f06235c46 --- /dev/null +++ b/packages/kibocommerce/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/kibocommerce/.prettierrc b/packages/kibocommerce/.prettierrc new file mode 100644 index 000000000..e1076edfa --- /dev/null +++ b/packages/kibocommerce/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/kibocommerce/README.md b/packages/kibocommerce/README.md new file mode 100644 index 000000000..13fa331d2 --- /dev/null +++ b/packages/kibocommerce/README.md @@ -0,0 +1,37 @@ +# Kibo Commerce Provider + +If you already have a Kibo Commerce account and want to use your current store, then copy the `.env.template` file in this directory to `.env.local` in the main directory (which will be ignored by Git): + +```bash +cp packages/kibocommerce/.env.template .env.local +``` + +Then, set the environment variables in `.env.local` to match the ones from your store. + +``` +COMMERCE_PROVIDER='kibocommerce' +KIBO_API_URL= 'https://t1234-s1234.sandbox.mozu.com/graphql' +KIBO_CART_COOKIE='kibo_cart' +KIBO_CUSTOMER_COOKIE='kibo_customer' +KIBO_CLIENT_ID='KIBO.APP.1.0.0.Release' +KIBO_SHARED_SECRET='12345secret' +KIBO_AUTH_URL='https://home.mozu.com' +``` + +- `KIBO_API_URL` - link to your Kibo Commerce GraphQL API instance. +- `KIBO_CART_COOKIE` - configurable cookie name for cart. +- `KIBO_CUSTOMER_COOKIE` - configurable cookie name for shopper identifier/authentication cookie +- `KIBO_CLIENT_ID` - Unique Application (Client) ID of your Application +- `KIBO_SHARED_SECRET` - Secret API key used to authenticate application/client id. + + +Your Kibo Client ID and Shared Secret can be found from your [Kibo eCommerce Dev Center](https://mozu.com/login) + +Visit [Kibo documentation](https://apidocs.kibong-perf.com/?spec=graphql#auth) for more details on API authentication + +Based on the config, this integration will handle Authenticating your application against the Kibo API using the Kibo Client ID and Kibo Shared Secret. +## Contribute + +Our commitment to Open Source can be found [here](https://vercel.com/oss). + +If you find an issue with the provider or want a new feature, feel free to open a PR or [create a new issue](https://github.com/vercel/commerce/issues). diff --git a/packages/kibocommerce/codegen.json b/packages/kibocommerce/codegen.json new file mode 100644 index 000000000..ede2d2f3b --- /dev/null +++ b/packages/kibocommerce/codegen.json @@ -0,0 +1,21 @@ +{ + "schema": { + "https://t17194-s21127.dev10.kubedev.kibo-dev.com/graphql": {} + }, + "generates": { + "./schema.d.ts": { + "plugins": ["typescript", "typescript-operations"], + "config": { + "scalars": { + "ID": "string" + } + } + }, + "./schema.graphql": { + "plugins": ["schema-ast"] + } + }, + "hooks": { + "afterAllFileWrite": ["prettier --write"] + } + } diff --git a/packages/kibocommerce/package.json b/packages/kibocommerce/package.json new file mode 100644 index 000000000..6d27b3804 --- /dev/null +++ b/packages/kibocommerce/package.json @@ -0,0 +1,85 @@ +{ + "name": "@vercel/commerce-kibocommerce", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "release": "taskr release", + "build": "taskr build", + "dev": "taskr", + "types": "tsc --emitDeclarationOnly", + "prettier-fix": "prettier --write .", + "generate": "graphql-codegen" + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], + "./next.config": "./dist/next.config.cjs" + }, + "typesVersions": { + "*": { + "*": [ + "src/*", + "src/*/index" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + }, + "files": [ + "dist", + "schema.d.ts" + ], + "publishConfig": { + "typesVersions": { + "*": { + "*": [ + "dist/*.d.ts", + "dist/*/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": { + "@graphql-codegen/cli": "^2.3.1", + "@graphql-codegen/schema-ast": "^2.4.1", + "@graphql-codegen/typescript": "^2.4.2", + "@graphql-codegen/typescript-operations": "^2.2.2", + "@taskr/clear": "^1.1.0", + "@taskr/esnext": "^1.1.0", + "@taskr/watch": "^1.1.0", + "@types/node": "^17.0.8", + "@types/react": "^17.0.38", + "lint-staged": "^12.1.7", + "next": "^12.0.8", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "taskr": "^1.1.0", + "taskr-swc": "^0.0.1", + "typescript": "^4.5.4" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,json}": [ + "prettier --write", + "git add" + ] + } +} diff --git a/packages/kibocommerce/schema.d.ts b/packages/kibocommerce/schema.d.ts new file mode 100644 index 000000000..cf52ddec9 --- /dev/null +++ b/packages/kibocommerce/schema.d.ts @@ -0,0 +1,11399 @@ +export type Maybe = T | null +export type Exact = { + [K in keyof T]: T[K] +} +export type MakeOptional = Omit & + { [SubKey in K]?: Maybe } +export type MakeMaybe = Omit & + { [SubKey in K]: Maybe } +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string + String: string + Boolean: boolean + Int: number + Float: number + /** The `AnyScalar` type allows any scalar value by examining the input and passing the serialize, parseValue, and parseLiteral operations to their respective types. */ + AnyScalar: any + /** DateTime custom scalar type */ + DateTime: any + /** Object custom scalar type */ + Object: any +} + +export type AccountPasswordInfoCollectionInput = { + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type AccountPasswordInfoInput = { + accountId: Scalars['Int'] + userId?: Maybe + unlockAccount?: Maybe + passwordInfo?: Maybe +} + +export type AccountSalesRep = { + __typename?: 'AccountSalesRep' + _get?: Maybe + _root?: Maybe + accountId: Scalars['Int'] + adminUserId?: Maybe +} + +export type AccountSalesRep_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type AccountSalesRepInput = { + accountId: Scalars['Int'] + adminUserId?: Maybe +} + +export type ActiveDateRange = { + __typename?: 'ActiveDateRange' + _get?: Maybe + _root?: Maybe + startDate?: Maybe + endDate?: Maybe +} + +export type ActiveDateRange_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ActiveDateRangeInput = { + startDate?: Maybe + endDate?: Maybe +} + +export type AddressValidationRequestInput = { + address?: Maybe +} + +export type AddressValidationResponse = { + __typename?: 'AddressValidationResponse' + _get?: Maybe + _root?: Maybe + addressCandidates?: Maybe>> +} + +export type AddressValidationResponse_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type Adjustment = { + __typename?: 'Adjustment' + _get?: Maybe + _root?: Maybe + amount?: Maybe + description?: Maybe + internalComment?: Maybe +} + +export type Adjustment_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type AdjustmentInput = { + amount?: Maybe + description?: Maybe + internalComment?: Maybe +} + +export type AppliedLineItemProductDiscount = { + __typename?: 'AppliedLineItemProductDiscount' + _get?: Maybe + _root?: Maybe + appliesToSalePrice?: Maybe + discountQuantity: Scalars['Int'] + productQuantity?: Maybe + impactPerUnit?: Maybe +} + +export type AppliedLineItemProductDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type AppliedLineItemProductDiscountInput = { + appliesToSalePrice?: Maybe + discountQuantity: Scalars['Int'] + productQuantity?: Maybe + impactPerUnit?: Maybe +} + +export type AppliedLineItemShippingDiscount = { + __typename?: 'AppliedLineItemShippingDiscount' + _get?: Maybe + _root?: Maybe + methodCode?: Maybe + discount?: Maybe + discountQuantity: Scalars['Int'] + impactPerUnit: Scalars['Float'] +} + +export type AppliedLineItemShippingDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type AppliedLineItemShippingDiscountInput = { + methodCode?: Maybe + discount?: Maybe + discountQuantity: Scalars['Int'] + impactPerUnit: Scalars['Float'] +} + +export type AttributeDetail = { + __typename?: 'AttributeDetail' + _get?: Maybe + _root?: Maybe + valueType?: Maybe + inputType?: Maybe + dataType?: Maybe + usageType?: Maybe + dataTypeSequence: Scalars['Int'] + name?: Maybe + description?: Maybe + validation?: Maybe + searchableInStorefront?: Maybe + searchDisplayValue?: Maybe + allowFilteringAndSortingInStorefront?: Maybe + indexValueWithCase?: Maybe + customWeightInStorefrontSearch?: Maybe + displayIntention?: Maybe +} + +export type AttributeDetail_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type AttributeVocabularyValueDisplayInfo = { + __typename?: 'AttributeVocabularyValueDisplayInfo' + _get?: Maybe + _root?: Maybe + cmsId?: Maybe + imageUrl?: Maybe + colorValue?: Maybe +} + +export type AttributeVocabularyValueDisplayInfo_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type AuditRecord = { + __typename?: 'AuditRecord' + _get?: Maybe + _root?: Maybe + id?: Maybe + changes?: Maybe>> + auditInfo?: Maybe +} + +export type AuditRecord_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type AuditRecordChange = { + __typename?: 'AuditRecordChange' + _get?: Maybe + _root?: Maybe + type?: Maybe + path?: Maybe + fields?: Maybe>> +} + +export type AuditRecordChange_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type AuditRecordChangeField = { + __typename?: 'AuditRecordChangeField' + _get?: Maybe + _root?: Maybe + name?: Maybe + oldValue?: Maybe + newValue?: Maybe +} + +export type AuditRecordChangeField_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type AuditRecordChangeFieldInput = { + name?: Maybe + oldValue?: Maybe + newValue?: Maybe +} + +export type AuditRecordChangeInput = { + type?: Maybe + path?: Maybe + fields?: Maybe>> +} + +export type AuditRecordInput = { + id?: Maybe + changes?: Maybe>> + auditInfo?: Maybe +} + +export type B2BAccount = { + __typename?: 'B2BAccount' + _get?: Maybe + _root?: Maybe + users?: Maybe>> + isActive?: Maybe + priceList?: Maybe + salesReps?: Maybe>> + rootAccountId?: Maybe + parentAccountId?: Maybe + approvalStatus?: Maybe + id: Scalars['Int'] + customerSet?: Maybe + commerceSummary?: Maybe + contacts?: Maybe>> + companyOrOrganization?: Maybe + notes?: Maybe>> + attributes?: Maybe>> + segments?: Maybe>> + taxId?: Maybe + externalId?: Maybe + auditInfo?: Maybe + customerSinceDate?: Maybe + accountType?: Maybe +} + +export type B2BAccount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type B2BAccountCollection = { + __typename?: 'B2BAccountCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type B2BAccountCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type B2BAccountInput = { + users?: Maybe>> + isActive?: Maybe + priceList?: Maybe + salesReps?: Maybe>> + rootAccountId?: Maybe + parentAccountId?: Maybe + approvalStatus?: Maybe + id: Scalars['Int'] + customerSet?: Maybe + commerceSummary?: Maybe + contacts?: Maybe>> + companyOrOrganization?: Maybe + notes?: Maybe>> + attributes?: Maybe>> + segments?: Maybe>> + taxId?: Maybe + externalId?: Maybe + auditInfo?: Maybe + customerSinceDate?: Maybe + accountType?: Maybe +} + +export type B2BUser = { + __typename?: 'B2BUser' + _get?: Maybe + _root?: Maybe + emailAddress?: Maybe + userName?: Maybe + firstName?: Maybe + lastName?: Maybe + localeCode?: Maybe + userId?: Maybe + roles?: Maybe>> + isLocked?: Maybe + isActive?: Maybe + isRemoved?: Maybe + acceptsMarketing?: Maybe + hasExternalPassword?: Maybe +} + +export type B2BUser_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type B2BUserAndAuthInfoInput = { + b2BUser?: Maybe + externalPassword?: Maybe + isImport?: Maybe +} + +export type B2BUserCollection = { + __typename?: 'B2BUserCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type B2BUserCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type B2BUserInput = { + emailAddress?: Maybe + userName?: Maybe + firstName?: Maybe + lastName?: Maybe + localeCode?: Maybe + userId?: Maybe + roles?: Maybe>> + isLocked?: Maybe + isActive?: Maybe + isRemoved?: Maybe + acceptsMarketing?: Maybe + hasExternalPassword?: Maybe +} + +export type BillingInfo = { + __typename?: 'BillingInfo' + _get?: Maybe + _root?: Maybe + paymentType?: Maybe + paymentWorkflow?: Maybe + billingContact?: Maybe + isSameBillingShippingAddress?: Maybe + card?: Maybe + token?: Maybe + purchaseOrder?: Maybe + check?: Maybe + auditInfo?: Maybe + storeCreditCode?: Maybe + storeCreditType?: Maybe + customCreditType?: Maybe + externalTransactionId?: Maybe + data?: Maybe +} + +export type BillingInfo_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type BillingInfoInput = { + paymentType?: Maybe + paymentWorkflow?: Maybe + billingContact?: Maybe + isSameBillingShippingAddress?: Maybe + card?: Maybe + token?: Maybe + purchaseOrder?: Maybe + check?: Maybe + auditInfo?: Maybe + storeCreditCode?: Maybe + storeCreditType?: Maybe + customCreditType?: Maybe + externalTransactionId?: Maybe + data?: Maybe +} + +export type BoxType = { + __typename?: 'BoxType' + _get?: Maybe + _root?: Maybe + name?: Maybe + height?: Maybe + width?: Maybe + length?: Maybe +} + +export type BoxType_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type BpmConfiguration = { + __typename?: 'BpmConfiguration' + _get?: Maybe + _root?: Maybe + shipmentType?: Maybe + workflowContainerId?: Maybe + workflowProcessId?: Maybe +} + +export type BpmConfiguration_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type BundledProductSummary = { + __typename?: 'BundledProductSummary' + _get?: Maybe + _root?: Maybe + productShortDescription?: Maybe + productName?: Maybe + productCode?: Maybe + goodsType?: Maybe + quantity: Scalars['Int'] + measurements?: Maybe + isPackagedStandAlone?: Maybe + inventoryInfo?: Maybe + optionAttributeFQN?: Maybe + optionValue?: Maybe + creditValue?: Maybe + productType?: Maybe +} + +export type BundledProductSummary_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export enum BundlingStrategyEnum { + ItemDependency = 'ITEM_DEPENDENCY', +} + +export type CancelReasonCollection = { + __typename?: 'CancelReasonCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CancelReasonCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CancelReasonItem = { + __typename?: 'CancelReasonItem' + _get?: Maybe + _root?: Maybe + reasonCode?: Maybe + name?: Maybe + needsMoreInfo?: Maybe +} + +export type CancelReasonItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CanceledItem = { + __typename?: 'CanceledItem' + _get?: Maybe + _root?: Maybe + canceledReason?: Maybe + auditInfo?: Maybe + lineId: Scalars['Int'] + originalOrderItemId?: Maybe + parentId?: Maybe + productCode?: Maybe + variationProductCode?: Maybe + optionAttributeFQN?: Maybe + name?: Maybe + fulfillmentLocationCode?: Maybe + imageUrl?: Maybe + isTaxable?: Maybe + quantity: Scalars['Int'] + unitPrice: Scalars['Float'] + actualPrice: Scalars['Float'] + overridePrice?: Maybe + itemDiscount: Scalars['Float'] + lineItemCost: Scalars['Float'] + itemTax: Scalars['Float'] + shipping: Scalars['Float'] + shippingDiscount: Scalars['Float'] + shippingTax: Scalars['Float'] + handling: Scalars['Float'] + handlingDiscount: Scalars['Float'] + handlingTax: Scalars['Float'] + duty: Scalars['Float'] + isPackagedStandAlone?: Maybe + readyForPickupQuantity?: Maybe + backorderReleaseDate?: Maybe + measurements?: Maybe + options?: Maybe>> + data?: Maybe + taxData?: Maybe + weightedShipmentAdjustment: Scalars['Float'] + weightedLineItemTaxAdjustment: Scalars['Float'] + weightedShippingAdjustment: Scalars['Float'] + weightedShippingTaxAdjustment: Scalars['Float'] + weightedHandlingAdjustment: Scalars['Float'] + weightedHandlingTaxAdjustment: Scalars['Float'] + weightedDutyAdjustment: Scalars['Float'] + taxableShipping: Scalars['Float'] + taxableLineItemCost: Scalars['Float'] + taxableHandling: Scalars['Float'] + fulfillmentFields?: Maybe>> + isAssemblyRequired?: Maybe + parentItemId?: Maybe + childItemIds?: Maybe> + giftCards?: Maybe>> +} + +export type CanceledItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CanceledItemInput = { + canceledReason?: Maybe + auditInfo?: Maybe + lineId: Scalars['Int'] + originalOrderItemId?: Maybe + parentId?: Maybe + productCode?: Maybe + variationProductCode?: Maybe + optionAttributeFQN?: Maybe + name?: Maybe + fulfillmentLocationCode?: Maybe + imageUrl?: Maybe + isTaxable?: Maybe + quantity: Scalars['Int'] + unitPrice: Scalars['Float'] + actualPrice: Scalars['Float'] + overridePrice?: Maybe + itemDiscount: Scalars['Float'] + lineItemCost: Scalars['Float'] + itemTax: Scalars['Float'] + shipping: Scalars['Float'] + shippingDiscount: Scalars['Float'] + shippingTax: Scalars['Float'] + handling: Scalars['Float'] + handlingDiscount: Scalars['Float'] + handlingTax: Scalars['Float'] + duty: Scalars['Float'] + isPackagedStandAlone?: Maybe + readyForPickupQuantity?: Maybe + backorderReleaseDate?: Maybe + measurements?: Maybe + options?: Maybe>> + data?: Maybe + taxData?: Maybe + weightedShipmentAdjustment: Scalars['Float'] + weightedLineItemTaxAdjustment: Scalars['Float'] + weightedShippingAdjustment: Scalars['Float'] + weightedShippingTaxAdjustment: Scalars['Float'] + weightedHandlingAdjustment: Scalars['Float'] + weightedHandlingTaxAdjustment: Scalars['Float'] + weightedDutyAdjustment: Scalars['Float'] + taxableShipping: Scalars['Float'] + taxableLineItemCost: Scalars['Float'] + taxableHandling: Scalars['Float'] + fulfillmentFields?: Maybe>> + isAssemblyRequired?: Maybe + parentItemId?: Maybe + childItemIds?: Maybe> + giftCards?: Maybe>> +} + +export type CanceledReason = { + __typename?: 'CanceledReason' + _get?: Maybe + _root?: Maybe + reasonCode?: Maybe + description?: Maybe + moreInfo?: Maybe +} + +export type CanceledReason_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CanceledReasonInput = { + reasonCode?: Maybe + description?: Maybe + moreInfo?: Maybe +} + +export type CapturableShipmentSummary = { + __typename?: 'CapturableShipmentSummary' + _get?: Maybe + _root?: Maybe + shipmentNumber: Scalars['Int'] + shipmentTotal: Scalars['Float'] + amountApplied: Scalars['Float'] +} + +export type CapturableShipmentSummary_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CapturableShipmentSummaryInput = { + shipmentNumber: Scalars['Int'] + shipmentTotal: Scalars['Float'] + amountApplied: Scalars['Float'] +} + +export type Card = { + __typename?: 'Card' + _get?: Maybe + _root?: Maybe + id?: Maybe + nameOnCard?: Maybe + cardType?: Maybe + expireMonth?: Maybe + expireYear?: Maybe + cardNumberPart?: Maybe + contactId: Scalars['Int'] + isDefaultPayMethod?: Maybe +} + +export type Card_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CardCollection = { + __typename?: 'CardCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CardCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CardInput = { + id?: Maybe + nameOnCard?: Maybe + cardType?: Maybe + expireMonth?: Maybe + expireYear?: Maybe + cardNumberPart?: Maybe + contactId: Scalars['Int'] + isDefaultPayMethod?: Maybe +} + +export type Carrier = { + __typename?: 'Carrier' + _get?: Maybe + _root?: Maybe + carrierType?: Maybe + isEnabled?: Maybe + shippingMethodMappings?: Maybe +} + +export type Carrier_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CarrierServiceGenerateLabelResponse = { + __typename?: 'CarrierServiceGenerateLabelResponse' + _get?: Maybe + _root?: Maybe + imageURL?: Maybe + integratorId?: Maybe + price?: Maybe + trackingNumber?: Maybe +} + +export type CarrierServiceGenerateLabelResponse_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type Cart = { + __typename?: 'Cart' + _get?: Maybe + _root?: Maybe + items?: Maybe>> + couponCodes?: Maybe> + invalidCoupons?: Maybe>> + priceListCode?: Maybe + cartMessage?: Maybe + cartMessages?: Maybe>> + handlingAmount?: Maybe + handlingSubTotal?: Maybe + handlingTotal?: Maybe + userId?: Maybe + id?: Maybe + tenantId?: Maybe + siteId?: Maybe + channelCode?: Maybe + currencyCode?: Maybe + visitId?: Maybe + webSessionId?: Maybe + customerInteractionType?: Maybe + fulfillmentInfo?: Maybe + orderDiscounts?: Maybe>> + suggestedDiscounts?: Maybe>> + rejectedDiscounts?: Maybe>> + data?: Maybe + taxData?: Maybe + subtotal?: Maybe + discountedSubtotal?: Maybe + discountTotal?: Maybe + discountedTotal?: Maybe + shippingTotal?: Maybe + shippingSubTotal?: Maybe + shippingTaxTotal?: Maybe + handlingTaxTotal?: Maybe + itemTaxTotal?: Maybe + taxTotal?: Maybe + feeTotal?: Maybe + total?: Maybe + lineItemSubtotalWithOrderAdjustments?: Maybe + shippingAmountBeforeDiscountsAndAdjustments?: Maybe + lastValidationDate?: Maybe + expirationDate?: Maybe + changeMessages?: Maybe>> + extendedProperties?: Maybe>> + discountThresholdMessages?: Maybe>> + auditInfo?: Maybe +} + +export type Cart_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CartChangeMessageCollection = { + __typename?: 'CartChangeMessageCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CartChangeMessageCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CartInput = { + items?: Maybe>> + couponCodes?: Maybe> + invalidCoupons?: Maybe>> + priceListCode?: Maybe + cartMessage?: Maybe + cartMessages?: Maybe>> + handlingAmount?: Maybe + handlingSubTotal?: Maybe + handlingTotal?: Maybe + userId?: Maybe + id?: Maybe + tenantId?: Maybe + siteId?: Maybe + channelCode?: Maybe + currencyCode?: Maybe + visitId?: Maybe + webSessionId?: Maybe + customerInteractionType?: Maybe + fulfillmentInfo?: Maybe + orderDiscounts?: Maybe>> + suggestedDiscounts?: Maybe>> + rejectedDiscounts?: Maybe>> + data?: Maybe + taxData?: Maybe + subtotal?: Maybe + discountedSubtotal?: Maybe + discountTotal?: Maybe + discountedTotal?: Maybe + shippingTotal?: Maybe + shippingSubTotal?: Maybe + shippingTaxTotal?: Maybe + handlingTaxTotal?: Maybe + itemTaxTotal?: Maybe + taxTotal?: Maybe + feeTotal?: Maybe + total?: Maybe + lineItemSubtotalWithOrderAdjustments?: Maybe + shippingAmountBeforeDiscountsAndAdjustments?: Maybe + lastValidationDate?: Maybe + expirationDate?: Maybe + changeMessages?: Maybe>> + extendedProperties?: Maybe>> + discountThresholdMessages?: Maybe>> + auditInfo?: Maybe +} + +export type CartItem = { + __typename?: 'CartItem' + _get?: Maybe + _root?: Maybe + id?: Maybe + fulfillmentLocationCode?: Maybe + fulfillmentMethod?: Maybe + localeCode?: Maybe + purchaseLocation?: Maybe + lineId?: Maybe + product?: Maybe + quantity: Scalars['Int'] + isRecurring?: Maybe + isTaxable?: Maybe + subtotal?: Maybe + extendedTotal?: Maybe + taxableTotal?: Maybe + discountTotal?: Maybe + discountedTotal?: Maybe + itemTaxTotal?: Maybe + shippingTaxTotal?: Maybe + shippingTotal?: Maybe + handlingAmount?: Maybe + feeTotal?: Maybe + total?: Maybe + unitPrice?: Maybe + productDiscount?: Maybe + productDiscounts?: Maybe>> + shippingDiscounts?: Maybe>> + data?: Maybe + taxData?: Maybe + auditInfo?: Maybe + shippingAmountBeforeDiscountsAndAdjustments?: Maybe + weightedOrderAdjustment?: Maybe + weightedOrderDiscount?: Maybe + adjustedLineItemSubtotal?: Maybe + totalWithoutWeightedShippingAndHandling?: Maybe + weightedOrderTax?: Maybe + weightedOrderShipping?: Maybe + weightedOrderShippingDiscount?: Maybe + weightedOrderShippingManualAdjustment?: Maybe + weightedOrderShippingTax?: Maybe + weightedOrderHandlingFee?: Maybe + weightedOrderHandlingFeeTax?: Maybe + weightedOrderHandlingFeeDiscount?: Maybe + weightedOrderDuty?: Maybe + totalWithWeightedShippingAndHandling?: Maybe + weightedOrderHandlingAdjustment?: Maybe + autoAddDiscountId?: Maybe + isAssemblyRequired?: Maybe + childItemIds?: Maybe> + parentItemId?: Maybe +} + +export type CartItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CartItemCollection = { + __typename?: 'CartItemCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CartItemCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CartItemInput = { + id?: Maybe + fulfillmentLocationCode?: Maybe + fulfillmentMethod?: Maybe + localeCode?: Maybe + purchaseLocation?: Maybe + lineId?: Maybe + product?: Maybe + quantity: Scalars['Int'] + isRecurring?: Maybe + isTaxable?: Maybe + subtotal?: Maybe + extendedTotal?: Maybe + taxableTotal?: Maybe + discountTotal?: Maybe + discountedTotal?: Maybe + itemTaxTotal?: Maybe + shippingTaxTotal?: Maybe + shippingTotal?: Maybe + handlingAmount?: Maybe + feeTotal?: Maybe + total?: Maybe + unitPrice?: Maybe + productDiscount?: Maybe + productDiscounts?: Maybe>> + shippingDiscounts?: Maybe>> + data?: Maybe + taxData?: Maybe + auditInfo?: Maybe + shippingAmountBeforeDiscountsAndAdjustments?: Maybe + weightedOrderAdjustment?: Maybe + weightedOrderDiscount?: Maybe + adjustedLineItemSubtotal?: Maybe + totalWithoutWeightedShippingAndHandling?: Maybe + weightedOrderTax?: Maybe + weightedOrderShipping?: Maybe + weightedOrderShippingDiscount?: Maybe + weightedOrderShippingManualAdjustment?: Maybe + weightedOrderShippingTax?: Maybe + weightedOrderHandlingFee?: Maybe + weightedOrderHandlingFeeTax?: Maybe + weightedOrderHandlingFeeDiscount?: Maybe + weightedOrderDuty?: Maybe + totalWithWeightedShippingAndHandling?: Maybe + weightedOrderHandlingAdjustment?: Maybe + autoAddDiscountId?: Maybe + isAssemblyRequired?: Maybe + childItemIds?: Maybe> + parentItemId?: Maybe +} + +export type CartMessage = { + __typename?: 'CartMessage' + _get?: Maybe + _root?: Maybe + message?: Maybe + messageType?: Maybe + productsRemoved?: Maybe>> +} + +export type CartMessage_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CartMessageInput = { + message?: Maybe + messageType?: Maybe + productsRemoved?: Maybe>> +} + +export type CartSummary = { + __typename?: 'CartSummary' + _get?: Maybe + _root?: Maybe + itemCount?: Maybe + totalQuantity?: Maybe + total?: Maybe + isExpired?: Maybe + hasActiveCart?: Maybe +} + +export type CartSummary_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CategoryCollection = { + __typename?: 'CategoryCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CategoryCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CategoryContent = { + __typename?: 'CategoryContent' + _get?: Maybe + _root?: Maybe + categoryImages?: Maybe>> + name?: Maybe + description?: Maybe + pageTitle?: Maybe + metaTagTitle?: Maybe + metaTagDescription?: Maybe + metaTagKeywords?: Maybe + slug?: Maybe +} + +export type CategoryContent_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CategoryImage = { + __typename?: 'CategoryImage' + _get?: Maybe + _root?: Maybe + imageLabel?: Maybe + altText?: Maybe + imageUrl?: Maybe + cmsId?: Maybe + videoUrl?: Maybe + mediaType?: Maybe + sequence?: Maybe +} + +export type CategoryImage_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CategoryPagedCollection = { + __typename?: 'CategoryPagedCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CategoryPagedCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ChangeMessage = { + __typename?: 'ChangeMessage' + _get?: Maybe + _root?: Maybe + id?: Maybe + correlationId?: Maybe + userId?: Maybe + userFirstName?: Maybe + userLastName?: Maybe + userScopeType?: Maybe + appId?: Maybe + appKey?: Maybe + appName?: Maybe + subjectType?: Maybe + success?: Maybe + identifier?: Maybe + subject?: Maybe + verb?: Maybe + message?: Maybe + metadata?: Maybe + oldValue?: Maybe + newValue?: Maybe + amount?: Maybe + createDate?: Maybe +} + +export type ChangeMessage_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ChangeMessageInput = { + id?: Maybe + correlationId?: Maybe + userId?: Maybe + userFirstName?: Maybe + userLastName?: Maybe + userScopeType?: Maybe + appId?: Maybe + appKey?: Maybe + appName?: Maybe + subjectType?: Maybe + success?: Maybe + identifier?: Maybe + subject?: Maybe + verb?: Maybe + message?: Maybe + metadata?: Maybe + oldValue?: Maybe + newValue?: Maybe + amount?: Maybe + createDate?: Maybe +} + +export type ChangePasswordResult = { + __typename?: 'ChangePasswordResult' + _get?: Maybe + _root?: Maybe + accountId: Scalars['Int'] + succeeded?: Maybe + errorMessage?: Maybe +} + +export type ChangePasswordResult_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ChangePasswordResultCollection = { + __typename?: 'ChangePasswordResultCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type ChangePasswordResultCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type Channel = { + __typename?: 'Channel' + _get?: Maybe + _root?: Maybe + tenantId: Scalars['Int'] + code?: Maybe + name?: Maybe + region?: Maybe + countryCode?: Maybe + groupCode?: Maybe + siteIds?: Maybe> + auditInfo?: Maybe +} + +export type Channel_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ChannelCollection = { + __typename?: 'ChannelCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type ChannelCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ChannelGroup = { + __typename?: 'ChannelGroup' + _get?: Maybe + _root?: Maybe + tenantId: Scalars['Int'] + code?: Maybe + name?: Maybe + auditInfo?: Maybe +} + +export type ChannelGroup_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ChannelGroupCollection = { + __typename?: 'ChannelGroupCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type ChannelGroupCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ChannelGroupInput = { + tenantId: Scalars['Int'] + code?: Maybe + name?: Maybe + auditInfo?: Maybe +} + +export type ChannelInput = { + tenantId: Scalars['Int'] + code?: Maybe + name?: Maybe + region?: Maybe + countryCode?: Maybe + groupCode?: Maybe + siteIds?: Maybe> + auditInfo?: Maybe +} + +export type CheckPayment = { + __typename?: 'CheckPayment' + _get?: Maybe + _root?: Maybe + checkNumber?: Maybe +} + +export type CheckPayment_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CheckPaymentInput = { + checkNumber?: Maybe +} + +export type Checkout = { + __typename?: 'Checkout' + _get?: Maybe + _root?: Maybe + id?: Maybe + siteId: Scalars['Int'] + tenantId: Scalars['Int'] + number?: Maybe + originalCartId?: Maybe + submittedDate?: Maybe + type?: Maybe + items?: Maybe>> + groupings?: Maybe>> + auditInfo?: Maybe + destinations?: Maybe>> + payments?: Maybe>> + amountRemainingForPayment: Scalars['Float'] + acceptsMarketing?: Maybe + customerAccountId?: Maybe + email?: Maybe + customerTaxId?: Maybe + isTaxExempt?: Maybe + currencyCode?: Maybe + priceListCode?: Maybe + attributes?: Maybe>> + shopperNotes?: Maybe + availableActions?: Maybe> + data?: Maybe + taxData?: Maybe + channelCode?: Maybe + locationCode?: Maybe + ipAddress?: Maybe + sourceDevice?: Maybe + visitId?: Maybe + webSessionId?: Maybe + customerInteractionType?: Maybe + orderDiscounts?: Maybe>> + couponCodes?: Maybe> + invalidCoupons?: Maybe>> + suggestedDiscounts?: Maybe>> + discountThresholdMessages?: Maybe>> + dutyTotal?: Maybe + feeTotal: Scalars['Float'] + subTotal: Scalars['Float'] + itemLevelProductDiscountTotal: Scalars['Float'] + orderLevelProductDiscountTotal: Scalars['Float'] + itemTaxTotal: Scalars['Float'] + itemTotal: Scalars['Float'] + shippingSubTotal: Scalars['Float'] + itemLevelShippingDiscountTotal: Scalars['Float'] + orderLevelShippingDiscountTotal: Scalars['Float'] + shippingTaxTotal: Scalars['Float'] + shippingTotal: Scalars['Float'] + handlingSubTotal: Scalars['Float'] + itemLevelHandlingDiscountTotal: Scalars['Float'] + orderLevelHandlingDiscountTotal: Scalars['Float'] + handlingTaxTotal: Scalars['Float'] + handlingTotal: Scalars['Float'] + total: Scalars['Float'] +} + +export type Checkout_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CheckoutActionInput = { + actionName?: Maybe +} + +export type CheckoutCollection = { + __typename?: 'CheckoutCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CheckoutCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CheckoutGroupRates = { + __typename?: 'CheckoutGroupRates' + _get?: Maybe + _root?: Maybe + groupingId?: Maybe + shippingRates?: Maybe>> +} + +export type CheckoutGroupRates_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CheckoutGroupShippingMethodInput = { + groupingId?: Maybe + shippingRate?: Maybe +} + +export type CheckoutGrouping = { + __typename?: 'CheckoutGrouping' + _get?: Maybe + _root?: Maybe + id?: Maybe + destinationId?: Maybe + fulfillmentMethod?: Maybe + orderItemIds?: Maybe> + shippingMethodCode?: Maybe + shippingMethodName?: Maybe + standaloneGroup?: Maybe + shippingDiscounts?: Maybe>> + handlingDiscounts?: Maybe>> + dutyAmount?: Maybe + dutyTotal: Scalars['Float'] + shippingAmount?: Maybe + shippingSubTotal: Scalars['Float'] + itemLevelShippingDiscountTotal: Scalars['Float'] + orderLevelShippingDiscountTotal: Scalars['Float'] + shippingTax?: Maybe + shippingTaxTotal: Scalars['Float'] + shippingTotal: Scalars['Float'] + handlingAmount?: Maybe + handlingSubTotal: Scalars['Float'] + itemLevelHandlingDiscountTotal: Scalars['Float'] + orderLevelHandlingDiscountTotal: Scalars['Float'] + handlingTax?: Maybe + handlingTaxTotal: Scalars['Float'] + handlingTotal: Scalars['Float'] + taxData?: Maybe +} + +export type CheckoutGrouping_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CheckoutGroupingInput = { + id?: Maybe + destinationId?: Maybe + fulfillmentMethod?: Maybe + orderItemIds?: Maybe> + shippingMethodCode?: Maybe + shippingMethodName?: Maybe + standaloneGroup?: Maybe + shippingDiscounts?: Maybe>> + handlingDiscounts?: Maybe>> + dutyAmount?: Maybe + dutyTotal: Scalars['Float'] + shippingAmount?: Maybe + shippingSubTotal: Scalars['Float'] + itemLevelShippingDiscountTotal: Scalars['Float'] + orderLevelShippingDiscountTotal: Scalars['Float'] + shippingTax?: Maybe + shippingTaxTotal: Scalars['Float'] + shippingTotal: Scalars['Float'] + handlingAmount?: Maybe + handlingSubTotal: Scalars['Float'] + itemLevelHandlingDiscountTotal: Scalars['Float'] + orderLevelHandlingDiscountTotal: Scalars['Float'] + handlingTax?: Maybe + handlingTaxTotal: Scalars['Float'] + handlingTotal: Scalars['Float'] + taxData?: Maybe +} + +export type CheckoutInput = { + id?: Maybe + siteId: Scalars['Int'] + tenantId: Scalars['Int'] + number?: Maybe + originalCartId?: Maybe + submittedDate?: Maybe + type?: Maybe + items?: Maybe>> + groupings?: Maybe>> + auditInfo?: Maybe + destinations?: Maybe>> + payments?: Maybe>> + amountRemainingForPayment: Scalars['Float'] + acceptsMarketing?: Maybe + customerAccountId?: Maybe + email?: Maybe + customerTaxId?: Maybe + isTaxExempt?: Maybe + currencyCode?: Maybe + priceListCode?: Maybe + attributes?: Maybe>> + shopperNotes?: Maybe + availableActions?: Maybe> + data?: Maybe + taxData?: Maybe + channelCode?: Maybe + locationCode?: Maybe + ipAddress?: Maybe + sourceDevice?: Maybe + visitId?: Maybe + webSessionId?: Maybe + customerInteractionType?: Maybe + orderDiscounts?: Maybe>> + couponCodes?: Maybe> + invalidCoupons?: Maybe>> + suggestedDiscounts?: Maybe>> + discountThresholdMessages?: Maybe>> + dutyTotal?: Maybe + feeTotal: Scalars['Float'] + subTotal: Scalars['Float'] + itemLevelProductDiscountTotal: Scalars['Float'] + orderLevelProductDiscountTotal: Scalars['Float'] + itemTaxTotal: Scalars['Float'] + itemTotal: Scalars['Float'] + shippingSubTotal: Scalars['Float'] + itemLevelShippingDiscountTotal: Scalars['Float'] + orderLevelShippingDiscountTotal: Scalars['Float'] + shippingTaxTotal: Scalars['Float'] + shippingTotal: Scalars['Float'] + handlingSubTotal: Scalars['Float'] + itemLevelHandlingDiscountTotal: Scalars['Float'] + orderLevelHandlingDiscountTotal: Scalars['Float'] + handlingTaxTotal: Scalars['Float'] + handlingTotal: Scalars['Float'] + total: Scalars['Float'] +} + +export type CoHttpContentInput = { + headers?: Maybe>> +} + +export type CoHttpMethodInput = { + method?: Maybe +} + +export type CoHttpRequestMessageInput = { + version?: Maybe + content?: Maybe + method?: Maybe + requestUri?: Maybe + headers?: Maybe>> + properties?: Maybe +} + +export type CommerceSummary = { + __typename?: 'CommerceSummary' + _get?: Maybe + _root?: Maybe + totalOrderAmount?: Maybe + orderCount: Scalars['Int'] + lastOrderDate?: Maybe + wishlistCount: Scalars['Int'] + visitsCount: Scalars['Int'] +} + +export type CommerceSummary_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CommerceSummaryInput = { + totalOrderAmount?: Maybe + orderCount: Scalars['Int'] + lastOrderDate?: Maybe + wishlistCount: Scalars['Int'] + visitsCount: Scalars['Int'] +} + +export type CommerceUnitPrice = { + __typename?: 'CommerceUnitPrice' + _get?: Maybe + _root?: Maybe + extendedAmount?: Maybe + listAmount?: Maybe + saleAmount?: Maybe + overrideAmount?: Maybe +} + +export type CommerceUnitPrice_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CommerceUnitPriceInput = { + extendedAmount?: Maybe + listAmount?: Maybe + saleAmount?: Maybe + overrideAmount?: Maybe +} + +export type ConfiguredProduct = { + __typename?: 'ConfiguredProduct' + _get?: Maybe + _root?: Maybe + productCode?: Maybe + purchaseLocation?: Maybe + fulfillmentTypesSupported?: Maybe> + variationProductCode?: Maybe + upc?: Maybe + mfgPartNumber?: Maybe + purchasableState?: Maybe + priceRange?: Maybe + volumePriceBands?: Maybe>> + volumePriceRange?: Maybe + price?: Maybe + availableShippingDiscounts?: Maybe>> + measurements?: Maybe + inventoryInfo?: Maybe + options?: Maybe>> + properties?: Maybe>> + priceListEntryTypeProperty?: Maybe + productImages?: Maybe>> +} + +export type ConfiguredProduct_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type Contact = { + __typename?: 'Contact' + _get?: Maybe + _root?: Maybe + id?: Maybe + email?: Maybe + firstName?: Maybe + middleNameOrInitial?: Maybe + lastNameOrSurname?: Maybe + companyOrOrganization?: Maybe + phoneNumbers?: Maybe + address?: Maybe +} + +export type Contact_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ContactInput = { + id?: Maybe + email?: Maybe + firstName?: Maybe + middleNameOrInitial?: Maybe + lastNameOrSurname?: Maybe + companyOrOrganization?: Maybe + phoneNumbers?: Maybe + address?: Maybe +} + +export type ContactType = { + __typename?: 'ContactType' + _get?: Maybe + _root?: Maybe + name?: Maybe + isPrimary?: Maybe +} + +export type ContactType_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ContactTypeInput = { + name?: Maybe + isPrimary?: Maybe +} + +export type Coordinates = { + __typename?: 'Coordinates' + _get?: Maybe + _root?: Maybe + lat: Scalars['Float'] + lng: Scalars['Float'] +} + +export type Coordinates_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CoordinatesInput = { + lat: Scalars['Float'] + lng: Scalars['Float'] +} + +export type CrAddress = { + __typename?: 'CrAddress' + _get?: Maybe + _root?: Maybe + address1?: Maybe + address2?: Maybe + address3?: Maybe + address4?: Maybe + cityOrTown?: Maybe + stateOrProvince?: Maybe + postalOrZipCode?: Maybe + countryCode?: Maybe + addressType?: Maybe + isValidated?: Maybe +} + +export type CrAddress_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrAddressInput = { + address1?: Maybe + address2?: Maybe + address3?: Maybe + address4?: Maybe + cityOrTown?: Maybe + stateOrProvince?: Maybe + postalOrZipCode?: Maybe + countryCode?: Maybe + addressType?: Maybe + isValidated?: Maybe +} + +export type CrAppliedDiscount = { + __typename?: 'CrAppliedDiscount' + _get?: Maybe + _root?: Maybe + impact?: Maybe + discount?: Maybe + couponCode?: Maybe + excluded?: Maybe +} + +export type CrAppliedDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrAppliedDiscountInput = { + impact?: Maybe + discount?: Maybe + couponCode?: Maybe + excluded?: Maybe +} + +export type CrAuditInfo = { + __typename?: 'CrAuditInfo' + _get?: Maybe + _root?: Maybe + updateDate?: Maybe + createDate?: Maybe + updateBy?: Maybe + createBy?: Maybe +} + +export type CrAuditInfo_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrAuditInfoInput = { + updateDate?: Maybe + createDate?: Maybe + updateBy?: Maybe + createBy?: Maybe +} + +export type CrBundledProduct = { + __typename?: 'CrBundledProduct' + _get?: Maybe + _root?: Maybe + quantity: Scalars['Int'] + optionAttributeFQN?: Maybe + optionValue?: Maybe + creditValue?: Maybe + deltaPrice?: Maybe + productCode?: Maybe + name?: Maybe + description?: Maybe + goodsType?: Maybe + isPackagedStandAlone?: Maybe + stock?: Maybe + productReservationId?: Maybe + allocationId?: Maybe + allocationExpiration?: Maybe + measurements?: Maybe + fulfillmentStatus?: Maybe +} + +export type CrBundledProduct_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrBundledProductInput = { + quantity: Scalars['Int'] + optionAttributeFQN?: Maybe + optionValue?: Maybe + creditValue?: Maybe + deltaPrice?: Maybe + productCode?: Maybe + name?: Maybe + description?: Maybe + goodsType?: Maybe + isPackagedStandAlone?: Maybe + stock?: Maybe + productReservationId?: Maybe + allocationId?: Maybe + allocationExpiration?: Maybe + measurements?: Maybe + fulfillmentStatus?: Maybe +} + +export type CrCategory = { + __typename?: 'CrCategory' + _get?: Maybe + _root?: Maybe + id?: Maybe + parent?: Maybe +} + +export type CrCategory_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrCategoryInput = { + id?: Maybe + parent?: Maybe +} + +export type CrDiscount = { + __typename?: 'CrDiscount' + _get?: Maybe + _root?: Maybe + id: Scalars['Int'] + name?: Maybe + itemIds?: Maybe> + expirationDate?: Maybe + hasMultipleTargetProducts?: Maybe +} + +export type CrDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrDiscountInput = { + id: Scalars['Int'] + name?: Maybe + itemIds?: Maybe> + expirationDate?: Maybe + hasMultipleTargetProducts?: Maybe +} + +export type CrMeasurement = { + __typename?: 'CrMeasurement' + _get?: Maybe + _root?: Maybe + unit?: Maybe + value?: Maybe +} + +export type CrMeasurement_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrMeasurementInput = { + unit?: Maybe + value?: Maybe +} + +export type CrOrderItem = { + __typename?: 'CrOrderItem' + _get?: Maybe + _root?: Maybe + id?: Maybe + destinationId?: Maybe + originalCartItemId?: Maybe + fulfillmentLocationCode?: Maybe + fulfillmentMethod?: Maybe + dutyAmount?: Maybe + expectedDeliveryDate?: Maybe + localeCode?: Maybe + purchaseLocation?: Maybe + lineId?: Maybe + product?: Maybe + quantity: Scalars['Int'] + isRecurring?: Maybe + isTaxable?: Maybe + subtotal?: Maybe + extendedTotal?: Maybe + taxableTotal?: Maybe + discountTotal?: Maybe + discountedTotal?: Maybe + itemTaxTotal?: Maybe + shippingTaxTotal?: Maybe + shippingTotal?: Maybe + handlingAmount?: Maybe + feeTotal?: Maybe + total?: Maybe + unitPrice?: Maybe + productDiscount?: Maybe + productDiscounts?: Maybe>> + shippingDiscounts?: Maybe>> + data?: Maybe + taxData?: Maybe + auditInfo?: Maybe + shippingAmountBeforeDiscountsAndAdjustments?: Maybe + weightedOrderAdjustment?: Maybe + weightedOrderDiscount?: Maybe + adjustedLineItemSubtotal?: Maybe + totalWithoutWeightedShippingAndHandling?: Maybe + weightedOrderTax?: Maybe + weightedOrderShipping?: Maybe + weightedOrderShippingDiscount?: Maybe + weightedOrderShippingManualAdjustment?: Maybe + weightedOrderShippingTax?: Maybe + weightedOrderHandlingFee?: Maybe + weightedOrderHandlingFeeTax?: Maybe + weightedOrderHandlingFeeDiscount?: Maybe + weightedOrderDuty?: Maybe + totalWithWeightedShippingAndHandling?: Maybe + weightedOrderHandlingAdjustment?: Maybe + autoAddDiscountId?: Maybe + isAssemblyRequired?: Maybe + childItemIds?: Maybe> + parentItemId?: Maybe +} + +export type CrOrderItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrOrderItemInput = { + id?: Maybe + destinationId?: Maybe + originalCartItemId?: Maybe + fulfillmentLocationCode?: Maybe + fulfillmentMethod?: Maybe + dutyAmount?: Maybe + expectedDeliveryDate?: Maybe + localeCode?: Maybe + purchaseLocation?: Maybe + lineId?: Maybe + product?: Maybe + quantity: Scalars['Int'] + isRecurring?: Maybe + isTaxable?: Maybe + subtotal?: Maybe + extendedTotal?: Maybe + taxableTotal?: Maybe + discountTotal?: Maybe + discountedTotal?: Maybe + itemTaxTotal?: Maybe + shippingTaxTotal?: Maybe + shippingTotal?: Maybe + handlingAmount?: Maybe + feeTotal?: Maybe + total?: Maybe + unitPrice?: Maybe + productDiscount?: Maybe + productDiscounts?: Maybe>> + shippingDiscounts?: Maybe>> + data?: Maybe + taxData?: Maybe + auditInfo?: Maybe + shippingAmountBeforeDiscountsAndAdjustments?: Maybe + weightedOrderAdjustment?: Maybe + weightedOrderDiscount?: Maybe + adjustedLineItemSubtotal?: Maybe + totalWithoutWeightedShippingAndHandling?: Maybe + weightedOrderTax?: Maybe + weightedOrderShipping?: Maybe + weightedOrderShippingDiscount?: Maybe + weightedOrderShippingManualAdjustment?: Maybe + weightedOrderShippingTax?: Maybe + weightedOrderHandlingFee?: Maybe + weightedOrderHandlingFeeTax?: Maybe + weightedOrderHandlingFeeDiscount?: Maybe + weightedOrderDuty?: Maybe + totalWithWeightedShippingAndHandling?: Maybe + weightedOrderHandlingAdjustment?: Maybe + autoAddDiscountId?: Maybe + isAssemblyRequired?: Maybe + childItemIds?: Maybe> + parentItemId?: Maybe +} + +export type CrPackageMeasurements = { + __typename?: 'CrPackageMeasurements' + _get?: Maybe + _root?: Maybe + height?: Maybe + width?: Maybe + length?: Maybe + weight?: Maybe +} + +export type CrPackageMeasurements_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrPackageMeasurementsInput = { + height?: Maybe + width?: Maybe + length?: Maybe + weight?: Maybe +} + +export type CrPhone = { + __typename?: 'CrPhone' + _get?: Maybe + _root?: Maybe + home?: Maybe + mobile?: Maybe + work?: Maybe +} + +export type CrPhone_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrPhoneInput = { + home?: Maybe + mobile?: Maybe + work?: Maybe +} + +export type CrProduct = { + __typename?: 'CrProduct' + _get?: Maybe + _root?: Maybe + mfgPartNumber?: Maybe + upc?: Maybe + sku?: Maybe + fulfillmentTypesSupported?: Maybe> + imageAlternateText?: Maybe + imageUrl?: Maybe + variationProductCode?: Maybe + options?: Maybe>> + properties?: Maybe>> + categories?: Maybe>> + price?: Maybe + discountsRestricted?: Maybe + discountsRestrictedStartDate?: Maybe + discountsRestrictedEndDate?: Maybe + isRecurring?: Maybe + isTaxable?: Maybe + productType?: Maybe + productUsage?: Maybe + bundledProducts?: Maybe>> + fulfillmentFields?: Maybe>> + productCode?: Maybe + name?: Maybe + description?: Maybe + goodsType?: Maybe + isPackagedStandAlone?: Maybe + stock?: Maybe + productReservationId?: Maybe + allocationId?: Maybe + allocationExpiration?: Maybe + measurements?: Maybe + fulfillmentStatus?: Maybe +} + +export type CrProduct_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrProductInput = { + mfgPartNumber?: Maybe + upc?: Maybe + sku?: Maybe + fulfillmentTypesSupported?: Maybe> + imageAlternateText?: Maybe + imageUrl?: Maybe + variationProductCode?: Maybe + options?: Maybe>> + properties?: Maybe>> + categories?: Maybe>> + price?: Maybe + discountsRestricted?: Maybe + discountsRestrictedStartDate?: Maybe + discountsRestrictedEndDate?: Maybe + isRecurring?: Maybe + isTaxable?: Maybe + productType?: Maybe + productUsage?: Maybe + bundledProducts?: Maybe>> + fulfillmentFields?: Maybe>> + productCode?: Maybe + name?: Maybe + description?: Maybe + goodsType?: Maybe + isPackagedStandAlone?: Maybe + stock?: Maybe + productReservationId?: Maybe + allocationId?: Maybe + allocationExpiration?: Maybe + measurements?: Maybe + fulfillmentStatus?: Maybe +} + +export type CrProductOption = { + __typename?: 'CrProductOption' + _get?: Maybe + _root?: Maybe + name?: Maybe + value?: Maybe + shopperEnteredValue?: Maybe + attributeFQN?: Maybe + dataType?: Maybe + stringValue?: Maybe +} + +export type CrProductOption_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrProductOptionInput = { + name?: Maybe + value?: Maybe + shopperEnteredValue?: Maybe + attributeFQN?: Maybe + dataType?: Maybe + stringValue?: Maybe +} + +export type CrProductPrice = { + __typename?: 'CrProductPrice' + _get?: Maybe + _root?: Maybe + price?: Maybe + salePrice?: Maybe + tenantOverridePrice?: Maybe + msrp?: Maybe + creditValue?: Maybe + priceListCode?: Maybe + priceListEntryMode?: Maybe +} + +export type CrProductPrice_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrProductPriceInput = { + price?: Maybe + salePrice?: Maybe + tenantOverridePrice?: Maybe + msrp?: Maybe + creditValue?: Maybe + priceListCode?: Maybe + priceListEntryMode?: Maybe +} + +export type CrProductProperty = { + __typename?: 'CrProductProperty' + _get?: Maybe + _root?: Maybe + attributeFQN?: Maybe + name?: Maybe + dataType?: Maybe + isMultiValue?: Maybe + values?: Maybe>> +} + +export type CrProductProperty_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrProductPropertyInput = { + attributeFQN?: Maybe + name?: Maybe + dataType?: Maybe + isMultiValue?: Maybe + values?: Maybe>> +} + +export type CrProductPropertyValue = { + __typename?: 'CrProductPropertyValue' + _get?: Maybe + _root?: Maybe + stringValue?: Maybe + value?: Maybe +} + +export type CrProductPropertyValue_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CrProductPropertyValueInput = { + stringValue?: Maybe + value?: Maybe +} + +export type Credit = { + __typename?: 'Credit' + _get?: Maybe + _root?: Maybe + code?: Maybe + activationDate?: Maybe + creditType?: Maybe + customCreditType?: Maybe + currencyCode?: Maybe + initialBalance?: Maybe + currentBalance?: Maybe + expirationDate?: Maybe + customerId?: Maybe + auditInfo?: Maybe + creditTypeId: Scalars['Int'] +} + +export type Credit_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CreditAuditEntry = { + __typename?: 'CreditAuditEntry' + _get?: Maybe + _root?: Maybe + activityType?: Maybe + details?: Maybe + auditInfo?: Maybe + activityTypeId: Scalars['Int'] +} + +export type CreditAuditEntry_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CreditAuditEntryCollection = { + __typename?: 'CreditAuditEntryCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CreditAuditEntryCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CreditCollection = { + __typename?: 'CreditCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CreditCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CreditInput = { + code?: Maybe + activationDate?: Maybe + creditType?: Maybe + customCreditType?: Maybe + currencyCode?: Maybe + initialBalance?: Maybe + currentBalance?: Maybe + expirationDate?: Maybe + customerId?: Maybe + auditInfo?: Maybe + creditTypeId: Scalars['Int'] +} + +export type CreditTransaction = { + __typename?: 'CreditTransaction' + _get?: Maybe + _root?: Maybe + id?: Maybe + transactionType?: Maybe + comments?: Maybe + impactAmount?: Maybe + auditInfo?: Maybe + orderId?: Maybe + data?: Maybe +} + +export type CreditTransaction_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CreditTransactionCollection = { + __typename?: 'CreditTransactionCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CreditTransactionCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CreditTransactionInput = { + id?: Maybe + transactionType?: Maybe + comments?: Maybe + impactAmount?: Maybe + auditInfo?: Maybe + orderId?: Maybe + data?: Maybe +} + +export type CuAddress = { + __typename?: 'CuAddress' + _get?: Maybe + _root?: Maybe + address1?: Maybe + address2?: Maybe + address3?: Maybe + address4?: Maybe + cityOrTown?: Maybe + stateOrProvince?: Maybe + postalOrZipCode?: Maybe + countryCode?: Maybe + addressType?: Maybe + isValidated?: Maybe +} + +export type CuAddress_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CuAddressInput = { + address1?: Maybe + address2?: Maybe + address3?: Maybe + address4?: Maybe + cityOrTown?: Maybe + stateOrProvince?: Maybe + postalOrZipCode?: Maybe + countryCode?: Maybe + addressType?: Maybe + isValidated?: Maybe +} + +export type CuAttribute = { + __typename?: 'CuAttribute' + _get?: Maybe + _root?: Maybe + id?: Maybe + adminName?: Maybe + namespace?: Maybe + attributeCode: Scalars['String'] + inputType?: Maybe + valueType: Scalars['String'] + dataType?: Maybe + attributeMetadata?: Maybe>> + attributeFQN?: Maybe + content?: Maybe + validation?: Maybe + vocabularyValues?: Maybe>> + auditInfo?: Maybe + isActive?: Maybe + isRequired?: Maybe + isReadOnly?: Maybe + isMultiValued?: Maybe + isVisible?: Maybe + order?: Maybe + displayGroup: Scalars['String'] +} + +export type CuAttribute_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CuAttributeCollection = { + __typename?: 'CuAttributeCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CuAttributeCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CuAttributeInput = { + id?: Maybe + adminName?: Maybe + namespace?: Maybe + attributeCode: Scalars['String'] + inputType?: Maybe + valueType: Scalars['String'] + dataType?: Maybe + attributeMetadata?: Maybe>> + attributeFQN?: Maybe + content?: Maybe + validation?: Maybe + vocabularyValues?: Maybe>> + auditInfo?: Maybe + isActive?: Maybe + isRequired?: Maybe + isReadOnly?: Maybe + isMultiValued?: Maybe + isVisible?: Maybe + order?: Maybe + displayGroup: Scalars['String'] +} + +export type CuAttributeLocalizedContent = { + __typename?: 'CuAttributeLocalizedContent' + _get?: Maybe + _root?: Maybe + localeCode?: Maybe + value?: Maybe +} + +export type CuAttributeLocalizedContent_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CuAttributeLocalizedContentInput = { + localeCode?: Maybe + value?: Maybe +} + +export type CuAttributeMetadataItem = { + __typename?: 'CuAttributeMetadataItem' + _get?: Maybe + _root?: Maybe + key: Scalars['String'] + value: Scalars['String'] +} + +export type CuAttributeMetadataItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CuAttributeMetadataItemInput = { + key: Scalars['String'] + value: Scalars['String'] +} + +export type CuAttributeValidation = { + __typename?: 'CuAttributeValidation' + _get?: Maybe + _root?: Maybe + regularExpression?: Maybe + minStringLength?: Maybe + maxStringLength?: Maybe + minNumericValue?: Maybe + maxNumericValue?: Maybe + minDateTime?: Maybe + maxDateTime?: Maybe +} + +export type CuAttributeValidation_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CuAttributeValidationInput = { + regularExpression?: Maybe + minStringLength?: Maybe + maxStringLength?: Maybe + minNumericValue?: Maybe + maxNumericValue?: Maybe + minDateTime?: Maybe + maxDateTime?: Maybe +} + +export type CuAttributeValueLocalizedContent = { + __typename?: 'CuAttributeValueLocalizedContent' + _get?: Maybe + _root?: Maybe + localeCode: Scalars['String'] + value: Scalars['String'] +} + +export type CuAttributeValueLocalizedContent_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CuAttributeValueLocalizedContentInput = { + localeCode: Scalars['String'] + value: Scalars['String'] +} + +export type CuAttributeVocabularyValue = { + __typename?: 'CuAttributeVocabularyValue' + _get?: Maybe + _root?: Maybe + value: Scalars['String'] + sequence?: Maybe + isHidden?: Maybe + content?: Maybe +} + +export type CuAttributeVocabularyValue_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CuAttributeVocabularyValueInput = { + value: Scalars['String'] + sequence?: Maybe + isHidden?: Maybe + content?: Maybe +} + +export type CuAuditInfo = { + __typename?: 'CuAuditInfo' + _get?: Maybe + _root?: Maybe + updateDate?: Maybe + createDate?: Maybe + updateBy?: Maybe + createBy?: Maybe +} + +export type CuAuditInfo_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CuAuditInfoInput = { + updateDate?: Maybe + createDate?: Maybe + updateBy?: Maybe + createBy?: Maybe +} + +export type CuPhone = { + __typename?: 'CuPhone' + _get?: Maybe + _root?: Maybe + home?: Maybe + mobile?: Maybe + work?: Maybe +} + +export type CuPhone_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CuPhoneInput = { + home?: Maybe + mobile?: Maybe + work?: Maybe +} + +export type CurrencyAmount = { + __typename?: 'CurrencyAmount' + _get?: Maybe + _root?: Maybe + currencyCode?: Maybe + amount: Scalars['Float'] +} + +export type CurrencyAmount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CurrencyAmountInput = { + currencyCode?: Maybe + amount: Scalars['Float'] +} + +export type CurrencyExchangeRate = { + __typename?: 'CurrencyExchangeRate' + _get?: Maybe + _root?: Maybe + fromCurrencyCode?: Maybe + toCurrencyCode?: Maybe + rate?: Maybe + multiplier?: Maybe + decimalPlaces?: Maybe + roundingStrategy?: Maybe + referenceData?: Maybe +} + +export type CurrencyExchangeRate_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type Customer = { + __typename?: 'Customer' + _get?: Maybe + _root?: Maybe + customerContact?: Maybe + data?: Maybe + isDestinationCommercial?: Maybe +} + +export type Customer_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerAccount = { + __typename?: 'CustomerAccount' + _get?: Maybe + _root?: Maybe + emailAddress?: Maybe + userName?: Maybe + firstName?: Maybe + lastName?: Maybe + localeCode?: Maybe + userId?: Maybe + isAnonymous?: Maybe + isLocked?: Maybe + isActive?: Maybe + acceptsMarketing?: Maybe + hasExternalPassword?: Maybe + id: Scalars['Int'] + customerSet?: Maybe + commerceSummary?: Maybe + contacts?: Maybe>> + companyOrOrganization?: Maybe + notes?: Maybe>> + attributes?: Maybe>> + segments?: Maybe>> + taxId?: Maybe + externalId?: Maybe + auditInfo?: Maybe + customerSinceDate?: Maybe + accountType?: Maybe +} + +export type CustomerAccount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerAccountAndAuthInfoInput = { + account?: Maybe + password?: Maybe + externalPassword?: Maybe + isImport?: Maybe +} + +export type CustomerAccountCollection = { + __typename?: 'CustomerAccountCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CustomerAccountCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerAccountInput = { + emailAddress?: Maybe + userName?: Maybe + firstName?: Maybe + lastName?: Maybe + localeCode?: Maybe + userId?: Maybe + isAnonymous?: Maybe + isLocked?: Maybe + isActive?: Maybe + acceptsMarketing?: Maybe + hasExternalPassword?: Maybe + id: Scalars['Int'] + customerSet?: Maybe + commerceSummary?: Maybe + contacts?: Maybe>> + companyOrOrganization?: Maybe + notes?: Maybe>> + attributes?: Maybe>> + segments?: Maybe>> + taxId?: Maybe + externalId?: Maybe + auditInfo?: Maybe + customerSinceDate?: Maybe + accountType?: Maybe +} + +export type CustomerAttribute = { + __typename?: 'CustomerAttribute' + _get?: Maybe + _root?: Maybe + auditInfo?: Maybe + fullyQualifiedName?: Maybe + attributeDefinitionId?: Maybe + values?: Maybe> +} + +export type CustomerAttribute_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerAttributeCollection = { + __typename?: 'CustomerAttributeCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CustomerAttributeCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerAttributeInput = { + auditInfo?: Maybe + fullyQualifiedName?: Maybe + attributeDefinitionId?: Maybe + values?: Maybe> +} + +export type CustomerAuditEntry = { + __typename?: 'CustomerAuditEntry' + _get?: Maybe + _root?: Maybe + customerAccountId: Scalars['Int'] + customerAuditEntryId: Scalars['Int'] + entryDate: Scalars['DateTime'] + entryUser?: Maybe + application?: Maybe + site?: Maybe + description?: Maybe + fieldPath?: Maybe + oldValue?: Maybe + newValue?: Maybe +} + +export type CustomerAuditEntry_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerAuditEntryCollection = { + __typename?: 'CustomerAuditEntryCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CustomerAuditEntryCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerAuthTicket = { + __typename?: 'CustomerAuthTicket' + _get?: Maybe + _root?: Maybe + customerAccount?: Maybe + accessToken?: Maybe + accessTokenExpiration: Scalars['DateTime'] + refreshToken?: Maybe + refreshTokenExpiration: Scalars['DateTime'] + userId?: Maybe + jwtAccessToken?: Maybe +} + +export type CustomerAuthTicket_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerContact = { + __typename?: 'CustomerContact' + _get?: Maybe + _root?: Maybe + accountId: Scalars['Int'] + types?: Maybe>> + auditInfo?: Maybe + faxNumber?: Maybe + label?: Maybe + id?: Maybe + email?: Maybe + firstName?: Maybe + middleNameOrInitial?: Maybe + lastNameOrSurname?: Maybe + companyOrOrganization?: Maybe + phoneNumbers?: Maybe + address?: Maybe +} + +export type CustomerContact_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerContactCollection = { + __typename?: 'CustomerContactCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CustomerContactCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerContactInput = { + accountId: Scalars['Int'] + types?: Maybe>> + auditInfo?: Maybe + faxNumber?: Maybe + label?: Maybe + id?: Maybe + email?: Maybe + firstName?: Maybe + middleNameOrInitial?: Maybe + lastNameOrSurname?: Maybe + companyOrOrganization?: Maybe + phoneNumbers?: Maybe + address?: Maybe +} + +export type CustomerInput = { + customerContact?: Maybe + data?: Maybe + isDestinationCommercial?: Maybe +} + +export type CustomerLoginInfoInput = { + emailAddress?: Maybe + username?: Maybe + password?: Maybe + externalPassword?: Maybe + isImport?: Maybe +} + +export type CustomerNote = { + __typename?: 'CustomerNote' + _get?: Maybe + _root?: Maybe + id: Scalars['Int'] + content?: Maybe + auditInfo?: Maybe +} + +export type CustomerNote_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerNoteCollection = { + __typename?: 'CustomerNoteCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CustomerNoteCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerNoteInput = { + id: Scalars['Int'] + content?: Maybe + auditInfo?: Maybe +} + +export type CustomerPurchaseOrderAccount = { + __typename?: 'CustomerPurchaseOrderAccount' + _get?: Maybe + _root?: Maybe + id: Scalars['Int'] + accountId: Scalars['Int'] + isEnabled?: Maybe + creditLimit: Scalars['Float'] + availableBalance: Scalars['Float'] + totalAvailableBalance: Scalars['Float'] + overdraftAllowance?: Maybe + overdraftAllowanceType?: Maybe + customerPurchaseOrderPaymentTerms?: Maybe< + Array> + > + auditInfo?: Maybe +} + +export type CustomerPurchaseOrderAccount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerPurchaseOrderAccountCollection = { + __typename?: 'CustomerPurchaseOrderAccountCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CustomerPurchaseOrderAccountCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerPurchaseOrderAccountInput = { + id: Scalars['Int'] + accountId: Scalars['Int'] + isEnabled?: Maybe + creditLimit: Scalars['Float'] + availableBalance: Scalars['Float'] + totalAvailableBalance: Scalars['Float'] + overdraftAllowance?: Maybe + overdraftAllowanceType?: Maybe + customerPurchaseOrderPaymentTerms?: Maybe< + Array> + > + auditInfo?: Maybe +} + +export type CustomerPurchaseOrderPaymentTerm = { + __typename?: 'CustomerPurchaseOrderPaymentTerm' + _get?: Maybe + _root?: Maybe + siteId: Scalars['Int'] + code?: Maybe + description?: Maybe + auditInfo?: Maybe +} + +export type CustomerPurchaseOrderPaymentTerm_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerPurchaseOrderPaymentTermInput = { + siteId: Scalars['Int'] + code?: Maybe + description?: Maybe + auditInfo?: Maybe +} + +export type CustomerSegment = { + __typename?: 'CustomerSegment' + _get?: Maybe + _root?: Maybe + id: Scalars['Int'] + code?: Maybe + name?: Maybe + description?: Maybe + auditInfo?: Maybe +} + +export type CustomerSegment_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerSegmentCollection = { + __typename?: 'CustomerSegmentCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CustomerSegmentCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerSegmentInput = { + id: Scalars['Int'] + code?: Maybe + name?: Maybe + description?: Maybe + auditInfo?: Maybe +} + +export type CustomerSet = { + __typename?: 'CustomerSet' + _get?: Maybe + _root?: Maybe + code?: Maybe + name?: Maybe + description?: Maybe + auditInfo?: Maybe + sites?: Maybe>> + isDefault?: Maybe + aggregateInfo?: Maybe +} + +export type CustomerSet_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerSetAggregateInfo = { + __typename?: 'CustomerSetAggregateInfo' + _get?: Maybe + _root?: Maybe + customerCount: Scalars['Int'] +} + +export type CustomerSetAggregateInfo_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerSetCollection = { + __typename?: 'CustomerSetCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type CustomerSetCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerSetSite = { + __typename?: 'CustomerSetSite' + _get?: Maybe + _root?: Maybe + siteId: Scalars['Int'] + customerSetCode?: Maybe + name?: Maybe +} + +export type CustomerSetSite_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type CustomerUserAuthInfoInput = { + username?: Maybe + password?: Maybe +} + +export type Destination = { + __typename?: 'Destination' + _get?: Maybe + _root?: Maybe + id?: Maybe + destinationContact?: Maybe + isDestinationCommercial?: Maybe + data?: Maybe +} + +export type Destination_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DestinationInput = { + id?: Maybe + destinationContact?: Maybe + isDestinationCommercial?: Maybe + data?: Maybe +} + +export type DigitalPackage = { + __typename?: 'DigitalPackage' + _get?: Maybe + _root?: Maybe + id?: Maybe + code?: Maybe + status?: Maybe + items?: Maybe>> + fulfillmentDate?: Maybe + fulfillmentLocationCode?: Maybe + auditInfo?: Maybe + availableActions?: Maybe> + changeMessages?: Maybe>> +} + +export type DigitalPackage_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DigitalPackageInput = { + id?: Maybe + code?: Maybe + status?: Maybe + items?: Maybe>> + fulfillmentDate?: Maybe + fulfillmentLocationCode?: Maybe + auditInfo?: Maybe + availableActions?: Maybe> + changeMessages?: Maybe>> +} + +export type DigitalPackageItem = { + __typename?: 'DigitalPackageItem' + _get?: Maybe + _root?: Maybe + giftCardCode?: Maybe + productCode?: Maybe + quantity: Scalars['Int'] + fulfillmentItemType?: Maybe + lineId?: Maybe + optionAttributeFQN?: Maybe +} + +export type DigitalPackageItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DigitalPackageItemInput = { + giftCardCode?: Maybe + productCode?: Maybe + quantity: Scalars['Int'] + fulfillmentItemType?: Maybe + lineId?: Maybe + optionAttributeFQN?: Maybe +} + +export type DigitalWalletInput = { + digitalWalletData?: Maybe + cartId?: Maybe +} + +export type DiscountSelectionsInput = { + discountIds?: Maybe> +} + +export type DiscountValidationSummary = { + __typename?: 'DiscountValidationSummary' + _get?: Maybe + _root?: Maybe + applicableDiscounts?: Maybe>> +} + +export type DiscountValidationSummary_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type Document = { + __typename?: 'Document' + _get?: Maybe + _root?: Maybe + id?: Maybe + name?: Maybe + path?: Maybe + publishSetCode?: Maybe + extension?: Maybe + documentTypeFQN?: Maybe + listFQN?: Maybe + contentLength?: Maybe + contentMimeType?: Maybe + contentUpdateDate?: Maybe + publishState?: Maybe + properties?: Maybe + insertDate?: Maybe + updateDate?: Maybe + activeDateRange?: Maybe +} + +export type Document_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DocumentCollection = { + __typename?: 'DocumentCollection' + _get?: Maybe + _root?: Maybe + subPaths?: Maybe> + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type DocumentCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DocumentDraftSummary = { + __typename?: 'DocumentDraftSummary' + _get?: Maybe + _root?: Maybe + id?: Maybe + name?: Maybe + documentTypeFQN?: Maybe + listFQN?: Maybe + activeUpdateDate?: Maybe + draftUpdateDate: Scalars['DateTime'] + updatedBy?: Maybe + activeUpdatedBy?: Maybe + publishType?: Maybe + publishSetCode?: Maybe + masterCatalogId?: Maybe + catalogId?: Maybe + siteId?: Maybe +} + +export type DocumentDraftSummary_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DocumentDraftSummaryPagedCollection = { + __typename?: 'DocumentDraftSummaryPagedCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type DocumentDraftSummaryPagedCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DocumentInput = { + id?: Maybe + name?: Maybe + path?: Maybe + publishSetCode?: Maybe + extension?: Maybe + documentTypeFQN?: Maybe + listFQN?: Maybe + contentLength?: Maybe + contentMimeType?: Maybe + contentUpdateDate?: Maybe + publishState?: Maybe + properties?: Maybe + insertDate?: Maybe + updateDate?: Maybe + activeDateRange?: Maybe +} + +export type DocumentInstallation = { + __typename?: 'DocumentInstallation' + _get?: Maybe + _root?: Maybe + name?: Maybe + documentTypeFQN?: Maybe + properties?: Maybe + locale?: Maybe +} + +export type DocumentInstallation_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DocumentInstallationInput = { + name?: Maybe + documentTypeFQN?: Maybe + properties?: Maybe + locale?: Maybe +} + +export type DocumentList = { + __typename?: 'DocumentList' + _get?: Maybe + _root?: Maybe + name?: Maybe + namespace?: Maybe + listFQN?: Maybe + documentTypes?: Maybe> + supportsPublishing?: Maybe + enablePublishing?: Maybe + supportsActiveDateRanges?: Maybe + enableActiveDateRanges?: Maybe + views?: Maybe>> + usages?: Maybe> + security?: Maybe + scopeId?: Maybe + scopeType?: Maybe + documentListType?: Maybe + metadata?: Maybe +} + +export type DocumentList_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DocumentListCollection = { + __typename?: 'DocumentListCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type DocumentListCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DocumentListInput = { + name?: Maybe + namespace?: Maybe + listFQN?: Maybe + documentTypes?: Maybe> + supportsPublishing?: Maybe + enablePublishing?: Maybe + supportsActiveDateRanges?: Maybe + enableActiveDateRanges?: Maybe + views?: Maybe>> + usages?: Maybe> + security?: Maybe + scopeId?: Maybe + scopeType?: Maybe + documentListType?: Maybe + metadata?: Maybe +} + +export type DocumentListType = { + __typename?: 'DocumentListType' + _get?: Maybe + _root?: Maybe + name?: Maybe + namespace?: Maybe + documentListTypeFQN?: Maybe + scopeType?: Maybe + installationPackage?: Maybe + version?: Maybe + defaultDocuments?: Maybe>> + documentTypeFQNs?: Maybe> + supportsPublishing?: Maybe + enablePublishing?: Maybe + supportsActiveDateRanges?: Maybe + enableActiveDateRanges?: Maybe + views?: Maybe>> + usages?: Maybe> + metadata?: Maybe +} + +export type DocumentListType_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DocumentListTypeCollection = { + __typename?: 'DocumentListTypeCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type DocumentListTypeCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DocumentListTypeInput = { + name?: Maybe + namespace?: Maybe + documentListTypeFQN?: Maybe + scopeType?: Maybe + installationPackage?: Maybe + version?: Maybe + defaultDocuments?: Maybe>> + documentTypeFQNs?: Maybe> + supportsPublishing?: Maybe + enablePublishing?: Maybe + supportsActiveDateRanges?: Maybe + enableActiveDateRanges?: Maybe + views?: Maybe>> + usages?: Maybe> + metadata?: Maybe +} + +export type DocumentType = { + __typename?: 'DocumentType' + _get?: Maybe + _root?: Maybe + name?: Maybe + namespace?: Maybe + documentTypeFQN?: Maybe + adminName?: Maybe + installationPackage?: Maybe + version?: Maybe + metadata?: Maybe + properties?: Maybe>> +} + +export type DocumentType_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DocumentTypeCollection = { + __typename?: 'DocumentTypeCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type DocumentTypeCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type DocumentTypeInput = { + name?: Maybe + namespace?: Maybe + documentTypeFQN?: Maybe + adminName?: Maybe + installationPackage?: Maybe + version?: Maybe + metadata?: Maybe + properties?: Maybe>> +} + +export type EntityCollection = { + __typename?: 'EntityCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe> +} + +export type EntityCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type EntityContainer = { + __typename?: 'EntityContainer' + _get?: Maybe + _root?: Maybe + tenantId: Scalars['Int'] + siteId?: Maybe + masterCatalogId?: Maybe + catalogId?: Maybe + localeCode?: Maybe + listFullName?: Maybe + userId?: Maybe + id?: Maybe + item?: Maybe + createBy?: Maybe + createDate: Scalars['DateTime'] + updateBy?: Maybe + updateDate: Scalars['DateTime'] +} + +export type EntityContainer_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type EntityContainerCollection = { + __typename?: 'EntityContainerCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type EntityContainerCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type EntityList = { + __typename?: 'EntityList' + _get?: Maybe + _root?: Maybe + tenantId: Scalars['Int'] + nameSpace?: Maybe + name?: Maybe + contextLevel?: Maybe + useSystemAssignedId?: Maybe + idProperty?: Maybe + indexA?: Maybe + indexB?: Maybe + indexC?: Maybe + indexD?: Maybe + isVisibleInStorefront?: Maybe + isLocaleSpecific?: Maybe + isShopperSpecific?: Maybe + isSandboxDataCloningSupported?: Maybe + views?: Maybe>> + usages?: Maybe> + metadata?: Maybe + createDate: Scalars['DateTime'] + updateDate: Scalars['DateTime'] +} + +export type EntityList_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type EntityListCollection = { + __typename?: 'EntityListCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type EntityListCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type EntityListInput = { + tenantId: Scalars['Int'] + nameSpace?: Maybe + name?: Maybe + contextLevel?: Maybe + useSystemAssignedId?: Maybe + idProperty?: Maybe + indexA?: Maybe + indexB?: Maybe + indexC?: Maybe + indexD?: Maybe + isVisibleInStorefront?: Maybe + isLocaleSpecific?: Maybe + isShopperSpecific?: Maybe + isSandboxDataCloningSupported?: Maybe + views?: Maybe>> + usages?: Maybe> + metadata?: Maybe + createDate: Scalars['DateTime'] + updateDate: Scalars['DateTime'] +} + +export type ExclusionListEntryLocationCodeInput = { + locationCode: Scalars['String'] + orderItemID: Scalars['Int'] +} + +export type ExtendedProperty = { + __typename?: 'ExtendedProperty' + _get?: Maybe + _root?: Maybe + key?: Maybe + value?: Maybe +} + +export type ExtendedProperty_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ExtendedPropertyInput = { + key?: Maybe + value?: Maybe +} + +export type Facet = { + __typename?: 'Facet' + _get?: Maybe + _root?: Maybe + label?: Maybe + facetType?: Maybe + field?: Maybe + values?: Maybe>> +} + +export type Facet_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type FacetValue = { + __typename?: 'FacetValue' + _get?: Maybe + _root?: Maybe + label?: Maybe + isApplied?: Maybe + count: Scalars['Int'] + value?: Maybe + filterValue?: Maybe + rangeQueryValueStart?: Maybe + rangeQueryValueEnd?: Maybe + parentFacetValue?: Maybe + isDisplayed?: Maybe + childrenFacetValues?: Maybe>> +} + +export type FacetValue_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type FulfillmentActionInput = { + actionName?: Maybe + packageIds?: Maybe> + pickupIds?: Maybe> + digitalPackageIds?: Maybe> +} + +export type FulfillmentField = { + __typename?: 'FulfillmentField' + _get?: Maybe + _root?: Maybe + name?: Maybe + userEnteredValue?: Maybe + required?: Maybe +} + +export type FulfillmentField_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type FulfillmentFieldInput = { + name?: Maybe + userEnteredValue?: Maybe + required?: Maybe +} + +export type FulfillmentInfo = { + __typename?: 'FulfillmentInfo' + _get?: Maybe + _root?: Maybe + fulfillmentContact?: Maybe + isDestinationCommercial?: Maybe + shippingMethodCode?: Maybe + shippingMethodName?: Maybe + data?: Maybe + auditInfo?: Maybe +} + +export type FulfillmentInfo_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type FulfillmentInfoInput = { + fulfillmentContact?: Maybe + isDestinationCommercial?: Maybe + shippingMethodCode?: Maybe + shippingMethodName?: Maybe + data?: Maybe + auditInfo?: Maybe +} + +export type FulfillmentShopperNotes = { + __typename?: 'FulfillmentShopperNotes' + _get?: Maybe + _root?: Maybe + comments?: Maybe + deliveryInstructions?: Maybe + giftMessage?: Maybe +} + +export type FulfillmentShopperNotes_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type FulfillmentShopperNotesInput = { + comments?: Maybe + deliveryInstructions?: Maybe + giftMessage?: Maybe +} + +export type FulfillmentTask = { + __typename?: 'FulfillmentTask' + _get?: Maybe + _root?: Maybe + links?: Maybe + active?: Maybe + attributes?: Maybe + completed?: Maybe + completedDate?: Maybe + description?: Maybe + inputs?: Maybe>> + name?: Maybe + skippable?: Maybe + subject?: Maybe + taskId?: Maybe +} + +export type FulfillmentTask_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type FulfillmentTaskInput = { + links?: Maybe + active?: Maybe + attributes?: Maybe + completed?: Maybe + completedDate?: Maybe + description?: Maybe + inputs?: Maybe>> + name?: Maybe + skippable?: Maybe + subject?: Maybe + taskId?: Maybe +} + +export type GatewayGiftCard = { + __typename?: 'GatewayGiftCard' + _get?: Maybe + _root?: Maybe + cardNumber?: Maybe + amount: Scalars['Float'] + currencyCode?: Maybe +} + +export type GatewayGiftCard_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type GatewayGiftCardInput = { + cardNumber?: Maybe + amount: Scalars['Float'] + currencyCode?: Maybe +} + +export type GiftCard = { + __typename?: 'GiftCard' + _get?: Maybe + _root?: Maybe + activationDate?: Maybe + cardNumber?: Maybe + code?: Maybe + creditType?: Maybe + creditValue?: Maybe + currencyCode?: Maybe + currentBalance?: Maybe + customerId?: Maybe + expirationDate?: Maybe + initialBalance?: Maybe +} + +export type GiftCard_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type GiftCardInput = { + activationDate?: Maybe + cardNumber?: Maybe + code?: Maybe + creditType?: Maybe + creditValue?: Maybe + currencyCode?: Maybe + currentBalance?: Maybe + customerId?: Maybe + expirationDate?: Maybe + initialBalance?: Maybe +} + +export type Hours = { + __typename?: 'Hours' + _get?: Maybe + _root?: Maybe + label?: Maybe + openTime?: Maybe + closeTime?: Maybe + isClosed?: Maybe +} + +export type Hours_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type HoursInput = { + label?: Maybe + openTime?: Maybe + closeTime?: Maybe + isClosed?: Maybe +} + +export type InStockNotificationSubscription = { + __typename?: 'InStockNotificationSubscription' + _get?: Maybe + _root?: Maybe + id?: Maybe + email?: Maybe + customerId?: Maybe + productCode?: Maybe + locationCode?: Maybe + userId?: Maybe + auditInfo?: Maybe +} + +export type InStockNotificationSubscription_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type InStockNotificationSubscriptionCollection = { + __typename?: 'InStockNotificationSubscriptionCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type InStockNotificationSubscriptionCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type InStockNotificationSubscriptionInput = { + id?: Maybe + email?: Maybe + customerId?: Maybe + productCode?: Maybe + locationCode?: Maybe + userId?: Maybe + auditInfo?: Maybe +} + +export type IndexedProperty = { + __typename?: 'IndexedProperty' + _get?: Maybe + _root?: Maybe + propertyName?: Maybe + dataType?: Maybe +} + +export type IndexedProperty_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type IndexedPropertyInput = { + propertyName?: Maybe + dataType?: Maybe +} + +export type InvalidCoupon = { + __typename?: 'InvalidCoupon' + _get?: Maybe + _root?: Maybe + couponCode?: Maybe + reasonCode: Scalars['Int'] + reason?: Maybe + createDate: Scalars['DateTime'] + discountId: Scalars['Int'] +} + +export type InvalidCoupon_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type InvalidCouponInput = { + couponCode?: Maybe + reasonCode: Scalars['Int'] + reason?: Maybe + createDate: Scalars['DateTime'] + discountId: Scalars['Int'] +} + +export enum InventoryRequestTypeEnum { + All = 'ALL', + Partial = 'PARTIAL', + Any = 'ANY', + AllStores = 'ALL_STORES', +} + +export type ItemsForDestinationInput = { + destinationId?: Maybe + itemIds?: Maybe> +} + +export type JsonNode = { + __typename?: 'JsonNode' + _get?: Maybe + _root?: Maybe + array?: Maybe + bigDecimal?: Maybe + bigInteger?: Maybe + binary?: Maybe + boolean?: Maybe + containerNode?: Maybe + double?: Maybe + float?: Maybe + floatingPointNumber?: Maybe + int?: Maybe + integralNumber?: Maybe + long?: Maybe + missingNode?: Maybe + nodeType?: Maybe + null?: Maybe + number?: Maybe + object?: Maybe + pojo?: Maybe + short?: Maybe + textual?: Maybe + valueNode?: Maybe +} + +export type JsonNode_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type KeyValuePair2Input = { + key?: Maybe + value?: Maybe> +} + +export type ListView = { + __typename?: 'ListView' + _get?: Maybe + _root?: Maybe + name?: Maybe + usages?: Maybe> + metaData?: Maybe + security?: Maybe + filter?: Maybe + defaultSort?: Maybe + fields?: Maybe>> +} + +export type ListView_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ListViewCollection = { + __typename?: 'ListViewCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type ListViewCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ListViewField = { + __typename?: 'ListViewField' + _get?: Maybe + _root?: Maybe + name?: Maybe + type?: Maybe + target?: Maybe +} + +export type ListViewField_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ListViewFieldInput = { + name?: Maybe + type?: Maybe + target?: Maybe +} + +export type ListViewInput = { + name?: Maybe + usages?: Maybe> + metaData?: Maybe + security?: Maybe + filter?: Maybe + defaultSort?: Maybe + fields?: Maybe>> +} + +export type LoAddress = { + __typename?: 'LoAddress' + _get?: Maybe + _root?: Maybe + address1?: Maybe + address2?: Maybe + address3?: Maybe + address4?: Maybe + cityOrTown?: Maybe + stateOrProvince?: Maybe + postalOrZipCode?: Maybe + countryCode?: Maybe + addressType?: Maybe + isValidated?: Maybe +} + +export type LoAddress_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LoAddressInput = { + address1?: Maybe + address2?: Maybe + address3?: Maybe + address4?: Maybe + cityOrTown?: Maybe + stateOrProvince?: Maybe + postalOrZipCode?: Maybe + countryCode?: Maybe + addressType?: Maybe + isValidated?: Maybe +} + +export type LoAttribute = { + __typename?: 'LoAttribute' + _get?: Maybe + _root?: Maybe + id?: Maybe + adminName?: Maybe + namespace?: Maybe + attributeCode: Scalars['String'] + inputType?: Maybe + valueType: Scalars['String'] + dataType?: Maybe + attributeMetadata?: Maybe>> + attributeFQN?: Maybe + content?: Maybe + validation?: Maybe + vocabularyValues?: Maybe>> + auditInfo?: Maybe + isActive?: Maybe + isRequired?: Maybe + isReadOnly?: Maybe + isMultiValued?: Maybe + isVisible?: Maybe + order?: Maybe + displayGroup: Scalars['String'] +} + +export type LoAttribute_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LoAttributeCollection = { + __typename?: 'LoAttributeCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type LoAttributeCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LoAttributeInput = { + id?: Maybe + adminName?: Maybe + namespace?: Maybe + attributeCode: Scalars['String'] + inputType?: Maybe + valueType: Scalars['String'] + dataType?: Maybe + attributeMetadata?: Maybe>> + attributeFQN?: Maybe + content?: Maybe + validation?: Maybe + vocabularyValues?: Maybe>> + auditInfo?: Maybe + isActive?: Maybe + isRequired?: Maybe + isReadOnly?: Maybe + isMultiValued?: Maybe + isVisible?: Maybe + order?: Maybe + displayGroup: Scalars['String'] +} + +export type LoAttributeLocalizedContent = { + __typename?: 'LoAttributeLocalizedContent' + _get?: Maybe + _root?: Maybe + localeCode?: Maybe + value?: Maybe +} + +export type LoAttributeLocalizedContent_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LoAttributeLocalizedContentInput = { + localeCode?: Maybe + value?: Maybe +} + +export type LoAttributeMetadataItem = { + __typename?: 'LoAttributeMetadataItem' + _get?: Maybe + _root?: Maybe + key: Scalars['String'] + value: Scalars['String'] +} + +export type LoAttributeMetadataItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LoAttributeMetadataItemInput = { + key: Scalars['String'] + value: Scalars['String'] +} + +export type LoAttributeValidation = { + __typename?: 'LoAttributeValidation' + _get?: Maybe + _root?: Maybe + regularExpression?: Maybe + minStringLength?: Maybe + maxStringLength?: Maybe + minNumericValue?: Maybe + maxNumericValue?: Maybe + minDateTime?: Maybe + maxDateTime?: Maybe +} + +export type LoAttributeValidation_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LoAttributeValidationInput = { + regularExpression?: Maybe + minStringLength?: Maybe + maxStringLength?: Maybe + minNumericValue?: Maybe + maxNumericValue?: Maybe + minDateTime?: Maybe + maxDateTime?: Maybe +} + +export type LoAttributeValueLocalizedContent = { + __typename?: 'LoAttributeValueLocalizedContent' + _get?: Maybe + _root?: Maybe + localeCode: Scalars['String'] + value: Scalars['String'] +} + +export type LoAttributeValueLocalizedContent_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LoAttributeValueLocalizedContentInput = { + localeCode: Scalars['String'] + value: Scalars['String'] +} + +export type LoAttributeVocabularyValue = { + __typename?: 'LoAttributeVocabularyValue' + _get?: Maybe + _root?: Maybe + value: Scalars['String'] + sequence?: Maybe + isHidden?: Maybe + content?: Maybe +} + +export type LoAttributeVocabularyValue_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LoAttributeVocabularyValueInput = { + value: Scalars['String'] + sequence?: Maybe + isHidden?: Maybe + content?: Maybe +} + +export type LoAuditInfo = { + __typename?: 'LoAuditInfo' + _get?: Maybe + _root?: Maybe + updateDate?: Maybe + createDate?: Maybe + updateBy?: Maybe + createBy?: Maybe +} + +export type LoAuditInfo_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LoAuditInfoInput = { + updateDate?: Maybe + createDate?: Maybe + updateBy?: Maybe + createBy?: Maybe +} + +export type LoFulfillmentType = { + __typename?: 'LoFulfillmentType' + _get?: Maybe + _root?: Maybe + code?: Maybe + name?: Maybe +} + +export type LoFulfillmentType_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LoFulfillmentTypeInput = { + code?: Maybe + name?: Maybe +} + +export type Location = { + __typename?: 'Location' + _get?: Maybe + _root?: Maybe + code?: Maybe + locationTypes?: Maybe>> + name?: Maybe + description?: Maybe + address?: Maybe + geo?: Maybe + phone?: Maybe + fax?: Maybe + supportsInventory?: Maybe + fulfillmentTypes?: Maybe>> + regularHours?: Maybe + shippingOriginContact?: Maybe + note?: Maybe + tags?: Maybe> + attributes?: Maybe>> + auditInfo?: Maybe + allowFulfillmentWithNoStock?: Maybe + isDisabled?: Maybe + express?: Maybe + transferEnabled?: Maybe + includeInInventoryAggregrate?: Maybe + includeInLocationExport?: Maybe + warehouseEnabled?: Maybe + requiresManifest?: Maybe +} + +export type Location_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LocationAttribute = { + __typename?: 'LocationAttribute' + _get?: Maybe + _root?: Maybe + attributeDefinition?: Maybe + auditInfo?: Maybe + fullyQualifiedName?: Maybe + attributeDefinitionId?: Maybe + values?: Maybe> +} + +export type LocationAttribute_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LocationAttributeInput = { + attributeDefinition?: Maybe + auditInfo?: Maybe + fullyQualifiedName?: Maybe + attributeDefinitionId?: Maybe + values?: Maybe> +} + +export type LocationCollection = { + __typename?: 'LocationCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type LocationCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LocationGroup = { + __typename?: 'LocationGroup' + _get?: Maybe + _root?: Maybe + locationGroupId: Scalars['Int'] + locationGroupCode?: Maybe + siteIds?: Maybe> + name?: Maybe + locationCodes?: Maybe> + auditInfo?: Maybe +} + +export type LocationGroup_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LocationGroupCollection = { + __typename?: 'LocationGroupCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type LocationGroupCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LocationGroupConfiguration = { + __typename?: 'LocationGroupConfiguration' + _get?: Maybe + _root?: Maybe + tenantId: Scalars['Int'] + siteId: Scalars['Int'] + locationGroupId: Scalars['Int'] + locationGroupCode?: Maybe + customerFailedToPickupAfterAction?: Maybe + customerFailedToPickupDeadline?: Maybe + sendCustomerPickupReminder?: Maybe + enableForSTH?: Maybe + enableForISPU?: Maybe + enableAdvancedOptionForPickWaveCreation?: Maybe + maximumNumberOfOrdersInPickWave?: Maybe + defaultNumberOfOrdersInPickWave?: Maybe + pickWavePrintFormat?: Maybe + closePickWavePermissions?: Maybe> + wmsEnabled?: Maybe + enableScanningOfUpcForShipToHome?: Maybe + allowReturns?: Maybe + returnRefundReduction?: Maybe + defaultReturnRefundReductionAmount?: Maybe + maximumReturnRefundReductionAmount?: Maybe + defaultCarrier?: Maybe + carriers?: Maybe>> + printReturnLabel?: Maybe + defaultPrinterType?: Maybe + boxTypes?: Maybe>> + attributes?: Maybe>> + bpmConfigurations?: Maybe>> + auditInfo?: Maybe + autoPackingListPopup?: Maybe + blockPartialStock?: Maybe + defaultMaxNumberOfShipmentsInPickWave?: Maybe + displayProductImagesInPickWaveDetails?: Maybe + enablePnpForSTH?: Maybe + enablePnpForBOPIS?: Maybe + blockPartialCancel?: Maybe + packageSettings?: Maybe +} + +export type LocationGroupConfiguration_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LocationGroupInput = { + locationGroupId: Scalars['Int'] + locationGroupCode?: Maybe + siteIds?: Maybe> + name?: Maybe + locationCodes?: Maybe> + auditInfo?: Maybe +} + +export type LocationInput = { + code?: Maybe + locationTypes?: Maybe>> + name?: Maybe + description?: Maybe + address?: Maybe + geo?: Maybe + phone?: Maybe + fax?: Maybe + supportsInventory?: Maybe + fulfillmentTypes?: Maybe>> + regularHours?: Maybe + shippingOriginContact?: Maybe + note?: Maybe + tags?: Maybe> + attributes?: Maybe>> + auditInfo?: Maybe + allowFulfillmentWithNoStock?: Maybe + isDisabled?: Maybe + express?: Maybe + transferEnabled?: Maybe + includeInInventoryAggregrate?: Maybe + includeInLocationExport?: Maybe + warehouseEnabled?: Maybe + requiresManifest?: Maybe +} + +export type LocationInventory = { + __typename?: 'LocationInventory' + _get?: Maybe + _root?: Maybe + productCode?: Maybe + locationCode?: Maybe + stockAvailable?: Maybe + softStockAvailable?: Maybe + sku?: Maybe + mfgPartNumber?: Maybe +} + +export type LocationInventory_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LocationInventoryCollection = { + __typename?: 'LocationInventoryCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type LocationInventoryCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LocationInventoryQueryInput = { + locationCodes?: Maybe> + productCodes?: Maybe> +} + +export type LocationType = { + __typename?: 'LocationType' + _get?: Maybe + _root?: Maybe + code?: Maybe + name?: Maybe + auditInfo?: Maybe +} + +export type LocationType_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LocationTypeInput = { + code?: Maybe + name?: Maybe + auditInfo?: Maybe +} + +export type LocationUsage = { + __typename?: 'LocationUsage' + _get?: Maybe + _root?: Maybe + locationUsageTypeCode?: Maybe + locationTypeCodes?: Maybe> + locationCodes?: Maybe> + auditInfo?: Maybe +} + +export type LocationUsage_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LocationUsageCollection = { + __typename?: 'LocationUsageCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type LocationUsageCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type LocationUsageInput = { + locationUsageTypeCode?: Maybe + locationTypeCodes?: Maybe> + locationCodes?: Maybe> + auditInfo?: Maybe +} + +export type LoginState = { + __typename?: 'LoginState' + _get?: Maybe + _root?: Maybe + isPasswordChangeRequired?: Maybe + lastPasswordChangeOn?: Maybe + isLocked?: Maybe + lastLockedOn?: Maybe + failedLoginAttemptCount: Scalars['Int'] + remainingLoginAttempts: Scalars['Int'] + firstFailedLoginAttemptOn?: Maybe + lastLoginOn?: Maybe + createdOn?: Maybe + updatedOn?: Maybe +} + +export type LoginState_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type MzdbHttpContentInput = { + headers?: Maybe>> +} + +export type MzdbHttpMethodInput = { + method?: Maybe +} + +export type MzdbHttpRequestMessageInput = { + version?: Maybe + content?: Maybe + method?: Maybe + requestUri?: Maybe + headers?: Maybe>> + properties?: Maybe +} + +export type MzdbStringStringIEnumerableKeyValuePairInput = { + key?: Maybe + value?: Maybe> +} + +export type Mutation = { + __typename?: 'Mutation' + createCustomerAccountAttributeDefinition?: Maybe + updateCustomerAccountAttributeDefinition?: Maybe + validateCustomerAddress?: Maybe + validateAddress?: Maybe>> + createCustomerAuthTicket?: Maybe + refreshCustomerAuthTickets?: Maybe + createCustomerB2bAccountAttribute?: Maybe + deleteB2bAccountAttribute?: Maybe + updateCustomerB2bAccountAttribute?: Maybe + createCustomerB2bAccount?: Maybe + updateCustomerB2bAccount?: Maybe + createCustomerB2bAccountUser?: Maybe + updateCustomerB2bAccountUser?: Maybe + removeCustomerB2bAccountUser?: Maybe + addRoleToCustomerB2bAccount?: Maybe + deleteB2bAccountRole?: Maybe + createCustomerCredit?: Maybe + updateCustomerCredit?: Maybe + deleteCustomerCredit?: Maybe + updateCustomerCreditAssociateToShopper?: Maybe + resendCustomerCreditEmail?: Maybe + createCustomerCreditTransaction?: Maybe + createCustomerAccountAttribute?: Maybe + deleteCustomerAccountAttribute?: Maybe + updateCustomerAccountAttribute?: Maybe + createCustomerAccountCard?: Maybe + updateCustomerAccountCard?: Maybe + deleteCustomerAccountCard?: Maybe + createCustomerAccountContact?: Maybe + updateCustomerAccountContacts?: Maybe + updateCustomerAccountContact?: Maybe + deleteCustomerAccountContact?: Maybe + createCustomerAccount?: Maybe + updateCustomerAccount?: Maybe + deleteCustomerAccount?: Maybe + createCustomerAccountTransaction?: Maybe + deleteCustomerAccountTransaction?: Maybe + recomputeCustomerAccountLifetimeValue?: Maybe + createCustomerAccountNote?: Maybe + updateCustomerAccountNote?: Maybe + deleteCustomerAccountNote?: Maybe + createCustomerAccountPurchaseOrderAccount?: Maybe + updateCustomerPurchaseOrderAccount?: Maybe + createCustomerAccountPurchaseOrderAccountTransaction?: Maybe + createPurchaseOrderAccount?: Maybe + changeCustomerAccountPassword?: Maybe + updateCustomerAccountPasswords?: Maybe + resetCustomerAccountPassword?: Maybe + createCustomerAccountLogin?: Maybe + createCustomerAccountAndLogin?: Maybe + setCustomerAccountLoginLocked?: Maybe + setCustomerAccountPasswordChangeRequired?: Maybe + createCustomerAccounts?: Maybe + createCustomerSegment?: Maybe + updateCustomerSegment?: Maybe + deleteCustomerSegment?: Maybe + createCustomerSegmentAccount?: Maybe + deleteCustomerSegmentAccount?: Maybe + createInStockNotification?: Maybe + deleteInStockNotification?: Maybe + createResolvedPriceList?: Maybe + configureProduct?: Maybe + validateProduct?: Maybe + validateProductDiscounts?: Maybe + manageLocationProductInventory?: Maybe + createProductCost?: Maybe + createCartForUser?: Maybe + updateUserCart?: Maybe + updateCurrentCart?: Maybe + deleteCurrentCart?: Maybe + updateCart?: Maybe + deleteCart?: Maybe + deleteUserCart?: Maybe + rejectCartDiscount?: Maybe + updateCartCoupon?: Maybe + deleteCartCoupons?: Maybe + deleteCartCoupon?: Maybe + addExtendedPropertyToCurrentCart?: Maybe>> + updateCurrentCartExtendedProperties?: Maybe>> + deleteCurrentCartExtendedProperties?: Maybe + updateCurrentCartExtendedProperty?: Maybe + deleteCurrentCartExtendedProperty?: Maybe + deleteCurrentCartItems?: Maybe + addItemToCurrentCart?: Maybe + deleteCartItems?: Maybe + addItemToCart?: Maybe + updateCurrentCartItem?: Maybe + deleteCurrentCartItem?: Maybe + updateCartItem?: Maybe + deleteCartItem?: Maybe + addItemsToCurrentCart?: Maybe + addItemsToCart?: Maybe + updateCurrentCartItemQuantity?: Maybe + updateCartItemQuantity?: Maybe + deleteCurrentCartMessages?: Maybe + deleteCurrentCartMessage?: Maybe + createCommerceChannel?: Maybe + updateChannel?: Maybe + deleteCommerceChannel?: Maybe + createCommerceChannelGroup?: Maybe + updateChannelGroup?: Maybe + deleteCommerceChannelGroup?: Maybe + createCheckoutAttribute?: Maybe>> + updateCheckoutAttributes?: Maybe>> + updateCheckout?: Maybe + createCheckout?: Maybe + createCheckoutShippingMethod?: Maybe + createCheckoutAction?: Maybe + updateCheckoutDigitalWalletType?: Maybe + updateCheckoutPriceList?: Maybe + resendCheckoutEmail?: Maybe + updateCheckoutCoupon?: Maybe + deleteCheckoutCoupons?: Maybe + deleteCheckoutCoupon?: Maybe + updateCheckoutDestination?: Maybe + deleteCheckoutDestination?: Maybe + createCheckoutDestination?: Maybe + createCheckoutItem?: Maybe + deleteCheckoutItem?: Maybe + updateCheckoutItemDestination?: Maybe + createCheckoutItemDestination?: Maybe + createCheckoutPaymentAction?: Maybe + updateCheckoutPaymentAction?: Maybe + createOrderPaymentAction?: Maybe + createOrderPaymentPaymentAction?: Maybe + createOrderAutoCapture?: Maybe + createOrderPickup?: Maybe + updateOrderPickup?: Maybe + deleteOrderPickup?: Maybe + createOrderRefund?: Maybe + updateOrderRefund?: Maybe + createOrderShipment?: Maybe>> + deleteOrderShipment?: Maybe + repriceOrderShipment?: Maybe + createOrderShipmentAdjustment?: Maybe + createOrderShipmentItemAdjustment?: Maybe + splitOrderShipment?: Maybe>> + updateOrderValidationResults?: Maybe + updateOrderAdjustment?: Maybe + deleteOrderAdjustment?: Maybe + updateOrderShippingAdjustment?: Maybe + deleteOrderAdjustmentShipping?: Maybe + updateOrderHandlingAdjustment?: Maybe + deleteOrderAdjustmentHandling?: Maybe + createOrderAttribute?: Maybe>> + updateOrderAttributes?: Maybe>> + updateOrderBillingInfo?: Maybe + cancelOrder?: Maybe + createOrder?: Maybe + updateUserOrder?: Maybe + updateOrderPriceList?: Maybe + resendOrderEmail?: Maybe + updateOrder?: Maybe + updateOrderDigitalWalletTpe?: Maybe + updateOrderDraft?: Maybe + createOrderAction?: Maybe + updateOrderDiscount?: Maybe + updateOrderPrice?: Maybe + updateOrderCoupon?: Maybe + deleteOrderCoupons?: Maybe + deleteOrderCoupon?: Maybe + createOrderDigitalPackage?: Maybe + updateOrderDigitalPackage?: Maybe + deleteOrderDigitalPackage?: Maybe + createOrderExtendedProperties?: Maybe>> + updateOrderExtendedProperties?: Maybe>> + deleteOrderExtendedProperties?: Maybe + updateOrderExtendedProperty?: Maybe + deleteOrderExtendedProperty?: Maybe + createOrderFulfillmentAction?: Maybe + resendOrderFulfillmentEmail?: Maybe + updateOrderFulfillmentInfo?: Maybe + createOrderItem?: Maybe + deleteOrderItem?: Maybe + updateOrderItemPrice?: Maybe + updateOrderItemQuantity?: Maybe + updateOrderItemDutyAmount?: Maybe + updateOrderItemFulfillment?: Maybe + updateOrderItemDiscount?: Maybe + createOrderNote?: Maybe + updateOrderNotes?: Maybe + deleteOrderNote?: Maybe + createOrderPackage?: Maybe + updateOrderPackage?: Maybe + deleteOrderPackage?: Maybe + validateOrder?: Maybe + updateQuote?: Maybe + deleteQuote?: Maybe + createQuote?: Maybe + createQuoteItem?: Maybe + deleteQuoteItem?: Maybe + createReturn?: Maybe + resendReturnEmail?: Maybe + updateReturn?: Maybe + deleteReturn?: Maybe + createReturnAction?: Maybe + setReturnShip?: Maybe + createReturnPaymentAction?: Maybe + createReturnPaymentPaymentAction?: Maybe + setReturnRestock?: Maybe + createReturnItem?: Maybe + deleteReturnItem?: Maybe + createReturnNote?: Maybe + updateReturnNote?: Maybe + deleteReturnNote?: Maybe + createReturnPackage?: Maybe + updateReturnPackage?: Maybe + deleteReturnPackage?: Maybe + createReturnShipment?: Maybe>> + deleteReturnShipment?: Maybe + createWishlist?: Maybe + updateWishlist?: Maybe + deleteWishlist?: Maybe + deleteWishlistItems?: Maybe + createWishlistItem?: Maybe + updateWishlistItem?: Maybe + deleteWishlistItem?: Maybe + updateWishlistItemQuantity?: Maybe + updateDocumentListDocumentContent?: Maybe + deleteDocumentListDocumentContent?: Maybe + updateDocumentListDocumentTreeContent?: Maybe + deleteDocumentListDocumentTreeContent?: Maybe + createDocumentListDocument?: Maybe + updateDocumentListDocument?: Maybe + patchDocumentListDocument?: Maybe + deleteDocumentListDocument?: Maybe + createDocumentList?: Maybe + updateDocumentList?: Maybe + deleteDocumentList?: Maybe + createDocumentListType?: Maybe + updateDocumentListType?: Maybe + createDocumentDraft?: Maybe + toggleDocumentPublishing?: Maybe + createDocumentType?: Maybe + updateDocumentType?: Maybe + createPropertyType?: Maybe + updatePropertyType?: Maybe + deletePropertyType?: Maybe + adminCreateLocation?: Maybe + adminUpdateLocation?: Maybe + deleteAdminLocation?: Maybe + adminCreateLocationAttribute?: Maybe + adminUpdateLocationAttribute?: Maybe + adminCreateLocationGroup?: Maybe + updateLocationUsage?: Maybe + adminCreateLocationType?: Maybe + adminUpdateLocationType?: Maybe + deleteAdminLocationType?: Maybe + updateEntityListEntities?: Maybe + deleteEntityListEntity?: Maybe + createEntityListEntity?: Maybe + updateEntityList?: Maybe + deleteEntityList?: Maybe + createEntityList?: Maybe + createEntityListView?: Maybe + updateEntityListView?: Maybe + deleteEntityListView?: Maybe + createTargetRule?: Maybe + updateTargetRule?: Maybe + deleteCommerceTargetRule?: Maybe + validateTargetRule?: Maybe + createOrderRoutingSuggestion?: Maybe +} + +export type MutationCreateCustomerAccountAttributeDefinitionArgs = { + attributeInput?: Maybe +} + +export type MutationUpdateCustomerAccountAttributeDefinitionArgs = { + attributeFQN: Scalars['String'] + attributeInput?: Maybe +} + +export type MutationValidateCustomerAddressArgs = { + addressValidationRequestInput?: Maybe +} + +export type MutationValidateAddressArgs = { + addressInput?: Maybe +} + +export type MutationCreateCustomerAuthTicketArgs = { + customerUserAuthInfoInput?: Maybe +} + +export type MutationRefreshCustomerAuthTicketsArgs = { + refreshToken?: Maybe +} + +export type MutationCreateCustomerB2bAccountAttributeArgs = { + accountId: Scalars['Int'] + customerAttributeInput?: Maybe +} + +export type MutationDeleteB2bAccountAttributeArgs = { + accountId: Scalars['Int'] + attributeFQN: Scalars['String'] +} + +export type MutationUpdateCustomerB2bAccountAttributeArgs = { + accountId: Scalars['Int'] + attributeFQN: Scalars['String'] + customerAttributeInput?: Maybe +} + +export type MutationCreateCustomerB2bAccountArgs = { + b2BAccountInput?: Maybe +} + +export type MutationUpdateCustomerB2bAccountArgs = { + accountId: Scalars['Int'] + b2BAccountInput?: Maybe +} + +export type MutationCreateCustomerB2bAccountUserArgs = { + accountId: Scalars['Int'] + b2BUserAndAuthInfoInput?: Maybe +} + +export type MutationUpdateCustomerB2bAccountUserArgs = { + accountId: Scalars['Int'] + userId: Scalars['String'] + b2BUserInput?: Maybe +} + +export type MutationRemoveCustomerB2bAccountUserArgs = { + accountId: Scalars['Int'] + userId: Scalars['String'] +} + +export type MutationAddRoleToCustomerB2bAccountArgs = { + accountId: Scalars['Int'] + userId: Scalars['String'] + roleId: Scalars['Int'] +} + +export type MutationDeleteB2bAccountRoleArgs = { + accountId: Scalars['Int'] + userId: Scalars['String'] + roleId: Scalars['Int'] +} + +export type MutationCreateCustomerCreditArgs = { + userId?: Maybe + creditInput?: Maybe +} + +export type MutationUpdateCustomerCreditArgs = { + code: Scalars['String'] + creditInput?: Maybe +} + +export type MutationDeleteCustomerCreditArgs = { + code: Scalars['String'] +} + +export type MutationUpdateCustomerCreditAssociateToShopperArgs = { + code: Scalars['String'] +} + +export type MutationResendCustomerCreditEmailArgs = { + code: Scalars['String'] + userId?: Maybe +} + +export type MutationCreateCustomerCreditTransactionArgs = { + code: Scalars['String'] + creditTransactionInput?: Maybe +} + +export type MutationCreateCustomerAccountAttributeArgs = { + accountId: Scalars['Int'] + userId?: Maybe + customerAttributeInput?: Maybe +} + +export type MutationDeleteCustomerAccountAttributeArgs = { + accountId: Scalars['Int'] + attributeFQN: Scalars['String'] + userId?: Maybe +} + +export type MutationUpdateCustomerAccountAttributeArgs = { + accountId: Scalars['Int'] + attributeFQN: Scalars['String'] + userId?: Maybe + customerAttributeInput?: Maybe +} + +export type MutationCreateCustomerAccountCardArgs = { + accountId: Scalars['Int'] + cardInput?: Maybe +} + +export type MutationUpdateCustomerAccountCardArgs = { + accountId: Scalars['Int'] + cardId: Scalars['String'] + cardInput?: Maybe +} + +export type MutationDeleteCustomerAccountCardArgs = { + accountId: Scalars['Int'] + cardId: Scalars['String'] +} + +export type MutationCreateCustomerAccountContactArgs = { + accountId: Scalars['Int'] + customerContactInput?: Maybe +} + +export type MutationUpdateCustomerAccountContactsArgs = { + accountId: Scalars['Int'] + customerContactInput?: Maybe +} + +export type MutationUpdateCustomerAccountContactArgs = { + accountId: Scalars['Int'] + contactId: Scalars['Int'] + userId?: Maybe + customerContactInput?: Maybe +} + +export type MutationDeleteCustomerAccountContactArgs = { + accountId: Scalars['Int'] + contactId: Scalars['Int'] +} + +export type MutationCreateCustomerAccountArgs = { + customerAccountInput?: Maybe +} + +export type MutationUpdateCustomerAccountArgs = { + accountId: Scalars['Int'] + customerAccountInput?: Maybe +} + +export type MutationDeleteCustomerAccountArgs = { + accountId: Scalars['Int'] +} + +export type MutationCreateCustomerAccountTransactionArgs = { + accountId: Scalars['Int'] + transactionInput?: Maybe +} + +export type MutationDeleteCustomerAccountTransactionArgs = { + accountId: Scalars['Int'] + transactionId: Scalars['String'] +} + +export type MutationRecomputeCustomerAccountLifetimeValueArgs = { + accountId: Scalars['Int'] +} + +export type MutationCreateCustomerAccountNoteArgs = { + accountId: Scalars['Int'] + customerNoteInput?: Maybe +} + +export type MutationUpdateCustomerAccountNoteArgs = { + accountId: Scalars['Int'] + noteId: Scalars['Int'] + customerNoteInput?: Maybe +} + +export type MutationDeleteCustomerAccountNoteArgs = { + accountId: Scalars['Int'] + noteId: Scalars['Int'] +} + +export type MutationCreateCustomerAccountPurchaseOrderAccountArgs = { + accountId: Scalars['Int'] + customerPurchaseOrderAccountInput?: Maybe +} + +export type MutationUpdateCustomerPurchaseOrderAccountArgs = { + accountId: Scalars['Int'] + customerPurchaseOrderAccountInput?: Maybe +} + +export type MutationCreateCustomerAccountPurchaseOrderAccountTransactionArgs = { + accountId: Scalars['Int'] + purchaseOrderTransactionInput?: Maybe +} + +export type MutationCreatePurchaseOrderAccountArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + accountType?: Maybe +} + +export type MutationChangeCustomerAccountPasswordArgs = { + accountId: Scalars['Int'] + unlockAccount?: Maybe + userId?: Maybe + passwordInfoInput?: Maybe +} + +export type MutationUpdateCustomerAccountPasswordsArgs = { + accountPasswordInfoCollectionInput?: Maybe +} + +export type MutationResetCustomerAccountPasswordArgs = { + resetPasswordInfoInput?: Maybe +} + +export type MutationCreateCustomerAccountLoginArgs = { + accountId: Scalars['Int'] + customerLoginInfoInput?: Maybe +} + +export type MutationCreateCustomerAccountAndLoginArgs = { + customerAccountAndAuthInfoInput?: Maybe +} + +export type MutationSetCustomerAccountLoginLockedArgs = { + accountId: Scalars['Int'] + userId?: Maybe + graphQLBoolean?: Maybe +} + +export type MutationSetCustomerAccountPasswordChangeRequiredArgs = { + accountId: Scalars['Int'] + userId?: Maybe + graphQLBoolean?: Maybe +} + +export type MutationCreateCustomerAccountsArgs = { + customerAccountAndAuthInfoInput?: Maybe +} + +export type MutationCreateCustomerSegmentArgs = { + customerSegmentInput?: Maybe +} + +export type MutationUpdateCustomerSegmentArgs = { + id: Scalars['Int'] + customerSegmentInput?: Maybe +} + +export type MutationDeleteCustomerSegmentArgs = { + id: Scalars['Int'] +} + +export type MutationCreateCustomerSegmentAccountArgs = { + id: Scalars['Int'] + graphQLInt?: Maybe +} + +export type MutationDeleteCustomerSegmentAccountArgs = { + id: Scalars['Int'] + accountId: Scalars['Int'] +} + +export type MutationCreateInStockNotificationArgs = { + inStockNotificationSubscriptionInput?: Maybe +} + +export type MutationDeleteInStockNotificationArgs = { + id: Scalars['Int'] +} + +export type MutationCreateResolvedPriceListArgs = { + object?: Maybe +} + +export type MutationConfigureProductArgs = { + productCode: Scalars['String'] + includeOptionDetails?: Maybe + skipInventoryCheck?: Maybe + quantity?: Maybe + purchaseLocation?: Maybe + variationProductCodeFilter?: Maybe + productOptionSelectionsInput?: Maybe +} + +export type MutationValidateProductArgs = { + productCode: Scalars['String'] + skipInventoryCheck?: Maybe + quantity?: Maybe + skipDefaults?: Maybe + purchaseLocation?: Maybe + productOptionSelectionsInput?: Maybe +} + +export type MutationValidateProductDiscountsArgs = { + productCode: Scalars['String'] + variationProductCode?: Maybe + customerAccountId?: Maybe + allowInactive?: Maybe + skipInventoryCheck?: Maybe + discountSelectionsInput?: Maybe +} + +export type MutationManageLocationProductInventoryArgs = { + locationInventoryQueryInput?: Maybe +} + +export type MutationCreateProductCostArgs = { + productCostQueryInput?: Maybe +} + +export type MutationCreateCartForUserArgs = { + userId: Scalars['String'] +} + +export type MutationUpdateUserCartArgs = { + userId: Scalars['String'] + cartInput?: Maybe +} + +export type MutationUpdateCurrentCartArgs = { + cartInput?: Maybe +} + +export type MutationUpdateCartArgs = { + cartId: Scalars['String'] + cartInput?: Maybe +} + +export type MutationDeleteCartArgs = { + cartId: Scalars['String'] +} + +export type MutationDeleteUserCartArgs = { + userId: Scalars['String'] +} + +export type MutationRejectCartDiscountArgs = { + cartId: Scalars['String'] + discountId: Scalars['Int'] +} + +export type MutationUpdateCartCouponArgs = { + cartId: Scalars['String'] + couponCode: Scalars['String'] +} + +export type MutationDeleteCartCouponsArgs = { + cartId: Scalars['String'] +} + +export type MutationDeleteCartCouponArgs = { + cartId: Scalars['String'] + couponCode: Scalars['String'] +} + +export type MutationAddExtendedPropertyToCurrentCartArgs = { + extendedPropertyInput?: Maybe +} + +export type MutationUpdateCurrentCartExtendedPropertiesArgs = { + upsert?: Maybe + extendedPropertyInput?: Maybe +} + +export type MutationDeleteCurrentCartExtendedPropertiesArgs = { + graphQLString?: Maybe +} + +export type MutationUpdateCurrentCartExtendedPropertyArgs = { + key: Scalars['String'] + upsert?: Maybe + extendedPropertyInput?: Maybe +} + +export type MutationDeleteCurrentCartExtendedPropertyArgs = { + key: Scalars['String'] +} + +export type MutationAddItemToCurrentCartArgs = { + cartItemInput?: Maybe +} + +export type MutationDeleteCartItemsArgs = { + cartId: Scalars['String'] +} + +export type MutationAddItemToCartArgs = { + cartId: Scalars['String'] + cartItemInput?: Maybe +} + +export type MutationUpdateCurrentCartItemArgs = { + cartItemId: Scalars['String'] + cartItemInput?: Maybe +} + +export type MutationDeleteCurrentCartItemArgs = { + cartItemId: Scalars['String'] +} + +export type MutationUpdateCartItemArgs = { + cartId: Scalars['String'] + cartItemId: Scalars['String'] + cartItemInput?: Maybe +} + +export type MutationDeleteCartItemArgs = { + cartId: Scalars['String'] + cartItemId: Scalars['String'] +} + +export type MutationAddItemsToCurrentCartArgs = { + throwErrorOnInvalidItems?: Maybe + cartItemInput?: Maybe +} + +export type MutationAddItemsToCartArgs = { + cartId: Scalars['String'] + throwErrorOnInvalidItems?: Maybe + cartItemInput?: Maybe +} + +export type MutationUpdateCurrentCartItemQuantityArgs = { + cartItemId: Scalars['String'] + quantity: Scalars['Int'] +} + +export type MutationUpdateCartItemQuantityArgs = { + cartId: Scalars['String'] + cartItemId: Scalars['String'] + quantity: Scalars['Int'] +} + +export type MutationDeleteCurrentCartMessageArgs = { + messageId: Scalars['String'] +} + +export type MutationCreateCommerceChannelArgs = { + channelInput?: Maybe +} + +export type MutationUpdateChannelArgs = { + code: Scalars['String'] + channelInput?: Maybe +} + +export type MutationDeleteCommerceChannelArgs = { + code: Scalars['String'] +} + +export type MutationCreateCommerceChannelGroupArgs = { + channelGroupInput?: Maybe +} + +export type MutationUpdateChannelGroupArgs = { + code: Scalars['String'] + channelGroupInput?: Maybe +} + +export type MutationDeleteCommerceChannelGroupArgs = { + code: Scalars['String'] +} + +export type MutationCreateCheckoutAttributeArgs = { + checkoutId: Scalars['String'] + orderAttributeInput?: Maybe +} + +export type MutationUpdateCheckoutAttributesArgs = { + checkoutId: Scalars['String'] + removeMissing?: Maybe + orderAttributeInput?: Maybe +} + +export type MutationUpdateCheckoutArgs = { + checkoutId: Scalars['String'] + checkoutInput?: Maybe +} + +export type MutationCreateCheckoutArgs = { + cartId?: Maybe +} + +export type MutationCreateCheckoutShippingMethodArgs = { + checkoutId: Scalars['String'] + checkoutGroupShippingMethodInput?: Maybe +} + +export type MutationCreateCheckoutActionArgs = { + checkoutId: Scalars['String'] + checkoutActionInput?: Maybe +} + +export type MutationUpdateCheckoutDigitalWalletTypeArgs = { + checkoutId: Scalars['String'] + digitalWalletType: Scalars['String'] + digitalWalletInput?: Maybe +} + +export type MutationUpdateCheckoutPriceListArgs = { + checkoutId: Scalars['String'] + graphQLString?: Maybe +} + +export type MutationResendCheckoutEmailArgs = { + checkoutId: Scalars['String'] +} + +export type MutationUpdateCheckoutCouponArgs = { + checkoutId: Scalars['String'] + couponCode: Scalars['String'] +} + +export type MutationDeleteCheckoutCouponsArgs = { + checkoutId: Scalars['String'] +} + +export type MutationDeleteCheckoutCouponArgs = { + checkoutId: Scalars['String'] + couponCode: Scalars['String'] +} + +export type MutationUpdateCheckoutDestinationArgs = { + checkoutId: Scalars['String'] + destinationId: Scalars['String'] + destinationInput?: Maybe +} + +export type MutationDeleteCheckoutDestinationArgs = { + checkoutId: Scalars['String'] + destinationId: Scalars['String'] +} + +export type MutationCreateCheckoutDestinationArgs = { + checkoutId: Scalars['String'] + destinationInput?: Maybe +} + +export type MutationCreateCheckoutItemArgs = { + checkoutId: Scalars['String'] + orderItemInput?: Maybe +} + +export type MutationDeleteCheckoutItemArgs = { + checkoutId: Scalars['String'] + itemId: Scalars['String'] +} + +export type MutationUpdateCheckoutItemDestinationArgs = { + checkoutId: Scalars['String'] + itemId: Scalars['String'] + destinationId: Scalars['String'] +} + +export type MutationCreateCheckoutItemDestinationArgs = { + checkoutId: Scalars['String'] + itemsForDestinationInput?: Maybe +} + +export type MutationCreateCheckoutPaymentActionArgs = { + checkoutId: Scalars['String'] + paymentActionInput?: Maybe +} + +export type MutationUpdateCheckoutPaymentActionArgs = { + checkoutId: Scalars['String'] + paymentId: Scalars['String'] + paymentActionInput?: Maybe +} + +export type MutationCreateOrderPaymentActionArgs = { + orderId: Scalars['String'] + paymentActionInput?: Maybe +} + +export type MutationCreateOrderPaymentPaymentActionArgs = { + orderId: Scalars['String'] + paymentId: Scalars['String'] + paymentActionInput?: Maybe +} + +export type MutationCreateOrderAutoCaptureArgs = { + orderId: Scalars['String'] + forceCapture?: Maybe +} + +export type MutationCreateOrderPickupArgs = { + orderId: Scalars['String'] + pickupInput?: Maybe +} + +export type MutationUpdateOrderPickupArgs = { + orderId: Scalars['String'] + pickupId: Scalars['String'] + pickupInput?: Maybe +} + +export type MutationDeleteOrderPickupArgs = { + orderId: Scalars['String'] + pickupId: Scalars['String'] +} + +export type MutationCreateOrderRefundArgs = { + orderId: Scalars['String'] + refundInput?: Maybe +} + +export type MutationUpdateOrderRefundArgs = { + orderId: Scalars['String'] + refundId: Scalars['String'] +} + +export type MutationCreateOrderShipmentArgs = { + orderId: Scalars['String'] + graphQLString?: Maybe +} + +export type MutationDeleteOrderShipmentArgs = { + orderId: Scalars['String'] + shipmentId: Scalars['String'] +} + +export type MutationRepriceOrderShipmentArgs = { + shipmentNumber: Scalars['Int'] + orderId: Scalars['String'] + repriceShipmentObjectInput?: Maybe +} + +export type MutationCreateOrderShipmentAdjustmentArgs = { + orderId: Scalars['String'] + shipmentNumber: Scalars['Int'] + shipmentAdjustmentInput?: Maybe +} + +export type MutationCreateOrderShipmentItemAdjustmentArgs = { + shipmentNumber: Scalars['Int'] + itemId: Scalars['Int'] + orderId: Scalars['String'] + shipmentItemAdjustmentInput?: Maybe +} + +export type MutationSplitOrderShipmentArgs = { + orderId: Scalars['String'] + shipmentNumber: Scalars['String'] + splitShipmentsObjectInput?: Maybe +} + +export type MutationUpdateOrderValidationResultsArgs = { + orderId: Scalars['String'] + orderValidationResultInput?: Maybe +} + +export type MutationUpdateOrderAdjustmentArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe + adjustmentInput?: Maybe +} + +export type MutationDeleteOrderAdjustmentArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe +} + +export type MutationUpdateOrderShippingAdjustmentArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe + adjustmentInput?: Maybe +} + +export type MutationDeleteOrderAdjustmentShippingArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe +} + +export type MutationUpdateOrderHandlingAdjustmentArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe + adjustmentInput?: Maybe +} + +export type MutationDeleteOrderAdjustmentHandlingArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe +} + +export type MutationCreateOrderAttributeArgs = { + orderId: Scalars['String'] + orderAttributeInput?: Maybe +} + +export type MutationUpdateOrderAttributesArgs = { + orderId: Scalars['String'] + removeMissing?: Maybe + orderAttributeInput?: Maybe +} + +export type MutationUpdateOrderBillingInfoArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe + billingInfoInput?: Maybe +} + +export type MutationCancelOrderArgs = { + orderId: Scalars['String'] + canceledReasonInput?: Maybe +} + +export type MutationCreateOrderArgs = { + cartId?: Maybe + quoteId?: Maybe + orderInput?: Maybe +} + +export type MutationUpdateUserOrderArgs = { + orderId: Scalars['String'] +} + +export type MutationUpdateOrderPriceListArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe + graphQLString?: Maybe +} + +export type MutationResendOrderEmailArgs = { + orderId: Scalars['String'] + orderActionInput?: Maybe +} + +export type MutationUpdateOrderArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe + orderInput?: Maybe +} + +export type MutationUpdateOrderDigitalWalletTpeArgs = { + orderId: Scalars['String'] + digitalWalletType: Scalars['String'] + digitalWalletInput?: Maybe +} + +export type MutationUpdateOrderDraftArgs = { + orderId: Scalars['String'] + version?: Maybe +} + +export type MutationCreateOrderActionArgs = { + orderId: Scalars['String'] + orderActionInput?: Maybe +} + +export type MutationUpdateOrderDiscountArgs = { + orderId: Scalars['String'] + discountId: Scalars['Int'] + updateMode?: Maybe + version?: Maybe + appliedDiscountInput?: Maybe +} + +export type MutationUpdateOrderPriceArgs = { + refreshShipping?: Maybe + orderInput?: Maybe +} + +export type MutationUpdateOrderCouponArgs = { + orderId: Scalars['String'] + couponCode: Scalars['String'] + updateMode?: Maybe + version?: Maybe +} + +export type MutationDeleteOrderCouponsArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe +} + +export type MutationDeleteOrderCouponArgs = { + orderId: Scalars['String'] + couponCode: Scalars['String'] + updateMode?: Maybe + version?: Maybe +} + +export type MutationCreateOrderDigitalPackageArgs = { + orderId: Scalars['String'] + digitalPackageInput?: Maybe +} + +export type MutationUpdateOrderDigitalPackageArgs = { + orderId: Scalars['String'] + digitalPackageId: Scalars['String'] + digitalPackageInput?: Maybe +} + +export type MutationDeleteOrderDigitalPackageArgs = { + orderId: Scalars['String'] + digitalPackageId: Scalars['String'] +} + +export type MutationCreateOrderExtendedPropertiesArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe + extendedPropertyInput?: Maybe +} + +export type MutationUpdateOrderExtendedPropertiesArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe + upsert?: Maybe + extendedPropertyInput?: Maybe +} + +export type MutationDeleteOrderExtendedPropertiesArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe + graphQLString?: Maybe +} + +export type MutationUpdateOrderExtendedPropertyArgs = { + orderId: Scalars['String'] + key: Scalars['String'] + updateMode?: Maybe + version?: Maybe + upsert?: Maybe + extendedPropertyInput?: Maybe +} + +export type MutationDeleteOrderExtendedPropertyArgs = { + orderId: Scalars['String'] + key: Scalars['String'] + updateMode?: Maybe + version?: Maybe +} + +export type MutationCreateOrderFulfillmentActionArgs = { + orderId: Scalars['String'] + fulfillmentActionInput?: Maybe +} + +export type MutationResendOrderFulfillmentEmailArgs = { + orderId: Scalars['String'] + fulfillmentActionInput?: Maybe +} + +export type MutationUpdateOrderFulfillmentInfoArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe + fulfillmentInfoInput?: Maybe +} + +export type MutationCreateOrderItemArgs = { + orderId: Scalars['String'] + updateMode?: Maybe + version?: Maybe + skipInventoryCheck?: Maybe + orderItemInput?: Maybe +} + +export type MutationDeleteOrderItemArgs = { + orderId: Scalars['String'] + orderItemId: Scalars['String'] + updateMode?: Maybe + version?: Maybe +} + +export type MutationUpdateOrderItemPriceArgs = { + orderId: Scalars['String'] + orderItemId: Scalars['String'] + price: Scalars['Float'] + updateMode?: Maybe + version?: Maybe +} + +export type MutationUpdateOrderItemQuantityArgs = { + orderId: Scalars['String'] + orderItemId: Scalars['String'] + quantity: Scalars['Int'] + updateMode?: Maybe + version?: Maybe +} + +export type MutationUpdateOrderItemDutyAmountArgs = { + orderId: Scalars['String'] + orderItemId: Scalars['String'] + dutyAmount: Scalars['Float'] + updateMode?: Maybe + version?: Maybe +} + +export type MutationUpdateOrderItemFulfillmentArgs = { + orderId: Scalars['String'] + orderItemId: Scalars['String'] + updateMode?: Maybe + version?: Maybe + orderItemInput?: Maybe +} + +export type MutationUpdateOrderItemDiscountArgs = { + orderId: Scalars['String'] + orderItemId: Scalars['String'] + discountId: Scalars['Int'] + updateMode?: Maybe + version?: Maybe + appliedDiscountInput?: Maybe +} + +export type MutationCreateOrderNoteArgs = { + orderId: Scalars['String'] + orderNoteInput?: Maybe +} + +export type MutationUpdateOrderNotesArgs = { + orderId: Scalars['String'] + noteId: Scalars['String'] + orderNoteInput?: Maybe +} + +export type MutationDeleteOrderNoteArgs = { + orderId: Scalars['String'] + noteId: Scalars['String'] +} + +export type MutationCreateOrderPackageArgs = { + orderId: Scalars['String'] + packageObjInput?: Maybe +} + +export type MutationUpdateOrderPackageArgs = { + orderId: Scalars['String'] + packageId: Scalars['String'] + packageObjInput?: Maybe +} + +export type MutationDeleteOrderPackageArgs = { + orderId: Scalars['String'] + packageId: Scalars['String'] +} + +export type MutationValidateOrderArgs = { + orderInput?: Maybe +} + +export type MutationUpdateQuoteArgs = { + quoteId: Scalars['String'] + updateMode?: Maybe + quoteInput?: Maybe +} + +export type MutationDeleteQuoteArgs = { + quoteId: Scalars['String'] + draft?: Maybe +} + +export type MutationCreateQuoteArgs = { + quoteInput?: Maybe +} + +export type MutationCreateQuoteItemArgs = { + quoteId: Scalars['String'] + updateMode?: Maybe + orderItemInput?: Maybe +} + +export type MutationDeleteQuoteItemArgs = { + quoteId: Scalars['String'] + quoteItemId: Scalars['String'] + updateMode?: Maybe +} + +export type MutationCreateReturnArgs = { + returnObjInput?: Maybe +} + +export type MutationResendReturnEmailArgs = { + returnActionInput?: Maybe +} + +export type MutationUpdateReturnArgs = { + returnId: Scalars['String'] + returnObjInput?: Maybe +} + +export type MutationDeleteReturnArgs = { + returnId: Scalars['String'] +} + +export type MutationCreateReturnActionArgs = { + returnActionInput?: Maybe +} + +export type MutationSetReturnShipArgs = { + returnId: Scalars['String'] + returnItemSpecifierInput?: Maybe +} + +export type MutationCreateReturnPaymentActionArgs = { + returnId: Scalars['String'] + paymentActionInput?: Maybe +} + +export type MutationCreateReturnPaymentPaymentActionArgs = { + returnId: Scalars['String'] + paymentId: Scalars['String'] + paymentActionInput?: Maybe +} + +export type MutationSetReturnRestockArgs = { + returnId: Scalars['String'] + restockableReturnItemInput?: Maybe +} + +export type MutationCreateReturnItemArgs = { + returnId: Scalars['String'] + returnItemInput?: Maybe +} + +export type MutationDeleteReturnItemArgs = { + returnId?: Maybe + returnItemId?: Maybe + orderId: Scalars['String'] + orderItemId: Scalars['String'] +} + +export type MutationCreateReturnNoteArgs = { + returnId: Scalars['String'] + orderNoteInput?: Maybe +} + +export type MutationUpdateReturnNoteArgs = { + returnId: Scalars['String'] + noteId: Scalars['String'] + orderNoteInput?: Maybe +} + +export type MutationDeleteReturnNoteArgs = { + returnId: Scalars['String'] + noteId: Scalars['String'] +} + +export type MutationCreateReturnPackageArgs = { + returnId: Scalars['String'] + packageObjInput?: Maybe +} + +export type MutationUpdateReturnPackageArgs = { + returnId: Scalars['String'] + packageId: Scalars['String'] + packageObjInput?: Maybe +} + +export type MutationDeleteReturnPackageArgs = { + returnId: Scalars['String'] + packageId: Scalars['String'] +} + +export type MutationCreateReturnShipmentArgs = { + returnId: Scalars['String'] + graphQLString?: Maybe +} + +export type MutationDeleteReturnShipmentArgs = { + returnId: Scalars['String'] + shipmentId: Scalars['String'] +} + +export type MutationCreateWishlistArgs = { + wishlistInput?: Maybe +} + +export type MutationUpdateWishlistArgs = { + wishlistId: Scalars['String'] + wishlistInput?: Maybe +} + +export type MutationDeleteWishlistArgs = { + wishlistId: Scalars['String'] +} + +export type MutationDeleteWishlistItemsArgs = { + wishlistId: Scalars['String'] +} + +export type MutationCreateWishlistItemArgs = { + wishlistId: Scalars['String'] + wishlistItemInput?: Maybe +} + +export type MutationUpdateWishlistItemArgs = { + wishlistId: Scalars['String'] + wishlistItemId: Scalars['String'] + wishlistItemInput?: Maybe +} + +export type MutationDeleteWishlistItemArgs = { + wishlistId: Scalars['String'] + wishlistItemId: Scalars['String'] +} + +export type MutationUpdateWishlistItemQuantityArgs = { + wishlistId: Scalars['String'] + wishlistItemId: Scalars['String'] + quantity: Scalars['Int'] +} + +export type MutationUpdateDocumentListDocumentContentArgs = { + documentListName: Scalars['String'] + documentId: Scalars['String'] + httpRequestMessageInput?: Maybe +} + +export type MutationDeleteDocumentListDocumentContentArgs = { + documentListName: Scalars['String'] + documentId: Scalars['String'] +} + +export type MutationUpdateDocumentListDocumentTreeContentArgs = { + documentListName: Scalars['String'] + documentName: Scalars['String'] + httpRequestMessageInput?: Maybe +} + +export type MutationDeleteDocumentListDocumentTreeContentArgs = { + documentListName: Scalars['String'] + documentName: Scalars['String'] + httpRequestMessageInput?: Maybe +} + +export type MutationCreateDocumentListDocumentArgs = { + documentListName: Scalars['String'] + documentInput?: Maybe +} + +export type MutationUpdateDocumentListDocumentArgs = { + documentListName: Scalars['String'] + documentId: Scalars['String'] + documentInput?: Maybe +} + +export type MutationPatchDocumentListDocumentArgs = { + documentListName: Scalars['String'] + documentId: Scalars['String'] + documentInput?: Maybe +} + +export type MutationDeleteDocumentListDocumentArgs = { + documentListName: Scalars['String'] + documentId: Scalars['String'] +} + +export type MutationCreateDocumentListArgs = { + documentListInput?: Maybe +} + +export type MutationUpdateDocumentListArgs = { + documentListName: Scalars['String'] + documentListInput?: Maybe +} + +export type MutationDeleteDocumentListArgs = { + documentListName: Scalars['String'] +} + +export type MutationCreateDocumentListTypeArgs = { + documentListTypeInput?: Maybe +} + +export type MutationUpdateDocumentListTypeArgs = { + documentListTypeFQN: Scalars['String'] + documentListTypeInput?: Maybe +} + +export type MutationCreateDocumentDraftArgs = { + documentLists?: Maybe + graphQLString?: Maybe +} + +export type MutationToggleDocumentPublishingArgs = { + documentLists?: Maybe + graphQLString?: Maybe +} + +export type MutationCreateDocumentTypeArgs = { + documentTypeInput?: Maybe +} + +export type MutationUpdateDocumentTypeArgs = { + documentTypeName: Scalars['String'] + documentTypeInput?: Maybe +} + +export type MutationCreatePropertyTypeArgs = { + propertyTypeInput?: Maybe +} + +export type MutationUpdatePropertyTypeArgs = { + propertyTypeName: Scalars['String'] + propertyTypeInput?: Maybe +} + +export type MutationDeletePropertyTypeArgs = { + propertyTypeName: Scalars['String'] +} + +export type MutationAdminCreateLocationArgs = { + locationInput?: Maybe +} + +export type MutationAdminUpdateLocationArgs = { + locationCode: Scalars['String'] + locationInput?: Maybe +} + +export type MutationDeleteAdminLocationArgs = { + locationCode: Scalars['String'] +} + +export type MutationAdminCreateLocationAttributeArgs = { + attributeInput?: Maybe +} + +export type MutationAdminUpdateLocationAttributeArgs = { + attributeFQN: Scalars['String'] + attributeInput?: Maybe +} + +export type MutationAdminCreateLocationGroupArgs = { + locationGroupInput?: Maybe +} + +export type MutationUpdateLocationUsageArgs = { + code: Scalars['String'] + locationUsageInput?: Maybe +} + +export type MutationAdminCreateLocationTypeArgs = { + locationTypeInput?: Maybe +} + +export type MutationAdminUpdateLocationTypeArgs = { + locationTypeCode: Scalars['String'] + locationTypeInput?: Maybe +} + +export type MutationDeleteAdminLocationTypeArgs = { + locationTypeCode: Scalars['String'] +} + +export type MutationUpdateEntityListEntitiesArgs = { + entityListFullName: Scalars['String'] + id: Scalars['String'] + httpRequestMessageInput?: Maybe +} + +export type MutationDeleteEntityListEntityArgs = { + entityListFullName: Scalars['String'] + id: Scalars['String'] +} + +export type MutationCreateEntityListEntityArgs = { + entityListFullName: Scalars['String'] + httpRequestMessageInput?: Maybe +} + +export type MutationUpdateEntityListArgs = { + entityListFullName: Scalars['String'] + entityListInput?: Maybe +} + +export type MutationDeleteEntityListArgs = { + entityListFullName: Scalars['String'] +} + +export type MutationCreateEntityListArgs = { + entityListInput?: Maybe +} + +export type MutationCreateEntityListViewArgs = { + entityListFullName: Scalars['String'] + listViewInput?: Maybe +} + +export type MutationUpdateEntityListViewArgs = { + entityListFullName: Scalars['String'] + viewName: Scalars['String'] + listViewInput?: Maybe +} + +export type MutationDeleteEntityListViewArgs = { + entityListFullName: Scalars['String'] + viewName: Scalars['String'] +} + +export type MutationCreateTargetRuleArgs = { + targetRuleInput?: Maybe +} + +export type MutationUpdateTargetRuleArgs = { + code: Scalars['String'] + targetRuleInput?: Maybe +} + +export type MutationDeleteCommerceTargetRuleArgs = { + code: Scalars['String'] +} + +export type MutationValidateTargetRuleArgs = { + targetRuleInput?: Maybe +} + +export type MutationCreateOrderRoutingSuggestionArgs = { + returnSuggestionLog?: Maybe + suggestionRequestInput?: Maybe +} + +export enum NodeTypeEnum { + Array = 'ARRAY', + Binary = 'BINARY', + Boolean = 'BOOLEAN', + Missing = 'MISSING', + Null = 'NULL', + Number = 'NUMBER', + Object = 'OBJECT', + Pojo = 'POJO', + String = 'STRING', +} + +export type Order = { + __typename?: 'Order' + _get?: Maybe + _root?: Maybe + orderNumber?: Maybe + locationCode?: Maybe + version?: Maybe + parentOrderId?: Maybe + parentOrderNumber?: Maybe + parentCheckoutId?: Maybe + parentCheckoutNumber?: Maybe + partialOrderNumber?: Maybe + partialOrderCount?: Maybe + isPartialOrder?: Maybe + parentReturnId?: Maybe + parentReturnNumber?: Maybe + originalCartId?: Maybe + originalQuoteId?: Maybe + originalQuoteNumber?: Maybe + priceListCode?: Maybe + availableActions?: Maybe> + shopperNotes?: Maybe + customerAccountId?: Maybe + customerTaxId?: Maybe + isTaxExempt?: Maybe + email?: Maybe + ipAddress?: Maybe + sourceDevice?: Maybe + acceptsMarketing?: Maybe + status?: Maybe + type?: Maybe + paymentStatus?: Maybe + returnStatus?: Maybe + isEligibleForReturns?: Maybe + totalCollected: Scalars['Float'] + attributes?: Maybe>> + adjustment?: Maybe + shippingAdjustment?: Maybe + handlingAdjustment?: Maybe + shippingDiscounts?: Maybe>> + handlingDiscounts?: Maybe>> + handlingAmount?: Maybe + handlingSubTotal?: Maybe + handlingTotal?: Maybe + dutyAmount?: Maybe + dutyTotal?: Maybe + fulfillmentStatus?: Maybe + submittedDate?: Maybe + cancelledDate?: Maybe + closedDate?: Maybe + acceptedDate?: Maybe + notes?: Maybe>> + items?: Maybe>> + validationResults?: Maybe>> + billingInfo?: Maybe + payments?: Maybe>> + refunds?: Maybe>> + packages?: Maybe>> + pickups?: Maybe>> + digitalPackages?: Maybe>> + shipments?: Maybe>> + isDraft?: Maybe + hasDraft?: Maybe + isImport?: Maybe + isHistoricalImport?: Maybe + importDate?: Maybe + isUnified?: Maybe + externalId?: Maybe + couponCodes?: Maybe> + invalidCoupons?: Maybe>> + amountAvailableForRefund: Scalars['Float'] + amountRemainingForPayment: Scalars['Float'] + amountRefunded: Scalars['Float'] + readyToCapture?: Maybe + isOptInForSms?: Maybe + userId?: Maybe + id?: Maybe + tenantId?: Maybe + siteId?: Maybe + channelCode?: Maybe + currencyCode?: Maybe + visitId?: Maybe + webSessionId?: Maybe + customerInteractionType?: Maybe + fulfillmentInfo?: Maybe + orderDiscounts?: Maybe>> + suggestedDiscounts?: Maybe>> + rejectedDiscounts?: Maybe>> + data?: Maybe + taxData?: Maybe + subtotal?: Maybe + discountedSubtotal?: Maybe + discountTotal?: Maybe + discountedTotal?: Maybe + shippingTotal?: Maybe + shippingSubTotal?: Maybe + shippingTaxTotal?: Maybe + handlingTaxTotal?: Maybe + itemTaxTotal?: Maybe + taxTotal?: Maybe + feeTotal?: Maybe + total?: Maybe + lineItemSubtotalWithOrderAdjustments?: Maybe + shippingAmountBeforeDiscountsAndAdjustments?: Maybe + lastValidationDate?: Maybe + expirationDate?: Maybe + changeMessages?: Maybe>> + extendedProperties?: Maybe>> + discountThresholdMessages?: Maybe>> + auditInfo?: Maybe +} + +export type Order_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type OrderActionInput = { + actionName?: Maybe +} + +export type OrderAttribute = { + __typename?: 'OrderAttribute' + _get?: Maybe + _root?: Maybe + auditInfo?: Maybe + fullyQualifiedName?: Maybe + attributeDefinitionId?: Maybe + values?: Maybe> +} + +export type OrderAttribute_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type OrderAttributeInput = { + auditInfo?: Maybe + fullyQualifiedName?: Maybe + attributeDefinitionId?: Maybe + values?: Maybe> +} + +export type OrderCollection = { + __typename?: 'OrderCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type OrderCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type OrderInput = { + orderNumber?: Maybe + locationCode?: Maybe + version?: Maybe + parentOrderId?: Maybe + parentOrderNumber?: Maybe + parentCheckoutId?: Maybe + parentCheckoutNumber?: Maybe + partialOrderNumber?: Maybe + partialOrderCount?: Maybe + isPartialOrder?: Maybe + parentReturnId?: Maybe + parentReturnNumber?: Maybe + originalCartId?: Maybe + originalQuoteId?: Maybe + originalQuoteNumber?: Maybe + priceListCode?: Maybe + availableActions?: Maybe> + shopperNotes?: Maybe + customerAccountId?: Maybe + customerTaxId?: Maybe + isTaxExempt?: Maybe + email?: Maybe + ipAddress?: Maybe + sourceDevice?: Maybe + acceptsMarketing?: Maybe + status?: Maybe + type?: Maybe + paymentStatus?: Maybe + returnStatus?: Maybe + isEligibleForReturns?: Maybe + totalCollected: Scalars['Float'] + attributes?: Maybe>> + adjustment?: Maybe + shippingAdjustment?: Maybe + handlingAdjustment?: Maybe + shippingDiscounts?: Maybe>> + handlingDiscounts?: Maybe>> + handlingAmount?: Maybe + handlingSubTotal?: Maybe + handlingTotal?: Maybe + dutyAmount?: Maybe + dutyTotal?: Maybe + fulfillmentStatus?: Maybe + submittedDate?: Maybe + cancelledDate?: Maybe + closedDate?: Maybe + acceptedDate?: Maybe + notes?: Maybe>> + items?: Maybe>> + validationResults?: Maybe>> + billingInfo?: Maybe + payments?: Maybe>> + refunds?: Maybe>> + packages?: Maybe>> + pickups?: Maybe>> + digitalPackages?: Maybe>> + shipments?: Maybe>> + isDraft?: Maybe + hasDraft?: Maybe + isImport?: Maybe + isHistoricalImport?: Maybe + importDate?: Maybe + isUnified?: Maybe + externalId?: Maybe + couponCodes?: Maybe> + invalidCoupons?: Maybe>> + amountAvailableForRefund: Scalars['Float'] + amountRemainingForPayment: Scalars['Float'] + amountRefunded: Scalars['Float'] + readyToCapture?: Maybe + isOptInForSms?: Maybe + userId?: Maybe + id?: Maybe + tenantId?: Maybe + siteId?: Maybe + channelCode?: Maybe + currencyCode?: Maybe + visitId?: Maybe + webSessionId?: Maybe + customerInteractionType?: Maybe + fulfillmentInfo?: Maybe + orderDiscounts?: Maybe>> + suggestedDiscounts?: Maybe>> + rejectedDiscounts?: Maybe>> + data?: Maybe + taxData?: Maybe + subtotal?: Maybe + discountedSubtotal?: Maybe + discountTotal?: Maybe + discountedTotal?: Maybe + shippingTotal?: Maybe + shippingSubTotal?: Maybe + shippingTaxTotal?: Maybe + handlingTaxTotal?: Maybe + itemTaxTotal?: Maybe + taxTotal?: Maybe + feeTotal?: Maybe + total?: Maybe + lineItemSubtotalWithOrderAdjustments?: Maybe + shippingAmountBeforeDiscountsAndAdjustments?: Maybe + lastValidationDate?: Maybe + expirationDate?: Maybe + changeMessages?: Maybe>> + extendedProperties?: Maybe>> + discountThresholdMessages?: Maybe>> + auditInfo?: Maybe +} + +export type OrderItemCollection = { + __typename?: 'OrderItemCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type OrderItemCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type OrderItemInput = { + backorderable?: Maybe + customItemData: Scalars['Object'] + itemDependency: Scalars['Int'] + orderItemID: Scalars['Int'] + partNumber: Scalars['String'] + quantity: Scalars['Int'] + sku: Scalars['String'] + upc: Scalars['String'] +} + +export type OrderNote = { + __typename?: 'OrderNote' + _get?: Maybe + _root?: Maybe + id?: Maybe + text?: Maybe + auditInfo?: Maybe +} + +export type OrderNote_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type OrderNoteInput = { + id?: Maybe + text?: Maybe + auditInfo?: Maybe +} + +export type OrderReturnableItem = { + __typename?: 'OrderReturnableItem' + _get?: Maybe + _root?: Maybe + productCode?: Maybe + productName?: Maybe + shipmentNumber?: Maybe + shipmentItemId?: Maybe + quantityOrdered: Scalars['Int'] + quantityFulfilled: Scalars['Int'] + quantityReturned: Scalars['Int'] + quantityReturnable: Scalars['Int'] + fulfillmentStatus?: Maybe + orderItemId?: Maybe + orderLineId: Scalars['Int'] + orderItemOptionAttributeFQN?: Maybe + unitQuantity: Scalars['Int'] + parentProductCode?: Maybe + parentProductName?: Maybe + fulfillmentFields?: Maybe>> + sku?: Maybe + mfgPartNumber?: Maybe +} + +export type OrderReturnableItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type OrderReturnableItemCollection = { + __typename?: 'OrderReturnableItemCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type OrderReturnableItemCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export enum OrderTypeEnum { + Directship = 'DIRECTSHIP', + Transfer = 'TRANSFER', +} + +export type OrderValidationMessage = { + __typename?: 'OrderValidationMessage' + _get?: Maybe + _root?: Maybe + orderItemId?: Maybe + messageType?: Maybe + message?: Maybe +} + +export type OrderValidationMessage_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type OrderValidationMessageInput = { + orderItemId?: Maybe + messageType?: Maybe + message?: Maybe +} + +export type OrderValidationResult = { + __typename?: 'OrderValidationResult' + _get?: Maybe + _root?: Maybe + validationId?: Maybe + validatorName?: Maybe + validatorType?: Maybe + status?: Maybe + createdDate?: Maybe + messages?: Maybe>> +} + +export type OrderValidationResult_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type OrderValidationResultInput = { + validationId?: Maybe + validatorName?: Maybe + validatorType?: Maybe + status?: Maybe + createdDate?: Maybe + messages?: Maybe>> +} + +export type PackageItem = { + __typename?: 'PackageItem' + _get?: Maybe + _root?: Maybe + productCode?: Maybe + quantity: Scalars['Int'] + fulfillmentItemType?: Maybe + lineId?: Maybe + optionAttributeFQN?: Maybe +} + +export type PackageItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PackageItemInput = { + productCode?: Maybe + quantity: Scalars['Int'] + fulfillmentItemType?: Maybe + lineId?: Maybe + optionAttributeFQN?: Maybe +} + +export type PackageObj = { + __typename?: 'PackageObj' + _get?: Maybe + _root?: Maybe + shippingMethodCode?: Maybe + shippingMethodName?: Maybe + shipmentId?: Maybe + trackingNumber?: Maybe + trackingNumbers?: Maybe> + packagingType?: Maybe + hasLabel?: Maybe + measurements?: Maybe + carrier?: Maybe + signatureRequired?: Maybe + trackings?: Maybe>> + id?: Maybe + code?: Maybe + status?: Maybe + items?: Maybe>> + fulfillmentDate?: Maybe + fulfillmentLocationCode?: Maybe + auditInfo?: Maybe + availableActions?: Maybe> + changeMessages?: Maybe>> +} + +export type PackageObj_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PackageObjInput = { + shippingMethodCode?: Maybe + shippingMethodName?: Maybe + shipmentId?: Maybe + trackingNumber?: Maybe + trackingNumbers?: Maybe> + packagingType?: Maybe + hasLabel?: Maybe + measurements?: Maybe + carrier?: Maybe + signatureRequired?: Maybe + trackings?: Maybe>> + id?: Maybe + code?: Maybe + status?: Maybe + items?: Maybe>> + fulfillmentDate?: Maybe + fulfillmentLocationCode?: Maybe + auditInfo?: Maybe + availableActions?: Maybe> + changeMessages?: Maybe>> +} + +export type PackageSettings = { + __typename?: 'PackageSettings' + _get?: Maybe + _root?: Maybe + unitType?: Maybe +} + +export type PackageSettings_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PasswordInfoInput = { + oldPassword?: Maybe + newPassword?: Maybe + externalPassword?: Maybe +} + +export type Payment = { + __typename?: 'Payment' + _get?: Maybe + _root?: Maybe + id?: Maybe + groupId?: Maybe + paymentServiceTransactionId?: Maybe + availableActions?: Maybe> + orderId?: Maybe + paymentType?: Maybe + paymentWorkflow?: Maybe + externalTransactionId?: Maybe + billingInfo?: Maybe + data?: Maybe + status?: Maybe + subPayments?: Maybe>> + interactions?: Maybe>> + isRecurring?: Maybe + amountCollected: Scalars['Float'] + amountCredited: Scalars['Float'] + amountRequested: Scalars['Float'] + changeMessages?: Maybe>> + auditInfo?: Maybe + gatewayGiftCard?: Maybe +} + +export type Payment_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PaymentActionInput = { + actionName?: Maybe + currencyCode?: Maybe + checkNumber?: Maybe + returnUrl?: Maybe + cancelUrl?: Maybe + amount?: Maybe + interactionDate?: Maybe + newBillingInfo?: Maybe + referenceSourcePaymentId?: Maybe + manualGatewayInteraction?: Maybe + externalTransactionId?: Maybe + data?: Maybe +} + +export type PaymentActionTarget = { + __typename?: 'PaymentActionTarget' + _get?: Maybe + _root?: Maybe + targetType?: Maybe + targetId?: Maybe + targetNumber?: Maybe +} + +export type PaymentActionTarget_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PaymentActionTargetInput = { + targetType?: Maybe + targetId?: Maybe + targetNumber?: Maybe +} + +export type PaymentCard = { + __typename?: 'PaymentCard' + _get?: Maybe + _root?: Maybe + paymentServiceCardId?: Maybe + isUsedRecurring?: Maybe + nameOnCard?: Maybe + isCardInfoSaved?: Maybe + isTokenized?: Maybe + paymentOrCardType?: Maybe + cardNumberPartOrMask?: Maybe + expireMonth: Scalars['Int'] + expireYear: Scalars['Int'] + bin?: Maybe +} + +export type PaymentCard_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PaymentCardInput = { + paymentServiceCardId?: Maybe + isUsedRecurring?: Maybe + nameOnCard?: Maybe + isCardInfoSaved?: Maybe + isTokenized?: Maybe + paymentOrCardType?: Maybe + cardNumberPartOrMask?: Maybe + expireMonth: Scalars['Int'] + expireYear: Scalars['Int'] + bin?: Maybe +} + +export type PaymentCollection = { + __typename?: 'PaymentCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type PaymentCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PaymentGatewayInteractionInput = { + gatewayInteractionId?: Maybe + gatewayTransactionId?: Maybe + gatewayAuthCode?: Maybe + gatewayAVSCodes?: Maybe + gatewayCVV2Codes?: Maybe + gatewayResponseCode?: Maybe + gatewayResponseText?: Maybe +} + +export type PaymentGatewayResponseData = { + __typename?: 'PaymentGatewayResponseData' + _get?: Maybe + _root?: Maybe + key?: Maybe + value?: Maybe +} + +export type PaymentGatewayResponseData_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PaymentGatewayResponseDataInput = { + key?: Maybe + value?: Maybe +} + +export type PaymentInput = { + id?: Maybe + groupId?: Maybe + paymentServiceTransactionId?: Maybe + availableActions?: Maybe> + orderId?: Maybe + paymentType?: Maybe + paymentWorkflow?: Maybe + externalTransactionId?: Maybe + billingInfo?: Maybe + data?: Maybe + status?: Maybe + subPayments?: Maybe>> + interactions?: Maybe>> + isRecurring?: Maybe + amountCollected: Scalars['Float'] + amountCredited: Scalars['Float'] + amountRequested: Scalars['Float'] + changeMessages?: Maybe>> + auditInfo?: Maybe + gatewayGiftCard?: Maybe +} + +export type PaymentInteraction = { + __typename?: 'PaymentInteraction' + _get?: Maybe + _root?: Maybe + id?: Maybe + gatewayInteractionId?: Maybe + paymentId?: Maybe + orderId?: Maybe + target?: Maybe + currencyCode?: Maybe + interactionType?: Maybe + checkNumber?: Maybe + status?: Maybe + paymentEntryStatus?: Maybe + isRecurring?: Maybe + isManual?: Maybe + gatewayTransactionId?: Maybe + gatewayAuthCode?: Maybe + gatewayAVSCodes?: Maybe + gatewayCVV2Codes?: Maybe + gatewayResponseCode?: Maybe + gatewayResponseText?: Maybe + gatewayResponseData?: Maybe>> + paymentTransactionInteractionIdReference?: Maybe + amount?: Maybe + note?: Maybe + interactionDate?: Maybe + auditInfo?: Maybe + returnId?: Maybe + refundId?: Maybe + capturableShipmentsSummary?: Maybe>> +} + +export type PaymentInteraction_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PaymentInteractionInput = { + id?: Maybe + gatewayInteractionId?: Maybe + paymentId?: Maybe + orderId?: Maybe + target?: Maybe + currencyCode?: Maybe + interactionType?: Maybe + checkNumber?: Maybe + status?: Maybe + paymentEntryStatus?: Maybe + isRecurring?: Maybe + isManual?: Maybe + gatewayTransactionId?: Maybe + gatewayAuthCode?: Maybe + gatewayAVSCodes?: Maybe + gatewayCVV2Codes?: Maybe + gatewayResponseCode?: Maybe + gatewayResponseText?: Maybe + gatewayResponseData?: Maybe>> + paymentTransactionInteractionIdReference?: Maybe + amount?: Maybe + note?: Maybe + interactionDate?: Maybe + auditInfo?: Maybe + returnId?: Maybe + refundId?: Maybe + capturableShipmentsSummary?: Maybe< + Array> + > +} + +export type PaymentToken = { + __typename?: 'PaymentToken' + _get?: Maybe + _root?: Maybe + paymentServiceTokenId?: Maybe + type?: Maybe +} + +export type PaymentToken_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PaymentTokenInput = { + paymentServiceTokenId?: Maybe + type?: Maybe +} + +export type Pickup = { + __typename?: 'Pickup' + _get?: Maybe + _root?: Maybe + id?: Maybe + code?: Maybe + status?: Maybe + items?: Maybe>> + fulfillmentDate?: Maybe + fulfillmentLocationCode?: Maybe + auditInfo?: Maybe + availableActions?: Maybe> + changeMessages?: Maybe>> +} + +export type Pickup_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PickupInput = { + id?: Maybe + code?: Maybe + status?: Maybe + items?: Maybe>> + fulfillmentDate?: Maybe + fulfillmentLocationCode?: Maybe + auditInfo?: Maybe + availableActions?: Maybe> + changeMessages?: Maybe>> +} + +export type PickupItem = { + __typename?: 'PickupItem' + _get?: Maybe + _root?: Maybe + productCode?: Maybe + quantity: Scalars['Int'] + fulfillmentItemType?: Maybe + lineId?: Maybe + optionAttributeFQN?: Maybe +} + +export type PickupItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PickupItemInput = { + productCode?: Maybe + quantity: Scalars['Int'] + fulfillmentItemType?: Maybe + lineId?: Maybe + optionAttributeFQN?: Maybe +} + +export type PrAppliedDiscount = { + __typename?: 'PrAppliedDiscount' + _get?: Maybe + _root?: Maybe + couponCode?: Maybe + discount?: Maybe + discounts?: Maybe>> + impact: Scalars['Float'] +} + +export type PrAppliedDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PrAttributeValidation = { + __typename?: 'PrAttributeValidation' + _get?: Maybe + _root?: Maybe + regularExpression?: Maybe + minStringLength?: Maybe + maxStringLength?: Maybe + minNumericValue?: Maybe + maxNumericValue?: Maybe + minDateValue?: Maybe + maxDateValue?: Maybe +} + +export type PrAttributeValidation_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PrBundledProduct = { + __typename?: 'PrBundledProduct' + _get?: Maybe + _root?: Maybe + content?: Maybe + productCode?: Maybe + goodsType?: Maybe + quantity: Scalars['Int'] + measurements?: Maybe + isPackagedStandAlone?: Maybe + inventoryInfo?: Maybe + optionAttributeFQN?: Maybe + optionValue?: Maybe + creditValue?: Maybe + productType?: Maybe +} + +export type PrBundledProduct_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PrCategory = { + __typename?: 'PrCategory' + _get?: Maybe + _root?: Maybe + categoryId: Scalars['Int'] + parentCategory?: Maybe + content?: Maybe + childrenCategories?: Maybe>> + sequence?: Maybe + isDisplayed?: Maybe + categoryCode?: Maybe + count?: Maybe + updateDate: Scalars['DateTime'] + shouldSlice?: Maybe +} + +export type PrCategory_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PrDiscount = { + __typename?: 'PrDiscount' + _get?: Maybe + _root?: Maybe + discountId: Scalars['Int'] + expirationDate?: Maybe + name?: Maybe + friendlyDescription?: Maybe + impact: Scalars['Float'] +} + +export type PrDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PrMeasurement = { + __typename?: 'PrMeasurement' + _get?: Maybe + _root?: Maybe + unit?: Maybe + value?: Maybe +} + +export type PrMeasurement_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PrPackageMeasurements = { + __typename?: 'PrPackageMeasurements' + _get?: Maybe + _root?: Maybe + packageHeight?: Maybe + packageWidth?: Maybe + packageLength?: Maybe + packageWeight?: Maybe +} + +export type PrPackageMeasurements_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PriceList = { + __typename?: 'PriceList' + _get?: Maybe + _root?: Maybe + priceListCode?: Maybe + priceListId: Scalars['Int'] + enabled?: Maybe + name?: Maybe + resolvable?: Maybe + isIndexed?: Maybe + filteredInStoreFront?: Maybe + isSiteDefault?: Maybe + description?: Maybe + ancestors?: Maybe>> + descendants?: Maybe>> + validSites?: Maybe> +} + +export type PriceList_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PriceListNode = { + __typename?: 'PriceListNode' + _get?: Maybe + _root?: Maybe + priceListCode?: Maybe + priceListId: Scalars['Int'] + parentPriceListId?: Maybe + priceListLevel: Scalars['Int'] +} + +export type PriceListNode_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingAppliedDiscount = { + __typename?: 'PricingAppliedDiscount' + _get?: Maybe + _root?: Maybe + impact: Scalars['Float'] + discount?: Maybe + couponCode?: Maybe + couponSetId?: Maybe +} + +export type PricingAppliedDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingAppliedLineItemProductDiscount = { + __typename?: 'PricingAppliedLineItemProductDiscount' + _get?: Maybe + _root?: Maybe + appliesToSalePrice?: Maybe + quantity: Scalars['Int'] + impactPerUnit: Scalars['Float'] + isForced?: Maybe + normalizedImpact: Scalars['Float'] + impact: Scalars['Float'] + discount?: Maybe + couponCode?: Maybe + couponSetId?: Maybe +} + +export type PricingAppliedLineItemProductDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingAppliedLineItemShippingDiscount = { + __typename?: 'PricingAppliedLineItemShippingDiscount' + _get?: Maybe + _root?: Maybe + shippingMethodCode?: Maybe + quantity: Scalars['Int'] + impactPerUnit: Scalars['Float'] + isForced?: Maybe + normalizedImpact: Scalars['Float'] + impact: Scalars['Float'] + discount?: Maybe + couponCode?: Maybe + couponSetId?: Maybe +} + +export type PricingAppliedLineItemShippingDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingAppliedOrderShippingDiscount = { + __typename?: 'PricingAppliedOrderShippingDiscount' + _get?: Maybe + _root?: Maybe + shippingMethodCode?: Maybe + impact: Scalars['Float'] + discount?: Maybe + couponCode?: Maybe + couponSetId?: Maybe +} + +export type PricingAppliedOrderShippingDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingDiscount = { + __typename?: 'PricingDiscount' + _get?: Maybe + _root?: Maybe + discountId: Scalars['Int'] + name?: Maybe + friendlyDescription?: Maybe + amount: Scalars['Float'] + scope?: Maybe + maxRedemptions?: Maybe + maximumUsesPerUser?: Maybe + requiresAuthenticatedUser?: Maybe + doesNotApplyToProductsWithSalePrice?: Maybe + maximumRedemptionsPerOrder?: Maybe + maximumDiscountValuePerOrder?: Maybe + maxDiscountValuePerRedemption?: Maybe + doesNotApplyToMultiShipToOrders?: Maybe + includedPriceLists?: Maybe> + redemptions: Scalars['Int'] + type?: Maybe + amountType?: Maybe + target?: Maybe + condition?: Maybe + expirationDate?: Maybe + stackingLayer: Scalars['Int'] +} + +export type PricingDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingDiscountCondition = { + __typename?: 'PricingDiscountCondition' + _get?: Maybe + _root?: Maybe + requiresCoupon?: Maybe + couponCode?: Maybe + minimumQuantityProductsRequiredInCategories?: Maybe + includedCategoryIds?: Maybe> + excludedCategoryIds?: Maybe> + minimumQuantityRequiredProducts?: Maybe + includedProductCodes?: Maybe> + excludedProductCodes?: Maybe> + paymentWorkflows?: Maybe> + customerSegmentIds?: Maybe> + minimumOrderAmount?: Maybe + maximumOrderAmount?: Maybe + minimumLifetimeValueAmount?: Maybe + startDate?: Maybe + expirationDate?: Maybe + minimumCategorySubtotalBeforeDiscounts?: Maybe +} + +export type PricingDiscountCondition_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingDiscountTarget = { + __typename?: 'PricingDiscountTarget' + _get?: Maybe + _root?: Maybe + type?: Maybe + includedCategoryIds?: Maybe> + excludedCategoryIds?: Maybe> + includedCategoriesOperator?: Maybe + excludedCategoriesOperator?: Maybe + includedProductCodes?: Maybe> + excludedProductCodes?: Maybe> + includeAllProducts?: Maybe + shippingMethods?: Maybe> + shippingZones?: Maybe> +} + +export type PricingDiscountTarget_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingProductAttribute = { + __typename?: 'PricingProductAttribute' + _get?: Maybe + _root?: Maybe + inputType?: Maybe + valueType?: Maybe + dataType?: Maybe + name?: Maybe + description?: Maybe +} + +export type PricingProductAttribute_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingProductProperty = { + __typename?: 'PricingProductProperty' + _get?: Maybe + _root?: Maybe + attributeFQN?: Maybe + values?: Maybe>> + attributeDetail?: Maybe + isHidden?: Maybe + isMultiValue?: Maybe +} + +export type PricingProductProperty_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingProductPropertyValue = { + __typename?: 'PricingProductPropertyValue' + _get?: Maybe + _root?: Maybe + value?: Maybe + stringValue?: Maybe +} + +export type PricingProductPropertyValue_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingTaxAttribute = { + __typename?: 'PricingTaxAttribute' + _get?: Maybe + _root?: Maybe + fullyQualifiedName?: Maybe + attributeDefinitionId?: Maybe + values?: Maybe> +} + +export type PricingTaxAttribute_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingTaxContext = { + __typename?: 'PricingTaxContext' + _get?: Maybe + _root?: Maybe + taxContextId?: Maybe + customerId?: Maybe + taxExemptId?: Maybe + originAddress?: Maybe + destinationAddress?: Maybe +} + +export type PricingTaxContext_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingTaxableLineItem = { + __typename?: 'PricingTaxableLineItem' + _get?: Maybe + _root?: Maybe + id?: Maybe + productCode?: Maybe + variantProductCode?: Maybe + productName?: Maybe + productProperties?: Maybe>> + quantity: Scalars['Int'] + lineItemPrice: Scalars['Float'] + discountTotal?: Maybe + discountedTotal?: Maybe + shippingAmount: Scalars['Float'] + handlingAmount?: Maybe + feeTotal?: Maybe + isTaxable?: Maybe + reason?: Maybe + data?: Maybe + productDiscount?: Maybe + shippingDiscount?: Maybe + productDiscounts?: Maybe>> + shippingDiscounts?: Maybe< + Array> + > + originAddress?: Maybe + destinationAddress?: Maybe +} + +export type PricingTaxableLineItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PricingTaxableOrder = { + __typename?: 'PricingTaxableOrder' + _get?: Maybe + _root?: Maybe + orderDate: Scalars['DateTime'] + taxContext?: Maybe + lineItems?: Maybe>> + shippingAmount: Scalars['Float'] + currencyCode?: Maybe + handlingFee: Scalars['Float'] + originalDocumentCode?: Maybe + orderId?: Maybe + orderNumber?: Maybe + originalOrderDate: Scalars['DateTime'] + data?: Maybe + attributes?: Maybe>> + shippingDiscounts?: Maybe>> + shippingDiscount?: Maybe + orderDiscounts?: Maybe>> + orderDiscount?: Maybe + handlingDiscounts?: Maybe>> + handlingDiscount?: Maybe + shippingMethodCode?: Maybe + shippingMethodName?: Maybe + taxRequestType?: Maybe +} + +export type PricingTaxableOrder_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type Product = { + __typename?: 'Product' + _get?: Maybe + _root?: Maybe + productCode?: Maybe + purchaseLocation?: Maybe + productSequence?: Maybe + productUsage?: Maybe + fulfillmentTypesSupported?: Maybe> + goodsType?: Maybe + bundledProducts?: Maybe>> + content?: Maybe + purchasableState?: Maybe + isActive?: Maybe + publishState?: Maybe + price?: Maybe + priceRange?: Maybe + volumePriceBands?: Maybe>> + volumePriceRange?: Maybe + availableShippingDiscounts?: Maybe>> + productType?: Maybe + productTypeId?: Maybe + isTaxable?: Maybe + isRecurring?: Maybe + pricingBehavior?: Maybe + inventoryInfo?: Maybe + createDate: Scalars['DateTime'] + updateDate: Scalars['DateTime'] + dateFirstAvailableInCatalog?: Maybe + catalogStartDate?: Maybe + catalogEndDate?: Maybe + daysAvailableInCatalog?: Maybe + upc?: Maybe + upCs?: Maybe> + mfgPartNumber?: Maybe + mfgPartNumbers?: Maybe> + variationProductCode?: Maybe + categories?: Maybe>> + measurements?: Maybe + isPackagedStandAlone?: Maybe + properties?: Maybe>> + options?: Maybe>> + variations?: Maybe>> + validPriceLists?: Maybe> + locationsInStock?: Maybe> + slicingAttributeFQN?: Maybe + productImageGroups?: Maybe>> + sliceValue?: Maybe + productCollections?: Maybe>> + productCollectionMembers?: Maybe>> + collectionMembersProductContent?: Maybe>> + score: Scalars['Float'] + personalizationScore: Scalars['Float'] +} + +export type Product_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductPropertiesArgs = { + filterAttribute?: Maybe + filterOperator?: Maybe + filterValue?: Maybe +} + +export type ProductCollection = { + __typename?: 'ProductCollection' + _get?: Maybe + _root?: Maybe + nextCursorMark?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type ProductCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductCollectionInfo = { + __typename?: 'ProductCollectionInfo' + _get?: Maybe + _root?: Maybe + productCode?: Maybe + isPrimary?: Maybe +} + +export type ProductCollectionInfo_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductCollectionMember = { + __typename?: 'ProductCollectionMember' + _get?: Maybe + _root?: Maybe + memberKey?: Maybe +} + +export type ProductCollectionMember_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductCollectionMemberKey = { + __typename?: 'ProductCollectionMemberKey' + _get?: Maybe + _root?: Maybe + value?: Maybe +} + +export type ProductCollectionMemberKey_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductContent = { + __typename?: 'ProductContent' + _get?: Maybe + _root?: Maybe + productName?: Maybe + productFullDescription?: Maybe + productShortDescription?: Maybe + metaTagTitle?: Maybe + metaTagDescription?: Maybe + metaTagKeywords?: Maybe + seoFriendlyUrl?: Maybe + productImages?: Maybe>> +} + +export type ProductContent_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductCost = { + __typename?: 'ProductCost' + _get?: Maybe + _root?: Maybe + productCode?: Maybe + cost: Scalars['Float'] +} + +export type ProductCost_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductCostCollection = { + __typename?: 'ProductCostCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type ProductCostCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductCostQueryInput = { + productCodes?: Maybe> +} + +export type ProductForIndexing = { + __typename?: 'ProductForIndexing' + _get?: Maybe + _root?: Maybe + slices?: Maybe>> + productCode?: Maybe + purchaseLocation?: Maybe + productSequence?: Maybe + productUsage?: Maybe + fulfillmentTypesSupported?: Maybe> + goodsType?: Maybe + bundledProducts?: Maybe>> + content?: Maybe + purchasableState?: Maybe + isActive?: Maybe + publishState?: Maybe + price?: Maybe + priceRange?: Maybe + volumePriceBands?: Maybe>> + volumePriceRange?: Maybe + availableShippingDiscounts?: Maybe>> + productType?: Maybe + productTypeId?: Maybe + isTaxable?: Maybe + isRecurring?: Maybe + pricingBehavior?: Maybe + inventoryInfo?: Maybe + createDate: Scalars['DateTime'] + updateDate: Scalars['DateTime'] + dateFirstAvailableInCatalog?: Maybe + catalogStartDate?: Maybe + catalogEndDate?: Maybe + daysAvailableInCatalog?: Maybe + upc?: Maybe + upCs?: Maybe> + mfgPartNumber?: Maybe + mfgPartNumbers?: Maybe> + variationProductCode?: Maybe + categories?: Maybe>> + measurements?: Maybe + isPackagedStandAlone?: Maybe + properties?: Maybe>> + options?: Maybe>> + variations?: Maybe>> + validPriceLists?: Maybe> + locationsInStock?: Maybe> + slicingAttributeFQN?: Maybe + productImageGroups?: Maybe>> + sliceValue?: Maybe + productCollections?: Maybe>> + productCollectionMembers?: Maybe>> + collectionMembersProductContent?: Maybe>> + score: Scalars['Float'] + personalizationScore: Scalars['Float'] +} + +export type ProductForIndexing_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductImage = { + __typename?: 'ProductImage' + _get?: Maybe + _root?: Maybe + imageLabel?: Maybe + altText?: Maybe + imageUrl?: Maybe + cmsId?: Maybe + videoUrl?: Maybe + mediaType?: Maybe + sequence?: Maybe + productImageGroupId?: Maybe +} + +export type ProductImage_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductImageGroup = { + __typename?: 'ProductImageGroup' + _get?: Maybe + _root?: Maybe + productImageGroupId: Scalars['String'] + productImageGroupTags?: Maybe>> +} + +export type ProductImageGroup_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductImageGroupTag = { + __typename?: 'ProductImageGroupTag' + _get?: Maybe + _root?: Maybe + attributeFqn?: Maybe + value?: Maybe +} + +export type ProductImageGroupTag_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductInventoryInfo = { + __typename?: 'ProductInventoryInfo' + _get?: Maybe + _root?: Maybe + manageStock?: Maybe + outOfStockBehavior?: Maybe + onlineStockAvailable?: Maybe + onlineSoftStockAvailable?: Maybe + onlineLocationCode?: Maybe + availableDate?: Maybe +} + +export type ProductInventoryInfo_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductOption = { + __typename?: 'ProductOption' + _get?: Maybe + _root?: Maybe + attributeFQN?: Maybe + isRequired?: Maybe + isMultiValue?: Maybe + values?: Maybe>> + attributeDetail?: Maybe + isProductImageGroupSelector?: Maybe +} + +export type ProductOption_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductOptionSelectionInput = { + attributeFQN?: Maybe + value?: Maybe + attributeValueId?: Maybe + shopperEnteredValue?: Maybe +} + +export type ProductOptionSelectionsInput = { + variationProductCode?: Maybe + options?: Maybe>> +} + +export type ProductOptionValue = { + __typename?: 'ProductOptionValue' + _get?: Maybe + _root?: Maybe + value?: Maybe + attributeValueId: Scalars['Int'] + stringValue?: Maybe + isEnabled?: Maybe + isSelected?: Maybe + isDefault?: Maybe + deltaWeight?: Maybe + deltaPrice?: Maybe + shopperEnteredValue?: Maybe + bundledProduct?: Maybe + displayInfo?: Maybe +} + +export type ProductOptionValue_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductPrice = { + __typename?: 'ProductPrice' + _get?: Maybe + _root?: Maybe + msrp?: Maybe + price?: Maybe + priceType?: Maybe + salePrice?: Maybe + salePriceType?: Maybe + catalogSalePrice?: Maybe + catalogListPrice?: Maybe + discount?: Maybe + creditValue?: Maybe + effectivePricelistCode?: Maybe + priceListEntryCode?: Maybe + priceListEntryMode?: Maybe +} + +export type ProductPrice_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductPriceRange = { + __typename?: 'ProductPriceRange' + _get?: Maybe + _root?: Maybe + lower?: Maybe + upper?: Maybe +} + +export type ProductPriceRange_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductPricingBehaviorInfo = { + __typename?: 'ProductPricingBehaviorInfo' + _get?: Maybe + _root?: Maybe + discountsRestricted?: Maybe + discountsRestrictedStartDate?: Maybe + discountsRestrictedEndDate?: Maybe +} + +export type ProductPricingBehaviorInfo_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductProperty = { + __typename?: 'ProductProperty' + _get?: Maybe + _root?: Maybe + attributeFQN?: Maybe + isHidden?: Maybe + isMultiValue?: Maybe + attributeDetail?: Maybe + values?: Maybe>> + propertyType?: Maybe +} + +export type ProductProperty_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductPropertyValue = { + __typename?: 'ProductPropertyValue' + _get?: Maybe + _root?: Maybe + value?: Maybe + stringValue?: Maybe + displayInfo?: Maybe +} + +export type ProductPropertyValue_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductPurchasableState = { + __typename?: 'ProductPurchasableState' + _get?: Maybe + _root?: Maybe + isPurchasable?: Maybe + messages?: Maybe>> +} + +export type ProductPurchasableState_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductSearchRandomAccessCursor = { + __typename?: 'ProductSearchRandomAccessCursor' + _get?: Maybe + _root?: Maybe + cursorMarks?: Maybe> +} + +export type ProductSearchRandomAccessCursor_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductSearchResult = { + __typename?: 'ProductSearchResult' + _get?: Maybe + _root?: Maybe + facets?: Maybe>> + solrDebugInfo?: Maybe + searchRedirect?: Maybe + searchEngine?: Maybe + nextCursorMark?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type ProductSearchResult_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductStock = { + __typename?: 'ProductStock' + _get?: Maybe + _root?: Maybe + manageStock?: Maybe + isOnBackOrder?: Maybe + availableDate?: Maybe + stockAvailable?: Maybe + aggregateInventory?: Maybe +} + +export type ProductStock_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductStockInput = { + manageStock?: Maybe + isOnBackOrder?: Maybe + availableDate?: Maybe + stockAvailable?: Maybe + aggregateInventory?: Maybe +} + +export type ProductValidationSummary = { + __typename?: 'ProductValidationSummary' + _get?: Maybe + _root?: Maybe + productCode?: Maybe + purchaseLocation?: Maybe + productUsage?: Maybe + fulfillmentTypesSupported?: Maybe> + goodsType?: Maybe + bundledProducts?: Maybe>> + upc?: Maybe + mfgPartNumber?: Maybe + variationProductCode?: Maybe + purchasableState?: Maybe + price?: Maybe + measurements?: Maybe + isPackagedStandAlone?: Maybe + image?: Maybe + productShortDescription?: Maybe + productName?: Maybe + categories?: Maybe>> + properties?: Maybe>> + pricingBehavior?: Maybe + inventoryInfo?: Maybe + isTaxable?: Maybe + productType?: Maybe +} + +export type ProductValidationSummary_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ProductVolumePrice = { + __typename?: 'ProductVolumePrice' + _get?: Maybe + _root?: Maybe + isCurrent?: Maybe + minQty: Scalars['Int'] + maxQty?: Maybe + priceRange?: Maybe + price?: Maybe +} + +export type ProductVolumePrice_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type Property = { + __typename?: 'Property' + _get?: Maybe + _root?: Maybe + name?: Maybe + isRequired?: Maybe + isMultiValued?: Maybe + propertyType?: Maybe +} + +export type Property_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PropertyInput = { + name?: Maybe + isRequired?: Maybe + isMultiValued?: Maybe + propertyType?: Maybe +} + +export type PropertyType = { + __typename?: 'PropertyType' + _get?: Maybe + _root?: Maybe + name?: Maybe + namespace?: Maybe + propertyTypeFQN?: Maybe + adminName?: Maybe + installationPackage?: Maybe + version?: Maybe + dataType?: Maybe + isQueryable?: Maybe + isSortable?: Maybe + isAggregatable?: Maybe +} + +export type PropertyType_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PropertyTypeCollection = { + __typename?: 'PropertyTypeCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type PropertyTypeCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PropertyTypeInput = { + name?: Maybe + namespace?: Maybe + propertyTypeFQN?: Maybe + adminName?: Maybe + installationPackage?: Maybe + version?: Maybe + dataType?: Maybe + isQueryable?: Maybe + isSortable?: Maybe + isAggregatable?: Maybe +} + +export type PurchaseOrderCustomField = { + __typename?: 'PurchaseOrderCustomField' + _get?: Maybe + _root?: Maybe + code?: Maybe + label?: Maybe + value?: Maybe +} + +export type PurchaseOrderCustomField_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PurchaseOrderCustomFieldInput = { + code?: Maybe + label?: Maybe + value?: Maybe +} + +export type PurchaseOrderPayment = { + __typename?: 'PurchaseOrderPayment' + _get?: Maybe + _root?: Maybe + purchaseOrderNumber?: Maybe + paymentTerm?: Maybe + customFields?: Maybe>> +} + +export type PurchaseOrderPayment_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PurchaseOrderPaymentInput = { + purchaseOrderNumber?: Maybe + paymentTerm?: Maybe + customFields?: Maybe>> +} + +export type PurchaseOrderPaymentTerm = { + __typename?: 'PurchaseOrderPaymentTerm' + _get?: Maybe + _root?: Maybe + code?: Maybe + description?: Maybe +} + +export type PurchaseOrderPaymentTerm_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PurchaseOrderPaymentTermInput = { + code?: Maybe + description?: Maybe +} + +export type PurchaseOrderTransaction = { + __typename?: 'PurchaseOrderTransaction' + _get?: Maybe + _root?: Maybe + customerPurchaseOrderAccountId: Scalars['Int'] + externalId?: Maybe + siteId: Scalars['Int'] + tenantId: Scalars['Int'] + transactionDate: Scalars['DateTime'] + orderId?: Maybe + purchaseOrderNumber?: Maybe + transactionAmount: Scalars['Float'] + creditLimit: Scalars['Float'] + additionalTransactionDetail?: Maybe + availableBalance: Scalars['Float'] + transactionTypeId: Scalars['Int'] + transactionDescription?: Maybe + author?: Maybe + auditInfo?: Maybe +} + +export type PurchaseOrderTransaction_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PurchaseOrderTransactionCollection = { + __typename?: 'PurchaseOrderTransactionCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type PurchaseOrderTransactionCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type PurchaseOrderTransactionInput = { + customerPurchaseOrderAccountId: Scalars['Int'] + externalId?: Maybe + siteId: Scalars['Int'] + tenantId: Scalars['Int'] + transactionDate: Scalars['DateTime'] + orderId?: Maybe + purchaseOrderNumber?: Maybe + transactionAmount: Scalars['Float'] + creditLimit: Scalars['Float'] + additionalTransactionDetail?: Maybe + availableBalance: Scalars['Float'] + transactionTypeId: Scalars['Int'] + transactionDescription?: Maybe + author?: Maybe + auditInfo?: Maybe +} + +export type Query = { + __typename?: 'Query' + customerAccountAttributeDefinitions?: Maybe + customerAccountAttributeVocabularyValues?: Maybe< + Array> + > + customerAccountAttributeDefinition?: Maybe + b2bAccountAttributes?: Maybe + b2bAccountAttributeVocabularyValues?: Maybe + b2bAccounts?: Maybe + b2bAccount?: Maybe + b2bAccountUsers?: Maybe + b2bAccountUserRoles?: Maybe + customerCreditAuditTrail?: Maybe + customerCredits?: Maybe + customerCredit?: Maybe + customerCreditTransactions?: Maybe + customerAccountAttributes?: Maybe + customerAccountAttribute?: Maybe + customerAccountCards?: Maybe + customerAccountCard?: Maybe + customerAccountContacts?: Maybe + customerAccountContact?: Maybe + customerAccounts?: Maybe + customerAccount?: Maybe + getCurrentAccount?: Maybe + customerAccountTransactions?: Maybe>> + customerAccountNotes?: Maybe + customerAccountNote?: Maybe + customerAccountSegments?: Maybe + customerAccountAuditLog?: Maybe + customerPurchaseOrderAccount?: Maybe + customerPurchaseOrderAccountTransaction?: Maybe + customerAccountLoginState?: Maybe + customerSegments?: Maybe + customerSegment?: Maybe + customerSets?: Maybe + customerSet?: Maybe + inStockNotifications?: Maybe + inStockNotification?: Maybe + authTicket?: Maybe + exchangeRates?: Maybe>> + resolvedPriceList?: Maybe + categoriesTree?: Maybe + categories?: Maybe + category?: Maybe + products?: Maybe + product?: Maybe + productVersion?: Maybe + productLocationInventory?: Maybe + suggestionSearch?: Maybe + productSearchRandomAccessCursor?: Maybe + productSearch?: Maybe + priceList?: Maybe + cartsSummary?: Maybe + userCartSummary?: Maybe + cartSummary?: Maybe + userCart?: Maybe + currentCart?: Maybe + cart?: Maybe + currentCartExtendedProperties?: Maybe>> + currentCartItems?: Maybe + cartItems?: Maybe + currentCartItem?: Maybe + cartItem?: Maybe + currentCartMessages?: Maybe + channels?: Maybe + channel?: Maybe + channelGroups?: Maybe + channelGroup?: Maybe + checkoutAttributes?: Maybe>> + checkout?: Maybe + checkouts?: Maybe + checkoutShippingMethods?: Maybe>> + checkoutActions?: Maybe>> + checkoutDestination?: Maybe + checkoutDestinations?: Maybe>> + orderPackageActions?: Maybe>> + orderPaymentActions?: Maybe>> + orderPayment?: Maybe + orderPayments?: Maybe + orderPickup?: Maybe + orderPickupActions?: Maybe>> + orderReturnableItems?: Maybe + orderShipment?: Maybe + orderShipmentMethods?: Maybe>> + orderValidationResults?: Maybe>> + orderAttributes?: Maybe>> + orderBillingInfo?: Maybe + orderCancelReasons?: Maybe + orders?: Maybe + order?: Maybe + orderActions?: Maybe>> + orderTaxableOrders?: Maybe>> + orderDigitalPackage?: Maybe + orderDigitalPackageActions?: Maybe>> + orderExtendedProperties?: Maybe>> + orderFulfillmentInfo?: Maybe + orderItems?: Maybe + orderNotes?: Maybe>> + orderNote?: Maybe + orderPackage?: Maybe + orderPackageLabel?: Maybe + quote?: Maybe + quotes?: Maybe + customerAccountQuote?: Maybe + quoteItems?: Maybe>> + customerAccountQuoteItems?: Maybe>> + quoteItem?: Maybe + returns?: Maybe + returnReasons?: Maybe + returnReason?: Maybe + returnActions?: Maybe>> + returnPayments?: Maybe + returnPayment?: Maybe + returnPaymentActions?: Maybe>> + returnShippingLabel?: Maybe + returnItems?: Maybe + returnItem?: Maybe + returnNotes?: Maybe>> + returnNote?: Maybe + returnPackage?: Maybe + returnPackageLabel?: Maybe + returnShipment?: Maybe + wishlists?: Maybe + wishlist?: Maybe + customerWishlist?: Maybe + wishlistItems?: Maybe + customerWishlistItems?: Maybe + wishlistItem?: Maybe + orderItem?: Maybe + documentListDocumentContent?: Maybe + documentListDocumentTransform?: Maybe + documentListTreeDocumentContent?: Maybe + documentListTreeDocumentTransform?: Maybe + documentListDocuments?: Maybe + documentListDocument?: Maybe + documentListTreeDocument?: Maybe + documentLists?: Maybe + documentList?: Maybe + documentListViewDocuments?: Maybe + documentListTypes?: Maybe + documentListType?: Maybe + documentDrafts?: Maybe + documentTypes?: Maybe + documentType?: Maybe + propertyTypes?: Maybe + propertyType?: Maybe + adminLocations?: Maybe + adminLocation?: Maybe + adminLocationAttributes?: Maybe + adminLocationAttributeVocabularyValues?: Maybe< + Array> + > + adminLocationAttribute?: Maybe + adminLocationGroups?: Maybe + dslLocation?: Maybe + spLocations?: Maybe + spLocation?: Maybe + usageTypeLocations?: Maybe + location?: Maybe + locationUsages?: Maybe + locationUsage?: Maybe + adminLocationTypes?: Maybe>> + adminLocationType?: Maybe + locationGroupConfig?: Maybe + locationGroup?: Maybe + entityListEntity?: Maybe + entityListEntities?: Maybe + entityListEntityContainer?: Maybe + entityListEntityContainers?: Maybe + entityList?: Maybe + entityLists?: Maybe + entityListViews?: Maybe + entityListView?: Maybe + entityListViewEntityContainers?: Maybe + entityListViewEntities?: Maybe + entityListViewEntityContainer?: Maybe + entityListViewEntity?: Maybe + carrierLocaleServiceTypes?: Maybe>> + localeServiceTypes?: Maybe>> + targetRules?: Maybe + targetRule?: Maybe + orderRoutingRoutingSuggestionLog?: Maybe>> +} + +export type QueryCustomerAccountAttributeDefinitionsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryCustomerAccountAttributeVocabularyValuesArgs = { + attributeFQN: Scalars['String'] +} + +export type QueryCustomerAccountAttributeDefinitionArgs = { + attributeFQN: Scalars['String'] +} + +export type QueryB2bAccountAttributesArgs = { + accountId: Scalars['Int'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryB2bAccountAttributeVocabularyValuesArgs = { + accountId: Scalars['Int'] + attributeFQN: Scalars['String'] +} + +export type QueryB2bAccountsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe + fields?: Maybe + q?: Maybe + qLimit?: Maybe +} + +export type QueryB2bAccountArgs = { + accountId: Scalars['Int'] +} + +export type QueryB2bAccountUsersArgs = { + accountId: Scalars['Int'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe + q?: Maybe + qLimit?: Maybe +} + +export type QueryB2bAccountUserRolesArgs = { + accountId: Scalars['Int'] + userId: Scalars['String'] +} + +export type QueryCustomerCreditAuditTrailArgs = { + code: Scalars['String'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryCustomerCreditsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryCustomerCreditArgs = { + code: Scalars['String'] +} + +export type QueryCustomerCreditTransactionsArgs = { + code: Scalars['String'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryCustomerAccountAttributesArgs = { + accountId: Scalars['Int'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe + userId?: Maybe +} + +export type QueryCustomerAccountAttributeArgs = { + accountId: Scalars['Int'] + attributeFQN: Scalars['String'] + userId?: Maybe +} + +export type QueryCustomerAccountCardsArgs = { + accountId: Scalars['Int'] +} + +export type QueryCustomerAccountCardArgs = { + accountId: Scalars['Int'] + cardId: Scalars['String'] +} + +export type QueryCustomerAccountContactsArgs = { + accountId: Scalars['Int'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe + userId?: Maybe +} + +export type QueryCustomerAccountContactArgs = { + accountId: Scalars['Int'] + contactId: Scalars['Int'] + userId?: Maybe +} + +export type QueryCustomerAccountsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe + fields?: Maybe + q?: Maybe + qLimit?: Maybe + isAnonymous?: Maybe +} + +export type QueryCustomerAccountArgs = { + accountId: Scalars['Int'] + userId?: Maybe +} + +export type QueryCustomerAccountTransactionsArgs = { + accountId: Scalars['Int'] +} + +export type QueryCustomerAccountNotesArgs = { + accountId: Scalars['Int'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryCustomerAccountNoteArgs = { + accountId: Scalars['Int'] + noteId: Scalars['Int'] +} + +export type QueryCustomerAccountSegmentsArgs = { + accountId: Scalars['Int'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryCustomerAccountAuditLogArgs = { + accountId: Scalars['Int'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryCustomerPurchaseOrderAccountArgs = { + accountId: Scalars['Int'] +} + +export type QueryCustomerPurchaseOrderAccountTransactionArgs = { + accountId: Scalars['Int'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryCustomerAccountLoginStateArgs = { + accountId: Scalars['Int'] + userId?: Maybe +} + +export type QueryCustomerSegmentsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryCustomerSegmentArgs = { + id: Scalars['Int'] +} + +export type QueryCustomerSetsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe +} + +export type QueryCustomerSetArgs = { + code: Scalars['String'] +} + +export type QueryInStockNotificationsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryInStockNotificationArgs = { + id: Scalars['Int'] +} + +export type QueryAuthTicketArgs = { + accountId?: Maybe +} + +export type QueryResolvedPriceListArgs = { + customerAccountId?: Maybe +} + +export type QueryCategoriesArgs = { + filter?: Maybe + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe +} + +export type QueryCategoryArgs = { + categoryId: Scalars['Int'] + allowInactive?: Maybe +} + +export type QueryProductsArgs = { + filter?: Maybe + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + responseOptions?: Maybe + cursorMark?: Maybe + defaultSort?: Maybe + mid?: Maybe + includeAllImages?: Maybe +} + +export type QueryProductArgs = { + productCode: Scalars['String'] + variationProductCode?: Maybe + allowInactive?: Maybe + skipInventoryCheck?: Maybe + supressOutOfStock404?: Maybe + quantity?: Maybe + acceptVariantProductCode?: Maybe + purchaseLocation?: Maybe + variationProductCodeFilter?: Maybe + sliceValue?: Maybe + includeAllImages?: Maybe +} + +export type QueryProductVersionArgs = { + productCode: Scalars['String'] + productVersion?: Maybe + lastModifiedDate?: Maybe +} + +export type QueryProductLocationInventoryArgs = { + productCode: Scalars['String'] + locationCodes?: Maybe +} + +export type QuerySuggestionSearchArgs = { + query?: Maybe + groups?: Maybe + pageSize?: Maybe + mid?: Maybe + filter?: Maybe +} + +export type QueryProductSearchRandomAccessCursorArgs = { + query?: Maybe + filter?: Maybe + pageSize?: Maybe +} + +export type QueryProductSearchArgs = { + query?: Maybe + filter?: Maybe + facetTemplate?: Maybe + facetTemplateSubset?: Maybe + facet?: Maybe + facetFieldRangeQuery?: Maybe + facetHierPrefix?: Maybe + facetHierValue?: Maybe + facetHierDepth?: Maybe + facetStartIndex?: Maybe + facetPageSize?: Maybe + facetSettings?: Maybe + facetValueFilter?: Maybe + sortBy?: Maybe + pageSize?: Maybe + startIndex?: Maybe + searchSettings?: Maybe + enableSearchTuningRules?: Maybe + searchTuningRuleContext?: Maybe + searchTuningRuleCode?: Maybe + facetTemplateExclude?: Maybe + facetPrefix?: Maybe + responseOptions?: Maybe + cursorMark?: Maybe + facetValueSort?: Maybe + defaultSort?: Maybe + sortDefinitionName?: Maybe + defaultSortDefinitionName?: Maybe + shouldSlice?: Maybe + mid?: Maybe + omitNamespace?: Maybe +} + +export type QueryPriceListArgs = { + priceListCode?: Maybe +} + +export type QueryUserCartSummaryArgs = { + userId: Scalars['String'] +} + +export type QueryCartSummaryArgs = { + cartId: Scalars['String'] +} + +export type QueryUserCartArgs = { + userId: Scalars['String'] +} + +export type QueryCartArgs = { + cartId: Scalars['String'] +} + +export type QueryCartItemsArgs = { + cartId: Scalars['String'] +} + +export type QueryCurrentCartItemArgs = { + cartItemId: Scalars['String'] +} + +export type QueryCartItemArgs = { + cartId: Scalars['String'] + cartItemId: Scalars['String'] +} + +export type QueryChannelsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryChannelArgs = { + code: Scalars['String'] +} + +export type QueryChannelGroupsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryChannelGroupArgs = { + code: Scalars['String'] +} + +export type QueryCheckoutAttributesArgs = { + checkoutId: Scalars['String'] +} + +export type QueryCheckoutArgs = { + checkoutId: Scalars['String'] +} + +export type QueryCheckoutsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe + q?: Maybe + qLimit?: Maybe +} + +export type QueryCheckoutShippingMethodsArgs = { + checkoutId: Scalars['String'] +} + +export type QueryCheckoutActionsArgs = { + checkoutId: Scalars['String'] +} + +export type QueryCheckoutDestinationArgs = { + checkoutId: Scalars['String'] + destinationId: Scalars['String'] +} + +export type QueryCheckoutDestinationsArgs = { + checkoutId: Scalars['String'] +} + +export type QueryOrderPackageActionsArgs = { + orderId: Scalars['String'] + packageId: Scalars['String'] +} + +export type QueryOrderPaymentActionsArgs = { + orderId: Scalars['String'] + paymentId: Scalars['String'] +} + +export type QueryOrderPaymentArgs = { + orderId: Scalars['String'] + paymentId: Scalars['String'] +} + +export type QueryOrderPaymentsArgs = { + orderId: Scalars['String'] +} + +export type QueryOrderPickupArgs = { + orderId: Scalars['String'] + pickupId: Scalars['String'] +} + +export type QueryOrderPickupActionsArgs = { + orderId: Scalars['String'] + pickupId: Scalars['String'] +} + +export type QueryOrderReturnableItemsArgs = { + orderId: Scalars['String'] +} + +export type QueryOrderShipmentArgs = { + orderId: Scalars['String'] + shipmentId: Scalars['String'] +} + +export type QueryOrderShipmentMethodsArgs = { + orderId: Scalars['String'] + draft?: Maybe +} + +export type QueryOrderValidationResultsArgs = { + orderId: Scalars['String'] +} + +export type QueryOrderAttributesArgs = { + orderId: Scalars['String'] +} + +export type QueryOrderBillingInfoArgs = { + orderId: Scalars['String'] + draft?: Maybe +} + +export type QueryOrderCancelReasonsArgs = { + category?: Maybe +} + +export type QueryOrdersArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe + q?: Maybe + qLimit?: Maybe + includeBin?: Maybe + mode?: Maybe +} + +export type QueryOrderArgs = { + orderId: Scalars['String'] + draft?: Maybe + includeBin?: Maybe + mode?: Maybe +} + +export type QueryOrderActionsArgs = { + orderId: Scalars['String'] +} + +export type QueryOrderTaxableOrdersArgs = { + orderId: Scalars['String'] +} + +export type QueryOrderDigitalPackageArgs = { + orderId: Scalars['String'] + digitalPackageId: Scalars['String'] +} + +export type QueryOrderDigitalPackageActionsArgs = { + orderId: Scalars['String'] + digitalPackageId: Scalars['String'] +} + +export type QueryOrderExtendedPropertiesArgs = { + orderId: Scalars['String'] + draft?: Maybe +} + +export type QueryOrderFulfillmentInfoArgs = { + orderId: Scalars['String'] + draft?: Maybe +} + +export type QueryOrderItemsArgs = { + orderId: Scalars['String'] + draft?: Maybe +} + +export type QueryOrderNotesArgs = { + orderId: Scalars['String'] +} + +export type QueryOrderNoteArgs = { + orderId: Scalars['String'] + noteId: Scalars['String'] +} + +export type QueryOrderPackageArgs = { + orderId: Scalars['String'] + packageId: Scalars['String'] +} + +export type QueryOrderPackageLabelArgs = { + orderId: Scalars['String'] + packageId: Scalars['String'] +} + +export type QueryQuoteArgs = { + quoteId: Scalars['String'] + draft?: Maybe +} + +export type QueryQuotesArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe + q?: Maybe + qLimit?: Maybe +} + +export type QueryCustomerAccountQuoteArgs = { + customerAccountId: Scalars['Int'] + quoteName: Scalars['String'] + draft?: Maybe +} + +export type QueryQuoteItemsArgs = { + quoteId: Scalars['String'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryCustomerAccountQuoteItemsArgs = { + customerAccountId: Scalars['Int'] + quoteName: Scalars['String'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryQuoteItemArgs = { + quoteId: Scalars['String'] + quoteItemId: Scalars['String'] + draft?: Maybe +} + +export type QueryReturnsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe + q?: Maybe +} + +export type QueryReturnReasonArgs = { + returnId: Scalars['String'] +} + +export type QueryReturnActionsArgs = { + returnId: Scalars['String'] +} + +export type QueryReturnPaymentsArgs = { + returnId: Scalars['String'] +} + +export type QueryReturnPaymentArgs = { + returnId: Scalars['String'] + paymentId: Scalars['String'] +} + +export type QueryReturnPaymentActionsArgs = { + returnId: Scalars['String'] + paymentId: Scalars['String'] +} + +export type QueryReturnShippingLabelArgs = { + returnId: Scalars['String'] +} + +export type QueryReturnItemsArgs = { + returnId: Scalars['String'] +} + +export type QueryReturnItemArgs = { + returnId: Scalars['String'] + returnItemId: Scalars['String'] +} + +export type QueryReturnNotesArgs = { + returnId: Scalars['String'] +} + +export type QueryReturnNoteArgs = { + returnId: Scalars['String'] + noteId: Scalars['String'] +} + +export type QueryReturnPackageArgs = { + returnId: Scalars['String'] + packageId: Scalars['String'] +} + +export type QueryReturnPackageLabelArgs = { + returnId: Scalars['String'] + packageId: Scalars['String'] + returnAsBase64Png?: Maybe +} + +export type QueryReturnShipmentArgs = { + returnId: Scalars['String'] + shipmentId: Scalars['String'] +} + +export type QueryWishlistsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe + q?: Maybe + qLimit?: Maybe +} + +export type QueryWishlistArgs = { + wishlistId: Scalars['String'] +} + +export type QueryCustomerWishlistArgs = { + customerAccountId: Scalars['Int'] + wishlistName: Scalars['String'] +} + +export type QueryWishlistItemsArgs = { + wishlistId: Scalars['String'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryCustomerWishlistItemsArgs = { + customerAccountId: Scalars['Int'] + wishlistName: Scalars['String'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryWishlistItemArgs = { + wishlistId: Scalars['String'] + wishlistItemId: Scalars['String'] +} + +export type QueryOrderItemArgs = { + orderId?: Maybe + lineId?: Maybe + orderItemId?: Maybe + draft?: Maybe +} + +export type QueryDocumentListDocumentContentArgs = { + documentListName: Scalars['String'] + documentId: Scalars['String'] +} + +export type QueryDocumentListDocumentTransformArgs = { + documentListName: Scalars['String'] + documentId: Scalars['String'] + width?: Maybe + height?: Maybe + max?: Maybe + maxWidth?: Maybe + maxHeight?: Maybe + crop?: Maybe + quality?: Maybe +} + +export type QueryDocumentListTreeDocumentContentArgs = { + documentListName: Scalars['String'] + documentName: Scalars['String'] +} + +export type QueryDocumentListTreeDocumentTransformArgs = { + documentListName: Scalars['String'] + documentName: Scalars['String'] + width?: Maybe + height?: Maybe + max?: Maybe + maxWidth?: Maybe + maxHeight?: Maybe + crop?: Maybe + quality?: Maybe +} + +export type QueryDocumentListDocumentsArgs = { + documentListName: Scalars['String'] + filter?: Maybe + sortBy?: Maybe + pageSize?: Maybe + startIndex?: Maybe + includeInactive?: Maybe + path?: Maybe + includeSubPaths?: Maybe + queryScope?: Maybe +} + +export type QueryDocumentListDocumentArgs = { + documentListName: Scalars['String'] + documentId: Scalars['String'] + includeInactive?: Maybe +} + +export type QueryDocumentListTreeDocumentArgs = { + documentListName: Scalars['String'] + documentName: Scalars['String'] + includeInactive?: Maybe +} + +export type QueryDocumentListsArgs = { + pageSize?: Maybe + startIndex?: Maybe +} + +export type QueryDocumentListArgs = { + documentListName: Scalars['String'] +} + +export type QueryDocumentListViewDocumentsArgs = { + documentListName: Scalars['String'] + viewName: Scalars['String'] + filter?: Maybe + sortBy?: Maybe + pageSize?: Maybe + startIndex?: Maybe + includeInactive?: Maybe +} + +export type QueryDocumentListTypesArgs = { + pageSize?: Maybe + startIndex?: Maybe +} + +export type QueryDocumentListTypeArgs = { + documentListTypeFQN: Scalars['String'] +} + +export type QueryDocumentDraftsArgs = { + pageSize?: Maybe + startIndex?: Maybe + documentLists?: Maybe +} + +export type QueryDocumentTypesArgs = { + pageSize?: Maybe + startIndex?: Maybe +} + +export type QueryDocumentTypeArgs = { + documentTypeName: Scalars['String'] +} + +export type QueryPropertyTypesArgs = { + pageSize?: Maybe + startIndex?: Maybe +} + +export type QueryPropertyTypeArgs = { + propertyTypeName: Scalars['String'] +} + +export type QueryAdminLocationsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryAdminLocationArgs = { + locationCode: Scalars['String'] +} + +export type QueryAdminLocationAttributesArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryAdminLocationAttributeVocabularyValuesArgs = { + attributeFQN: Scalars['String'] +} + +export type QueryAdminLocationAttributeArgs = { + attributeFQN: Scalars['String'] +} + +export type QueryAdminLocationGroupsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryDslLocationArgs = { + includeAttributeDefinition?: Maybe +} + +export type QuerySpLocationsArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe + includeAttributeDefinition?: Maybe +} + +export type QuerySpLocationArgs = { + locationCode: Scalars['String'] + includeAttributeDefinition?: Maybe +} + +export type QueryUsageTypeLocationsArgs = { + locationUsageType: Scalars['String'] + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe + includeAttributeDefinition?: Maybe +} + +export type QueryLocationArgs = { + locationCode: Scalars['String'] + includeAttributeDefinition?: Maybe +} + +export type QueryLocationUsageArgs = { + code: Scalars['String'] +} + +export type QueryAdminLocationTypeArgs = { + locationTypeCode: Scalars['String'] +} + +export type QueryLocationGroupConfigArgs = { + locationGroupId?: Maybe + locationGroupCode?: Maybe + locationCode?: Maybe +} + +export type QueryLocationGroupArgs = { + groupId?: Maybe + locationGroupCode?: Maybe +} + +export type QueryEntityListEntityArgs = { + entityListFullName: Scalars['String'] + id: Scalars['String'] +} + +export type QueryEntityListEntitiesArgs = { + entityListFullName: Scalars['String'] + pageSize?: Maybe + startIndex?: Maybe + filter?: Maybe + sortBy?: Maybe +} + +export type QueryEntityListEntityContainerArgs = { + entityListFullName: Scalars['String'] + id: Scalars['String'] +} + +export type QueryEntityListEntityContainersArgs = { + entityListFullName: Scalars['String'] + pageSize?: Maybe + startIndex?: Maybe + filter?: Maybe + sortBy?: Maybe +} + +export type QueryEntityListArgs = { + entityListFullName: Scalars['String'] +} + +export type QueryEntityListsArgs = { + pageSize?: Maybe + startIndex?: Maybe + filter?: Maybe + sortBy?: Maybe +} + +export type QueryEntityListViewsArgs = { + entityListFullName: Scalars['String'] +} + +export type QueryEntityListViewArgs = { + entityListFullName: Scalars['String'] + viewName: Scalars['String'] +} + +export type QueryEntityListViewEntityContainersArgs = { + entityListFullName: Scalars['String'] + viewName: Scalars['String'] + pageSize?: Maybe + startIndex?: Maybe + filter?: Maybe +} + +export type QueryEntityListViewEntitiesArgs = { + entityListFullName: Scalars['String'] + viewName: Scalars['String'] + pageSize?: Maybe + startIndex?: Maybe + filter?: Maybe +} + +export type QueryEntityListViewEntityContainerArgs = { + entityListFullName: Scalars['String'] + viewName: Scalars['String'] + entityId: Scalars['String'] +} + +export type QueryEntityListViewEntityArgs = { + entityListFullName: Scalars['String'] + viewName: Scalars['String'] + entityId: Scalars['String'] +} + +export type QueryCarrierLocaleServiceTypesArgs = { + carrierId: Scalars['String'] + localeCode: Scalars['String'] +} + +export type QueryLocaleServiceTypesArgs = { + localeCode: Scalars['String'] +} + +export type QueryTargetRulesArgs = { + startIndex?: Maybe + pageSize?: Maybe + sortBy?: Maybe + filter?: Maybe +} + +export type QueryTargetRuleArgs = { + code: Scalars['String'] +} + +export type QueryOrderRoutingRoutingSuggestionLogArgs = { + externalResponseID?: Maybe + orderID?: Maybe + responseID?: Maybe + suggestionID?: Maybe +} + +export type Quote = { + __typename?: 'Quote' + _get?: Maybe + _root?: Maybe + id?: Maybe + name?: Maybe + siteId: Scalars['Int'] + tenantId: Scalars['Int'] + number?: Maybe + submittedDate?: Maybe + items?: Maybe>> + auditHistory?: Maybe>> + auditInfo?: Maybe + comments?: Maybe>> + expirationDate?: Maybe + fulfillmentInfo?: Maybe + userId?: Maybe + customerAccountId?: Maybe + email?: Maybe + customerTaxId?: Maybe + isTaxExempt?: Maybe + currencyCode?: Maybe + priceListCode?: Maybe + data?: Maybe + taxData?: Maybe + channelCode?: Maybe + locationCode?: Maybe + ipAddress?: Maybe + sourceDevice?: Maybe + visitId?: Maybe + webSessionId?: Maybe + customerInteractionType?: Maybe + orderDiscounts?: Maybe>> + subTotal: Scalars['Float'] + itemLevelProductDiscountTotal: Scalars['Float'] + orderLevelProductDiscountTotal: Scalars['Float'] + itemTaxTotal: Scalars['Float'] + adjustment?: Maybe + itemTotal: Scalars['Float'] + total: Scalars['Float'] + shippingDiscounts?: Maybe>> + itemLevelShippingDiscountTotal: Scalars['Float'] + orderLevelShippingDiscountTotal: Scalars['Float'] + shippingAmount: Scalars['Float'] + shippingAdjustment?: Maybe + shippingSubTotal: Scalars['Float'] + shippingTax?: Maybe + shippingTaxTotal: Scalars['Float'] + shippingTotal: Scalars['Float'] + handlingDiscounts?: Maybe>> + itemLevelHandlingDiscountTotal: Scalars['Float'] + orderLevelHandlingDiscountTotal: Scalars['Float'] + handlingAmount?: Maybe + handlingAdjustment?: Maybe + handlingSubTotal: Scalars['Float'] + handlingTax?: Maybe + handlingTaxTotal: Scalars['Float'] + handlingTotal: Scalars['Float'] + dutyAmount?: Maybe + dutyTotal: Scalars['Float'] + feeTotal: Scalars['Float'] + isDraft?: Maybe + hasDraft?: Maybe + status?: Maybe + couponCodes?: Maybe> + invalidCoupons?: Maybe>> +} + +export type Quote_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type QuoteCollection = { + __typename?: 'QuoteCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type QuoteCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type QuoteComment = { + __typename?: 'QuoteComment' + _get?: Maybe + _root?: Maybe + id?: Maybe + text?: Maybe + auditInfo?: Maybe +} + +export type QuoteComment_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type QuoteCommentInput = { + id?: Maybe + text?: Maybe + auditInfo?: Maybe +} + +export type QuoteInput = { + id?: Maybe + name?: Maybe + siteId: Scalars['Int'] + tenantId: Scalars['Int'] + number?: Maybe + submittedDate?: Maybe + items?: Maybe>> + auditHistory?: Maybe>> + auditInfo?: Maybe + comments?: Maybe>> + expirationDate?: Maybe + fulfillmentInfo?: Maybe + userId?: Maybe + customerAccountId?: Maybe + email?: Maybe + customerTaxId?: Maybe + isTaxExempt?: Maybe + currencyCode?: Maybe + priceListCode?: Maybe + data?: Maybe + taxData?: Maybe + channelCode?: Maybe + locationCode?: Maybe + ipAddress?: Maybe + sourceDevice?: Maybe + visitId?: Maybe + webSessionId?: Maybe + customerInteractionType?: Maybe + orderDiscounts?: Maybe>> + subTotal: Scalars['Float'] + itemLevelProductDiscountTotal: Scalars['Float'] + orderLevelProductDiscountTotal: Scalars['Float'] + itemTaxTotal: Scalars['Float'] + adjustment?: Maybe + itemTotal: Scalars['Float'] + total: Scalars['Float'] + shippingDiscounts?: Maybe>> + itemLevelShippingDiscountTotal: Scalars['Float'] + orderLevelShippingDiscountTotal: Scalars['Float'] + shippingAmount: Scalars['Float'] + shippingAdjustment?: Maybe + shippingSubTotal: Scalars['Float'] + shippingTax?: Maybe + shippingTaxTotal: Scalars['Float'] + shippingTotal: Scalars['Float'] + handlingDiscounts?: Maybe>> + itemLevelHandlingDiscountTotal: Scalars['Float'] + orderLevelHandlingDiscountTotal: Scalars['Float'] + handlingAmount?: Maybe + handlingAdjustment?: Maybe + handlingSubTotal: Scalars['Float'] + handlingTax?: Maybe + handlingTaxTotal: Scalars['Float'] + handlingTotal: Scalars['Float'] + dutyAmount?: Maybe + dutyTotal: Scalars['Float'] + feeTotal: Scalars['Float'] + isDraft?: Maybe + hasDraft?: Maybe + status?: Maybe + couponCodes?: Maybe> + invalidCoupons?: Maybe>> +} + +export type ReasonCollection = { + __typename?: 'ReasonCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe> +} + +export type ReasonCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type Refund = { + __typename?: 'Refund' + _get?: Maybe + _root?: Maybe + id?: Maybe + orderId?: Maybe + reason?: Maybe + reasonCode?: Maybe + payment?: Maybe + amount: Scalars['Float'] + refundMethod?: Maybe + auditInfo?: Maybe +} + +export type Refund_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type RefundInput = { + id?: Maybe + orderId?: Maybe + reason?: Maybe + reasonCode?: Maybe + payment?: Maybe + amount: Scalars['Float'] + refundMethod?: Maybe + auditInfo?: Maybe +} + +export type RegularHours = { + __typename?: 'RegularHours' + _get?: Maybe + _root?: Maybe + sunday?: Maybe + monday?: Maybe + tuesday?: Maybe + wednesday?: Maybe + thursday?: Maybe + friday?: Maybe + saturday?: Maybe + timeZone?: Maybe +} + +export type RegularHours_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type RegularHoursInput = { + sunday?: Maybe + monday?: Maybe + tuesday?: Maybe + wednesday?: Maybe + thursday?: Maybe + friday?: Maybe + saturday?: Maybe + timeZone?: Maybe +} + +export type RepriceShipmentObjectInput = { + originalShipment?: Maybe + newShipment?: Maybe +} + +export type ResetPasswordInfoInput = { + emailAddress?: Maybe + userName?: Maybe + customerSetCode?: Maybe +} + +export type ResolvedPriceList = { + __typename?: 'ResolvedPriceList' + _get?: Maybe + _root?: Maybe + priceListCode?: Maybe + priceListId: Scalars['Int'] + name?: Maybe + description?: Maybe +} + +export type ResolvedPriceList_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type RestockableReturnItemInput = { + returnItemId?: Maybe + quantity: Scalars['Int'] + locationCode?: Maybe +} + +export type ReturnActionInput = { + actionName?: Maybe + returnIds?: Maybe> +} + +export type ReturnBundle = { + __typename?: 'ReturnBundle' + _get?: Maybe + _root?: Maybe + productCode?: Maybe + quantity: Scalars['Int'] +} + +export type ReturnBundle_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ReturnBundleInput = { + productCode?: Maybe + quantity: Scalars['Int'] +} + +export type ReturnCollection = { + __typename?: 'ReturnCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type ReturnCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ReturnItem = { + __typename?: 'ReturnItem' + _get?: Maybe + _root?: Maybe + id?: Maybe + orderItemId?: Maybe + orderLineId?: Maybe + orderItemOptionAttributeFQN?: Maybe + product?: Maybe + reasons?: Maybe>> + excludeProductExtras?: Maybe + returnType?: Maybe + returnNotRequired?: Maybe + quantityReceived: Scalars['Int'] + receiveStatus?: Maybe + quantityShipped: Scalars['Int'] + replaceStatus?: Maybe + quantityRestockable: Scalars['Int'] + quantityRestocked: Scalars['Int'] + refundAmount?: Maybe + refundStatus?: Maybe + quantityReplaced?: Maybe + notes?: Maybe>> + productLossAmount?: Maybe + productLossTaxAmount?: Maybe + shippingLossAmount?: Maybe + shippingLossTaxAmount?: Maybe + bundledProducts?: Maybe>> + totalWithoutWeightedShippingAndHandling?: Maybe + totalWithWeightedShippingAndHandling?: Maybe + shipmentItemId?: Maybe + shipmentNumber?: Maybe +} + +export type ReturnItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ReturnItemCollection = { + __typename?: 'ReturnItemCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type ReturnItemCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ReturnItemInput = { + id?: Maybe + orderItemId?: Maybe + orderLineId?: Maybe + orderItemOptionAttributeFQN?: Maybe + product?: Maybe + reasons?: Maybe>> + excludeProductExtras?: Maybe + returnType?: Maybe + returnNotRequired?: Maybe + quantityReceived: Scalars['Int'] + receiveStatus?: Maybe + quantityShipped: Scalars['Int'] + replaceStatus?: Maybe + quantityRestockable: Scalars['Int'] + quantityRestocked: Scalars['Int'] + refundAmount?: Maybe + refundStatus?: Maybe + quantityReplaced?: Maybe + notes?: Maybe>> + productLossAmount?: Maybe + productLossTaxAmount?: Maybe + shippingLossAmount?: Maybe + shippingLossTaxAmount?: Maybe + bundledProducts?: Maybe>> + totalWithoutWeightedShippingAndHandling?: Maybe + totalWithWeightedShippingAndHandling?: Maybe + shipmentItemId?: Maybe + shipmentNumber?: Maybe +} + +export type ReturnItemSpecifierInput = { + returnItemId?: Maybe + quantity: Scalars['Int'] +} + +export type ReturnObj = { + __typename?: 'ReturnObj' + _get?: Maybe + _root?: Maybe + id?: Maybe + customerAccountId?: Maybe + visitId?: Maybe + webSessionId?: Maybe + customerInteractionType?: Maybe + availableActions?: Maybe> + returnNumber?: Maybe + contact?: Maybe + locationCode?: Maybe + originalOrderId?: Maybe + originalOrderNumber?: Maybe + returnOrderId?: Maybe + currencyCode?: Maybe + status?: Maybe + receiveStatus?: Maybe + refundStatus?: Maybe + replaceStatus?: Maybe + items?: Maybe>> + notes?: Maybe>> + rmaDeadline?: Maybe + returnType?: Maybe + refundAmount?: Maybe + auditInfo?: Maybe + payments?: Maybe>> + packages?: Maybe>> + productLossTotal?: Maybe + shippingLossTotal?: Maybe + lossTotal?: Maybe + productLossTaxTotal?: Maybe + shippingLossTaxTotal?: Maybe + tenantId?: Maybe + siteId?: Maybe + userId?: Maybe + channelCode?: Maybe + changeMessages?: Maybe>> + actionRequired?: Maybe + isUnified?: Maybe +} + +export type ReturnObj_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ReturnObjInput = { + id?: Maybe + customerAccountId?: Maybe + visitId?: Maybe + webSessionId?: Maybe + customerInteractionType?: Maybe + availableActions?: Maybe> + returnNumber?: Maybe + contact?: Maybe + locationCode?: Maybe + originalOrderId?: Maybe + originalOrderNumber?: Maybe + returnOrderId?: Maybe + currencyCode?: Maybe + status?: Maybe + receiveStatus?: Maybe + refundStatus?: Maybe + replaceStatus?: Maybe + items?: Maybe>> + notes?: Maybe>> + rmaDeadline?: Maybe + returnType?: Maybe + refundAmount?: Maybe + auditInfo?: Maybe + payments?: Maybe>> + packages?: Maybe>> + productLossTotal?: Maybe + shippingLossTotal?: Maybe + lossTotal?: Maybe + productLossTaxTotal?: Maybe + shippingLossTaxTotal?: Maybe + tenantId?: Maybe + siteId?: Maybe + userId?: Maybe + channelCode?: Maybe + changeMessages?: Maybe>> + actionRequired?: Maybe + isUnified?: Maybe +} + +export type ReturnReason = { + __typename?: 'ReturnReason' + _get?: Maybe + _root?: Maybe + reason?: Maybe + quantity: Scalars['Int'] +} + +export type ReturnReason_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ReturnReasonInput = { + reason?: Maybe + quantity: Scalars['Int'] +} + +export type SearchSuggestion = { + __typename?: 'SearchSuggestion' + _get?: Maybe + _root?: Maybe + suggestionType?: Maybe + suggestion?: Maybe +} + +export type SearchSuggestion_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type SearchSuggestionGroup = { + __typename?: 'SearchSuggestionGroup' + _get?: Maybe + _root?: Maybe + name?: Maybe + suggestions?: Maybe>> +} + +export type SearchSuggestionGroup_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type SearchSuggestionResult = { + __typename?: 'SearchSuggestionResult' + _get?: Maybe + _root?: Maybe + query?: Maybe + suggestionGroups?: Maybe>> +} + +export type SearchSuggestionResult_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ServiceType = { + __typename?: 'ServiceType' + _get?: Maybe + _root?: Maybe + code?: Maybe + deliveryDuration?: Maybe + content?: Maybe +} + +export type ServiceType_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ServiceTypeLocalizedContent = { + __typename?: 'ServiceTypeLocalizedContent' + _get?: Maybe + _root?: Maybe + localeCode?: Maybe + name?: Maybe +} + +export type ServiceTypeLocalizedContent_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type Shipment = { + __typename?: 'Shipment' + _get?: Maybe + _root?: Maybe + id?: Maybe + externalShipmentId?: Maybe + number?: Maybe + orderId?: Maybe + orderNumber: Scalars['Int'] + email?: Maybe + currencyCode?: Maybe + customerAccountId?: Maybe + customerTaxId?: Maybe + shipmentType?: Maybe + shippingMethodCode?: Maybe + shippingMethodName?: Maybe + fulfillmentLocationCode?: Maybe + origin?: Maybe + destination?: Maybe + shipmentStatus?: Maybe + shipmentStatusReason?: Maybe + transferShipmentNumbers?: Maybe> + isTransfer?: Maybe + originalShipmentNumber?: Maybe + parentShipmentNumber?: Maybe + fulfillmentStatus?: Maybe + workflowProcessId?: Maybe + workflowProcessContainerId?: Maybe + workflowState?: Maybe + backorderCreatedDate?: Maybe + fulfillmentDate?: Maybe + orderSubmitDate?: Maybe + pickStatus?: Maybe + pickType?: Maybe + changeMessages?: Maybe>> + packages?: Maybe>> + items?: Maybe>> + canceledItems?: Maybe>> + data?: Maybe + taxData?: Maybe + auditInfo?: Maybe + shipmentAdjustment: Scalars['Float'] + lineItemSubtotal: Scalars['Float'] + lineItemTaxAdjustment: Scalars['Float'] + lineItemTaxTotal: Scalars['Float'] + lineItemTotal: Scalars['Float'] + shippingAdjustment: Scalars['Float'] + shippingSubtotal: Scalars['Float'] + shippingTaxAdjustment: Scalars['Float'] + shippingTaxTotal: Scalars['Float'] + shippingTotal: Scalars['Float'] + handlingAdjustment: Scalars['Float'] + handlingSubtotal: Scalars['Float'] + handlingTaxAdjustment: Scalars['Float'] + handlingTaxTotal: Scalars['Float'] + handlingTotal: Scalars['Float'] + dutyAdjustment: Scalars['Float'] + dutyTotal: Scalars['Float'] + total: Scalars['Float'] + cost?: Maybe + externalOrderId?: Maybe + isExpress?: Maybe + readyToCapture?: Maybe + pickupInfo?: Maybe + shopperNotes?: Maybe + customer?: Maybe +} + +export type Shipment_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ShipmentAdjustmentInput = { + itemAdjustment?: Maybe + itemTaxAdjustment?: Maybe + shippingAdjustment?: Maybe + shippingTaxAdjustment?: Maybe + handlingAdjustment?: Maybe + handlingTaxAdjustment?: Maybe +} + +export type ShipmentInput = { + id?: Maybe + externalShipmentId?: Maybe + number?: Maybe + orderId?: Maybe + orderNumber: Scalars['Int'] + email?: Maybe + currencyCode?: Maybe + customerAccountId?: Maybe + customerTaxId?: Maybe + shipmentType?: Maybe + shippingMethodCode?: Maybe + shippingMethodName?: Maybe + fulfillmentLocationCode?: Maybe + origin?: Maybe + destination?: Maybe + shipmentStatus?: Maybe + shipmentStatusReason?: Maybe + transferShipmentNumbers?: Maybe> + isTransfer?: Maybe + originalShipmentNumber?: Maybe + parentShipmentNumber?: Maybe + fulfillmentStatus?: Maybe + workflowProcessId?: Maybe + workflowProcessContainerId?: Maybe + workflowState?: Maybe + backorderCreatedDate?: Maybe + fulfillmentDate?: Maybe + orderSubmitDate?: Maybe + pickStatus?: Maybe + pickType?: Maybe + changeMessages?: Maybe>> + packages?: Maybe>> + items?: Maybe>> + canceledItems?: Maybe>> + data?: Maybe + taxData?: Maybe + auditInfo?: Maybe + shipmentAdjustment: Scalars['Float'] + lineItemSubtotal: Scalars['Float'] + lineItemTaxAdjustment: Scalars['Float'] + lineItemTaxTotal: Scalars['Float'] + lineItemTotal: Scalars['Float'] + shippingAdjustment: Scalars['Float'] + shippingSubtotal: Scalars['Float'] + shippingTaxAdjustment: Scalars['Float'] + shippingTaxTotal: Scalars['Float'] + shippingTotal: Scalars['Float'] + handlingAdjustment: Scalars['Float'] + handlingSubtotal: Scalars['Float'] + handlingTaxAdjustment: Scalars['Float'] + handlingTaxTotal: Scalars['Float'] + handlingTotal: Scalars['Float'] + dutyAdjustment: Scalars['Float'] + dutyTotal: Scalars['Float'] + total: Scalars['Float'] + cost?: Maybe + externalOrderId?: Maybe + isExpress?: Maybe + readyToCapture?: Maybe + pickupInfo?: Maybe + shopperNotes?: Maybe + customer?: Maybe +} + +export type ShipmentItem = { + __typename?: 'ShipmentItem' + _get?: Maybe + _root?: Maybe + lineId: Scalars['Int'] + originalOrderItemId?: Maybe + parentId?: Maybe + productCode?: Maybe + variationProductCode?: Maybe + optionAttributeFQN?: Maybe + name?: Maybe + auditInfo?: Maybe + fulfillmentLocationCode?: Maybe + imageUrl?: Maybe + isTaxable?: Maybe + quantity: Scalars['Int'] + unitPrice: Scalars['Float'] + actualPrice: Scalars['Float'] + overridePrice?: Maybe + itemDiscount: Scalars['Float'] + lineItemCost: Scalars['Float'] + itemTax: Scalars['Float'] + shipping: Scalars['Float'] + shippingDiscount: Scalars['Float'] + shippingTax: Scalars['Float'] + handling: Scalars['Float'] + handlingDiscount: Scalars['Float'] + handlingTax: Scalars['Float'] + duty: Scalars['Float'] + isPackagedStandAlone?: Maybe + readyForPickupQuantity?: Maybe + backorderReleaseDate?: Maybe + measurements?: Maybe + options?: Maybe>> + data?: Maybe + taxData?: Maybe + weightedShipmentAdjustment: Scalars['Float'] + weightedLineItemTaxAdjustment: Scalars['Float'] + weightedShippingAdjustment: Scalars['Float'] + weightedShippingTaxAdjustment: Scalars['Float'] + weightedHandlingAdjustment: Scalars['Float'] + weightedHandlingTaxAdjustment: Scalars['Float'] + weightedDutyAdjustment: Scalars['Float'] + taxableShipping: Scalars['Float'] + taxableLineItemCost: Scalars['Float'] + taxableHandling: Scalars['Float'] + fulfillmentFields?: Maybe>> + isAssemblyRequired?: Maybe + parentItemId?: Maybe + childItemIds?: Maybe> + giftCards?: Maybe>> +} + +export type ShipmentItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ShipmentItemAdjustmentInput = { + overridePrice?: Maybe +} + +export type ShipmentItemInput = { + lineId: Scalars['Int'] + originalOrderItemId?: Maybe + parentId?: Maybe + productCode?: Maybe + variationProductCode?: Maybe + optionAttributeFQN?: Maybe + name?: Maybe + auditInfo?: Maybe + fulfillmentLocationCode?: Maybe + imageUrl?: Maybe + isTaxable?: Maybe + quantity: Scalars['Int'] + unitPrice: Scalars['Float'] + actualPrice: Scalars['Float'] + overridePrice?: Maybe + itemDiscount: Scalars['Float'] + lineItemCost: Scalars['Float'] + itemTax: Scalars['Float'] + shipping: Scalars['Float'] + shippingDiscount: Scalars['Float'] + shippingTax: Scalars['Float'] + handling: Scalars['Float'] + handlingDiscount: Scalars['Float'] + handlingTax: Scalars['Float'] + duty: Scalars['Float'] + isPackagedStandAlone?: Maybe + readyForPickupQuantity?: Maybe + backorderReleaseDate?: Maybe + measurements?: Maybe + options?: Maybe>> + data?: Maybe + taxData?: Maybe + weightedShipmentAdjustment: Scalars['Float'] + weightedLineItemTaxAdjustment: Scalars['Float'] + weightedShippingAdjustment: Scalars['Float'] + weightedShippingTaxAdjustment: Scalars['Float'] + weightedHandlingAdjustment: Scalars['Float'] + weightedHandlingTaxAdjustment: Scalars['Float'] + weightedDutyAdjustment: Scalars['Float'] + taxableShipping: Scalars['Float'] + taxableLineItemCost: Scalars['Float'] + taxableHandling: Scalars['Float'] + fulfillmentFields?: Maybe>> + isAssemblyRequired?: Maybe + parentItemId?: Maybe + childItemIds?: Maybe> + giftCards?: Maybe>> +} + +export type ShipmentStatusReason = { + __typename?: 'ShipmentStatusReason' + _get?: Maybe + _root?: Maybe + reasonCode?: Maybe + moreInfo?: Maybe +} + +export type ShipmentStatusReason_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ShipmentStatusReasonInput = { + reasonCode?: Maybe + moreInfo?: Maybe +} + +export type ShippingAddressInput = { + addressID: Scalars['Int'] + addressLine1: Scalars['String'] + city: Scalars['String'] + countryCode: Scalars['String'] + customerID: Scalars['Int'] + latitude: Scalars['Float'] + longitude: Scalars['Float'] + phone: Scalars['String'] + postalCode: Scalars['String'] + state: Scalars['String'] +} + +export type ShippingDiscount = { + __typename?: 'ShippingDiscount' + _get?: Maybe + _root?: Maybe + methodCode?: Maybe + discount?: Maybe +} + +export type ShippingDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ShippingDiscountInput = { + methodCode?: Maybe + discount?: Maybe +} + +export type ShippingMethodMappings = { + __typename?: 'ShippingMethodMappings' + _get?: Maybe + _root?: Maybe + shippingMethods?: Maybe> + returnLabelShippingMethod?: Maybe + standardDefault?: Maybe + express1DayDefault?: Maybe + express2DayDefault?: Maybe + express3DayDefault?: Maybe + enableSmartPost?: Maybe + internationalUsReturnLabelShippingMethod?: Maybe +} + +export type ShippingMethodMappings_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ShippingOriginContact = { + __typename?: 'ShippingOriginContact' + _get?: Maybe + _root?: Maybe + firstName?: Maybe + middleNameOrInitial?: Maybe + lastNameOrSurname?: Maybe + companyOrOrganization?: Maybe + phoneNumber?: Maybe + email?: Maybe +} + +export type ShippingOriginContact_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ShippingOriginContactInput = { + firstName?: Maybe + middleNameOrInitial?: Maybe + lastNameOrSurname?: Maybe + companyOrOrganization?: Maybe + phoneNumber?: Maybe + email?: Maybe +} + +export type ShippingRate = { + __typename?: 'ShippingRate' + _get?: Maybe + _root?: Maybe + shippingMethodCode?: Maybe + shippingMethodName?: Maybe + shippingZoneCode?: Maybe + isValid?: Maybe + messages?: Maybe> + data?: Maybe + currencyCode?: Maybe + price?: Maybe +} + +export type ShippingRate_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ShippingRateInput = { + shippingMethodCode?: Maybe + shippingMethodName?: Maybe + shippingZoneCode?: Maybe + isValid?: Maybe + messages?: Maybe> + data?: Maybe + currencyCode?: Maybe + price?: Maybe +} + +export type ShopperNotes = { + __typename?: 'ShopperNotes' + _get?: Maybe + _root?: Maybe + giftMessage?: Maybe + comments?: Maybe + deliveryInstructions?: Maybe +} + +export type ShopperNotes_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ShopperNotesInput = { + giftMessage?: Maybe + comments?: Maybe + deliveryInstructions?: Maybe +} + +export type SolrDebugInfo = { + __typename?: 'SolrDebugInfo' + _get?: Maybe + _root?: Maybe + searchTuningRuleCode?: Maybe + boostedProductCodes?: Maybe> + blockedProductCodes?: Maybe> + boostQueries?: Maybe> + boostFunctions?: Maybe> +} + +export type SolrDebugInfo_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type SplitShipmentsObjectInput = { + originalShipment?: Maybe + newShipments?: Maybe>> +} + +export type SubPayment = { + __typename?: 'SubPayment' + _get?: Maybe + _root?: Maybe + status?: Maybe + amountCollected: Scalars['Float'] + amountCredited: Scalars['Float'] + amountRequested: Scalars['Float'] + amountRefunded: Scalars['Float'] + target?: Maybe +} + +export type SubPayment_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type SubPaymentInput = { + status?: Maybe + amountCollected: Scalars['Float'] + amountCredited: Scalars['Float'] + amountRequested: Scalars['Float'] + amountRefunded: Scalars['Float'] + target?: Maybe +} + +export type SuggestedDiscount = { + __typename?: 'SuggestedDiscount' + _get?: Maybe + _root?: Maybe + productCode?: Maybe + autoAdd?: Maybe + discountId: Scalars['Int'] + hasMultipleProducts?: Maybe + hasOptions?: Maybe +} + +export type SuggestedDiscount_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type SuggestedDiscountInput = { + productCode?: Maybe + autoAdd?: Maybe + discountId: Scalars['Int'] + hasMultipleProducts?: Maybe + hasOptions?: Maybe +} + +export type SuggestionEvent = { + __typename?: 'SuggestionEvent' + _get?: Maybe + _root?: Maybe + causeID: Scalars['Int'] + errors: Array + name: Scalars['String'] + type?: Maybe +} + +export type SuggestionEvent_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type SuggestionLog = { + __typename?: 'SuggestionLog' + _get?: Maybe + _root?: Maybe + created: Scalars['DateTime'] + creatorUsername: Scalars['String'] + environmentID: Scalars['Int'] + events: Array> + externalResponseID: Scalars['String'] + orderID: Scalars['Int'] + pathString: Scalars['String'] + persisted?: Maybe + siteID: Scalars['Int'] + suggestionID: Scalars['Int'] + tenantID: Scalars['Int'] + updated: Scalars['DateTime'] + updaterUsername: Scalars['String'] +} + +export type SuggestionLog_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type SuggestionRequestInput = { + bundlingStrategy?: Maybe + customData: Scalars['Object'] + environmentID: Scalars['Int'] + exclusionListLocationCode: Array> + externalResponseID: Scalars['String'] + fraud: Scalars['Int'] + inventoryRequestType?: Maybe + isExpress?: Maybe + items: Array> + locationCodeWhiteList: Array + numShipmentsNotInRequest: Scalars['Int'] + orderID: Scalars['Int'] + orderType?: Maybe + pickupLocationCode: Scalars['String'] + shippingAddress?: Maybe + total: Scalars['Float'] +} + +export type SuggestionResponse = { + __typename?: 'SuggestionResponse' + _get?: Maybe + _root?: Maybe + assignmentSuggestions: Scalars['Object'] + availableLocations: Array + externalResponseID: Scalars['String'] + responseID: Scalars['Int'] + stateChangeSuggestions: Scalars['Object'] + suggestionLog?: Maybe +} + +export type SuggestionResponse_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type TargetRule = { + __typename?: 'TargetRule' + _get?: Maybe + _root?: Maybe + code?: Maybe + description?: Maybe + domain?: Maybe + expression?: Maybe +} + +export type TargetRule_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type TargetRuleCollection = { + __typename?: 'TargetRuleCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type TargetRuleCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type TargetRuleInput = { + code?: Maybe + description?: Maybe + domain?: Maybe + expression?: Maybe +} + +export type TaskInput = { + __typename?: 'TaskInput' + _get?: Maybe + _root?: Maybe + helpMessage?: Maybe + label?: Maybe + maxLength?: Maybe + maximum: Scalars['Float'] + minLength?: Maybe + minimum: Scalars['Float'] + name?: Maybe + options?: Maybe> + pattern?: Maybe + required?: Maybe + type?: Maybe +} + +export type TaskInput_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type TaskInputInput = { + helpMessage?: Maybe + label?: Maybe + maxLength?: Maybe + maximum: Scalars['Float'] + minLength?: Maybe + minimum: Scalars['Float'] + name?: Maybe + options?: Maybe> + pattern?: Maybe + required?: Maybe + type?: Maybe +} + +export type ThresholdMessage = { + __typename?: 'ThresholdMessage' + _get?: Maybe + _root?: Maybe + discountId: Scalars['Int'] + message?: Maybe + thresholdValue: Scalars['Float'] + showOnCheckout?: Maybe + showInCart?: Maybe + requiresCouponCode?: Maybe +} + +export type ThresholdMessage_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ThresholdMessageInput = { + discountId: Scalars['Int'] + message?: Maybe + thresholdValue: Scalars['Float'] + showOnCheckout?: Maybe + showInCart?: Maybe + requiresCouponCode?: Maybe +} + +export type Tracking = { + __typename?: 'Tracking' + _get?: Maybe + _root?: Maybe + attributes?: Maybe + number?: Maybe + url?: Maybe +} + +export type Tracking_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type TrackingInput = { + attributes?: Maybe + number?: Maybe + url?: Maybe +} + +export type Transaction = { + __typename?: 'Transaction' + _get?: Maybe + _root?: Maybe + transactionId?: Maybe + visitId?: Maybe + transactionType?: Maybe + interactionType?: Maybe + amount: Scalars['Float'] + date: Scalars['DateTime'] + currencyCode?: Maybe +} + +export type Transaction_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type TransactionInput = { + transactionId?: Maybe + visitId?: Maybe + transactionType?: Maybe + interactionType?: Maybe + amount: Scalars['Float'] + date: Scalars['DateTime'] + currencyCode?: Maybe +} + +export enum TypeEnum { + NewRequest = 'NEW_REQUEST', + RouteSelected = 'ROUTE_SELECTED', + MakeLocationsAvailable = 'MAKE_LOCATIONS_AVAILABLE', + NoRouteFound = 'NO_ROUTE_FOUND', + RemovedInactiveLocations = 'REMOVED_INACTIVE_LOCATIONS', + RemovedOnHoldLocations = 'REMOVED_ON_HOLD_LOCATIONS', + RemovedOverfulfilledLocations = 'REMOVED_OVERFULFILLED_LOCATIONS', + Group = 'GROUP', + GroupFilter = 'GROUP_FILTER', + GroupSort = 'GROUP_SORT', + Filter = 'FILTER', + Sort = 'SORT', + AfterAction = 'AFTER_ACTION', + FoundFullOrderLocation = 'FOUND_FULL_ORDER_LOCATION', + Response = 'RESPONSE', + AfterActionSort = 'AFTER_ACTION_SORT', + DefaultResponse = 'DEFAULT_RESPONSE', + MaxSplitsExceeded = 'MAX_SPLITS_EXCEEDED', + AutoAssignLimitExceeded = 'AUTO_ASSIGN_LIMIT_EXCEEDED', + InventoryRequest = 'INVENTORY_REQUEST', + RemovedInternationalLocations = 'REMOVED_INTERNATIONAL_LOCATIONS', +} + +export type UserRole = { + __typename?: 'UserRole' + _get?: Maybe + _root?: Maybe + userId?: Maybe + assignedInScope?: Maybe + roleId: Scalars['Int'] + roleName?: Maybe + roleTags?: Maybe> + auditInfo?: Maybe +} + +export type UserRole_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type UserRoleCollection = { + __typename?: 'UserRoleCollection' + _get?: Maybe + _root?: Maybe + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type UserRoleCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type UserRoleInput = { + userId?: Maybe + assignedInScope?: Maybe + roleId: Scalars['Int'] + roleName?: Maybe + roleTags?: Maybe> + auditInfo?: Maybe +} + +export type UserScope = { + __typename?: 'UserScope' + _get?: Maybe + _root?: Maybe + type?: Maybe + id?: Maybe + name?: Maybe +} + +export type UserScope_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type UserScopeInput = { + type?: Maybe + id?: Maybe + name?: Maybe +} + +export type ValidationMessage = { + __typename?: 'ValidationMessage' + _get?: Maybe + _root?: Maybe + severity?: Maybe + source?: Maybe + message?: Maybe + validationType?: Maybe + sourceId?: Maybe +} + +export type ValidationMessage_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type VariationOption = { + __typename?: 'VariationOption' + _get?: Maybe + _root?: Maybe + valueSequence: Scalars['Int'] + attributeFQN?: Maybe + value?: Maybe +} + +export type VariationOption_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type VariationSummary = { + __typename?: 'VariationSummary' + _get?: Maybe + _root?: Maybe + productCode?: Maybe + options?: Maybe>> + inventoryInfo?: Maybe +} + +export type VariationSummary_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type View = { + __typename?: 'View' + _get?: Maybe + _root?: Maybe + name?: Maybe + usages?: Maybe> + metadata?: Maybe + isVisibleInStorefront?: Maybe + filter?: Maybe + includeInactiveMode?: Maybe + isAdminDefault?: Maybe + fields?: Maybe>> +} + +export type View_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ViewField = { + __typename?: 'ViewField' + _get?: Maybe + _root?: Maybe + name?: Maybe + target?: Maybe +} + +export type ViewField_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type ViewFieldInput = { + name?: Maybe + target?: Maybe +} + +export type ViewInput = { + name?: Maybe + usages?: Maybe> + metadata?: Maybe + isVisibleInStorefront?: Maybe + filter?: Maybe + includeInactiveMode?: Maybe + isAdminDefault?: Maybe + fields?: Maybe>> +} + +export type Wishlist = { + __typename?: 'Wishlist' + _get?: Maybe + _root?: Maybe + customerAccountId?: Maybe + typeTag?: Maybe + name?: Maybe + items?: Maybe>> + privacyType?: Maybe + sortOrder?: Maybe + version?: Maybe + isImport?: Maybe + importDate?: Maybe + externalId?: Maybe + userId?: Maybe + id?: Maybe + tenantId?: Maybe + siteId?: Maybe + channelCode?: Maybe + currencyCode?: Maybe + visitId?: Maybe + webSessionId?: Maybe + customerInteractionType?: Maybe + fulfillmentInfo?: Maybe + orderDiscounts?: Maybe>> + suggestedDiscounts?: Maybe>> + rejectedDiscounts?: Maybe>> + data?: Maybe + taxData?: Maybe + subtotal?: Maybe + discountedSubtotal?: Maybe + discountTotal?: Maybe + discountedTotal?: Maybe + shippingTotal?: Maybe + shippingSubTotal?: Maybe + shippingTaxTotal?: Maybe + handlingTaxTotal?: Maybe + itemTaxTotal?: Maybe + taxTotal?: Maybe + feeTotal?: Maybe + total?: Maybe + lineItemSubtotalWithOrderAdjustments?: Maybe + shippingAmountBeforeDiscountsAndAdjustments?: Maybe + lastValidationDate?: Maybe + expirationDate?: Maybe + changeMessages?: Maybe>> + extendedProperties?: Maybe>> + discountThresholdMessages?: Maybe>> + auditInfo?: Maybe +} + +export type Wishlist_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type WishlistCollection = { + __typename?: 'WishlistCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type WishlistCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type WishlistInput = { + customerAccountId?: Maybe + typeTag?: Maybe + name?: Maybe + items?: Maybe>> + privacyType?: Maybe + sortOrder?: Maybe + version?: Maybe + isImport?: Maybe + importDate?: Maybe + externalId?: Maybe + userId?: Maybe + id?: Maybe + tenantId?: Maybe + siteId?: Maybe + channelCode?: Maybe + currencyCode?: Maybe + visitId?: Maybe + webSessionId?: Maybe + customerInteractionType?: Maybe + fulfillmentInfo?: Maybe + orderDiscounts?: Maybe>> + suggestedDiscounts?: Maybe>> + rejectedDiscounts?: Maybe>> + data?: Maybe + taxData?: Maybe + subtotal?: Maybe + discountedSubtotal?: Maybe + discountTotal?: Maybe + discountedTotal?: Maybe + shippingTotal?: Maybe + shippingSubTotal?: Maybe + shippingTaxTotal?: Maybe + handlingTaxTotal?: Maybe + itemTaxTotal?: Maybe + taxTotal?: Maybe + feeTotal?: Maybe + total?: Maybe + lineItemSubtotalWithOrderAdjustments?: Maybe + shippingAmountBeforeDiscountsAndAdjustments?: Maybe + lastValidationDate?: Maybe + expirationDate?: Maybe + changeMessages?: Maybe>> + extendedProperties?: Maybe>> + discountThresholdMessages?: Maybe>> + auditInfo?: Maybe +} + +export type WishlistItem = { + __typename?: 'WishlistItem' + _get?: Maybe + _root?: Maybe + id?: Maybe + comments?: Maybe + priorityType?: Maybe + purchasableStatusType?: Maybe + localeCode?: Maybe + purchaseLocation?: Maybe + lineId?: Maybe + product?: Maybe + quantity: Scalars['Int'] + isRecurring?: Maybe + isTaxable?: Maybe + subtotal?: Maybe + extendedTotal?: Maybe + taxableTotal?: Maybe + discountTotal?: Maybe + discountedTotal?: Maybe + itemTaxTotal?: Maybe + shippingTaxTotal?: Maybe + shippingTotal?: Maybe + handlingAmount?: Maybe + feeTotal?: Maybe + total?: Maybe + unitPrice?: Maybe + productDiscount?: Maybe + productDiscounts?: Maybe>> + shippingDiscounts?: Maybe>> + data?: Maybe + taxData?: Maybe + auditInfo?: Maybe + shippingAmountBeforeDiscountsAndAdjustments?: Maybe + weightedOrderAdjustment?: Maybe + weightedOrderDiscount?: Maybe + adjustedLineItemSubtotal?: Maybe + totalWithoutWeightedShippingAndHandling?: Maybe + weightedOrderTax?: Maybe + weightedOrderShipping?: Maybe + weightedOrderShippingDiscount?: Maybe + weightedOrderShippingManualAdjustment?: Maybe + weightedOrderShippingTax?: Maybe + weightedOrderHandlingFee?: Maybe + weightedOrderHandlingFeeTax?: Maybe + weightedOrderHandlingFeeDiscount?: Maybe + weightedOrderDuty?: Maybe + totalWithWeightedShippingAndHandling?: Maybe + weightedOrderHandlingAdjustment?: Maybe + autoAddDiscountId?: Maybe + isAssemblyRequired?: Maybe + childItemIds?: Maybe> + parentItemId?: Maybe +} + +export type WishlistItem_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type WishlistItemCollection = { + __typename?: 'WishlistItemCollection' + _get?: Maybe + _root?: Maybe + startIndex: Scalars['Int'] + pageSize: Scalars['Int'] + pageCount: Scalars['Int'] + totalCount: Scalars['Int'] + items?: Maybe>> +} + +export type WishlistItemCollection_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type WishlistItemInput = { + id?: Maybe + comments?: Maybe + priorityType?: Maybe + purchasableStatusType?: Maybe + localeCode?: Maybe + purchaseLocation?: Maybe + lineId?: Maybe + product?: Maybe + quantity: Scalars['Int'] + isRecurring?: Maybe + isTaxable?: Maybe + subtotal?: Maybe + extendedTotal?: Maybe + taxableTotal?: Maybe + discountTotal?: Maybe + discountedTotal?: Maybe + itemTaxTotal?: Maybe + shippingTaxTotal?: Maybe + shippingTotal?: Maybe + handlingAmount?: Maybe + feeTotal?: Maybe + total?: Maybe + unitPrice?: Maybe + productDiscount?: Maybe + productDiscounts?: Maybe>> + shippingDiscounts?: Maybe>> + data?: Maybe + taxData?: Maybe + auditInfo?: Maybe + shippingAmountBeforeDiscountsAndAdjustments?: Maybe + weightedOrderAdjustment?: Maybe + weightedOrderDiscount?: Maybe + adjustedLineItemSubtotal?: Maybe + totalWithoutWeightedShippingAndHandling?: Maybe + weightedOrderTax?: Maybe + weightedOrderShipping?: Maybe + weightedOrderShippingDiscount?: Maybe + weightedOrderShippingManualAdjustment?: Maybe + weightedOrderShippingTax?: Maybe + weightedOrderHandlingFee?: Maybe + weightedOrderHandlingFeeTax?: Maybe + weightedOrderHandlingFeeDiscount?: Maybe + weightedOrderDuty?: Maybe + totalWithWeightedShippingAndHandling?: Maybe + weightedOrderHandlingAdjustment?: Maybe + autoAddDiscountId?: Maybe + isAssemblyRequired?: Maybe + childItemIds?: Maybe> + parentItemId?: Maybe +} + +export type WorkflowState = { + __typename?: 'WorkflowState' + _get?: Maybe + _root?: Maybe + attributes?: Maybe + auditInfo?: Maybe + completedDate?: Maybe + processInstanceId?: Maybe + shipmentState?: Maybe + taskList?: Maybe>> +} + +export type WorkflowState_GetArgs = { + path: Scalars['String'] + defaultValue?: Maybe + allowUndefined?: Maybe +} + +export type WorkflowStateInput = { + attributes?: Maybe + auditInfo?: Maybe + completedDate?: Maybe + processInstanceId?: Maybe + shipmentState?: Maybe + taskList?: Maybe>> +} diff --git a/packages/kibocommerce/schema.graphql b/packages/kibocommerce/schema.graphql new file mode 100644 index 000000000..8d02ae535 --- /dev/null +++ b/packages/kibocommerce/schema.graphql @@ -0,0 +1,9129 @@ +input AccountPasswordInfoCollectionInput { + totalCount: Int! + items: [AccountPasswordInfoInput] +} + +input AccountPasswordInfoInput { + accountId: Int! + userId: String + unlockAccount: Boolean = false + passwordInfo: PasswordInfoInput +} + +type AccountSalesRep { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: AccountSalesRep + accountId: Int! + adminUserId: String +} + +input AccountSalesRepInput { + accountId: Int! + adminUserId: String +} + +type ActiveDateRange { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ActiveDateRange + startDate: DateTime + endDate: DateTime +} + +input ActiveDateRangeInput { + startDate: DateTime + endDate: DateTime +} + +input AddressValidationRequestInput { + address: CuAddressInput +} + +type AddressValidationResponse { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: AddressValidationResponse + addressCandidates: [CuAddress] +} + +type Adjustment { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Adjustment + amount: Float + description: String + internalComment: String +} + +input AdjustmentInput { + amount: Float + description: String + internalComment: String +} + +""" +The `AnyScalar` type allows any scalar value by examining the input and passing the serialize, parseValue, and parseLiteral operations to their respective types. +""" +scalar AnyScalar + +type AppliedLineItemProductDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: AppliedLineItemProductDiscount + appliesToSalePrice: Boolean + discountQuantity: Int! + productQuantity: Int + impactPerUnit: Float +} + +input AppliedLineItemProductDiscountInput { + appliesToSalePrice: Boolean = false + discountQuantity: Int! + productQuantity: Int + impactPerUnit: Float +} + +type AppliedLineItemShippingDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: AppliedLineItemShippingDiscount + methodCode: String + discount: CrAppliedDiscount + discountQuantity: Int! + impactPerUnit: Float! +} + +input AppliedLineItemShippingDiscountInput { + methodCode: String + discount: CrAppliedDiscountInput + discountQuantity: Int! + impactPerUnit: Float! +} + +type AttributeDetail { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: AttributeDetail + valueType: String + inputType: String + dataType: String + usageType: String + dataTypeSequence: Int! + name: String + description: String + validation: PrAttributeValidation + searchableInStorefront: Boolean + searchDisplayValue: Boolean + allowFilteringAndSortingInStorefront: Boolean + indexValueWithCase: Boolean + customWeightInStorefrontSearch: Boolean + displayIntention: String +} + +type AttributeVocabularyValueDisplayInfo { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: AttributeVocabularyValueDisplayInfo + cmsId: String + imageUrl: String + colorValue: String +} + +type AuditRecord { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: AuditRecord + id: String + changes: [AuditRecordChange] + auditInfo: CrAuditInfo +} + +type AuditRecordChange { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: AuditRecordChange + type: String + path: String + fields: [AuditRecordChangeField] +} + +type AuditRecordChangeField { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: AuditRecordChangeField + name: String + oldValue: String + newValue: String +} + +input AuditRecordChangeFieldInput { + name: String + oldValue: String + newValue: String +} + +input AuditRecordChangeInput { + type: String + path: String + fields: [AuditRecordChangeFieldInput] +} + +input AuditRecordInput { + id: String + changes: [AuditRecordChangeInput] + auditInfo: CrAuditInfoInput +} + +type B2BAccount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: B2BAccount + users: [B2BUser] + isActive: Boolean + priceList: String + salesReps: [AccountSalesRep] + rootAccountId: Int + parentAccountId: Int + approvalStatus: String + id: Int! + customerSet: String + commerceSummary: CommerceSummary + contacts: [CustomerContact] + companyOrOrganization: String + notes: [CustomerNote] + attributes: [CustomerAttribute] + segments: [CustomerSegment] + taxId: String + externalId: String + auditInfo: CuAuditInfo + customerSinceDate: DateTime + accountType: String +} + +type B2BAccountCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: B2BAccountCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [B2BAccount] +} + +input B2BAccountInput { + users: [B2BUserInput] + isActive: Boolean = false + priceList: String + salesReps: [AccountSalesRepInput] + rootAccountId: Int + parentAccountId: Int + approvalStatus: String + id: Int! + customerSet: String + commerceSummary: CommerceSummaryInput + contacts: [CustomerContactInput] + companyOrOrganization: String + notes: [CustomerNoteInput] + attributes: [CustomerAttributeInput] + segments: [CustomerSegmentInput] + taxId: String + externalId: String + auditInfo: CuAuditInfoInput + customerSinceDate: DateTime + accountType: String +} + +type B2BUser { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: B2BUser + emailAddress: String + userName: String + firstName: String + lastName: String + localeCode: String + userId: String + roles: [UserRole] + isLocked: Boolean + isActive: Boolean + isRemoved: Boolean + acceptsMarketing: Boolean + hasExternalPassword: Boolean +} + +input B2BUserAndAuthInfoInput { + b2BUser: B2BUserInput + externalPassword: String + isImport: Boolean = false +} + +type B2BUserCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: B2BUserCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [B2BUser] +} + +input B2BUserInput { + emailAddress: String + userName: String + firstName: String + lastName: String + localeCode: String + userId: String + roles: [UserRoleInput] + isLocked: Boolean = false + isActive: Boolean = false + isRemoved: Boolean = false + acceptsMarketing: Boolean = false + hasExternalPassword: Boolean = false +} + +type BillingInfo { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: BillingInfo + paymentType: String + paymentWorkflow: String + billingContact: Contact + isSameBillingShippingAddress: Boolean + card: PaymentCard + token: PaymentToken + purchaseOrder: PurchaseOrderPayment + check: CheckPayment + auditInfo: CrAuditInfo + storeCreditCode: String + storeCreditType: String + customCreditType: String + externalTransactionId: String + data: Object +} + +input BillingInfoInput { + paymentType: String + paymentWorkflow: String + billingContact: ContactInput + isSameBillingShippingAddress: Boolean = false + card: PaymentCardInput + token: PaymentTokenInput + purchaseOrder: PurchaseOrderPaymentInput + check: CheckPaymentInput + auditInfo: CrAuditInfoInput + storeCreditCode: String + storeCreditType: String + customCreditType: String + externalTransactionId: String + data: Object +} + +type BoxType { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: BoxType + name: String + height: Float + width: Float + length: Float +} + +type BpmConfiguration { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: BpmConfiguration + shipmentType: String + workflowContainerId: String + workflowProcessId: String +} + +type BundledProductSummary { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: BundledProductSummary + productShortDescription: String + productName: String + productCode: String + goodsType: String + quantity: Int! + measurements: PrPackageMeasurements + isPackagedStandAlone: Boolean + inventoryInfo: ProductInventoryInfo + optionAttributeFQN: String + optionValue: Object + creditValue: Float + productType: String +} + +enum BundlingStrategyEnum { + ITEM_DEPENDENCY +} + +type CancelReasonCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CancelReasonCollection + totalCount: Int! + items: [CancelReasonItem] +} + +type CancelReasonItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CancelReasonItem + reasonCode: String + name: String + needsMoreInfo: Boolean +} + +type CanceledItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CanceledItem + canceledReason: CanceledReason + auditInfo: CrAuditInfo + lineId: Int! + originalOrderItemId: String + parentId: String + productCode: String + variationProductCode: String + optionAttributeFQN: String + name: String + fulfillmentLocationCode: String + imageUrl: String + isTaxable: Boolean + quantity: Int! + unitPrice: Float! + actualPrice: Float! + overridePrice: Float + itemDiscount: Float! + lineItemCost: Float! + itemTax: Float! + shipping: Float! + shippingDiscount: Float! + shippingTax: Float! + handling: Float! + handlingDiscount: Float! + handlingTax: Float! + duty: Float! + isPackagedStandAlone: Boolean + readyForPickupQuantity: Int + backorderReleaseDate: DateTime + measurements: CrPackageMeasurements + options: [CrProductOption] + data: Object + taxData: Object + weightedShipmentAdjustment: Float! + weightedLineItemTaxAdjustment: Float! + weightedShippingAdjustment: Float! + weightedShippingTaxAdjustment: Float! + weightedHandlingAdjustment: Float! + weightedHandlingTaxAdjustment: Float! + weightedDutyAdjustment: Float! + taxableShipping: Float! + taxableLineItemCost: Float! + taxableHandling: Float! + fulfillmentFields: [FulfillmentField] + isAssemblyRequired: Boolean + parentItemId: String + childItemIds: [String!] + giftCards: [GiftCard] +} + +input CanceledItemInput { + canceledReason: CanceledReasonInput + auditInfo: CrAuditInfoInput + lineId: Int! + originalOrderItemId: String + parentId: String + productCode: String + variationProductCode: String + optionAttributeFQN: String + name: String + fulfillmentLocationCode: String + imageUrl: String + isTaxable: Boolean = false + quantity: Int! + unitPrice: Float! + actualPrice: Float! + overridePrice: Float + itemDiscount: Float! + lineItemCost: Float! + itemTax: Float! + shipping: Float! + shippingDiscount: Float! + shippingTax: Float! + handling: Float! + handlingDiscount: Float! + handlingTax: Float! + duty: Float! + isPackagedStandAlone: Boolean = false + readyForPickupQuantity: Int + backorderReleaseDate: DateTime + measurements: CrPackageMeasurementsInput + options: [CrProductOptionInput] + data: Object + taxData: Object + weightedShipmentAdjustment: Float! + weightedLineItemTaxAdjustment: Float! + weightedShippingAdjustment: Float! + weightedShippingTaxAdjustment: Float! + weightedHandlingAdjustment: Float! + weightedHandlingTaxAdjustment: Float! + weightedDutyAdjustment: Float! + taxableShipping: Float! + taxableLineItemCost: Float! + taxableHandling: Float! + fulfillmentFields: [FulfillmentFieldInput] + isAssemblyRequired: Boolean = false + parentItemId: String + childItemIds: [String!] + giftCards: [GiftCardInput] +} + +type CanceledReason { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CanceledReason + reasonCode: String + description: String + moreInfo: String +} + +input CanceledReasonInput { + reasonCode: String + description: String + moreInfo: String +} + +type CapturableShipmentSummary { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CapturableShipmentSummary + shipmentNumber: Int! + shipmentTotal: Float! + amountApplied: Float! +} + +input CapturableShipmentSummaryInput { + shipmentNumber: Int! + shipmentTotal: Float! + amountApplied: Float! +} + +type Card { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Card + id: String + nameOnCard: String + cardType: String + expireMonth: Int + expireYear: Int + cardNumberPart: String + contactId: Int! + isDefaultPayMethod: Boolean +} + +type CardCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CardCollection + totalCount: Int! + items: [Card] +} + +input CardInput { + id: String + nameOnCard: String + cardType: String + expireMonth: Int + expireYear: Int + cardNumberPart: String + contactId: Int! + isDefaultPayMethod: Boolean = false +} + +type Carrier { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Carrier + carrierType: String + isEnabled: Boolean + shippingMethodMappings: ShippingMethodMappings +} + +type CarrierServiceGenerateLabelResponse { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CarrierServiceGenerateLabelResponse + imageURL: String + integratorId: String + price: Float + trackingNumber: String +} + +type Cart { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Cart + items: [CartItem] + couponCodes: [String!] + invalidCoupons: [InvalidCoupon] + priceListCode: String + cartMessage: CartMessage + cartMessages: [CartMessage] + handlingAmount: Float + handlingSubTotal: Float + handlingTotal: Float + userId: String + id: String + tenantId: Int + siteId: Int + channelCode: String + currencyCode: String + visitId: String + webSessionId: String + customerInteractionType: String + fulfillmentInfo: FulfillmentInfo + orderDiscounts: [CrAppliedDiscount] + suggestedDiscounts: [SuggestedDiscount] + rejectedDiscounts: [SuggestedDiscount] + data: Object + taxData: Object + subtotal: Float + discountedSubtotal: Float + discountTotal: Float + discountedTotal: Float + shippingTotal: Float + shippingSubTotal: Float + shippingTaxTotal: Float + handlingTaxTotal: Float + itemTaxTotal: Float + taxTotal: Float + feeTotal: Float + total: Float + lineItemSubtotalWithOrderAdjustments: Float + shippingAmountBeforeDiscountsAndAdjustments: Float + lastValidationDate: DateTime + expirationDate: DateTime + changeMessages: [ChangeMessage] + extendedProperties: [ExtendedProperty] + discountThresholdMessages: [ThresholdMessage] + auditInfo: CrAuditInfo +} + +type CartChangeMessageCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CartChangeMessageCollection + totalCount: Int! + items: [ChangeMessage] +} + +input CartInput { + items: [CartItemInput] + couponCodes: [String!] + invalidCoupons: [InvalidCouponInput] + priceListCode: String + cartMessage: CartMessageInput + cartMessages: [CartMessageInput] + handlingAmount: Float + handlingSubTotal: Float + handlingTotal: Float + userId: String + id: String + tenantId: Int + siteId: Int + channelCode: String + currencyCode: String + visitId: String + webSessionId: String + customerInteractionType: String + fulfillmentInfo: FulfillmentInfoInput + orderDiscounts: [CrAppliedDiscountInput] + suggestedDiscounts: [SuggestedDiscountInput] + rejectedDiscounts: [SuggestedDiscountInput] + data: Object + taxData: Object + subtotal: Float + discountedSubtotal: Float + discountTotal: Float + discountedTotal: Float + shippingTotal: Float + shippingSubTotal: Float + shippingTaxTotal: Float + handlingTaxTotal: Float + itemTaxTotal: Float + taxTotal: Float + feeTotal: Float + total: Float + lineItemSubtotalWithOrderAdjustments: Float + shippingAmountBeforeDiscountsAndAdjustments: Float + lastValidationDate: DateTime + expirationDate: DateTime + changeMessages: [ChangeMessageInput] + extendedProperties: [ExtendedPropertyInput] + discountThresholdMessages: [ThresholdMessageInput] + auditInfo: CrAuditInfoInput +} + +type CartItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CartItem + id: String + fulfillmentLocationCode: String + fulfillmentMethod: String + localeCode: String + purchaseLocation: String + lineId: Int + product: CrProduct + quantity: Int! + isRecurring: Boolean + isTaxable: Boolean + subtotal: Float + extendedTotal: Float + taxableTotal: Float + discountTotal: Float + discountedTotal: Float + itemTaxTotal: Float + shippingTaxTotal: Float + shippingTotal: Float + handlingAmount: Float + feeTotal: Float + total: Float + unitPrice: CommerceUnitPrice + productDiscount: AppliedLineItemProductDiscount + productDiscounts: [AppliedLineItemProductDiscount] + shippingDiscounts: [AppliedLineItemShippingDiscount] + data: Object + taxData: Object + auditInfo: CrAuditInfo + shippingAmountBeforeDiscountsAndAdjustments: Float + weightedOrderAdjustment: Float + weightedOrderDiscount: Float + adjustedLineItemSubtotal: Float + totalWithoutWeightedShippingAndHandling: Float + weightedOrderTax: Float + weightedOrderShipping: Float + weightedOrderShippingDiscount: Float + weightedOrderShippingManualAdjustment: Float + weightedOrderShippingTax: Float + weightedOrderHandlingFee: Float + weightedOrderHandlingFeeTax: Float + weightedOrderHandlingFeeDiscount: Float + weightedOrderDuty: Float + totalWithWeightedShippingAndHandling: Float + weightedOrderHandlingAdjustment: Float + autoAddDiscountId: Int + isAssemblyRequired: Boolean + childItemIds: [String!] + parentItemId: String +} + +type CartItemCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CartItemCollection + totalCount: Int! + items: [CartItem] +} + +input CartItemInput { + id: String + fulfillmentLocationCode: String + fulfillmentMethod: String + localeCode: String + purchaseLocation: String + lineId: Int + product: CrProductInput + quantity: Int! + isRecurring: Boolean = false + isTaxable: Boolean = false + subtotal: Float + extendedTotal: Float + taxableTotal: Float + discountTotal: Float + discountedTotal: Float + itemTaxTotal: Float + shippingTaxTotal: Float + shippingTotal: Float + handlingAmount: Float + feeTotal: Float + total: Float + unitPrice: CommerceUnitPriceInput + productDiscount: AppliedLineItemProductDiscountInput + productDiscounts: [AppliedLineItemProductDiscountInput] + shippingDiscounts: [AppliedLineItemShippingDiscountInput] + data: Object + taxData: Object + auditInfo: CrAuditInfoInput + shippingAmountBeforeDiscountsAndAdjustments: Float + weightedOrderAdjustment: Float + weightedOrderDiscount: Float + adjustedLineItemSubtotal: Float + totalWithoutWeightedShippingAndHandling: Float + weightedOrderTax: Float + weightedOrderShipping: Float + weightedOrderShippingDiscount: Float + weightedOrderShippingManualAdjustment: Float + weightedOrderShippingTax: Float + weightedOrderHandlingFee: Float + weightedOrderHandlingFeeTax: Float + weightedOrderHandlingFeeDiscount: Float + weightedOrderDuty: Float + totalWithWeightedShippingAndHandling: Float + weightedOrderHandlingAdjustment: Float + autoAddDiscountId: Int + isAssemblyRequired: Boolean = false + childItemIds: [String!] + parentItemId: String +} + +type CartMessage { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CartMessage + message: String + messageType: String + productsRemoved: [CrProduct] +} + +input CartMessageInput { + message: String + messageType: String + productsRemoved: [CrProductInput] +} + +type CartSummary { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CartSummary + itemCount: Int + totalQuantity: Int + total: Float + isExpired: Boolean + hasActiveCart: Boolean +} + +type CategoryCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CategoryCollection + totalCount: Int! + items: [PrCategory] +} + +type CategoryContent { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CategoryContent + categoryImages: [CategoryImage] + name: String + description: String + pageTitle: String + metaTagTitle: String + metaTagDescription: String + metaTagKeywords: String + slug: String +} + +type CategoryImage { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CategoryImage + imageLabel: String + altText: String + imageUrl: String + cmsId: String + videoUrl: String + mediaType: String + sequence: Int +} + +type CategoryPagedCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CategoryPagedCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [PrCategory] +} + +type ChangeMessage { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ChangeMessage + id: String + correlationId: String + userId: String + userFirstName: String + userLastName: String + userScopeType: String + appId: String + appKey: String + appName: String + subjectType: String + success: Boolean + identifier: String + subject: String + verb: String + message: String + metadata: Object + oldValue: String + newValue: String + amount: Float + createDate: DateTime +} + +input ChangeMessageInput { + id: String + correlationId: String + userId: String + userFirstName: String + userLastName: String + userScopeType: String + appId: String + appKey: String + appName: String + subjectType: String + success: Boolean = false + identifier: String + subject: String + verb: String + message: String + metadata: Object + oldValue: String + newValue: String + amount: Float + createDate: DateTime +} + +type ChangePasswordResult { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ChangePasswordResult + accountId: Int! + succeeded: Boolean + errorMessage: String +} + +type ChangePasswordResultCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ChangePasswordResultCollection + totalCount: Int! + items: [ChangePasswordResult] +} + +type Channel { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Channel + tenantId: Int! + code: String + name: String + region: String + countryCode: String + groupCode: String + siteIds: [Int!] + auditInfo: CrAuditInfo +} + +type ChannelCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ChannelCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [Channel] +} + +type ChannelGroup { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ChannelGroup + tenantId: Int! + code: String + name: String + auditInfo: CrAuditInfo +} + +type ChannelGroupCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ChannelGroupCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [ChannelGroup] +} + +input ChannelGroupInput { + tenantId: Int! + code: String + name: String + auditInfo: CrAuditInfoInput +} + +input ChannelInput { + tenantId: Int! + code: String + name: String + region: String + countryCode: String + groupCode: String + siteIds: [Int!] + auditInfo: CrAuditInfoInput +} + +type CheckPayment { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CheckPayment + checkNumber: String +} + +input CheckPaymentInput { + checkNumber: String +} + +type Checkout { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Checkout + id: String + siteId: Int! + tenantId: Int! + number: Int + originalCartId: String + submittedDate: DateTime + type: String + items: [CrOrderItem] + groupings: [CheckoutGrouping] + auditInfo: CrAuditInfo + destinations: [Destination] + payments: [Payment] + amountRemainingForPayment: Float! + acceptsMarketing: Boolean + customerAccountId: Int + email: String + customerTaxId: String + isTaxExempt: Boolean + currencyCode: String + priceListCode: String + attributes: [OrderAttribute] + shopperNotes: ShopperNotes + availableActions: [String!] + data: Object + taxData: Object + channelCode: String + locationCode: String + ipAddress: String + sourceDevice: String + visitId: String + webSessionId: String + customerInteractionType: String + orderDiscounts: [CrAppliedDiscount] + couponCodes: [String!] + invalidCoupons: [InvalidCoupon] + suggestedDiscounts: [SuggestedDiscount] + discountThresholdMessages: [ThresholdMessage] + dutyTotal: Float + feeTotal: Float! + subTotal: Float! + itemLevelProductDiscountTotal: Float! + orderLevelProductDiscountTotal: Float! + itemTaxTotal: Float! + itemTotal: Float! + shippingSubTotal: Float! + itemLevelShippingDiscountTotal: Float! + orderLevelShippingDiscountTotal: Float! + shippingTaxTotal: Float! + shippingTotal: Float! + handlingSubTotal: Float! + itemLevelHandlingDiscountTotal: Float! + orderLevelHandlingDiscountTotal: Float! + handlingTaxTotal: Float! + handlingTotal: Float! + total: Float! +} + +input CheckoutActionInput { + actionName: String +} + +type CheckoutCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CheckoutCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [Checkout] +} + +type CheckoutGroupRates { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CheckoutGroupRates + groupingId: String + shippingRates: [ShippingRate] +} + +input CheckoutGroupShippingMethodInput { + groupingId: String + shippingRate: ShippingRateInput +} + +type CheckoutGrouping { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CheckoutGrouping + id: String + destinationId: String + fulfillmentMethod: String + orderItemIds: [String!] + shippingMethodCode: String + shippingMethodName: String + standaloneGroup: Boolean + shippingDiscounts: [ShippingDiscount] + handlingDiscounts: [CrAppliedDiscount] + dutyAmount: Float + dutyTotal: Float! + shippingAmount: Float + shippingSubTotal: Float! + itemLevelShippingDiscountTotal: Float! + orderLevelShippingDiscountTotal: Float! + shippingTax: Float + shippingTaxTotal: Float! + shippingTotal: Float! + handlingAmount: Float + handlingSubTotal: Float! + itemLevelHandlingDiscountTotal: Float! + orderLevelHandlingDiscountTotal: Float! + handlingTax: Float + handlingTaxTotal: Float! + handlingTotal: Float! + taxData: Object +} + +input CheckoutGroupingInput { + id: String + destinationId: String + fulfillmentMethod: String + orderItemIds: [String!] + shippingMethodCode: String + shippingMethodName: String + standaloneGroup: Boolean = false + shippingDiscounts: [ShippingDiscountInput] + handlingDiscounts: [CrAppliedDiscountInput] + dutyAmount: Float + dutyTotal: Float! + shippingAmount: Float + shippingSubTotal: Float! + itemLevelShippingDiscountTotal: Float! + orderLevelShippingDiscountTotal: Float! + shippingTax: Float + shippingTaxTotal: Float! + shippingTotal: Float! + handlingAmount: Float + handlingSubTotal: Float! + itemLevelHandlingDiscountTotal: Float! + orderLevelHandlingDiscountTotal: Float! + handlingTax: Float + handlingTaxTotal: Float! + handlingTotal: Float! + taxData: Object +} + +input CheckoutInput { + id: String + siteId: Int! + tenantId: Int! + number: Int + originalCartId: String + submittedDate: DateTime + type: String + items: [CrOrderItemInput] + groupings: [CheckoutGroupingInput] + auditInfo: CrAuditInfoInput + destinations: [DestinationInput] + payments: [PaymentInput] + amountRemainingForPayment: Float! + acceptsMarketing: Boolean = false + customerAccountId: Int + email: String + customerTaxId: String + isTaxExempt: Boolean = false + currencyCode: String + priceListCode: String + attributes: [OrderAttributeInput] + shopperNotes: ShopperNotesInput + availableActions: [String!] + data: Object + taxData: Object + channelCode: String + locationCode: String + ipAddress: String + sourceDevice: String + visitId: String + webSessionId: String + customerInteractionType: String + orderDiscounts: [CrAppliedDiscountInput] + couponCodes: [String!] + invalidCoupons: [InvalidCouponInput] + suggestedDiscounts: [SuggestedDiscountInput] + discountThresholdMessages: [ThresholdMessageInput] + dutyTotal: Float + feeTotal: Float! + subTotal: Float! + itemLevelProductDiscountTotal: Float! + orderLevelProductDiscountTotal: Float! + itemTaxTotal: Float! + itemTotal: Float! + shippingSubTotal: Float! + itemLevelShippingDiscountTotal: Float! + orderLevelShippingDiscountTotal: Float! + shippingTaxTotal: Float! + shippingTotal: Float! + handlingSubTotal: Float! + itemLevelHandlingDiscountTotal: Float! + orderLevelHandlingDiscountTotal: Float! + handlingTaxTotal: Float! + handlingTotal: Float! + total: Float! +} + +input CoHttpContentInput { + headers: [KeyValuePair2Input] +} + +input CoHttpMethodInput { + method: String +} + +input CoHttpRequestMessageInput { + version: String + content: CoHttpContentInput + method: CoHttpMethodInput + requestUri: DateTime + headers: [KeyValuePair2Input] + properties: Object +} + +type CommerceSummary { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CommerceSummary + totalOrderAmount: CurrencyAmount + orderCount: Int! + lastOrderDate: DateTime + wishlistCount: Int! + visitsCount: Int! +} + +input CommerceSummaryInput { + totalOrderAmount: CurrencyAmountInput + orderCount: Int! + lastOrderDate: DateTime + wishlistCount: Int! + visitsCount: Int! +} + +type CommerceUnitPrice { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CommerceUnitPrice + extendedAmount: Float + listAmount: Float + saleAmount: Float + overrideAmount: Float +} + +input CommerceUnitPriceInput { + extendedAmount: Float + listAmount: Float + saleAmount: Float + overrideAmount: Float +} + +type ConfiguredProduct { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ConfiguredProduct + productCode: String + purchaseLocation: String + fulfillmentTypesSupported: [String!] + variationProductCode: String + upc: String + mfgPartNumber: String + purchasableState: ProductPurchasableState + priceRange: ProductPriceRange + volumePriceBands: [ProductVolumePrice] + volumePriceRange: ProductPriceRange + price: ProductPrice + availableShippingDiscounts: [PrDiscount] + measurements: PrPackageMeasurements + inventoryInfo: ProductInventoryInfo + options: [ProductOption] + properties: [ProductProperty] + priceListEntryTypeProperty: ProductProperty + productImages: [ProductImage] +} + +type Contact { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Contact + id: Int + email: String + firstName: String + middleNameOrInitial: String + lastNameOrSurname: String + companyOrOrganization: String + phoneNumbers: CrPhone + address: CrAddress +} + +input ContactInput { + id: Int + email: String + firstName: String + middleNameOrInitial: String + lastNameOrSurname: String + companyOrOrganization: String + phoneNumbers: CrPhoneInput + address: CrAddressInput +} + +type ContactType { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ContactType + name: String + isPrimary: Boolean +} + +input ContactTypeInput { + name: String + isPrimary: Boolean = false +} + +type Coordinates { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Coordinates + lat: Float! + lng: Float! +} + +input CoordinatesInput { + lat: Float! + lng: Float! +} + +type CrAddress { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrAddress + address1: String + address2: String + address3: String + address4: String + cityOrTown: String + stateOrProvince: String + postalOrZipCode: String + countryCode: String + addressType: String + isValidated: Boolean +} + +input CrAddressInput { + address1: String + address2: String + address3: String + address4: String + cityOrTown: String + stateOrProvince: String + postalOrZipCode: String + countryCode: String + addressType: String + isValidated: Boolean = false +} + +type CrAppliedDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrAppliedDiscount + impact: Float + discount: CrDiscount + couponCode: String + excluded: Boolean +} + +input CrAppliedDiscountInput { + impact: Float + discount: CrDiscountInput + couponCode: String + excluded: Boolean = false +} + +type CrAuditInfo { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrAuditInfo + updateDate: DateTime + createDate: DateTime + updateBy: String + createBy: String +} + +input CrAuditInfoInput { + updateDate: DateTime + createDate: DateTime + updateBy: String + createBy: String +} + +type CrBundledProduct { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrBundledProduct + quantity: Int! + optionAttributeFQN: String + optionValue: Object + creditValue: Float + deltaPrice: Float + productCode: String + name: String + description: String + goodsType: String + isPackagedStandAlone: Boolean + stock: ProductStock + productReservationId: Int + allocationId: Int + allocationExpiration: DateTime + measurements: CrPackageMeasurements + fulfillmentStatus: String +} + +input CrBundledProductInput { + quantity: Int! + optionAttributeFQN: String + optionValue: Object + creditValue: Float + deltaPrice: Float + productCode: String + name: String + description: String + goodsType: String + isPackagedStandAlone: Boolean = false + stock: ProductStockInput + productReservationId: Int + allocationId: Int + allocationExpiration: DateTime + measurements: CrPackageMeasurementsInput + fulfillmentStatus: String +} + +type CrCategory { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrCategory + id: Int + parent: CrCategory +} + +input CrCategoryInput { + id: Int + parent: CrCategoryInput +} + +type CrDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrDiscount + id: Int! + name: String + itemIds: [String!] + expirationDate: DateTime + hasMultipleTargetProducts: Boolean +} + +input CrDiscountInput { + id: Int! + name: String + itemIds: [String!] + expirationDate: DateTime + hasMultipleTargetProducts: Boolean = false +} + +type CrMeasurement { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrMeasurement + unit: String + value: Float +} + +input CrMeasurementInput { + unit: String + value: Float +} + +type CrOrderItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrOrderItem + id: String + destinationId: String + originalCartItemId: String + fulfillmentLocationCode: String + fulfillmentMethod: String + dutyAmount: Float + expectedDeliveryDate: DateTime + localeCode: String + purchaseLocation: String + lineId: Int + product: CrProduct + quantity: Int! + isRecurring: Boolean + isTaxable: Boolean + subtotal: Float + extendedTotal: Float + taxableTotal: Float + discountTotal: Float + discountedTotal: Float + itemTaxTotal: Float + shippingTaxTotal: Float + shippingTotal: Float + handlingAmount: Float + feeTotal: Float + total: Float + unitPrice: CommerceUnitPrice + productDiscount: AppliedLineItemProductDiscount + productDiscounts: [AppliedLineItemProductDiscount] + shippingDiscounts: [AppliedLineItemShippingDiscount] + data: Object + taxData: Object + auditInfo: CrAuditInfo + shippingAmountBeforeDiscountsAndAdjustments: Float + weightedOrderAdjustment: Float + weightedOrderDiscount: Float + adjustedLineItemSubtotal: Float + totalWithoutWeightedShippingAndHandling: Float + weightedOrderTax: Float + weightedOrderShipping: Float + weightedOrderShippingDiscount: Float + weightedOrderShippingManualAdjustment: Float + weightedOrderShippingTax: Float + weightedOrderHandlingFee: Float + weightedOrderHandlingFeeTax: Float + weightedOrderHandlingFeeDiscount: Float + weightedOrderDuty: Float + totalWithWeightedShippingAndHandling: Float + weightedOrderHandlingAdjustment: Float + autoAddDiscountId: Int + isAssemblyRequired: Boolean + childItemIds: [String!] + parentItemId: String +} + +input CrOrderItemInput { + id: String + destinationId: String + originalCartItemId: String + fulfillmentLocationCode: String + fulfillmentMethod: String + dutyAmount: Float + expectedDeliveryDate: DateTime + localeCode: String + purchaseLocation: String + lineId: Int + product: CrProductInput + quantity: Int! + isRecurring: Boolean = false + isTaxable: Boolean = false + subtotal: Float + extendedTotal: Float + taxableTotal: Float + discountTotal: Float + discountedTotal: Float + itemTaxTotal: Float + shippingTaxTotal: Float + shippingTotal: Float + handlingAmount: Float + feeTotal: Float + total: Float + unitPrice: CommerceUnitPriceInput + productDiscount: AppliedLineItemProductDiscountInput + productDiscounts: [AppliedLineItemProductDiscountInput] + shippingDiscounts: [AppliedLineItemShippingDiscountInput] + data: Object + taxData: Object + auditInfo: CrAuditInfoInput + shippingAmountBeforeDiscountsAndAdjustments: Float + weightedOrderAdjustment: Float + weightedOrderDiscount: Float + adjustedLineItemSubtotal: Float + totalWithoutWeightedShippingAndHandling: Float + weightedOrderTax: Float + weightedOrderShipping: Float + weightedOrderShippingDiscount: Float + weightedOrderShippingManualAdjustment: Float + weightedOrderShippingTax: Float + weightedOrderHandlingFee: Float + weightedOrderHandlingFeeTax: Float + weightedOrderHandlingFeeDiscount: Float + weightedOrderDuty: Float + totalWithWeightedShippingAndHandling: Float + weightedOrderHandlingAdjustment: Float + autoAddDiscountId: Int + isAssemblyRequired: Boolean = false + childItemIds: [String!] + parentItemId: String +} + +type CrPackageMeasurements { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrPackageMeasurements + height: CrMeasurement + width: CrMeasurement + length: CrMeasurement + weight: CrMeasurement +} + +input CrPackageMeasurementsInput { + height: CrMeasurementInput + width: CrMeasurementInput + length: CrMeasurementInput + weight: CrMeasurementInput +} + +type CrPhone { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrPhone + home: String + mobile: String + work: String +} + +input CrPhoneInput { + home: String + mobile: String + work: String +} + +type CrProduct { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrProduct + mfgPartNumber: String + upc: String + sku: String + fulfillmentTypesSupported: [String!] + imageAlternateText: String + imageUrl: String + variationProductCode: String + options: [CrProductOption] + properties: [CrProductProperty] + categories: [CrCategory] + price: CrProductPrice + discountsRestricted: Boolean + discountsRestrictedStartDate: DateTime + discountsRestrictedEndDate: DateTime + isRecurring: Boolean + isTaxable: Boolean + productType: String + productUsage: String + bundledProducts: [CrBundledProduct] + fulfillmentFields: [FulfillmentField] + productCode: String + name: String + description: String + goodsType: String + isPackagedStandAlone: Boolean + stock: ProductStock + productReservationId: Int + allocationId: Int + allocationExpiration: DateTime + measurements: CrPackageMeasurements + fulfillmentStatus: String +} + +input CrProductInput { + mfgPartNumber: String + upc: String + sku: String + fulfillmentTypesSupported: [String!] + imageAlternateText: String + imageUrl: String + variationProductCode: String + options: [CrProductOptionInput] + properties: [CrProductPropertyInput] + categories: [CrCategoryInput] + price: CrProductPriceInput + discountsRestricted: Boolean = false + discountsRestrictedStartDate: DateTime + discountsRestrictedEndDate: DateTime + isRecurring: Boolean = false + isTaxable: Boolean = false + productType: String + productUsage: String + bundledProducts: [CrBundledProductInput] + fulfillmentFields: [FulfillmentFieldInput] + productCode: String + name: String + description: String + goodsType: String + isPackagedStandAlone: Boolean = false + stock: ProductStockInput + productReservationId: Int + allocationId: Int + allocationExpiration: DateTime + measurements: CrPackageMeasurementsInput + fulfillmentStatus: String +} + +type CrProductOption { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrProductOption + name: String + value: Object + shopperEnteredValue: Object + attributeFQN: String + dataType: String + stringValue: String +} + +input CrProductOptionInput { + name: String + value: Object + shopperEnteredValue: Object + attributeFQN: String + dataType: String + stringValue: String +} + +type CrProductPrice { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrProductPrice + price: Float + salePrice: Float + tenantOverridePrice: Float + msrp: Float + creditValue: Float + priceListCode: String + priceListEntryMode: String +} + +input CrProductPriceInput { + price: Float + salePrice: Float + tenantOverridePrice: Float + msrp: Float + creditValue: Float + priceListCode: String + priceListEntryMode: String +} + +type CrProductProperty { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrProductProperty + attributeFQN: String + name: String + dataType: String + isMultiValue: Boolean + values: [CrProductPropertyValue] +} + +input CrProductPropertyInput { + attributeFQN: String + name: String + dataType: String + isMultiValue: Boolean = false + values: [CrProductPropertyValueInput] +} + +type CrProductPropertyValue { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CrProductPropertyValue + stringValue: String + value: Object +} + +input CrProductPropertyValueInput { + stringValue: String + value: Object +} + +type Credit { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Credit + code: String + activationDate: DateTime + creditType: String + customCreditType: String + currencyCode: String + initialBalance: Float + currentBalance: Float + expirationDate: DateTime + customerId: Int + auditInfo: CuAuditInfo + creditTypeId: Int! +} + +type CreditAuditEntry { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CreditAuditEntry + activityType: String + details: String + auditInfo: CuAuditInfo + activityTypeId: Int! +} + +type CreditAuditEntryCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CreditAuditEntryCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [CreditAuditEntry] +} + +type CreditCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CreditCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [Credit] +} + +input CreditInput { + code: String + activationDate: DateTime + creditType: String + customCreditType: String + currencyCode: String + initialBalance: Float + currentBalance: Float + expirationDate: DateTime + customerId: Int + auditInfo: CuAuditInfoInput + creditTypeId: Int! +} + +type CreditTransaction { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CreditTransaction + id: Int + transactionType: String + comments: String + impactAmount: Float + auditInfo: CuAuditInfo + orderId: String + data: Object +} + +type CreditTransactionCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CreditTransactionCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [CreditTransaction] +} + +input CreditTransactionInput { + id: Int + transactionType: String + comments: String + impactAmount: Float + auditInfo: CuAuditInfoInput + orderId: String + data: Object +} + +type CuAddress { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CuAddress + address1: String + address2: String + address3: String + address4: String + cityOrTown: String + stateOrProvince: String + postalOrZipCode: String + countryCode: String + addressType: String + isValidated: Boolean +} + +input CuAddressInput { + address1: String + address2: String + address3: String + address4: String + cityOrTown: String + stateOrProvince: String + postalOrZipCode: String + countryCode: String + addressType: String + isValidated: Boolean = false +} + +type CuAttribute { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CuAttribute + id: Int + adminName: String + namespace: String + attributeCode: String! + inputType: String + valueType: String! + dataType: String + attributeMetadata: [CuAttributeMetadataItem] + attributeFQN: String + content: CuAttributeLocalizedContent + validation: CuAttributeValidation + vocabularyValues: [CuAttributeVocabularyValue] + auditInfo: CuAuditInfo + isActive: Boolean + isRequired: Boolean + isReadOnly: Boolean + isMultiValued: Boolean + isVisible: Boolean + order: Int + displayGroup: String! +} + +type CuAttributeCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CuAttributeCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [CuAttribute] +} + +input CuAttributeInput { + id: Int + adminName: String + namespace: String + attributeCode: String! + inputType: String + valueType: String! + dataType: String + attributeMetadata: [CuAttributeMetadataItemInput] + attributeFQN: String + content: CuAttributeLocalizedContentInput + validation: CuAttributeValidationInput + vocabularyValues: [CuAttributeVocabularyValueInput] + auditInfo: CuAuditInfoInput + isActive: Boolean = false + isRequired: Boolean = false + isReadOnly: Boolean = false + isMultiValued: Boolean = false + isVisible: Boolean = false + order: Int + displayGroup: String! +} + +type CuAttributeLocalizedContent { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CuAttributeLocalizedContent + localeCode: String + value: String +} + +input CuAttributeLocalizedContentInput { + localeCode: String + value: String +} + +type CuAttributeMetadataItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CuAttributeMetadataItem + key: String! + value: String! +} + +input CuAttributeMetadataItemInput { + key: String! + value: String! +} + +type CuAttributeValidation { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CuAttributeValidation + regularExpression: String + minStringLength: Int + maxStringLength: Int + minNumericValue: Float + maxNumericValue: Float + minDateTime: DateTime + maxDateTime: DateTime +} + +input CuAttributeValidationInput { + regularExpression: String + minStringLength: Int + maxStringLength: Int + minNumericValue: Float + maxNumericValue: Float + minDateTime: DateTime + maxDateTime: DateTime +} + +type CuAttributeValueLocalizedContent { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CuAttributeValueLocalizedContent + localeCode: String! + value: String! +} + +input CuAttributeValueLocalizedContentInput { + localeCode: String! + value: String! +} + +type CuAttributeVocabularyValue { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CuAttributeVocabularyValue + value: String! + sequence: Int + isHidden: Boolean + content: CuAttributeValueLocalizedContent +} + +input CuAttributeVocabularyValueInput { + value: String! + sequence: Int + isHidden: Boolean = false + content: CuAttributeValueLocalizedContentInput +} + +type CuAuditInfo { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CuAuditInfo + updateDate: DateTime + createDate: DateTime + updateBy: String + createBy: String +} + +input CuAuditInfoInput { + updateDate: DateTime + createDate: DateTime + updateBy: String + createBy: String +} + +type CuPhone { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CuPhone + home: String + mobile: String + work: String +} + +input CuPhoneInput { + home: String + mobile: String + work: String +} + +type CurrencyAmount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CurrencyAmount + currencyCode: String + amount: Float! +} + +input CurrencyAmountInput { + currencyCode: String + amount: Float! +} + +type CurrencyExchangeRate { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CurrencyExchangeRate + fromCurrencyCode: String + toCurrencyCode: String + rate: Float + multiplier: Float + decimalPlaces: Int + roundingStrategy: Int + referenceData: String +} + +type Customer { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Customer + customerContact: Contact + data: Object + isDestinationCommercial: Boolean +} + +type CustomerAccount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerAccount + emailAddress: String + userName: String + firstName: String + lastName: String + localeCode: String + userId: String + isAnonymous: Boolean + isLocked: Boolean + isActive: Boolean + acceptsMarketing: Boolean + hasExternalPassword: Boolean + id: Int! + customerSet: String + commerceSummary: CommerceSummary + contacts: [CustomerContact] + companyOrOrganization: String + notes: [CustomerNote] + attributes: [CustomerAttribute] + segments: [CustomerSegment] + taxId: String + externalId: String + auditInfo: CuAuditInfo + customerSinceDate: DateTime + accountType: String +} + +input CustomerAccountAndAuthInfoInput { + account: CustomerAccountInput + password: String + externalPassword: String + isImport: Boolean = false +} + +type CustomerAccountCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerAccountCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [CustomerAccount] +} + +input CustomerAccountInput { + emailAddress: String + userName: String + firstName: String + lastName: String + localeCode: String + userId: String + isAnonymous: Boolean = false + isLocked: Boolean = false + isActive: Boolean = false + acceptsMarketing: Boolean = false + hasExternalPassword: Boolean = false + id: Int! + customerSet: String + commerceSummary: CommerceSummaryInput + contacts: [CustomerContactInput] + companyOrOrganization: String + notes: [CustomerNoteInput] + attributes: [CustomerAttributeInput] + segments: [CustomerSegmentInput] + taxId: String + externalId: String + auditInfo: CuAuditInfoInput + customerSinceDate: DateTime + accountType: String +} + +type CustomerAttribute { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerAttribute + auditInfo: CuAuditInfo + fullyQualifiedName: String + attributeDefinitionId: Int + values: [Object!] +} + +type CustomerAttributeCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerAttributeCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [CustomerAttribute] +} + +input CustomerAttributeInput { + auditInfo: CuAuditInfoInput + fullyQualifiedName: String + attributeDefinitionId: Int + values: [Object!] +} + +type CustomerAuditEntry { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerAuditEntry + customerAccountId: Int! + customerAuditEntryId: Int! + entryDate: DateTime! + entryUser: String + application: String + site: String + description: String + fieldPath: String + oldValue: String + newValue: String +} + +type CustomerAuditEntryCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerAuditEntryCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [CustomerAuditEntry] +} + +type CustomerAuthTicket { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerAuthTicket + customerAccount: CustomerAccount + accessToken: String + accessTokenExpiration: DateTime! + refreshToken: String + refreshTokenExpiration: DateTime! + userId: String + jwtAccessToken: String +} + +type CustomerContact { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerContact + accountId: Int! + types: [ContactType] + auditInfo: CuAuditInfo + faxNumber: String + label: String + id: Int + email: String + firstName: String + middleNameOrInitial: String + lastNameOrSurname: String + companyOrOrganization: String + phoneNumbers: CuPhone + address: CuAddress +} + +type CustomerContactCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerContactCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [CustomerContact] +} + +input CustomerContactInput { + accountId: Int! + types: [ContactTypeInput] + auditInfo: CuAuditInfoInput + faxNumber: String + label: String + id: Int + email: String + firstName: String + middleNameOrInitial: String + lastNameOrSurname: String + companyOrOrganization: String + phoneNumbers: CuPhoneInput + address: CuAddressInput +} + +input CustomerInput { + customerContact: ContactInput + data: Object + isDestinationCommercial: Boolean = false +} + +input CustomerLoginInfoInput { + emailAddress: String + username: String + password: String + externalPassword: String + isImport: Boolean = false +} + +type CustomerNote { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerNote + id: Int! + content: String + auditInfo: CuAuditInfo +} + +type CustomerNoteCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerNoteCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [CustomerNote] +} + +input CustomerNoteInput { + id: Int! + content: String + auditInfo: CuAuditInfoInput +} + +type CustomerPurchaseOrderAccount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerPurchaseOrderAccount + id: Int! + accountId: Int! + isEnabled: Boolean + creditLimit: Float! + availableBalance: Float! + totalAvailableBalance: Float! + overdraftAllowance: Float + overdraftAllowanceType: String + customerPurchaseOrderPaymentTerms: [CustomerPurchaseOrderPaymentTerm] + auditInfo: CuAuditInfo +} + +type CustomerPurchaseOrderAccountCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerPurchaseOrderAccountCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [CustomerPurchaseOrderAccount] +} + +input CustomerPurchaseOrderAccountInput { + id: Int! + accountId: Int! + isEnabled: Boolean = false + creditLimit: Float! + availableBalance: Float! + totalAvailableBalance: Float! + overdraftAllowance: Float + overdraftAllowanceType: String + customerPurchaseOrderPaymentTerms: [CustomerPurchaseOrderPaymentTermInput] + auditInfo: CuAuditInfoInput +} + +type CustomerPurchaseOrderPaymentTerm { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerPurchaseOrderPaymentTerm + siteId: Int! + code: String + description: String + auditInfo: CuAuditInfo +} + +input CustomerPurchaseOrderPaymentTermInput { + siteId: Int! + code: String + description: String + auditInfo: CuAuditInfoInput +} + +type CustomerSegment { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerSegment + id: Int! + code: String + name: String + description: String + auditInfo: CuAuditInfo +} + +type CustomerSegmentCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerSegmentCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [CustomerSegment] +} + +input CustomerSegmentInput { + id: Int! + code: String + name: String + description: String + auditInfo: CuAuditInfoInput +} + +type CustomerSet { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerSet + code: String + name: String + description: String + auditInfo: CuAuditInfo + sites: [CustomerSetSite] + isDefault: Boolean + aggregateInfo: CustomerSetAggregateInfo +} + +type CustomerSetAggregateInfo { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerSetAggregateInfo + customerCount: Int! +} + +type CustomerSetCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerSetCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [CustomerSet] +} + +type CustomerSetSite { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: CustomerSetSite + siteId: Int! + customerSetCode: String + name: String +} + +input CustomerUserAuthInfoInput { + username: String + password: String +} + +""" +DateTime custom scalar type +""" +scalar DateTime + +type Destination { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Destination + id: String + destinationContact: Contact + isDestinationCommercial: Boolean + data: Object +} + +input DestinationInput { + id: String + destinationContact: ContactInput + isDestinationCommercial: Boolean = false + data: Object +} + +type DigitalPackage { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DigitalPackage + id: String + code: String + status: String + items: [DigitalPackageItem] + fulfillmentDate: DateTime + fulfillmentLocationCode: String + auditInfo: CrAuditInfo + availableActions: [String!] + changeMessages: [ChangeMessage] +} + +input DigitalPackageInput { + id: String + code: String + status: String + items: [DigitalPackageItemInput] + fulfillmentDate: DateTime + fulfillmentLocationCode: String + auditInfo: CrAuditInfoInput + availableActions: [String!] + changeMessages: [ChangeMessageInput] +} + +type DigitalPackageItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DigitalPackageItem + giftCardCode: String + productCode: String + quantity: Int! + fulfillmentItemType: String + lineId: Int + optionAttributeFQN: String +} + +input DigitalPackageItemInput { + giftCardCode: String + productCode: String + quantity: Int! + fulfillmentItemType: String + lineId: Int + optionAttributeFQN: String +} + +input DigitalWalletInput { + digitalWalletData: String + cartId: String +} + +input DiscountSelectionsInput { + discountIds: [Int!] +} + +type DiscountValidationSummary { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DiscountValidationSummary + applicableDiscounts: [PrDiscount] +} + +type Document { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Document + id: String + name: String + path: String + publishSetCode: String + extension: String + documentTypeFQN: String + listFQN: String + contentLength: Int + contentMimeType: String + contentUpdateDate: DateTime + publishState: String + properties: Object + insertDate: DateTime + updateDate: DateTime + activeDateRange: ActiveDateRange +} + +type DocumentCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DocumentCollection + subPaths: [String!] + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [Document] +} + +type DocumentDraftSummary { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DocumentDraftSummary + id: String + name: String + documentTypeFQN: String + listFQN: String + activeUpdateDate: DateTime + draftUpdateDate: DateTime! + updatedBy: String + activeUpdatedBy: String + publishType: String + publishSetCode: String + masterCatalogId: Int + catalogId: Int + siteId: Int +} + +type DocumentDraftSummaryPagedCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DocumentDraftSummaryPagedCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [DocumentDraftSummary] +} + +input DocumentInput { + id: String + name: String + path: String + publishSetCode: String + extension: String + documentTypeFQN: String + listFQN: String + contentLength: Int + contentMimeType: String + contentUpdateDate: DateTime + publishState: String + properties: Object + insertDate: DateTime + updateDate: DateTime + activeDateRange: ActiveDateRangeInput +} + +type DocumentInstallation { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DocumentInstallation + name: String + documentTypeFQN: String + properties: Object + locale: String +} + +input DocumentInstallationInput { + name: String + documentTypeFQN: String + properties: Object + locale: String +} + +type DocumentList { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DocumentList + name: String + namespace: String + listFQN: String + documentTypes: [String!] + supportsPublishing: Boolean + enablePublishing: Boolean + supportsActiveDateRanges: Boolean + enableActiveDateRanges: Boolean + views: [View] + usages: [String!] + security: String + scopeId: Int + scopeType: String + documentListType: String + metadata: Object +} + +type DocumentListCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DocumentListCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [DocumentList] +} + +input DocumentListInput { + name: String + namespace: String + listFQN: String + documentTypes: [String!] + supportsPublishing: Boolean = false + enablePublishing: Boolean = false + supportsActiveDateRanges: Boolean = false + enableActiveDateRanges: Boolean = false + views: [ViewInput] + usages: [String!] + security: String + scopeId: Int + scopeType: String + documentListType: String + metadata: Object +} + +type DocumentListType { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DocumentListType + name: String + namespace: String + documentListTypeFQN: String + scopeType: String + installationPackage: String + version: String + defaultDocuments: [DocumentInstallation] + documentTypeFQNs: [String!] + supportsPublishing: Boolean + enablePublishing: Boolean + supportsActiveDateRanges: Boolean + enableActiveDateRanges: Boolean + views: [View] + usages: [String!] + metadata: Object +} + +type DocumentListTypeCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DocumentListTypeCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [DocumentListType] +} + +input DocumentListTypeInput { + name: String + namespace: String + documentListTypeFQN: String + scopeType: String + installationPackage: String + version: String + defaultDocuments: [DocumentInstallationInput] + documentTypeFQNs: [String!] + supportsPublishing: Boolean = false + enablePublishing: Boolean = false + supportsActiveDateRanges: Boolean = false + enableActiveDateRanges: Boolean = false + views: [ViewInput] + usages: [String!] + metadata: Object +} + +type DocumentType { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DocumentType + name: String + namespace: String + documentTypeFQN: String + adminName: String + installationPackage: String + version: String + metadata: Object + properties: [Property] +} + +type DocumentTypeCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: DocumentTypeCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [DocumentType] +} + +input DocumentTypeInput { + name: String + namespace: String + documentTypeFQN: String + adminName: String + installationPackage: String + version: String + metadata: Object + properties: [PropertyInput] +} + +type EntityCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: EntityCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [Object!] +} + +type EntityContainer { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: EntityContainer + tenantId: Int! + siteId: Int + masterCatalogId: Int + catalogId: Int + localeCode: String + listFullName: String + userId: String + id: String + item: Object + createBy: String + createDate: DateTime! + updateBy: String + updateDate: DateTime! +} + +type EntityContainerCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: EntityContainerCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [EntityContainer] +} + +type EntityList { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: EntityList + tenantId: Int! + nameSpace: String + name: String + contextLevel: String + useSystemAssignedId: Boolean + idProperty: IndexedProperty + indexA: IndexedProperty + indexB: IndexedProperty + indexC: IndexedProperty + indexD: IndexedProperty + isVisibleInStorefront: Boolean + isLocaleSpecific: Boolean + isShopperSpecific: Boolean + isSandboxDataCloningSupported: Boolean + views: [ListView] + usages: [String!] + metadata: Object + createDate: DateTime! + updateDate: DateTime! +} + +type EntityListCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: EntityListCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [EntityList] +} + +input EntityListInput { + tenantId: Int! + nameSpace: String + name: String + contextLevel: String + useSystemAssignedId: Boolean = false + idProperty: IndexedPropertyInput + indexA: IndexedPropertyInput + indexB: IndexedPropertyInput + indexC: IndexedPropertyInput + indexD: IndexedPropertyInput + isVisibleInStorefront: Boolean = false + isLocaleSpecific: Boolean = false + isShopperSpecific: Boolean = false + isSandboxDataCloningSupported: Boolean = false + views: [ListViewInput] + usages: [String!] + metadata: Object + createDate: DateTime! + updateDate: DateTime! +} + +input ExclusionListEntryLocationCodeInput { + locationCode: String! + orderItemID: Int! +} + +type ExtendedProperty { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ExtendedProperty + key: String + value: String +} + +input ExtendedPropertyInput { + key: String + value: String +} + +type Facet { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Facet + label: String + facetType: String + field: String + values: [FacetValue] +} + +type FacetValue { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: FacetValue + label: String + isApplied: Boolean + count: Int! + value: String + filterValue: String + rangeQueryValueStart: String + rangeQueryValueEnd: String + parentFacetValue: String + isDisplayed: Boolean + childrenFacetValues: [FacetValue] +} + +input FulfillmentActionInput { + actionName: String + packageIds: [String!] + pickupIds: [String!] + digitalPackageIds: [String!] +} + +type FulfillmentField { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: FulfillmentField + name: String + userEnteredValue: Object + required: Boolean +} + +input FulfillmentFieldInput { + name: String + userEnteredValue: Object + required: Boolean = false +} + +type FulfillmentInfo { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: FulfillmentInfo + fulfillmentContact: Contact + isDestinationCommercial: Boolean + shippingMethodCode: String + shippingMethodName: String + data: Object + auditInfo: CrAuditInfo +} + +input FulfillmentInfoInput { + fulfillmentContact: ContactInput + isDestinationCommercial: Boolean = false + shippingMethodCode: String + shippingMethodName: String + data: Object + auditInfo: CrAuditInfoInput +} + +type FulfillmentShopperNotes { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: FulfillmentShopperNotes + comments: String + deliveryInstructions: String + giftMessage: String +} + +input FulfillmentShopperNotesInput { + comments: String + deliveryInstructions: String + giftMessage: String +} + +type FulfillmentTask { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: FulfillmentTask + links: Object + active: Boolean + attributes: Object + completed: Boolean + completedDate: DateTime + description: String + inputs: [TaskInput] + name: String + skippable: Boolean + subject: String + taskId: String +} + +input FulfillmentTaskInput { + links: Object + active: Boolean = false + attributes: Object + completed: Boolean = false + completedDate: DateTime + description: String + inputs: [TaskInputInput] + name: String + skippable: Boolean = false + subject: String + taskId: String +} + +type GatewayGiftCard { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: GatewayGiftCard + cardNumber: String + amount: Float! + currencyCode: String +} + +input GatewayGiftCardInput { + cardNumber: String + amount: Float! + currencyCode: String +} + +type GiftCard { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: GiftCard + activationDate: DateTime + cardNumber: String + code: String + creditType: String + creditValue: Float + currencyCode: String + currentBalance: Float + customerId: Int + expirationDate: DateTime + initialBalance: Float +} + +input GiftCardInput { + activationDate: DateTime + cardNumber: String + code: String + creditType: String + creditValue: Float + currencyCode: String + currentBalance: Float + customerId: Int + expirationDate: DateTime + initialBalance: Float +} + +type Hours { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Hours + label: String + openTime: String + closeTime: String + isClosed: Boolean +} + +input HoursInput { + label: String + openTime: String + closeTime: String + isClosed: Boolean = false +} + +type InStockNotificationSubscription { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: InStockNotificationSubscription + id: Int + email: String + customerId: Int + productCode: String + locationCode: String + userId: String + auditInfo: CuAuditInfo +} + +type InStockNotificationSubscriptionCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: InStockNotificationSubscriptionCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [InStockNotificationSubscription] +} + +input InStockNotificationSubscriptionInput { + id: Int + email: String + customerId: Int + productCode: String + locationCode: String + userId: String + auditInfo: CuAuditInfoInput +} + +type IndexedProperty { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: IndexedProperty + propertyName: String + dataType: String +} + +input IndexedPropertyInput { + propertyName: String + dataType: String +} + +type InvalidCoupon { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: InvalidCoupon + couponCode: String + reasonCode: Int! + reason: String + createDate: DateTime! + discountId: Int! +} + +input InvalidCouponInput { + couponCode: String + reasonCode: Int! + reason: String + createDate: DateTime! + discountId: Int! +} + +enum InventoryRequestTypeEnum { + ALL + PARTIAL + ANY + ALL_STORES +} + +input ItemsForDestinationInput { + destinationId: String + itemIds: [String!] +} + +type JsonNode { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: JsonNode + array: Boolean + bigDecimal: Boolean + bigInteger: Boolean + binary: Boolean + boolean: Boolean + containerNode: Boolean + double: Boolean + float: Boolean + floatingPointNumber: Boolean + int: Boolean + integralNumber: Boolean + long: Boolean + missingNode: Boolean + nodeType: NodeTypeEnum + null: Boolean + number: Boolean + object: Boolean + pojo: Boolean + short: Boolean + textual: Boolean + valueNode: Boolean +} + +input KeyValuePair2Input { + key: String + value: [String!] +} + +type ListView { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ListView + name: String + usages: [String!] + metaData: Object + security: String + filter: String + defaultSort: String + fields: [ListViewField] +} + +type ListViewCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ListViewCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [ListView] +} + +type ListViewField { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ListViewField + name: String + type: String + target: String +} + +input ListViewFieldInput { + name: String + type: String + target: String +} + +input ListViewInput { + name: String + usages: [String!] + metaData: Object + security: String + filter: String + defaultSort: String + fields: [ListViewFieldInput] +} + +type LoAddress { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LoAddress + address1: String + address2: String + address3: String + address4: String + cityOrTown: String + stateOrProvince: String + postalOrZipCode: String + countryCode: String + addressType: String + isValidated: Boolean +} + +input LoAddressInput { + address1: String + address2: String + address3: String + address4: String + cityOrTown: String + stateOrProvince: String + postalOrZipCode: String + countryCode: String + addressType: String + isValidated: Boolean = false +} + +type LoAttribute { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LoAttribute + id: Int + adminName: String + namespace: String + attributeCode: String! + inputType: String + valueType: String! + dataType: String + attributeMetadata: [LoAttributeMetadataItem] + attributeFQN: String + content: LoAttributeLocalizedContent + validation: LoAttributeValidation + vocabularyValues: [LoAttributeVocabularyValue] + auditInfo: LoAuditInfo + isActive: Boolean + isRequired: Boolean + isReadOnly: Boolean + isMultiValued: Boolean + isVisible: Boolean + order: Int + displayGroup: String! +} + +type LoAttributeCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LoAttributeCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [LoAttribute] +} + +input LoAttributeInput { + id: Int + adminName: String + namespace: String + attributeCode: String! + inputType: String + valueType: String! + dataType: String + attributeMetadata: [LoAttributeMetadataItemInput] + attributeFQN: String + content: LoAttributeLocalizedContentInput + validation: LoAttributeValidationInput + vocabularyValues: [LoAttributeVocabularyValueInput] + auditInfo: LoAuditInfoInput + isActive: Boolean = false + isRequired: Boolean = false + isReadOnly: Boolean = false + isMultiValued: Boolean = false + isVisible: Boolean = false + order: Int + displayGroup: String! +} + +type LoAttributeLocalizedContent { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LoAttributeLocalizedContent + localeCode: String + value: String +} + +input LoAttributeLocalizedContentInput { + localeCode: String + value: String +} + +type LoAttributeMetadataItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LoAttributeMetadataItem + key: String! + value: String! +} + +input LoAttributeMetadataItemInput { + key: String! + value: String! +} + +type LoAttributeValidation { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LoAttributeValidation + regularExpression: String + minStringLength: Int + maxStringLength: Int + minNumericValue: Float + maxNumericValue: Float + minDateTime: DateTime + maxDateTime: DateTime +} + +input LoAttributeValidationInput { + regularExpression: String + minStringLength: Int + maxStringLength: Int + minNumericValue: Float + maxNumericValue: Float + minDateTime: DateTime + maxDateTime: DateTime +} + +type LoAttributeValueLocalizedContent { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LoAttributeValueLocalizedContent + localeCode: String! + value: String! +} + +input LoAttributeValueLocalizedContentInput { + localeCode: String! + value: String! +} + +type LoAttributeVocabularyValue { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LoAttributeVocabularyValue + value: String! + sequence: Int + isHidden: Boolean + content: LoAttributeValueLocalizedContent +} + +input LoAttributeVocabularyValueInput { + value: String! + sequence: Int + isHidden: Boolean = false + content: LoAttributeValueLocalizedContentInput +} + +type LoAuditInfo { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LoAuditInfo + updateDate: DateTime + createDate: DateTime + updateBy: String + createBy: String +} + +input LoAuditInfoInput { + updateDate: DateTime + createDate: DateTime + updateBy: String + createBy: String +} + +type LoFulfillmentType { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LoFulfillmentType + code: String + name: String +} + +input LoFulfillmentTypeInput { + code: String + name: String +} + +type Location { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Location + code: String + locationTypes: [LocationType] + name: String + description: String + address: LoAddress + geo: Coordinates + phone: String + fax: String + supportsInventory: Boolean + fulfillmentTypes: [LoFulfillmentType] + regularHours: RegularHours + shippingOriginContact: ShippingOriginContact + note: String + tags: [String!] + attributes: [LocationAttribute] + auditInfo: LoAuditInfo + allowFulfillmentWithNoStock: Boolean + isDisabled: Boolean + express: Boolean + transferEnabled: Boolean + includeInInventoryAggregrate: Boolean + includeInLocationExport: Boolean + warehouseEnabled: Boolean + requiresManifest: Boolean +} + +type LocationAttribute { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LocationAttribute + attributeDefinition: LoAttribute + auditInfo: LoAuditInfo + fullyQualifiedName: String + attributeDefinitionId: Int + values: [Object!] +} + +input LocationAttributeInput { + attributeDefinition: LoAttributeInput + auditInfo: LoAuditInfoInput + fullyQualifiedName: String + attributeDefinitionId: Int + values: [Object!] +} + +type LocationCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LocationCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [Location] +} + +type LocationGroup { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LocationGroup + locationGroupId: Int! + locationGroupCode: String + siteIds: [Int!] + name: String + locationCodes: [String!] + auditInfo: LoAuditInfo +} + +type LocationGroupCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LocationGroupCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [LocationGroup] +} + +type LocationGroupConfiguration { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LocationGroupConfiguration + tenantId: Int! + siteId: Int! + locationGroupId: Int! + locationGroupCode: String + customerFailedToPickupAfterAction: String + customerFailedToPickupDeadline: Int + sendCustomerPickupReminder: Int + enableForSTH: Boolean + enableForISPU: Boolean + enableAdvancedOptionForPickWaveCreation: Boolean + maximumNumberOfOrdersInPickWave: Int + defaultNumberOfOrdersInPickWave: Int + pickWavePrintFormat: String + closePickWavePermissions: [String!] + wmsEnabled: Boolean + enableScanningOfUpcForShipToHome: Boolean + allowReturns: Boolean + returnRefundReduction: Boolean + defaultReturnRefundReductionAmount: Int + maximumReturnRefundReductionAmount: Int + defaultCarrier: String + carriers: [Carrier] + printReturnLabel: Boolean + defaultPrinterType: String + boxTypes: [BoxType] + attributes: [LocationAttribute] + bpmConfigurations: [BpmConfiguration] + auditInfo: LoAuditInfo + autoPackingListPopup: Boolean + blockPartialStock: Boolean + defaultMaxNumberOfShipmentsInPickWave: Int + displayProductImagesInPickWaveDetails: Boolean + enablePnpForSTH: Boolean + enablePnpForBOPIS: Boolean + blockPartialCancel: Boolean + packageSettings: PackageSettings +} + +input LocationGroupInput { + locationGroupId: Int! + locationGroupCode: String + siteIds: [Int!] + name: String + locationCodes: [String!] + auditInfo: LoAuditInfoInput +} + +input LocationInput { + code: String + locationTypes: [LocationTypeInput] + name: String + description: String + address: LoAddressInput + geo: CoordinatesInput + phone: String + fax: String + supportsInventory: Boolean = false + fulfillmentTypes: [LoFulfillmentTypeInput] + regularHours: RegularHoursInput + shippingOriginContact: ShippingOriginContactInput + note: String + tags: [String!] + attributes: [LocationAttributeInput] + auditInfo: LoAuditInfoInput + allowFulfillmentWithNoStock: Boolean = false + isDisabled: Boolean = false + express: Boolean = false + transferEnabled: Boolean = false + includeInInventoryAggregrate: Boolean = false + includeInLocationExport: Boolean = false + warehouseEnabled: Boolean = false + requiresManifest: Boolean = false +} + +type LocationInventory { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LocationInventory + productCode: String + locationCode: String + stockAvailable: Int + softStockAvailable: Int + sku: String + mfgPartNumber: String +} + +type LocationInventoryCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LocationInventoryCollection + totalCount: Int! + items: [LocationInventory] +} + +input LocationInventoryQueryInput { + locationCodes: [String!] + productCodes: [String!] +} + +type LocationType { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LocationType + code: String + name: String + auditInfo: LoAuditInfo +} + +input LocationTypeInput { + code: String + name: String + auditInfo: LoAuditInfoInput +} + +type LocationUsage { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LocationUsage + locationUsageTypeCode: String + locationTypeCodes: [String!] + locationCodes: [String!] + auditInfo: LoAuditInfo +} + +type LocationUsageCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LocationUsageCollection + totalCount: Int! + items: [LocationUsage] +} + +input LocationUsageInput { + locationUsageTypeCode: String + locationTypeCodes: [String!] + locationCodes: [String!] + auditInfo: LoAuditInfoInput +} + +type LoginState { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: LoginState + isPasswordChangeRequired: Boolean + lastPasswordChangeOn: DateTime + isLocked: Boolean + lastLockedOn: DateTime + failedLoginAttemptCount: Int! + remainingLoginAttempts: Int! + firstFailedLoginAttemptOn: DateTime + lastLoginOn: DateTime + createdOn: DateTime + updatedOn: DateTime +} + +input MZDBHttpContentInput { + headers: [MZDBStringStringIEnumerableKeyValuePairInput] +} + +input MZDBHttpMethodInput { + method: String +} + +input MZDBHttpRequestMessageInput { + version: String + content: MZDBHttpContentInput + method: MZDBHttpMethodInput + requestUri: DateTime + headers: [MZDBStringStringIEnumerableKeyValuePairInput] + properties: Object +} + +input MZDBStringStringIEnumerableKeyValuePairInput { + key: String + value: [String!] +} + +type Mutation { + createCustomerAccountAttributeDefinition( + attributeInput: CuAttributeInput + ): CuAttribute + updateCustomerAccountAttributeDefinition( + attributeFQN: String! + attributeInput: CuAttributeInput + ): CuAttribute + validateCustomerAddress( + addressValidationRequestInput: AddressValidationRequestInput + ): AddressValidationResponse + validateAddress(addressInput: CuAddressInput): [CuAddress] + createCustomerAuthTicket( + customerUserAuthInfoInput: CustomerUserAuthInfoInput + ): CustomerAuthTicket + refreshCustomerAuthTickets(refreshToken: String): CustomerAuthTicket + createCustomerB2bAccountAttribute( + accountId: Int! + customerAttributeInput: CustomerAttributeInput + ): CustomerAttribute + deleteB2bAccountAttribute(accountId: Int!, attributeFQN: String!): Boolean + updateCustomerB2bAccountAttribute( + accountId: Int! + attributeFQN: String! + customerAttributeInput: CustomerAttributeInput + ): CustomerAttribute + createCustomerB2bAccount(b2BAccountInput: B2BAccountInput): B2BAccount + updateCustomerB2bAccount( + accountId: Int! + b2BAccountInput: B2BAccountInput + ): B2BAccount + createCustomerB2bAccountUser( + accountId: Int! + b2BUserAndAuthInfoInput: B2BUserAndAuthInfoInput + ): B2BUser + updateCustomerB2bAccountUser( + accountId: Int! + userId: String! + b2BUserInput: B2BUserInput + ): B2BUser + removeCustomerB2bAccountUser(accountId: Int!, userId: String!): Boolean + addRoleToCustomerB2bAccount( + accountId: Int! + userId: String! + roleId: Int! + ): Boolean + deleteB2bAccountRole(accountId: Int!, userId: String!, roleId: Int!): Boolean + createCustomerCredit(userId: String, creditInput: CreditInput): Credit + updateCustomerCredit(code: String!, creditInput: CreditInput): Credit + deleteCustomerCredit(code: String!): Boolean + updateCustomerCreditAssociateToShopper(code: String!): Credit + resendCustomerCreditEmail(code: String!, userId: String): Boolean + createCustomerCreditTransaction( + code: String! + creditTransactionInput: CreditTransactionInput + ): CreditTransaction + createCustomerAccountAttribute( + accountId: Int! + userId: String + customerAttributeInput: CustomerAttributeInput + ): CustomerAttribute + deleteCustomerAccountAttribute( + accountId: Int! + attributeFQN: String! + userId: String + ): Boolean + updateCustomerAccountAttribute( + accountId: Int! + attributeFQN: String! + userId: String + customerAttributeInput: CustomerAttributeInput + ): CustomerAttribute + createCustomerAccountCard(accountId: Int!, cardInput: CardInput): Card + updateCustomerAccountCard( + accountId: Int! + cardId: String! + cardInput: CardInput + ): Card + deleteCustomerAccountCard(accountId: Int!, cardId: String!): Boolean + createCustomerAccountContact( + accountId: Int! + customerContactInput: CustomerContactInput + ): CustomerContact + updateCustomerAccountContacts( + accountId: Int! + customerContactInput: CustomerContactInput + ): CustomerContactCollection + updateCustomerAccountContact( + accountId: Int! + contactId: Int! + userId: String + customerContactInput: CustomerContactInput + ): CustomerContact + deleteCustomerAccountContact(accountId: Int!, contactId: Int!): Boolean + createCustomerAccount( + customerAccountInput: CustomerAccountInput + ): CustomerAccount + updateCustomerAccount( + accountId: Int! + customerAccountInput: CustomerAccountInput + ): CustomerAccount + deleteCustomerAccount(accountId: Int!): Boolean + createCustomerAccountTransaction( + accountId: Int! + transactionInput: TransactionInput + ): Transaction + deleteCustomerAccountTransaction( + accountId: Int! + transactionId: String! + ): Boolean + recomputeCustomerAccountLifetimeValue(accountId: Int!): Boolean + createCustomerAccountNote( + accountId: Int! + customerNoteInput: CustomerNoteInput + ): CustomerNote + updateCustomerAccountNote( + accountId: Int! + noteId: Int! + customerNoteInput: CustomerNoteInput + ): CustomerNote + deleteCustomerAccountNote(accountId: Int!, noteId: Int!): Boolean + createCustomerAccountPurchaseOrderAccount( + accountId: Int! + customerPurchaseOrderAccountInput: CustomerPurchaseOrderAccountInput + ): CustomerPurchaseOrderAccount + updateCustomerPurchaseOrderAccount( + accountId: Int! + customerPurchaseOrderAccountInput: CustomerPurchaseOrderAccountInput + ): CustomerPurchaseOrderAccount + createCustomerAccountPurchaseOrderAccountTransaction( + accountId: Int! + purchaseOrderTransactionInput: PurchaseOrderTransactionInput + ): PurchaseOrderTransaction + createPurchaseOrderAccount( + startIndex: Int + pageSize: Int + sortBy: String + accountType: String + ): CustomerPurchaseOrderAccountCollection + changeCustomerAccountPassword( + accountId: Int! + unlockAccount: Boolean + userId: String + passwordInfoInput: PasswordInfoInput + ): Boolean + updateCustomerAccountPasswords( + accountPasswordInfoCollectionInput: AccountPasswordInfoCollectionInput + ): ChangePasswordResultCollection + resetCustomerAccountPassword( + resetPasswordInfoInput: ResetPasswordInfoInput + ): Boolean + createCustomerAccountLogin( + accountId: Int! + customerLoginInfoInput: CustomerLoginInfoInput + ): CustomerAuthTicket + createCustomerAccountAndLogin( + customerAccountAndAuthInfoInput: CustomerAccountAndAuthInfoInput + ): CustomerAuthTicket + setCustomerAccountLoginLocked( + accountId: Int! + userId: String + graphQLBoolean: Boolean + ): Boolean + setCustomerAccountPasswordChangeRequired( + accountId: Int! + userId: String + graphQLBoolean: Boolean + ): Boolean + createCustomerAccounts( + customerAccountAndAuthInfoInput: CustomerAccountAndAuthInfoInput + ): CustomerAccountCollection + createCustomerSegment( + customerSegmentInput: CustomerSegmentInput + ): CustomerSegment + updateCustomerSegment( + id: Int! + customerSegmentInput: CustomerSegmentInput + ): CustomerSegment + deleteCustomerSegment(id: Int!): Boolean + createCustomerSegmentAccount(id: Int!, graphQLInt: Int): Boolean + deleteCustomerSegmentAccount(id: Int!, accountId: Int!): Boolean + createInStockNotification( + inStockNotificationSubscriptionInput: InStockNotificationSubscriptionInput + ): InStockNotificationSubscription + deleteInStockNotification(id: Int!): Boolean + createResolvedPriceList(object: Object): ResolvedPriceList + configureProduct( + productCode: String! + includeOptionDetails: Boolean + skipInventoryCheck: Boolean + quantity: Int + purchaseLocation: String + variationProductCodeFilter: String + productOptionSelectionsInput: ProductOptionSelectionsInput + ): ConfiguredProduct + validateProduct( + productCode: String! + skipInventoryCheck: Boolean + quantity: Int + skipDefaults: Boolean + purchaseLocation: String + productOptionSelectionsInput: ProductOptionSelectionsInput + ): ProductValidationSummary + validateProductDiscounts( + productCode: String! + variationProductCode: String + customerAccountId: Int + allowInactive: Boolean + skipInventoryCheck: Boolean + discountSelectionsInput: DiscountSelectionsInput + ): DiscountValidationSummary + manageLocationProductInventory( + locationInventoryQueryInput: LocationInventoryQueryInput + ): LocationInventoryCollection + createProductCost( + productCostQueryInput: ProductCostQueryInput + ): ProductCostCollection + createCartForUser(userId: String!): Cart + updateUserCart(userId: String!, cartInput: CartInput): Cart + updateCurrentCart(cartInput: CartInput): Cart + deleteCurrentCart: Boolean + updateCart(cartId: String!, cartInput: CartInput): Cart + deleteCart(cartId: String!): Boolean + deleteUserCart(userId: String!): Boolean + rejectCartDiscount(cartId: String!, discountId: Int!): Cart + updateCartCoupon(cartId: String!, couponCode: String!): Cart + deleteCartCoupons(cartId: String!): Cart + deleteCartCoupon(cartId: String!, couponCode: String!): Cart + addExtendedPropertyToCurrentCart( + extendedPropertyInput: ExtendedPropertyInput + ): [ExtendedProperty] + updateCurrentCartExtendedProperties( + upsert: Boolean + extendedPropertyInput: ExtendedPropertyInput + ): [ExtendedProperty] + deleteCurrentCartExtendedProperties(graphQLString: String): Boolean + updateCurrentCartExtendedProperty( + key: String! + upsert: Boolean + extendedPropertyInput: ExtendedPropertyInput + ): ExtendedProperty + deleteCurrentCartExtendedProperty(key: String!): Boolean + deleteCurrentCartItems: Cart + addItemToCurrentCart(cartItemInput: CartItemInput): CartItem + deleteCartItems(cartId: String!): Cart + addItemToCart(cartId: String!, cartItemInput: CartItemInput): CartItem + updateCurrentCartItem( + cartItemId: String! + cartItemInput: CartItemInput + ): CartItem + deleteCurrentCartItem(cartItemId: String!): Boolean + updateCartItem( + cartId: String! + cartItemId: String! + cartItemInput: CartItemInput + ): CartItem + deleteCartItem(cartId: String!, cartItemId: String!): Boolean + addItemsToCurrentCart( + throwErrorOnInvalidItems: Boolean + cartItemInput: CartItemInput + ): Boolean + addItemsToCart( + cartId: String! + throwErrorOnInvalidItems: Boolean + cartItemInput: CartItemInput + ): Boolean + updateCurrentCartItemQuantity(cartItemId: String!, quantity: Int!): CartItem + updateCartItemQuantity( + cartId: String! + cartItemId: String! + quantity: Int! + ): CartItem + deleteCurrentCartMessages: Boolean + deleteCurrentCartMessage(messageId: String!): Boolean + createCommerceChannel(channelInput: ChannelInput): Channel + updateChannel(code: String!, channelInput: ChannelInput): Channel + deleteCommerceChannel(code: String!): Boolean + createCommerceChannelGroup(channelGroupInput: ChannelGroupInput): ChannelGroup + updateChannelGroup( + code: String! + channelGroupInput: ChannelGroupInput + ): ChannelGroup + deleteCommerceChannelGroup(code: String!): Boolean + createCheckoutAttribute( + checkoutId: String! + orderAttributeInput: OrderAttributeInput + ): [OrderAttribute] + updateCheckoutAttributes( + checkoutId: String! + removeMissing: Boolean + orderAttributeInput: OrderAttributeInput + ): [OrderAttribute] + updateCheckout(checkoutId: String!, checkoutInput: CheckoutInput): Checkout + createCheckout(cartId: String): Checkout + createCheckoutShippingMethod( + checkoutId: String! + checkoutGroupShippingMethodInput: CheckoutGroupShippingMethodInput + ): Checkout + createCheckoutAction( + checkoutId: String! + checkoutActionInput: CheckoutActionInput + ): Checkout + updateCheckoutDigitalWalletType( + checkoutId: String! + digitalWalletType: String! + digitalWalletInput: DigitalWalletInput + ): Checkout + updateCheckoutPriceList(checkoutId: String!, graphQLString: String): Checkout + resendCheckoutEmail(checkoutId: String!): Boolean + updateCheckoutCoupon(checkoutId: String!, couponCode: String!): Checkout + deleteCheckoutCoupons(checkoutId: String!): Checkout + deleteCheckoutCoupon(checkoutId: String!, couponCode: String!): Checkout + updateCheckoutDestination( + checkoutId: String! + destinationId: String! + destinationInput: DestinationInput + ): Destination + deleteCheckoutDestination( + checkoutId: String! + destinationId: String! + ): Boolean + createCheckoutDestination( + checkoutId: String! + destinationInput: DestinationInput + ): Destination + createCheckoutItem( + checkoutId: String! + orderItemInput: CrOrderItemInput + ): Checkout + deleteCheckoutItem(checkoutId: String!, itemId: String!): Checkout + updateCheckoutItemDestination( + checkoutId: String! + itemId: String! + destinationId: String! + ): Checkout + createCheckoutItemDestination( + checkoutId: String! + itemsForDestinationInput: ItemsForDestinationInput + ): Checkout + createCheckoutPaymentAction( + checkoutId: String! + paymentActionInput: PaymentActionInput + ): Checkout + updateCheckoutPaymentAction( + checkoutId: String! + paymentId: String! + paymentActionInput: PaymentActionInput + ): Checkout + createOrderPaymentAction( + orderId: String! + paymentActionInput: PaymentActionInput + ): Order + createOrderPaymentPaymentAction( + orderId: String! + paymentId: String! + paymentActionInput: PaymentActionInput + ): Order + createOrderAutoCapture(orderId: String!, forceCapture: Boolean): Order + createOrderPickup(orderId: String!, pickupInput: PickupInput): Pickup + updateOrderPickup( + orderId: String! + pickupId: String! + pickupInput: PickupInput + ): Pickup + deleteOrderPickup(orderId: String!, pickupId: String!): Boolean + createOrderRefund(orderId: String!, refundInput: RefundInput): Refund + updateOrderRefund(orderId: String!, refundId: String!): Boolean + createOrderShipment(orderId: String!, graphQLString: String): [PackageObj] + deleteOrderShipment(orderId: String!, shipmentId: String!): Boolean + repriceOrderShipment( + shipmentNumber: Int! + orderId: String! + repriceShipmentObjectInput: RepriceShipmentObjectInput + ): Shipment + createOrderShipmentAdjustment( + orderId: String! + shipmentNumber: Int! + shipmentAdjustmentInput: ShipmentAdjustmentInput + ): Shipment + createOrderShipmentItemAdjustment( + shipmentNumber: Int! + itemId: Int! + orderId: String! + shipmentItemAdjustmentInput: ShipmentItemAdjustmentInput + ): Shipment + splitOrderShipment( + orderId: String! + shipmentNumber: String! + splitShipmentsObjectInput: SplitShipmentsObjectInput + ): [Shipment] + updateOrderValidationResults( + orderId: String! + orderValidationResultInput: OrderValidationResultInput + ): OrderValidationResult + updateOrderAdjustment( + orderId: String! + updateMode: String + version: String + adjustmentInput: AdjustmentInput + ): Order + deleteOrderAdjustment( + orderId: String! + updateMode: String + version: String + ): Order + updateOrderShippingAdjustment( + orderId: String! + updateMode: String + version: String + adjustmentInput: AdjustmentInput + ): Order + deleteOrderAdjustmentShipping( + orderId: String! + updateMode: String + version: String + ): Order + updateOrderHandlingAdjustment( + orderId: String! + updateMode: String + version: String + adjustmentInput: AdjustmentInput + ): Order + deleteOrderAdjustmentHandling( + orderId: String! + updateMode: String + version: String + ): Order + createOrderAttribute( + orderId: String! + orderAttributeInput: OrderAttributeInput + ): [OrderAttribute] + updateOrderAttributes( + orderId: String! + removeMissing: Boolean + orderAttributeInput: OrderAttributeInput + ): [OrderAttribute] + updateOrderBillingInfo( + orderId: String! + updateMode: String + version: String + billingInfoInput: BillingInfoInput + ): BillingInfo + cancelOrder(orderId: String!, canceledReasonInput: CanceledReasonInput): Order + createOrder(cartId: String, quoteId: String, orderInput: OrderInput): Order + updateUserOrder(orderId: String!): Order + updateOrderPriceList( + orderId: String! + updateMode: String + version: String + graphQLString: String + ): Order + resendOrderEmail( + orderId: String! + orderActionInput: OrderActionInput + ): Boolean + updateOrder( + orderId: String! + updateMode: String + version: String + orderInput: OrderInput + ): Order + updateOrderDigitalWalletTpe( + orderId: String! + digitalWalletType: String! + digitalWalletInput: DigitalWalletInput + ): Order + updateOrderDraft(orderId: String!, version: String): Boolean + createOrderAction(orderId: String!, orderActionInput: OrderActionInput): Order + updateOrderDiscount( + orderId: String! + discountId: Int! + updateMode: String + version: String + appliedDiscountInput: CrAppliedDiscountInput + ): Order + updateOrderPrice(refreshShipping: Boolean, orderInput: OrderInput): Order + updateOrderCoupon( + orderId: String! + couponCode: String! + updateMode: String + version: String + ): Order + deleteOrderCoupons( + orderId: String! + updateMode: String + version: String + ): Order + deleteOrderCoupon( + orderId: String! + couponCode: String! + updateMode: String + version: String + ): Order + createOrderDigitalPackage( + orderId: String! + digitalPackageInput: DigitalPackageInput + ): DigitalPackage + updateOrderDigitalPackage( + orderId: String! + digitalPackageId: String! + digitalPackageInput: DigitalPackageInput + ): DigitalPackage + deleteOrderDigitalPackage( + orderId: String! + digitalPackageId: String! + ): Boolean + createOrderExtendedProperties( + orderId: String! + updateMode: String + version: String + extendedPropertyInput: ExtendedPropertyInput + ): [ExtendedProperty] + updateOrderExtendedProperties( + orderId: String! + updateMode: String + version: String + upsert: Boolean + extendedPropertyInput: ExtendedPropertyInput + ): [ExtendedProperty] + deleteOrderExtendedProperties( + orderId: String! + updateMode: String + version: String + graphQLString: String + ): Boolean + updateOrderExtendedProperty( + orderId: String! + key: String! + updateMode: String + version: String + upsert: Boolean + extendedPropertyInput: ExtendedPropertyInput + ): ExtendedProperty + deleteOrderExtendedProperty( + orderId: String! + key: String! + updateMode: String + version: String + ): Boolean + createOrderFulfillmentAction( + orderId: String! + fulfillmentActionInput: FulfillmentActionInput + ): Order + resendOrderFulfillmentEmail( + orderId: String! + fulfillmentActionInput: FulfillmentActionInput + ): Order + updateOrderFulfillmentInfo( + orderId: String! + updateMode: String + version: String + fulfillmentInfoInput: FulfillmentInfoInput + ): FulfillmentInfo + createOrderItem( + orderId: String! + updateMode: String + version: String + skipInventoryCheck: Boolean + orderItemInput: CrOrderItemInput + ): Order + deleteOrderItem( + orderId: String! + orderItemId: String! + updateMode: String + version: String + ): Order + updateOrderItemPrice( + orderId: String! + orderItemId: String! + price: Float! + updateMode: String + version: String + ): Order + updateOrderItemQuantity( + orderId: String! + orderItemId: String! + quantity: Int! + updateMode: String + version: String + ): Order + updateOrderItemDutyAmount( + orderId: String! + orderItemId: String! + dutyAmount: Float! + updateMode: String + version: String + ): Order + updateOrderItemFulfillment( + orderId: String! + orderItemId: String! + updateMode: String + version: String + orderItemInput: CrOrderItemInput + ): Order + updateOrderItemDiscount( + orderId: String! + orderItemId: String! + discountId: Int! + updateMode: String + version: String + appliedDiscountInput: CrAppliedDiscountInput + ): Order + createOrderNote(orderId: String!, orderNoteInput: OrderNoteInput): OrderNote + updateOrderNotes( + orderId: String! + noteId: String! + orderNoteInput: OrderNoteInput + ): OrderNote + deleteOrderNote(orderId: String!, noteId: String!): Boolean + createOrderPackage( + orderId: String! + packageObjInput: PackageObjInput + ): PackageObj + updateOrderPackage( + orderId: String! + packageId: String! + packageObjInput: PackageObjInput + ): PackageObj + deleteOrderPackage(orderId: String!, packageId: String!): Boolean + validateOrder(orderInput: OrderInput): OrderValidationResult + updateQuote( + quoteId: String! + updateMode: String + quoteInput: QuoteInput + ): Quote + deleteQuote(quoteId: String!, draft: Boolean): Boolean + createQuote(quoteInput: QuoteInput): Quote + createQuoteItem( + quoteId: String! + updateMode: String + orderItemInput: CrOrderItemInput + ): Quote + deleteQuoteItem( + quoteId: String! + quoteItemId: String! + updateMode: String + ): Boolean + createReturn(returnObjInput: ReturnObjInput): ReturnObj + resendReturnEmail(returnActionInput: ReturnActionInput): Boolean + updateReturn(returnId: String!, returnObjInput: ReturnObjInput): ReturnObj + deleteReturn(returnId: String!): Boolean + createReturnAction(returnActionInput: ReturnActionInput): ReturnCollection + setReturnShip( + returnId: String! + returnItemSpecifierInput: ReturnItemSpecifierInput + ): Order + createReturnPaymentAction( + returnId: String! + paymentActionInput: PaymentActionInput + ): ReturnObj + createReturnPaymentPaymentAction( + returnId: String! + paymentId: String! + paymentActionInput: PaymentActionInput + ): ReturnObj + setReturnRestock( + returnId: String! + restockableReturnItemInput: RestockableReturnItemInput + ): ReturnObj + createReturnItem( + returnId: String! + returnItemInput: ReturnItemInput + ): ReturnObj + deleteReturnItem( + returnId: String + returnItemId: String + orderId: String! + orderItemId: String! + ): ReturnObj + createReturnNote(returnId: String!, orderNoteInput: OrderNoteInput): OrderNote + updateReturnNote( + returnId: String! + noteId: String! + orderNoteInput: OrderNoteInput + ): OrderNote + deleteReturnNote(returnId: String!, noteId: String!): Boolean + createReturnPackage( + returnId: String! + packageObjInput: PackageObjInput + ): PackageObj + updateReturnPackage( + returnId: String! + packageId: String! + packageObjInput: PackageObjInput + ): PackageObj + deleteReturnPackage(returnId: String!, packageId: String!): Boolean + createReturnShipment(returnId: String!, graphQLString: String): [PackageObj] + deleteReturnShipment(returnId: String!, shipmentId: String!): Boolean + createWishlist(wishlistInput: WishlistInput): Wishlist + updateWishlist(wishlistId: String!, wishlistInput: WishlistInput): Wishlist + deleteWishlist(wishlistId: String!): Boolean + deleteWishlistItems(wishlistId: String!): Wishlist + createWishlistItem( + wishlistId: String! + wishlistItemInput: WishlistItemInput + ): WishlistItem + updateWishlistItem( + wishlistId: String! + wishlistItemId: String! + wishlistItemInput: WishlistItemInput + ): WishlistItem + deleteWishlistItem(wishlistId: String!, wishlistItemId: String!): Boolean + updateWishlistItemQuantity( + wishlistId: String! + wishlistItemId: String! + quantity: Int! + ): WishlistItem + updateDocumentListDocumentContent( + documentListName: String! + documentId: String! + httpRequestMessageInput: CoHttpRequestMessageInput + ): Boolean + deleteDocumentListDocumentContent( + documentListName: String! + documentId: String! + ): Boolean + updateDocumentListDocumentTreeContent( + documentListName: String! + documentName: String! + httpRequestMessageInput: CoHttpRequestMessageInput + ): Boolean + deleteDocumentListDocumentTreeContent( + documentListName: String! + documentName: String! + httpRequestMessageInput: CoHttpRequestMessageInput + ): Boolean + createDocumentListDocument( + documentListName: String! + documentInput: DocumentInput + ): Document + updateDocumentListDocument( + documentListName: String! + documentId: String! + documentInput: DocumentInput + ): Document + patchDocumentListDocument( + documentListName: String! + documentId: String! + documentInput: DocumentInput + ): Document + deleteDocumentListDocument( + documentListName: String! + documentId: String! + ): Boolean + createDocumentList(documentListInput: DocumentListInput): DocumentList + updateDocumentList( + documentListName: String! + documentListInput: DocumentListInput + ): DocumentList + deleteDocumentList(documentListName: String!): Boolean + createDocumentListType( + documentListTypeInput: DocumentListTypeInput + ): DocumentListType + updateDocumentListType( + documentListTypeFQN: String! + documentListTypeInput: DocumentListTypeInput + ): DocumentListType + createDocumentDraft(documentLists: String, graphQLString: String): Boolean + toggleDocumentPublishing( + documentLists: String + graphQLString: String + ): Boolean + createDocumentType(documentTypeInput: DocumentTypeInput): DocumentType + updateDocumentType( + documentTypeName: String! + documentTypeInput: DocumentTypeInput + ): DocumentType + createPropertyType(propertyTypeInput: PropertyTypeInput): PropertyType + updatePropertyType( + propertyTypeName: String! + propertyTypeInput: PropertyTypeInput + ): PropertyType + deletePropertyType(propertyTypeName: String!): Boolean + adminCreateLocation(locationInput: LocationInput): Location + adminUpdateLocation( + locationCode: String! + locationInput: LocationInput + ): Location + deleteAdminLocation(locationCode: String!): Boolean + adminCreateLocationAttribute(attributeInput: LoAttributeInput): LoAttribute + adminUpdateLocationAttribute( + attributeFQN: String! + attributeInput: LoAttributeInput + ): LoAttribute + adminCreateLocationGroup( + locationGroupInput: LocationGroupInput + ): LocationGroup + updateLocationUsage( + code: String! + locationUsageInput: LocationUsageInput + ): LocationUsage + adminCreateLocationType(locationTypeInput: LocationTypeInput): LocationType + adminUpdateLocationType( + locationTypeCode: String! + locationTypeInput: LocationTypeInput + ): LocationType + deleteAdminLocationType(locationTypeCode: String!): Boolean + updateEntityListEntities( + entityListFullName: String! + id: String! + httpRequestMessageInput: MZDBHttpRequestMessageInput + ): Boolean + deleteEntityListEntity(entityListFullName: String!, id: String!): Boolean + createEntityListEntity( + entityListFullName: String! + httpRequestMessageInput: MZDBHttpRequestMessageInput + ): Boolean + updateEntityList( + entityListFullName: String! + entityListInput: EntityListInput + ): EntityList + deleteEntityList(entityListFullName: String!): Boolean + createEntityList(entityListInput: EntityListInput): EntityList + createEntityListView( + entityListFullName: String! + listViewInput: ListViewInput + ): ListView + updateEntityListView( + entityListFullName: String! + viewName: String! + listViewInput: ListViewInput + ): ListView + deleteEntityListView(entityListFullName: String!, viewName: String!): Boolean + createTargetRule(targetRuleInput: TargetRuleInput): TargetRule + updateTargetRule(code: String!, targetRuleInput: TargetRuleInput): TargetRule + deleteCommerceTargetRule(code: String!): Boolean + validateTargetRule(targetRuleInput: TargetRuleInput): Boolean + createOrderRoutingSuggestion( + returnSuggestionLog: Boolean + suggestionRequestInput: SuggestionRequestInput + ): SuggestionResponse +} + +enum NodeTypeEnum { + ARRAY + BINARY + BOOLEAN + MISSING + NULL + NUMBER + OBJECT + POJO + STRING +} + +""" +Object custom scalar type +""" +scalar Object + +type Order { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Order + orderNumber: Int + locationCode: String + version: String + parentOrderId: String + parentOrderNumber: Int + parentCheckoutId: String + parentCheckoutNumber: Int + partialOrderNumber: Int + partialOrderCount: Int + isPartialOrder: Boolean + parentReturnId: String + parentReturnNumber: Int + originalCartId: String + originalQuoteId: String + originalQuoteNumber: Int + priceListCode: String + availableActions: [String!] + shopperNotes: ShopperNotes + customerAccountId: Int + customerTaxId: String + isTaxExempt: Boolean + email: String + ipAddress: String + sourceDevice: String + acceptsMarketing: Boolean + status: String + type: String + paymentStatus: String + returnStatus: String + isEligibleForReturns: Boolean + totalCollected: Float! + attributes: [OrderAttribute] + adjustment: Adjustment + shippingAdjustment: Adjustment + handlingAdjustment: Adjustment + shippingDiscounts: [ShippingDiscount] + handlingDiscounts: [CrAppliedDiscount] + handlingAmount: Float + handlingSubTotal: Float + handlingTotal: Float + dutyAmount: Float + dutyTotal: Float + fulfillmentStatus: String + submittedDate: DateTime + cancelledDate: DateTime + closedDate: DateTime + acceptedDate: DateTime + notes: [OrderNote] + items: [CrOrderItem] + validationResults: [OrderValidationResult] + billingInfo: BillingInfo + payments: [Payment] + refunds: [Refund] + packages: [PackageObj] + pickups: [Pickup] + digitalPackages: [DigitalPackage] + shipments: [Shipment] + isDraft: Boolean + hasDraft: Boolean + isImport: Boolean + isHistoricalImport: Boolean + importDate: DateTime + isUnified: Boolean + externalId: String + couponCodes: [String!] + invalidCoupons: [InvalidCoupon] + amountAvailableForRefund: Float! + amountRemainingForPayment: Float! + amountRefunded: Float! + readyToCapture: Boolean + isOptInForSms: Boolean + userId: String + id: String + tenantId: Int + siteId: Int + channelCode: String + currencyCode: String + visitId: String + webSessionId: String + customerInteractionType: String + fulfillmentInfo: FulfillmentInfo + orderDiscounts: [CrAppliedDiscount] + suggestedDiscounts: [SuggestedDiscount] + rejectedDiscounts: [SuggestedDiscount] + data: Object + taxData: Object + subtotal: Float + discountedSubtotal: Float + discountTotal: Float + discountedTotal: Float + shippingTotal: Float + shippingSubTotal: Float + shippingTaxTotal: Float + handlingTaxTotal: Float + itemTaxTotal: Float + taxTotal: Float + feeTotal: Float + total: Float + lineItemSubtotalWithOrderAdjustments: Float + shippingAmountBeforeDiscountsAndAdjustments: Float + lastValidationDate: DateTime + expirationDate: DateTime + changeMessages: [ChangeMessage] + extendedProperties: [ExtendedProperty] + discountThresholdMessages: [ThresholdMessage] + auditInfo: CrAuditInfo +} + +input OrderActionInput { + actionName: String +} + +type OrderAttribute { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: OrderAttribute + auditInfo: CrAuditInfo + fullyQualifiedName: String + attributeDefinitionId: Int + values: [Object!] +} + +input OrderAttributeInput { + auditInfo: CrAuditInfoInput + fullyQualifiedName: String + attributeDefinitionId: Int + values: [Object!] +} + +type OrderCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: OrderCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [Order] +} + +input OrderInput { + orderNumber: Int + locationCode: String + version: String + parentOrderId: String + parentOrderNumber: Int + parentCheckoutId: String + parentCheckoutNumber: Int + partialOrderNumber: Int + partialOrderCount: Int + isPartialOrder: Boolean = false + parentReturnId: String + parentReturnNumber: Int + originalCartId: String + originalQuoteId: String + originalQuoteNumber: Int + priceListCode: String + availableActions: [String!] + shopperNotes: ShopperNotesInput + customerAccountId: Int + customerTaxId: String + isTaxExempt: Boolean = false + email: String + ipAddress: String + sourceDevice: String + acceptsMarketing: Boolean = false + status: String + type: String + paymentStatus: String + returnStatus: String + isEligibleForReturns: Boolean = false + totalCollected: Float! + attributes: [OrderAttributeInput] + adjustment: AdjustmentInput + shippingAdjustment: AdjustmentInput + handlingAdjustment: AdjustmentInput + shippingDiscounts: [ShippingDiscountInput] + handlingDiscounts: [CrAppliedDiscountInput] + handlingAmount: Float + handlingSubTotal: Float + handlingTotal: Float + dutyAmount: Float + dutyTotal: Float + fulfillmentStatus: String + submittedDate: DateTime + cancelledDate: DateTime + closedDate: DateTime + acceptedDate: DateTime + notes: [OrderNoteInput] + items: [CrOrderItemInput] + validationResults: [OrderValidationResultInput] + billingInfo: BillingInfoInput + payments: [PaymentInput] + refunds: [RefundInput] + packages: [PackageObjInput] + pickups: [PickupInput] + digitalPackages: [DigitalPackageInput] + shipments: [ShipmentInput] + isDraft: Boolean = false + hasDraft: Boolean = false + isImport: Boolean = false + isHistoricalImport: Boolean = false + importDate: DateTime + isUnified: Boolean = false + externalId: String + couponCodes: [String!] + invalidCoupons: [InvalidCouponInput] + amountAvailableForRefund: Float! + amountRemainingForPayment: Float! + amountRefunded: Float! + readyToCapture: Boolean = false + isOptInForSms: Boolean = false + userId: String + id: String + tenantId: Int + siteId: Int + channelCode: String + currencyCode: String + visitId: String + webSessionId: String + customerInteractionType: String + fulfillmentInfo: FulfillmentInfoInput + orderDiscounts: [CrAppliedDiscountInput] + suggestedDiscounts: [SuggestedDiscountInput] + rejectedDiscounts: [SuggestedDiscountInput] + data: Object + taxData: Object + subtotal: Float + discountedSubtotal: Float + discountTotal: Float + discountedTotal: Float + shippingTotal: Float + shippingSubTotal: Float + shippingTaxTotal: Float + handlingTaxTotal: Float + itemTaxTotal: Float + taxTotal: Float + feeTotal: Float + total: Float + lineItemSubtotalWithOrderAdjustments: Float + shippingAmountBeforeDiscountsAndAdjustments: Float + lastValidationDate: DateTime + expirationDate: DateTime + changeMessages: [ChangeMessageInput] + extendedProperties: [ExtendedPropertyInput] + discountThresholdMessages: [ThresholdMessageInput] + auditInfo: CrAuditInfoInput +} + +type OrderItemCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: OrderItemCollection + totalCount: Int! + items: [CrOrderItem] +} + +input OrderItemInput { + backorderable: Boolean = false + customItemData: Object! + itemDependency: Int! + orderItemID: Int! + partNumber: String! + quantity: Int! + sku: String! + upc: String! +} + +type OrderNote { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: OrderNote + id: String + text: String + auditInfo: CrAuditInfo +} + +input OrderNoteInput { + id: String + text: String + auditInfo: CrAuditInfoInput +} + +type OrderReturnableItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: OrderReturnableItem + productCode: String + productName: String + shipmentNumber: Int + shipmentItemId: Int + quantityOrdered: Int! + quantityFulfilled: Int! + quantityReturned: Int! + quantityReturnable: Int! + fulfillmentStatus: String + orderItemId: String + orderLineId: Int! + orderItemOptionAttributeFQN: String + unitQuantity: Int! + parentProductCode: String + parentProductName: String + fulfillmentFields: [FulfillmentField] + sku: String + mfgPartNumber: String +} + +type OrderReturnableItemCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: OrderReturnableItemCollection + totalCount: Int! + items: [OrderReturnableItem] +} + +enum OrderTypeEnum { + DIRECTSHIP + TRANSFER +} + +type OrderValidationMessage { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: OrderValidationMessage + orderItemId: String + messageType: String + message: String +} + +input OrderValidationMessageInput { + orderItemId: String + messageType: String + message: String +} + +type OrderValidationResult { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: OrderValidationResult + validationId: String + validatorName: String + validatorType: String + status: String + createdDate: DateTime + messages: [OrderValidationMessage] +} + +input OrderValidationResultInput { + validationId: String + validatorName: String + validatorType: String + status: String + createdDate: DateTime + messages: [OrderValidationMessageInput] +} + +type PackageItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PackageItem + productCode: String + quantity: Int! + fulfillmentItemType: String + lineId: Int + optionAttributeFQN: String +} + +input PackageItemInput { + productCode: String + quantity: Int! + fulfillmentItemType: String + lineId: Int + optionAttributeFQN: String +} + +type PackageObj { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PackageObj + shippingMethodCode: String + shippingMethodName: String + shipmentId: String + trackingNumber: String + trackingNumbers: [String!] + packagingType: String + hasLabel: Boolean + measurements: CrPackageMeasurements + carrier: String + signatureRequired: Boolean + trackings: [Tracking] + id: String + code: String + status: String + items: [PackageItem] + fulfillmentDate: DateTime + fulfillmentLocationCode: String + auditInfo: CrAuditInfo + availableActions: [String!] + changeMessages: [ChangeMessage] +} + +input PackageObjInput { + shippingMethodCode: String + shippingMethodName: String + shipmentId: String + trackingNumber: String + trackingNumbers: [String!] + packagingType: String + hasLabel: Boolean = false + measurements: CrPackageMeasurementsInput + carrier: String + signatureRequired: Boolean = false + trackings: [TrackingInput] + id: String + code: String + status: String + items: [PackageItemInput] + fulfillmentDate: DateTime + fulfillmentLocationCode: String + auditInfo: CrAuditInfoInput + availableActions: [String!] + changeMessages: [ChangeMessageInput] +} + +type PackageSettings { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PackageSettings + unitType: String +} + +input PasswordInfoInput { + oldPassword: String + newPassword: String + externalPassword: String +} + +type Payment { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Payment + id: String + groupId: PaymentActionTarget + paymentServiceTransactionId: String + availableActions: [String!] + orderId: String + paymentType: String + paymentWorkflow: String + externalTransactionId: String + billingInfo: BillingInfo + data: Object + status: String + subPayments: [SubPayment] + interactions: [PaymentInteraction] + isRecurring: Boolean + amountCollected: Float! + amountCredited: Float! + amountRequested: Float! + changeMessages: [ChangeMessage] + auditInfo: CrAuditInfo + gatewayGiftCard: GatewayGiftCard +} + +input PaymentActionInput { + actionName: String + currencyCode: String + checkNumber: String + returnUrl: String + cancelUrl: String + amount: Float + interactionDate: DateTime + newBillingInfo: BillingInfoInput + referenceSourcePaymentId: String + manualGatewayInteraction: PaymentGatewayInteractionInput + externalTransactionId: String + data: Object +} + +type PaymentActionTarget { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PaymentActionTarget + targetType: String + targetId: String + targetNumber: Int +} + +input PaymentActionTargetInput { + targetType: String + targetId: String + targetNumber: Int +} + +type PaymentCard { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PaymentCard + paymentServiceCardId: String + isUsedRecurring: Boolean + nameOnCard: String + isCardInfoSaved: Boolean + isTokenized: Boolean + paymentOrCardType: String + cardNumberPartOrMask: String + expireMonth: Int! + expireYear: Int! + bin: String +} + +input PaymentCardInput { + paymentServiceCardId: String + isUsedRecurring: Boolean = false + nameOnCard: String + isCardInfoSaved: Boolean = false + isTokenized: Boolean = false + paymentOrCardType: String + cardNumberPartOrMask: String + expireMonth: Int! + expireYear: Int! + bin: String +} + +type PaymentCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PaymentCollection + totalCount: Int! + items: [Payment] +} + +input PaymentGatewayInteractionInput { + gatewayInteractionId: Int + gatewayTransactionId: String + gatewayAuthCode: String + gatewayAVSCodes: String + gatewayCVV2Codes: String + gatewayResponseCode: String + gatewayResponseText: String +} + +type PaymentGatewayResponseData { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PaymentGatewayResponseData + key: String + value: String +} + +input PaymentGatewayResponseDataInput { + key: String + value: String +} + +input PaymentInput { + id: String + groupId: PaymentActionTargetInput + paymentServiceTransactionId: String + availableActions: [String!] + orderId: String + paymentType: String + paymentWorkflow: String + externalTransactionId: String + billingInfo: BillingInfoInput + data: Object + status: String + subPayments: [SubPaymentInput] + interactions: [PaymentInteractionInput] + isRecurring: Boolean = false + amountCollected: Float! + amountCredited: Float! + amountRequested: Float! + changeMessages: [ChangeMessageInput] + auditInfo: CrAuditInfoInput + gatewayGiftCard: GatewayGiftCardInput +} + +type PaymentInteraction { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PaymentInteraction + id: String + gatewayInteractionId: Int + paymentId: String + orderId: String + target: PaymentActionTarget + currencyCode: String + interactionType: String + checkNumber: String + status: String + paymentEntryStatus: String + isRecurring: Boolean + isManual: Boolean + gatewayTransactionId: String + gatewayAuthCode: String + gatewayAVSCodes: String + gatewayCVV2Codes: String + gatewayResponseCode: String + gatewayResponseText: String + gatewayResponseData: [PaymentGatewayResponseData] + paymentTransactionInteractionIdReference: Int + amount: Float + note: String + interactionDate: DateTime + auditInfo: CrAuditInfo + returnId: String + refundId: String + capturableShipmentsSummary: [CapturableShipmentSummary] +} + +input PaymentInteractionInput { + id: String + gatewayInteractionId: Int + paymentId: String + orderId: String + target: PaymentActionTargetInput + currencyCode: String + interactionType: String + checkNumber: String + status: String + paymentEntryStatus: String + isRecurring: Boolean = false + isManual: Boolean = false + gatewayTransactionId: String + gatewayAuthCode: String + gatewayAVSCodes: String + gatewayCVV2Codes: String + gatewayResponseCode: String + gatewayResponseText: String + gatewayResponseData: [PaymentGatewayResponseDataInput] + paymentTransactionInteractionIdReference: Int + amount: Float + note: String + interactionDate: DateTime + auditInfo: CrAuditInfoInput + returnId: String + refundId: String + capturableShipmentsSummary: [CapturableShipmentSummaryInput] +} + +type PaymentToken { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PaymentToken + paymentServiceTokenId: String + type: String +} + +input PaymentTokenInput { + paymentServiceTokenId: String + type: String +} + +type Pickup { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Pickup + id: String + code: String + status: String + items: [PickupItem] + fulfillmentDate: DateTime + fulfillmentLocationCode: String + auditInfo: CrAuditInfo + availableActions: [String!] + changeMessages: [ChangeMessage] +} + +input PickupInput { + id: String + code: String + status: String + items: [PickupItemInput] + fulfillmentDate: DateTime + fulfillmentLocationCode: String + auditInfo: CrAuditInfoInput + availableActions: [String!] + changeMessages: [ChangeMessageInput] +} + +type PickupItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PickupItem + productCode: String + quantity: Int! + fulfillmentItemType: String + lineId: Int + optionAttributeFQN: String +} + +input PickupItemInput { + productCode: String + quantity: Int! + fulfillmentItemType: String + lineId: Int + optionAttributeFQN: String +} + +type PrAppliedDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PrAppliedDiscount + couponCode: String + discount: PrDiscount + discounts: [PrDiscount] + impact: Float! +} + +type PrAttributeValidation { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PrAttributeValidation + regularExpression: String + minStringLength: Int + maxStringLength: Int + minNumericValue: Float + maxNumericValue: Float + minDateValue: DateTime + maxDateValue: DateTime +} + +type PrBundledProduct { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PrBundledProduct + content: ProductContent + productCode: String + goodsType: String + quantity: Int! + measurements: PrPackageMeasurements + isPackagedStandAlone: Boolean + inventoryInfo: ProductInventoryInfo + optionAttributeFQN: String + optionValue: Object + creditValue: Float + productType: String +} + +type PrCategory { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PrCategory + categoryId: Int! + parentCategory: PrCategory + content: CategoryContent + childrenCategories: [PrCategory] + sequence: Int + isDisplayed: Boolean + categoryCode: String + count: Int + updateDate: DateTime! + shouldSlice: Boolean +} + +type PrDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PrDiscount + discountId: Int! + expirationDate: DateTime + name: String + friendlyDescription: String + impact: Float! +} + +type PrMeasurement { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PrMeasurement + unit: String + value: Float +} + +type PrPackageMeasurements { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PrPackageMeasurements + packageHeight: PrMeasurement + packageWidth: PrMeasurement + packageLength: PrMeasurement + packageWeight: PrMeasurement +} + +type PriceList { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PriceList + priceListCode: String + priceListId: Int! + enabled: Boolean + name: String + resolvable: Boolean + isIndexed: Boolean + filteredInStoreFront: Boolean + isSiteDefault: Boolean + description: String + ancestors: [PriceListNode] + descendants: [PriceListNode] + validSites: [Int!] +} + +type PriceListNode { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PriceListNode + priceListCode: String + priceListId: Int! + parentPriceListId: Int + priceListLevel: Int! +} + +type PricingAppliedDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingAppliedDiscount + impact: Float! + discount: PricingDiscount + couponCode: String + couponSetId: Int +} + +type PricingAppliedLineItemProductDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingAppliedLineItemProductDiscount + appliesToSalePrice: Boolean + quantity: Int! + impactPerUnit: Float! + isForced: Boolean + normalizedImpact: Float! + impact: Float! + discount: PricingDiscount + couponCode: String + couponSetId: Int +} + +type PricingAppliedLineItemShippingDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingAppliedLineItemShippingDiscount + shippingMethodCode: String + quantity: Int! + impactPerUnit: Float! + isForced: Boolean + normalizedImpact: Float! + impact: Float! + discount: PricingDiscount + couponCode: String + couponSetId: Int +} + +type PricingAppliedOrderShippingDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingAppliedOrderShippingDiscount + shippingMethodCode: String + impact: Float! + discount: PricingDiscount + couponCode: String + couponSetId: Int +} + +type PricingDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingDiscount + discountId: Int! + name: String + friendlyDescription: String + amount: Float! + scope: String + maxRedemptions: Int + maximumUsesPerUser: Int + requiresAuthenticatedUser: Boolean + doesNotApplyToProductsWithSalePrice: Boolean + maximumRedemptionsPerOrder: Int + maximumDiscountValuePerOrder: Float + maxDiscountValuePerRedemption: Float + doesNotApplyToMultiShipToOrders: Boolean + includedPriceLists: [String!] + redemptions: Int! + type: String + amountType: String + target: PricingDiscountTarget + condition: PricingDiscountCondition + expirationDate: DateTime + stackingLayer: Int! +} + +type PricingDiscountCondition { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingDiscountCondition + requiresCoupon: Boolean + couponCode: String + minimumQuantityProductsRequiredInCategories: Int + includedCategoryIds: [Int!] + excludedCategoryIds: [Int!] + minimumQuantityRequiredProducts: Int + includedProductCodes: [String!] + excludedProductCodes: [String!] + paymentWorkflows: [String!] + customerSegmentIds: [Int!] + minimumOrderAmount: Float + maximumOrderAmount: Float + minimumLifetimeValueAmount: Float + startDate: DateTime + expirationDate: DateTime + minimumCategorySubtotalBeforeDiscounts: Float +} + +type PricingDiscountTarget { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingDiscountTarget + type: String + includedCategoryIds: [Int!] + excludedCategoryIds: [Int!] + includedCategoriesOperator: String + excludedCategoriesOperator: String + includedProductCodes: [String!] + excludedProductCodes: [String!] + includeAllProducts: Boolean + shippingMethods: [String!] + shippingZones: [String!] +} + +type PricingProductAttribute { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingProductAttribute + inputType: String + valueType: String + dataType: String + name: String + description: String +} + +type PricingProductProperty { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingProductProperty + attributeFQN: String + values: [PricingProductPropertyValue] + attributeDetail: PricingProductAttribute + isHidden: Boolean + isMultiValue: Boolean +} + +type PricingProductPropertyValue { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingProductPropertyValue + value: Object + stringValue: String +} + +type PricingTaxAttribute { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingTaxAttribute + fullyQualifiedName: String + attributeDefinitionId: Int + values: [Object!] +} + +type PricingTaxContext { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingTaxContext + taxContextId: String + customerId: String + taxExemptId: String + originAddress: CrAddress + destinationAddress: CrAddress +} + +type PricingTaxableLineItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingTaxableLineItem + id: String + productCode: String + variantProductCode: String + productName: String + productProperties: [PricingProductProperty] + quantity: Int! + lineItemPrice: Float! + discountTotal: Float + discountedTotal: Float + shippingAmount: Float! + handlingAmount: Float + feeTotal: Float + isTaxable: Boolean + reason: String + data: Object + productDiscount: PricingAppliedLineItemProductDiscount + shippingDiscount: PricingAppliedLineItemShippingDiscount + productDiscounts: [PricingAppliedLineItemProductDiscount] + shippingDiscounts: [PricingAppliedLineItemShippingDiscount] + originAddress: CrAddress + destinationAddress: CrAddress +} + +type PricingTaxableOrder { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PricingTaxableOrder + orderDate: DateTime! + taxContext: PricingTaxContext + lineItems: [PricingTaxableLineItem] + shippingAmount: Float! + currencyCode: String + handlingFee: Float! + originalDocumentCode: String + orderId: String + orderNumber: Int + originalOrderDate: DateTime! + data: Object + attributes: [PricingTaxAttribute] + shippingDiscounts: [PricingAppliedOrderShippingDiscount] + shippingDiscount: PricingAppliedOrderShippingDiscount + orderDiscounts: [PricingAppliedDiscount] + orderDiscount: PricingAppliedDiscount + handlingDiscounts: [PricingAppliedDiscount] + handlingDiscount: PricingAppliedDiscount + shippingMethodCode: String + shippingMethodName: String + taxRequestType: String +} + +type Product { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Product + productCode: String + purchaseLocation: String + productSequence: Int + productUsage: String + fulfillmentTypesSupported: [String!] + goodsType: String + bundledProducts: [PrBundledProduct] + content: ProductContent + purchasableState: ProductPurchasableState + isActive: Boolean + publishState: String + price: ProductPrice + priceRange: ProductPriceRange + volumePriceBands: [ProductVolumePrice] + volumePriceRange: ProductPriceRange + availableShippingDiscounts: [PrDiscount] + productType: String + productTypeId: Int + isTaxable: Boolean + isRecurring: Boolean + pricingBehavior: ProductPricingBehaviorInfo + inventoryInfo: ProductInventoryInfo + createDate: DateTime! + updateDate: DateTime! + dateFirstAvailableInCatalog: DateTime + catalogStartDate: DateTime + catalogEndDate: DateTime + daysAvailableInCatalog: Int + upc: String + upCs: [String!] + mfgPartNumber: String + mfgPartNumbers: [String!] + variationProductCode: String + categories: [PrCategory] + measurements: PrPackageMeasurements + isPackagedStandAlone: Boolean + properties( + filterAttribute: String + filterOperator: String + filterValue: Object + ): [ProductProperty] + options: [ProductOption] + variations: [VariationSummary] + validPriceLists: [String!] + locationsInStock: [String!] + slicingAttributeFQN: String + productImageGroups: [ProductImageGroup] + sliceValue: String + productCollections: [ProductCollectionInfo] + productCollectionMembers: [ProductCollectionMember] + collectionMembersProductContent: [ProductContent] + score: Float! + personalizationScore: Float! +} + +type ProductCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductCollection + nextCursorMark: String + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [Product] +} + +type ProductCollectionInfo { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductCollectionInfo + productCode: String + isPrimary: Boolean +} + +type ProductCollectionMember { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductCollectionMember + memberKey: ProductCollectionMemberKey +} + +type ProductCollectionMemberKey { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductCollectionMemberKey + value: String +} + +type ProductContent { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductContent + productName: String + productFullDescription: String + productShortDescription: String + metaTagTitle: String + metaTagDescription: String + metaTagKeywords: String + seoFriendlyUrl: String + productImages: [ProductImage] +} + +type ProductCost { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductCost + productCode: String + cost: Float! +} + +type ProductCostCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductCostCollection + totalCount: Int! + items: [ProductCost] +} + +input ProductCostQueryInput { + productCodes: [String!] +} + +type ProductForIndexing { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductForIndexing + slices: [Product] + productCode: String + purchaseLocation: String + productSequence: Int + productUsage: String + fulfillmentTypesSupported: [String!] + goodsType: String + bundledProducts: [PrBundledProduct] + content: ProductContent + purchasableState: ProductPurchasableState + isActive: Boolean + publishState: String + price: ProductPrice + priceRange: ProductPriceRange + volumePriceBands: [ProductVolumePrice] + volumePriceRange: ProductPriceRange + availableShippingDiscounts: [PrDiscount] + productType: String + productTypeId: Int + isTaxable: Boolean + isRecurring: Boolean + pricingBehavior: ProductPricingBehaviorInfo + inventoryInfo: ProductInventoryInfo + createDate: DateTime! + updateDate: DateTime! + dateFirstAvailableInCatalog: DateTime + catalogStartDate: DateTime + catalogEndDate: DateTime + daysAvailableInCatalog: Int + upc: String + upCs: [String!] + mfgPartNumber: String + mfgPartNumbers: [String!] + variationProductCode: String + categories: [PrCategory] + measurements: PrPackageMeasurements + isPackagedStandAlone: Boolean + properties: [ProductProperty] + options: [ProductOption] + variations: [VariationSummary] + validPriceLists: [String!] + locationsInStock: [String!] + slicingAttributeFQN: String + productImageGroups: [ProductImageGroup] + sliceValue: String + productCollections: [ProductCollectionInfo] + productCollectionMembers: [ProductCollectionMember] + collectionMembersProductContent: [ProductContent] + score: Float! + personalizationScore: Float! +} + +type ProductImage { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductImage + imageLabel: String + altText: String + imageUrl: String + cmsId: String + videoUrl: String + mediaType: String + sequence: Int + productImageGroupId: String +} + +type ProductImageGroup { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductImageGroup + productImageGroupId: String! + productImageGroupTags: [ProductImageGroupTag] +} + +type ProductImageGroupTag { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductImageGroupTag + attributeFqn: String + value: String +} + +type ProductInventoryInfo { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductInventoryInfo + manageStock: Boolean + outOfStockBehavior: String + onlineStockAvailable: Int + onlineSoftStockAvailable: Int + onlineLocationCode: String + availableDate: DateTime +} + +type ProductOption { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductOption + attributeFQN: String + isRequired: Boolean + isMultiValue: Boolean + values: [ProductOptionValue] + attributeDetail: AttributeDetail + isProductImageGroupSelector: Boolean +} + +input ProductOptionSelectionInput { + attributeFQN: String + value: Object + attributeValueId: Int + shopperEnteredValue: Object +} + +input ProductOptionSelectionsInput { + variationProductCode: String + options: [ProductOptionSelectionInput] +} + +type ProductOptionValue { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductOptionValue + value: Object + attributeValueId: Int! + stringValue: String + isEnabled: Boolean + isSelected: Boolean + isDefault: Boolean + deltaWeight: Float + deltaPrice: Float + shopperEnteredValue: Object + bundledProduct: PrBundledProduct + displayInfo: AttributeVocabularyValueDisplayInfo +} + +type ProductPrice { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductPrice + msrp: Float + price: Float + priceType: String + salePrice: Float + salePriceType: String + catalogSalePrice: Float + catalogListPrice: Float + discount: PrAppliedDiscount + creditValue: Float + effectivePricelistCode: String + priceListEntryCode: String + priceListEntryMode: String +} + +type ProductPriceRange { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductPriceRange + lower: ProductPrice + upper: ProductPrice +} + +type ProductPricingBehaviorInfo { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductPricingBehaviorInfo + discountsRestricted: Boolean + discountsRestrictedStartDate: DateTime + discountsRestrictedEndDate: DateTime +} + +type ProductProperty { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductProperty + attributeFQN: String + isHidden: Boolean + isMultiValue: Boolean + attributeDetail: AttributeDetail + values: [ProductPropertyValue] + propertyType: String +} + +type ProductPropertyValue { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductPropertyValue + value: Object + stringValue: String + displayInfo: AttributeVocabularyValueDisplayInfo +} + +type ProductPurchasableState { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductPurchasableState + isPurchasable: Boolean + messages: [ValidationMessage] +} + +type ProductSearchRandomAccessCursor { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductSearchRandomAccessCursor + cursorMarks: [String!] +} + +type ProductSearchResult { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductSearchResult + facets: [Facet] + solrDebugInfo: SolrDebugInfo + searchRedirect: String + searchEngine: String + nextCursorMark: String + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [Product] +} + +type ProductStock { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductStock + manageStock: Boolean + isOnBackOrder: Boolean + availableDate: DateTime + stockAvailable: Int + aggregateInventory: Int +} + +input ProductStockInput { + manageStock: Boolean = false + isOnBackOrder: Boolean = false + availableDate: DateTime + stockAvailable: Int + aggregateInventory: Int +} + +type ProductValidationSummary { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductValidationSummary + productCode: String + purchaseLocation: String + productUsage: String + fulfillmentTypesSupported: [String!] + goodsType: String + bundledProducts: [BundledProductSummary] + upc: String + mfgPartNumber: String + variationProductCode: String + purchasableState: ProductPurchasableState + price: ProductPrice + measurements: PrPackageMeasurements + isPackagedStandAlone: Boolean + image: ProductImage + productShortDescription: String + productName: String + categories: [PrCategory] + properties: [ProductProperty] + pricingBehavior: ProductPricingBehaviorInfo + inventoryInfo: ProductInventoryInfo + isTaxable: Boolean + productType: String +} + +type ProductVolumePrice { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ProductVolumePrice + isCurrent: Boolean + minQty: Int! + maxQty: Int + priceRange: ProductPriceRange + price: ProductPrice +} + +type Property { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Property + name: String + isRequired: Boolean + isMultiValued: Boolean + propertyType: PropertyType +} + +input PropertyInput { + name: String + isRequired: Boolean = false + isMultiValued: Boolean = false + propertyType: PropertyTypeInput +} + +type PropertyType { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PropertyType + name: String + namespace: String + propertyTypeFQN: String + adminName: String + installationPackage: String + version: String + dataType: String + isQueryable: Boolean + isSortable: Boolean + isAggregatable: Boolean +} + +type PropertyTypeCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PropertyTypeCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [PropertyType] +} + +input PropertyTypeInput { + name: String + namespace: String + propertyTypeFQN: String + adminName: String + installationPackage: String + version: String + dataType: String + isQueryable: Boolean = false + isSortable: Boolean = false + isAggregatable: Boolean = false +} + +type PurchaseOrderCustomField { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PurchaseOrderCustomField + code: String + label: String + value: String +} + +input PurchaseOrderCustomFieldInput { + code: String + label: String + value: String +} + +type PurchaseOrderPayment { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PurchaseOrderPayment + purchaseOrderNumber: String + paymentTerm: PurchaseOrderPaymentTerm + customFields: [PurchaseOrderCustomField] +} + +input PurchaseOrderPaymentInput { + purchaseOrderNumber: String + paymentTerm: PurchaseOrderPaymentTermInput + customFields: [PurchaseOrderCustomFieldInput] +} + +type PurchaseOrderPaymentTerm { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PurchaseOrderPaymentTerm + code: String + description: String +} + +input PurchaseOrderPaymentTermInput { + code: String + description: String +} + +type PurchaseOrderTransaction { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PurchaseOrderTransaction + customerPurchaseOrderAccountId: Int! + externalId: String + siteId: Int! + tenantId: Int! + transactionDate: DateTime! + orderId: String + purchaseOrderNumber: String + transactionAmount: Float! + creditLimit: Float! + additionalTransactionDetail: String + availableBalance: Float! + transactionTypeId: Int! + transactionDescription: String + author: String + auditInfo: CuAuditInfo +} + +type PurchaseOrderTransactionCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: PurchaseOrderTransactionCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [PurchaseOrderTransaction] +} + +input PurchaseOrderTransactionInput { + customerPurchaseOrderAccountId: Int! + externalId: String + siteId: Int! + tenantId: Int! + transactionDate: DateTime! + orderId: String + purchaseOrderNumber: String + transactionAmount: Float! + creditLimit: Float! + additionalTransactionDetail: String + availableBalance: Float! + transactionTypeId: Int! + transactionDescription: String + author: String + auditInfo: CuAuditInfoInput +} + +type Query { + customerAccountAttributeDefinitions( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): CuAttributeCollection + customerAccountAttributeVocabularyValues( + attributeFQN: String! + ): [CuAttributeVocabularyValue] + customerAccountAttributeDefinition(attributeFQN: String!): CuAttribute + b2bAccountAttributes( + accountId: Int! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): CustomerAttributeCollection + b2bAccountAttributeVocabularyValues( + accountId: Int! + attributeFQN: String! + ): CustomerAttribute + b2bAccounts( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + fields: String + q: String + qLimit: Int + ): B2BAccountCollection + b2bAccount(accountId: Int!): B2BAccount + b2bAccountUsers( + accountId: Int! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + q: String + qLimit: Int + ): B2BUserCollection + b2bAccountUserRoles(accountId: Int!, userId: String!): UserRoleCollection + customerCreditAuditTrail( + code: String! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): CreditAuditEntryCollection + customerCredits( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): CreditCollection + customerCredit(code: String!): Credit + customerCreditTransactions( + code: String! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): CreditTransactionCollection + customerAccountAttributes( + accountId: Int! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + userId: String + ): CustomerAttributeCollection + customerAccountAttribute( + accountId: Int! + attributeFQN: String! + userId: String + ): CustomerAttribute + customerAccountCards(accountId: Int!): CardCollection + customerAccountCard(accountId: Int!, cardId: String!): Card + customerAccountContacts( + accountId: Int! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + userId: String + ): CustomerContactCollection + customerAccountContact( + accountId: Int! + contactId: Int! + userId: String + ): CustomerContact + customerAccounts( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + fields: String + q: String + qLimit: Int + isAnonymous: Boolean + ): CustomerAccountCollection + customerAccount(accountId: Int!, userId: String): CustomerAccount + getCurrentAccount: CustomerAccount + customerAccountTransactions(accountId: Int!): [Transaction] + customerAccountNotes( + accountId: Int! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): CustomerNoteCollection + customerAccountNote(accountId: Int!, noteId: Int!): CustomerNote + customerAccountSegments( + accountId: Int! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): CustomerSegmentCollection + customerAccountAuditLog( + accountId: Int! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): CustomerAuditEntryCollection + customerPurchaseOrderAccount(accountId: Int!): CustomerPurchaseOrderAccount + customerPurchaseOrderAccountTransaction( + accountId: Int! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): PurchaseOrderTransactionCollection + customerAccountLoginState(accountId: Int!, userId: String): LoginState + customerSegments( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): CustomerSegmentCollection + customerSegment(id: Int!): CustomerSegment + customerSets( + startIndex: Int + pageSize: Int + sortBy: String + ): CustomerSetCollection + customerSet(code: String!): CustomerSet + inStockNotifications( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): InStockNotificationSubscriptionCollection + inStockNotification(id: Int!): InStockNotificationSubscription + authTicket(accountId: Int): CustomerAuthTicket + exchangeRates: [CurrencyExchangeRate] + resolvedPriceList(customerAccountId: Int): ResolvedPriceList + categoriesTree: CategoryCollection + categories( + filter: String + startIndex: Int + pageSize: Int + sortBy: String + ): CategoryPagedCollection + category(categoryId: Int!, allowInactive: Boolean): PrCategory + products( + filter: String + startIndex: Int + pageSize: Int + sortBy: String + responseOptions: String + cursorMark: String + defaultSort: String + mid: String + includeAllImages: Boolean + ): ProductCollection + product( + productCode: String! + variationProductCode: String + allowInactive: Boolean + skipInventoryCheck: Boolean + supressOutOfStock404: Boolean + quantity: Int + acceptVariantProductCode: Boolean + purchaseLocation: String + variationProductCodeFilter: String + sliceValue: String + includeAllImages: Boolean + ): Product + productVersion( + productCode: String! + productVersion: Int + lastModifiedDate: DateTime + ): ProductForIndexing + productLocationInventory( + productCode: String! + locationCodes: String + ): LocationInventoryCollection + suggestionSearch( + query: String + groups: String + pageSize: Int + mid: String + filter: String + ): SearchSuggestionResult + productSearchRandomAccessCursor( + query: String + filter: String + pageSize: Int + ): ProductSearchRandomAccessCursor + productSearch( + query: String + filter: String + facetTemplate: String + facetTemplateSubset: String + facet: String + facetFieldRangeQuery: String + facetHierPrefix: String + facetHierValue: String + facetHierDepth: String + facetStartIndex: String + facetPageSize: String + facetSettings: String + facetValueFilter: String + sortBy: String + pageSize: Int + startIndex: Int + searchSettings: String + enableSearchTuningRules: Boolean + searchTuningRuleContext: String + searchTuningRuleCode: String + facetTemplateExclude: String + facetPrefix: String + responseOptions: String + cursorMark: String + facetValueSort: String + defaultSort: String + sortDefinitionName: String + defaultSortDefinitionName: String + shouldSlice: Boolean + mid: String + omitNamespace: Boolean + ): ProductSearchResult + priceList(priceListCode: String): PriceList + cartsSummary: CartSummary + userCartSummary(userId: String!): CartSummary + cartSummary(cartId: String!): CartSummary + userCart(userId: String!): Cart + currentCart: Cart + cart(cartId: String!): Cart + currentCartExtendedProperties: [ExtendedProperty] + currentCartItems: CartItemCollection + cartItems(cartId: String!): CartItemCollection + currentCartItem(cartItemId: String!): CartItem + cartItem(cartId: String!, cartItemId: String!): CartItem + currentCartMessages: CartChangeMessageCollection + channels( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): ChannelCollection + channel(code: String!): Channel + channelGroups( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): ChannelGroupCollection + channelGroup(code: String!): ChannelGroup + checkoutAttributes(checkoutId: String!): [OrderAttribute] + checkout(checkoutId: String!): Checkout + checkouts( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + q: String + qLimit: Int + ): CheckoutCollection + checkoutShippingMethods(checkoutId: String!): [CheckoutGroupRates] + checkoutActions(checkoutId: String!): [String] + checkoutDestination(checkoutId: String!, destinationId: String!): Destination + checkoutDestinations(checkoutId: String!): [Destination] + orderPackageActions(orderId: String!, packageId: String!): [String] + orderPaymentActions(orderId: String!, paymentId: String!): [String] + orderPayment(orderId: String!, paymentId: String!): Payment + orderPayments(orderId: String!): PaymentCollection + orderPickup(orderId: String!, pickupId: String!): Pickup + orderPickupActions(orderId: String!, pickupId: String!): [String] + orderReturnableItems(orderId: String!): OrderReturnableItemCollection + orderShipment(orderId: String!, shipmentId: String!): Shipment + orderShipmentMethods(orderId: String!, draft: Boolean): [ShippingRate] + orderValidationResults(orderId: String!): [OrderValidationResult] + orderAttributes(orderId: String!): [OrderAttribute] + orderBillingInfo(orderId: String!, draft: Boolean): BillingInfo + orderCancelReasons(category: String): CancelReasonCollection + orders( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + q: String + qLimit: Int + includeBin: Boolean + mode: String + ): OrderCollection + order( + orderId: String! + draft: Boolean + includeBin: Boolean + mode: String + ): Order + orderActions(orderId: String!): [String] + orderTaxableOrders(orderId: String!): [PricingTaxableOrder] + orderDigitalPackage( + orderId: String! + digitalPackageId: String! + ): DigitalPackage + orderDigitalPackageActions( + orderId: String! + digitalPackageId: String! + ): [String] + orderExtendedProperties(orderId: String!, draft: Boolean): [ExtendedProperty] + orderFulfillmentInfo(orderId: String!, draft: Boolean): FulfillmentInfo + orderItems(orderId: String!, draft: Boolean): OrderItemCollection + orderNotes(orderId: String!): [OrderNote] + orderNote(orderId: String!, noteId: String!): OrderNote + orderPackage(orderId: String!, packageId: String!): PackageObj + orderPackageLabel(orderId: String!, packageId: String!): Boolean + quote(quoteId: String!, draft: Boolean): Quote + quotes( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + q: String + qLimit: Int + ): QuoteCollection + customerAccountQuote( + customerAccountId: Int! + quoteName: String! + draft: Boolean + ): Quote + quoteItems( + quoteId: String! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): [CrOrderItem] + customerAccountQuoteItems( + customerAccountId: Int! + quoteName: String! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): [CrOrderItem] + quoteItem(quoteId: String!, quoteItemId: String!, draft: Boolean): CrOrderItem + returns( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + q: String + ): ReturnCollection + returnReasons: ReasonCollection + returnReason(returnId: String!): ReturnObj + returnActions(returnId: String!): [String] + returnPayments(returnId: String!): PaymentCollection + returnPayment(returnId: String!, paymentId: String!): Payment + returnPaymentActions(returnId: String!, paymentId: String!): [String] + returnShippingLabel(returnId: String!): CarrierServiceGenerateLabelResponse + returnItems(returnId: String!): ReturnItemCollection + returnItem(returnId: String!, returnItemId: String!): ReturnItem + returnNotes(returnId: String!): [OrderNote] + returnNote(returnId: String!, noteId: String!): OrderNote + returnPackage(returnId: String!, packageId: String!): PackageObj + returnPackageLabel( + returnId: String! + packageId: String! + returnAsBase64Png: Boolean + ): Boolean + returnShipment(returnId: String!, shipmentId: String!): Shipment + wishlists( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + q: String + qLimit: Int + ): WishlistCollection + wishlist(wishlistId: String!): Wishlist + customerWishlist(customerAccountId: Int!, wishlistName: String!): Wishlist + wishlistItems( + wishlistId: String! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): WishlistItemCollection + customerWishlistItems( + customerAccountId: Int! + wishlistName: String! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): WishlistItemCollection + wishlistItem(wishlistId: String!, wishlistItemId: String!): WishlistItem + orderItem( + orderId: String + lineId: Int + orderItemId: String + draft: Boolean + ): CrOrderItem + documentListDocumentContent( + documentListName: String! + documentId: String! + ): Boolean + documentListDocumentTransform( + documentListName: String! + documentId: String! + width: Int + height: Int + max: Int + maxWidth: Int + maxHeight: Int + crop: String + quality: Int + ): Boolean + documentListTreeDocumentContent( + documentListName: String! + documentName: String! + ): Boolean + documentListTreeDocumentTransform( + documentListName: String! + documentName: String! + width: Int + height: Int + max: Int + maxWidth: Int + maxHeight: Int + crop: String + quality: Int + ): Boolean + documentListDocuments( + documentListName: String! + filter: String + sortBy: String + pageSize: Int + startIndex: Int + includeInactive: Boolean + path: String + includeSubPaths: Boolean + queryScope: String + ): DocumentCollection + documentListDocument( + documentListName: String! + documentId: String! + includeInactive: Boolean + ): Document + documentListTreeDocument( + documentListName: String! + documentName: String! + includeInactive: Boolean + ): Document + documentLists(pageSize: Int, startIndex: Int): DocumentListCollection + documentList(documentListName: String!): DocumentList + documentListViewDocuments( + documentListName: String! + viewName: String! + filter: String + sortBy: String + pageSize: Int + startIndex: Int + includeInactive: Boolean + ): DocumentCollection + documentListTypes(pageSize: Int, startIndex: Int): DocumentListTypeCollection + documentListType(documentListTypeFQN: String!): DocumentListType + documentDrafts( + pageSize: Int + startIndex: Int + documentLists: String + ): DocumentDraftSummaryPagedCollection + documentTypes(pageSize: Int, startIndex: Int): DocumentTypeCollection + documentType(documentTypeName: String!): DocumentType + propertyTypes(pageSize: Int, startIndex: Int): PropertyTypeCollection + propertyType(propertyTypeName: String!): PropertyType + adminLocations( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): LocationCollection + adminLocation(locationCode: String!): Location + adminLocationAttributes( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): LoAttributeCollection + adminLocationAttributeVocabularyValues( + attributeFQN: String! + ): [LoAttributeVocabularyValue] + adminLocationAttribute(attributeFQN: String!): LoAttribute + adminLocationGroups( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): LocationGroupCollection + dslLocation(includeAttributeDefinition: Boolean): Location + spLocations( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + includeAttributeDefinition: Boolean + ): LocationCollection + spLocation( + locationCode: String! + includeAttributeDefinition: Boolean + ): Location + usageTypeLocations( + locationUsageType: String! + startIndex: Int + pageSize: Int + sortBy: String + filter: String + includeAttributeDefinition: Boolean + ): LocationCollection + location(locationCode: String!, includeAttributeDefinition: Boolean): Location + locationUsages: LocationUsageCollection + locationUsage(code: String!): LocationUsage + adminLocationTypes: [LocationType] + adminLocationType(locationTypeCode: String!): LocationType + locationGroupConfig( + locationGroupId: Int + locationGroupCode: String + locationCode: String + ): LocationGroupConfiguration + locationGroup(groupId: Int, locationGroupCode: String): LocationGroup + entityListEntity(entityListFullName: String!, id: String!): Boolean + entityListEntities( + entityListFullName: String! + pageSize: Int + startIndex: Int + filter: String + sortBy: String + ): EntityCollection + entityListEntityContainer( + entityListFullName: String! + id: String! + ): EntityContainer + entityListEntityContainers( + entityListFullName: String! + pageSize: Int + startIndex: Int + filter: String + sortBy: String + ): EntityContainerCollection + entityList(entityListFullName: String!): EntityList + entityLists( + pageSize: Int + startIndex: Int + filter: String + sortBy: String + ): EntityListCollection + entityListViews(entityListFullName: String!): ListViewCollection + entityListView(entityListFullName: String!, viewName: String!): ListView + entityListViewEntityContainers( + entityListFullName: String! + viewName: String! + pageSize: Int + startIndex: Int + filter: String + ): EntityContainerCollection + entityListViewEntities( + entityListFullName: String! + viewName: String! + pageSize: Int + startIndex: Int + filter: String + ): EntityCollection + entityListViewEntityContainer( + entityListFullName: String! + viewName: String! + entityId: String! + ): EntityContainer + entityListViewEntity( + entityListFullName: String! + viewName: String! + entityId: String! + ): Boolean + carrierLocaleServiceTypes( + carrierId: String! + localeCode: String! + ): [ServiceType] + localeServiceTypes(localeCode: String!): [ServiceType] + targetRules( + startIndex: Int + pageSize: Int + sortBy: String + filter: String + ): TargetRuleCollection + targetRule(code: String!): TargetRule + orderRoutingRoutingSuggestionLog( + externalResponseID: String + orderID: Int + responseID: Int + suggestionID: Int + ): [JsonNode] +} + +type Quote { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Quote + id: String + name: String + siteId: Int! + tenantId: Int! + number: Int + submittedDate: DateTime + items: [CrOrderItem] + auditHistory: [AuditRecord] + auditInfo: CrAuditInfo + comments: [QuoteComment] + expirationDate: DateTime + fulfillmentInfo: FulfillmentInfo + userId: String + customerAccountId: Int + email: String + customerTaxId: String + isTaxExempt: Boolean + currencyCode: String + priceListCode: String + data: Object + taxData: Object + channelCode: String + locationCode: String + ipAddress: String + sourceDevice: String + visitId: String + webSessionId: String + customerInteractionType: String + orderDiscounts: [CrAppliedDiscount] + subTotal: Float! + itemLevelProductDiscountTotal: Float! + orderLevelProductDiscountTotal: Float! + itemTaxTotal: Float! + adjustment: Adjustment + itemTotal: Float! + total: Float! + shippingDiscounts: [ShippingDiscount] + itemLevelShippingDiscountTotal: Float! + orderLevelShippingDiscountTotal: Float! + shippingAmount: Float! + shippingAdjustment: Adjustment + shippingSubTotal: Float! + shippingTax: Float + shippingTaxTotal: Float! + shippingTotal: Float! + handlingDiscounts: [CrAppliedDiscount] + itemLevelHandlingDiscountTotal: Float! + orderLevelHandlingDiscountTotal: Float! + handlingAmount: Float + handlingAdjustment: Adjustment + handlingSubTotal: Float! + handlingTax: Float + handlingTaxTotal: Float! + handlingTotal: Float! + dutyAmount: Float + dutyTotal: Float! + feeTotal: Float! + isDraft: Boolean + hasDraft: Boolean + status: String + couponCodes: [String!] + invalidCoupons: [InvalidCoupon] +} + +type QuoteCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: QuoteCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [Quote] +} + +type QuoteComment { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: QuoteComment + id: String + text: String + auditInfo: CrAuditInfo +} + +input QuoteCommentInput { + id: String + text: String + auditInfo: CrAuditInfoInput +} + +input QuoteInput { + id: String + name: String + siteId: Int! + tenantId: Int! + number: Int + submittedDate: DateTime + items: [CrOrderItemInput] + auditHistory: [AuditRecordInput] + auditInfo: CrAuditInfoInput + comments: [QuoteCommentInput] + expirationDate: DateTime + fulfillmentInfo: FulfillmentInfoInput + userId: String + customerAccountId: Int + email: String + customerTaxId: String + isTaxExempt: Boolean = false + currencyCode: String + priceListCode: String + data: Object + taxData: Object + channelCode: String + locationCode: String + ipAddress: String + sourceDevice: String + visitId: String + webSessionId: String + customerInteractionType: String + orderDiscounts: [CrAppliedDiscountInput] + subTotal: Float! + itemLevelProductDiscountTotal: Float! + orderLevelProductDiscountTotal: Float! + itemTaxTotal: Float! + adjustment: AdjustmentInput + itemTotal: Float! + total: Float! + shippingDiscounts: [ShippingDiscountInput] + itemLevelShippingDiscountTotal: Float! + orderLevelShippingDiscountTotal: Float! + shippingAmount: Float! + shippingAdjustment: AdjustmentInput + shippingSubTotal: Float! + shippingTax: Float + shippingTaxTotal: Float! + shippingTotal: Float! + handlingDiscounts: [CrAppliedDiscountInput] + itemLevelHandlingDiscountTotal: Float! + orderLevelHandlingDiscountTotal: Float! + handlingAmount: Float + handlingAdjustment: AdjustmentInput + handlingSubTotal: Float! + handlingTax: Float + handlingTaxTotal: Float! + handlingTotal: Float! + dutyAmount: Float + dutyTotal: Float! + feeTotal: Float! + isDraft: Boolean = false + hasDraft: Boolean = false + status: String + couponCodes: [String!] + invalidCoupons: [InvalidCouponInput] +} + +type ReasonCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ReasonCollection + totalCount: Int! + items: [String!] +} + +type Refund { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Refund + id: String + orderId: String + reason: String + reasonCode: String + payment: Payment + amount: Float! + refundMethod: String + auditInfo: CrAuditInfo +} + +input RefundInput { + id: String + orderId: String + reason: String + reasonCode: String + payment: PaymentInput + amount: Float! + refundMethod: String + auditInfo: CrAuditInfoInput +} + +type RegularHours { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: RegularHours + sunday: Hours + monday: Hours + tuesday: Hours + wednesday: Hours + thursday: Hours + friday: Hours + saturday: Hours + timeZone: String +} + +input RegularHoursInput { + sunday: HoursInput + monday: HoursInput + tuesday: HoursInput + wednesday: HoursInput + thursday: HoursInput + friday: HoursInput + saturday: HoursInput + timeZone: String +} + +input RepriceShipmentObjectInput { + originalShipment: ShipmentInput + newShipment: ShipmentInput +} + +input ResetPasswordInfoInput { + emailAddress: String + userName: String + customerSetCode: String +} + +type ResolvedPriceList { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ResolvedPriceList + priceListCode: String + priceListId: Int! + name: String + description: String +} + +input RestockableReturnItemInput { + returnItemId: String + quantity: Int! + locationCode: String +} + +input ReturnActionInput { + actionName: String + returnIds: [String!] +} + +type ReturnBundle { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ReturnBundle + productCode: String + quantity: Int! +} + +input ReturnBundleInput { + productCode: String + quantity: Int! +} + +type ReturnCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ReturnCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [ReturnObj] +} + +type ReturnItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ReturnItem + id: String + orderItemId: String + orderLineId: Int + orderItemOptionAttributeFQN: String + product: CrProduct + reasons: [ReturnReason] + excludeProductExtras: Boolean + returnType: String + returnNotRequired: Boolean + quantityReceived: Int! + receiveStatus: String + quantityShipped: Int! + replaceStatus: String + quantityRestockable: Int! + quantityRestocked: Int! + refundAmount: Float + refundStatus: String + quantityReplaced: Int + notes: [OrderNote] + productLossAmount: Float + productLossTaxAmount: Float + shippingLossAmount: Float + shippingLossTaxAmount: Float + bundledProducts: [ReturnBundle] + totalWithoutWeightedShippingAndHandling: Float + totalWithWeightedShippingAndHandling: Float + shipmentItemId: Int + shipmentNumber: Int +} + +type ReturnItemCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ReturnItemCollection + totalCount: Int! + items: [ReturnItem] +} + +input ReturnItemInput { + id: String + orderItemId: String + orderLineId: Int + orderItemOptionAttributeFQN: String + product: CrProductInput + reasons: [ReturnReasonInput] + excludeProductExtras: Boolean = false + returnType: String + returnNotRequired: Boolean = false + quantityReceived: Int! + receiveStatus: String + quantityShipped: Int! + replaceStatus: String + quantityRestockable: Int! + quantityRestocked: Int! + refundAmount: Float + refundStatus: String + quantityReplaced: Int + notes: [OrderNoteInput] + productLossAmount: Float + productLossTaxAmount: Float + shippingLossAmount: Float + shippingLossTaxAmount: Float + bundledProducts: [ReturnBundleInput] + totalWithoutWeightedShippingAndHandling: Float + totalWithWeightedShippingAndHandling: Float + shipmentItemId: Int + shipmentNumber: Int +} + +input ReturnItemSpecifierInput { + returnItemId: String + quantity: Int! +} + +type ReturnObj { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ReturnObj + id: String + customerAccountId: Int + visitId: String + webSessionId: String + customerInteractionType: String + availableActions: [String!] + returnNumber: Int + contact: Contact + locationCode: String + originalOrderId: String + originalOrderNumber: Int + returnOrderId: String + currencyCode: String + status: String + receiveStatus: String + refundStatus: String + replaceStatus: String + items: [ReturnItem] + notes: [OrderNote] + rmaDeadline: DateTime + returnType: String + refundAmount: Float + auditInfo: CrAuditInfo + payments: [Payment] + packages: [PackageObj] + productLossTotal: Float + shippingLossTotal: Float + lossTotal: Float + productLossTaxTotal: Float + shippingLossTaxTotal: Float + tenantId: Int + siteId: Int + userId: String + channelCode: String + changeMessages: [ChangeMessage] + actionRequired: Boolean + isUnified: Boolean +} + +input ReturnObjInput { + id: String + customerAccountId: Int + visitId: String + webSessionId: String + customerInteractionType: String + availableActions: [String!] + returnNumber: Int + contact: ContactInput + locationCode: String + originalOrderId: String + originalOrderNumber: Int + returnOrderId: String + currencyCode: String + status: String + receiveStatus: String + refundStatus: String + replaceStatus: String + items: [ReturnItemInput] + notes: [OrderNoteInput] + rmaDeadline: DateTime + returnType: String + refundAmount: Float + auditInfo: CrAuditInfoInput + payments: [PaymentInput] + packages: [PackageObjInput] + productLossTotal: Float + shippingLossTotal: Float + lossTotal: Float + productLossTaxTotal: Float + shippingLossTaxTotal: Float + tenantId: Int + siteId: Int + userId: String + channelCode: String + changeMessages: [ChangeMessageInput] + actionRequired: Boolean = false + isUnified: Boolean = false +} + +type ReturnReason { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ReturnReason + reason: String + quantity: Int! +} + +input ReturnReasonInput { + reason: String + quantity: Int! +} + +type SearchSuggestion { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: SearchSuggestion + suggestionType: String + suggestion: Object +} + +type SearchSuggestionGroup { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: SearchSuggestionGroup + name: String + suggestions: [SearchSuggestion] +} + +type SearchSuggestionResult { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: SearchSuggestionResult + query: String + suggestionGroups: [SearchSuggestionGroup] +} + +type ServiceType { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ServiceType + code: String + deliveryDuration: String + content: ServiceTypeLocalizedContent +} + +type ServiceTypeLocalizedContent { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ServiceTypeLocalizedContent + localeCode: String + name: String +} + +type Shipment { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Shipment + id: String + externalShipmentId: String + number: Int + orderId: String + orderNumber: Int! + email: String + currencyCode: String + customerAccountId: Int + customerTaxId: String + shipmentType: String + shippingMethodCode: String + shippingMethodName: String + fulfillmentLocationCode: String + origin: Contact + destination: Destination + shipmentStatus: String + shipmentStatusReason: ShipmentStatusReason + transferShipmentNumbers: [Int!] + isTransfer: Boolean + originalShipmentNumber: Int + parentShipmentNumber: Int + fulfillmentStatus: String + workflowProcessId: String + workflowProcessContainerId: String + workflowState: WorkflowState + backorderCreatedDate: Int + fulfillmentDate: DateTime + orderSubmitDate: DateTime + pickStatus: String + pickType: String + changeMessages: [ChangeMessage] + packages: [PackageObj] + items: [ShipmentItem] + canceledItems: [CanceledItem] + data: Object + taxData: Object + auditInfo: CrAuditInfo + shipmentAdjustment: Float! + lineItemSubtotal: Float! + lineItemTaxAdjustment: Float! + lineItemTaxTotal: Float! + lineItemTotal: Float! + shippingAdjustment: Float! + shippingSubtotal: Float! + shippingTaxAdjustment: Float! + shippingTaxTotal: Float! + shippingTotal: Float! + handlingAdjustment: Float! + handlingSubtotal: Float! + handlingTaxAdjustment: Float! + handlingTaxTotal: Float! + handlingTotal: Float! + dutyAdjustment: Float! + dutyTotal: Float! + total: Float! + cost: Float + externalOrderId: String + isExpress: Boolean + readyToCapture: Boolean + pickupInfo: Object + shopperNotes: FulfillmentShopperNotes + customer: Customer +} + +input ShipmentAdjustmentInput { + itemAdjustment: Float + itemTaxAdjustment: Float + shippingAdjustment: Float + shippingTaxAdjustment: Float + handlingAdjustment: Float + handlingTaxAdjustment: Float +} + +input ShipmentInput { + id: String + externalShipmentId: String + number: Int + orderId: String + orderNumber: Int! + email: String + currencyCode: String + customerAccountId: Int + customerTaxId: String + shipmentType: String + shippingMethodCode: String + shippingMethodName: String + fulfillmentLocationCode: String + origin: ContactInput + destination: DestinationInput + shipmentStatus: String + shipmentStatusReason: ShipmentStatusReasonInput + transferShipmentNumbers: [Int!] + isTransfer: Boolean = false + originalShipmentNumber: Int + parentShipmentNumber: Int + fulfillmentStatus: String + workflowProcessId: String + workflowProcessContainerId: String + workflowState: WorkflowStateInput + backorderCreatedDate: Int + fulfillmentDate: DateTime + orderSubmitDate: DateTime + pickStatus: String + pickType: String + changeMessages: [ChangeMessageInput] + packages: [PackageObjInput] + items: [ShipmentItemInput] + canceledItems: [CanceledItemInput] + data: Object + taxData: Object + auditInfo: CrAuditInfoInput + shipmentAdjustment: Float! + lineItemSubtotal: Float! + lineItemTaxAdjustment: Float! + lineItemTaxTotal: Float! + lineItemTotal: Float! + shippingAdjustment: Float! + shippingSubtotal: Float! + shippingTaxAdjustment: Float! + shippingTaxTotal: Float! + shippingTotal: Float! + handlingAdjustment: Float! + handlingSubtotal: Float! + handlingTaxAdjustment: Float! + handlingTaxTotal: Float! + handlingTotal: Float! + dutyAdjustment: Float! + dutyTotal: Float! + total: Float! + cost: Float + externalOrderId: String + isExpress: Boolean = false + readyToCapture: Boolean = false + pickupInfo: Object + shopperNotes: FulfillmentShopperNotesInput + customer: CustomerInput +} + +type ShipmentItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ShipmentItem + lineId: Int! + originalOrderItemId: String + parentId: String + productCode: String + variationProductCode: String + optionAttributeFQN: String + name: String + auditInfo: CrAuditInfo + fulfillmentLocationCode: String + imageUrl: String + isTaxable: Boolean + quantity: Int! + unitPrice: Float! + actualPrice: Float! + overridePrice: Float + itemDiscount: Float! + lineItemCost: Float! + itemTax: Float! + shipping: Float! + shippingDiscount: Float! + shippingTax: Float! + handling: Float! + handlingDiscount: Float! + handlingTax: Float! + duty: Float! + isPackagedStandAlone: Boolean + readyForPickupQuantity: Int + backorderReleaseDate: DateTime + measurements: CrPackageMeasurements + options: [CrProductOption] + data: Object + taxData: Object + weightedShipmentAdjustment: Float! + weightedLineItemTaxAdjustment: Float! + weightedShippingAdjustment: Float! + weightedShippingTaxAdjustment: Float! + weightedHandlingAdjustment: Float! + weightedHandlingTaxAdjustment: Float! + weightedDutyAdjustment: Float! + taxableShipping: Float! + taxableLineItemCost: Float! + taxableHandling: Float! + fulfillmentFields: [FulfillmentField] + isAssemblyRequired: Boolean + parentItemId: String + childItemIds: [String!] + giftCards: [GiftCard] +} + +input ShipmentItemAdjustmentInput { + overridePrice: Float +} + +input ShipmentItemInput { + lineId: Int! + originalOrderItemId: String + parentId: String + productCode: String + variationProductCode: String + optionAttributeFQN: String + name: String + auditInfo: CrAuditInfoInput + fulfillmentLocationCode: String + imageUrl: String + isTaxable: Boolean = false + quantity: Int! + unitPrice: Float! + actualPrice: Float! + overridePrice: Float + itemDiscount: Float! + lineItemCost: Float! + itemTax: Float! + shipping: Float! + shippingDiscount: Float! + shippingTax: Float! + handling: Float! + handlingDiscount: Float! + handlingTax: Float! + duty: Float! + isPackagedStandAlone: Boolean = false + readyForPickupQuantity: Int + backorderReleaseDate: DateTime + measurements: CrPackageMeasurementsInput + options: [CrProductOptionInput] + data: Object + taxData: Object + weightedShipmentAdjustment: Float! + weightedLineItemTaxAdjustment: Float! + weightedShippingAdjustment: Float! + weightedShippingTaxAdjustment: Float! + weightedHandlingAdjustment: Float! + weightedHandlingTaxAdjustment: Float! + weightedDutyAdjustment: Float! + taxableShipping: Float! + taxableLineItemCost: Float! + taxableHandling: Float! + fulfillmentFields: [FulfillmentFieldInput] + isAssemblyRequired: Boolean = false + parentItemId: String + childItemIds: [String!] + giftCards: [GiftCardInput] +} + +type ShipmentStatusReason { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ShipmentStatusReason + reasonCode: String + moreInfo: String +} + +input ShipmentStatusReasonInput { + reasonCode: String + moreInfo: String +} + +input ShippingAddressInput { + addressID: Int! + addressLine1: String! + city: String! + countryCode: String! + customerID: Int! + latitude: Float! + longitude: Float! + phone: String! + postalCode: String! + state: String! +} + +type ShippingDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ShippingDiscount + methodCode: String + discount: CrAppliedDiscount +} + +input ShippingDiscountInput { + methodCode: String + discount: CrAppliedDiscountInput +} + +type ShippingMethodMappings { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ShippingMethodMappings + shippingMethods: [String!] + returnLabelShippingMethod: String + standardDefault: String + express1DayDefault: String + express2DayDefault: String + express3DayDefault: String + enableSmartPost: Boolean + internationalUsReturnLabelShippingMethod: String +} + +type ShippingOriginContact { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ShippingOriginContact + firstName: String + middleNameOrInitial: String + lastNameOrSurname: String + companyOrOrganization: String + phoneNumber: String + email: String +} + +input ShippingOriginContactInput { + firstName: String + middleNameOrInitial: String + lastNameOrSurname: String + companyOrOrganization: String + phoneNumber: String + email: String +} + +type ShippingRate { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ShippingRate + shippingMethodCode: String + shippingMethodName: String + shippingZoneCode: String + isValid: Boolean + messages: [String!] + data: Object + currencyCode: String + price: Float +} + +input ShippingRateInput { + shippingMethodCode: String + shippingMethodName: String + shippingZoneCode: String + isValid: Boolean = false + messages: [String!] + data: Object + currencyCode: String + price: Float +} + +type ShopperNotes { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ShopperNotes + giftMessage: String + comments: String + deliveryInstructions: String +} + +input ShopperNotesInput { + giftMessage: String + comments: String + deliveryInstructions: String +} + +type SolrDebugInfo { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: SolrDebugInfo + searchTuningRuleCode: String + boostedProductCodes: [String!] + blockedProductCodes: [String!] + boostQueries: [String!] + boostFunctions: [String!] +} + +input SplitShipmentsObjectInput { + originalShipment: ShipmentInput + newShipments: [ShipmentInput] +} + +type SubPayment { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: SubPayment + status: String + amountCollected: Float! + amountCredited: Float! + amountRequested: Float! + amountRefunded: Float! + target: PaymentActionTarget +} + +input SubPaymentInput { + status: String + amountCollected: Float! + amountCredited: Float! + amountRequested: Float! + amountRefunded: Float! + target: PaymentActionTargetInput +} + +type SuggestedDiscount { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: SuggestedDiscount + productCode: String + autoAdd: Boolean + discountId: Int! + hasMultipleProducts: Boolean + hasOptions: Boolean +} + +input SuggestedDiscountInput { + productCode: String + autoAdd: Boolean = false + discountId: Int! + hasMultipleProducts: Boolean = false + hasOptions: Boolean = false +} + +type SuggestionEvent { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: SuggestionEvent + causeID: Int! + errors: [String!]! + name: String! + type: TypeEnum +} + +type SuggestionLog { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: SuggestionLog + created: DateTime! + creatorUsername: String! + environmentID: Int! + events: [SuggestionEvent]! + externalResponseID: String! + orderID: Int! + pathString: String! + persisted: Boolean + siteID: Int! + suggestionID: Int! + tenantID: Int! + updated: DateTime! + updaterUsername: String! +} + +input SuggestionRequestInput { + bundlingStrategy: BundlingStrategyEnum + customData: Object! + environmentID: Int! + exclusionListLocationCode: [ExclusionListEntryLocationCodeInput]! + externalResponseID: String! + fraud: Int! + inventoryRequestType: InventoryRequestTypeEnum + isExpress: Boolean = false + items: [OrderItemInput]! + locationCodeWhiteList: [String!]! + numShipmentsNotInRequest: Int! + orderID: Int! + orderType: OrderTypeEnum + pickupLocationCode: String! + shippingAddress: ShippingAddressInput + total: Float! +} + +type SuggestionResponse { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: SuggestionResponse + assignmentSuggestions: Object! + availableLocations: [Int!]! + externalResponseID: String! + responseID: Int! + stateChangeSuggestions: Object! + suggestionLog: SuggestionLog +} + +type TargetRule { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: TargetRule + code: String + description: String + domain: String + expression: String +} + +type TargetRuleCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: TargetRuleCollection + totalCount: Int! + items: [TargetRule] +} + +input TargetRuleInput { + code: String + description: String + domain: String + expression: String +} + +type TaskInput { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: TaskInput + helpMessage: String + label: String + maxLength: Int + maximum: Float! + minLength: Int + minimum: Float! + name: String + options: [Object!] + pattern: String + required: Boolean + type: String +} + +input TaskInputInput { + helpMessage: String + label: String + maxLength: Int + maximum: Float! + minLength: Int + minimum: Float! + name: String + options: [Object!] + pattern: String + required: Boolean = false + type: String +} + +type ThresholdMessage { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ThresholdMessage + discountId: Int! + message: String + thresholdValue: Float! + showOnCheckout: Boolean + showInCart: Boolean + requiresCouponCode: Boolean +} + +input ThresholdMessageInput { + discountId: Int! + message: String + thresholdValue: Float! + showOnCheckout: Boolean = false + showInCart: Boolean = false + requiresCouponCode: Boolean = false +} + +type Tracking { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Tracking + attributes: Object + number: String + url: String +} + +input TrackingInput { + attributes: Object + number: String + url: String +} + +type Transaction { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Transaction + transactionId: String + visitId: String + transactionType: String + interactionType: String + amount: Float! + date: DateTime! + currencyCode: String +} + +input TransactionInput { + transactionId: String + visitId: String + transactionType: String + interactionType: String + amount: Float! + date: DateTime! + currencyCode: String +} + +enum TypeEnum { + NEW_REQUEST + ROUTE_SELECTED + MAKE_LOCATIONS_AVAILABLE + NO_ROUTE_FOUND + REMOVED_INACTIVE_LOCATIONS + REMOVED_ON_HOLD_LOCATIONS + REMOVED_OVERFULFILLED_LOCATIONS + GROUP + GROUP_FILTER + GROUP_SORT + FILTER + SORT + AFTER_ACTION + FOUND_FULL_ORDER_LOCATION + RESPONSE + AFTER_ACTION_SORT + DEFAULT_RESPONSE + MAX_SPLITS_EXCEEDED + AUTO_ASSIGN_LIMIT_EXCEEDED + INVENTORY_REQUEST + REMOVED_INTERNATIONAL_LOCATIONS +} + +type UserRole { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: UserRole + userId: String + assignedInScope: UserScope + roleId: Int! + roleName: String + roleTags: [String!] + auditInfo: CuAuditInfo +} + +type UserRoleCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: UserRoleCollection + totalCount: Int! + items: [UserRole] +} + +input UserRoleInput { + userId: String + assignedInScope: UserScopeInput + roleId: Int! + roleName: String + roleTags: [String!] + auditInfo: CuAuditInfoInput +} + +type UserScope { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: UserScope + type: String + id: Int + name: String +} + +input UserScopeInput { + type: String + id: Int + name: String +} + +type ValidationMessage { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ValidationMessage + severity: String + source: String + message: String + validationType: String + sourceId: String +} + +type VariationOption { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: VariationOption + valueSequence: Int! + attributeFQN: String + value: Object +} + +type VariationSummary { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: VariationSummary + productCode: String + options: [VariationOption] + inventoryInfo: ProductInventoryInfo +} + +type View { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: View + name: String + usages: [String!] + metadata: Object + isVisibleInStorefront: Boolean + filter: String + includeInactiveMode: String + isAdminDefault: Boolean + fields: [ViewField] +} + +type ViewField { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: ViewField + name: String + target: String +} + +input ViewFieldInput { + name: String + target: String +} + +input ViewInput { + name: String + usages: [String!] + metadata: Object + isVisibleInStorefront: Boolean = false + filter: String + includeInactiveMode: String + isAdminDefault: Boolean = false + fields: [ViewFieldInput] +} + +type Wishlist { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: Wishlist + customerAccountId: Int + typeTag: String + name: String + items: [WishlistItem] + privacyType: String + sortOrder: Int + version: String + isImport: Boolean + importDate: DateTime + externalId: String + userId: String + id: String + tenantId: Int + siteId: Int + channelCode: String + currencyCode: String + visitId: String + webSessionId: String + customerInteractionType: String + fulfillmentInfo: FulfillmentInfo + orderDiscounts: [CrAppliedDiscount] + suggestedDiscounts: [SuggestedDiscount] + rejectedDiscounts: [SuggestedDiscount] + data: Object + taxData: Object + subtotal: Float + discountedSubtotal: Float + discountTotal: Float + discountedTotal: Float + shippingTotal: Float + shippingSubTotal: Float + shippingTaxTotal: Float + handlingTaxTotal: Float + itemTaxTotal: Float + taxTotal: Float + feeTotal: Float + total: Float + lineItemSubtotalWithOrderAdjustments: Float + shippingAmountBeforeDiscountsAndAdjustments: Float + lastValidationDate: DateTime + expirationDate: DateTime + changeMessages: [ChangeMessage] + extendedProperties: [ExtendedProperty] + discountThresholdMessages: [ThresholdMessage] + auditInfo: CrAuditInfo +} + +type WishlistCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: WishlistCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [Wishlist] +} + +input WishlistInput { + customerAccountId: Int + typeTag: String + name: String + items: [WishlistItemInput] + privacyType: String + sortOrder: Int + version: String + isImport: Boolean = false + importDate: DateTime + externalId: String + userId: String + id: String + tenantId: Int + siteId: Int + channelCode: String + currencyCode: String + visitId: String + webSessionId: String + customerInteractionType: String + fulfillmentInfo: FulfillmentInfoInput + orderDiscounts: [CrAppliedDiscountInput] + suggestedDiscounts: [SuggestedDiscountInput] + rejectedDiscounts: [SuggestedDiscountInput] + data: Object + taxData: Object + subtotal: Float + discountedSubtotal: Float + discountTotal: Float + discountedTotal: Float + shippingTotal: Float + shippingSubTotal: Float + shippingTaxTotal: Float + handlingTaxTotal: Float + itemTaxTotal: Float + taxTotal: Float + feeTotal: Float + total: Float + lineItemSubtotalWithOrderAdjustments: Float + shippingAmountBeforeDiscountsAndAdjustments: Float + lastValidationDate: DateTime + expirationDate: DateTime + changeMessages: [ChangeMessageInput] + extendedProperties: [ExtendedPropertyInput] + discountThresholdMessages: [ThresholdMessageInput] + auditInfo: CrAuditInfoInput +} + +type WishlistItem { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: WishlistItem + id: String + comments: String + priorityType: String + purchasableStatusType: String + localeCode: String + purchaseLocation: String + lineId: Int + product: CrProduct + quantity: Int! + isRecurring: Boolean + isTaxable: Boolean + subtotal: Float + extendedTotal: Float + taxableTotal: Float + discountTotal: Float + discountedTotal: Float + itemTaxTotal: Float + shippingTaxTotal: Float + shippingTotal: Float + handlingAmount: Float + feeTotal: Float + total: Float + unitPrice: CommerceUnitPrice + productDiscount: AppliedLineItemProductDiscount + productDiscounts: [AppliedLineItemProductDiscount] + shippingDiscounts: [AppliedLineItemShippingDiscount] + data: Object + taxData: Object + auditInfo: CrAuditInfo + shippingAmountBeforeDiscountsAndAdjustments: Float + weightedOrderAdjustment: Float + weightedOrderDiscount: Float + adjustedLineItemSubtotal: Float + totalWithoutWeightedShippingAndHandling: Float + weightedOrderTax: Float + weightedOrderShipping: Float + weightedOrderShippingDiscount: Float + weightedOrderShippingManualAdjustment: Float + weightedOrderShippingTax: Float + weightedOrderHandlingFee: Float + weightedOrderHandlingFeeTax: Float + weightedOrderHandlingFeeDiscount: Float + weightedOrderDuty: Float + totalWithWeightedShippingAndHandling: Float + weightedOrderHandlingAdjustment: Float + autoAddDiscountId: Int + isAssemblyRequired: Boolean + childItemIds: [String!] + parentItemId: String +} + +type WishlistItemCollection { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: WishlistItemCollection + startIndex: Int! + pageSize: Int! + pageCount: Int! + totalCount: Int! + items: [WishlistItem] +} + +input WishlistItemInput { + id: String + comments: String + priorityType: String + purchasableStatusType: String + localeCode: String + purchaseLocation: String + lineId: Int + product: CrProductInput + quantity: Int! + isRecurring: Boolean = false + isTaxable: Boolean = false + subtotal: Float + extendedTotal: Float + taxableTotal: Float + discountTotal: Float + discountedTotal: Float + itemTaxTotal: Float + shippingTaxTotal: Float + shippingTotal: Float + handlingAmount: Float + feeTotal: Float + total: Float + unitPrice: CommerceUnitPriceInput + productDiscount: AppliedLineItemProductDiscountInput + productDiscounts: [AppliedLineItemProductDiscountInput] + shippingDiscounts: [AppliedLineItemShippingDiscountInput] + data: Object + taxData: Object + auditInfo: CrAuditInfoInput + shippingAmountBeforeDiscountsAndAdjustments: Float + weightedOrderAdjustment: Float + weightedOrderDiscount: Float + adjustedLineItemSubtotal: Float + totalWithoutWeightedShippingAndHandling: Float + weightedOrderTax: Float + weightedOrderShipping: Float + weightedOrderShippingDiscount: Float + weightedOrderShippingManualAdjustment: Float + weightedOrderShippingTax: Float + weightedOrderHandlingFee: Float + weightedOrderHandlingFeeTax: Float + weightedOrderHandlingFeeDiscount: Float + weightedOrderDuty: Float + totalWithWeightedShippingAndHandling: Float + weightedOrderHandlingAdjustment: Float + autoAddDiscountId: Int + isAssemblyRequired: Boolean = false + childItemIds: [String!] + parentItemId: String +} + +type WorkflowState { + _get( + path: String! + defaultValue: AnyScalar + allowUndefined: Boolean + ): AnyScalar + _root: WorkflowState + attributes: Object + auditInfo: CrAuditInfo + completedDate: DateTime + processInstanceId: String + shipmentState: String + taskList: [FulfillmentTask] +} + +input WorkflowStateInput { + attributes: Object + auditInfo: CrAuditInfoInput + completedDate: DateTime + processInstanceId: String + shipmentState: String + taskList: [FulfillmentTaskInput] +} diff --git a/packages/kibocommerce/src/api/endpoints/cart/add-item.ts b/packages/kibocommerce/src/api/endpoints/cart/add-item.ts new file mode 100644 index 000000000..6dfea1e0c --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/cart/add-item.ts @@ -0,0 +1,101 @@ +import { normalizeCart } from '../../../lib/normalize' +import type { CartEndpoint } from '.' +import addToCurrentCartMutation from '../../../api/mutations/addToCart-mutation' + +import { getProductQuery } from '../../../api/queries/get-product-query' +import { getCartQuery } from '../../../api/queries/get-cart-query' +import CookieHandler from '../../../api/utils/cookie-handler' + +const buildAddToCartVariables = ({ + productId, + variantId, + quantity = 1, + productResponse, +}: { + productId: string + variantId: string + quantity: number + productResponse: any +}) => { + const { product } = productResponse.data + + const selectedOptions = product.variations?.find( + (v: any) => v.productCode === variantId + ).options + + let options: any[] = [] + selectedOptions?.forEach((each: any) => { + product?.options + .filter((option: any) => { + return option.attributeFQN == each.attributeFQN + }) + .forEach((po: any) => { + options.push({ + attributeFQN: po.attributeFQN, + name: po.attributeDetail.name, + value: po.values?.find((v: any) => v.value == each.value).value, + }) + }) + }) + + return { + productToAdd: { + product: { + productCode: productId, + variationProductCode: variantId ? variantId : null, + options, + }, + quantity, + fulfillmentMethod: 'Ship', + }, + } +} + +const addItem: CartEndpoint['handlers']['addItem'] = async ({ + req, + res, + body: { cartId, item }, + config, +}) => { + if (!item) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Missing item' }], + }) + } + if (!item.quantity) item.quantity = 1 + + const productResponse = await config.fetch(getProductQuery, { + variables: { productCode: item?.productId }, + }) + + const cookieHandler = new CookieHandler(config, req, res) + let accessToken = null + + if (!cookieHandler.getAccessToken()) { + let anonymousShopperTokenResponse = await cookieHandler.getAnonymousToken() + accessToken = anonymousShopperTokenResponse.accessToken; + } else { + accessToken = cookieHandler.getAccessToken() + } + + const addToCartResponse = await config.fetch( + addToCurrentCartMutation, + { + variables: buildAddToCartVariables({ ...item, productResponse }), + }, + { headers: { 'x-vol-user-claims': accessToken } } + ) + let currentCart = null + if (addToCartResponse.data.addItemToCurrentCart) { + let result = await config.fetch( + getCartQuery, + {}, + { headers: { 'x-vol-user-claims': accessToken } } + ) + currentCart = result?.data?.currentCart + } + res.status(200).json({ data: normalizeCart(currentCart) }) +} + +export default addItem diff --git a/packages/kibocommerce/src/api/endpoints/cart/get-cart.ts b/packages/kibocommerce/src/api/endpoints/cart/get-cart.ts new file mode 100644 index 000000000..6a6ec3ab4 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/cart/get-cart.ts @@ -0,0 +1,41 @@ +import CookieHandler from '../../../api/utils/cookie-handler' +import { normalizeCart } from '../../../lib/normalize' +import { Cart } from '../../../../schema' +import type { CartEndpoint } from '.' +import { getCartQuery } from '../../queries/get-cart-query' + +const getCart: CartEndpoint['handlers']['getCart'] = async ({ + req, + res, + body: { cartId }, + config, +}) => { + let currentCart: Cart = {} + try { + const cookieHandler = new CookieHandler(config, req, res) + let accessToken = null + + if (!cookieHandler.getAccessToken()) { + let anonymousShopperTokenResponse = await cookieHandler.getAnonymousToken() + const response = anonymousShopperTokenResponse.response + accessToken = anonymousShopperTokenResponse.accessToken + cookieHandler.setAnonymousShopperCookie(response) + } else { + accessToken = cookieHandler.getAccessToken() + } + + let result = await config.fetch( + getCartQuery, + {}, + { headers: { 'x-vol-user-claims': accessToken } } + ) + currentCart = result?.data?.currentCart + } catch (error) { + throw error + } + res.status(200).json({ + data: currentCart ? normalizeCart(currentCart) : null, + }) +} + +export default getCart diff --git a/packages/kibocommerce/src/api/endpoints/cart/index.ts b/packages/kibocommerce/src/api/endpoints/cart/index.ts new file mode 100644 index 000000000..d4e8118ac --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/cart/index.ts @@ -0,0 +1,25 @@ +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import cartEndpoint from '@vercel/commerce/api/endpoints/cart' +import type { KiboCommerceAPI } from '../..' +import getCart from './get-cart'; +import addItem from './add-item'; +import updateItem from './update-item' +import removeItem from './remove-item' + +export type CartAPI = GetAPISchema + +export type CartEndpoint = CartAPI['endpoint'] + +export const handlers: CartEndpoint['handlers'] = { + getCart, + addItem, + updateItem, + removeItem, +} + +const cartApi = createEndpoint({ + handler: cartEndpoint, + handlers, +}) + +export default cartApi diff --git a/packages/kibocommerce/src/api/endpoints/cart/remove-item.ts b/packages/kibocommerce/src/api/endpoints/cart/remove-item.ts new file mode 100644 index 000000000..62f6afdc6 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/cart/remove-item.ts @@ -0,0 +1,45 @@ +import { normalizeCart } from '../../../lib/normalize' +import type { CartEndpoint } from '.' +import removeItemFromCartMutation from '../../../api/mutations/removeItemFromCart-mutation' +import { getCartQuery } from '../../../api/queries/get-cart-query' + +const removeItem: CartEndpoint['handlers']['removeItem'] = async ({ + req, + res, + body: { cartId, itemId }, + config, +}) => { + if (!itemId) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + const encodedToken = req.cookies[config.customerCookie] + const token = encodedToken + ? Buffer.from(encodedToken, 'base64').toString('ascii') + : null + + const accessToken = token ? JSON.parse(token).accessToken : null + + const removeItemResponse = await config.fetch( + removeItemFromCartMutation, + { + variables: { id: itemId }, + }, + { headers: { 'x-vol-user-claims': accessToken } } + ) + + let currentCart = null + if (removeItemResponse.data.deleteCurrentCartItem) { + let result = await config.fetch( + getCartQuery, + {}, + { headers: { 'x-vol-user-claims': accessToken } } + ) + currentCart = result?.data?.currentCart + } + res.status(200).json({ data: normalizeCart(currentCart) }) +} + +export default removeItem diff --git a/packages/kibocommerce/src/api/endpoints/cart/update-item.ts b/packages/kibocommerce/src/api/endpoints/cart/update-item.ts new file mode 100644 index 000000000..b42ff3430 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/cart/update-item.ts @@ -0,0 +1,45 @@ +import { normalizeCart } from '../../../lib/normalize' +import type { CartEndpoint } from '.' +import { getCartQuery } from '../../../api/queries/get-cart-query' +import updateCartItemQuantityMutation from '../../../api/mutations/updateCartItemQuantity-mutation' + +const updateItem: CartEndpoint['handlers']['updateItem'] = async ({ + req, + res, + body: { cartId, itemId, item }, + config, +}) => { + if (!itemId || !item) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + const encodedToken = req.cookies[config.customerCookie] + const token = encodedToken + ? Buffer.from(encodedToken, 'base64').toString('ascii') + : null + + const accessToken = token ? JSON.parse(token).accessToken : null + + const updateItemResponse = await config.fetch( + updateCartItemQuantityMutation, + { + variables: { itemId: itemId, quantity: item.quantity }, + }, + { headers: { 'x-vol-user-claims': accessToken } } + ) + + let currentCart = null + if (updateItemResponse.data) { + let result = await config.fetch( + getCartQuery, + {}, + { headers: { 'x-vol-user-claims': accessToken } } + ) + currentCart = result?.data?.currentCart + } + res.status(200).json({ data: normalizeCart(currentCart) }) +} + +export default updateItem diff --git a/packages/kibocommerce/src/api/endpoints/catalog/products/index.ts b/packages/kibocommerce/src/api/endpoints/catalog/products/index.ts new file mode 100644 index 000000000..a838eb56e --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/catalog/products/index.ts @@ -0,0 +1,17 @@ +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import productsEndpoint from '@vercel/commerce/api/endpoints/catalog/products' +import type { KiboCommerceAPI } from '../../..' +import getProducts from '../products/products' + +export type ProductsAPI = GetAPISchema + +export type ProductsEndpoint = ProductsAPI['endpoint'] + +export const handlers: ProductsEndpoint['handlers'] = { getProducts } + +const productsApi = createEndpoint({ + handler: productsEndpoint, + handlers, +}) + +export default productsApi diff --git a/packages/kibocommerce/src/api/endpoints/catalog/products/products.ts b/packages/kibocommerce/src/api/endpoints/catalog/products/products.ts new file mode 100644 index 000000000..189922d53 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/catalog/products/products.ts @@ -0,0 +1,31 @@ +import { Product } from '@vercel/commerce/types/product' +import { ProductsEndpoint } from '.' +import productSearchQuery from '../../../queries/product-search-query' +import { buildProductSearchVars } from '../../../../lib/product-search-vars' +import {normalizeProduct} from '../../../../lib/normalize' + +const getProducts: ProductsEndpoint['handlers']['getProducts'] = async ({ + res, + body: { search, categoryId, brandId, sort }, + config, +}) => { + const pageSize = 100; + const filters = {}; + const startIndex = 0; + const variables = buildProductSearchVars({ + categoryCode: categoryId, + pageSize, + search, + sort, + filters, + startIndex, + }) + const {data} = await config.fetch(productSearchQuery, { variables }); + const found = data?.products?.items?.length > 0 ? true : false; + let productsResponse= data?.products?.items.map((item: any) =>normalizeProduct(item,config)); + const products: Product[] = found ? productsResponse : []; + + res.status(200).json({ data: { products, found } }); +} + +export default getProducts diff --git a/framework/vendure/api/endpoints/catalog/index.ts b/packages/kibocommerce/src/api/endpoints/checkout/index.ts similarity index 100% rename from framework/vendure/api/endpoints/catalog/index.ts rename to packages/kibocommerce/src/api/endpoints/checkout/index.ts diff --git a/framework/reactioncommerce/api/endpoints/customers/login.ts b/packages/kibocommerce/src/api/endpoints/customer/address.ts similarity index 100% rename from framework/reactioncommerce/api/endpoints/customers/login.ts rename to packages/kibocommerce/src/api/endpoints/customer/address.ts diff --git a/framework/reactioncommerce/api/endpoints/customers/logout.ts b/packages/kibocommerce/src/api/endpoints/customer/card.ts similarity index 100% rename from framework/reactioncommerce/api/endpoints/customers/logout.ts rename to packages/kibocommerce/src/api/endpoints/customer/card.ts diff --git a/packages/kibocommerce/src/api/endpoints/customer/customer.ts b/packages/kibocommerce/src/api/endpoints/customer/customer.ts new file mode 100644 index 000000000..c2e6db707 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/customer/customer.ts @@ -0,0 +1,36 @@ +import CookieHandler from '../../../api/utils/cookie-handler' +import type { CustomerEndpoint } from '.' +import { getCustomerAccountQuery } from '../../queries/get-customer-account-query' +import { normalizeCustomer } from '../../../lib/normalize' + +const getLoggedInCustomer: CustomerEndpoint['handlers']['getLoggedInCustomer'] = async ({ + req, + res, + config, +}) => { + const cookieHandler = new CookieHandler(config, req, res) + let accessToken = cookieHandler.getAccessToken(); + + if (!cookieHandler.isShopperCookieAnonymous()) { + const { data } = await config.fetch(getCustomerAccountQuery, undefined, { + headers: { + 'x-vol-user-claims': accessToken, + }, + }) + + const customer = normalizeCustomer(data?.customerAccount) + + if (!customer.id) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Customer not found', code: 'not_found' }], + }) + } + + return res.status(200).json({ data: { customer } }) + } + + res.status(200).json({ data: null }) +} + +export default getLoggedInCustomer diff --git a/packages/kibocommerce/src/api/endpoints/customer/index.ts b/packages/kibocommerce/src/api/endpoints/customer/index.ts new file mode 100644 index 000000000..20bd44da9 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/customer/index.ts @@ -0,0 +1,18 @@ +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import customerEndpoint from '@vercel/commerce/api/endpoints/customer' +import type { CustomerSchema } from '../../../types/customer' +import type { KiboCommerceAPI } from '../..' +import getLoggedInCustomer from './customer' + +export type CustomerAPI = GetAPISchema + +export type CustomerEndpoint = CustomerAPI['endpoint'] + +export const handlers: CustomerEndpoint['handlers'] = { getLoggedInCustomer } + +const customerApi = createEndpoint({ + handler: customerEndpoint, + handlers, +}) + +export default customerApi diff --git a/packages/kibocommerce/src/api/endpoints/login/index.ts b/packages/kibocommerce/src/api/endpoints/login/index.ts new file mode 100644 index 000000000..679a92d90 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/login/index.ts @@ -0,0 +1,20 @@ +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import loginEndpoint from '@vercel/commerce/api/endpoints/login' +import type { LoginSchema } from '../../../types/login' +import type { KiboCommerceAPI } from '../..' +import login from './login' + +export type LoginAPI = GetAPISchema + +export type LoginEndpoint = LoginAPI['endpoint'] + +export const handlers: LoginEndpoint['handlers'] = { login } + +const loginApi = createEndpoint({ + handler: loginEndpoint, + handlers, +}) + +export default loginApi; + + diff --git a/packages/kibocommerce/src/api/endpoints/login/login.ts b/packages/kibocommerce/src/api/endpoints/login/login.ts new file mode 100644 index 000000000..7a08069c6 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/login/login.ts @@ -0,0 +1,66 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { LoginEndpoint } from '.' +import { loginMutation } from '../../mutations/login-mutation' +import { prepareSetCookie } from '../../../lib/prepare-set-cookie'; +import { setCookies } from '../../../lib/set-cookie' +import { getCookieExpirationDate } from '../../../lib/get-cookie-expiration-date' + +const invalidCredentials = /invalid credentials/i + +const login: LoginEndpoint['handlers']['login'] = async ({ + req, + res, + body: { email, password }, + config, + commerce, +}) => { + + if (!(email && password)) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + + let response; + try { + + const variables = { loginInput : { username: email, password }}; + response = await config.fetch(loginMutation, { variables }) + const { account: token } = response.data; + + // Set Cookie + const cookieExpirationDate = getCookieExpirationDate(config.customerCookieMaxAgeInDays) + + const authCookie = prepareSetCookie( + config.customerCookie, + JSON.stringify(token), + token.accessTokenExpiration ? { expires: cookieExpirationDate }: {}, + ) + setCookies(res, [authCookie]) + + } catch (error) { + // Check if the email and password didn't match an existing account + if ( + error instanceof FetcherError && + invalidCredentials.test(error.message) + ) { + return res.status(401).json({ + data: null, + errors: [ + { + message: + 'Cannot find an account that matches the provided credentials', + code: 'invalid_credentials', + }, + ], + }) + } + + throw error + } + + res.status(200).json({ data: response }) +} + +export default login diff --git a/packages/kibocommerce/src/api/endpoints/logout/index.ts b/packages/kibocommerce/src/api/endpoints/logout/index.ts new file mode 100644 index 000000000..00804afb3 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/logout/index.ts @@ -0,0 +1,18 @@ +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import logoutEndpoint from '@vercel/commerce/api/endpoints/logout' +import type { LogoutSchema } from '../../../types/logout' +import type { KiboCommerceAPI } from '../..' +import logout from './logout' + +export type LogoutAPI = GetAPISchema + +export type LogoutEndpoint = LogoutAPI['endpoint'] + +export const handlers: LogoutEndpoint['handlers'] = { logout } + +const logoutApi = createEndpoint({ + handler: logoutEndpoint, + handlers, +}) + +export default logoutApi diff --git a/packages/kibocommerce/src/api/endpoints/logout/logout.ts b/packages/kibocommerce/src/api/endpoints/logout/logout.ts new file mode 100644 index 000000000..1b0835e39 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/logout/logout.ts @@ -0,0 +1,22 @@ +import type { LogoutEndpoint } from '.' +import {prepareSetCookie} from '../../../lib/prepare-set-cookie'; +import {setCookies} from '../../../lib/set-cookie' + +const logout: LogoutEndpoint['handlers']['logout'] = async ({ + res, + body: { redirectTo }, + config, +}) => { + // Remove the cookie + const authCookie = prepareSetCookie(config.customerCookie,'',{ maxAge: -1, path: '/' }) + setCookies(res, [authCookie]) + + // Only allow redirects to a relative URL + if (redirectTo?.startsWith('/')) { + res.redirect(redirectTo) + } else { + res.status(200).json({ data: null }) + } +} + +export default logout diff --git a/packages/kibocommerce/src/api/endpoints/signup/index.ts b/packages/kibocommerce/src/api/endpoints/signup/index.ts new file mode 100644 index 000000000..8b2fec006 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/signup/index.ts @@ -0,0 +1,18 @@ +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import signupEndpoint from '@vercel/commerce/api/endpoints/signup' +import type { SignupSchema } from '../../../types/signup' +import type { KiboCommerceAPI } from '../..' +import signup from './signup' + +export type SignupAPI = GetAPISchema + +export type SignupEndpoint = SignupAPI['endpoint'] + +export const handlers: SignupEndpoint['handlers'] = { signup } + +const singupApi = createEndpoint({ + handler: signupEndpoint, + handlers, +}) + +export default singupApi diff --git a/packages/kibocommerce/src/api/endpoints/signup/signup.ts b/packages/kibocommerce/src/api/endpoints/signup/signup.ts new file mode 100644 index 000000000..b3d988475 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/signup/signup.ts @@ -0,0 +1,91 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { SignupEndpoint } from '.' +import { registerUserMutation, registerUserLoginMutation } from '../../mutations/signup-mutation' +import { prepareSetCookie } from '../../../lib/prepare-set-cookie'; +import { setCookies } from '../../../lib/set-cookie' +import { getCookieExpirationDate } from '../../../lib/get-cookie-expiration-date' + +const invalidCredentials = /invalid credentials/i + +const signup: SignupEndpoint['handlers']['signup'] = async ({ + req, + res, + body: { email, password, firstName, lastName }, + config, + commerce, +}) => { + + if (!(email && password)) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + + let response; + try { + + // Register user + const registerUserVariables = { + customerAccountInput: { + emailAddress: email, + firstName: firstName, + lastName: lastName, + acceptsMarketing: true, + id: 0 + } + } + + const registerUserResponse = await config.fetch(registerUserMutation, { variables: registerUserVariables}) + const accountId = registerUserResponse.data?.account?.id; + + // Login user + const registerUserLoginVairables = { + accountId: accountId, + customerLoginInfoInput: { + emailAddress: email, + username: email, + password: password, + isImport: false + } + } + + response = await config.fetch(registerUserLoginMutation, { variables: registerUserLoginVairables}) + const { account: token } = response.data; + + // Set Cookie + const cookieExpirationDate = getCookieExpirationDate(config.customerCookieMaxAgeInDays) + + const authCookie = prepareSetCookie( + config.customerCookie, + JSON.stringify(token), + token.accessTokenExpiration ? { expires: cookieExpirationDate }: {}, + ) + + setCookies(res, [authCookie]) + + } catch (error) { + // Check if the email and password didn't match an existing account + if ( + error instanceof FetcherError && + invalidCredentials.test(error.message) + ) { + return res.status(401).json({ + data: null, + errors: [ + { + message: + 'Cannot find an account that matches the provided credentials', + code: 'invalid_credentials', + }, + ], + }) + } + + throw error + } + + res.status(200).json({ data: response }) +} + +export default signup diff --git a/packages/kibocommerce/src/api/endpoints/wishlist/add-item.ts b/packages/kibocommerce/src/api/endpoints/wishlist/add-item.ts new file mode 100644 index 000000000..49cfc37d5 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/wishlist/add-item.ts @@ -0,0 +1,124 @@ +import getCustomerWishlist from '../../operations/get-customer-wishlist' +import getCustomerId from '../../utils/get-customer-id' +import type { WishlistEndpoint } from '.' +import { normalizeWishlistItem } from '../../../lib/normalize' +import { getProductQuery } from '../../../api/queries/get-product-query' +import addItemToWishlistMutation from '../../mutations/addItemToWishlist-mutation' +import createWishlist from '../../mutations/create-wishlist-mutation' + +// Return wishlist info +const buildAddToWishlistVariables = ({ + productId, + variantId, + productResponse, + wishlist +}: { + productId: string + variantId: string + productResponse: any + wishlist: any +}) => { + const { product } = productResponse.data + + const selectedOptions = product.variations?.find( + (v: any) => v.productCode === variantId + ).options + const quantity=1 + let options: any[] = [] + selectedOptions?.forEach((each: any) => { + product?.options + .filter((option: any) => { + return option.attributeFQN == each.attributeFQN + }) + .forEach((po: any) => { + options.push({ + attributeFQN: po.attributeFQN, + name: po.attributeDetail.name, + value: po.values?.find((v: any) => v.value == each.value).value, + }) + }) + }) + + return { + wishlistId: wishlist?.id, + wishlistItemInput: { + quantity, + product: { + productCode: productId, + variationProductCode: variantId ? variantId : null, + options, + } + }, + } +} + +const addItem: WishlistEndpoint['handlers']['addItem'] = async ({ + res, + body: { customerToken, item }, + config, + commerce, +}) => { + const token = customerToken ? Buffer.from(customerToken, 'base64').toString('ascii'): null; + const accessToken = token ? JSON.parse(token).accessToken : null; + let result: { data?: any } = {} + let wishlist: any + + if (!item) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Missing item' }], + }) + } + + const customerId = customerToken && (await getCustomerId({ customerToken, config })) + const wishlistName= config.defaultWishlistName + + if (!customerId) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + + const wishlistResponse = await commerce.getCustomerWishlist({ + variables: { customerId, wishlistName }, + config, + }) + wishlist= wishlistResponse?.wishlist + if(Object.keys(wishlist).length === 0) { + const createWishlistResponse= await config.fetch(createWishlist, {variables: { + wishlistInput: { + customerAccountId: customerId, + name: wishlistName + } + } + }, {headers: { 'x-vol-user-claims': accessToken } }) + wishlist= createWishlistResponse?.data?.createWishlist + } + + const productResponse = await config.fetch(getProductQuery, { + variables: { productCode: item?.productId }, + }) + + const addItemToWishlistResponse = await config.fetch( + addItemToWishlistMutation, + { + variables: buildAddToWishlistVariables({ ...item, productResponse, wishlist }), + }, + { headers: { 'x-vol-user-claims': accessToken } } + ) + + if(addItemToWishlistResponse?.data?.createWishlistItem){ + const wishlistResponse= await commerce.getCustomerWishlist({ + variables: { customerId, wishlistName }, + config, + }) + wishlist= wishlistResponse?.wishlist + } + + result = { data: {...wishlist, items: wishlist?.items?.map((item:any) => normalizeWishlistItem(item, config))} } + + res.status(200).json({ data: result?.data }) +} + +export default addItem diff --git a/packages/kibocommerce/src/api/endpoints/wishlist/get-wishlist.ts b/packages/kibocommerce/src/api/endpoints/wishlist/get-wishlist.ts new file mode 100644 index 000000000..be4c403d9 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/wishlist/get-wishlist.ts @@ -0,0 +1,35 @@ +import type { WishlistEndpoint } from '.' +import getCustomerId from '../../utils/get-customer-id' +import { normalizeWishlistItem } from '../../../lib/normalize' + +// Return wishlist info +const getWishlist: WishlistEndpoint['handlers']['getWishlist'] = async ({ + res, + body: { customerToken, includeProducts }, + config, + commerce, +}) => { + let result: { data?: any } = {} + if (customerToken) { + const customerId = customerToken && (await getCustomerId({ customerToken, config })) + const wishlistName= config.defaultWishlistName + if (!customerId) { + // If the customerToken is invalid, then this request is too + return res.status(404).json({ + data: null, + errors: [{ message: 'Wishlist not found' }], + }) + } + const { wishlist } = await commerce.getCustomerWishlist({ + variables: { customerId, wishlistName }, + includeProducts, + config, + }) + + result = { data: {...wishlist, items: wishlist?.items?.map((item:any) => normalizeWishlistItem(item, config, includeProducts))} } + } + + res.status(200).json({ data: result?.data ?? null }) +} + +export default getWishlist diff --git a/packages/kibocommerce/src/api/endpoints/wishlist/index.ts b/packages/kibocommerce/src/api/endpoints/wishlist/index.ts new file mode 100644 index 000000000..58344be72 --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/wishlist/index.ts @@ -0,0 +1,23 @@ +import { GetAPISchema, createEndpoint } from '@vercel/commerce/api' +import wishlistEndpoint from '@vercel/commerce/api/endpoints/wishlist' +import type { KiboCommerceAPI } from '../..' +import getWishlist from './get-wishlist' +import addItem from './add-item' +import removeItem from './remove-item' + +export type WishlistAPI = GetAPISchema + +export type WishlistEndpoint = WishlistAPI['endpoint'] + +export const handlers: WishlistEndpoint['handlers'] = { + getWishlist, + addItem, + removeItem, +} + +const wishlistApi = createEndpoint({ + handler: wishlistEndpoint, + handlers, +}) + +export default wishlistApi diff --git a/packages/kibocommerce/src/api/endpoints/wishlist/remove-item.ts b/packages/kibocommerce/src/api/endpoints/wishlist/remove-item.ts new file mode 100644 index 000000000..ae6a8d81c --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/wishlist/remove-item.ts @@ -0,0 +1,60 @@ +import getCustomerId from '../../utils/get-customer-id' +import type { WishlistEndpoint } from '.' +import { normalizeWishlistItem } from '../../../lib/normalize' +import removeItemFromWishlistMutation from '../../mutations/removeItemFromWishlist-mutation' + +// Return wishlist info +const removeItem: WishlistEndpoint['handlers']['removeItem'] = async ({ + res, + body: { customerToken, itemId }, + config, + commerce, +}) => { + const token = customerToken ? Buffer.from(customerToken, 'base64').toString('ascii'): null; + const accessToken = token ? JSON.parse(token).accessToken : null; + let result: { data?: any } = {} + let wishlist: any + + const customerId = customerToken && (await getCustomerId({ customerToken, config })) + const wishlistName= config.defaultWishlistName + const wishlistResponse = await commerce.getCustomerWishlist({ + variables: { customerId, wishlistName }, + config, + }) + wishlist= wishlistResponse?.wishlist + + if (!wishlist || !itemId) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + const removedItem = wishlist?.items?.find( + (item:any) => { + return item.product.productCode === itemId; + } + ); + + const removeItemFromWishlistResponse = await config.fetch( + removeItemFromWishlistMutation, + { + variables: { + wishlistId: wishlist?.id, + wishlistItemId: removedItem?.id + }, + }, + { headers: { 'x-vol-user-claims': accessToken } } + ) + + if(removeItemFromWishlistResponse?.data?.deleteWishlistItem){ + const wishlistResponse= await commerce.getCustomerWishlist({ + variables: { customerId, wishlistName }, + config, + }) + wishlist= wishlistResponse?.wishlist + } + result = { data: {...wishlist, items: wishlist?.items?.map((item:any) => normalizeWishlistItem(item, config))} } + res.status(200).json({ data: result?.data }) +} + +export default removeItem diff --git a/packages/kibocommerce/src/api/fragments/cartItemDetails.ts b/packages/kibocommerce/src/api/fragments/cartItemDetails.ts new file mode 100644 index 000000000..951813073 --- /dev/null +++ b/packages/kibocommerce/src/api/fragments/cartItemDetails.ts @@ -0,0 +1,11 @@ +import { productDetails } from '../fragments/productDetails' +export const cartItemDetails = /*GraphQL*/` +fragment cartItemDetails on CartItem { + id + product { + ...productDetails + } + quantity +} +${productDetails} +`; diff --git a/packages/kibocommerce/src/api/fragments/category.ts b/packages/kibocommerce/src/api/fragments/category.ts new file mode 100644 index 000000000..e6be159b2 --- /dev/null +++ b/packages/kibocommerce/src/api/fragments/category.ts @@ -0,0 +1,11 @@ +export const CategoryInfo = /* GraphQL */` +fragment categoryInfo on PrCategory { + categoryId + categoryCode + isDisplayed + content { + name + slug + description + } +}`; \ No newline at end of file diff --git a/packages/kibocommerce/src/api/fragments/product.ts b/packages/kibocommerce/src/api/fragments/product.ts new file mode 100644 index 000000000..b69d00827 --- /dev/null +++ b/packages/kibocommerce/src/api/fragments/product.ts @@ -0,0 +1,98 @@ +export const productPrices = /* GraphQL */` +fragment productPrices on Product { + price { + price + salePrice + } + priceRange { + lower { price, salePrice} + upper { price, salePrice } + } + } +`; +export const productAttributes = /* GraphQL */` +fragment productAttributes on Product { + properties { + attributeFQN + attributeDetail { + name + } + isHidden + values { + value + stringValue + } + } +} +`; +export const productContent = /* GraphQL */` +fragment productContent on Product { + content { + productFullDescription + productShortDescription + seoFriendlyUrl + productName + productImages { + imageUrl + imageLabel + mediaType + } + } +} +`; +export const productOptions = /* GraphQL */` +fragment productOptions on Product { + options { + attributeFQN + attributeDetail { + name + } + isProductImageGroupSelector + isRequired + isMultiValue + values { + value + isSelected + deltaPrice + stringValue + } + } +} +`; +export const productInfo = /* GraphQL */` +fragment productInfo on Product { + productCode + productUsage + + purchasableState { + isPurchasable + } + + variations { + productCode, + options { + __typename + attributeFQN + value + } + } + + categories { + categoryCode + categoryId + content { + name + slug + } + } + + ...productPrices + ...productAttributes + ...productContent + ...productOptions +} +${productPrices} +${productAttributes} +${productContent} +${productOptions} +`; diff --git a/packages/kibocommerce/src/api/fragments/productDetails.ts b/packages/kibocommerce/src/api/fragments/productDetails.ts new file mode 100644 index 000000000..e29ffa7b7 --- /dev/null +++ b/packages/kibocommerce/src/api/fragments/productDetails.ts @@ -0,0 +1,30 @@ +export const productDetails = /* GraphQL */ ` + fragment productDetails on CrProduct { + productCode + name + description + imageUrl + imageAlternateText + sku + variationProductCode + price { + price + salePrice + } + options { + attributeFQN + name + value + } + properties { + attributeFQN + name + values { + value + } + } + categories { + id + } +} +` diff --git a/packages/kibocommerce/src/api/fragments/search.ts b/packages/kibocommerce/src/api/fragments/search.ts new file mode 100644 index 000000000..dee242a07 --- /dev/null +++ b/packages/kibocommerce/src/api/fragments/search.ts @@ -0,0 +1,32 @@ +import { productInfo } from './product'; + +export const searchFacets = /* GraphQL */` +fragment searchFacets on Facet { + label + field + values { + label + value + isApplied + filterValue + isDisplayed + count + } +}`; + +export const searchResults = /* GraphQL */` +fragment searchResults on ProductSearchResult { + totalCount + pageSize + pageCount + startIndex + items { + ...productInfo + } + facets { + ...searchFacets + } +} +${searchFacets} +${productInfo} +`; diff --git a/packages/kibocommerce/src/api/index.ts b/packages/kibocommerce/src/api/index.ts new file mode 100644 index 000000000..aa6d9604e --- /dev/null +++ b/packages/kibocommerce/src/api/index.ts @@ -0,0 +1,64 @@ +import type { CommerceAPI, CommerceAPIConfig } from '@vercel/commerce/api' +import { getCommerceApi as commerceApi } from '@vercel/commerce/api' +import createFetchGraphqlApi from './utils/fetch-graphql-api' + +import getAllPages from './operations/get-all-pages' +import getPage from './operations/get-page' +import getSiteInfo from './operations/get-site-info' +import getCustomerWishlist from './operations/get-customer-wishlist' +import getAllProductPaths from './operations/get-all-product-paths' +import getAllProducts from './operations/get-all-products' +import getProduct from './operations/get-product' +import type { RequestInit } from '@vercel/fetch' + +export interface KiboCommerceConfig extends CommerceAPIConfig { + apiHost?: string + clientId?: string + sharedSecret?: string + customerCookieMaxAgeInDays: number, + currencyCode: string, + documentListName: string, + defaultWishlistName: string, + authUrl?: string +} + +const config: KiboCommerceConfig = { + commerceUrl: process.env.KIBO_API_URL || '', + apiToken: process.env.KIBO_API_TOKEN || '', + cartCookie: process.env.KIBO_CART_COOKIE || '', + customerCookie: process.env.KIBO_CUSTOMER_COOKIE || '', + cartCookieMaxAge: 2592000, + documentListName: 'siteSnippets@mozu', + fetch: createFetchGraphqlApi(() => getCommerceApi().getConfig()), + authUrl: process.env.KIBO_AUTH_URL || '', + // REST API + apiHost: process.env.KIBO_API_HOST || '', + clientId: process.env.KIBO_CLIENT_ID || '', + sharedSecret: process.env.KIBO_SHARED_SECRET || '', + customerCookieMaxAgeInDays: 30, + currencyCode: 'USD', + defaultWishlistName: 'My Wishlist' +} + +const operations = { + getAllPages, + getPage, + getSiteInfo, + getCustomerWishlist, + getAllProductPaths, + getAllProducts, + getProduct, +} + +export const provider = { config, operations } + +export type KiboCommerceProvider = typeof provider +export type KiboCommerceAPI< + P extends KiboCommerceProvider = KiboCommerceProvider + > = CommerceAPI

+ +export function getCommerceApi

( + customProvider: P = provider as any +): KiboCommerceAPI

{ + return commerceApi(customProvider as any) +} diff --git a/packages/kibocommerce/src/api/mutations/addItemToWishlist-mutation.ts b/packages/kibocommerce/src/api/mutations/addItemToWishlist-mutation.ts new file mode 100644 index 000000000..f9088b0bb --- /dev/null +++ b/packages/kibocommerce/src/api/mutations/addItemToWishlist-mutation.ts @@ -0,0 +1,21 @@ +import {productDetails} from '../fragments/productDetails' +const addItemToWishlistMutation = /* GraphQL */` + mutation createWishlistItem( + $wishlistId: String! + $wishlistItemInput: WishlistItemInput + ) { + createWishlistItem( + wishlistId: $wishlistId + wishlistItemInput: $wishlistItemInput + ) { + id + quantity + product { + ...productDetails + } + } + } +${productDetails} +`; + +export default addItemToWishlistMutation; diff --git a/packages/kibocommerce/src/api/mutations/addToCart-mutation.ts b/packages/kibocommerce/src/api/mutations/addToCart-mutation.ts new file mode 100644 index 000000000..7cbf68801 --- /dev/null +++ b/packages/kibocommerce/src/api/mutations/addToCart-mutation.ts @@ -0,0 +1,12 @@ +import { cartItemDetails } from './../fragments/cartItemDetails' + +const addToCurrentCartMutation = /*GraphQL*/ ` +${cartItemDetails} + +mutation addToCart($productToAdd:CartItemInput!){ + addItemToCurrentCart(cartItemInput: $productToAdd) { + ...cartItemDetails + } +}` + +export default addToCurrentCartMutation diff --git a/packages/kibocommerce/src/api/mutations/create-wishlist-mutation.ts b/packages/kibocommerce/src/api/mutations/create-wishlist-mutation.ts new file mode 100644 index 000000000..66ad88309 --- /dev/null +++ b/packages/kibocommerce/src/api/mutations/create-wishlist-mutation.ts @@ -0,0 +1,11 @@ +const createWishlist = /*GraphQL*/` +mutation createWishlist($wishlistInput:WishlistInput!) { + createWishlist(wishlistInput:$wishlistInput){ + id + name + customerAccountId + } + } +`; + +export default createWishlist; \ No newline at end of file diff --git a/packages/kibocommerce/src/api/mutations/login-mutation.ts b/packages/kibocommerce/src/api/mutations/login-mutation.ts new file mode 100644 index 000000000..730adeda1 --- /dev/null +++ b/packages/kibocommerce/src/api/mutations/login-mutation.ts @@ -0,0 +1,20 @@ + +export const loginMutation = /* GraphQL */` +mutation login($loginInput:CustomerUserAuthInfoInput!) { + account:createCustomerAuthTicket(customerUserAuthInfoInput:$loginInput) { + accessToken + userId + refreshToken + refreshTokenExpiration + accessTokenExpiration + customerAccount { + id + firstName + lastName + emailAddress + userName + } + } + } +` + diff --git a/packages/kibocommerce/src/api/mutations/removeItemFromCart-mutation.ts b/packages/kibocommerce/src/api/mutations/removeItemFromCart-mutation.ts new file mode 100644 index 000000000..3cf5c5af5 --- /dev/null +++ b/packages/kibocommerce/src/api/mutations/removeItemFromCart-mutation.ts @@ -0,0 +1,9 @@ +/* +* Delete cart based on current user session +*/ +const removeItemFromCartMutation = /*GraphQL*/` +mutation deleteCartItem($id: String!) { + deleteCurrentCartItem(cartItemId:$id) +}`; + +export default removeItemFromCartMutation; diff --git a/packages/kibocommerce/src/api/mutations/removeItemFromWishlist-mutation.ts b/packages/kibocommerce/src/api/mutations/removeItemFromWishlist-mutation.ts new file mode 100644 index 000000000..ce3d994a5 --- /dev/null +++ b/packages/kibocommerce/src/api/mutations/removeItemFromWishlist-mutation.ts @@ -0,0 +1,8 @@ +const removeItemFromWishlistMutation = /* GraphQL */` +mutation deletewishlistitem($wishlistId: String!, $wishlistItemId: String!) { + deleteWishlistItem(wishlistId: $wishlistId, wishlistItemId:$wishlistItemId) + } +`; + +export default removeItemFromWishlistMutation; + diff --git a/packages/kibocommerce/src/api/mutations/signup-mutation.ts b/packages/kibocommerce/src/api/mutations/signup-mutation.ts new file mode 100644 index 000000000..bb25534ab --- /dev/null +++ b/packages/kibocommerce/src/api/mutations/signup-mutation.ts @@ -0,0 +1,41 @@ + +const registerUserMutation = /* GraphQL */` +mutation registerUser($customerAccountInput: CustomerAccountInput!) { + account:createCustomerAccount(customerAccountInput:$customerAccountInput) { + emailAddress + userName + firstName + lastName + localeCode + userId + id + isAnonymous + attributes { + values + fullyQualifiedName + } + } +}`; + +const registerUserLoginMutation = /* GraphQL */` +mutation registerUserLogin($accountId: Int!, $customerLoginInfoInput: CustomerLoginInfoInput!) { + account:createCustomerAccountLogin(accountId:$accountId, customerLoginInfoInput:$customerLoginInfoInput) { + accessToken + accessTokenExpiration + refreshToken + refreshTokenExpiration + userId + customerAccount { + id + emailAddress + firstName + userName + } + } +}`; + +export { + registerUserMutation, + registerUserLoginMutation +}; + diff --git a/packages/kibocommerce/src/api/mutations/updateCartItemQuantity-mutation.ts b/packages/kibocommerce/src/api/mutations/updateCartItemQuantity-mutation.ts new file mode 100644 index 000000000..7b2cd5c82 --- /dev/null +++ b/packages/kibocommerce/src/api/mutations/updateCartItemQuantity-mutation.ts @@ -0,0 +1,9 @@ +const updateCartItemQuantityMutation = /*GraphQL*/` +mutation updateCartItemQuantity($itemId:String!, $quantity: Int!){ + updateCurrentCartItemQuantity(cartItemId:$itemId, quantity:$quantity){ + id + quantity + } +}`; + +export default updateCartItemQuantityMutation; diff --git a/packages/kibocommerce/src/api/operations/get-all-pages.ts b/packages/kibocommerce/src/api/operations/get-all-pages.ts new file mode 100644 index 000000000..7607e194e --- /dev/null +++ b/packages/kibocommerce/src/api/operations/get-all-pages.ts @@ -0,0 +1,38 @@ +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { KiboCommerceConfig } from '../index' +import { getAllPagesQuery } from '../queries/get-all-pages-query' +import { GetPagesQueryParams } from "../../types/page"; +import { normalizePage } from '../../lib/normalize' + +export type GetAllPagesResult< + T extends { pages: any[] } = { pages: any[] } + > = T + +export default function getAllPagesOperation({ + commerce, +}: OperationContext) { + + async function getAllPages({ + query = getAllPagesQuery, + config, + variables, + }: { + url?: string + config?: Partial + variables?: GetPagesQueryParams + preview?: boolean + query?: string + } = {}): Promise { + const cfg = commerce.getConfig(config) + variables = { + documentListName: cfg.documentListName + } + const { data } = await cfg.fetch(query, { variables }); + + const pages = data.documentListDocuments.items.map(normalizePage); + + return { pages } + } + + return getAllPages +} diff --git a/packages/kibocommerce/src/api/operations/get-all-product-paths.ts b/packages/kibocommerce/src/api/operations/get-all-product-paths.ts new file mode 100644 index 000000000..3067b67fc --- /dev/null +++ b/packages/kibocommerce/src/api/operations/get-all-product-paths.ts @@ -0,0 +1,26 @@ +import { KiboCommerceConfig } from '../index' +import { getAllProductsQuery } from '../queries/get-all-products-query'; +import { normalizeProduct } from '../../lib/normalize' + +export type GetAllProductPathsResult = { + products: Array<{ path: string }> +} + +export default function getAllProductPathsOperation({commerce,}: any) { + async function getAllProductPaths({ config }: {config?: KiboCommerceConfig } = {}): Promise { + + const cfg = commerce.getConfig(config) + + const productVariables = {startIndex: 0, pageSize: 100}; + const { data } = await cfg.fetch(getAllProductsQuery, { variables: productVariables }); + + const normalizedProducts = data.products.items ? data.products.items.map( (item:any) => normalizeProduct(item, cfg)) : []; + const products = normalizedProducts.map((product: any) => ({ path: product.path })) + + return Promise.resolve({ + products: products + }) + } + + return getAllProductPaths +} diff --git a/packages/kibocommerce/src/api/operations/get-all-products.ts b/packages/kibocommerce/src/api/operations/get-all-products.ts new file mode 100644 index 000000000..bddafbffa --- /dev/null +++ b/packages/kibocommerce/src/api/operations/get-all-products.ts @@ -0,0 +1,32 @@ +import { Product } from '@vercel/commerce/types/product' +import { GetAllProductsOperation } from '@vercel/commerce/types/product' +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { KiboCommerceConfig } from '../index' +import { getAllProductsQuery } from '../queries/get-all-products-query'; +import { normalizeProduct } from '../../lib/normalize' + +export default function getAllProductsOperation({ + commerce, +}: OperationContext) { + async function getAllProducts({ + query = getAllProductsQuery, + variables, + config, + }: { + query?: string + variables?: T['variables'] + config?: Partial + preview?: boolean + } = {}): Promise<{ products: Product[] | any[] }> { + + const cfg = commerce.getConfig(config) + const { data } = await cfg.fetch(query); + + let normalizedProducts = data.products.items ? data.products.items.map( (item:any) => normalizeProduct(item, cfg)) : []; + + return { + products: normalizedProducts, + } + } + return getAllProducts +} diff --git a/packages/kibocommerce/src/api/operations/get-customer-wishlist.ts b/packages/kibocommerce/src/api/operations/get-customer-wishlist.ts new file mode 100644 index 000000000..c2792ad32 --- /dev/null +++ b/packages/kibocommerce/src/api/operations/get-customer-wishlist.ts @@ -0,0 +1,57 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { + GetCustomerWishlistOperation, + Wishlist, +} from '@vercel/commerce/types/wishlist' +// import type { RecursivePartial, RecursiveRequired } from '../utils/types' +import { KiboCommerceConfig } from '..' +// import getAllProducts, { ProductEdge } from './get-all-products' +import {getCustomerWishlistQuery} from '../queries/get-customer-wishlist-query' + +export default function getCustomerWishlistOperation({ + commerce, +}: OperationContext) { + async function getCustomerWishlist< + T extends GetCustomerWishlistOperation + >(opts: { + variables: T['variables'] + config?: KiboCommerceConfig + includeProducts?: boolean + }): Promise + + async function getCustomerWishlist( + opts: { + variables: T['variables'] + config?: KiboCommerceConfig + includeProducts?: boolean + } & OperationOptions + ): Promise + + async function getCustomerWishlist({ + config, + variables, + includeProducts, + }: { + url?: string + variables: T['variables'] + config?: KiboCommerceConfig + includeProducts?: boolean + }): Promise { + let customerWishlist ={} + try { + + config = commerce.getConfig(config) + const result= await config?.fetch(getCustomerWishlistQuery,{variables}) + customerWishlist= result?.data?.customerWishlist; + } catch(e) { + customerWishlist= {} + } + + return { wishlist: customerWishlist as any } + } + + return getCustomerWishlist +} diff --git a/packages/kibocommerce/src/api/operations/get-page.ts b/packages/kibocommerce/src/api/operations/get-page.ts new file mode 100644 index 000000000..69289cba0 --- /dev/null +++ b/packages/kibocommerce/src/api/operations/get-page.ts @@ -0,0 +1,40 @@ +import type { + OperationContext, +} from '@vercel/commerce/api/operations' +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' + +export default function getPageOperation({ + commerce, +}: OperationContext) { + async function getPage({ + url, + variables, + config, + preview, + }: { + url?: string + variables: GetPageQueryParams + config?: Partial + preview?: boolean + }): Promise { + // RecursivePartial forces the method to check for every prop in the data, which is + // required in case there's a custom `url` + const cfg = commerce.getConfig(config) + const pageVariables = { documentListName: cfg.documentListName, filter: `id eq ${variables.id}` } + + const { data } = await cfg.fetch(getPageQuery, { variables: pageVariables }) + + const firstPage = data.documentListDocuments.items?.[0]; + const page = firstPage as Document + if (preview || page?.properties?.is_visible) { + return { page: normalizePage(page as any) } + } + return {} + } + + return getPage +} diff --git a/packages/kibocommerce/src/api/operations/get-product.ts b/packages/kibocommerce/src/api/operations/get-product.ts new file mode 100644 index 000000000..c41b1bf04 --- /dev/null +++ b/packages/kibocommerce/src/api/operations/get-product.ts @@ -0,0 +1,35 @@ +import type { KiboCommerceConfig } from '../index' +import { Product } from '@vercel/commerce/types/product' +import { GetProductOperation } from '@vercel/commerce/types/product' +import type { OperationContext } from '@vercel/commerce/api/operations' +import { getProductQuery } from '../queries/get-product-query' +import { normalizeProduct } from '../../lib/normalize' + +export default function getProductOperation({ + commerce, +}: OperationContext) { + + async function getProduct({ + query = getProductQuery, + variables, + config, + }: { + query?: string + variables?: T['variables'] + config?: Partial + preview?: boolean + } = {}): Promise { + const productVariables = { productCode: variables?.slug} + + const cfg = commerce.getConfig(config) + const { data } = await cfg.fetch(query, { variables: productVariables }); + + const normalizedProduct = normalizeProduct(data.product, cfg) + + return { + product: normalizedProduct + } + } + + return getProduct +} diff --git a/packages/kibocommerce/src/api/operations/get-site-info.ts b/packages/kibocommerce/src/api/operations/get-site-info.ts new file mode 100644 index 000000000..6b72d3b47 --- /dev/null +++ b/packages/kibocommerce/src/api/operations/get-site-info.ts @@ -0,0 +1,35 @@ +import { OperationContext } from '@vercel/commerce/api/operations' +import { Category } from '@vercel/commerce/types/site' +import { KiboCommerceConfig } from '../index' +import {categoryTreeQuery} from '../queries/get-categories-tree-query' +import { normalizeCategory } from '../../lib/normalize' + +export type GetSiteInfoResult< + T extends { categories: any[]; brands: any[] } = { + categories: Category[] + brands: any[] + } +> = T + +export default function getSiteInfoOperation({commerce}: OperationContext) { + async function getSiteInfo({ + query= categoryTreeQuery, + variables, + config, + }: { + query?: string + variables?: any + config?: Partial + preview?: boolean + } = {}): Promise { + const cfg = commerce.getConfig(config) + const { data } = await cfg.fetch(query); + const categories= data.categories.items.map(normalizeCategory); + return Promise.resolve({ + categories: categories ?? [], + brands: [], + }) + } + + return getSiteInfo +} diff --git a/framework/local/api/operations/index.ts b/packages/kibocommerce/src/api/operations/index.ts similarity index 100% rename from framework/local/api/operations/index.ts rename to packages/kibocommerce/src/api/operations/index.ts diff --git a/packages/kibocommerce/src/api/queries/get-all-pages-query.ts b/packages/kibocommerce/src/api/queries/get-all-pages-query.ts new file mode 100644 index 000000000..6926914f5 --- /dev/null +++ b/packages/kibocommerce/src/api/queries/get-all-pages-query.ts @@ -0,0 +1,11 @@ +export const getAllPagesQuery = /* GraphQL */` +query($documentListName: String!) { + documentListDocuments(documentListName:$documentListName){ + items { + id + name + listFQN + properties + } + } + }`; \ No newline at end of file diff --git a/packages/kibocommerce/src/api/queries/get-all-products-query.ts b/packages/kibocommerce/src/api/queries/get-all-products-query.ts new file mode 100644 index 000000000..3c6599e34 --- /dev/null +++ b/packages/kibocommerce/src/api/queries/get-all-products-query.ts @@ -0,0 +1,21 @@ +import { productInfo } from '../fragments/product'; + +export const getAllProductsQuery = /* GraphQL */` +${productInfo} + +query products( + $filter: String + $startIndex: Int + $pageSize: Int +) { + products( + filter: $filter + startIndex: $startIndex + pageSize: $pageSize + ) { + items { + ...productInfo + } + } +} +` \ No newline at end of file diff --git a/packages/kibocommerce/src/api/queries/get-anonymous-shopper-token-query.ts b/packages/kibocommerce/src/api/queries/get-anonymous-shopper-token-query.ts new file mode 100644 index 000000000..031ffc0ee --- /dev/null +++ b/packages/kibocommerce/src/api/queries/get-anonymous-shopper-token-query.ts @@ -0,0 +1,11 @@ +export const getAnonymousShopperTokenQuery = /* GraphQL */ ` + query { + getAnonymousShopperToken { + accessToken + accessTokenExpiration + refreshToken + refreshTokenExpiration + jwtAccessToken + } + } +` diff --git a/packages/kibocommerce/src/api/queries/get-cart-query.ts b/packages/kibocommerce/src/api/queries/get-cart-query.ts new file mode 100644 index 000000000..5bbf5bbfa --- /dev/null +++ b/packages/kibocommerce/src/api/queries/get-cart-query.ts @@ -0,0 +1,32 @@ +import { productDetails } from '../fragments/productDetails' +export const getCartQuery = /* GraphQL */` +query cart { + currentCart { + id + userId + orderDiscounts { + impact + discount { + id + name + } + couponCode + } + subtotal + shippingTotal + total + items { + id + subtotal + unitPrice{ + extendedAmount + } + product { + ...productDetails + } + quantity + } + } + } +${productDetails} +` diff --git a/packages/kibocommerce/src/api/queries/get-categories-tree-query.ts b/packages/kibocommerce/src/api/queries/get-categories-tree-query.ts new file mode 100644 index 000000000..984833630 --- /dev/null +++ b/packages/kibocommerce/src/api/queries/get-categories-tree-query.ts @@ -0,0 +1,29 @@ +import { CategoryInfo } from '../fragments/category' + +export const categoryTreeQuery = /* GraphQL */` +query GetCategoryTree { + categories: categoriesTree { + items { + ...categoryInfo + childrenCategories { + ...categoryInfo + childrenCategories { + ...categoryInfo + childrenCategories { + ...categoryInfo + childrenCategories { + ...categoryInfo + childrenCategories { + ...categoryInfo + childrenCategories { + ...categoryInfo + } + } + } + } + } + } + } + } +} +${CategoryInfo}`; \ No newline at end of file diff --git a/packages/kibocommerce/src/api/queries/get-customer-account-query.ts b/packages/kibocommerce/src/api/queries/get-customer-account-query.ts new file mode 100644 index 000000000..9528b8467 --- /dev/null +++ b/packages/kibocommerce/src/api/queries/get-customer-account-query.ts @@ -0,0 +1,12 @@ +export const getCustomerAccountQuery = /* GraphQL */` +query getUser { + customerAccount:getCurrentAccount { + id + firstName + lastName + emailAddress + userName + isAnonymous + } +} +` \ No newline at end of file diff --git a/packages/kibocommerce/src/api/queries/get-customer-wishlist-query.ts b/packages/kibocommerce/src/api/queries/get-customer-wishlist-query.ts new file mode 100644 index 000000000..d2ae3edec --- /dev/null +++ b/packages/kibocommerce/src/api/queries/get-customer-wishlist-query.ts @@ -0,0 +1,25 @@ +import {productDetails} from '../fragments/productDetails' +export const getCustomerWishlistQuery= /* GraphQL */` +query wishlist($customerId: Int!, $wishlistName: String!) { + customerWishlist(customerAccountId:$customerId ,wishlistName: $wishlistName){ + customerAccountId + name + id + userId + items { + id + quantity + total + subtotal + unitPrice{ + extendedAmount + } + quantity + product { + ...productDetails + } + } + } + } +${productDetails} +` \ No newline at end of file diff --git a/packages/kibocommerce/src/api/queries/get-page-query.ts b/packages/kibocommerce/src/api/queries/get-page-query.ts new file mode 100644 index 000000000..69371d003 --- /dev/null +++ b/packages/kibocommerce/src/api/queries/get-page-query.ts @@ -0,0 +1,14 @@ +export const getPageQuery = /* GraphQL */` +query($documentListName: String!, $filter: String!) { + documentListDocuments(documentListName: $documentListName, filter: $filter){ + startIndex + totalCount + items { + id + name + listFQN + properties + } + } + } +`; \ No newline at end of file diff --git a/packages/kibocommerce/src/api/queries/get-product-query.ts b/packages/kibocommerce/src/api/queries/get-product-query.ts new file mode 100644 index 000000000..47db311e4 --- /dev/null +++ b/packages/kibocommerce/src/api/queries/get-product-query.ts @@ -0,0 +1,15 @@ +import { productInfo } from '../fragments/product'; + +export const getProductQuery = /* GraphQL */` +${productInfo} + + query product( + $productCode: String! + ) { + product( + productCode: $productCode + ) { + ...productInfo + } + } +` \ No newline at end of file diff --git a/packages/kibocommerce/src/api/queries/product-search-query.ts b/packages/kibocommerce/src/api/queries/product-search-query.ts new file mode 100644 index 000000000..d22f0ef12 --- /dev/null +++ b/packages/kibocommerce/src/api/queries/product-search-query.ts @@ -0,0 +1,20 @@ +import { searchResults } from '../fragments/search' + +const query = /* GraphQL */` +query ProductSearch($query:String, $startIndex:Int, + $pageSize:Int, $sortBy:String, $filter:String,$facetTemplate:String,$facetValueFilter:String ) { + products:productSearch ( + query:$query, + startIndex: $startIndex, + pageSize:$pageSize, + sortBy: $sortBy, + filter:$filter, + facetTemplate:$facetTemplate, + facetValueFilter:$facetValueFilter + ) { + ...searchResults + } + } + ${searchResults} +`; +export default query; diff --git a/packages/kibocommerce/src/api/utils/api-auth-helper.ts b/packages/kibocommerce/src/api/utils/api-auth-helper.ts new file mode 100644 index 000000000..20cfc7403 --- /dev/null +++ b/packages/kibocommerce/src/api/utils/api-auth-helper.ts @@ -0,0 +1,110 @@ +import type { KiboCommerceConfig } from '../index' +import type { FetchOptions } from '@vercel/fetch' +import fetch from './fetch' + +// This object is persisted during development +const authCache: { kiboAuthTicket?: AppAuthTicket } = {} + +interface AppAuthTicket { + access_token: string + token_type: string + expires_in: number + expires_at: number + refresh_token: string | null +} + +interface AuthTicketCache { + getAuthTicket: () => Promise + setAuthTicket: (kiboAuthTicket: AppAuthTicket) => void +} + +class RuntimeMemCache implements AuthTicketCache { + constructor() {} + async getAuthTicket() { + return authCache.kiboAuthTicket + } + setAuthTicket(kiboAuthTicket: AppAuthTicket) { + authCache.kiboAuthTicket = kiboAuthTicket + } +} + +export class APIAuthenticationHelper { + private _clientId: string + private _sharedSecret: string + private _authUrl: string + private _authTicketCache!: AuthTicketCache + + constructor( + { clientId = '', sharedSecret = '', authUrl = '' }: KiboCommerceConfig, + authTicketCache?: AuthTicketCache + ) { + this._clientId = clientId + this._sharedSecret = sharedSecret + this._authUrl = authUrl + if(!authTicketCache) { + this._authTicketCache = new RuntimeMemCache(); + } + } + private _buildFetchOptions(body: any = {}): FetchOptions { + return { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(body), + } + } + private _calculateTicketExpiration(kiboAuthTicket: AppAuthTicket) { + //calculate how many milliseconds until auth expires + const millisecsUntilExpiration = kiboAuthTicket.expires_in * 1000 + kiboAuthTicket.expires_at = Date.now() + millisecsUntilExpiration + + return kiboAuthTicket + } + public async authenticate(): Promise { + // create oauth fetch options + const options = this._buildFetchOptions({ + client_id: this._clientId, + client_secret: this._sharedSecret, + grant_type: 'client_credentials', + }) + // perform authentication + const authTicket = await fetch( + `${this._authUrl}/api/platform/applications/authtickets/oauth`, + options + ).then((response) => response.json()) + // set expiration time in ms on auth ticket + this._calculateTicketExpiration(authTicket) + // set authentication ticket on next server runtime object + this._authTicketCache.setAuthTicket(authTicket) + + return authTicket + } + public async refreshTicket(kiboAuthTicket: AppAuthTicket) { + // create oauth refresh fetch options + const options = this._buildFetchOptions({ + refreshToken: kiboAuthTicket?.refresh_token, + }) + // perform auth ticket refresh + const refreshedTicket = await fetch( + `${this._authUrl}/api/platform/applications/authtickets/refresh-ticket`, + options + ).then((response) => response.json()) + + return refreshedTicket + } + public async getAccessToken(): Promise { + // get current Kibo API auth ticket + let authTicket = await this._authTicketCache.getAuthTicket() + + // if no current ticket, perform auth + // or if ticket expired, refresh auth + if (!authTicket) { + authTicket = await this.authenticate() + } else if (authTicket.expires_at < Date.now()) { + authTicket = await this.refreshTicket(authTicket) + } + + return authTicket!.access_token + } +} diff --git a/packages/kibocommerce/src/api/utils/cookie-handler.ts b/packages/kibocommerce/src/api/utils/cookie-handler.ts new file mode 100644 index 000000000..b4c950fea --- /dev/null +++ b/packages/kibocommerce/src/api/utils/cookie-handler.ts @@ -0,0 +1,61 @@ +import { KiboCommerceConfig } from './../index' +import { getCookieExpirationDate } from '../../lib/get-cookie-expiration-date' +import { prepareSetCookie } from '../../lib/prepare-set-cookie' +import { setCookies } from '../../lib/set-cookie' +import { NextApiRequest } from 'next' +import getAnonymousShopperToken from './get-anonymous-shopper-token' + +const parseCookie = (cookieValue?: any) => { + return cookieValue + ? JSON.parse(Buffer.from(cookieValue, 'base64').toString('ascii')) + : null +} +export default class CookieHandler { + config: KiboCommerceConfig + request: NextApiRequest + response: any + accessToken: any + constructor(config: any, req: NextApiRequest, res: any) { + this.config = config + this.request = req + this.response = res + const encodedToken = req.cookies[config.customerCookie] + const token = parseCookie(encodedToken) + this.accessToken = token ? token.accessToken : null + } + + async getAnonymousToken() { + const response: any = await getAnonymousShopperToken({ + config: this.config, + }) + let anonymousAccessToken = response?.accessToken + return { + response, + accessToken: anonymousAccessToken, + } + } + isShopperCookieAnonymous() { + const customerCookieKey = this.config.customerCookie + const shopperCookie = this.request.cookies[customerCookieKey] + const shopperSession = parseCookie(shopperCookie); + const isAnonymous = shopperSession?.customerAccount ? false : true + return isAnonymous + } + setAnonymousShopperCookie(anonymousShopperTokenResponse: any) { + const cookieExpirationDate = getCookieExpirationDate( + this.config.customerCookieMaxAgeInDays + ) + + const authCookie = prepareSetCookie( + this.config.customerCookie, + JSON.stringify(anonymousShopperTokenResponse), + anonymousShopperTokenResponse?.accessTokenExpiration + ? { expires: cookieExpirationDate } + : {} + ) + setCookies(this.response, [authCookie]) + } + getAccessToken() { + return this.accessToken + } +} diff --git a/packages/kibocommerce/src/api/utils/fetch-graphql-api.ts b/packages/kibocommerce/src/api/utils/fetch-graphql-api.ts new file mode 100644 index 000000000..cf84f5e41 --- /dev/null +++ b/packages/kibocommerce/src/api/utils/fetch-graphql-api.ts @@ -0,0 +1,43 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { GraphQLFetcher } from '@vercel/commerce/api' +import type { KiboCommerceConfig } from '../index' +import fetch from './fetch' +import { APIAuthenticationHelper } from './api-auth-helper'; + +const fetchGraphqlApi: ( + getConfig: () => KiboCommerceConfig +) => GraphQLFetcher = (getConfig) => async ( + query: string, + { variables, preview } = {}, + fetchOptions +) => { + const config = getConfig() + const authHelper = new APIAuthenticationHelper(config); + const apiToken = await authHelper.getAccessToken(); + const res = await fetch(config.commerceUrl + (preview ? '/preview' : ''), { + ...fetchOptions, + method: 'POST', + headers: { + ...fetchOptions?.headers, + Authorization: `Bearer ${apiToken}`, + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + query, + variables, + }), + }) + + const json = await res.json() + if (json.errors) { + console.warn(`Kibo API Request Correlation ID: ${res.headers.get('x-vol-correlation')}`); + throw new FetcherError({ + errors: json.errors ?? [{ message: 'Failed to fetch KiboCommerce API' }], + status: res.status, + }) + } + + return { data: json.data, res } +} + +export default fetchGraphqlApi diff --git a/packages/kibocommerce/src/api/utils/fetch-local.ts b/packages/kibocommerce/src/api/utils/fetch-local.ts new file mode 100644 index 000000000..fa3a214cb --- /dev/null +++ b/packages/kibocommerce/src/api/utils/fetch-local.ts @@ -0,0 +1,36 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { GraphQLFetcher } from '@vercel/commerce/api' +import type { KiboCommerceConfig } from '../index' +import fetch from './fetch' + +const fetchGraphqlApi: (getConfig: () => KiboCommerceConfig) => GraphQLFetcher = + (getConfig) => + async (query: string, { variables, preview } = {}, fetchOptions) => { + const config = getConfig() + const res = await fetch(config.commerceUrl, { + //const res = await fetch(config.commerceUrl + (preview ? '/preview' : ''), { + ...fetchOptions, + method: 'POST', + headers: { + Authorization: `Bearer ${config.apiToken}`, + ...fetchOptions?.headers, + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + query, + variables, + }), + }) + + const json = await res.json() + if (json.errors) { + throw new FetcherError({ + errors: json.errors ?? [{ message: 'Failed to fetch KiboCommerce API' }], + status: res.status, + }) + } + + return { data: json.data, res } + } + +export default fetchGraphqlApi diff --git a/framework/bigcommerce/api/utils/fetch.ts b/packages/kibocommerce/src/api/utils/fetch.ts similarity index 100% rename from framework/bigcommerce/api/utils/fetch.ts rename to packages/kibocommerce/src/api/utils/fetch.ts diff --git a/packages/kibocommerce/src/api/utils/get-anonymous-shopper-token.ts b/packages/kibocommerce/src/api/utils/get-anonymous-shopper-token.ts new file mode 100644 index 000000000..9325a4ecd --- /dev/null +++ b/packages/kibocommerce/src/api/utils/get-anonymous-shopper-token.ts @@ -0,0 +1,13 @@ +import type { KiboCommerceConfig } from '../' +import { getAnonymousShopperTokenQuery } from '../queries/get-anonymous-shopper-token-query' + +async function getAnonymousShopperToken({ + config, +}: { + config: KiboCommerceConfig +}): Promise { + const { data } = await config.fetch(getAnonymousShopperTokenQuery) + return data?.getAnonymousShopperToken +} + +export default getAnonymousShopperToken diff --git a/packages/kibocommerce/src/api/utils/get-customer-id.ts b/packages/kibocommerce/src/api/utils/get-customer-id.ts new file mode 100644 index 000000000..5ba3d7787 --- /dev/null +++ b/packages/kibocommerce/src/api/utils/get-customer-id.ts @@ -0,0 +1,26 @@ +import type { KiboCommerceConfig } from '..' +import { getCustomerAccountQuery } from '../queries/get-customer-account-query' + +async function getCustomerId({ + customerToken, + config, +}: { + customerToken: string + config: KiboCommerceConfig +}): Promise { + const token = customerToken ? Buffer.from(customerToken, 'base64').toString('ascii'): null; + const accessToken = token ? JSON.parse(token).accessToken : null; + const { data } = await config.fetch( + getCustomerAccountQuery, + undefined, + { + headers: { + 'x-vol-user-claims': accessToken, + }, + } + ) + + return data?.customerAccount?.id +} + +export default getCustomerId diff --git a/framework/reactioncommerce/auth/index.ts b/packages/kibocommerce/src/auth/index.ts similarity index 100% rename from framework/reactioncommerce/auth/index.ts rename to packages/kibocommerce/src/auth/index.ts diff --git a/packages/kibocommerce/src/auth/use-login.tsx b/packages/kibocommerce/src/auth/use-login.tsx new file mode 100644 index 000000000..c9d1fac17 --- /dev/null +++ b/packages/kibocommerce/src/auth/use-login.tsx @@ -0,0 +1,43 @@ +import { MutationHook } from '@vercel/commerce/utils/types' +import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login' + +import { useCallback } from 'react' +import { CommerceError } from '@vercel/commerce/utils/errors' +import type { LoginHook } from '../types/login' +import useCustomer from '../customer/use-customer' +import useCart from '../cart/use-cart' +export default useLogin as UseLogin + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/login', + method: 'POST', + }, + async fetcher({ input: { email, password }, options, fetch }) { + if (!(email && password)) { + throw new CommerceError({ + message: 'An email and password are required to login', + }) + } + + return fetch({ + ...options, + body: { email, password }, + }) + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCustomer() + const { mutate: mutateCart } = useCart() + return useCallback( + async function login(input) { + const data = await fetch({ input }) + await mutate() + await mutateCart() + return data + }, + [fetch, mutate, mutateCart] + ) + }, +} diff --git a/packages/kibocommerce/src/auth/use-logout.tsx b/packages/kibocommerce/src/auth/use-logout.tsx new file mode 100644 index 000000000..83e5a4b0c --- /dev/null +++ b/packages/kibocommerce/src/auth/use-logout.tsx @@ -0,0 +1,29 @@ +import { useCallback } from 'react' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout' +import type { LogoutHook } from '../types/logout' +import useCustomer from '../customer/use-customer' +import useCart from '../cart/use-cart' + +export default useLogout as UseLogout + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/logout', + method: 'GET', + }, + useHook: ({ fetch }) => () => { + const { mutate } = useCustomer() + const { mutate: mutateCart } = useCart() + + return useCallback( + async function logout() { + const data = await fetch() + await mutate(null, false) + await mutateCart(null, false) + return data + }, + [fetch, mutate, mutateCart] + ) + }, +} diff --git a/packages/kibocommerce/src/auth/use-signup.tsx b/packages/kibocommerce/src/auth/use-signup.tsx new file mode 100644 index 000000000..b06126df6 --- /dev/null +++ b/packages/kibocommerce/src/auth/use-signup.tsx @@ -0,0 +1,46 @@ +import { useCallback } from 'react' +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 type { SignupHook } from '../types/signup' +import useCustomer from '../customer/use-customer' + +export default useSignup as UseSignup + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/signup', + method: 'POST', + }, + async fetcher({ + input: { firstName, lastName, email, password }, + options, + fetch, + }) { + if (!(firstName && lastName && email && password)) { + throw new CommerceError({ + message: + 'A first name, last name, email and password are required to signup', + }) + } + + return fetch({ + ...options, + body: { firstName, lastName, email, password }, + }) + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCustomer() + + return useCallback( + async function signup(input) { + const data = await fetch({ input }) + await mutate() + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/framework/vendure/cart/index.ts b/packages/kibocommerce/src/cart/index.ts similarity index 100% rename from framework/vendure/cart/index.ts rename to packages/kibocommerce/src/cart/index.ts diff --git a/packages/kibocommerce/src/cart/use-add-item.tsx b/packages/kibocommerce/src/cart/use-add-item.tsx new file mode 100644 index 000000000..f65e82bc7 --- /dev/null +++ b/packages/kibocommerce/src/cart/use-add-item.tsx @@ -0,0 +1,46 @@ +import { useCallback } from 'react' +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 type { AddItemHook } from '@vercel/commerce/types/cart' +import useCart from './use-cart' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/cart', + method: 'POST', + }, + async fetcher({ input: item, options, fetch }) { + if ( + item.quantity && + (!Number.isInteger(item.quantity) || item.quantity! < 1) + ) { + throw new CommerceError({ + message: 'The item quantity has to be a valid integer greater than 0', + }) + } + + const data = await fetch({ + ...options, + body: { item }, + }) + + return data + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCart() + + return useCallback( + async function addItem(input) { + const data = await fetch({ input }) + await mutate(data, false) + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/kibocommerce/src/cart/use-cart.tsx b/packages/kibocommerce/src/cart/use-cart.tsx new file mode 100644 index 000000000..2d4924341 --- /dev/null +++ b/packages/kibocommerce/src/cart/use-cart.tsx @@ -0,0 +1,35 @@ +import { useMemo } from 'react' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCart, { UseCart } from '@vercel/commerce/cart/use-cart' + +export default useCart as UseCart + +export const handler: SWRHook = { + fetchOptions: { + method: 'GET', + url: '/api/cart', + }, + async fetcher({ options, fetch }) { + return await fetch({ ...options }) + }, + useHook: + ({ useData }) => + (input) => { + const response = useData({ + swrOptions: { revalidateOnFocus: false, ...input?.swrOptions }, + }) + + return useMemo( + () => + Object.create(response, { + isEmpty: { + get() { + return (response.data?.lineItems.length ?? 0) <= 0 + }, + enumerable: true, + }, + }), + [response] + ) + }, +} diff --git a/packages/kibocommerce/src/cart/use-remove-item.tsx b/packages/kibocommerce/src/cart/use-remove-item.tsx new file mode 100644 index 000000000..8bea34f41 --- /dev/null +++ b/packages/kibocommerce/src/cart/use-remove-item.tsx @@ -0,0 +1,54 @@ +import { useCallback } from 'react' +import type { + MutationHookContext, + HookFetcherContext, +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' +import useRemoveItem, { UseRemoveItem } from '@vercel/commerce/cart/use-remove-item' +import type { Cart, LineItem, RemoveItemHook } from '@vercel/commerce/types/cart' +import useCart from './use-cart' + +export type RemoveItemFn = T extends LineItem + ? (input?: RemoveItemActionInput) => Promise + : (input: RemoveItemActionInput) => Promise + +export type RemoveItemActionInput = T extends LineItem + ? Partial + : RemoveItemHook['actionInput'] + +export default useRemoveItem as UseRemoveItem + +export const handler = { + fetchOptions: { + url: '/api/cart', + method: 'DELETE', + }, + async fetcher({ + input: { itemId }, + options, + fetch, + }: HookFetcherContext) { + return await fetch({ ...options, body: { itemId } }) + }, + useHook: + ({ fetch }: MutationHookContext) => + (ctx: { item?: T } = {}) => { + const { item } = ctx + const { mutate } = useCart() + const removeItem: RemoveItemFn = async (input) => { + const itemId = input?.id ?? item?.id + + if (!itemId) { + throw new ValidationError({ + message: 'Invalid input used for this operation', + }) + } + + const data = await fetch({ input: { itemId } }) + await mutate(data, false) + return data + } + + return useCallback(removeItem as RemoveItemFn, [fetch, mutate]) + }, +} diff --git a/packages/kibocommerce/src/cart/use-update-item.tsx b/packages/kibocommerce/src/cart/use-update-item.tsx new file mode 100644 index 000000000..b15690ed7 --- /dev/null +++ b/packages/kibocommerce/src/cart/use-update-item.tsx @@ -0,0 +1,84 @@ +import { useCallback } from 'react' +import debounce from 'lodash.debounce' +import type { + MutationHookContext, + HookFetcherContext, +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' +import useUpdateItem, { UseUpdateItem } from '@vercel/commerce/cart/use-update-item' +import type { LineItem, UpdateItemHook } from '@vercel/commerce/types/cart' +import { handler as removeItemHandler } from './use-remove-item' +import useCart from './use-cart' + +export type UpdateItemActionInput = T extends LineItem + ? Partial + : UpdateItemHook['actionInput'] + +export default useUpdateItem as UseUpdateItem + +export const handler = { + fetchOptions: { + url: '/api/cart', + method: 'PUT', + }, + async fetcher({ + input: { itemId, item }, + options, + fetch, + }: HookFetcherContext) { + if (Number.isInteger(item.quantity)) { + // Also allow the update hook to remove an item if the quantity is lower than 1 + if (item.quantity! < 1) { + return removeItemHandler.fetcher({ + options: removeItemHandler.fetchOptions, + input: { itemId }, + fetch, + }) + } + } else if (item.quantity) { + throw new ValidationError({ + message: 'The item quantity has to be a valid integer', + }) + } + + return await fetch({ + ...options, + body: { itemId, item }, + }) + }, + useHook: + ({ fetch }: MutationHookContext) => + ( + ctx: { + item?: T + wait?: number + } = {} + ) => { + const { item } = ctx + const { mutate } = useCart() as any + + return useCallback( + debounce(async (input: UpdateItemActionInput) => { + const itemId = input.id ?? item?.id + const productId = input.productId ?? item?.productId + const variantId = input.productId ?? item?.variantId + + if (!itemId || !productId || !variantId) { + throw new ValidationError({ + message: 'Invalid input used for this operation', + }) + } + + const data = await fetch({ + input: { + itemId, + item: { productId, variantId, quantity: input.quantity }, + }, + }) + await mutate(data, false) + return data + }, ctx.wait ?? 500), + [fetch, mutate] + ) + }, +} diff --git a/packages/kibocommerce/src/checkout/use-checkout.tsx b/packages/kibocommerce/src/checkout/use-checkout.tsx new file mode 100644 index 000000000..cab52bb60 --- /dev/null +++ b/packages/kibocommerce/src/checkout/use-checkout.tsx @@ -0,0 +1,14 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { UseCheckout } from '@vercel/commerce/checkout/use-checkout' + +export default useCheckout as UseCheckout + +export const handler: SWRHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ useData }) => + async (input) => ({}), +} diff --git a/packages/kibocommerce/src/commerce.config.json b/packages/kibocommerce/src/commerce.config.json new file mode 100644 index 000000000..cd58f1e29 --- /dev/null +++ b/packages/kibocommerce/src/commerce.config.json @@ -0,0 +1,9 @@ +{ + "provider": "kibocommerce", + "features": { + "wishlist": true, + "cart": true, + "search": true, + "customerAuth": true + } +} \ No newline at end of file diff --git a/packages/kibocommerce/src/customer/address/use-add-item.tsx b/packages/kibocommerce/src/customer/address/use-add-item.tsx new file mode 100644 index 000000000..fabd11b1d --- /dev/null +++ b/packages/kibocommerce/src/customer/address/use-add-item.tsx @@ -0,0 +1,15 @@ +import useAddItem, { UseAddItem } from '@vercel/commerce/customer/address/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/packages/kibocommerce/src/customer/card/use-add-item.tsx b/packages/kibocommerce/src/customer/card/use-add-item.tsx new file mode 100644 index 000000000..938e6cd61 --- /dev/null +++ b/packages/kibocommerce/src/customer/card/use-add-item.tsx @@ -0,0 +1,15 @@ +import useAddItem, { UseAddItem } from '@vercel/commerce/customer/card/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/framework/reactioncommerce/customer/index.ts b/packages/kibocommerce/src/customer/index.ts similarity index 100% rename from framework/reactioncommerce/customer/index.ts rename to packages/kibocommerce/src/customer/index.ts diff --git a/packages/kibocommerce/src/customer/use-customer.tsx b/packages/kibocommerce/src/customer/use-customer.tsx new file mode 100644 index 000000000..36bf88617 --- /dev/null +++ b/packages/kibocommerce/src/customer/use-customer.tsx @@ -0,0 +1,26 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useCustomer, { UseCustomer } from '@vercel/commerce/customer/use-customer' +import type { CustomerHook } from '../types/customer' + +export default useCustomer as UseCustomer + +export const handler: SWRHook = { + fetchOptions: { + url: '/api/customer', + method: 'GET', + }, + async fetcher({ options, fetch }) { + const data = await fetch(options) + return data?.customer ?? null + }, + useHook: + ({ useData }) => + (input) => { + return useData({ + swrOptions: { + revalidateOnFocus: false, + ...input?.swrOptions, + }, + }) + }, +} diff --git a/packages/kibocommerce/src/fetcher.ts b/packages/kibocommerce/src/fetcher.ts new file mode 100644 index 000000000..bc8a6b9aa --- /dev/null +++ b/packages/kibocommerce/src/fetcher.ts @@ -0,0 +1,41 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { Fetcher } from '@vercel/commerce/utils/types' + +async function getText(res: Response) { + try { + return (await res.text()) || res.statusText + } catch (error) { + return res.statusText + } +} + +async function getError(res: Response) { + if (res.headers.get('Content-Type')?.includes('application/json')) { + const data = await res.json() + return new FetcherError({ errors: data.errors, status: res.status }) + } + return new FetcherError({ message: await getText(res), status: res.status }) +} + +const fetcher: Fetcher = async ({ + url, + method = 'GET', + variables, + body: bodyObj, +}) => { + const hasBody = Boolean(variables || bodyObj) + const body = hasBody + ? JSON.stringify(variables ? { variables } : bodyObj) + : undefined + const headers = hasBody ? { 'Content-Type': 'application/json' } : undefined + const res = await fetch(url!, { method, body, headers }) + + if (res.ok) { + const { data } = await res.json() + return data + } + + throw await getError(res) +} + +export default fetcher diff --git a/packages/kibocommerce/src/index.tsx b/packages/kibocommerce/src/index.tsx new file mode 100644 index 000000000..43077a535 --- /dev/null +++ b/packages/kibocommerce/src/index.tsx @@ -0,0 +1,9 @@ +import { getCommerceProvider, useCommerce as useCoreCommerce } from '@vercel/commerce' +import { kiboCommerceProvider, KibocommerceProvider } from './provider' + +export { kiboCommerceProvider } +export type { KibocommerceProvider } + +export const CommerceProvider = getCommerceProvider(kiboCommerceProvider) + +export const useCommerce = () => useCoreCommerce() diff --git a/packages/kibocommerce/src/lib/get-cookie-expiration-date.ts b/packages/kibocommerce/src/lib/get-cookie-expiration-date.ts new file mode 100644 index 000000000..89fd24504 --- /dev/null +++ b/packages/kibocommerce/src/lib/get-cookie-expiration-date.ts @@ -0,0 +1,8 @@ +export function getCookieExpirationDate(maxAgeInDays: number){ + const today = new Date(); + const expirationDate = new Date(); + + const cookieExpirationDate = new Date ( expirationDate.setDate(today.getDate() + maxAgeInDays) ) + + return cookieExpirationDate; +} \ No newline at end of file diff --git a/lib/get-slug.ts b/packages/kibocommerce/src/lib/get-slug.ts similarity index 100% rename from lib/get-slug.ts rename to packages/kibocommerce/src/lib/get-slug.ts diff --git a/packages/kibocommerce/src/lib/immutability.ts b/packages/kibocommerce/src/lib/immutability.ts new file mode 100644 index 000000000..488d3570f --- /dev/null +++ b/packages/kibocommerce/src/lib/immutability.ts @@ -0,0 +1,13 @@ +import update, { Context } from 'immutability-helper' + +const c = new Context() + +c.extend('$auto', function (value, object) { + return object ? c.update(object, value) : c.update({}, value) +}) + +c.extend('$autoArray', function (value, object) { + return object ? c.update(object, value) : c.update([], value) +}) + +export default c.update diff --git a/packages/kibocommerce/src/lib/normalize.ts b/packages/kibocommerce/src/lib/normalize.ts new file mode 100644 index 000000000..00d0a44c7 --- /dev/null +++ b/packages/kibocommerce/src/lib/normalize.ts @@ -0,0 +1,194 @@ +import update from './immutability' +import getSlug from './get-slug' +import type { PrCategory, CustomerAccountInput, Document } from '../../schema' +import { Page } from '../types/page'; +import { Customer } from '../types/customer' + +function normalizeProductOption(productOption: any) { + const { + node: { entityId, values: { edges = [] } = {}, ...rest }, + } = productOption + + return { + id: entityId, + values: edges?.map(({ node }: any) => node), + ...rest, + } +} + +export function normalizeProduct(productNode: any, config: any): any { + const product = { + id: productNode.productCode, + name: productNode.content.productName, + vendor: '', + path: `/${productNode.productCode}`, + slug: productNode.productCode, + price: { + value: productNode?.price?.price, + currencyCode: config.currencyCode, + }, + descriptionHtml: productNode.content.productShortDescription, + + images: productNode.content.productImages.map((p: any) => ({ + url: `http:${p.imageUrl}`, + altText: p.imageLabel, + })), + + variants: productNode.variations?.map((v: any) => ({ + id: v.productCode, + options: v.options.map((o: any) => ({ + ['__typename']: 'MultipleChoiceOption', + id: o.attributeFQN, + displayName: + o.attributeFQN.split('~')[1][0].toUpperCase() + + o.attributeFQN.split('~')[1].slice(1).toLowerCase(), + values: [{ label: o.value.toString() }], + })), + })) || [ + { + id: '', + }, + ], + + options: + productNode.options?.map((o: any) => ({ + id: o.attributeFQN, + displayName: o.attributeDetail.name, + values: o.values.map((v: any) => ({ + label: v.value.toString(), + hexColors: '', + })), + })) || [], + } + + return product +} + +export function normalizePage(page: Document): Page { + return { + id: String(page.id), + name: String(page.name), + url: page.properties.url, + body: page.properties.body, + is_visible: page.properties.is_visible, + sort_order: page.properties.sort_order + } +} + +export function normalizeCart(data: any): any { + return { + id: data.id, + customerId: data.userId, + email: data?.email, + createdAt: data?.created_time, + currency: { + code: 'USD', + }, + taxesIncluded: true, + lineItems: data.items.map(normalizeLineItem), + lineItemsSubtotalPrice: data?.items.reduce( + (acc: number, obj: { subtotal: number }) => acc + obj.subtotal, + 0 + ), + subtotalPrice: data?.subtotal, + totalPrice: data?.total, + discounts: data.orderDiscounts?.map((discount: any) => ({ + value: discount.impact, + })), + } +} + +export function normalizeCustomer(customer: CustomerAccountInput): Customer { + return { + id: customer.id, + firstName: customer.firstName, + lastName: customer.lastName, + email: customer.emailAddress, + userName: customer.userName, + isAnonymous: customer.isAnonymous + } +} + +function normalizeLineItem(item: any): any { + return { + id: item.id, + variantId: item.product.variationProductCode, + productId: String(item.product.productCode), + name: item.product.name, + quantity: item.quantity, + variant: { + id: item.product.variationProductCode, + sku: item.product?.sku, + name: item.product.name, + image: { + url: item?.product?.imageUrl, + }, + requiresShipping: item?.is_require_shipping, + price: item?.unitPrice.extendedAmount, + listPrice: 0, + }, + options: item.product.options, + path: `${item.product.productCode}`, + discounts: item?.discounts?.map((discount: any) => ({ + value: discount.discounted_amount, + })), + } +} + +export function normalizeCategory(category: PrCategory): any { + return { + id: category?.categoryCode, + name: category?.content?.name, + slug: category?.content?.slug, + path: `/${category?.content?.slug}`, + } +} + +export function normalizeWishlistItem( + item: any, + config: any, + includeProducts=false +): any { + if (includeProducts) { + return { + id: item.id, + product: getProuducts(item, config), + } + } else { + return getProuducts(item, config) + } +} + +function getProuducts(item: any, config: any): any { + return { + variant_id: item.product.variationProductCode || '', + id: String(item.product.productCode), + product_id: String(item.product.productCode), + name: item.product.name, + quantity: item.quantity, + images: [ + { + url: `http:${item.product.imageUrl}`, + alt: item.product.imageAlternateText, + }, + ], + price: { + value: item.product.price.price, + retailPrice: item.product.price.retailPrice || 0, + currencyCode: config.currencyCode, + }, + variants: [ + { + id: item.product.variationProductCode || '', + sku: item.product?.sku, + name: item.product.name, + image: { + url: item?.product.imageUrl, + }, + }, + ], + options: item.product.options, + path: `/${item.product.productCode}`, + description: item.product.description, + } +} diff --git a/packages/kibocommerce/src/lib/prepare-set-cookie.ts b/packages/kibocommerce/src/lib/prepare-set-cookie.ts new file mode 100644 index 000000000..c1aeb1c83 --- /dev/null +++ b/packages/kibocommerce/src/lib/prepare-set-cookie.ts @@ -0,0 +1,15 @@ +export function prepareSetCookie(name: string, value: string, options: any = {}): string { + const encodedValue = Buffer.from(value).toString('base64') + const cookieValue = [`${name}=${encodedValue}`]; + + if (options.maxAge) { + cookieValue.push(`Max-Age=${options.maxAge}`); + } + + if (options.expires && !options.maxAge) { + cookieValue.push(`Expires=${options.expires.toUTCString()}`); + } + + const cookie = cookieValue.join('; ') + return cookie +} \ No newline at end of file diff --git a/packages/kibocommerce/src/lib/product-search-vars.ts b/packages/kibocommerce/src/lib/product-search-vars.ts new file mode 100644 index 000000000..37c4d81eb --- /dev/null +++ b/packages/kibocommerce/src/lib/product-search-vars.ts @@ -0,0 +1,55 @@ +function getFacetValueFilter(categoryCode: string, filters = []) { + let facetValueFilter = ''; + if (categoryCode) { + facetValueFilter = `categoryCode:${categoryCode},`; + } + return facetValueFilter + filters.join(','); +} + +export const buildProductSearchVars = ({ + categoryCode = '', + pageSize = 5, + filters = {} as any, + startIndex = 0, + sort = '', + search = '', +}) => { + let facetTemplate = ''; + let filter = ''; + let sortBy; + if (categoryCode) { + facetTemplate = `categoryCode:${categoryCode}`; + filter = `categoryCode req ${categoryCode}`; + } + const facetFilterList = Object.keys(filters).filter(k => filters[k].length).reduce((accum, k): any => { + return [...accum, ...filters[k].map((facetValue: any) => `Tenant~${k}:${facetValue}`)]; + }, []); + + const facetValueFilter = getFacetValueFilter(categoryCode, facetFilterList); + + switch(sort) { + case 'latest-desc': + sortBy= 'createDate desc'; + break; + case 'price-asc': + sortBy= 'price asc'; + break; + case 'price-desc': + sortBy= 'price desc'; + break; + case 'trending-desc': + default: + sortBy= ''; + break; + } + + return { + query: search, + startIndex, + pageSize, + sortBy, + filter: filter, + facetTemplate, + facetValueFilter + } +} diff --git a/packages/kibocommerce/src/lib/set-cookie.ts b/packages/kibocommerce/src/lib/set-cookie.ts new file mode 100644 index 000000000..2c194c921 --- /dev/null +++ b/packages/kibocommerce/src/lib/set-cookie.ts @@ -0,0 +1,3 @@ +export function setCookies(res: any, cookies: string[]): void { + res.setHeader('Set-Cookie', cookies); +} \ No newline at end of file diff --git a/packages/kibocommerce/src/next.config.cjs b/packages/kibocommerce/src/next.config.cjs new file mode 100644 index 000000000..79a348c88 --- /dev/null +++ b/packages/kibocommerce/src/next.config.cjs @@ -0,0 +1,12 @@ +const commerce = require('./commerce.config.json') + +module.exports = { + commerce, + serverRuntimeConfig: { + // Will only be available on the server side + kiboAuthTicket: null + }, + images: { + domains: ['d1slj7rdbjyb5l.cloudfront.net', 'cdn-tp1.mozu.com', 'cdn-sb.mozu.com'], + }, +} diff --git a/framework/swell/product/index.ts b/packages/kibocommerce/src/product/index.ts similarity index 100% rename from framework/swell/product/index.ts rename to packages/kibocommerce/src/product/index.ts diff --git a/packages/kibocommerce/src/product/use-price.tsx b/packages/kibocommerce/src/product/use-price.tsx new file mode 100644 index 000000000..fd42d7033 --- /dev/null +++ b/packages/kibocommerce/src/product/use-price.tsx @@ -0,0 +1,2 @@ +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/packages/kibocommerce/src/product/use-search.tsx b/packages/kibocommerce/src/product/use-search.tsx new file mode 100644 index 000000000..4a9107b4a --- /dev/null +++ b/packages/kibocommerce/src/product/use-search.tsx @@ -0,0 +1,37 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useSearch, { UseSearch } from '@vercel/commerce/product/use-search' +export default useSearch as UseSearch + +export const handler: SWRHook = { + fetchOptions: { + method: 'GET', + url: '/api/catalog/products', + }, + fetcher({ input: { search, categoryId, brandId, sort }, options, fetch }) { + // Use a dummy base as we only care about the relative path + const url = new URL(options.url!, 'http://a') + + if (search) url.searchParams.set('search', search) + if (Number.isInteger(Number(categoryId))) + url.searchParams.set('categoryId', String(categoryId)) + if (Number.isInteger(brandId)) + url.searchParams.set('brandId', String(brandId)) + if (sort) url.searchParams.set('sort', sort) + + return fetch({ + url: url.pathname + url.search, + method: options.method, + }) + }, + useHook: ({ useData }) => (input) => { + return useData({ + input: [ + ['search', input.search], + ['categoryId', input.categoryId], + ['brandId', input.brandId], + ['sort', input.sort], + ], + swrOptions: { revalidateOnFocus: false, ...input?.swrOptions }, + }) + }, +} diff --git a/packages/kibocommerce/src/provider.ts b/packages/kibocommerce/src/provider.ts new file mode 100644 index 000000000..8ca1ddfde --- /dev/null +++ b/packages/kibocommerce/src/provider.ts @@ -0,0 +1,30 @@ +import fetcher from './fetcher' +import { handler as useCart } from './cart/use-cart' +import { handler as useAddItem } from './cart/use-add-item' +import { handler as useUpdateItem } from './cart/use-update-item' +import { handler as useRemoveItem } from './cart/use-remove-item' +import { handler as useCustomer } from './customer/use-customer' +import { handler as useSearch } from './product/use-search' +import { handler as useLogin } from './auth/use-login' +import { handler as useLogout } from './auth/use-logout' +import { handler as useSignup } from './auth/use-signup' +import { handler as useWishlist } from './wishlist/use-wishlist' +import { handler as useWishlistAddItem } from './wishlist/use-add-item' +import { handler as useWishlistRemoveItem } from './wishlist/use-remove-item' + +export const kiboCommerceProvider = { + locale: 'en-us', + cartCookie: 'kibo_cart', + fetcher, + cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, + wishlist: { + useWishlist, + useAddItem: useWishlistAddItem, + useRemoveItem: useWishlistRemoveItem, + }, + customer: { useCustomer }, + products: { useSearch }, + auth: { useLogin, useLogout, useSignup }, +} + +export type KibocommerceProvider = typeof kiboCommerceProvider diff --git a/packages/kibocommerce/src/types/customer.ts b/packages/kibocommerce/src/types/customer.ts new file mode 100644 index 000000000..29f68fef1 --- /dev/null +++ b/packages/kibocommerce/src/types/customer.ts @@ -0,0 +1,27 @@ +import * as Core from '@vercel/commerce/types/customer' +export type Maybe = T | null +export * from '@vercel/commerce/types/customer' +export type Scalars = { + ID: string + String: string + Boolean: boolean + Int: number + Float: number + /** The `AnyScalar` type allows any scalar value by examining the input and passing the serialize, parseValue, and parseLiteral operations to their respective types. */ + AnyScalar: any + /** DateTime custom scalar type */ + DateTime: any + /** Object custom scalar type */ + Object: any +} + +export type Customer = { + id: Scalars['Int'], + firstName?: Maybe, + lastName?: Maybe, + email?: Maybe, + userName?: Maybe, + isAnonymous?: Maybe +} + +export type CustomerSchema = Core.CustomerSchema diff --git a/packages/kibocommerce/src/types/login.ts b/packages/kibocommerce/src/types/login.ts new file mode 100644 index 000000000..2e7b198b2 --- /dev/null +++ b/packages/kibocommerce/src/types/login.ts @@ -0,0 +1,8 @@ +import * as Core from '@vercel/commerce/types/login' +import type { CustomerUserAuthInfoInput } from '../../schema' + +export * from '@vercel/commerce/types/login' + +export type LoginOperation = Core.LoginOperation & { + variables: CustomerUserAuthInfoInput +} diff --git a/packages/kibocommerce/src/types/logout.ts b/packages/kibocommerce/src/types/logout.ts new file mode 100644 index 000000000..1de06f8dc --- /dev/null +++ b/packages/kibocommerce/src/types/logout.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/logout' diff --git a/packages/kibocommerce/src/types/page.ts b/packages/kibocommerce/src/types/page.ts new file mode 100644 index 000000000..f311eb8b8 --- /dev/null +++ b/packages/kibocommerce/src/types/page.ts @@ -0,0 +1,35 @@ +import * as Core from '@vercel/commerce/types/page' +export type Maybe = T | null +export type Scalars = { + ID: string + String: string + Boolean: boolean + Int: number + Float: number + /** The `AnyScalar` type allows any scalar value by examining the input and passing the serialize, parseValue, and parseLiteral operations to their respective types. */ + AnyScalar: any + /** DateTime custom scalar type */ + DateTime: any + /** Object custom scalar type */ + Object: any +} + +export * from '@vercel/commerce/types/page' + +export type Page = Core.Page + +export type PageTypes = { + page: Page +} + +export type GetPagesQueryParams = { + documentListName: Maybe +} + +export type GetPageQueryParams = { + id: Maybe + documentListName: Maybe +} + +export type GetAllPagesOperation = Core.GetAllPagesOperation +export type GetPageOperation = Core.GetPageOperation diff --git a/packages/kibocommerce/src/types/signup.ts b/packages/kibocommerce/src/types/signup.ts new file mode 100644 index 000000000..3f0d1af5a --- /dev/null +++ b/packages/kibocommerce/src/types/signup.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/signup' diff --git a/packages/kibocommerce/src/wishlist/index.ts b/packages/kibocommerce/src/wishlist/index.ts new file mode 100644 index 000000000..241af3c7e --- /dev/null +++ b/packages/kibocommerce/src/wishlist/index.ts @@ -0,0 +1,3 @@ +export { default as useAddItem } from './use-add-item' +export { default as useWishlist } from './use-wishlist' +export { default as useRemoveItem } from './use-remove-item' diff --git a/packages/kibocommerce/src/wishlist/use-add-item.tsx b/packages/kibocommerce/src/wishlist/use-add-item.tsx new file mode 100644 index 000000000..3f634e31e --- /dev/null +++ b/packages/kibocommerce/src/wishlist/use-add-item.tsx @@ -0,0 +1,38 @@ +import { useCallback } from 'react' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useAddItem, { UseAddItem } from '@vercel/commerce/wishlist/use-add-item' +import type { AddItemHook } from '@vercel/commerce/types/wishlist' +import useCustomer from '../customer/use-customer' +import useWishlist from './use-wishlist' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/wishlist', + method: 'POST', + }, + useHook: + ({ fetch }) => + () => { + const { data: customer } = useCustomer() + const { mutate } = useWishlist() + + return useCallback( + async function addItem(item) { + if (!customer) { + // A signed customer is required in order to have a wishlist + throw new CommerceError({ + message: 'Signed customer not found', + }) + } + // TODO: add validations before doing the fetch + const data = await fetch({ input: { item } }) + await mutate() + return data + }, + [fetch, mutate, customer] + ) + }, +} diff --git a/packages/kibocommerce/src/wishlist/use-remove-item.tsx b/packages/kibocommerce/src/wishlist/use-remove-item.tsx new file mode 100644 index 000000000..490154a45 --- /dev/null +++ b/packages/kibocommerce/src/wishlist/use-remove-item.tsx @@ -0,0 +1,40 @@ +import { useCallback } from 'react' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useRemoveItem, { + UseRemoveItem, +} from '@vercel/commerce/wishlist/use-remove-item' +import type { RemoveItemHook } from '@vercel/commerce/types/wishlist' +import useCustomer from '../customer/use-customer' +import useWishlist from './use-wishlist' + +export default useRemoveItem as UseRemoveItem + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/wishlist', + method: 'DELETE', + }, + useHook: + ({ fetch }) => + ({ wishlist } = {}) => { + const { data: customer } = useCustomer() + const { mutate } = useWishlist(wishlist) + + return useCallback( + async function removeItem(input) { + if (!customer) { + // A signed customer is required in order to have a wishlist + throw new CommerceError({ + message: 'Signed customer not found', + }) + } + + const data = await fetch({ input: { itemId: String(input.id) } }) + await mutate() + return data + }, + [fetch, mutate, customer] + ) + }, +} diff --git a/packages/kibocommerce/src/wishlist/use-wishlist.tsx b/packages/kibocommerce/src/wishlist/use-wishlist.tsx new file mode 100644 index 000000000..371223f73 --- /dev/null +++ b/packages/kibocommerce/src/wishlist/use-wishlist.tsx @@ -0,0 +1,50 @@ +import { useMemo } from 'react' +import { SWRHook } from '@vercel/commerce/utils/types' +import useWishlist, { UseWishlist } from '@vercel/commerce/wishlist/use-wishlist' +import type { GetWishlistHook } from '@vercel/commerce/types/wishlist' +import useCustomer from '../customer/use-customer' + +export default useWishlist as UseWishlist + +export const handler: SWRHook = { + fetchOptions: { + url: '/api/wishlist', + method: 'GET', + }, + fetcher({ input: { customerId, includeProducts}, options, fetch }) { + if (!customerId) return null + // Use a dummy base as we only care about the relative path + const url = new URL(options.url!, 'http://a') + + if (includeProducts) url.searchParams.set('products', '1') + if(customerId) url.searchParams.set('customerId', customerId) + + return fetch({ + url: url.pathname + url.search, + method: options.method, + }) + }, + useHook: ({ useData }) => (input) => { + const { data: customer } = useCustomer() + const response = useData({ + input: [ + ['customerId', customer?.id], + ['includeProducts', input?.includeProducts], + ], + swrOptions: { + revalidateOnFocus: false, + ...input?.swrOptions, + }, + }) + return useMemo( + () => + Object.create(response, { + isEmpty: { + get() { + return (response.data?.items?.length || 0) <= 0 + }, + }), + [response] + ) + }, +} diff --git a/packages/kibocommerce/taskfile.js b/packages/kibocommerce/taskfile.js new file mode 100644 index 000000000..39b1b2a86 --- /dev/null +++ b/packages/kibocommerce/taskfile.js @@ -0,0 +1,20 @@ +export async function build(task, opts) { + await task + .source('src/**/*.+(ts|tsx|js)') + .swc({ dev: opts.dev, outDir: 'dist', baseUrl: 'src' }) + .target('dist') + .source('src/**/*.+(cjs|json)') + .target('dist') + task.$.log('Compiled src files') +} + +export async function release(task) { + await task.clear('dist').start('build') +} + +export default async function dev(task) { + const opts = { dev: true } + await task.clear('dist') + await task.start('build', opts) + await task.watch('src/**/*.+(ts|tsx|js|cjs|json)', 'build', opts) +} diff --git a/packages/kibocommerce/tsconfig.json b/packages/kibocommerce/tsconfig.json new file mode 100644 index 000000000..cd04ab2ff --- /dev/null +++ b/packages/kibocommerce/tsconfig.json @@ -0,0 +1,21 @@ +{ + "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, + "incremental": true, + "jsx": "react-jsx" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/framework/local/.env.template b/packages/local/.env.template similarity index 100% rename from framework/local/.env.template rename to packages/local/.env.template diff --git a/packages/local/.prettierignore b/packages/local/.prettierignore new file mode 100644 index 000000000..f06235c46 --- /dev/null +++ b/packages/local/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/local/.prettierrc b/packages/local/.prettierrc new file mode 100644 index 000000000..e1076edfa --- /dev/null +++ b/packages/local/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/framework/local/README.md b/packages/local/README.md similarity index 100% rename from framework/local/README.md rename to packages/local/README.md diff --git a/packages/local/package.json b/packages/local/package.json new file mode 100644 index 000000000..3ec3e69a4 --- /dev/null +++ b/packages/local/package.json @@ -0,0 +1,79 @@ +{ + "name": "@vercel/commerce-local", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "release": "taskr release", + "build": "taskr build", + "dev": "taskr", + "types": "tsc --emitDeclarationOnly", + "prettier-fix": "prettier --write ." + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], + "./next.config": "./dist/next.config.cjs" + }, + "typesVersions": { + "*": { + "*": [ + "src/*", + "src/*/index" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + }, + "files": [ + "dist" + ], + "publishConfig": { + "typesVersions": { + "*": { + "*": [ + "dist/*.d.ts", + "dist/*/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": { + "@taskr/clear": "^1.1.0", + "@taskr/esnext": "^1.1.0", + "@taskr/watch": "^1.1.0", + "@types/node": "^17.0.8", + "@types/react": "^17.0.38", + "lint-staged": "^12.1.7", + "next": "^12.0.8", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "taskr": "^1.1.0", + "taskr-swc": "^0.0.1", + "typescript": "^4.5.4" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,json}": [ + "prettier --write", + "git add" + ] + } +} diff --git a/framework/vendure/api/endpoints/customer/index.ts b/packages/local/src/api/endpoints/cart/index.ts similarity index 100% rename from framework/vendure/api/endpoints/customer/index.ts rename to packages/local/src/api/endpoints/cart/index.ts diff --git a/framework/vendure/api/endpoints/login/index.ts b/packages/local/src/api/endpoints/catalog/index.ts similarity index 100% rename from framework/vendure/api/endpoints/login/index.ts rename to packages/local/src/api/endpoints/catalog/index.ts diff --git a/framework/vendure/api/endpoints/catalog/products.ts b/packages/local/src/api/endpoints/catalog/products.ts similarity index 100% rename from framework/vendure/api/endpoints/catalog/products.ts rename to packages/local/src/api/endpoints/catalog/products.ts diff --git a/framework/vendure/api/endpoints/logout/index.ts b/packages/local/src/api/endpoints/checkout/index.ts similarity index 100% rename from framework/vendure/api/endpoints/logout/index.ts rename to packages/local/src/api/endpoints/checkout/index.ts diff --git a/framework/reactioncommerce/api/endpoints/customers/signup.ts b/packages/local/src/api/endpoints/customer/address.ts similarity index 100% rename from framework/reactioncommerce/api/endpoints/customers/signup.ts rename to packages/local/src/api/endpoints/customer/address.ts diff --git a/framework/vendure/api/endpoints/signup/index.ts b/packages/local/src/api/endpoints/customer/card.ts similarity index 100% rename from framework/vendure/api/endpoints/signup/index.ts rename to packages/local/src/api/endpoints/customer/card.ts diff --git a/framework/vendure/api/endpoints/wishlist/index.tsx b/packages/local/src/api/endpoints/customer/index.ts similarity index 100% rename from framework/vendure/api/endpoints/wishlist/index.tsx rename to packages/local/src/api/endpoints/customer/index.ts diff --git a/packages/local/src/api/endpoints/login/index.ts b/packages/local/src/api/endpoints/login/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/local/src/api/endpoints/login/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/local/src/api/endpoints/logout/index.ts b/packages/local/src/api/endpoints/logout/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/local/src/api/endpoints/logout/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/local/src/api/endpoints/signup/index.ts b/packages/local/src/api/endpoints/signup/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/local/src/api/endpoints/signup/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/local/src/api/endpoints/wishlist/index.tsx b/packages/local/src/api/endpoints/wishlist/index.tsx new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/local/src/api/endpoints/wishlist/index.tsx @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/framework/local/api/index.ts b/packages/local/src/api/index.ts similarity index 88% rename from framework/local/api/index.ts rename to packages/local/src/api/index.ts index 9f403d2b3..3b24a3045 100644 --- a/framework/local/api/index.ts +++ b/packages/local/src/api/index.ts @@ -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 createFetcher from './utils/fetch-local' import getAllPages from './operations/get-all-pages' diff --git a/framework/local/api/operations/get-all-pages.ts b/packages/local/src/api/operations/get-all-pages.ts similarity index 100% rename from framework/local/api/operations/get-all-pages.ts rename to packages/local/src/api/operations/get-all-pages.ts diff --git a/framework/local/api/operations/get-all-product-paths.ts b/packages/local/src/api/operations/get-all-product-paths.ts similarity index 100% rename from framework/local/api/operations/get-all-product-paths.ts rename to packages/local/src/api/operations/get-all-product-paths.ts diff --git a/framework/local/api/operations/get-all-products.ts b/packages/local/src/api/operations/get-all-products.ts similarity index 72% rename from framework/local/api/operations/get-all-products.ts rename to packages/local/src/api/operations/get-all-products.ts index 21a04559d..2d11950ce 100644 --- a/framework/local/api/operations/get-all-products.ts +++ b/packages/local/src/api/operations/get-all-products.ts @@ -1,6 +1,6 @@ -import { Product } from '@commerce/types/product' -import { GetAllProductsOperation } from '@commerce/types/product' -import type { OperationContext } from '@commerce/api/operations' +import { Product } from '@vercel/commerce/types/product' +import { GetAllProductsOperation } from '@vercel/commerce/types/product' +import type { OperationContext } from '@vercel/commerce/api/operations' import type { LocalConfig, Provider } from '../index' import data from '../../data.json' diff --git a/framework/local/api/operations/get-customer-wishlist.ts b/packages/local/src/api/operations/get-customer-wishlist.ts similarity index 100% rename from framework/local/api/operations/get-customer-wishlist.ts rename to packages/local/src/api/operations/get-customer-wishlist.ts diff --git a/framework/local/api/operations/get-page.ts b/packages/local/src/api/operations/get-page.ts similarity index 100% rename from framework/local/api/operations/get-page.ts rename to packages/local/src/api/operations/get-page.ts diff --git a/framework/local/api/operations/get-product.ts b/packages/local/src/api/operations/get-product.ts similarity index 73% rename from framework/local/api/operations/get-product.ts rename to packages/local/src/api/operations/get-product.ts index 690b1aab9..b77be3acb 100644 --- a/framework/local/api/operations/get-product.ts +++ b/packages/local/src/api/operations/get-product.ts @@ -1,8 +1,8 @@ import type { LocalConfig } from '../index' -import { Product } from '@commerce/types/product' -import { GetProductOperation } from '@commerce/types/product' +import { Product } from '@vercel/commerce/types/product' +import { GetProductOperation } from '@vercel/commerce/types/product' import data from '../../data.json' -import type { OperationContext } from '@commerce/api/operations' +import type { OperationContext } from '@vercel/commerce/api/operations' export default function getProductOperation({ commerce, diff --git a/framework/local/api/operations/get-site-info.ts b/packages/local/src/api/operations/get-site-info.ts similarity index 87% rename from framework/local/api/operations/get-site-info.ts rename to packages/local/src/api/operations/get-site-info.ts index d43ed8359..c07a479cb 100644 --- a/framework/local/api/operations/get-site-info.ts +++ b/packages/local/src/api/operations/get-site-info.ts @@ -1,5 +1,5 @@ -import { OperationContext } from '@commerce/api/operations' -import { Category } from '@commerce/types/site' +import { OperationContext } from '@vercel/commerce/api/operations' +import { Category } from '@vercel/commerce/types/site' import { LocalConfig } from '../index' export type GetSiteInfoResult< diff --git a/packages/local/src/api/operations/index.ts b/packages/local/src/api/operations/index.ts new file mode 100644 index 000000000..086fdf83a --- /dev/null +++ b/packages/local/src/api/operations/index.ts @@ -0,0 +1,6 @@ +export { default as getPage } from './get-page' +export { default as getSiteInfo } from './get-site-info' +export { default as getAllPages } from './get-all-pages' +export { default as getProduct } from './get-product' +export { default as getAllProducts } from './get-all-products' +export { default as getAllProductPaths } from './get-all-product-paths' diff --git a/framework/local/api/utils/fetch-local.ts b/packages/local/src/api/utils/fetch-local.ts similarity index 87% rename from framework/local/api/utils/fetch-local.ts rename to packages/local/src/api/utils/fetch-local.ts index aa85cf27b..ae84fff8b 100644 --- a/framework/local/api/utils/fetch-local.ts +++ b/packages/local/src/api/utils/fetch-local.ts @@ -1,5 +1,5 @@ -import { FetcherError } from '@commerce/utils/errors' -import type { GraphQLFetcher } from '@commerce/api' +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { GraphQLFetcher } from '@vercel/commerce/api' import type { LocalConfig } from '../index' import fetch from './fetch' diff --git a/framework/local/api/utils/fetch.ts b/packages/local/src/api/utils/fetch.ts similarity index 100% rename from framework/local/api/utils/fetch.ts rename to packages/local/src/api/utils/fetch.ts diff --git a/framework/vendure/auth/index.ts b/packages/local/src/auth/index.ts similarity index 100% rename from framework/vendure/auth/index.ts rename to packages/local/src/auth/index.ts diff --git a/framework/local/auth/use-login.tsx b/packages/local/src/auth/use-login.tsx similarity index 65% rename from framework/local/auth/use-login.tsx rename to packages/local/src/auth/use-login.tsx index 28351dc7f..20e3ed229 100644 --- a/framework/local/auth/use-login.tsx +++ b/packages/local/src/auth/use-login.tsx @@ -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 diff --git a/framework/local/auth/use-logout.tsx b/packages/local/src/auth/use-logout.tsx similarity index 64% rename from framework/local/auth/use-logout.tsx rename to packages/local/src/auth/use-logout.tsx index 9b3fc3e44..4e74908f3 100644 --- a/framework/local/auth/use-logout.tsx +++ b/packages/local/src/auth/use-logout.tsx @@ -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 diff --git a/framework/local/auth/use-signup.tsx b/packages/local/src/auth/use-signup.tsx similarity index 70% rename from framework/local/auth/use-signup.tsx rename to packages/local/src/auth/use-signup.tsx index e9ad13458..e48811403 100644 --- a/framework/local/auth/use-signup.tsx +++ b/packages/local/src/auth/use-signup.tsx @@ -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 diff --git a/packages/local/src/cart/index.ts b/packages/local/src/cart/index.ts new file mode 100644 index 000000000..3b8ba990e --- /dev/null +++ b/packages/local/src/cart/index.ts @@ -0,0 +1,4 @@ +export { default as useCart } from './use-cart' +export { default as useAddItem } from './use-add-item' +export { default as useRemoveItem } from './use-remove-item' +export { default as useUpdateItem } from './use-update-item' diff --git a/framework/local/cart/use-add-item.tsx b/packages/local/src/cart/use-add-item.tsx similarity index 69% rename from framework/local/cart/use-add-item.tsx rename to packages/local/src/cart/use-add-item.tsx index 7f3d1061f..2be6e0aaa 100644 --- a/framework/local/cart/use-add-item.tsx +++ b/packages/local/src/cart/use-add-item.tsx @@ -1,5 +1,5 @@ -import useAddItem, { UseAddItem } from '@commerce/cart/use-add-item' -import { MutationHook } from '@commerce/utils/types' +import useAddItem, { UseAddItem } from '@vercel/commerce/cart/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' export default useAddItem as UseAddItem export const handler: MutationHook = { diff --git a/framework/local/cart/use-cart.tsx b/packages/local/src/cart/use-cart.tsx similarity index 85% rename from framework/local/cart/use-cart.tsx rename to packages/local/src/cart/use-cart.tsx index b3e509a21..8f92de3c9 100644 --- a/framework/local/cart/use-cart.tsx +++ b/packages/local/src/cart/use-cart.tsx @@ -1,6 +1,6 @@ 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 diff --git a/framework/local/cart/use-remove-item.tsx b/packages/local/src/cart/use-remove-item.tsx similarity index 68% rename from framework/local/cart/use-remove-item.tsx rename to packages/local/src/cart/use-remove-item.tsx index b4ed583b8..92d52c997 100644 --- a/framework/local/cart/use-remove-item.tsx +++ b/packages/local/src/cart/use-remove-item.tsx @@ -1,5 +1,7 @@ -import { MutationHook } from '@commerce/utils/types' -import useRemoveItem, { UseRemoveItem } from '@commerce/cart/use-remove-item' +import { MutationHook } from '@vercel/commerce/utils/types' +import useRemoveItem, { + UseRemoveItem, +} from '@vercel/commerce/cart/use-remove-item' export default useRemoveItem as UseRemoveItem diff --git a/framework/local/cart/use-update-item.tsx b/packages/local/src/cart/use-update-item.tsx similarity index 66% rename from framework/local/cart/use-update-item.tsx rename to packages/local/src/cart/use-update-item.tsx index 06d703f70..950f422e1 100644 --- a/framework/local/cart/use-update-item.tsx +++ b/packages/local/src/cart/use-update-item.tsx @@ -1,5 +1,7 @@ -import { MutationHook } from '@commerce/utils/types' -import useUpdateItem, { UseUpdateItem } from '@commerce/cart/use-update-item' +import { MutationHook } from '@vercel/commerce/utils/types' +import useUpdateItem, { + UseUpdateItem, +} from '@vercel/commerce/cart/use-update-item' export default useUpdateItem as UseUpdateItem diff --git a/packages/local/src/checkout/use-checkout.tsx b/packages/local/src/checkout/use-checkout.tsx new file mode 100644 index 000000000..76997be73 --- /dev/null +++ b/packages/local/src/checkout/use-checkout.tsx @@ -0,0 +1,16 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { + UseCheckout, +} from '@vercel/commerce/checkout/use-checkout' + +export default useCheckout as UseCheckout + +export const handler: SWRHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ useData }) => + async (input) => ({}), +} diff --git a/framework/local/commerce.config.json b/packages/local/src/commerce.config.json similarity index 66% rename from framework/local/commerce.config.json rename to packages/local/src/commerce.config.json index 261211527..0e77dd14f 100644 --- a/framework/local/commerce.config.json +++ b/packages/local/src/commerce.config.json @@ -4,6 +4,7 @@ "wishlist": false, "cart": false, "search": false, - "customerAuth": false + "customerAuth": false, + "customCheckout": false } } diff --git a/packages/local/src/customer/address/use-add-item.tsx b/packages/local/src/customer/address/use-add-item.tsx new file mode 100644 index 000000000..4f85c8472 --- /dev/null +++ b/packages/local/src/customer/address/use-add-item.tsx @@ -0,0 +1,17 @@ +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/address/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/packages/local/src/customer/card/use-add-item.tsx b/packages/local/src/customer/card/use-add-item.tsx new file mode 100644 index 000000000..77d149eff --- /dev/null +++ b/packages/local/src/customer/card/use-add-item.tsx @@ -0,0 +1,17 @@ +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/card/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/framework/saleor/customer/index.ts b/packages/local/src/customer/index.ts similarity index 100% rename from framework/saleor/customer/index.ts rename to packages/local/src/customer/index.ts diff --git a/packages/local/src/customer/use-customer.tsx b/packages/local/src/customer/use-customer.tsx new file mode 100644 index 000000000..04c48943d --- /dev/null +++ b/packages/local/src/customer/use-customer.tsx @@ -0,0 +1,17 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useCustomer, { + UseCustomer, +} from '@vercel/commerce/customer/use-customer' + +export default useCustomer as UseCustomer +export const handler: SWRHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: () => () => { + return async function addItem() { + return {} + } + }, +} diff --git a/framework/local/data.json b/packages/local/src/data.json similarity index 100% rename from framework/local/data.json rename to packages/local/src/data.json diff --git a/framework/local/fetcher.ts b/packages/local/src/fetcher.ts similarity index 78% rename from framework/local/fetcher.ts rename to packages/local/src/fetcher.ts index 69943d1df..27f3ceb0c 100644 --- a/framework/local/fetcher.ts +++ b/packages/local/src/fetcher.ts @@ -1,4 +1,4 @@ -import { Fetcher } from '@commerce/utils/types' +import { Fetcher } from '@vercel/commerce/utils/types' export const fetcher: Fetcher = async () => { console.log('FETCHER') diff --git a/packages/local/src/index.tsx b/packages/local/src/index.tsx new file mode 100644 index 000000000..ae3df810e --- /dev/null +++ b/packages/local/src/index.tsx @@ -0,0 +1,12 @@ +import { + getCommerceProvider, + useCommerce as useCoreCommerce, +} from '@vercel/commerce' +import { localProvider, LocalProvider } from './provider' + +export { localProvider } +export type { LocalProvider } + +export const CommerceProvider = getCommerceProvider(localProvider) + +export const useCommerce = () => useCoreCommerce() diff --git a/framework/local/next.config.js b/packages/local/src/next.config.cjs similarity index 100% rename from framework/local/next.config.js rename to packages/local/src/next.config.cjs diff --git a/framework/vendure/product/index.ts b/packages/local/src/product/index.ts similarity index 100% rename from framework/vendure/product/index.ts rename to packages/local/src/product/index.ts diff --git a/packages/local/src/product/use-price.tsx b/packages/local/src/product/use-price.tsx new file mode 100644 index 000000000..fd42d7033 --- /dev/null +++ b/packages/local/src/product/use-price.tsx @@ -0,0 +1,2 @@ +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/framework/local/product/use-search.tsx b/packages/local/src/product/use-search.tsx similarity index 67% rename from framework/local/product/use-search.tsx rename to packages/local/src/product/use-search.tsx index 30e699537..b84889cca 100644 --- a/framework/local/product/use-search.tsx +++ b/packages/local/src/product/use-search.tsx @@ -1,5 +1,5 @@ -import { SWRHook } from '@commerce/utils/types' -import useSearch, { UseSearch } from '@commerce/product/use-search' +import { SWRHook } from '@vercel/commerce/utils/types' +import useSearch, { UseSearch } from '@vercel/commerce/product/use-search' export default useSearch as UseSearch export const handler: SWRHook = { diff --git a/framework/local/provider.ts b/packages/local/src/provider.ts similarity index 94% rename from framework/local/provider.ts rename to packages/local/src/provider.ts index e6a2b0a21..53dc7f574 100644 --- a/framework/local/provider.ts +++ b/packages/local/src/provider.ts @@ -9,7 +9,6 @@ import { handler as useLogin } from './auth/use-login' import { handler as useLogout } from './auth/use-logout' import { handler as useSignup } from './auth/use-signup' -export type Provider = typeof localProvider export const localProvider = { locale: 'en-us', cartCookie: 'session', @@ -19,3 +18,5 @@ export const localProvider = { products: { useSearch }, auth: { useLogin, useLogout, useSignup }, } + +export type LocalProvider = typeof localProvider diff --git a/framework/reactioncommerce/wishlist/use-add-item.tsx b/packages/local/src/wishlist/use-add-item.tsx similarity index 100% rename from framework/reactioncommerce/wishlist/use-add-item.tsx rename to packages/local/src/wishlist/use-add-item.tsx diff --git a/framework/reactioncommerce/wishlist/use-remove-item.tsx b/packages/local/src/wishlist/use-remove-item.tsx similarity index 100% rename from framework/reactioncommerce/wishlist/use-remove-item.tsx rename to packages/local/src/wishlist/use-remove-item.tsx diff --git a/framework/local/wishlist/use-wishlist.tsx b/packages/local/src/wishlist/use-wishlist.tsx similarity index 86% rename from framework/local/wishlist/use-wishlist.tsx rename to packages/local/src/wishlist/use-wishlist.tsx index 9fe0e758f..b2785d46f 100644 --- a/framework/local/wishlist/use-wishlist.tsx +++ b/packages/local/src/wishlist/use-wishlist.tsx @@ -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 = {} diff --git a/packages/local/taskfile.js b/packages/local/taskfile.js new file mode 100644 index 000000000..39b1b2a86 --- /dev/null +++ b/packages/local/taskfile.js @@ -0,0 +1,20 @@ +export async function build(task, opts) { + await task + .source('src/**/*.+(ts|tsx|js)') + .swc({ dev: opts.dev, outDir: 'dist', baseUrl: 'src' }) + .target('dist') + .source('src/**/*.+(cjs|json)') + .target('dist') + task.$.log('Compiled src files') +} + +export async function release(task) { + await task.clear('dist').start('build') +} + +export default async function dev(task) { + const opts = { dev: true } + await task.clear('dist') + await task.start('build', opts) + await task.watch('src/**/*.+(ts|tsx|js|cjs|json)', 'build', opts) +} diff --git a/packages/local/tsconfig.json b/packages/local/tsconfig.json new file mode 100644 index 000000000..cd04ab2ff --- /dev/null +++ b/packages/local/tsconfig.json @@ -0,0 +1,21 @@ +{ + "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, + "incremental": true, + "jsx": "react-jsx" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/ordercloud/.env.template b/packages/ordercloud/.env.template new file mode 100644 index 000000000..52406251a --- /dev/null +++ b/packages/ordercloud/.env.template @@ -0,0 +1,6 @@ +COMMERCE_PROVIDER=ordercloud + +ORDERCLOUD_BUYER_CLIENT_ID= +ORDERCLOUD_MIDDLEWARE_CLIENT_ID= +ORDERCLOUD_MIDDLEWARE_CLIENT_SECRET= +STRIPE_SECRET= diff --git a/packages/ordercloud/.prettierignore b/packages/ordercloud/.prettierignore new file mode 100644 index 000000000..f06235c46 --- /dev/null +++ b/packages/ordercloud/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/ordercloud/.prettierrc b/packages/ordercloud/.prettierrc new file mode 100644 index 000000000..e1076edfa --- /dev/null +++ b/packages/ordercloud/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/ordercloud/README.md b/packages/ordercloud/README.md new file mode 100644 index 000000000..ca1438eae --- /dev/null +++ b/packages/ordercloud/README.md @@ -0,0 +1,3 @@ +# Next.js Ordercloud Provider + +Create your own store from [here](https://nextjs.org/commerce) diff --git a/packages/ordercloud/package.json b/packages/ordercloud/package.json new file mode 100644 index 000000000..8c6439c54 --- /dev/null +++ b/packages/ordercloud/package.json @@ -0,0 +1,80 @@ +{ + "name": "@vercel/commerce-ordercloud", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "release": "taskr release", + "build": "taskr build", + "dev": "taskr", + "types": "tsc --emitDeclarationOnly", + "prettier-fix": "prettier --write ." + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], + "./next.config": "./dist/next.config.cjs" + }, + "typesVersions": { + "*": { + "*": [ + "src/*", + "src/*/index" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + }, + "files": [ + "dist" + ], + "publishConfig": { + "typesVersions": { + "*": { + "*": [ + "dist/*.d.ts", + "dist/*/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": { + "@taskr/clear": "^1.1.0", + "@taskr/esnext": "^1.1.0", + "@taskr/watch": "^1.1.0", + "@types/node": "^17.0.8", + "@types/react": "^17.0.38", + "lint-staged": "^12.1.7", + "next": "^12.0.8", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "taskr": "^1.1.0", + "taskr-swc": "^0.0.1", + "typescript": "^4.5.4" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,json}": [ + "prettier --write", + "git add" + ] + } +} diff --git a/packages/ordercloud/src/api/endpoints/cart/add-item.ts b/packages/ordercloud/src/api/endpoints/cart/add-item.ts new file mode 100644 index 000000000..28d372bd0 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/cart/add-item.ts @@ -0,0 +1,99 @@ +import type { CartEndpoint } from '.' +import type { RawVariant } from '../../../types/product' +import type { OrdercloudLineItem } from '../../../types/cart' + +import { serialize } from 'cookie' + +import { formatCart } from '../../utils/cart' + +const addItem: CartEndpoint['handlers']['addItem'] = async ({ + res, + body: { cartId, item }, + config: { restBuyerFetch, cartCookie, tokenCookie }, +}) => { + // Return an error if no item is present + if (!item) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Missing item' }], + }) + } + + // Store token + let token + + // Set the quantity if not present + if (!item.quantity) item.quantity = 1 + + // Create an order if it doesn't exist + if (!cartId) { + const { ID, meta } = await restBuyerFetch( + 'POST', + `/orders/Outgoing`, + {} + ).then((response: { ID: string; meta: { token: string } }) => response) + + // Set the cart id and token + cartId = ID + token = meta.token + + // Set the cart and token cookie + res.setHeader('Set-Cookie', [ + serialize(tokenCookie, meta.token, { + maxAge: 60 * 60 * 24 * 30, + expires: new Date(Date.now() + 60 * 60 * 24 * 30 * 1000), + secure: process.env.NODE_ENV === 'production', + path: '/', + sameSite: 'lax', + }), + serialize(cartCookie, cartId, { + maxAge: 60 * 60 * 24 * 30, + expires: new Date(Date.now() + 60 * 60 * 24 * 30 * 1000), + secure: process.env.NODE_ENV === 'production', + path: '/', + sameSite: 'lax', + }), + ]) + } + + // Store specs + let specs: RawVariant['Specs'] = [] + + // If a variant is present, fetch its specs + if (item.variantId) { + specs = await restBuyerFetch( + 'GET', + `/me/products/${item.productId}/variants/${item.variantId}`, + null, + { token } + ).then((res: RawVariant) => res.Specs) + } + + // Add the item to the order + await restBuyerFetch( + 'POST', + `/orders/Outgoing/${cartId}/lineitems`, + { + ProductID: item.productId, + Quantity: item.quantity, + Specs: specs, + }, + { token } + ) + + // Get cart + const [cart, lineItems] = await Promise.all([ + restBuyerFetch('GET', `/orders/Outgoing/${cartId}`, null, { token }), + restBuyerFetch('GET', `/orders/Outgoing/${cartId}/lineitems`, null, { + token, + }).then((response: { Items: OrdercloudLineItem[] }) => response.Items), + ]) + + // Format cart + const formattedCart = formatCart(cart, lineItems) + + // Return cart and errors + res.status(200).json({ data: formattedCart, errors: [] }) +} + +export default addItem diff --git a/packages/ordercloud/src/api/endpoints/cart/get-cart.ts b/packages/ordercloud/src/api/endpoints/cart/get-cart.ts new file mode 100644 index 000000000..7ea077b54 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/cart/get-cart.ts @@ -0,0 +1,65 @@ +import type { OrdercloudLineItem } from '../../../types/cart' +import type { CartEndpoint } from '.' + +import { serialize } from 'cookie' + +import { formatCart } from '../../utils/cart' + +// Return current cart info +const getCart: CartEndpoint['handlers']['getCart'] = async ({ + req, + res, + body: { cartId }, + config: { restBuyerFetch, cartCookie, tokenCookie }, +}) => { + if (!cartId) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + + try { + // Get token from cookies + const token = req.cookies[tokenCookie] + + // Get cart + const cart = await restBuyerFetch( + 'GET', + `/orders/Outgoing/${cartId}`, + null, + { token } + ) + + // Get line items + const lineItems = await restBuyerFetch( + 'GET', + `/orders/Outgoing/${cartId}/lineitems`, + null, + { token } + ).then((response: { Items: OrdercloudLineItem[] }) => response.Items) + + // Format cart + const formattedCart = formatCart(cart, lineItems) + + // Return cart and errors + res.status(200).json({ data: formattedCart, errors: [] }) + } catch (error) { + // Reset cart and token cookie + res.setHeader('Set-Cookie', [ + serialize(cartCookie, cartId, { + maxAge: -1, + path: '/', + }), + serialize(tokenCookie, cartId, { + maxAge: -1, + path: '/', + }), + ]) + + // Return empty cart + res.status(200).json({ data: null, errors: [] }) + } +} + +export default getCart diff --git a/packages/ordercloud/src/api/endpoints/cart/index.ts b/packages/ordercloud/src/api/endpoints/cart/index.ts new file mode 100644 index 000000000..f36364c46 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/cart/index.ts @@ -0,0 +1,28 @@ +import type { CartSchema } from '../../../types/cart' +import type { OrdercloudAPI } from '../..' + +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' +import updateItem from './update-item' +import removeItem from './remove-item' + +export type CartAPI = GetAPISchema + +export type CartEndpoint = CartAPI['endpoint'] + +export const handlers: CartEndpoint['handlers'] = { + getCart, + addItem, + updateItem, + removeItem, +} + +const cartApi = createEndpoint({ + handler: cartEndpoint, + handlers, +}) + +export default cartApi diff --git a/packages/ordercloud/src/api/endpoints/cart/remove-item.ts b/packages/ordercloud/src/api/endpoints/cart/remove-item.ts new file mode 100644 index 000000000..ea9c46e4c --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/cart/remove-item.ts @@ -0,0 +1,45 @@ +import type { CartEndpoint } from '.' + +import { formatCart } from '../../utils/cart' +import { OrdercloudLineItem } from '../../../types/cart' + +const removeItem: CartEndpoint['handlers']['removeItem'] = async ({ + req, + res, + body: { cartId, itemId }, + config: { restBuyerFetch, tokenCookie }, +}) => { + if (!cartId || !itemId) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + + // Get token from cookies + const token = req.cookies[tokenCookie] + + // Remove the item to the order + await restBuyerFetch( + 'DELETE', + `/orders/Outgoing/${cartId}/lineitems/${itemId}`, + null, + { token } + ) + + // Get cart + const [cart, lineItems] = await Promise.all([ + restBuyerFetch('GET', `/orders/Outgoing/${cartId}`, null, { token }), + restBuyerFetch('GET', `/orders/Outgoing/${cartId}/lineitems`, null, { + token, + }).then((response: { Items: OrdercloudLineItem[] }) => response.Items), + ]) + + // Format cart + const formattedCart = formatCart(cart, lineItems) + + // Return cart and errors + res.status(200).json({ data: formattedCart, errors: [] }) +} + +export default removeItem diff --git a/packages/ordercloud/src/api/endpoints/cart/update-item.ts b/packages/ordercloud/src/api/endpoints/cart/update-item.ts new file mode 100644 index 000000000..20113baee --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/cart/update-item.ts @@ -0,0 +1,63 @@ +import type { OrdercloudLineItem } from '../../../types/cart' +import type { RawVariant } from '../../../types/product' +import type { CartEndpoint } from '.' + +import { formatCart } from '../../utils/cart' + +const updateItem: CartEndpoint['handlers']['updateItem'] = async ({ + req, + res, + body: { cartId, itemId, item }, + config: { restBuyerFetch, tokenCookie }, +}) => { + if (!cartId || !itemId || !item) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + + // Get token from cookies + const token = req.cookies[tokenCookie] + + // Store specs + let specs: RawVariant['Specs'] = [] + + // If a variant is present, fetch its specs + if (item.variantId) { + specs = await restBuyerFetch( + 'GET', + `/me/products/${item.productId}/variants/${item.variantId}`, + null, + { token } + ).then((res: RawVariant) => res.Specs) + } + + // Add the item to the order + await restBuyerFetch( + 'PATCH', + `/orders/Outgoing/${cartId}/lineitems/${itemId}`, + { + ProductID: item.productId, + Quantity: item.quantity, + Specs: specs, + }, + { token } + ) + + // Get cart + const [cart, lineItems] = await Promise.all([ + restBuyerFetch('GET', `/orders/Outgoing/${cartId}`, null, { token }), + restBuyerFetch('GET', `/orders/Outgoing/${cartId}/lineitems`, null, { + token, + }).then((response: { Items: OrdercloudLineItem[] }) => response.Items), + ]) + + // Format cart + const formattedCart = formatCart(cart, lineItems) + + // Return cart and errors + res.status(200).json({ data: formattedCart, errors: [] }) +} + +export default updateItem diff --git a/packages/ordercloud/src/api/endpoints/catalog/products/get-products.ts b/packages/ordercloud/src/api/endpoints/catalog/products/get-products.ts new file mode 100644 index 000000000..ad8d391ac --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/catalog/products/get-products.ts @@ -0,0 +1,37 @@ +import { normalize as normalizeProduct } from '../../../../utils/product' +import { ProductsEndpoint } from '.' + +// Get products for the product list page. Search and category filter implemented. Sort and brand filter not implemented. +const getProducts: ProductsEndpoint['handlers']['getProducts'] = async ({ + req, + res, + body: { search, categoryId, brandId, sort }, + config: { restBuyerFetch, cartCookie, tokenCookie }, +}) => { + //Use a dummy base as we only care about the relative path + const url = new URL('/me/products', 'http://a') + + if (search) { + url.searchParams.set('search', search) + } + if (categoryId) { + url.searchParams.set('categoryID', String(categoryId)) + } + + // Get token from cookies + const token = req.cookies[tokenCookie] + + var rawProducts = await restBuyerFetch( + 'GET', + url.pathname + url.search, + null, + { token } + ) + + const products = rawProducts.Items.map(normalizeProduct) + const found = rawProducts?.Items?.length > 0 + + res.status(200).json({ data: { products, found } }) +} + +export default getProducts diff --git a/packages/ordercloud/src/api/endpoints/catalog/products/index.ts b/packages/ordercloud/src/api/endpoints/catalog/products/index.ts new file mode 100644 index 000000000..d775d6fc1 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/catalog/products/index.ts @@ -0,0 +1,19 @@ +import type { OrdercloudAPI } from '../../../../api' + +import { createEndpoint, GetAPISchema } from '@vercel/commerce/api' +import { ProductsSchema } from '@vercel/commerce/types/product' +import getProducts from './get-products' +import productsEndpoint from '@vercel/commerce/api/endpoints/catalog/products' + +export type ProductsAPI = GetAPISchema + +export type ProductsEndpoint = ProductsAPI['endpoint'] + +export const handlers: ProductsEndpoint['handlers'] = { getProducts } + +const productsApi = createEndpoint({ + handler: productsEndpoint, + handlers, +}) + +export default productsApi diff --git a/packages/ordercloud/src/api/endpoints/checkout/get-checkout.ts b/packages/ordercloud/src/api/endpoints/checkout/get-checkout.ts new file mode 100644 index 000000000..c0ab1a40d --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/checkout/get-checkout.ts @@ -0,0 +1,47 @@ +import type { CheckoutEndpoint } from '.' + +const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ + req, + res, + body: { cartId }, + config: { restBuyerFetch, tokenCookie }, +}) => { + // Return an error if no item is present + if (!cartId) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Missing cookie' }], + }) + } + + // Get token from cookies + const token = req.cookies[tokenCookie] + + // Register credit card + const payments = await restBuyerFetch( + 'GET', + `/orders/Outgoing/${cartId}/payments`, + null, + { token } + ).then((response: { Items: unknown[] }) => response.Items) + + const address = await restBuyerFetch( + 'GET', + `/orders/Outgoing/${cartId}`, + null, + { token } + ).then( + (response: { ShippingAddressID: string }) => response.ShippingAddressID + ) + + // Return cart and errors + res.status(200).json({ + data: { + hasPayment: payments.length > 0, + hasShipping: Boolean(address), + }, + errors: [], + }) +} + +export default getCheckout diff --git a/packages/ordercloud/src/api/endpoints/checkout/index.ts b/packages/ordercloud/src/api/endpoints/checkout/index.ts new file mode 100644 index 000000000..44a9a6933 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/checkout/index.ts @@ -0,0 +1,23 @@ +import type { CheckoutSchema } from '../../../types/checkout' +import type { OrdercloudAPI } from '../..' + +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' + +export type CheckoutAPI = GetAPISchema +export type CheckoutEndpoint = CheckoutAPI['endpoint'] + +export const handlers: CheckoutEndpoint['handlers'] = { + getCheckout, + submitCheckout, +} + +const checkoutApi = createEndpoint({ + handler: checkoutEndpoint, + handlers, +}) + +export default checkoutApi diff --git a/packages/ordercloud/src/api/endpoints/checkout/submit-checkout.ts b/packages/ordercloud/src/api/endpoints/checkout/submit-checkout.ts new file mode 100644 index 000000000..8cd9be5e4 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/checkout/submit-checkout.ts @@ -0,0 +1,32 @@ +import type { CheckoutEndpoint } from '.' + +const submitCheckout: CheckoutEndpoint['handlers']['submitCheckout'] = async ({ + req, + res, + body: { cartId }, + config: { restBuyerFetch, tokenCookie }, +}) => { + // Return an error if no item is present + if (!cartId) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Missing item' }], + }) + } + + // Get token from cookies + const token = req.cookies[tokenCookie] + + // Submit order + await restBuyerFetch( + 'POST', + `/orders/Outgoing/${cartId}/submit`, + {}, + { token } + ) + + // Return cart and errors + res.status(200).json({ data: null, errors: [] }) +} + +export default submitCheckout diff --git a/packages/ordercloud/src/api/endpoints/customer/address/add-item.ts b/packages/ordercloud/src/api/endpoints/customer/address/add-item.ts new file mode 100644 index 000000000..434c2400d --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/customer/address/add-item.ts @@ -0,0 +1,47 @@ +import type { CustomerAddressEndpoint } from '.' + +const addItem: CustomerAddressEndpoint['handlers']['addItem'] = async ({ + res, + body: { item, cartId }, + config: { restBuyerFetch }, +}) => { + // Return an error if no item is present + if (!item) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Missing item' }], + }) + } + + // Return an error if no item is present + if (!cartId) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Cookie not found' }], + }) + } + + // Register address + const address = await restBuyerFetch('POST', `/me/addresses`, { + AddressName: 'main address', + CompanyName: item.company, + FirstName: item.firstName, + LastName: item.lastName, + Street1: item.streetNumber, + Street2: item.streetNumber, + City: item.city, + State: item.city, + Zip: item.zipCode, + Country: item.country.slice(0, 2).toLowerCase(), + Shipping: true, + }).then((response: { ID: string }) => response.ID) + + // Assign address to order + await restBuyerFetch('PATCH', `/orders/Outgoing/${cartId}`, { + ShippingAddressID: address, + }) + + return res.status(200).json({ data: null, errors: [] }) +} + +export default addItem diff --git a/packages/ordercloud/src/api/endpoints/customer/address/get-addresses.ts b/packages/ordercloud/src/api/endpoints/customer/address/get-addresses.ts new file mode 100644 index 000000000..2e27591c0 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/customer/address/get-addresses.ts @@ -0,0 +1,9 @@ +import type { CustomerAddressEndpoint } from '.' + +const getCards: CustomerAddressEndpoint['handlers']['getAddresses'] = async ({ + res, +}) => { + return res.status(200).json({ data: null, errors: [] }) +} + +export default getCards diff --git a/packages/ordercloud/src/api/endpoints/customer/address/index.ts b/packages/ordercloud/src/api/endpoints/customer/address/index.ts new file mode 100644 index 000000000..f6ab7e306 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/customer/address/index.ts @@ -0,0 +1,30 @@ +import type { CustomerAddressSchema } from '../../../../types/customer/address' +import type { OrdercloudAPI } from '../../..' + +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' +import updateItem from './update-item' +import removeItem from './remove-item' + +export type CustomerAddressAPI = GetAPISchema< + OrdercloudAPI, + CustomerAddressSchema +> +export type CustomerAddressEndpoint = CustomerAddressAPI['endpoint'] + +export const handlers: CustomerAddressEndpoint['handlers'] = { + getAddresses, + addItem, + updateItem, + removeItem, +} + +const customerAddressApi = createEndpoint({ + handler: customerAddressEndpoint, + handlers, +}) + +export default customerAddressApi diff --git a/packages/ordercloud/src/api/endpoints/customer/address/remove-item.ts b/packages/ordercloud/src/api/endpoints/customer/address/remove-item.ts new file mode 100644 index 000000000..fba4e1154 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/customer/address/remove-item.ts @@ -0,0 +1,9 @@ +import type { CustomerAddressEndpoint } from '.' + +const removeItem: CustomerAddressEndpoint['handlers']['removeItem'] = async ({ + res, +}) => { + return res.status(200).json({ data: null, errors: [] }) +} + +export default removeItem diff --git a/packages/ordercloud/src/api/endpoints/customer/address/update-item.ts b/packages/ordercloud/src/api/endpoints/customer/address/update-item.ts new file mode 100644 index 000000000..4c4b4b9ae --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/customer/address/update-item.ts @@ -0,0 +1,9 @@ +import type { CustomerAddressEndpoint } from '.' + +const updateItem: CustomerAddressEndpoint['handlers']['updateItem'] = async ({ + res, +}) => { + return res.status(200).json({ data: null, errors: [] }) +} + +export default updateItem diff --git a/packages/ordercloud/src/api/endpoints/customer/card/add-item.ts b/packages/ordercloud/src/api/endpoints/customer/card/add-item.ts new file mode 100644 index 000000000..ad7dead7c --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/customer/card/add-item.ts @@ -0,0 +1,74 @@ +import type { CustomerCardEndpoint } from '.' +import type { OredercloudCreditCard } from '../../../../types/customer/card' + +import Stripe from 'stripe' + +const stripe = new Stripe(process.env.STRIPE_SECRET as string, { + apiVersion: '2020-08-27', +}) + +const addItem: CustomerCardEndpoint['handlers']['addItem'] = async ({ + res, + body: { item, cartId }, + config: { restBuyerFetch, restMiddlewareFetch }, +}) => { + // Return an error if no item is present + if (!item) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Missing item' }], + }) + } + + // Return an error if no item is present + if (!cartId) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Cookie not found' }], + }) + } + + // Get token + const token = await stripe.tokens + .create({ + card: { + number: item.cardNumber, + exp_month: item.cardExpireDate.split('/')[0], + exp_year: item.cardExpireDate.split('/')[1], + cvc: item.cardCvc, + }, + }) + .then((res: { id: string }) => res.id) + + // Register credit card + const creditCard = await restBuyerFetch('POST', `/me/creditcards`, { + Token: token, + CardType: 'credit', + PartialAccountNumber: item.cardNumber.slice(-4), + CardholderName: item.cardHolder, + ExpirationDate: item.cardExpireDate, + }).then((response: OredercloudCreditCard) => response.ID) + + // Assign payment to order + const payment = await restBuyerFetch( + 'POST', + `/orders/All/${cartId}/payments`, + { + Type: 'CreditCard', + CreditCardID: creditCard, + } + ).then((response: { ID: string }) => response.ID) + + // Accept payment to order + await restMiddlewareFetch( + 'PATCH', + `/orders/All/${cartId}/payments/${payment}`, + { + Accepted: true, + } + ) + + return res.status(200).json({ data: null, errors: [] }) +} + +export default addItem diff --git a/packages/ordercloud/src/api/endpoints/customer/card/get-cards.ts b/packages/ordercloud/src/api/endpoints/customer/card/get-cards.ts new file mode 100644 index 000000000..e77520803 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/customer/card/get-cards.ts @@ -0,0 +1,9 @@ +import type { CustomerCardEndpoint } from '.' + +const getCards: CustomerCardEndpoint['handlers']['getCards'] = async ({ + res, +}) => { + return res.status(200).json({ data: null, errors: [] }) +} + +export default getCards diff --git a/packages/ordercloud/src/api/endpoints/customer/card/index.ts b/packages/ordercloud/src/api/endpoints/customer/card/index.ts new file mode 100644 index 000000000..7116e3cb5 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/customer/card/index.ts @@ -0,0 +1,27 @@ +import type { CustomerCardSchema } from '../../../../types/customer/card' +import type { OrdercloudAPI } from '../../..' + +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' +import updateItem from './update-item' +import removeItem from './remove-item' + +export type CustomerCardAPI = GetAPISchema +export type CustomerCardEndpoint = CustomerCardAPI['endpoint'] + +export const handlers: CustomerCardEndpoint['handlers'] = { + getCards, + addItem, + updateItem, + removeItem, +} + +const customerCardApi = createEndpoint({ + handler: customerCardEndpoint, + handlers, +}) + +export default customerCardApi diff --git a/packages/ordercloud/src/api/endpoints/customer/card/remove-item.ts b/packages/ordercloud/src/api/endpoints/customer/card/remove-item.ts new file mode 100644 index 000000000..1a81d1cf4 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/customer/card/remove-item.ts @@ -0,0 +1,9 @@ +import type { CustomerCardEndpoint } from '.' + +const removeItem: CustomerCardEndpoint['handlers']['removeItem'] = async ({ + res, +}) => { + return res.status(200).json({ data: null, errors: [] }) +} + +export default removeItem diff --git a/packages/ordercloud/src/api/endpoints/customer/card/update-item.ts b/packages/ordercloud/src/api/endpoints/customer/card/update-item.ts new file mode 100644 index 000000000..9770644aa --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/customer/card/update-item.ts @@ -0,0 +1,9 @@ +import type { CustomerCardEndpoint } from '.' + +const updateItem: CustomerCardEndpoint['handlers']['updateItem'] = async ({ + res, +}) => { + return res.status(200).json({ data: null, errors: [] }) +} + +export default updateItem diff --git a/packages/ordercloud/src/api/endpoints/customer/index.ts b/packages/ordercloud/src/api/endpoints/customer/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/customer/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/ordercloud/src/api/endpoints/login/index.ts b/packages/ordercloud/src/api/endpoints/login/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/login/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/ordercloud/src/api/endpoints/logout/index.ts b/packages/ordercloud/src/api/endpoints/logout/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/logout/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/ordercloud/src/api/endpoints/signup/index.ts b/packages/ordercloud/src/api/endpoints/signup/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/signup/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/ordercloud/src/api/endpoints/wishlist/index.tsx b/packages/ordercloud/src/api/endpoints/wishlist/index.tsx new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/ordercloud/src/api/endpoints/wishlist/index.tsx @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/ordercloud/src/api/index.ts b/packages/ordercloud/src/api/index.ts new file mode 100644 index 000000000..d1a809eca --- /dev/null +++ b/packages/ordercloud/src/api/index.ts @@ -0,0 +1,71 @@ +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' + +import getAllPages from './operations/get-all-pages' +import getPage from './operations/get-page' +import getSiteInfo from './operations/get-site-info' +import getAllProductPaths from './operations/get-all-product-paths' +import getAllProducts from './operations/get-all-products' +import getProduct from './operations/get-product' + +import { + API_URL, + API_VERSION, + CART_COOKIE, + CUSTOMER_COOKIE, + TOKEN_COOKIE, +} from '../constants' + +export interface OrdercloudConfig extends CommerceAPIConfig { + restBuyerFetch: ( + method: string, + resource: string, + body?: Record, + fetchOptions?: Record + ) => Promise + restMiddlewareFetch: ( + method: string, + resource: string, + body?: Record, + fetchOptions?: Record + ) => Promise + apiVersion: string + tokenCookie: string +} + +const config: OrdercloudConfig = { + commerceUrl: API_URL, + apiToken: '', + apiVersion: API_VERSION, + cartCookie: CART_COOKIE, + customerCookie: CUSTOMER_COOKIE, + tokenCookie: TOKEN_COOKIE, + cartCookieMaxAge: 2592000, + restBuyerFetch: createBuyerFetcher(() => getCommerceApi().getConfig()), + restMiddlewareFetch: createMiddlewareFetcher(() => + getCommerceApi().getConfig() + ), + fetch: createGraphqlFetcher(() => getCommerceApi().getConfig()), +} + +const operations = { + getAllPages, + getPage, + getSiteInfo, + getAllProductPaths, + getAllProducts, + getProduct, +} + +export const provider = { config, operations } + +export type Provider = typeof provider +export type OrdercloudAPI

= CommerceAPI

+ +export function getCommerceApi

( + customProvider: P = provider as any +): OrdercloudAPI

{ + return commerceApi(customProvider as any) +} diff --git a/packages/ordercloud/src/api/operations/get-all-pages.ts b/packages/ordercloud/src/api/operations/get-all-pages.ts new file mode 100644 index 000000000..2720e5244 --- /dev/null +++ b/packages/ordercloud/src/api/operations/get-all-pages.ts @@ -0,0 +1,22 @@ +import type { OrdercloudConfig } from '../' + +import { GetAllPagesOperation } from '@vercel/commerce/types/page' + +export type Page = { url: string } +export type GetAllPagesResult = { pages: Page[] } + +export default function getAllPagesOperation() { + async function getAllPages({ + config, + preview, + }: { + url?: string + config?: Partial + preview?: boolean + } = {}): Promise { + return Promise.resolve({ + pages: [], + }) + } + return getAllPages +} diff --git a/packages/ordercloud/src/api/operations/get-all-product-paths.ts b/packages/ordercloud/src/api/operations/get-all-product-paths.ts new file mode 100644 index 000000000..8a79bee1e --- /dev/null +++ b/packages/ordercloud/src/api/operations/get-all-product-paths.ts @@ -0,0 +1,34 @@ +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 '../' + +export type GetAllProductPathsResult = { + products: Array<{ path: string }> +} + +export default function getAllProductPathsOperation({ + commerce, +}: OperationContext) { + async function getAllProductPaths({ + config, + }: { + config?: Partial + } = {}): Promise { + // Get fetch from the config + const { restBuyerFetch } = commerce.getConfig(config) + + // Get all products + const rawProducts: RawProduct[] = await restBuyerFetch<{ + Items: RawProduct[] + }>('GET', '/me/products').then((response) => response.Items) + + return { + // Match a path for every product retrieved + products: rawProducts.map((product) => ({ path: `/${product.ID}` })), + } + } + + return getAllProductPaths +} diff --git a/packages/ordercloud/src/api/operations/get-all-products.ts b/packages/ordercloud/src/api/operations/get-all-products.ts new file mode 100644 index 000000000..5b4861f8d --- /dev/null +++ b/packages/ordercloud/src/api/operations/get-all-products.ts @@ -0,0 +1,35 @@ +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' + +import { normalize as normalizeProduct } from '../../utils/product' + +export default function getAllProductsOperation({ + commerce, +}: OperationContext) { + async function getAllProducts({ + config, + }: { + query?: string + variables?: T['variables'] + config?: Partial + preview?: boolean + } = {}): Promise { + // Get fetch from the config + const { restBuyerFetch } = commerce.getConfig(config) + + // Get all products + const rawProducts: RawProduct[] = await restBuyerFetch<{ + Items: RawProduct[] + }>('GET', '/me/products').then((response) => response.Items) + + return { + // Normalize products to commerce schema + products: rawProducts.map(normalizeProduct), + } + } + + return getAllProducts +} diff --git a/packages/ordercloud/src/api/operations/get-page.ts b/packages/ordercloud/src/api/operations/get-page.ts new file mode 100644 index 000000000..e403d1660 --- /dev/null +++ b/packages/ordercloud/src/api/operations/get-page.ts @@ -0,0 +1,15 @@ +import { GetPageOperation } from '@vercel/commerce/types/page' + +export type Page = any +export type GetPageResult = { page?: Page } + +export type PageVariables = { + id: number +} + +export default function getPageOperation() { + async function getPage(): Promise { + return Promise.resolve({}) + } + return getPage +} diff --git a/packages/ordercloud/src/api/operations/get-product.ts b/packages/ordercloud/src/api/operations/get-product.ts new file mode 100644 index 000000000..b63b86c23 --- /dev/null +++ b/packages/ordercloud/src/api/operations/get-product.ts @@ -0,0 +1,60 @@ +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' + +import { normalize as normalizeProduct } from '../../utils/product' + +export default function getProductOperation({ + commerce, +}: OperationContext) { + async function getProduct({ + config, + variables, + }: { + query?: string + variables?: T['variables'] + config?: Partial + preview?: boolean + } = {}): Promise { + // Get fetch from the config + const { restBuyerFetch } = commerce.getConfig(config) + + // Get a single product + const productPromise = restBuyerFetch( + 'GET', + `/me/products/${variables?.slug}` + ) + + // Get product specs + const specsPromise = restBuyerFetch<{ Items: RawSpec[] }>( + 'GET', + `/me/products/${variables?.slug}/specs` + ).then((res) => res.Items) + + // Get product variants + const variantsPromise = restBuyerFetch<{ Items: RawVariant[] }>( + 'GET', + `/me/products/${variables?.slug}/variants` + ).then((res) => res.Items) + + // Execute all promises in parallel + const [product, specs, variants] = await Promise.all([ + productPromise, + specsPromise, + variantsPromise, + ]) + + // Hydrate product + product.xp.Specs = specs + product.xp.Variants = variants + + return { + // Normalize product to commerce schema + product: normalizeProduct(product), + } + } + + return getProduct +} diff --git a/packages/ordercloud/src/api/operations/get-site-info.ts b/packages/ordercloud/src/api/operations/get-site-info.ts new file mode 100644 index 000000000..ec0ed5dd3 --- /dev/null +++ b/packages/ordercloud/src/api/operations/get-site-info.ts @@ -0,0 +1,46 @@ +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' + +export type GetSiteInfoResult< + T extends { categories: any[]; brands: any[] } = { + categories: Category[] + brands: any[] + } +> = T + +export default function getSiteInfoOperation({ + commerce, +}: OperationContext) { + async function getSiteInfo({ + config, + }: { + query?: string + variables?: any + config?: Partial + preview?: boolean + } = {}): Promise { + // Get fetch from the config + const { restBuyerFetch } = commerce.getConfig(config) + + // Get list of categories + const rawCategories: RawCategory[] = await restBuyerFetch<{ + Items: RawCategory[] + }>('GET', `/me/categories`).then((response) => response.Items) + + return { + // Normalize categories + categories: rawCategories.map((category) => ({ + id: category.ID, + name: category.Name, + slug: category.ID, + path: `/${category.ID}`, + })), + brands: [], + } + } + + return getSiteInfo +} diff --git a/packages/ordercloud/src/api/operations/index.ts b/packages/ordercloud/src/api/operations/index.ts new file mode 100644 index 000000000..84b04a978 --- /dev/null +++ b/packages/ordercloud/src/api/operations/index.ts @@ -0,0 +1,6 @@ +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' +export { default as getAllProductPaths } from './get-all-product-paths' diff --git a/packages/ordercloud/src/api/utils/cart.ts b/packages/ordercloud/src/api/utils/cart.ts new file mode 100644 index 000000000..716f3521e --- /dev/null +++ b/packages/ordercloud/src/api/utils/cart.ts @@ -0,0 +1,41 @@ +import type { Cart, OrdercloudCart, OrdercloudLineItem } from '../../types/cart' + +export function formatCart( + cart: OrdercloudCart, + lineItems: OrdercloudLineItem[] +): Cart { + return { + id: cart.ID, + customerId: cart.FromUserID, + email: cart.FromUser.Email, + createdAt: cart.DateCreated, + currency: { + code: cart.FromUser?.xp?.currency ?? 'USD', + }, + taxesIncluded: cart.TaxCost === 0, + lineItems: lineItems.map((lineItem) => ({ + id: lineItem.ID, + variantId: lineItem.Variant ? String(lineItem.Variant.ID) : '', + productId: lineItem.ProductID, + name: lineItem.Product.Name, + quantity: lineItem.Quantity, + discounts: [], + path: lineItem.ProductID, + variant: { + id: lineItem.Variant ? String(lineItem.Variant.ID) : '', + sku: lineItem.ID, + name: lineItem.Product.Name, + image: { + url: lineItem.Product.xp?.Images?.[0]?.url, + }, + requiresShipping: Boolean(lineItem.ShippingAddress), + price: lineItem.UnitPrice, + listPrice: lineItem.UnitPrice, + }, + })), + lineItemsSubtotalPrice: cart.Subtotal, + subtotalPrice: cart.Subtotal, + totalPrice: cart.Total, + discounts: [], + } +} diff --git a/packages/ordercloud/src/api/utils/fetch-graphql.ts b/packages/ordercloud/src/api/utils/fetch-graphql.ts new file mode 100644 index 000000000..3c1058deb --- /dev/null +++ b/packages/ordercloud/src/api/utils/fetch-graphql.ts @@ -0,0 +1,14 @@ +import type { GraphQLFetcher } from '@vercel/commerce/api' +import type { OrdercloudConfig } from '../' + +import { FetcherError } from '@vercel/commerce/utils/errors' + +const fetchGraphqlApi: (getConfig: () => OrdercloudConfig) => GraphQLFetcher = + () => async () => { + throw new FetcherError({ + errors: [{ message: 'GraphQL fetch is not implemented' }], + status: 500, + }) + } + +export default fetchGraphqlApi diff --git a/packages/ordercloud/src/api/utils/fetch-rest.ts b/packages/ordercloud/src/api/utils/fetch-rest.ts new file mode 100644 index 000000000..5b70b9dff --- /dev/null +++ b/packages/ordercloud/src/api/utils/fetch-rest.ts @@ -0,0 +1,180 @@ +import vercelFetch from '@vercel/fetch' +import { FetcherError } from '@vercel/commerce/utils/errors' +import { CustomNodeJsGlobal } from '../../types/node'; + +import { OrdercloudConfig } from '../index' + +// Get an instance to vercel fetch +const fetch = vercelFetch() + +// Get token util +async function getToken({ + baseUrl, + clientId, + clientSecret, +}: { + baseUrl: string + clientId: string + clientSecret?: string +}): Promise { + // If not, get a new one and store it + const authResponse = await fetch(`${baseUrl}/oauth/token`, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + Accept: 'application/json', + }, + body: `client_id=${clientId}&client_secret=${clientSecret}&grant_type=client_credentials`, + }) + + // If something failed getting the auth response + if (!authResponse.ok) { + // Get the body of it + const error = await authResponse.json() + + // And return an error + throw new FetcherError({ + errors: [{ message: error.error_description.Code }], + status: error.error_description.HttpStatus, + }) + } + + // Return the token + return authResponse + .json() + .then((response: { access_token: string }) => response.access_token) +} + +export async function fetchData(opts: { + token: string + path: string + method: string + config: OrdercloudConfig + fetchOptions?: Record + body?: Record +}): Promise { + // Destructure opts + const { path, body, fetchOptions, config, token, method = 'GET' } = opts + + // Do the request with the correct headers + const dataResponse = await fetch( + `${config.commerceUrl}/${config.apiVersion}${path}`, + { + ...fetchOptions, + method, + headers: { + ...fetchOptions?.headers, + 'Content-Type': 'application/json', + accept: 'application/json, text/plain, */*', + authorization: `Bearer ${token}`, + }, + body: body ? JSON.stringify(body) : undefined, + } + ) + + // If something failed getting the data response + if (!dataResponse.ok) { + // Get the body of it + const error = await dataResponse.textConverted() + + // And return an error + throw new FetcherError({ + errors: [{ message: error || dataResponse.statusText }], + status: dataResponse.status, + }) + } + + try { + // Return data response as json + return (await dataResponse.json()) as Promise + } catch (error) { + // If response is empty return it as text + return null as unknown as Promise + } +} + +export const createMiddlewareFetcher: ( + getConfig: () => OrdercloudConfig +) => ( + method: string, + path: string, + body?: Record, + fetchOptions?: Record +) => Promise = + (getConfig) => + async ( + method: string, + path: string, + body?: Record, + fetchOptions?: Record + ) => { + // Get provider config + const config = getConfig() + + // Get a token + const token = await getToken({ + baseUrl: config.commerceUrl, + clientId: process.env.ORDERCLOUD_MIDDLEWARE_CLIENT_ID as string, + clientSecret: process.env.ORDERCLOUD_MIDDLEWARE_CLIENT_SECRET, + }) + + // Return the data and specify the expected type + return fetchData({ + token, + fetchOptions, + method, + config, + path, + body, + }) + } + +export const createBuyerFetcher: ( + getConfig: () => OrdercloudConfig +) => ( + method: string, + path: string, + body?: Record, + fetchOptions?: Record +) => Promise = + (getConfig) => + async ( + method: string, + path: string, + body?: Record, + fetchOptions?: Record + ) => { + const customGlobal = global as unknown as CustomNodeJsGlobal; + + // Get provider config + const config = getConfig() + + + // If a token was passed, set it on global + if (fetchOptions?.token) { + customGlobal.token = fetchOptions.token + } + + // Get a token + if (!customGlobal.token) { + customGlobal.token = await getToken({ + baseUrl: config.commerceUrl, + clientId: process.env.ORDERCLOUD_BUYER_CLIENT_ID as string, + }) + } + + // Return the data and specify the expected type + const data = await fetchData({ + token: customGlobal.token as string, + fetchOptions, + config, + method, + path, + body, + }) + + return { + ...data, + meta: { token: customGlobal.token as string }, + } + } diff --git a/packages/ordercloud/src/auth/index.ts b/packages/ordercloud/src/auth/index.ts new file mode 100644 index 000000000..36e757a89 --- /dev/null +++ b/packages/ordercloud/src/auth/index.ts @@ -0,0 +1,3 @@ +export { default as useLogin } from './use-login' +export { default as useLogout } from './use-logout' +export { default as useSignup } from './use-signup' diff --git a/packages/ordercloud/src/auth/use-login.tsx b/packages/ordercloud/src/auth/use-login.tsx new file mode 100644 index 000000000..20e3ed229 --- /dev/null +++ b/packages/ordercloud/src/auth/use-login.tsx @@ -0,0 +1,16 @@ +import { MutationHook } from '@vercel/commerce/utils/types' +import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login' + +export default useLogin as UseLogin + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher() { + return null + }, + useHook: () => () => { + return async function () {} + }, +} diff --git a/packages/ordercloud/src/auth/use-logout.tsx b/packages/ordercloud/src/auth/use-logout.tsx new file mode 100644 index 000000000..4e74908f3 --- /dev/null +++ b/packages/ordercloud/src/auth/use-logout.tsx @@ -0,0 +1,17 @@ +import { MutationHook } from '@vercel/commerce/utils/types' +import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout' + +export default useLogout as UseLogout + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher() { + return null + }, + useHook: + ({ fetch }) => + () => + async () => {}, +} diff --git a/packages/ordercloud/src/auth/use-signup.tsx b/packages/ordercloud/src/auth/use-signup.tsx new file mode 100644 index 000000000..e48811403 --- /dev/null +++ b/packages/ordercloud/src/auth/use-signup.tsx @@ -0,0 +1,19 @@ +import { useCallback } from 'react' +import useCustomer from '../customer/use-customer' +import { MutationHook } from '@vercel/commerce/utils/types' +import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup' + +export default useSignup as UseSignup + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher() { + return null + }, + useHook: + ({ fetch }) => + () => + () => {}, +} diff --git a/packages/ordercloud/src/cart/index.ts b/packages/ordercloud/src/cart/index.ts new file mode 100644 index 000000000..3b8ba990e --- /dev/null +++ b/packages/ordercloud/src/cart/index.ts @@ -0,0 +1,4 @@ +export { default as useCart } from './use-cart' +export { default as useAddItem } from './use-add-item' +export { default as useRemoveItem } from './use-remove-item' +export { default as useUpdateItem } from './use-update-item' diff --git a/packages/ordercloud/src/cart/use-add-item.tsx b/packages/ordercloud/src/cart/use-add-item.tsx new file mode 100644 index 000000000..c9d315301 --- /dev/null +++ b/packages/ordercloud/src/cart/use-add-item.tsx @@ -0,0 +1,48 @@ +import type { AddItemHook } from '@vercel/commerce/types/cart' +import type { MutationHook } from '@vercel/commerce/utils/types' + +import { useCallback } from 'react' +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 + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/cart', + method: 'POST', + }, + async fetcher({ input: item, options, fetch }) { + if ( + item.quantity && + (!Number.isInteger(item.quantity) || item.quantity! < 1) + ) { + throw new CommerceError({ + message: 'The item quantity has to be a valid integer greater than 0', + }) + } + + const data = await fetch({ + ...options, + body: { item }, + }) + + return data + }, + useHook: ({ fetch }) => + function useHook() { + const { mutate } = useCart() + + return useCallback( + async function addItem(input) { + const data = await fetch({ input }) + + await mutate(data, false) + + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/ordercloud/src/cart/use-cart.tsx b/packages/ordercloud/src/cart/use-cart.tsx new file mode 100644 index 000000000..01c3a1cab --- /dev/null +++ b/packages/ordercloud/src/cart/use-cart.tsx @@ -0,0 +1,33 @@ +import type { GetCartHook } from '@vercel/commerce/types/cart' + +import { useMemo } from 'react' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCart, { UseCart } from '@vercel/commerce/cart/use-cart' + +export default useCart as UseCart + +export const handler: SWRHook = { + fetchOptions: { + url: '/api/cart', + method: 'GET', + }, + useHook: ({ useData }) => + function useHook(input) { + const response = useData({ + swrOptions: { revalidateOnFocus: false, ...input?.swrOptions }, + }) + + return useMemo( + () => + Object.create(response, { + isEmpty: { + get() { + return (response.data?.lineItems?.length ?? 0) <= 0 + }, + enumerable: true, + }, + }), + [response] + ) + }, +} diff --git a/packages/ordercloud/src/cart/use-remove-item.tsx b/packages/ordercloud/src/cart/use-remove-item.tsx new file mode 100644 index 000000000..fba15f8d5 --- /dev/null +++ b/packages/ordercloud/src/cart/use-remove-item.tsx @@ -0,0 +1,60 @@ +import type { + MutationHookContext, + HookFetcherContext, +} from '@vercel/commerce/utils/types' +import type { Cart, LineItem, RemoveItemHook } from '@vercel/commerce/types/cart' + +import { useCallback } from 'react' + +import { ValidationError } from '@vercel/commerce/utils/errors' +import useRemoveItem, { UseRemoveItem } from '@vercel/commerce/cart/use-remove-item' + +import useCart from './use-cart' + +export type RemoveItemFn = T extends LineItem + ? (input?: RemoveItemActionInput) => Promise + : (input: RemoveItemActionInput) => Promise + +export type RemoveItemActionInput = T extends LineItem + ? Partial + : RemoveItemHook['actionInput'] + +export default useRemoveItem as UseRemoveItem + +export const handler = { + fetchOptions: { + url: '/api/cart', + method: 'DELETE', + }, + async fetcher({ + input: { itemId }, + options, + fetch, + }: HookFetcherContext) { + return await fetch({ ...options, body: { itemId } }) + }, + useHook: ({ fetch }: MutationHookContext) => + function useHook( + ctx: { item?: T } = {} + ) { + const { item } = ctx + const { mutate } = useCart() + const removeItem: RemoveItemFn = async (input) => { + const itemId = input?.id ?? item?.id + + if (!itemId) { + throw new ValidationError({ + message: 'Invalid input used for this operation', + }) + } + + const data = await fetch({ input: { itemId } }) + + await mutate(data, false) + + return data + } + + return useCallback(removeItem as RemoveItemFn, [fetch, mutate]) + }, +} diff --git a/packages/ordercloud/src/cart/use-update-item.tsx b/packages/ordercloud/src/cart/use-update-item.tsx new file mode 100644 index 000000000..7a5f6fcf7 --- /dev/null +++ b/packages/ordercloud/src/cart/use-update-item.tsx @@ -0,0 +1,93 @@ +import type { + HookFetcherContext, + MutationHookContext, +} 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 '@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' + +export type UpdateItemActionInput = T extends LineItem + ? Partial + : UpdateItemHook['actionInput'] + +export default useUpdateItem as UseUpdateItem + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/cart', + method: 'PUT', + }, + async fetcher({ + input: { itemId, item }, + options, + fetch, + }: HookFetcherContext) { + if (Number.isInteger(item.quantity)) { + // Also allow the update hook to remove an item if the quantity is lower than 1 + if (item.quantity! < 1) { + return removeItemHandler.fetcher({ + options: removeItemHandler.fetchOptions, + input: { itemId }, + fetch, + }) + } + } else if (item.quantity) { + throw new ValidationError({ + message: 'The item quantity has to be a valid integer', + }) + } + + return await fetch({ + ...options, + body: { itemId, item }, + }) + }, + useHook: ({ fetch }: MutationHookContext) => + function useHook( + ctx: { + item?: T + wait?: number + } = {} + ) { + const { item } = ctx + const { mutate } = useCart() as any + + return useCallback( + debounce(async (input: UpdateItemActionInput) => { + const itemId = input.id ?? item?.id + const productId = input.productId ?? item?.productId + const variantId = input.productId ?? item?.variantId + + if (!itemId || !productId) { + throw new ValidationError({ + message: 'Invalid input used for this operation', + }) + } + + const data = await fetch({ + input: { + itemId, + item: { + productId, + variantId: variantId || '', + quantity: input.quantity, + }, + }, + }) + + await mutate(data, false) + + return data + }, ctx.wait ?? 500), + [fetch, mutate] + ) + }, +} diff --git a/packages/ordercloud/src/checkout/index.ts b/packages/ordercloud/src/checkout/index.ts new file mode 100644 index 000000000..306621059 --- /dev/null +++ b/packages/ordercloud/src/checkout/index.ts @@ -0,0 +1,2 @@ +export { default as useSubmitCheckout } from './use-submit-checkout' +export { default as useCheckout } from './use-checkout' diff --git a/packages/ordercloud/src/checkout/use-checkout.tsx b/packages/ordercloud/src/checkout/use-checkout.tsx new file mode 100644 index 000000000..f60ebfdd9 --- /dev/null +++ b/packages/ordercloud/src/checkout/use-checkout.tsx @@ -0,0 +1,41 @@ +import type { GetCheckoutHook } from '@vercel/commerce/types/checkout' + +import { useMemo } from 'react' +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 + +export const handler: SWRHook = { + fetchOptions: { + url: '/api/checkout', + method: 'GET', + }, + useHook: ({ useData }) => + function useHook(input) { + const submit = useSubmitCheckout() + const response = useData({ + swrOptions: { revalidateOnFocus: false, ...input?.swrOptions }, + }) + + return useMemo( + () => + Object.create(response, { + isEmpty: { + get() { + return (response.data?.lineItems?.length ?? 0) <= 0 + }, + enumerable: true, + }, + submit: { + get() { + return submit + }, + enumerable: true, + }, + }), + [response, submit] + ) + }, +} diff --git a/packages/ordercloud/src/checkout/use-submit-checkout.tsx b/packages/ordercloud/src/checkout/use-submit-checkout.tsx new file mode 100644 index 000000000..79c438499 --- /dev/null +++ b/packages/ordercloud/src/checkout/use-submit-checkout.tsx @@ -0,0 +1,38 @@ +import type { SubmitCheckoutHook } from '@vercel/commerce/types/checkout' +import type { MutationHook } from '@vercel/commerce/utils/types' + +import { useCallback } from 'react' +import useSubmitCheckout, { + UseSubmitCheckout, +} from '@vercel/commerce/checkout/use-submit-checkout' + +export default useSubmitCheckout as UseSubmitCheckout + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/checkout', + method: 'POST', + }, + async fetcher({ input: item, options, fetch }) { + // @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({ + ...options, + body: { item }, + }) + + return data + }, + useHook: ({ fetch }) => + function useHook() { + return useCallback( + async function onSubmitCheckout(input) { + const data = await fetch({ input }) + + return data + }, + [fetch] + ) + }, +} diff --git a/commerce.config.json b/packages/ordercloud/src/commerce.config.json similarity index 65% rename from commerce.config.json rename to packages/ordercloud/src/commerce.config.json index 2c2f7d2c2..e329bd4c1 100644 --- a/commerce.config.json +++ b/packages/ordercloud/src/commerce.config.json @@ -1,10 +1,10 @@ { - "provider": "reactioncommerce", + "provider": "ordercloud", "features": { + "wishlist": false, "cart": true, "search": true, - "wishlist": false, - "customerAuth": true, + "customerAuth": false, "customCheckout": true } } diff --git a/packages/ordercloud/src/constants.ts b/packages/ordercloud/src/constants.ts new file mode 100644 index 000000000..d89b13f64 --- /dev/null +++ b/packages/ordercloud/src/constants.ts @@ -0,0 +1,6 @@ +export const CART_COOKIE = 'ordercloud.cart' +export const TOKEN_COOKIE = 'ordercloud.token' +export const CUSTOMER_COOKIE = 'ordercloud.customer' +export const API_URL = 'https://sandboxapi.ordercloud.io' +export const API_VERSION = 'v1' +export const LOCALE = 'en-us' diff --git a/packages/ordercloud/src/customer/address/index.ts b/packages/ordercloud/src/customer/address/index.ts new file mode 100644 index 000000000..02c73e53b --- /dev/null +++ b/packages/ordercloud/src/customer/address/index.ts @@ -0,0 +1,4 @@ +export { default as useAddresses } from './use-addresses' +export { default as useAddItem } from './use-add-item' +export { default as useRemoveItem } from './use-remove-item' +export { default as useUpdateItem } from './use-update-item' diff --git a/packages/ordercloud/src/customer/address/use-add-item.tsx b/packages/ordercloud/src/customer/address/use-add-item.tsx new file mode 100644 index 000000000..798f5fe22 --- /dev/null +++ b/packages/ordercloud/src/customer/address/use-add-item.tsx @@ -0,0 +1,38 @@ +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 '@vercel/commerce/customer/address/use-add-item' +import useAddresses from './use-addresses' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/customer/address', + method: 'POST', + }, + async fetcher({ input: item, options, fetch }) { + const data = await fetch({ + ...options, + body: { item }, + }) + + return data + }, + useHook: ({ fetch }) => + function useHook() { + const { mutate } = useAddresses() + + return useCallback( + async function addItem(input) { + const data = await fetch({ input }) + + await mutate([data], false) + + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/ordercloud/src/customer/address/use-addresses.tsx b/packages/ordercloud/src/customer/address/use-addresses.tsx new file mode 100644 index 000000000..fd6807a25 --- /dev/null +++ b/packages/ordercloud/src/customer/address/use-addresses.tsx @@ -0,0 +1,35 @@ +import type { GetAddressesHook } from '@vercel/commerce/types/customer/address' + +import { useMemo } from 'react' +import { SWRHook } from '@vercel/commerce/utils/types' +import useAddresses, { + UseAddresses, +} from '@vercel/commerce/customer/address/use-addresses' + +export default useAddresses as UseAddresses + +export const handler: SWRHook = { + fetchOptions: { + url: '/api/customer/address', + method: 'GET', + }, + useHook: ({ useData }) => + function useHook(input) { + const response = useData({ + swrOptions: { revalidateOnFocus: false, ...input?.swrOptions }, + }) + + return useMemo( + () => + Object.create(response, { + isEmpty: { + get() { + return (response.data?.length ?? 0) <= 0 + }, + enumerable: true, + }, + }), + [response] + ) + }, +} diff --git a/packages/ordercloud/src/customer/address/use-remove-item.tsx b/packages/ordercloud/src/customer/address/use-remove-item.tsx new file mode 100644 index 000000000..ac805dbc5 --- /dev/null +++ b/packages/ordercloud/src/customer/address/use-remove-item.tsx @@ -0,0 +1,62 @@ +import type { + MutationHookContext, + HookFetcherContext, +} from '@vercel/commerce/utils/types' +import type { Address, RemoveItemHook } from '@vercel/commerce/types/customer/address' + +import { useCallback } from 'react' + +import { ValidationError } from '@vercel/commerce/utils/errors' +import useRemoveItem, { + UseRemoveItem, +} from '@vercel/commerce/customer/address/use-remove-item' + +import useAddresses from './use-addresses' + +export type RemoveItemFn = T extends Address + ? (input?: RemoveItemActionInput) => Promise

+ : (input: RemoveItemActionInput) => Promise
+ +export type RemoveItemActionInput = T extends Address + ? Partial + : RemoveItemHook['actionInput'] + +export default useRemoveItem as UseRemoveItem + +export const handler = { + fetchOptions: { + url: '/api/customer/address', + method: 'DELETE', + }, + async fetcher({ + input: { itemId }, + options, + fetch, + }: HookFetcherContext) { + return await fetch({ ...options, body: { itemId } }) + }, + useHook: ({ fetch }: MutationHookContext) => + function useHook( + ctx: { item?: T } = {} + ) { + const { item } = ctx + const { mutate } = useAddresses() + const removeItem: RemoveItemFn
= async (input) => { + const itemId = input?.id ?? item?.id + + if (!itemId) { + throw new ValidationError({ + message: 'Invalid input used for this operation', + }) + } + + const data = await fetch({ input: { itemId } }) + + await mutate([], false) + + return data + } + + return useCallback(removeItem as RemoveItemFn, [fetch, mutate]) + }, +} diff --git a/packages/ordercloud/src/customer/address/use-update-item.tsx b/packages/ordercloud/src/customer/address/use-update-item.tsx new file mode 100644 index 000000000..d65956b7b --- /dev/null +++ b/packages/ordercloud/src/customer/address/use-update-item.tsx @@ -0,0 +1,52 @@ +import type { + HookFetcherContext, + MutationHookContext, +} from '@vercel/commerce/utils/types' +import type { UpdateItemHook, Address } from '@vercel/commerce/types/customer/address' + +import { useCallback } from 'react' + +import { MutationHook } from '@vercel/commerce/utils/types' +import useUpdateItem, { + UseUpdateItem, +} from '@vercel/commerce/customer/address/use-update-item' + +import useAddresses from './use-addresses' + +export type UpdateItemActionInput = T extends Address + ? Partial + : UpdateItemHook['actionInput'] + +export default useUpdateItem as UseUpdateItem + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/customer/address', + method: 'PUT', + }, + async fetcher({ + input: { itemId, item }, + options, + fetch, + }: HookFetcherContext) { + return await fetch({ + ...options, + body: { itemId, item }, + }) + }, + useHook: ({ fetch }: MutationHookContext) => + function useHook() { + const { mutate } = useAddresses() + + return useCallback( + async function updateItem(input) { + const data = await fetch({ input }) + + await mutate([], false) + + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/ordercloud/src/customer/card/index.ts b/packages/ordercloud/src/customer/card/index.ts new file mode 100644 index 000000000..357d30500 --- /dev/null +++ b/packages/ordercloud/src/customer/card/index.ts @@ -0,0 +1,4 @@ +export { default as useCards } from './use-cards' +export { default as useAddItem } from './use-add-item' +export { default as useRemoveItem } from './use-remove-item' +export { default as useUpdateItem } from './use-update-item' diff --git a/packages/ordercloud/src/customer/card/use-add-item.tsx b/packages/ordercloud/src/customer/card/use-add-item.tsx new file mode 100644 index 000000000..8e7d27885 --- /dev/null +++ b/packages/ordercloud/src/customer/card/use-add-item.tsx @@ -0,0 +1,38 @@ +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 '@vercel/commerce/customer/card/use-add-item' +import useCards from './use-cards' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/customer/card', + method: 'POST', + }, + async fetcher({ input: item, options, fetch }) { + const data = await fetch({ + ...options, + body: { item }, + }) + + return data + }, + useHook: ({ fetch }) => + function useHook() { + const { mutate } = useCards() + + return useCallback( + async function addItem(input) { + const data = await fetch({ input }) + + await mutate([data], false) + + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/ordercloud/src/customer/card/use-cards.tsx b/packages/ordercloud/src/customer/card/use-cards.tsx new file mode 100644 index 000000000..6438543e1 --- /dev/null +++ b/packages/ordercloud/src/customer/card/use-cards.tsx @@ -0,0 +1,33 @@ +import type { GetCardsHook } from '@vercel/commerce/types/customer/card' + +import { useMemo } from 'react' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCard, { UseCards } from '@vercel/commerce/customer/card/use-cards' + +export default useCard as UseCards + +export const handler: SWRHook = { + fetchOptions: { + url: '/api/customer/card', + method: 'GET', + }, + useHook: ({ useData }) => + function useHook(input) { + const response = useData({ + swrOptions: { revalidateOnFocus: false, ...input?.swrOptions }, + }) + + return useMemo( + () => + Object.create(response, { + isEmpty: { + get() { + return (response.data?.length ?? 0) <= 0 + }, + enumerable: true, + }, + }), + [response] + ) + }, +} diff --git a/packages/ordercloud/src/customer/card/use-remove-item.tsx b/packages/ordercloud/src/customer/card/use-remove-item.tsx new file mode 100644 index 000000000..23979bf3f --- /dev/null +++ b/packages/ordercloud/src/customer/card/use-remove-item.tsx @@ -0,0 +1,62 @@ +import type { + MutationHookContext, + HookFetcherContext, +} from '@vercel/commerce/utils/types' +import type { Card, RemoveItemHook } from '@vercel/commerce/types/customer/card' + +import { useCallback } from 'react' + +import { ValidationError } from '@vercel/commerce/utils/errors' +import useRemoveItem, { + UseRemoveItem, +} from '@vercel/commerce/customer/card/use-remove-item' + +import useCards from './use-cards' + +export type RemoveItemFn = T extends Card + ? (input?: RemoveItemActionInput) => Promise + : (input: RemoveItemActionInput) => Promise + +export type RemoveItemActionInput = T extends Card + ? Partial + : RemoveItemHook['actionInput'] + +export default useRemoveItem as UseRemoveItem + +export const handler = { + fetchOptions: { + url: '/api/customer/card', + method: 'DELETE', + }, + async fetcher({ + input: { itemId }, + options, + fetch, + }: HookFetcherContext) { + return await fetch({ ...options, body: { itemId } }) + }, + useHook: ({ fetch }: MutationHookContext) => + function useHook( + ctx: { item?: T } = {} + ) { + const { item } = ctx + const { mutate } = useCards() + const removeItem: RemoveItemFn = async (input) => { + const itemId = input?.id ?? item?.id + + if (!itemId) { + throw new ValidationError({ + message: 'Invalid input used for this operation', + }) + } + + const data = await fetch({ input: { itemId } }) + + await mutate([], false) + + return data + } + + return useCallback(removeItem as RemoveItemFn, [fetch, mutate]) + }, +} diff --git a/packages/ordercloud/src/customer/card/use-update-item.tsx b/packages/ordercloud/src/customer/card/use-update-item.tsx new file mode 100644 index 000000000..faa900744 --- /dev/null +++ b/packages/ordercloud/src/customer/card/use-update-item.tsx @@ -0,0 +1,52 @@ +import type { + HookFetcherContext, + MutationHookContext, +} from '@vercel/commerce/utils/types' +import type { UpdateItemHook, Card } from '@vercel/commerce/types/customer/card' + +import { useCallback } from 'react' + +import { MutationHook } from '@vercel/commerce/utils/types' +import useUpdateItem, { + UseUpdateItem, +} from '@vercel/commerce/customer/card/use-update-item' + +import useCards from './use-cards' + +export type UpdateItemActionInput = T extends Card + ? Partial + : UpdateItemHook['actionInput'] + +export default useUpdateItem as UseUpdateItem + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/customer/card', + method: 'PUT', + }, + async fetcher({ + input: { itemId, item }, + options, + fetch, + }: HookFetcherContext) { + return await fetch({ + ...options, + body: { itemId, item }, + }) + }, + useHook: ({ fetch }: MutationHookContext) => + function useHook() { + const { mutate } = useCards() + + return useCallback( + async function updateItem(input) { + const data = await fetch({ input }) + + await mutate([], false) + + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/framework/shopify/customer/index.ts b/packages/ordercloud/src/customer/index.ts similarity index 100% rename from framework/shopify/customer/index.ts rename to packages/ordercloud/src/customer/index.ts diff --git a/framework/local/customer/use-customer.tsx b/packages/ordercloud/src/customer/use-customer.tsx similarity index 66% rename from framework/local/customer/use-customer.tsx rename to packages/ordercloud/src/customer/use-customer.tsx index 41757cd0d..6eaede14f 100644 --- a/framework/local/customer/use-customer.tsx +++ b/packages/ordercloud/src/customer/use-customer.tsx @@ -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 export const handler: SWRHook = { diff --git a/packages/ordercloud/src/fetcher.ts b/packages/ordercloud/src/fetcher.ts new file mode 100644 index 000000000..1da35718e --- /dev/null +++ b/packages/ordercloud/src/fetcher.ts @@ -0,0 +1,17 @@ +import { Fetcher } from '@vercel/commerce/utils/types' + +const clientFetcher: Fetcher = async ({ method, url, body }) => { + const response = await fetch(url!, { + method, + body: body ? JSON.stringify(body) : undefined, + headers: { + 'Content-Type': 'application/json', + }, + }) + .then((response) => response.json()) + .then((response) => response.data) + + return response +} + +export default clientFetcher diff --git a/packages/ordercloud/src/index.tsx b/packages/ordercloud/src/index.tsx new file mode 100644 index 000000000..b282942e8 --- /dev/null +++ b/packages/ordercloud/src/index.tsx @@ -0,0 +1,9 @@ +import { ordercloudProvider, OrdercloudProvider } from './provider' +import { getCommerceProvider, useCommerce as useCoreCommerce } from '@vercel/commerce' + +export { ordercloudProvider } +export type { OrdercloudProvider } + +export const CommerceProvider = getCommerceProvider(ordercloudProvider) + +export const useCommerce = () => useCoreCommerce() diff --git a/framework/vendure/next.config.js b/packages/ordercloud/src/next.config.cjs similarity index 62% rename from framework/vendure/next.config.js rename to packages/ordercloud/src/next.config.cjs index 96153ad1e..793a4589f 100644 --- a/framework/vendure/next.config.js +++ b/packages/ordercloud/src/next.config.cjs @@ -3,6 +3,6 @@ const commerce = require('./commerce.config.json') module.exports = { commerce, images: { - domains: ['localhost', 'demo.vendure.io'], + domains: ['localhost', 'ocdevops.blob.core.windows.net'], }, } diff --git a/packages/ordercloud/src/product/index.ts b/packages/ordercloud/src/product/index.ts new file mode 100644 index 000000000..426a3edcd --- /dev/null +++ b/packages/ordercloud/src/product/index.ts @@ -0,0 +1,2 @@ +export { default as usePrice } from './use-price' +export { default as useSearch } from './use-search' diff --git a/packages/ordercloud/src/product/use-price.tsx b/packages/ordercloud/src/product/use-price.tsx new file mode 100644 index 000000000..fd42d7033 --- /dev/null +++ b/packages/ordercloud/src/product/use-price.tsx @@ -0,0 +1,2 @@ +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/packages/ordercloud/src/product/use-search.tsx b/packages/ordercloud/src/product/use-search.tsx new file mode 100644 index 000000000..0cb54e92c --- /dev/null +++ b/packages/ordercloud/src/product/use-search.tsx @@ -0,0 +1,41 @@ +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 + +export const handler: SWRHook = { + fetchOptions: { + url: '/api/catalog/products', + method: 'GET', + }, + fetcher({ input: { search, categoryId, brandId, sort }, options, fetch }) { + // Use a dummy base as we only care about the relative path + const url = new URL(options.url!, 'http://a') + + if (search) url.searchParams.set('search', String(search)) + if (categoryId) url.searchParams.set('categoryId', String(categoryId)) + if (brandId) url.searchParams.set('brandId', String(brandId)) + if (sort) url.searchParams.set('sort', String(sort)) + + return fetch({ + url: url.pathname + url.search, + method: options.method, + }) + }, + useHook: + ({ useData }) => + (input = {}) => { + return useData({ + input: [ + ['search', input.search], + ['categoryId', input.categoryId], + ['brandId', input.brandId], + ['sort', input.sort], + ], + swrOptions: { + revalidateOnFocus: false, + ...input.swrOptions, + }, + }) + }, +} diff --git a/packages/ordercloud/src/provider.ts b/packages/ordercloud/src/provider.ts new file mode 100644 index 000000000..7ae3f1d24 --- /dev/null +++ b/packages/ordercloud/src/provider.ts @@ -0,0 +1,62 @@ +import { handler as useCart } from './cart/use-cart' +import { handler as useAddCartItem } from './cart/use-add-item' +import { handler as useUpdateCartItem } from './cart/use-update-item' +import { handler as useRemoveCartItem } from './cart/use-remove-item' + +import { handler as useCustomer } from './customer/use-customer' +import { handler as useSearch } from './product/use-search' + +import { handler as useLogin } from './auth/use-login' +import { handler as useLogout } from './auth/use-logout' +import { handler as useSignup } from './auth/use-signup' + +import { handler as useCheckout } from './checkout/use-checkout' +import { handler as useSubmitCheckout } from './checkout/use-submit-checkout' + +import { handler as useCards } from './customer/card/use-cards' +import { handler as useAddCardItem } from './customer/card/use-add-item' +import { handler as useUpdateCardItem } from './customer/card/use-update-item' +import { handler as useRemoveCardItem } from './customer/card/use-remove-item' + +import { handler as useAddresses } from './customer/address/use-addresses' +import { handler as useAddAddressItem } from './customer/address/use-add-item' +import { handler as useUpdateAddressItem } from './customer/address/use-update-item' +import { handler as useRemoveAddressItem } from './customer/address/use-remove-item' + +import { CART_COOKIE, LOCALE } from './constants' +import { default as fetcher } from './fetcher' + +export const ordercloudProvider = { + locale: LOCALE, + cartCookie: CART_COOKIE, + fetcher, + cart: { + useCart, + useAddItem: useAddCartItem, + useUpdateItem: useUpdateCartItem, + useRemoveItem: useRemoveCartItem, + }, + checkout: { + useCheckout, + useSubmitCheckout, + }, + customer: { + useCustomer, + card: { + useCards, + useAddItem: useAddCardItem, + useUpdateItem: useUpdateCardItem, + useRemoveItem: useRemoveCardItem, + }, + address: { + useAddresses, + useAddItem: useAddAddressItem, + useUpdateItem: useUpdateAddressItem, + useRemoveItem: useRemoveAddressItem, + }, + }, + products: { useSearch }, + auth: { useLogin, useLogout, useSignup }, +} + +export type OrdercloudProvider = typeof ordercloudProvider diff --git a/packages/ordercloud/src/types/cart.ts b/packages/ordercloud/src/types/cart.ts new file mode 100644 index 000000000..389a5a666 --- /dev/null +++ b/packages/ordercloud/src/types/cart.ts @@ -0,0 +1,126 @@ +import * as Core from '@vercel/commerce/types/cart' + +export * from '@vercel/commerce/types/cart' + +export interface OrdercloudCart { + ID: string + FromUser: { + ID: string + Username: string + Password: null + FirstName: string + LastName: string + Email: string + Phone: null + TermsAccepted: null + Active: true + xp: { + something: string + currency: string + } + AvailableRoles: null + DateCreated: string + PasswordLastSetDate: null + } + FromCompanyID: string + ToCompanyID: string + FromUserID: string + BillingAddressID: null + BillingAddress: null + ShippingAddressID: null + Comments: null + LineItemCount: number + Status: string + DateCreated: string + DateSubmitted: null + DateApproved: null + DateDeclined: null + DateCanceled: null + DateCompleted: null + LastUpdated: string + Subtotal: number + ShippingCost: number + TaxCost: number + PromotionDiscount: number + Total: number + IsSubmitted: false + xp: { + productId: string + variantId: string + quantity: 1 + } +} + +export interface OrdercloudLineItem { + ID: string + ProductID: string + Quantity: 1 + DateAdded: string + QuantityShipped: number + UnitPrice: number + PromotionDiscount: number + LineTotal: number + LineSubtotal: number + CostCenter: null + DateNeeded: null + ShippingAccount: null + ShippingAddressID: null + ShipFromAddressID: null + Product: { + ID: string + Name: string + Description: string + QuantityMultiplier: number + ShipWeight: number + ShipHeight: null + ShipWidth: null + ShipLength: null + xp: { + Images: { + url: string + }[] + } + } + Variant: null | { + ID: string + Name: null + Description: null + ShipWeight: null + ShipHeight: null + ShipWidth: null + ShipLength: null + xp: null + } + ShippingAddress: null + ShipFromAddress: null + SupplierID: null + Specs: [] + xp: null +} + +/** + * Extend core cart types + */ + +export type Cart = Core.Cart & { + lineItems: Core.LineItem[] + url?: string +} + +export type CartTypes = Core.CartTypes + +export type CartHooks = Core.CartHooks + +export type GetCartHook = CartHooks['getCart'] +export type AddItemHook = CartHooks['addItem'] +export type UpdateItemHook = CartHooks['updateItem'] +export type RemoveItemHook = CartHooks['removeItem'] + +export type CartSchema = Core.CartSchema + +export type CartHandlers = Core.CartHandlers + +export type GetCartHandler = CartHandlers['getCart'] +export type AddItemHandler = CartHandlers['addItem'] +export type UpdateItemHandler = CartHandlers['updateItem'] +export type RemoveItemHandler = CartHandlers['removeItem'] diff --git a/packages/ordercloud/src/types/category.ts b/packages/ordercloud/src/types/category.ts new file mode 100644 index 000000000..247844a56 --- /dev/null +++ b/packages/ordercloud/src/types/category.ts @@ -0,0 +1,10 @@ +export interface RawCategory { + ID: string + Name: string + Description: null | string + ListOrder: number + Active: boolean + ParentID: null + ChildCount: number + xp: null +} diff --git a/packages/ordercloud/src/types/checkout.ts b/packages/ordercloud/src/types/checkout.ts new file mode 100644 index 000000000..976d78e7a --- /dev/null +++ b/packages/ordercloud/src/types/checkout.ts @@ -0,0 +1,4 @@ +import * as Core from '@vercel/commerce/types/checkout' + +export type CheckoutTypes = Core.CheckoutTypes +export type CheckoutSchema = Core.CheckoutSchema diff --git a/packages/ordercloud/src/types/customer/address.ts b/packages/ordercloud/src/types/customer/address.ts new file mode 100644 index 000000000..3576b676c --- /dev/null +++ b/packages/ordercloud/src/types/customer/address.ts @@ -0,0 +1,32 @@ +import * as Core from '@vercel/commerce/types/customer/address' + +export type CustomerAddressTypes = Core.CustomerAddressTypes +export type CustomerAddressSchema = + Core.CustomerAddressSchema + +export interface OrdercloudAddress { + ID: string + FromCompanyID: string + ToCompanyID: string + FromUserID: string + BillingAddressID: null + BillingAddress: null + ShippingAddressID: null + Comments: null + LineItemCount: number + Status: string + DateCreated: string + DateSubmitted: null + DateApproved: null + DateDeclined: null + DateCanceled: null + DateCompleted: null + LastUpdated: string + Subtotal: number + ShippingCost: number + TaxCost: number + PromotionDiscount: number + Total: number + IsSubmitted: false + xp: null +} diff --git a/packages/ordercloud/src/types/customer/card.ts b/packages/ordercloud/src/types/customer/card.ts new file mode 100644 index 000000000..293d5041a --- /dev/null +++ b/packages/ordercloud/src/types/customer/card.ts @@ -0,0 +1,16 @@ +import * as Core from '@vercel/commerce/types/customer/card' + +export type CustomerCardTypes = Core.CustomerCardTypes +export type CustomerCardSchema = Core.CustomerCardSchema + +export interface OredercloudCreditCard { + ID: string + Editable: boolean + Token: string + DateCreated: string + CardType: string + PartialAccountNumber: string + CardholderName: string + ExpirationDate: string + xp: null +} diff --git a/packages/ordercloud/src/types/node.d.ts b/packages/ordercloud/src/types/node.d.ts new file mode 100644 index 000000000..ee2452c30 --- /dev/null +++ b/packages/ordercloud/src/types/node.d.ts @@ -0,0 +1,3 @@ +export interface CustomNodeJsGlobal extends NodeJS.Global { + token: string | null | undefined +} diff --git a/packages/ordercloud/src/types/product.ts b/packages/ordercloud/src/types/product.ts new file mode 100644 index 000000000..8ccb778d2 --- /dev/null +++ b/packages/ordercloud/src/types/product.ts @@ -0,0 +1,55 @@ +interface RawVariantSpec { + SpecID: string + Name: string + OptionID: string + Value: string + PriceMarkupType: string + PriceMarkup: string | null +} + +export interface RawSpec { + ID: string + Name: string + Options: { + ID: string + Value: string + xp: { + hexColor?: string + } + }[] +} + +export interface RawVariant { + ID: string + Specs: RawVariantSpec[] +} + +export interface RawProduct { + OwnerID: string + DefaultPriceScheduleID: string | null + AutoForward: boolean + ID: string + Name: string + Description: string + QuantityMultiplier: number + ShipWeight: null + ShipHeight: null + ShipWidth: null + ShipLength: null + Active: boolean + SpecCount: number + VariantCount: number + ShipFromAddressID: null + Inventory: null + DefaultSupplierID: null + AllSuppliersCanSell: boolean + xp: { + Price: number + PriceCurrency: string + Images: { + url: string + }[] + Variants?: RawVariant[] + Specs?: RawSpec[] + } +} diff --git a/packages/ordercloud/src/utils/product.ts b/packages/ordercloud/src/utils/product.ts new file mode 100644 index 000000000..6da3bf86b --- /dev/null +++ b/packages/ordercloud/src/utils/product.ts @@ -0,0 +1,47 @@ +import type { Product } from '@vercel/commerce/types/product' + +import type { RawProduct } from '../types/product' + +export function normalize(product: RawProduct): Product { + return { + id: product.ID, + name: product.Name, + description: product.Description, + slug: product.ID, + images: product.xp.Images, + price: { + value: product.xp.Price, + currencyCode: product.xp.PriceCurrency, + }, + variants: product.xp.Variants?.length + ? product.xp.Variants.map((variant) => ({ + id: variant.ID, + options: variant.Specs.map((spec) => ({ + id: spec.SpecID, + __typename: 'MultipleChoiceOption', + displayName: spec.Name, + values: [ + { + label: spec.Value, + }, + ], + })), + })) + : [ + { + id: '', + options: [], + }, + ], + options: product.xp.Specs?.length + ? product.xp.Specs.map((spec) => ({ + id: spec.ID, + displayName: spec.Name, + values: spec.Options.map((option) => ({ + label: option.Value, + ...(option.xp?.hexColor && { hexColors: [option.xp.hexColor] }), + })), + })) + : [], + } +} diff --git a/framework/saleor/wishlist/use-add-item.tsx b/packages/ordercloud/src/wishlist/use-add-item.tsx similarity index 100% rename from framework/saleor/wishlist/use-add-item.tsx rename to packages/ordercloud/src/wishlist/use-add-item.tsx diff --git a/framework/saleor/wishlist/use-remove-item.tsx b/packages/ordercloud/src/wishlist/use-remove-item.tsx similarity index 100% rename from framework/saleor/wishlist/use-remove-item.tsx rename to packages/ordercloud/src/wishlist/use-remove-item.tsx diff --git a/packages/ordercloud/src/wishlist/use-wishlist.tsx b/packages/ordercloud/src/wishlist/use-wishlist.tsx new file mode 100644 index 000000000..b2785d46f --- /dev/null +++ b/packages/ordercloud/src/wishlist/use-wishlist.tsx @@ -0,0 +1,43 @@ +import { HookFetcher } from '@vercel/commerce/utils/types' +import type { Product } from '@vercel/commerce/types/product' + +const defaultOpts = {} + +export type Wishlist = { + items: [ + { + product_id: number + variant_id: number + id: number + product: Product + } + ] +} + +export interface UseWishlistOptions { + includeProducts?: boolean +} + +export interface UseWishlistInput extends UseWishlistOptions { + customerId?: number +} + +export const fetcher: HookFetcher = () => { + return null +} + +export function extendHook( + customFetcher: typeof fetcher, + // swrOptions?: SwrOptions + swrOptions?: any +) { + const useWishlist = ({ includeProducts }: UseWishlistOptions = {}) => { + return { data: null } + } + + useWishlist.extend = extendHook + + return useWishlist +} + +export default extendHook(fetcher) diff --git a/packages/ordercloud/taskfile.js b/packages/ordercloud/taskfile.js new file mode 100644 index 000000000..39b1b2a86 --- /dev/null +++ b/packages/ordercloud/taskfile.js @@ -0,0 +1,20 @@ +export async function build(task, opts) { + await task + .source('src/**/*.+(ts|tsx|js)') + .swc({ dev: opts.dev, outDir: 'dist', baseUrl: 'src' }) + .target('dist') + .source('src/**/*.+(cjs|json)') + .target('dist') + task.$.log('Compiled src files') +} + +export async function release(task) { + await task.clear('dist').start('build') +} + +export default async function dev(task) { + const opts = { dev: true } + await task.clear('dist') + await task.start('build', opts) + await task.watch('src/**/*.+(ts|tsx|js|cjs|json)', 'build', opts) +} diff --git a/packages/ordercloud/tsconfig.json b/packages/ordercloud/tsconfig.json new file mode 100644 index 000000000..cd04ab2ff --- /dev/null +++ b/packages/ordercloud/tsconfig.json @@ -0,0 +1,21 @@ +{ + "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, + "incremental": true, + "jsx": "react-jsx" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/framework/reactioncommerce/.env.template b/packages/reactioncommerce/.env.template similarity index 100% rename from framework/reactioncommerce/.env.template rename to packages/reactioncommerce/.env.template diff --git a/framework/reactioncommerce/README.md b/packages/reactioncommerce/README.md similarity index 100% rename from framework/reactioncommerce/README.md rename to packages/reactioncommerce/README.md diff --git a/framework/reactioncommerce/api/customer.ts b/packages/reactioncommerce/api/customer.ts similarity index 100% rename from framework/reactioncommerce/api/customer.ts rename to packages/reactioncommerce/api/customer.ts diff --git a/framework/reactioncommerce/api/endpoints/cart/add-item.ts b/packages/reactioncommerce/api/endpoints/cart/add-item.ts similarity index 100% rename from framework/reactioncommerce/api/endpoints/cart/add-item.ts rename to packages/reactioncommerce/api/endpoints/cart/add-item.ts diff --git a/framework/reactioncommerce/api/endpoints/cart/get-cart.ts b/packages/reactioncommerce/api/endpoints/cart/get-cart.ts similarity index 100% rename from framework/reactioncommerce/api/endpoints/cart/get-cart.ts rename to packages/reactioncommerce/api/endpoints/cart/get-cart.ts diff --git a/framework/reactioncommerce/api/endpoints/cart/index.ts b/packages/reactioncommerce/api/endpoints/cart/index.ts similarity index 100% rename from framework/reactioncommerce/api/endpoints/cart/index.ts rename to packages/reactioncommerce/api/endpoints/cart/index.ts diff --git a/framework/reactioncommerce/api/endpoints/catalog/get-products.ts b/packages/reactioncommerce/api/endpoints/catalog/get-products.ts similarity index 100% rename from framework/reactioncommerce/api/endpoints/catalog/get-products.ts rename to packages/reactioncommerce/api/endpoints/catalog/get-products.ts diff --git a/framework/reactioncommerce/api/endpoints/catalog/products.ts b/packages/reactioncommerce/api/endpoints/catalog/products.ts similarity index 100% rename from framework/reactioncommerce/api/endpoints/catalog/products.ts rename to packages/reactioncommerce/api/endpoints/catalog/products.ts diff --git a/packages/reactioncommerce/api/endpoints/checkout/index.ts b/packages/reactioncommerce/api/endpoints/checkout/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/reactioncommerce/api/endpoints/checkout/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/reactioncommerce/api/endpoints/customers/index.ts b/packages/reactioncommerce/api/endpoints/customers/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/reactioncommerce/api/endpoints/customers/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/reactioncommerce/api/endpoints/customers/login.ts b/packages/reactioncommerce/api/endpoints/customers/login.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/reactioncommerce/api/endpoints/customers/login.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/reactioncommerce/api/endpoints/customers/logout.ts b/packages/reactioncommerce/api/endpoints/customers/logout.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/reactioncommerce/api/endpoints/customers/logout.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/reactioncommerce/api/endpoints/customers/signup.ts b/packages/reactioncommerce/api/endpoints/customers/signup.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/reactioncommerce/api/endpoints/customers/signup.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/framework/reactioncommerce/api/index.ts b/packages/reactioncommerce/api/index.ts similarity index 100% rename from framework/reactioncommerce/api/index.ts rename to packages/reactioncommerce/api/index.ts diff --git a/framework/reactioncommerce/api/operations/get-all-pages.ts b/packages/reactioncommerce/api/operations/get-all-pages.ts similarity index 100% rename from framework/reactioncommerce/api/operations/get-all-pages.ts rename to packages/reactioncommerce/api/operations/get-all-pages.ts diff --git a/framework/reactioncommerce/api/operations/get-all-product-paths.ts b/packages/reactioncommerce/api/operations/get-all-product-paths.ts similarity index 100% rename from framework/reactioncommerce/api/operations/get-all-product-paths.ts rename to packages/reactioncommerce/api/operations/get-all-product-paths.ts diff --git a/framework/reactioncommerce/api/operations/get-all-products.ts b/packages/reactioncommerce/api/operations/get-all-products.ts similarity index 100% rename from framework/reactioncommerce/api/operations/get-all-products.ts rename to packages/reactioncommerce/api/operations/get-all-products.ts diff --git a/framework/reactioncommerce/api/operations/get-customer-wishlist.ts b/packages/reactioncommerce/api/operations/get-customer-wishlist.ts similarity index 100% rename from framework/reactioncommerce/api/operations/get-customer-wishlist.ts rename to packages/reactioncommerce/api/operations/get-customer-wishlist.ts diff --git a/framework/reactioncommerce/api/operations/get-page.ts b/packages/reactioncommerce/api/operations/get-page.ts similarity index 100% rename from framework/reactioncommerce/api/operations/get-page.ts rename to packages/reactioncommerce/api/operations/get-page.ts diff --git a/framework/reactioncommerce/api/operations/get-product.ts b/packages/reactioncommerce/api/operations/get-product.ts similarity index 100% rename from framework/reactioncommerce/api/operations/get-product.ts rename to packages/reactioncommerce/api/operations/get-product.ts diff --git a/framework/reactioncommerce/api/operations/get-site-info.ts b/packages/reactioncommerce/api/operations/get-site-info.ts similarity index 100% rename from framework/reactioncommerce/api/operations/get-site-info.ts rename to packages/reactioncommerce/api/operations/get-site-info.ts diff --git a/framework/reactioncommerce/api/operations/login.ts b/packages/reactioncommerce/api/operations/login.ts similarity index 100% rename from framework/reactioncommerce/api/operations/login.ts rename to packages/reactioncommerce/api/operations/login.ts diff --git a/framework/reactioncommerce/api/utils/create-api-handler.ts b/packages/reactioncommerce/api/utils/create-api-handler.ts similarity index 100% rename from framework/reactioncommerce/api/utils/create-api-handler.ts rename to packages/reactioncommerce/api/utils/create-api-handler.ts diff --git a/framework/reactioncommerce/api/utils/errors.ts b/packages/reactioncommerce/api/utils/errors.ts similarity index 100% rename from framework/reactioncommerce/api/utils/errors.ts rename to packages/reactioncommerce/api/utils/errors.ts diff --git a/framework/reactioncommerce/api/utils/fetch-all-products.ts b/packages/reactioncommerce/api/utils/fetch-all-products.ts similarity index 100% rename from framework/reactioncommerce/api/utils/fetch-all-products.ts rename to packages/reactioncommerce/api/utils/fetch-all-products.ts diff --git a/framework/reactioncommerce/api/utils/fetch-graphql-api.ts b/packages/reactioncommerce/api/utils/fetch-graphql-api.ts similarity index 100% rename from framework/reactioncommerce/api/utils/fetch-graphql-api.ts rename to packages/reactioncommerce/api/utils/fetch-graphql-api.ts diff --git a/framework/reactioncommerce/api/utils/fetch.ts b/packages/reactioncommerce/api/utils/fetch.ts similarity index 100% rename from framework/reactioncommerce/api/utils/fetch.ts rename to packages/reactioncommerce/api/utils/fetch.ts diff --git a/framework/reactioncommerce/api/utils/get-cart-cookie.ts b/packages/reactioncommerce/api/utils/get-cart-cookie.ts similarity index 100% rename from framework/reactioncommerce/api/utils/get-cart-cookie.ts rename to packages/reactioncommerce/api/utils/get-cart-cookie.ts diff --git a/framework/reactioncommerce/api/utils/get-categories.ts b/packages/reactioncommerce/api/utils/get-categories.ts similarity index 100% rename from framework/reactioncommerce/api/utils/get-categories.ts rename to packages/reactioncommerce/api/utils/get-categories.ts diff --git a/framework/reactioncommerce/api/utils/get-search-variables.ts b/packages/reactioncommerce/api/utils/get-search-variables.ts similarity index 100% rename from framework/reactioncommerce/api/utils/get-search-variables.ts rename to packages/reactioncommerce/api/utils/get-search-variables.ts diff --git a/framework/reactioncommerce/api/utils/get-sort-variables.ts b/packages/reactioncommerce/api/utils/get-sort-variables.ts similarity index 100% rename from framework/reactioncommerce/api/utils/get-sort-variables.ts rename to packages/reactioncommerce/api/utils/get-sort-variables.ts diff --git a/framework/reactioncommerce/api/utils/get-vendors.ts b/packages/reactioncommerce/api/utils/get-vendors.ts similarity index 100% rename from framework/reactioncommerce/api/utils/get-vendors.ts rename to packages/reactioncommerce/api/utils/get-vendors.ts diff --git a/framework/reactioncommerce/api/utils/is-allowed-method.ts b/packages/reactioncommerce/api/utils/is-allowed-method.ts similarity index 100% rename from framework/reactioncommerce/api/utils/is-allowed-method.ts rename to packages/reactioncommerce/api/utils/is-allowed-method.ts diff --git a/framework/reactioncommerce/api/utils/reconcile-carts.ts b/packages/reactioncommerce/api/utils/reconcile-carts.ts similarity index 100% rename from framework/reactioncommerce/api/utils/reconcile-carts.ts rename to packages/reactioncommerce/api/utils/reconcile-carts.ts diff --git a/packages/reactioncommerce/auth/index.ts b/packages/reactioncommerce/auth/index.ts new file mode 100644 index 000000000..36e757a89 --- /dev/null +++ b/packages/reactioncommerce/auth/index.ts @@ -0,0 +1,3 @@ +export { default as useLogin } from './use-login' +export { default as useLogout } from './use-logout' +export { default as useSignup } from './use-signup' diff --git a/framework/reactioncommerce/auth/use-login.tsx b/packages/reactioncommerce/auth/use-login.tsx similarity index 100% rename from framework/reactioncommerce/auth/use-login.tsx rename to packages/reactioncommerce/auth/use-login.tsx diff --git a/framework/reactioncommerce/auth/use-logout.tsx b/packages/reactioncommerce/auth/use-logout.tsx similarity index 100% rename from framework/reactioncommerce/auth/use-logout.tsx rename to packages/reactioncommerce/auth/use-logout.tsx diff --git a/framework/reactioncommerce/auth/use-signup.tsx b/packages/reactioncommerce/auth/use-signup.tsx similarity index 100% rename from framework/reactioncommerce/auth/use-signup.tsx rename to packages/reactioncommerce/auth/use-signup.tsx diff --git a/framework/reactioncommerce/cart/index.ts b/packages/reactioncommerce/cart/index.ts similarity index 100% rename from framework/reactioncommerce/cart/index.ts rename to packages/reactioncommerce/cart/index.ts diff --git a/framework/reactioncommerce/cart/use-add-item.tsx b/packages/reactioncommerce/cart/use-add-item.tsx similarity index 100% rename from framework/reactioncommerce/cart/use-add-item.tsx rename to packages/reactioncommerce/cart/use-add-item.tsx diff --git a/framework/reactioncommerce/cart/use-add-shipping-address.tsx b/packages/reactioncommerce/cart/use-add-shipping-address.tsx similarity index 100% rename from framework/reactioncommerce/cart/use-add-shipping-address.tsx rename to packages/reactioncommerce/cart/use-add-shipping-address.tsx diff --git a/framework/reactioncommerce/cart/use-cart.tsx b/packages/reactioncommerce/cart/use-cart.tsx similarity index 100% rename from framework/reactioncommerce/cart/use-cart.tsx rename to packages/reactioncommerce/cart/use-cart.tsx diff --git a/framework/reactioncommerce/cart/use-remove-item.tsx b/packages/reactioncommerce/cart/use-remove-item.tsx similarity index 100% rename from framework/reactioncommerce/cart/use-remove-item.tsx rename to packages/reactioncommerce/cart/use-remove-item.tsx diff --git a/framework/reactioncommerce/cart/use-update-item.tsx b/packages/reactioncommerce/cart/use-update-item.tsx similarity index 100% rename from framework/reactioncommerce/cart/use-update-item.tsx rename to packages/reactioncommerce/cart/use-update-item.tsx diff --git a/framework/reactioncommerce/cart/utils/create-cart.ts b/packages/reactioncommerce/cart/utils/create-cart.ts similarity index 100% rename from framework/reactioncommerce/cart/utils/create-cart.ts rename to packages/reactioncommerce/cart/utils/create-cart.ts diff --git a/framework/reactioncommerce/cart/utils/fetcher.ts b/packages/reactioncommerce/cart/utils/fetcher.ts similarity index 100% rename from framework/reactioncommerce/cart/utils/fetcher.ts rename to packages/reactioncommerce/cart/utils/fetcher.ts diff --git a/framework/reactioncommerce/cart/utils/index.ts b/packages/reactioncommerce/cart/utils/index.ts similarity index 100% rename from framework/reactioncommerce/cart/utils/index.ts rename to packages/reactioncommerce/cart/utils/index.ts diff --git a/framework/reactioncommerce/codegen.json b/packages/reactioncommerce/codegen.json similarity index 100% rename from framework/reactioncommerce/codegen.json rename to packages/reactioncommerce/codegen.json diff --git a/framework/reactioncommerce/commerce.config.json b/packages/reactioncommerce/commerce.config.json similarity index 100% rename from framework/reactioncommerce/commerce.config.json rename to packages/reactioncommerce/commerce.config.json diff --git a/framework/reactioncommerce/common/get-all-pages.ts b/packages/reactioncommerce/common/get-all-pages.ts similarity index 100% rename from framework/reactioncommerce/common/get-all-pages.ts rename to packages/reactioncommerce/common/get-all-pages.ts diff --git a/framework/reactioncommerce/common/get-page.ts b/packages/reactioncommerce/common/get-page.ts similarity index 100% rename from framework/reactioncommerce/common/get-page.ts rename to packages/reactioncommerce/common/get-page.ts diff --git a/framework/reactioncommerce/common/get-site-info.ts b/packages/reactioncommerce/common/get-site-info.ts similarity index 100% rename from framework/reactioncommerce/common/get-site-info.ts rename to packages/reactioncommerce/common/get-site-info.ts diff --git a/framework/reactioncommerce/const.ts b/packages/reactioncommerce/const.ts similarity index 100% rename from framework/reactioncommerce/const.ts rename to packages/reactioncommerce/const.ts diff --git a/framework/reactioncommerce/customer/get-viewer-id.ts b/packages/reactioncommerce/customer/get-viewer-id.ts similarity index 100% rename from framework/reactioncommerce/customer/get-viewer-id.ts rename to packages/reactioncommerce/customer/get-viewer-id.ts diff --git a/framework/swell/customer/index.ts b/packages/reactioncommerce/customer/index.ts similarity index 100% rename from framework/swell/customer/index.ts rename to packages/reactioncommerce/customer/index.ts diff --git a/framework/reactioncommerce/customer/use-customer.tsx b/packages/reactioncommerce/customer/use-customer.tsx similarity index 100% rename from framework/reactioncommerce/customer/use-customer.tsx rename to packages/reactioncommerce/customer/use-customer.tsx diff --git a/framework/reactioncommerce/fetcher.ts b/packages/reactioncommerce/fetcher.ts similarity index 100% rename from framework/reactioncommerce/fetcher.ts rename to packages/reactioncommerce/fetcher.ts diff --git a/framework/reactioncommerce/index.tsx b/packages/reactioncommerce/index.tsx similarity index 100% rename from framework/reactioncommerce/index.tsx rename to packages/reactioncommerce/index.tsx diff --git a/framework/reactioncommerce/next.config.js b/packages/reactioncommerce/next.config.js similarity index 100% rename from framework/reactioncommerce/next.config.js rename to packages/reactioncommerce/next.config.js diff --git a/framework/reactioncommerce/product/get-all-collections.ts b/packages/reactioncommerce/product/get-all-collections.ts similarity index 100% rename from framework/reactioncommerce/product/get-all-collections.ts rename to packages/reactioncommerce/product/get-all-collections.ts diff --git a/framework/reactioncommerce/product/get-all-product-paths.ts b/packages/reactioncommerce/product/get-all-product-paths.ts similarity index 100% rename from framework/reactioncommerce/product/get-all-product-paths.ts rename to packages/reactioncommerce/product/get-all-product-paths.ts diff --git a/framework/reactioncommerce/product/get-all-products.ts b/packages/reactioncommerce/product/get-all-products.ts similarity index 100% rename from framework/reactioncommerce/product/get-all-products.ts rename to packages/reactioncommerce/product/get-all-products.ts diff --git a/framework/reactioncommerce/product/get-product.ts b/packages/reactioncommerce/product/get-product.ts similarity index 100% rename from framework/reactioncommerce/product/get-product.ts rename to packages/reactioncommerce/product/get-product.ts diff --git a/framework/bigcommerce/product/use-price.tsx b/packages/reactioncommerce/product/use-price.tsx similarity index 100% rename from framework/bigcommerce/product/use-price.tsx rename to packages/reactioncommerce/product/use-price.tsx diff --git a/framework/reactioncommerce/product/use-search.tsx b/packages/reactioncommerce/product/use-search.tsx similarity index 100% rename from framework/reactioncommerce/product/use-search.tsx rename to packages/reactioncommerce/product/use-search.tsx diff --git a/framework/reactioncommerce/provider.ts b/packages/reactioncommerce/provider.ts similarity index 100% rename from framework/reactioncommerce/provider.ts rename to packages/reactioncommerce/provider.ts diff --git a/framework/reactioncommerce/schema.d.ts b/packages/reactioncommerce/schema.d.ts similarity index 100% rename from framework/reactioncommerce/schema.d.ts rename to packages/reactioncommerce/schema.d.ts diff --git a/framework/reactioncommerce/schema.graphql b/packages/reactioncommerce/schema.graphql similarity index 100% rename from framework/reactioncommerce/schema.graphql rename to packages/reactioncommerce/schema.graphql diff --git a/framework/reactioncommerce/types.ts b/packages/reactioncommerce/types.ts similarity index 100% rename from framework/reactioncommerce/types.ts rename to packages/reactioncommerce/types.ts diff --git a/framework/reactioncommerce/utils/customer-token.ts b/packages/reactioncommerce/utils/customer-token.ts similarity index 100% rename from framework/reactioncommerce/utils/customer-token.ts rename to packages/reactioncommerce/utils/customer-token.ts diff --git a/framework/reactioncommerce/utils/get-anonymous-cart-token.ts b/packages/reactioncommerce/utils/get-anonymous-cart-token.ts similarity index 100% rename from framework/reactioncommerce/utils/get-anonymous-cart-token.ts rename to packages/reactioncommerce/utils/get-anonymous-cart-token.ts diff --git a/framework/reactioncommerce/utils/get-cart-id.ts b/packages/reactioncommerce/utils/get-cart-id.ts similarity index 100% rename from framework/reactioncommerce/utils/get-cart-id.ts rename to packages/reactioncommerce/utils/get-cart-id.ts diff --git a/framework/reactioncommerce/utils/handle-fetch-response.ts b/packages/reactioncommerce/utils/handle-fetch-response.ts similarity index 100% rename from framework/reactioncommerce/utils/handle-fetch-response.ts rename to packages/reactioncommerce/utils/handle-fetch-response.ts diff --git a/framework/reactioncommerce/utils/index.ts b/packages/reactioncommerce/utils/index.ts similarity index 100% rename from framework/reactioncommerce/utils/index.ts rename to packages/reactioncommerce/utils/index.ts diff --git a/framework/reactioncommerce/utils/mutations/add-cart-items.ts b/packages/reactioncommerce/utils/mutations/add-cart-items.ts similarity index 100% rename from framework/reactioncommerce/utils/mutations/add-cart-items.ts rename to packages/reactioncommerce/utils/mutations/add-cart-items.ts diff --git a/framework/reactioncommerce/utils/mutations/authenticate.ts b/packages/reactioncommerce/utils/mutations/authenticate.ts similarity index 100% rename from framework/reactioncommerce/utils/mutations/authenticate.ts rename to packages/reactioncommerce/utils/mutations/authenticate.ts diff --git a/framework/reactioncommerce/utils/mutations/create-cart.ts b/packages/reactioncommerce/utils/mutations/create-cart.ts similarity index 100% rename from framework/reactioncommerce/utils/mutations/create-cart.ts rename to packages/reactioncommerce/utils/mutations/create-cart.ts diff --git a/framework/reactioncommerce/utils/mutations/create-user.ts b/packages/reactioncommerce/utils/mutations/create-user.ts similarity index 100% rename from framework/reactioncommerce/utils/mutations/create-user.ts rename to packages/reactioncommerce/utils/mutations/create-user.ts diff --git a/framework/reactioncommerce/utils/mutations/index.ts b/packages/reactioncommerce/utils/mutations/index.ts similarity index 100% rename from framework/reactioncommerce/utils/mutations/index.ts rename to packages/reactioncommerce/utils/mutations/index.ts diff --git a/framework/reactioncommerce/utils/mutations/logout.ts b/packages/reactioncommerce/utils/mutations/logout.ts similarity index 100% rename from framework/reactioncommerce/utils/mutations/logout.ts rename to packages/reactioncommerce/utils/mutations/logout.ts diff --git a/framework/reactioncommerce/utils/mutations/reconcile-carts.ts b/packages/reactioncommerce/utils/mutations/reconcile-carts.ts similarity index 100% rename from framework/reactioncommerce/utils/mutations/reconcile-carts.ts rename to packages/reactioncommerce/utils/mutations/reconcile-carts.ts diff --git a/framework/reactioncommerce/utils/mutations/remove-cart-items.ts b/packages/reactioncommerce/utils/mutations/remove-cart-items.ts similarity index 100% rename from framework/reactioncommerce/utils/mutations/remove-cart-items.ts rename to packages/reactioncommerce/utils/mutations/remove-cart-items.ts diff --git a/framework/reactioncommerce/utils/mutations/set-shipping-address-on-cart.ts b/packages/reactioncommerce/utils/mutations/set-shipping-address-on-cart.ts similarity index 100% rename from framework/reactioncommerce/utils/mutations/set-shipping-address-on-cart.ts rename to packages/reactioncommerce/utils/mutations/set-shipping-address-on-cart.ts diff --git a/framework/reactioncommerce/utils/mutations/update-cart-items-quantity.ts b/packages/reactioncommerce/utils/mutations/update-cart-items-quantity.ts similarity index 100% rename from framework/reactioncommerce/utils/mutations/update-cart-items-quantity.ts rename to packages/reactioncommerce/utils/mutations/update-cart-items-quantity.ts diff --git a/framework/reactioncommerce/utils/normalize.ts b/packages/reactioncommerce/utils/normalize.ts similarity index 100% rename from framework/reactioncommerce/utils/normalize.ts rename to packages/reactioncommerce/utils/normalize.ts diff --git a/framework/reactioncommerce/utils/queries/account-cart-by-account-id.ts b/packages/reactioncommerce/utils/queries/account-cart-by-account-id.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/account-cart-by-account-id.ts rename to packages/reactioncommerce/utils/queries/account-cart-by-account-id.ts diff --git a/framework/reactioncommerce/utils/queries/catalog-items-query.ts b/packages/reactioncommerce/utils/queries/catalog-items-query.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/catalog-items-query.ts rename to packages/reactioncommerce/utils/queries/catalog-items-query.ts diff --git a/framework/reactioncommerce/utils/queries/get-all-collections-query.ts b/packages/reactioncommerce/utils/queries/get-all-collections-query.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/get-all-collections-query.ts rename to packages/reactioncommerce/utils/queries/get-all-collections-query.ts diff --git a/framework/reactioncommerce/utils/queries/get-all-pages-query.ts b/packages/reactioncommerce/utils/queries/get-all-pages-query.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/get-all-pages-query.ts rename to packages/reactioncommerce/utils/queries/get-all-pages-query.ts diff --git a/framework/reactioncommerce/utils/queries/get-all-product-vendors-query.ts b/packages/reactioncommerce/utils/queries/get-all-product-vendors-query.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/get-all-product-vendors-query.ts rename to packages/reactioncommerce/utils/queries/get-all-product-vendors-query.ts diff --git a/framework/reactioncommerce/utils/queries/get-all-products-paths-query.ts b/packages/reactioncommerce/utils/queries/get-all-products-paths-query.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/get-all-products-paths-query.ts rename to packages/reactioncommerce/utils/queries/get-all-products-paths-query.ts diff --git a/framework/reactioncommerce/utils/queries/get-anonymous-cart.ts b/packages/reactioncommerce/utils/queries/get-anonymous-cart.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/get-anonymous-cart.ts rename to packages/reactioncommerce/utils/queries/get-anonymous-cart.ts diff --git a/framework/reactioncommerce/utils/queries/get-cart-query.ts b/packages/reactioncommerce/utils/queries/get-cart-query.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/get-cart-query.ts rename to packages/reactioncommerce/utils/queries/get-cart-query.ts diff --git a/framework/reactioncommerce/utils/queries/get-collection-products-query.ts b/packages/reactioncommerce/utils/queries/get-collection-products-query.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/get-collection-products-query.ts rename to packages/reactioncommerce/utils/queries/get-collection-products-query.ts diff --git a/framework/reactioncommerce/utils/queries/get-page-query.ts b/packages/reactioncommerce/utils/queries/get-page-query.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/get-page-query.ts rename to packages/reactioncommerce/utils/queries/get-page-query.ts diff --git a/framework/reactioncommerce/utils/queries/get-product-query.ts b/packages/reactioncommerce/utils/queries/get-product-query.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/get-product-query.ts rename to packages/reactioncommerce/utils/queries/get-product-query.ts diff --git a/framework/reactioncommerce/utils/queries/get-viewer-id-query.ts b/packages/reactioncommerce/utils/queries/get-viewer-id-query.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/get-viewer-id-query.ts rename to packages/reactioncommerce/utils/queries/get-viewer-id-query.ts diff --git a/framework/reactioncommerce/utils/queries/index.ts b/packages/reactioncommerce/utils/queries/index.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/index.ts rename to packages/reactioncommerce/utils/queries/index.ts diff --git a/framework/reactioncommerce/utils/queries/viewer-query.ts b/packages/reactioncommerce/utils/queries/viewer-query.ts similarity index 100% rename from framework/reactioncommerce/utils/queries/viewer-query.ts rename to packages/reactioncommerce/utils/queries/viewer-query.ts diff --git a/framework/shopify/wishlist/use-add-item.tsx b/packages/reactioncommerce/wishlist/use-add-item.tsx similarity index 100% rename from framework/shopify/wishlist/use-add-item.tsx rename to packages/reactioncommerce/wishlist/use-add-item.tsx diff --git a/framework/shopify/wishlist/use-remove-item.tsx b/packages/reactioncommerce/wishlist/use-remove-item.tsx similarity index 100% rename from framework/shopify/wishlist/use-remove-item.tsx rename to packages/reactioncommerce/wishlist/use-remove-item.tsx diff --git a/framework/reactioncommerce/wishlist/use-wishlist.tsx b/packages/reactioncommerce/wishlist/use-wishlist.tsx similarity index 100% rename from framework/reactioncommerce/wishlist/use-wishlist.tsx rename to packages/reactioncommerce/wishlist/use-wishlist.tsx diff --git a/framework/saleor/.env.template b/packages/saleor/.env.template similarity index 100% rename from framework/saleor/.env.template rename to packages/saleor/.env.template diff --git a/packages/saleor/.prettierignore b/packages/saleor/.prettierignore new file mode 100644 index 000000000..f06235c46 --- /dev/null +++ b/packages/saleor/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/saleor/.prettierrc b/packages/saleor/.prettierrc new file mode 100644 index 000000000..e1076edfa --- /dev/null +++ b/packages/saleor/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/framework/saleor/README.md b/packages/saleor/README.md similarity index 87% rename from framework/saleor/README.md rename to packages/saleor/README.md index 00af272b0..277639622 100644 --- a/framework/saleor/README.md +++ b/packages/saleor/README.md @@ -9,10 +9,10 @@ This provider requires Saleor **3.x** or higher. Copy the `.env.template` file in this directory to `.env.local` in the main directory (which will be ignored by Git): ```bash -cp framework/saleor/.env.template .env.local +cp packages/saleor/.env.template .env.local ``` -Then, set the environment following variables in your `.env.local`. Both, `NEXT_PUBLIC_SALEOR_API_URL` and `COMMERCE_IMAGE_HOST` must point to your own Saleor instance. +Then, set the environment following variables in your `.env.local`. Both, `NEXT_PUBLIC_SALEOR_API_URL` and `COMMERCE_IMAGE_HOST` must point to your own Saleor instance. ``` COMMERCE_PROVIDER=saleor diff --git a/codegen.json b/packages/saleor/codegen.json similarity index 59% rename from codegen.json rename to packages/saleor/codegen.json index d9a5c09ce..abbbbf142 100644 --- a/codegen.json +++ b/packages/saleor/codegen.json @@ -4,26 +4,26 @@ }, "documents": [ { - "./framework/saleor/utils/queries/get-all-products-query.ts": { + "./src/utils/queries/get-all-products-query.ts": { "noRequire": true } }, { - "./framework/saleor/utils/queries/get-all-products-paths-query.ts": { + "./src/utils/queries/get-all-products-paths-query.ts": { "noRequire": true } }, { - "./framework/saleor/utils/queries/get-products.ts": { + "./src/utils/queries/get-products.ts": { "noRequire": true } } ], "generates": { - "./framework/saleor/schema.d.ts": { + "./schema.d.ts": { "plugins": ["typescript", "typescript-operations"] }, - "./framework/saleor/schema.graphql": { + "./schema.graphql": { "plugins": ["schema-ast"] } }, diff --git a/packages/saleor/package.json b/packages/saleor/package.json new file mode 100644 index 000000000..43ba1b7c7 --- /dev/null +++ b/packages/saleor/package.json @@ -0,0 +1,85 @@ +{ + "name": "@vercel/commerce-saleor", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "release": "taskr release", + "build": "taskr build", + "dev": "taskr", + "types": "tsc --emitDeclarationOnly", + "prettier-fix": "prettier --write .", + "generate": "graphql-codegen" + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], + "./next.config": "./dist/next.config.cjs" + }, + "typesVersions": { + "*": { + "*": [ + "src/*", + "src/*/index" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + }, + "files": [ + "dist", + "schema.d.ts" + ], + "publishConfig": { + "typesVersions": { + "*": { + "*": [ + "dist/*.d.ts", + "dist/*/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": { + "@graphql-codegen/cli": "^2.3.1", + "@graphql-codegen/schema-ast": "^2.4.1", + "@graphql-codegen/typescript": "^2.4.2", + "@graphql-codegen/typescript-operations": "^2.2.2", + "@taskr/clear": "^1.1.0", + "@taskr/esnext": "^1.1.0", + "@taskr/watch": "^1.1.0", + "@types/node": "^17.0.8", + "@types/react": "^17.0.38", + "lint-staged": "^12.1.7", + "next": "^12.0.8", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "taskr": "^1.1.0", + "taskr-swc": "^0.0.1", + "typescript": "^4.5.4" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,json}": [ + "prettier --write", + "git add" + ] + } +} diff --git a/framework/saleor/schema.d.ts b/packages/saleor/schema.d.ts similarity index 100% rename from framework/saleor/schema.d.ts rename to packages/saleor/schema.d.ts diff --git a/framework/saleor/schema.graphql b/packages/saleor/schema.graphql similarity index 100% rename from framework/saleor/schema.graphql rename to packages/saleor/schema.graphql diff --git a/framework/saleor/api/cart.ts b/packages/saleor/src/api/cart.ts similarity index 100% rename from framework/saleor/api/cart.ts rename to packages/saleor/src/api/cart.ts diff --git a/framework/saleor/api/catalog/products.ts b/packages/saleor/src/api/catalog/products.ts similarity index 100% rename from framework/saleor/api/catalog/products.ts rename to packages/saleor/src/api/catalog/products.ts diff --git a/framework/saleor/api/checkout.ts b/packages/saleor/src/api/checkout.ts similarity index 100% rename from framework/saleor/api/checkout.ts rename to packages/saleor/src/api/checkout.ts diff --git a/framework/saleor/api/customers/index.ts b/packages/saleor/src/api/customers/index.ts similarity index 100% rename from framework/saleor/api/customers/index.ts rename to packages/saleor/src/api/customers/index.ts diff --git a/framework/saleor/api/customers/login.ts b/packages/saleor/src/api/customers/login.ts similarity index 100% rename from framework/saleor/api/customers/login.ts rename to packages/saleor/src/api/customers/login.ts diff --git a/framework/saleor/api/customers/logout.ts b/packages/saleor/src/api/customers/logout.ts similarity index 100% rename from framework/saleor/api/customers/logout.ts rename to packages/saleor/src/api/customers/logout.ts diff --git a/framework/saleor/api/customers/signup.ts b/packages/saleor/src/api/customers/signup.ts similarity index 100% rename from framework/saleor/api/customers/signup.ts rename to packages/saleor/src/api/customers/signup.ts diff --git a/framework/saleor/api/endpoints/cart.ts b/packages/saleor/src/api/endpoints/cart.ts similarity index 100% rename from framework/saleor/api/endpoints/cart.ts rename to packages/saleor/src/api/endpoints/cart.ts diff --git a/framework/saleor/api/endpoints/catalog/products.ts b/packages/saleor/src/api/endpoints/catalog/products.ts similarity index 100% rename from framework/saleor/api/endpoints/catalog/products.ts rename to packages/saleor/src/api/endpoints/catalog/products.ts diff --git a/framework/saleor/api/endpoints/checkout/index.ts b/packages/saleor/src/api/endpoints/checkout/index.ts similarity index 79% rename from framework/saleor/api/endpoints/checkout/index.ts rename to packages/saleor/src/api/endpoints/checkout/index.ts index f3d68abf0..2468c8d97 100644 --- a/framework/saleor/api/endpoints/checkout/index.ts +++ b/packages/saleor/src/api/endpoints/checkout/index.ts @@ -1,12 +1,12 @@ -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 export type CheckoutEndpoint = CheckoutAPI['endpoint'] -const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({ req, res, config }) => { +const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ req, res, config }) => { try { const html = ` @@ -43,7 +43,7 @@ const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({ req, res, co } } -export const handlers: CheckoutEndpoint['handlers'] = { checkout } +export const handlers: CheckoutEndpoint['handlers'] = { getCheckout } const checkoutApi = createEndpoint({ handler: checkoutEndpoint, diff --git a/packages/saleor/src/api/endpoints/customer/address.ts b/packages/saleor/src/api/endpoints/customer/address.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/saleor/src/api/endpoints/customer/address.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/saleor/src/api/endpoints/customer/card.ts b/packages/saleor/src/api/endpoints/customer/card.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/saleor/src/api/endpoints/customer/card.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/saleor/src/api/endpoints/customer/index.ts b/packages/saleor/src/api/endpoints/customer/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/saleor/src/api/endpoints/customer/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/framework/saleor/api/endpoints/login.ts b/packages/saleor/src/api/endpoints/login.ts similarity index 100% rename from framework/saleor/api/endpoints/login.ts rename to packages/saleor/src/api/endpoints/login.ts diff --git a/framework/saleor/api/endpoints/logout.ts b/packages/saleor/src/api/endpoints/logout.ts similarity index 100% rename from framework/saleor/api/endpoints/logout.ts rename to packages/saleor/src/api/endpoints/logout.ts diff --git a/framework/saleor/api/endpoints/signup.ts b/packages/saleor/src/api/endpoints/signup.ts similarity index 100% rename from framework/saleor/api/endpoints/signup.ts rename to packages/saleor/src/api/endpoints/signup.ts diff --git a/framework/saleor/api/endpoints/wishlist.ts b/packages/saleor/src/api/endpoints/wishlist.ts similarity index 100% rename from framework/saleor/api/endpoints/wishlist.ts rename to packages/saleor/src/api/endpoints/wishlist.ts diff --git a/framework/saleor/api/index.ts b/packages/saleor/src/api/index.ts similarity index 84% rename from framework/saleor/api/index.ts rename to packages/saleor/src/api/index.ts index 3f5bcd70c..7ee17f693 100644 --- a/framework/saleor/api/index.ts +++ b/packages/saleor/src/api/index.ts @@ -1,5 +1,5 @@ -import type { CommerceAPIConfig } from '@commerce/api' - +import { CommerceAPI, CommerceAPIConfig, getCommerceApi as commerceApi } from '@vercel/commerce/api' +import * as operations from './operations' import * as Const from '../const' if (!Const.API_URL) { @@ -27,12 +27,6 @@ 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 diff --git a/framework/saleor/api/operations/get-all-pages.ts b/packages/saleor/src/api/operations/get-all-pages.ts similarity index 88% rename from framework/saleor/api/operations/get-all-pages.ts rename to packages/saleor/src/api/operations/get-all-pages.ts index 7ba07450d..37f2e3ab2 100644 --- a/framework/saleor/api/operations/get-all-pages.ts +++ b/packages/saleor/src/api/operations/get-all-pages.ts @@ -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' diff --git a/framework/saleor/api/operations/get-all-product-paths.ts b/packages/saleor/src/api/operations/get-all-product-paths.ts similarity index 77% rename from framework/saleor/api/operations/get-all-product-paths.ts rename to packages/saleor/src/api/operations/get-all-product-paths.ts index b716b3ea1..66e8f95c9 100644 --- a/framework/saleor/api/operations/get-all-product-paths.ts +++ b/packages/saleor/src/api/operations/get-all-product-paths.ts @@ -1,6 +1,6 @@ -import type { OperationContext } from '@commerce/api/operations' -import { GetAllProductPathsQuery, GetAllProductPathsQueryVariables, ProductCountableEdge } from '../../schema' -import type { ShopifyConfig, Provider, SaleorConfig } from '..' +import type { OperationContext } from '@vercel/commerce/api/operations' +import { ProductCountableEdge } from '../../../schema' +import type { Provider, SaleorConfig } from '..' import { getAllProductsPathsQuery } from '../../utils/queries' import fetchAllProducts from '../utils/fetch-all-products' diff --git a/framework/saleor/api/operations/get-all-products.ts b/packages/saleor/src/api/operations/get-all-products.ts similarity index 84% rename from framework/saleor/api/operations/get-all-products.ts rename to packages/saleor/src/api/operations/get-all-products.ts index 4cb7555d6..f7982adee 100644 --- a/framework/saleor/api/operations/get-all-products.ts +++ b/packages/saleor/src/api/operations/get-all-products.ts @@ -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[] diff --git a/framework/saleor/api/operations/get-page.ts b/packages/saleor/src/api/operations/get-page.ts similarity index 89% rename from framework/saleor/api/operations/get-page.ts rename to packages/saleor/src/api/operations/get-page.ts index 1e6c8cf2b..bab9d92c5 100644 --- a/framework/saleor/api/operations/get-page.ts +++ b/packages/saleor/src/api/operations/get-page.ts @@ -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' diff --git a/framework/saleor/api/operations/get-product.ts b/packages/saleor/src/api/operations/get-product.ts similarity index 92% rename from framework/saleor/api/operations/get-product.ts rename to packages/saleor/src/api/operations/get-product.ts index e5e8e596f..5a33dec7b 100644 --- a/framework/saleor/api/operations/get-product.ts +++ b/packages/saleor/src/api/operations/get-product.ts @@ -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 '..' diff --git a/framework/saleor/api/operations/get-site-info.ts b/packages/saleor/src/api/operations/get-site-info.ts similarity index 84% rename from framework/saleor/api/operations/get-site-info.ts rename to packages/saleor/src/api/operations/get-site-info.ts index 917b96ce4..6ce7408e4 100644 --- a/framework/saleor/api/operations/get-site-info.ts +++ b/packages/saleor/src/api/operations/get-site-info.ts @@ -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' diff --git a/framework/saleor/api/operations/index.ts b/packages/saleor/src/api/operations/index.ts similarity index 100% rename from framework/saleor/api/operations/index.ts rename to packages/saleor/src/api/operations/index.ts diff --git a/framework/saleor/api/operations/login.ts b/packages/saleor/src/api/operations/login.ts similarity index 93% rename from framework/saleor/api/operations/login.ts rename to packages/saleor/src/api/operations/login.ts index 9d3a7fe9f..76d1e7844 100644 --- a/framework/saleor/api/operations/login.ts +++ b/packages/saleor/src/api/operations/login.ts @@ -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' diff --git a/framework/saleor/api/utils/fetch-all-products.ts b/packages/saleor/src/api/utils/fetch-all-products.ts similarity index 93% rename from framework/saleor/api/utils/fetch-all-products.ts rename to packages/saleor/src/api/utils/fetch-all-products.ts index 1cfb3157c..761e1271d 100644 --- a/framework/saleor/api/utils/fetch-all-products.ts +++ b/packages/saleor/src/api/utils/fetch-all-products.ts @@ -1,4 +1,4 @@ -import { ProductCountableEdge } from '../../schema' +import { ProductCountableEdge } from '../../../schema' import { SaleorConfig } from '..' const fetchAllProducts = async ({ diff --git a/framework/saleor/api/utils/fetch-graphql-api.ts b/packages/saleor/src/api/utils/fetch-graphql-api.ts similarity index 93% rename from framework/saleor/api/utils/fetch-graphql-api.ts rename to packages/saleor/src/api/utils/fetch-graphql-api.ts index 3145409ad..de4d45aae 100644 --- a/framework/saleor/api/utils/fetch-graphql-api.ts +++ b/packages/saleor/src/api/utils/fetch-graphql-api.ts @@ -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' diff --git a/framework/saleor/api/utils/fetch.ts b/packages/saleor/src/api/utils/fetch.ts similarity index 100% rename from framework/saleor/api/utils/fetch.ts rename to packages/saleor/src/api/utils/fetch.ts diff --git a/framework/saleor/api/utils/is-allowed-method.ts b/packages/saleor/src/api/utils/is-allowed-method.ts similarity index 100% rename from framework/saleor/api/utils/is-allowed-method.ts rename to packages/saleor/src/api/utils/is-allowed-method.ts diff --git a/framework/saleor/api/wishlist.ts b/packages/saleor/src/api/wishlist.ts similarity index 100% rename from framework/saleor/api/wishlist.ts rename to packages/saleor/src/api/wishlist.ts diff --git a/framework/saleor/auth/use-login.tsx b/packages/saleor/src/auth/use-login.tsx similarity index 77% rename from framework/saleor/auth/use-login.tsx rename to packages/saleor/src/auth/use-login.tsx index 2a31c932b..33f95da2b 100644 --- a/framework/saleor/auth/use-login.tsx +++ b/packages/saleor/src/auth/use-login.tsx @@ -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 @@ -49,15 +49,15 @@ export const handler: MutationHook = { useHook: ({ fetch }) => () => { - const { revalidate } = useCustomer() + const { mutate } = useCustomer() return useCallback( async function login(input) { const data = await fetch({ input }) - await revalidate() + await mutate() return data }, - [fetch, revalidate] + [fetch, mutate] ) }, } diff --git a/framework/saleor/auth/use-logout.tsx b/packages/saleor/src/auth/use-logout.tsx similarity index 81% rename from framework/saleor/auth/use-logout.tsx rename to packages/saleor/src/auth/use-logout.tsx index fe75df84b..396cb472a 100644 --- a/framework/saleor/auth/use-logout.tsx +++ b/packages/saleor/src/auth/use-logout.tsx @@ -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 diff --git a/framework/saleor/auth/use-signup.tsx b/packages/saleor/src/auth/use-signup.tsx similarity index 77% rename from framework/saleor/auth/use-signup.tsx rename to packages/saleor/src/auth/use-signup.tsx index 06df516a5..e29ee3b1a 100644 --- a/framework/saleor/auth/use-signup.tsx +++ b/packages/saleor/src/auth/use-signup.tsx @@ -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 @@ -42,15 +42,15 @@ export const handler: MutationHook = { useHook: ({ fetch }) => () => { - const { revalidate } = useCustomer() + const { mutate } = useCustomer() return useCallback( async function signup(input) { const data = await fetch({ input }) - await revalidate() + await mutate() return data }, - [fetch, revalidate] + [fetch, mutate] ) }, } diff --git a/framework/saleor/cart/index.ts b/packages/saleor/src/cart/index.ts similarity index 100% rename from framework/saleor/cart/index.ts rename to packages/saleor/src/cart/index.ts diff --git a/framework/saleor/cart/use-add-item.tsx b/packages/saleor/src/cart/use-add-item.tsx similarity index 79% rename from framework/saleor/cart/use-add-item.tsx rename to packages/saleor/src/cart/use-add-item.tsx index 3af368e70..2db070233 100644 --- a/framework/saleor/cart/use-add-item.tsx +++ b/packages/saleor/src/cart/use-add-item.tsx @@ -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 diff --git a/framework/saleor/cart/use-cart.tsx b/packages/saleor/src/cart/use-cart.tsx similarity index 86% rename from framework/saleor/cart/use-cart.tsx rename to packages/saleor/src/cart/use-cart.tsx index ab80ea395..9360875d4 100644 --- a/framework/saleor/cart/use-cart.tsx +++ b/packages/saleor/src/cart/use-cart.tsx @@ -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 diff --git a/framework/saleor/cart/use-remove-item.tsx b/packages/saleor/src/cart/use-remove-item.tsx similarity index 85% rename from framework/saleor/cart/use-remove-item.tsx rename to packages/saleor/src/cart/use-remove-item.tsx index 17be31e0c..09d1acab7 100644 --- a/framework/saleor/cart/use-remove-item.tsx +++ b/packages/saleor/src/cart/use-remove-item.tsx @@ -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 diff --git a/framework/saleor/cart/use-update-item.tsx b/packages/saleor/src/cart/use-update-item.tsx similarity index 89% rename from framework/saleor/cart/use-update-item.tsx rename to packages/saleor/src/cart/use-update-item.tsx index bd596132d..ffca9b2f8 100644 --- a/framework/saleor/cart/use-update-item.tsx +++ b/packages/saleor/src/cart/use-update-item.tsx @@ -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' diff --git a/packages/saleor/src/checkout/use-checkout.tsx b/packages/saleor/src/checkout/use-checkout.tsx new file mode 100644 index 000000000..cab52bb60 --- /dev/null +++ b/packages/saleor/src/checkout/use-checkout.tsx @@ -0,0 +1,14 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { UseCheckout } from '@vercel/commerce/checkout/use-checkout' + +export default useCheckout as UseCheckout + +export const handler: SWRHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ useData }) => + async (input) => ({}), +} diff --git a/framework/shopify/commerce.config.json b/packages/saleor/src/commerce.config.json similarity index 64% rename from framework/shopify/commerce.config.json rename to packages/saleor/src/commerce.config.json index b30ab39d9..eddd3066c 100644 --- a/framework/shopify/commerce.config.json +++ b/packages/saleor/src/commerce.config.json @@ -1,5 +1,5 @@ { - "provider": "shopify", + "provider": "saleor", "features": { "wishlist": false } diff --git a/framework/saleor/const.ts b/packages/saleor/src/const.ts similarity index 100% rename from framework/saleor/const.ts rename to packages/saleor/src/const.ts diff --git a/packages/saleor/src/customer/address/use-add-item.tsx b/packages/saleor/src/customer/address/use-add-item.tsx new file mode 100644 index 000000000..fabd11b1d --- /dev/null +++ b/packages/saleor/src/customer/address/use-add-item.tsx @@ -0,0 +1,15 @@ +import useAddItem, { UseAddItem } from '@vercel/commerce/customer/address/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/packages/saleor/src/customer/card/use-add-item.tsx b/packages/saleor/src/customer/card/use-add-item.tsx new file mode 100644 index 000000000..938e6cd61 --- /dev/null +++ b/packages/saleor/src/customer/card/use-add-item.tsx @@ -0,0 +1,15 @@ +import useAddItem, { UseAddItem } from '@vercel/commerce/customer/card/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/framework/vendure/customer/index.ts b/packages/saleor/src/customer/index.ts similarity index 100% rename from framework/vendure/customer/index.ts rename to packages/saleor/src/customer/index.ts diff --git a/framework/saleor/customer/use-customer.tsx b/packages/saleor/src/customer/use-customer.tsx similarity index 73% rename from framework/saleor/customer/use-customer.tsx rename to packages/saleor/src/customer/use-customer.tsx index 1e0e63d5a..841793886 100644 --- a/framework/saleor/customer/use-customer.tsx +++ b/packages/saleor/src/customer/use-customer.tsx @@ -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' diff --git a/framework/saleor/fetcher.ts b/packages/saleor/src/fetcher.ts similarity index 89% rename from framework/saleor/fetcher.ts rename to packages/saleor/src/fetcher.ts index 9d3c0bf89..c1be921c5 100644 --- a/framework/saleor/fetcher.ts +++ b/packages/saleor/src/fetcher.ts @@ -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' diff --git a/packages/saleor/src/index.tsx b/packages/saleor/src/index.tsx new file mode 100644 index 000000000..cf9aaf6e8 --- /dev/null +++ b/packages/saleor/src/index.tsx @@ -0,0 +1,9 @@ +import { getCommerceProvider, useCommerce as useCoreCommerce } from '@vercel/commerce' +import { saleorProvider, SaleorProvider } from './provider' + +export { saleorProvider } +export type { SaleorProvider } + +export const CommerceProvider = getCommerceProvider(saleorProvider) + +export const useCommerce = () => useCoreCommerce() diff --git a/framework/saleor/next.config.js b/packages/saleor/src/next.config.cjs similarity index 100% rename from framework/saleor/next.config.js rename to packages/saleor/src/next.config.cjs diff --git a/packages/saleor/src/product/use-price.tsx b/packages/saleor/src/product/use-price.tsx new file mode 100644 index 000000000..fd42d7033 --- /dev/null +++ b/packages/saleor/src/product/use-price.tsx @@ -0,0 +1,2 @@ +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/framework/saleor/product/use-search.tsx b/packages/saleor/src/product/use-search.tsx similarity index 84% rename from framework/saleor/product/use-search.tsx rename to packages/saleor/src/product/use-search.tsx index cc763c4b7..69212cba1 100644 --- a/framework/saleor/product/use-search.tsx +++ b/packages/saleor/src/product/use-search.tsx @@ -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 diff --git a/framework/saleor/provider.ts b/packages/saleor/src/provider.ts similarity index 91% rename from framework/saleor/provider.ts rename to packages/saleor/src/provider.ts index 2ca96475a..becf2998f 100644 --- a/framework/saleor/provider.ts +++ b/packages/saleor/src/provider.ts @@ -1,3 +1,4 @@ +import { CHECKOUT_ID_COOKIE } from './const' import { handler as useCart } from './cart/use-cart' import { handler as useAddItem } from './cart/use-add-item' import { handler as useUpdateItem } from './cart/use-update-item' @@ -14,8 +15,7 @@ import fetcher from './fetcher' export const saleorProvider = { locale: 'en-us', - cartCookie: '', - cartCookieToken: '', + cartCookie: CHECKOUT_ID_COOKIE, fetcher, cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, customer: { useCustomer }, diff --git a/framework/saleor/types.ts b/packages/saleor/src/types.ts similarity index 90% rename from framework/saleor/types.ts rename to packages/saleor/src/types.ts index 2025b8898..1bbf94cf3 100644 --- a/framework/saleor/types.ts +++ b/packages/saleor/src/types.ts @@ -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 diff --git a/framework/saleor/types/cart.ts b/packages/saleor/src/types/cart.ts similarity index 88% rename from framework/saleor/types/cart.ts rename to packages/saleor/src/types/cart.ts index 1f4ba61df..9a4d29387 100644 --- a/framework/saleor/types/cart.ts +++ b/packages/saleor/src/types/cart.ts @@ -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 = {} diff --git a/framework/saleor/utils/checkout-attach.ts b/packages/saleor/src/utils/checkout-attach.ts similarity index 83% rename from framework/saleor/utils/checkout-attach.ts rename to packages/saleor/src/utils/checkout-attach.ts index 476c73e77..c7ab44ab0 100644 --- a/framework/saleor/utils/checkout-attach.ts +++ b/packages/saleor/src/utils/checkout-attach.ts @@ -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 => { const data = await fetch({ diff --git a/framework/saleor/utils/checkout-create.ts b/packages/saleor/src/utils/checkout-create.ts similarity index 85% rename from framework/saleor/utils/checkout-create.ts rename to packages/saleor/src/utils/checkout-create.ts index c1b6e4023..0e86c1335 100644 --- a/framework/saleor/utils/checkout-create.ts +++ b/packages/saleor/src/utils/checkout-create.ts @@ -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 => { const data = await fetch({ query: mutation.CheckoutCreate }) diff --git a/framework/saleor/utils/checkout-to-cart.ts b/packages/saleor/src/utils/checkout-to-cart.ts similarity index 91% rename from framework/saleor/utils/checkout-to-cart.ts rename to packages/saleor/src/utils/checkout-to-cart.ts index 0bfcf6ed9..4c228adea 100644 --- a/framework/saleor/utils/checkout-to-cart.ts +++ b/packages/saleor/src/utils/checkout-to-cart.ts @@ -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' diff --git a/framework/saleor/utils/customer-token.ts b/packages/saleor/src/utils/customer-token.ts similarity index 100% rename from framework/saleor/utils/customer-token.ts rename to packages/saleor/src/utils/customer-token.ts diff --git a/framework/saleor/utils/fragments/checkout-details.ts b/packages/saleor/src/utils/fragments/checkout-details.ts similarity index 100% rename from framework/saleor/utils/fragments/checkout-details.ts rename to packages/saleor/src/utils/fragments/checkout-details.ts diff --git a/framework/saleor/utils/fragments/index.ts b/packages/saleor/src/utils/fragments/index.ts similarity index 100% rename from framework/saleor/utils/fragments/index.ts rename to packages/saleor/src/utils/fragments/index.ts diff --git a/framework/saleor/utils/fragments/product.ts b/packages/saleor/src/utils/fragments/product.ts similarity index 100% rename from framework/saleor/utils/fragments/product.ts rename to packages/saleor/src/utils/fragments/product.ts diff --git a/framework/saleor/utils/get-categories.ts b/packages/saleor/src/utils/get-categories.ts similarity index 81% rename from framework/saleor/utils/get-categories.ts rename to packages/saleor/src/utils/get-categories.ts index 990c0a404..e2cc72533 100644 --- a/framework/saleor/utils/get-categories.ts +++ b/packages/saleor/src/utils/get-categories.ts @@ -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 => { diff --git a/framework/saleor/utils/get-checkout-id.ts b/packages/saleor/src/utils/get-checkout-id.ts similarity index 100% rename from framework/saleor/utils/get-checkout-id.ts rename to packages/saleor/src/utils/get-checkout-id.ts diff --git a/framework/saleor/utils/get-search-variables.ts b/packages/saleor/src/utils/get-search-variables.ts similarity index 100% rename from framework/saleor/utils/get-search-variables.ts rename to packages/saleor/src/utils/get-search-variables.ts diff --git a/framework/saleor/utils/get-sort-variables.ts b/packages/saleor/src/utils/get-sort-variables.ts similarity index 100% rename from framework/saleor/utils/get-sort-variables.ts rename to packages/saleor/src/utils/get-sort-variables.ts diff --git a/framework/saleor/utils/get-vendors.ts b/packages/saleor/src/utils/get-vendors.ts similarity index 100% rename from framework/saleor/utils/get-vendors.ts rename to packages/saleor/src/utils/get-vendors.ts diff --git a/framework/saleor/utils/handle-fetch-response.ts b/packages/saleor/src/utils/handle-fetch-response.ts similarity index 90% rename from framework/saleor/utils/handle-fetch-response.ts rename to packages/saleor/src/utils/handle-fetch-response.ts index 6a2b5f57b..33fe15c17 100644 --- a/framework/saleor/utils/handle-fetch-response.ts +++ b/packages/saleor/src/utils/handle-fetch-response.ts @@ -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' }] diff --git a/framework/saleor/utils/handle-login.ts b/packages/saleor/src/utils/handle-login.ts similarity index 91% rename from framework/saleor/utils/handle-login.ts rename to packages/saleor/src/utils/handle-login.ts index 4ef390174..b1beaeda9 100644 --- a/framework/saleor/utils/handle-login.ts +++ b/packages/saleor/src/utils/handle-login.ts @@ -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' diff --git a/framework/saleor/utils/index.ts b/packages/saleor/src/utils/index.ts similarity index 100% rename from framework/saleor/utils/index.ts rename to packages/saleor/src/utils/index.ts diff --git a/framework/saleor/utils/mutations/account-create.ts b/packages/saleor/src/utils/mutations/account-create.ts similarity index 100% rename from framework/saleor/utils/mutations/account-create.ts rename to packages/saleor/src/utils/mutations/account-create.ts diff --git a/framework/saleor/utils/mutations/checkout-attach.ts b/packages/saleor/src/utils/mutations/checkout-attach.ts similarity index 100% rename from framework/saleor/utils/mutations/checkout-attach.ts rename to packages/saleor/src/utils/mutations/checkout-attach.ts diff --git a/framework/saleor/utils/mutations/checkout-create.ts b/packages/saleor/src/utils/mutations/checkout-create.ts similarity index 100% rename from framework/saleor/utils/mutations/checkout-create.ts rename to packages/saleor/src/utils/mutations/checkout-create.ts diff --git a/framework/saleor/utils/mutations/checkout-line-add.ts b/packages/saleor/src/utils/mutations/checkout-line-add.ts similarity index 100% rename from framework/saleor/utils/mutations/checkout-line-add.ts rename to packages/saleor/src/utils/mutations/checkout-line-add.ts diff --git a/framework/saleor/utils/mutations/checkout-line-remove.ts b/packages/saleor/src/utils/mutations/checkout-line-remove.ts similarity index 100% rename from framework/saleor/utils/mutations/checkout-line-remove.ts rename to packages/saleor/src/utils/mutations/checkout-line-remove.ts diff --git a/framework/saleor/utils/mutations/checkout-line-update.ts b/packages/saleor/src/utils/mutations/checkout-line-update.ts similarity index 100% rename from framework/saleor/utils/mutations/checkout-line-update.ts rename to packages/saleor/src/utils/mutations/checkout-line-update.ts diff --git a/framework/saleor/utils/mutations/index.ts b/packages/saleor/src/utils/mutations/index.ts similarity index 100% rename from framework/saleor/utils/mutations/index.ts rename to packages/saleor/src/utils/mutations/index.ts diff --git a/framework/saleor/utils/mutations/session-create.ts b/packages/saleor/src/utils/mutations/session-create.ts similarity index 100% rename from framework/saleor/utils/mutations/session-create.ts rename to packages/saleor/src/utils/mutations/session-create.ts diff --git a/framework/saleor/utils/mutations/session-destroy.ts b/packages/saleor/src/utils/mutations/session-destroy.ts similarity index 100% rename from framework/saleor/utils/mutations/session-destroy.ts rename to packages/saleor/src/utils/mutations/session-destroy.ts diff --git a/framework/saleor/utils/normalize.ts b/packages/saleor/src/utils/normalize.ts similarity index 97% rename from framework/saleor/utils/normalize.ts rename to packages/saleor/src/utils/normalize.ts index 56091db15..a4ff4b52c 100644 --- a/framework/saleor/utils/normalize.ts +++ b/packages/saleor/src/utils/normalize.ts @@ -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' diff --git a/framework/saleor/utils/queries/checkout-one.ts b/packages/saleor/src/utils/queries/checkout-one.ts similarity index 100% rename from framework/saleor/utils/queries/checkout-one.ts rename to packages/saleor/src/utils/queries/checkout-one.ts diff --git a/framework/saleor/utils/queries/collection-many.ts b/packages/saleor/src/utils/queries/collection-many.ts similarity index 100% rename from framework/saleor/utils/queries/collection-many.ts rename to packages/saleor/src/utils/queries/collection-many.ts diff --git a/framework/saleor/utils/queries/collection-one.ts b/packages/saleor/src/utils/queries/collection-one.ts similarity index 100% rename from framework/saleor/utils/queries/collection-one.ts rename to packages/saleor/src/utils/queries/collection-one.ts diff --git a/framework/saleor/utils/queries/customer-current.ts b/packages/saleor/src/utils/queries/customer-current.ts similarity index 100% rename from framework/saleor/utils/queries/customer-current.ts rename to packages/saleor/src/utils/queries/customer-current.ts diff --git a/framework/saleor/utils/queries/customer-one.ts b/packages/saleor/src/utils/queries/customer-one.ts similarity index 100% rename from framework/saleor/utils/queries/customer-one.ts rename to packages/saleor/src/utils/queries/customer-one.ts diff --git a/framework/saleor/utils/queries/get-all-product-vendors-query.ts b/packages/saleor/src/utils/queries/get-all-product-vendors-query.ts similarity index 100% rename from framework/saleor/utils/queries/get-all-product-vendors-query.ts rename to packages/saleor/src/utils/queries/get-all-product-vendors-query.ts diff --git a/framework/saleor/utils/queries/get-all-products-paths-query.ts b/packages/saleor/src/utils/queries/get-all-products-paths-query.ts similarity index 100% rename from framework/saleor/utils/queries/get-all-products-paths-query.ts rename to packages/saleor/src/utils/queries/get-all-products-paths-query.ts diff --git a/framework/saleor/utils/queries/index.ts b/packages/saleor/src/utils/queries/index.ts similarity index 100% rename from framework/saleor/utils/queries/index.ts rename to packages/saleor/src/utils/queries/index.ts diff --git a/framework/saleor/utils/queries/page-many.ts b/packages/saleor/src/utils/queries/page-many.ts similarity index 100% rename from framework/saleor/utils/queries/page-many.ts rename to packages/saleor/src/utils/queries/page-many.ts diff --git a/framework/saleor/utils/queries/page-one.ts b/packages/saleor/src/utils/queries/page-one.ts similarity index 100% rename from framework/saleor/utils/queries/page-one.ts rename to packages/saleor/src/utils/queries/page-one.ts diff --git a/framework/saleor/utils/queries/product-many.ts b/packages/saleor/src/utils/queries/product-many.ts similarity index 100% rename from framework/saleor/utils/queries/product-many.ts rename to packages/saleor/src/utils/queries/product-many.ts diff --git a/framework/saleor/utils/queries/product-one-by-slug.ts b/packages/saleor/src/utils/queries/product-one-by-slug.ts similarity index 100% rename from framework/saleor/utils/queries/product-one-by-slug.ts rename to packages/saleor/src/utils/queries/product-one-by-slug.ts diff --git a/framework/saleor/utils/throw-user-errors.ts b/packages/saleor/src/utils/throw-user-errors.ts similarity index 83% rename from framework/saleor/utils/throw-user-errors.ts rename to packages/saleor/src/utils/throw-user-errors.ts index 2991d78a6..59345e748 100644 --- a/framework/saleor/utils/throw-user-errors.ts +++ b/packages/saleor/src/utils/throw-user-errors.ts @@ -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 diff --git a/framework/swell/wishlist/use-add-item.tsx b/packages/saleor/src/wishlist/use-add-item.tsx similarity index 100% rename from framework/swell/wishlist/use-add-item.tsx rename to packages/saleor/src/wishlist/use-add-item.tsx diff --git a/framework/swell/wishlist/use-remove-item.tsx b/packages/saleor/src/wishlist/use-remove-item.tsx similarity index 100% rename from framework/swell/wishlist/use-remove-item.tsx rename to packages/saleor/src/wishlist/use-remove-item.tsx diff --git a/framework/saleor/wishlist/use-wishlist.tsx b/packages/saleor/src/wishlist/use-wishlist.tsx similarity index 90% rename from framework/saleor/wishlist/use-wishlist.tsx rename to packages/saleor/src/wishlist/use-wishlist.tsx index cdd9a643d..56e7ea0e7 100644 --- a/framework/saleor/wishlist/use-wishlist.tsx +++ b/packages/saleor/src/wishlist/use-wishlist.tsx @@ -1,8 +1,8 @@ // TODO: replace this hook and other wishlist hooks with a handler, or remove them if // Saleor doesn't have a wishlist -import { HookFetcher } from '@commerce/utils/types' -import { Product } from '../schema' +import { HookFetcher } from '@vercel/commerce/utils/types' +import { Product } from '../../schema' const defaultOpts = {} diff --git a/packages/saleor/taskfile.js b/packages/saleor/taskfile.js new file mode 100644 index 000000000..39b1b2a86 --- /dev/null +++ b/packages/saleor/taskfile.js @@ -0,0 +1,20 @@ +export async function build(task, opts) { + await task + .source('src/**/*.+(ts|tsx|js)') + .swc({ dev: opts.dev, outDir: 'dist', baseUrl: 'src' }) + .target('dist') + .source('src/**/*.+(cjs|json)') + .target('dist') + task.$.log('Compiled src files') +} + +export async function release(task) { + await task.clear('dist').start('build') +} + +export default async function dev(task) { + const opts = { dev: true } + await task.clear('dist') + await task.start('build', opts) + await task.watch('src/**/*.+(ts|tsx|js|cjs|json)', 'build', opts) +} diff --git a/packages/saleor/tsconfig.json b/packages/saleor/tsconfig.json new file mode 100644 index 000000000..cd04ab2ff --- /dev/null +++ b/packages/saleor/tsconfig.json @@ -0,0 +1,21 @@ +{ + "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, + "incremental": true, + "jsx": "react-jsx" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/framework/shopify/.env.template b/packages/shopify/.env.template similarity index 100% rename from framework/shopify/.env.template rename to packages/shopify/.env.template diff --git a/packages/shopify/.prettierignore b/packages/shopify/.prettierignore new file mode 100644 index 000000000..f06235c46 --- /dev/null +++ b/packages/shopify/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/shopify/.prettierrc b/packages/shopify/.prettierrc new file mode 100644 index 000000000..e1076edfa --- /dev/null +++ b/packages/shopify/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/framework/shopify/README.md b/packages/shopify/README.md similarity index 96% rename from framework/shopify/README.md rename to packages/shopify/README.md index d5c4aa942..15a6e1f11 100644 --- a/framework/shopify/README.md +++ b/packages/shopify/README.md @@ -2,12 +2,12 @@ **Demo:** https://shopify.demo.vercel.store/ -Before getting starter, a [Shopify](https://www.shopify.com/) account and store is required before using the provider. +Before getting started, a [Shopify](https://www.shopify.com/) account and store is required before using the provider. Next, copy the `.env.template` file in this directory to `.env.local` in the main directory (which will be ignored by Git): ```bash -cp framework/shopify/.env.template .env.local +cp packages/shopify/.env.template .env.local ``` Then, set the environment variables in `.env.local` to match the ones from your store. diff --git a/framework/shopify/codegen.json b/packages/shopify/codegen.json similarity index 81% rename from framework/shopify/codegen.json rename to packages/shopify/codegen.json index 9d7dcf8a9..4b1dd2087 100644 --- a/framework/shopify/codegen.json +++ b/packages/shopify/codegen.json @@ -8,13 +8,13 @@ }, "documents": [ { - "./framework/shopify/**/*.{ts,tsx}": { + "./src/**/*.{ts,tsx}": { "noRequire": true } } ], "generates": { - "./framework/shopify/schema.d.ts": { + "./schema.d.ts": { "plugins": ["typescript", "typescript-operations"], "config": { "scalars": { @@ -22,7 +22,7 @@ } } }, - "./framework/shopify/schema.graphql": { + "./schema.graphql": { "plugins": ["schema-ast"] } }, diff --git a/packages/shopify/package.json b/packages/shopify/package.json new file mode 100644 index 000000000..a98e3b507 --- /dev/null +++ b/packages/shopify/package.json @@ -0,0 +1,86 @@ +{ + "name": "@vercel/commerce-shopify", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "release": "taskr release", + "build": "taskr build", + "dev": "taskr", + "types": "tsc --emitDeclarationOnly", + "prettier-fix": "prettier --write .", + "generate": "DOTENV_CONFIG_PATH=./.env graphql-codegen -r dotenv/config" + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], + "./next.config": "./dist/next.config.cjs" + }, + "typesVersions": { + "*": { + "*": [ + "src/*", + "src/*/index" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + }, + "files": [ + "dist", + "schema.d.ts" + ], + "publishConfig": { + "typesVersions": { + "*": { + "*": [ + "dist/*.d.ts", + "dist/*/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": { + "@graphql-codegen/cli": "^2.3.1", + "@graphql-codegen/schema-ast": "^2.4.1", + "@graphql-codegen/typescript": "^2.4.2", + "@graphql-codegen/typescript-operations": "^2.2.2", + "@taskr/clear": "^1.1.0", + "@taskr/esnext": "^1.1.0", + "@taskr/watch": "^1.1.0", + "@types/node": "^17.0.8", + "@types/react": "^17.0.38", + "dotenv": "^12.0.3", + "lint-staged": "^12.1.7", + "next": "^12.0.8", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "taskr": "^1.1.0", + "taskr-swc": "^0.0.1", + "typescript": "^4.5.4" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,json}": [ + "prettier --write", + "git add" + ] + } +} diff --git a/framework/shopify/schema.d.ts b/packages/shopify/schema.d.ts similarity index 100% rename from framework/shopify/schema.d.ts rename to packages/shopify/schema.d.ts diff --git a/framework/shopify/schema.graphql b/packages/shopify/schema.graphql similarity index 100% rename from framework/shopify/schema.graphql rename to packages/shopify/schema.graphql diff --git a/framework/shopify/api/endpoints/cart.ts b/packages/shopify/src/api/endpoints/cart.ts similarity index 100% rename from framework/shopify/api/endpoints/cart.ts rename to packages/shopify/src/api/endpoints/cart.ts diff --git a/framework/shopify/api/endpoints/catalog/products.ts b/packages/shopify/src/api/endpoints/catalog/products.ts similarity index 100% rename from framework/shopify/api/endpoints/catalog/products.ts rename to packages/shopify/src/api/endpoints/catalog/products.ts diff --git a/framework/shopify/api/endpoints/checkout/checkout.ts b/packages/shopify/src/api/endpoints/checkout/get-checkout.ts similarity index 89% rename from framework/shopify/api/endpoints/checkout/checkout.ts rename to packages/shopify/src/api/endpoints/checkout/get-checkout.ts index 0c340a129..188915022 100644 --- a/framework/shopify/api/endpoints/checkout/checkout.ts +++ b/packages/shopify/src/api/endpoints/checkout/get-checkout.ts @@ -6,7 +6,7 @@ import { import associateCustomerWithCheckoutMutation from '../../../utils/mutations/associate-customer-with-checkout' import type { CheckoutEndpoint } from '.' -const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({ +const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ req, res, config, @@ -35,4 +35,4 @@ const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({ } } -export default checkout +export default getCheckout diff --git a/framework/shopify/api/endpoints/checkout/index.ts b/packages/shopify/src/api/endpoints/checkout/index.ts similarity index 58% rename from framework/shopify/api/endpoints/checkout/index.ts rename to packages/shopify/src/api/endpoints/checkout/index.ts index 5d78f451b..64020810d 100644 --- a/framework/shopify/api/endpoints/checkout/index.ts +++ b/packages/shopify/src/api/endpoints/checkout/index.ts @@ -1,14 +1,14 @@ -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 type { CheckoutSchema } from '../../../types/checkout' import type { ShopifyAPI } from '../..' -import checkout from './checkout' +import getCheckout from './get-checkout' export type CheckoutAPI = GetAPISchema export type CheckoutEndpoint = CheckoutAPI['endpoint'] -export const handlers: CheckoutEndpoint['handlers'] = { checkout } +export const handlers: CheckoutEndpoint['handlers'] = { getCheckout } const checkoutApi = createEndpoint({ handler: checkoutEndpoint, diff --git a/packages/shopify/src/api/endpoints/customer/address.ts b/packages/shopify/src/api/endpoints/customer/address.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/shopify/src/api/endpoints/customer/address.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/shopify/src/api/endpoints/customer/card.ts b/packages/shopify/src/api/endpoints/customer/card.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/shopify/src/api/endpoints/customer/card.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/shopify/src/api/endpoints/customer/index.ts b/packages/shopify/src/api/endpoints/customer/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/shopify/src/api/endpoints/customer/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/framework/shopify/api/endpoints/login.ts b/packages/shopify/src/api/endpoints/login.ts similarity index 100% rename from framework/shopify/api/endpoints/login.ts rename to packages/shopify/src/api/endpoints/login.ts diff --git a/framework/shopify/api/endpoints/logout.ts b/packages/shopify/src/api/endpoints/logout.ts similarity index 100% rename from framework/shopify/api/endpoints/logout.ts rename to packages/shopify/src/api/endpoints/logout.ts diff --git a/framework/shopify/api/endpoints/signup.ts b/packages/shopify/src/api/endpoints/signup.ts similarity index 100% rename from framework/shopify/api/endpoints/signup.ts rename to packages/shopify/src/api/endpoints/signup.ts diff --git a/framework/shopify/api/endpoints/wishlist.ts b/packages/shopify/src/api/endpoints/wishlist.ts similarity index 100% rename from framework/shopify/api/endpoints/wishlist.ts rename to packages/shopify/src/api/endpoints/wishlist.ts diff --git a/framework/shopify/api/index.ts b/packages/shopify/src/api/index.ts similarity index 97% rename from framework/shopify/api/index.ts rename to packages/shopify/src/api/index.ts index 28c7d34b3..7ae6a4206 100644 --- a/framework/shopify/api/index.ts +++ b/packages/shopify/src/api/index.ts @@ -2,7 +2,7 @@ import { CommerceAPI, CommerceAPIConfig, getCommerceApi as commerceApi, -} from '@commerce/api' +} from '@vercel/commerce/api' import { API_URL, diff --git a/framework/shopify/api/operations/get-all-pages.ts b/packages/shopify/src/api/operations/get-all-pages.ts similarity index 96% rename from framework/shopify/api/operations/get-all-pages.ts rename to packages/shopify/src/api/operations/get-all-pages.ts index 38285ccca..2f6cc0916 100644 --- a/framework/shopify/api/operations/get-all-pages.ts +++ b/packages/shopify/src/api/operations/get-all-pages.ts @@ -1,12 +1,12 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import { GetAllPagesQuery, GetAllPagesQueryVariables, PageEdge, -} from '../../schema' +} from '../../../schema' import { normalizePages } from '../../utils' import type { ShopifyConfig, Provider } from '..' import type { GetAllPagesOperation, Page } from '../../types/page' diff --git a/framework/shopify/api/operations/get-all-product-paths.ts b/packages/shopify/src/api/operations/get-all-product-paths.ts similarity index 95% rename from framework/shopify/api/operations/get-all-product-paths.ts rename to packages/shopify/src/api/operations/get-all-product-paths.ts index c84f8c90a..e5a7d2d8e 100644 --- a/framework/shopify/api/operations/get-all-product-paths.ts +++ b/packages/shopify/src/api/operations/get-all-product-paths.ts @@ -1,13 +1,13 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import { GetAllProductPathsOperation } from '../../types/product' import { GetAllProductPathsQuery, GetAllProductPathsQueryVariables, ProductEdge, -} from '../../schema' +} from '../../../schema' import type { ShopifyConfig, Provider } from '..' import { getAllProductsQuery } from '../../utils' diff --git a/framework/shopify/api/operations/get-all-products.ts b/packages/shopify/src/api/operations/get-all-products.ts similarity index 96% rename from framework/shopify/api/operations/get-all-products.ts rename to packages/shopify/src/api/operations/get-all-products.ts index 08d781d5c..003e27204 100644 --- a/framework/shopify/api/operations/get-all-products.ts +++ b/packages/shopify/src/api/operations/get-all-products.ts @@ -1,13 +1,13 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import { GetAllProductsOperation } from '../../types/product' 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' diff --git a/framework/shopify/api/operations/get-page.ts b/packages/shopify/src/api/operations/get-page.ts similarity index 95% rename from framework/shopify/api/operations/get-page.ts rename to packages/shopify/src/api/operations/get-page.ts index 023ebeeb7..2cea52194 100644 --- a/framework/shopify/api/operations/get-page.ts +++ b/packages/shopify/src/api/operations/get-page.ts @@ -1,14 +1,14 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import { normalizePage } from '../../utils' import type { ShopifyConfig, Provider } from '..' import { GetPageQuery, GetPageQueryVariables, Page as ShopifyPage, -} from '../../schema' +} from '../../../schema' import { GetPageOperation } from '../../types/page' import getPageQuery from '../../utils/queries/get-page-query' diff --git a/framework/shopify/api/operations/get-product.ts b/packages/shopify/src/api/operations/get-product.ts similarity index 91% rename from framework/shopify/api/operations/get-product.ts rename to packages/shopify/src/api/operations/get-product.ts index 447b5c792..1697b0feb 100644 --- a/framework/shopify/api/operations/get-product.ts +++ b/packages/shopify/src/api/operations/get-product.ts @@ -1,11 +1,14 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' 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, diff --git a/framework/shopify/api/operations/get-site-info.ts b/packages/shopify/src/api/operations/get-site-info.ts similarity index 93% rename from framework/shopify/api/operations/get-site-info.ts rename to packages/shopify/src/api/operations/get-site-info.ts index 7f51d1d5c..6bb6de4b0 100644 --- a/framework/shopify/api/operations/get-site-info.ts +++ b/packages/shopify/src/api/operations/get-site-info.ts @@ -1,8 +1,8 @@ import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' -import { GetSiteInfoQueryVariables } from '../../schema' +} from '@vercel/commerce/api/operations' +import { GetSiteInfoQueryVariables } from '../../../schema' import type { ShopifyConfig, Provider } from '..' import { GetSiteInfoOperation } from '../../types/site' diff --git a/framework/shopify/api/operations/index.ts b/packages/shopify/src/api/operations/index.ts similarity index 100% rename from framework/shopify/api/operations/index.ts rename to packages/shopify/src/api/operations/index.ts diff --git a/framework/shopify/api/operations/login.ts b/packages/shopify/src/api/operations/login.ts similarity index 89% rename from framework/shopify/api/operations/login.ts rename to packages/shopify/src/api/operations/login.ts index 41e837a3f..5fad769bd 100644 --- a/framework/shopify/api/operations/login.ts +++ b/packages/shopify/src/api/operations/login.ts @@ -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 { LoginOperation } from '../../types/login' import type { ShopifyConfig, Provider } from '..' import { @@ -7,7 +7,7 @@ import { setCustomerToken, throwUserErrors, } from '../../utils' -import { CustomerAccessTokenCreateMutation } from '../../schema' +import { CustomerAccessTokenCreateMutation } from '../../../schema' export default function loginOperation({ commerce, diff --git a/framework/shopify/api/utils/fetch-graphql-api.ts b/packages/shopify/src/api/utils/fetch-graphql-api.ts similarity index 94% rename from framework/shopify/api/utils/fetch-graphql-api.ts rename to packages/shopify/src/api/utils/fetch-graphql-api.ts index c45d57e70..1970db572 100644 --- a/framework/shopify/api/utils/fetch-graphql-api.ts +++ b/packages/shopify/src/api/utils/fetch-graphql-api.ts @@ -1,4 +1,4 @@ -import type { GraphQLFetcher } from '@commerce/api' +import type { GraphQLFetcher } from '@vercel/commerce/api' import fetch from './fetch' import { API_URL, API_TOKEN } from '../../const' diff --git a/framework/shopify/api/utils/fetch.ts b/packages/shopify/src/api/utils/fetch.ts similarity index 100% rename from framework/shopify/api/utils/fetch.ts rename to packages/shopify/src/api/utils/fetch.ts diff --git a/framework/shopify/auth/use-login.tsx b/packages/shopify/src/auth/use-login.tsx similarity index 78% rename from framework/shopify/auth/use-login.tsx rename to packages/shopify/src/auth/use-login.tsx index a8bea1ff6..c9d183e33 100644 --- a/framework/shopify/auth/use-login.tsx +++ b/packages/shopify/src/auth/use-login.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError } from '@commerce/utils/errors' -import useLogin, { UseLogin } from '@commerce/auth/use-login' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login' import type { LoginHook } from '../types/login' import useCustomer from '../customer/use-customer' @@ -10,7 +10,7 @@ import { throwUserErrors, customerAccessTokenCreateMutation, } from '../utils' -import { Mutation, MutationCustomerAccessTokenCreateArgs } from '../schema' +import { Mutation, MutationCustomerAccessTokenCreateArgs } from '../../schema' export default useLogin as UseLogin @@ -21,8 +21,7 @@ export const handler: MutationHook = { async fetcher({ input: { email, password }, options, fetch }) { if (!(email && password)) { throw new CommerceError({ - message: - 'An email and password are required to login', + message: 'An email and password are required to login', }) } @@ -50,15 +49,15 @@ export const handler: MutationHook = { useHook: ({ fetch }) => () => { - const { revalidate } = useCustomer() + const { mutate } = useCustomer() return useCallback( async function login(input) { const data = await fetch({ input }) - await revalidate() + await mutate() return data }, - [fetch, revalidate] + [fetch, mutate] ) }, } diff --git a/framework/shopify/auth/use-logout.tsx b/packages/shopify/src/auth/use-logout.tsx similarity index 87% rename from framework/shopify/auth/use-logout.tsx rename to packages/shopify/src/auth/use-logout.tsx index fdba8df84..c37b0fcc9 100644 --- a/framework/shopify/auth/use-logout.tsx +++ b/packages/shopify/src/auth/use-logout.tsx @@ -1,6 +1,6 @@ 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 type { LogoutHook } from '../types/logout' import useCustomer from '../customer/use-customer' import customerAccessTokenDeleteMutation from '../utils/mutations/customer-access-token-delete' diff --git a/framework/shopify/auth/use-signup.tsx b/packages/shopify/src/auth/use-signup.tsx similarity index 78% rename from framework/shopify/auth/use-signup.tsx rename to packages/shopify/src/auth/use-signup.tsx index 0a55c17d4..8af0fec7d 100644 --- a/framework/shopify/auth/use-signup.tsx +++ b/packages/shopify/src/auth/use-signup.tsx @@ -1,10 +1,10 @@ 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 type { SignupHook } from '../types/signup' import useCustomer from '../customer/use-customer' -import { Mutation, MutationCustomerCreateArgs } from '../schema' +import { Mutation, MutationCustomerCreateArgs } from '../../schema' import { handleAutomaticLogin, @@ -53,15 +53,15 @@ export const handler: MutationHook = { useHook: ({ fetch }) => () => { - const { revalidate } = useCustomer() + const { mutate } = useCustomer() return useCallback( async function signup(input) { const data = await fetch({ input }) - await revalidate() + await mutate() return data }, - [fetch, revalidate] + [fetch, mutate] ) }, } diff --git a/framework/shopify/cart/index.ts b/packages/shopify/src/cart/index.ts similarity index 100% rename from framework/shopify/cart/index.ts rename to packages/shopify/src/cart/index.ts diff --git a/framework/shopify/cart/use-add-item.tsx b/packages/shopify/src/cart/use-add-item.tsx similarity index 54% rename from framework/shopify/cart/use-add-item.tsx rename to packages/shopify/src/cart/use-add-item.tsx index 099b52c77..5460bd726 100644 --- a/framework/shopify/cart/use-add-item.tsx +++ b/packages/shopify/src/cart/use-add-item.tsx @@ -1,7 +1,7 @@ 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 type { AddItemHook } from '../types/cart' import useCart from './use-cart' @@ -9,8 +9,9 @@ import { checkoutLineItemAddMutation, getCheckoutId, checkoutToCart, + checkoutCreate, } from '../utils' -import { Mutation, MutationCheckoutLineItemsAddArgs } from '../schema' +import { Mutation, MutationCheckoutLineItemsAddArgs } from '../../schema' export default useAddItem as UseAddItem @@ -28,29 +29,35 @@ export const handler: MutationHook = { }) } - const { checkoutLineItemsAdd } = await fetch< - Mutation, - MutationCheckoutLineItemsAddArgs - >({ - ...options, - variables: { - checkoutId: getCheckoutId(), - lineItems: [ - { - variantId: item.variantId, - quantity: item.quantity ?? 1, - }, - ], + const lineItems = [ + { + variantId: item.variantId, + quantity: item.quantity ?? 1, }, - }) + ] - return checkoutToCart(checkoutLineItemsAdd) + let checkoutId = getCheckoutId() + + if (!checkoutId) { + return checkoutToCart(await checkoutCreate(fetch, lineItems)) + } else { + const { checkoutLineItemsAdd } = await fetch< + Mutation, + MutationCheckoutLineItemsAddArgs + >({ + ...options, + variables: { + checkoutId, + lineItems, + }, + }) + return checkoutToCart(checkoutLineItemsAdd) + } }, useHook: ({ fetch }) => () => { const { mutate } = useCart() - return useCallback( async function addItem(input) { const data = await fetch({ input }) diff --git a/framework/shopify/cart/use-cart.tsx b/packages/shopify/src/cart/use-cart.tsx similarity index 54% rename from framework/shopify/cart/use-cart.tsx rename to packages/shopify/src/cart/use-cart.tsx index bea2a682e..2fe68beef 100644 --- a/framework/shopify/cart/use-cart.tsx +++ b/packages/shopify/src/cart/use-cart.tsx @@ -1,16 +1,16 @@ 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 { checkoutCreate, checkoutToCart } from '../utils' +import { SWRHook } from '@vercel/commerce/utils/types' +import { checkoutToCart } from '../utils' import getCheckoutQuery from '../utils/queries/get-checkout-query' import { GetCartHook } from '../types/cart' +import Cookies from 'js-cookie' import { - GetCheckoutQuery, - GetCheckoutQueryVariables, - CheckoutDetailsFragment, -} from '../schema' + SHOPIFY_CHECKOUT_ID_COOKIE, + SHOPIFY_CHECKOUT_URL_COOKIE, +} from '../const' export default useCommerceCart as UseCart @@ -18,24 +18,25 @@ export const handler: SWRHook = { fetchOptions: { query: getCheckoutQuery, }, - async fetcher({ input: { cartId: checkoutId }, options, fetch }) { - let checkout - - if (checkoutId) { - const data = await fetch({ + async fetcher({ input: { cartId }, options, fetch }) { + if (cartId) { + const { node: checkout } = await fetch({ ...options, variables: { - checkoutId: checkoutId, + checkoutId: cartId, }, }) - checkout = data.node + if (checkout?.completedAt) { + Cookies.remove(SHOPIFY_CHECKOUT_ID_COOKIE) + Cookies.remove(SHOPIFY_CHECKOUT_URL_COOKIE) + return null + } else { + return checkoutToCart({ + checkout, + }) + } } - - if (checkout?.completedAt || !checkoutId) { - checkout = await checkoutCreate(fetch) - } - - return checkoutToCart({ checkout }) + return null }, useHook: ({ useData }) => diff --git a/framework/shopify/cart/use-remove-item.tsx b/packages/shopify/src/cart/use-remove-item.tsx similarity index 90% rename from framework/shopify/cart/use-remove-item.tsx rename to packages/shopify/src/cart/use-remove-item.tsx index 5e193358b..d04c7c5d2 100644 --- a/framework/shopify/cart/use-remove-item.tsx +++ b/packages/shopify/src/cart/use-remove-item.tsx @@ -2,9 +2,11 @@ import { useCallback } from 'react' import type { MutationHookContext, HookFetcherContext, -} from '@commerce/utils/types' -import { ValidationError } from '@commerce/utils/errors' -import useRemoveItem, { UseRemoveItem } from '@commerce/cart/use-remove-item' +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' +import useRemoveItem, { + UseRemoveItem, +} from '@vercel/commerce/cart/use-remove-item' import type { Cart, LineItem, RemoveItemHook } from '../types/cart' import useCart from './use-cart' @@ -24,7 +26,7 @@ import { checkoutToCart, } from '../utils' -import { Mutation, MutationCheckoutLineItemsRemoveArgs } from '../schema' +import { Mutation, MutationCheckoutLineItemsRemoveArgs } from '../../schema' export const handler = { fetchOptions: { diff --git a/framework/shopify/cart/use-update-item.tsx b/packages/shopify/src/cart/use-update-item.tsx similarity index 93% rename from framework/shopify/cart/use-update-item.tsx rename to packages/shopify/src/cart/use-update-item.tsx index 83d0a220a..0e8258a51 100644 --- a/framework/shopify/cart/use-update-item.tsx +++ b/packages/shopify/src/cart/use-update-item.tsx @@ -3,9 +3,11 @@ 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' +} 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' @@ -15,7 +17,7 @@ import { checkoutLineItemUpdateMutation, checkoutToCart, } from '../utils' -import { Mutation, MutationCheckoutLineItemsUpdateArgs } from '../schema' +import { Mutation, MutationCheckoutLineItemsUpdateArgs } from '../../schema' export type UpdateItemActionInput = T extends LineItem ? Partial diff --git a/packages/shopify/src/checkout/use-checkout.tsx b/packages/shopify/src/checkout/use-checkout.tsx new file mode 100644 index 000000000..76997be73 --- /dev/null +++ b/packages/shopify/src/checkout/use-checkout.tsx @@ -0,0 +1,16 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { + UseCheckout, +} from '@vercel/commerce/checkout/use-checkout' + +export default useCheckout as UseCheckout + +export const handler: SWRHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ useData }) => + async (input) => ({}), +} diff --git a/packages/shopify/src/commerce.config.json b/packages/shopify/src/commerce.config.json new file mode 100644 index 000000000..b194b629c --- /dev/null +++ b/packages/shopify/src/commerce.config.json @@ -0,0 +1,7 @@ +{ + "provider": "shopify", + "features": { + "wishlist": false, + "customerAuth": true + } +} diff --git a/framework/shopify/const.ts b/packages/shopify/src/const.ts similarity index 86% rename from framework/shopify/const.ts rename to packages/shopify/src/const.ts index 06fbe5054..a8ee70586 100644 --- a/framework/shopify/const.ts +++ b/packages/shopify/src/const.ts @@ -8,6 +8,6 @@ export const STORE_DOMAIN = process.env.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN export const SHOPIFY_COOKIE_EXPIRE = 30 -export const API_URL = `https://${STORE_DOMAIN}/api/2021-01/graphql.json` +export const API_URL = `https://${STORE_DOMAIN}/api/2021-07/graphql.json` export const API_TOKEN = process.env.NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN diff --git a/packages/shopify/src/customer/address/use-add-item.tsx b/packages/shopify/src/customer/address/use-add-item.tsx new file mode 100644 index 000000000..4f85c8472 --- /dev/null +++ b/packages/shopify/src/customer/address/use-add-item.tsx @@ -0,0 +1,17 @@ +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/address/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/packages/shopify/src/customer/card/use-add-item.tsx b/packages/shopify/src/customer/card/use-add-item.tsx new file mode 100644 index 000000000..77d149eff --- /dev/null +++ b/packages/shopify/src/customer/card/use-add-item.tsx @@ -0,0 +1,17 @@ +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/card/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/packages/shopify/src/customer/index.ts b/packages/shopify/src/customer/index.ts new file mode 100644 index 000000000..6c903ecc5 --- /dev/null +++ b/packages/shopify/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/framework/shopify/customer/use-customer.tsx b/packages/shopify/src/customer/use-customer.tsx similarity index 85% rename from framework/shopify/customer/use-customer.tsx rename to packages/shopify/src/customer/use-customer.tsx index 5c470e7de..6fc9a53a7 100644 --- a/framework/shopify/customer/use-customer.tsx +++ b/packages/shopify/src/customer/use-customer.tsx @@ -1,8 +1,10 @@ -import useCustomer, { UseCustomer } from '@commerce/customer/use-customer' +import useCustomer, { + UseCustomer, +} from '@vercel/commerce/customer/use-customer' import type { CustomerHook } from '../types/customer' -import { SWRHook } from '@commerce/utils/types' +import { SWRHook } from '@vercel/commerce/utils/types' import { getCustomerQuery, getCustomerToken } from '../utils' -import { GetCustomerQuery, GetCustomerQueryVariables } from '../schema' +import { GetCustomerQuery, GetCustomerQueryVariables } from '../../schema' export default useCustomer as UseCustomer diff --git a/framework/shopify/fetcher.ts b/packages/shopify/src/fetcher.ts similarity index 91% rename from framework/shopify/fetcher.ts rename to packages/shopify/src/fetcher.ts index 9a8d2d8d5..64f492620 100644 --- a/framework/shopify/fetcher.ts +++ b/packages/shopify/src/fetcher.ts @@ -1,4 +1,4 @@ -import { Fetcher } from '@commerce/utils/types' +import { Fetcher } from '@vercel/commerce/utils/types' import { API_TOKEN, API_URL } from './const' import { handleFetchResponse } from './utils' diff --git a/packages/shopify/src/index.tsx b/packages/shopify/src/index.tsx new file mode 100644 index 000000000..51199bbe6 --- /dev/null +++ b/packages/shopify/src/index.tsx @@ -0,0 +1,12 @@ +import { + getCommerceProvider, + useCommerce as useCoreCommerce, +} from '@vercel/commerce' +import { shopifyProvider, ShopifyProvider } from './provider' + +export { shopifyProvider } +export type { ShopifyProvider } + +export const CommerceProvider = getCommerceProvider(shopifyProvider) + +export const useCommerce = () => useCoreCommerce() diff --git a/framework/shopify/next.config.js b/packages/shopify/src/next.config.cjs similarity index 100% rename from framework/shopify/next.config.js rename to packages/shopify/src/next.config.cjs diff --git a/packages/shopify/src/product/use-price.tsx b/packages/shopify/src/product/use-price.tsx new file mode 100644 index 000000000..fd42d7033 --- /dev/null +++ b/packages/shopify/src/product/use-price.tsx @@ -0,0 +1,2 @@ +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/framework/shopify/product/use-search.tsx b/packages/shopify/src/product/use-search.tsx similarity index 93% rename from framework/shopify/product/use-search.tsx rename to packages/shopify/src/product/use-search.tsx index b975c03fe..582423e9f 100644 --- a/framework/shopify/product/use-search.tsx +++ b/packages/shopify/src/product/use-search.tsx @@ -1,5 +1,5 @@ -import { SWRHook } from '@commerce/utils/types' -import useSearch, { UseSearch } from '@commerce/product/use-search' +import { SWRHook } from '@vercel/commerce/utils/types' +import useSearch, { UseSearch } from '@vercel/commerce/product/use-search' import { CollectionEdge, @@ -7,7 +7,7 @@ import { GetProductsFromCollectionQueryVariables, Product as ShopifyProduct, ProductEdge, -} from '../schema' +} from '../../schema' import { getAllProductsQuery, diff --git a/framework/shopify/provider.ts b/packages/shopify/src/provider.ts similarity index 100% rename from framework/shopify/provider.ts rename to packages/shopify/src/provider.ts diff --git a/framework/shopify/types/cart.ts b/packages/shopify/src/types/cart.ts similarity index 88% rename from framework/shopify/types/cart.ts rename to packages/shopify/src/types/cart.ts index 09410740a..243d369a5 100644 --- a/framework/shopify/types/cart.ts +++ b/packages/shopify/src/types/cart.ts @@ -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 ShopifyCart = {} diff --git a/packages/shopify/src/types/checkout.ts b/packages/shopify/src/types/checkout.ts new file mode 100644 index 000000000..d139db685 --- /dev/null +++ b/packages/shopify/src/types/checkout.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/checkout' diff --git a/packages/shopify/src/types/common.ts b/packages/shopify/src/types/common.ts new file mode 100644 index 000000000..23b8daa11 --- /dev/null +++ b/packages/shopify/src/types/common.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/common' diff --git a/packages/shopify/src/types/customer.ts b/packages/shopify/src/types/customer.ts new file mode 100644 index 000000000..6e66366be --- /dev/null +++ b/packages/shopify/src/types/customer.ts @@ -0,0 +1,5 @@ +import * as Core from '@vercel/commerce/types/customer' + +export * from '@vercel/commerce/types/customer' + +export type CustomerSchema = Core.CustomerSchema diff --git a/framework/swell/types/index.ts b/packages/shopify/src/types/index.ts similarity index 100% rename from framework/swell/types/index.ts rename to packages/shopify/src/types/index.ts diff --git a/packages/shopify/src/types/login.ts b/packages/shopify/src/types/login.ts new file mode 100644 index 000000000..ab99bf8cd --- /dev/null +++ b/packages/shopify/src/types/login.ts @@ -0,0 +1,8 @@ +import * as Core from '@vercel/commerce/types/login' +import type { CustomerAccessTokenCreateInput } from '../../schema' + +export * from '@vercel/commerce/types/login' + +export type LoginOperation = Core.LoginOperation & { + variables: CustomerAccessTokenCreateInput +} diff --git a/packages/shopify/src/types/logout.ts b/packages/shopify/src/types/logout.ts new file mode 100644 index 000000000..1de06f8dc --- /dev/null +++ b/packages/shopify/src/types/logout.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/logout' diff --git a/framework/shopify/types/page.ts b/packages/shopify/src/types/page.ts similarity index 68% rename from framework/shopify/types/page.ts rename to packages/shopify/src/types/page.ts index 2bccfade2..ccbc29f7b 100644 --- a/framework/shopify/types/page.ts +++ b/packages/shopify/src/types/page.ts @@ -1,5 +1,5 @@ -import * as Core from '@commerce/types/page' -export * from '@commerce/types/page' +import * as Core from '@vercel/commerce/types/page' +export * from '@vercel/commerce/types/page' export type Page = Core.Page diff --git a/packages/shopify/src/types/product.ts b/packages/shopify/src/types/product.ts new file mode 100644 index 000000000..72ca02f02 --- /dev/null +++ b/packages/shopify/src/types/product.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/product' diff --git a/packages/shopify/src/types/signup.ts b/packages/shopify/src/types/signup.ts new file mode 100644 index 000000000..3f0d1af5a --- /dev/null +++ b/packages/shopify/src/types/signup.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/signup' diff --git a/packages/shopify/src/types/site.ts b/packages/shopify/src/types/site.ts new file mode 100644 index 000000000..96a2e476e --- /dev/null +++ b/packages/shopify/src/types/site.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/site' diff --git a/packages/shopify/src/types/wishlist.ts b/packages/shopify/src/types/wishlist.ts new file mode 100644 index 000000000..af92d9f63 --- /dev/null +++ b/packages/shopify/src/types/wishlist.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/wishlist' diff --git a/packages/shopify/src/utils/checkout-create.ts b/packages/shopify/src/utils/checkout-create.ts new file mode 100644 index 000000000..2f681c95d --- /dev/null +++ b/packages/shopify/src/utils/checkout-create.ts @@ -0,0 +1,45 @@ +import Cookies from 'js-cookie' + +import { + SHOPIFY_CHECKOUT_ID_COOKIE, + SHOPIFY_CHECKOUT_URL_COOKIE, + SHOPIFY_COOKIE_EXPIRE, +} from '../const' + +import checkoutCreateMutation from './mutations/checkout-create' +import { + CheckoutCreatePayload, + CheckoutLineItemInput, + Mutation, + MutationCheckoutCreateArgs, +} from '../../schema' +import { FetcherOptions } from '@vercel/commerce/utils/types' + +export const checkoutCreate = async ( + fetch: (options: FetcherOptions) => Promise, + lineItems: CheckoutLineItemInput[] +): Promise => { + const { checkoutCreate } = await fetch({ + query: checkoutCreateMutation, + variables: { + input: { lineItems }, + }, + }) + + const checkout = checkoutCreate?.checkout + + if (checkout) { + const checkoutId = checkout?.id + const options = { + expires: SHOPIFY_COOKIE_EXPIRE, + } + Cookies.set(SHOPIFY_CHECKOUT_ID_COOKIE, checkoutId, options) + if (checkout?.webUrl) { + Cookies.set(SHOPIFY_CHECKOUT_URL_COOKIE, checkout.webUrl, options) + } + } + + return checkoutCreate! +} + +export default checkoutCreate diff --git a/framework/shopify/utils/checkout-to-cart.ts b/packages/shopify/src/utils/checkout-to-cart.ts similarity index 83% rename from framework/shopify/utils/checkout-to-cart.ts rename to packages/shopify/src/utils/checkout-to-cart.ts index e2531cc78..97b3f0a21 100644 --- a/framework/shopify/utils/checkout-to-cart.ts +++ b/packages/shopify/src/utils/checkout-to-cart.ts @@ -1,5 +1,5 @@ import type { Cart } from '../types/cart' -import { CommerceError } from '@commerce/utils/errors' +import { CommerceError } from '@vercel/commerce/utils/errors' import { CheckoutLineItemsAddPayload, @@ -9,7 +9,7 @@ import { CheckoutUserError, Checkout, Maybe, -} from '../schema' +} from '../../schema' import { normalizeCart } from './normalize' import throwUserErrors from './throw-user-errors' @@ -27,16 +27,15 @@ export type CheckoutPayload = | CheckoutQuery const checkoutToCart = (checkoutPayload?: Maybe): Cart => { - const checkout = checkoutPayload?.checkout throwUserErrors(checkoutPayload?.checkoutUserErrors) - if (!checkout) { + if (!checkoutPayload?.checkout) { throw new CommerceError({ message: 'Missing checkout object from response', }) } - return normalizeCart(checkout) + return normalizeCart(checkoutPayload?.checkout) } export default checkoutToCart diff --git a/packages/shopify/src/utils/colors.ts b/packages/shopify/src/utils/colors.ts new file mode 100644 index 000000000..f9822c486 --- /dev/null +++ b/packages/shopify/src/utils/colors.ts @@ -0,0 +1,154 @@ +export const colorMap: Record = { + aliceblue: '#F0F8FF', + antiquewhite: '#FAEBD7', + aqua: '#00FFFF', + aquamarine: '#7FFFD4', + azure: '#F0FFFF', + beige: '#F5F5DC', + bisque: '#FFE4C4', + black: '#000000', + blanchedalmond: '#FFEBCD', + blue: '#0000FF', + blueviolet: '#8A2BE2', + brown: '#A52A2A', + burlywood: '#DEB887', + burgandy: '#800020', + burgundy: '#800020', + cadetblue: '#5F9EA0', + chartreuse: '#7FFF00', + chocolate: '#D2691E', + coral: '#FF7F50', + cornflowerblue: '#6495ED', + cornsilk: '#FFF8DC', + crimson: '#DC143C', + cyan: '#00FFFF', + darkblue: '#00008B', + darkcyan: '#008B8B', + darkgoldenrod: '#B8860B', + darkgray: '#A9A9A9', + darkgreen: '#006400', + darkgrey: '#A9A9A9', + darkkhaki: '#BDB76B', + darkmagenta: '#8B008B', + darkolivegreen: '#556B2F', + darkorange: '#FF8C00', + darkorchid: '#9932CC', + darkred: '#8B0000', + darksalmon: '#E9967A', + darkseagreen: '#8FBC8F', + darkslateblue: '#483D8B', + darkslategray: '#2F4F4F', + darkslategrey: '#2F4F4F', + darkturquoise: '#00CED1', + darkviolet: '#9400D3', + deeppink: '#FF1493', + deepskyblue: '#00BFFF', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1E90FF', + firebrick: '#B22222', + floralwhite: '#FFFAF0', + forestgreen: '#228B22', + fuchsia: '#FF00FF', + gainsboro: '#DCDCDC', + ghostwhite: '#F8F8FF', + gold: '#FFD700', + goldenrod: '#DAA520', + gray: '#808080', + green: '#008000', + greenyellow: '#ADFF2F', + grey: '#808080', + honeydew: '#F0FFF0', + hotpink: '#FF69B4', + indianred: '#CD5C5C', + indigo: '#4B0082', + ivory: '#FFFFF0', + khaki: '#F0E68C', + lavender: '#E6E6FA', + lavenderblush: '#FFF0F5', + lawngreen: '#7CFC00', + lemonchiffon: '#FFFACD', + lightblue: '#ADD8E6', + lightcoral: '#F08080', + lightcyan: '#E0FFFF', + lightgoldenrodyellow: '#FAFAD2', + lightgray: '#D3D3D3', + lightgreen: '#90EE90', + lightgrey: '#D3D3D3', + lightpink: '#FFB6C1', + lightsalmon: '#FFA07A', + lightseagreen: '#20B2AA', + lightskyblue: '#87CEFA', + lightslategray: '#778899', + lightslategrey: '#778899', + lightsteelblue: '#B0C4DE', + lightyellow: '#FFFFE0', + lime: '#00FF00', + limegreen: '#32CD32', + linen: '#FAF0E6', + magenta: '#FF00FF', + maroon: '#800000', + mediumaquamarine: '#66CDAA', + mediumblue: '#0000CD', + mediumorchid: '#BA55D3', + mediumpurple: '#9370DB', + mediumseagreen: '#3CB371', + mediumslateblue: '#7B68EE', + mediumspringgreen: '#00FA9A', + mediumturquoise: '#48D1CC', + mediumvioletred: '#C71585', + midnightblue: '#191970', + mintcream: '#F5FFFA', + mistyrose: '#FFE4E1', + moccasin: '#FFE4B5', + navajowhite: '#FFDEAD', + navy: '#000080', + oldlace: '#FDF5E6', + olive: '#808000', + olivedrab: '#6B8E23', + orange: '#FFA500', + orangered: '#FF4500', + orchid: '#DA70D6', + palegoldenrod: '#EEE8AA', + palegreen: '#98FB98', + paleturquoise: '#AFEEEE', + palevioletred: '#DB7093', + papayawhip: '#FFEFD5', + peachpuff: '#FFDAB9', + peru: '#CD853F', + pink: '#FFC0CB', + plum: '#DDA0DD', + powderblue: '#B0E0E6', + purple: '#800080', + rebeccapurple: '#663399', + red: '#FF0000', + rosybrown: '#BC8F8F', + royalblue: '#4169E1', + saddlebrown: '#8B4513', + salmon: '#FA8072', + sandybrown: '#F4A460', + seagreen: '#2E8B57', + seashell: '#FFF5EE', + sienna: '#A0522D', + silver: '#C0C0C0', + skyblue: '#87CEEB', + slateblue: '#6A5ACD', + slategray: '#708090', + slategrey: '#708090', + spacegrey: '#65737e', + spacegray: '#65737e', + snow: '#FFFAFA', + springgreen: '#00FF7F', + steelblue: '#4682B4', + tan: '#D2B48C', + teal: '#008080', + thistle: '#D8BFD8', + tomato: '#FF6347', + turquoise: '#40E0D0', + violet: '#EE82EE', + wheat: '#F5DEB3', + white: '#FFFFFF', + whitesmoke: '#F5F5F5', + yellow: '#FFFF00', + yellowgreen: '#9ACD32', +} diff --git a/framework/shopify/utils/customer-token.ts b/packages/shopify/src/utils/customer-token.ts similarity index 100% rename from framework/shopify/utils/customer-token.ts rename to packages/shopify/src/utils/customer-token.ts diff --git a/framework/shopify/utils/get-brands.ts b/packages/shopify/src/utils/get-brands.ts similarity index 97% rename from framework/shopify/utils/get-brands.ts rename to packages/shopify/src/utils/get-brands.ts index 3065e4ae8..eb87b519d 100644 --- a/framework/shopify/utils/get-brands.ts +++ b/packages/shopify/src/utils/get-brands.ts @@ -1,7 +1,7 @@ import { GetAllProductVendorsQuery, GetAllProductVendorsQueryVariables, -} from '../schema' +} from '../../schema' import { ShopifyConfig } from '../api' import getAllProductVendors from './queries/get-all-product-vendors-query' diff --git a/framework/shopify/utils/get-categories.ts b/packages/shopify/src/utils/get-categories.ts similarity index 93% rename from framework/shopify/utils/get-categories.ts rename to packages/shopify/src/utils/get-categories.ts index 543ee2fa1..e5ca16dad 100644 --- a/framework/shopify/utils/get-categories.ts +++ b/packages/shopify/src/utils/get-categories.ts @@ -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' diff --git a/framework/shopify/utils/get-checkout-id.ts b/packages/shopify/src/utils/get-checkout-id.ts similarity index 100% rename from framework/shopify/utils/get-checkout-id.ts rename to packages/shopify/src/utils/get-checkout-id.ts diff --git a/framework/shopify/utils/get-search-variables.ts b/packages/shopify/src/utils/get-search-variables.ts similarity index 100% rename from framework/shopify/utils/get-search-variables.ts rename to packages/shopify/src/utils/get-search-variables.ts diff --git a/framework/shopify/utils/get-sort-variables.ts b/packages/shopify/src/utils/get-sort-variables.ts similarity index 100% rename from framework/shopify/utils/get-sort-variables.ts rename to packages/shopify/src/utils/get-sort-variables.ts diff --git a/framework/shopify/utils/handle-account-activation.ts b/packages/shopify/src/utils/handle-account-activation.ts similarity index 84% rename from framework/shopify/utils/handle-account-activation.ts rename to packages/shopify/src/utils/handle-account-activation.ts index d11f80ba1..2519590c0 100644 --- a/framework/shopify/utils/handle-account-activation.ts +++ b/packages/shopify/src/utils/handle-account-activation.ts @@ -1,11 +1,11 @@ -import { FetcherOptions } from '@commerce/utils/types' +import { FetcherOptions } from '@vercel/commerce/utils/types' 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 ( diff --git a/framework/shopify/utils/handle-fetch-response.ts b/packages/shopify/src/utils/handle-fetch-response.ts similarity index 90% rename from framework/shopify/utils/handle-fetch-response.ts rename to packages/shopify/src/utils/handle-fetch-response.ts index 91d362d7d..927ab54f1 100644 --- a/framework/shopify/utils/handle-fetch-response.ts +++ b/packages/shopify/src/utils/handle-fetch-response.ts @@ -1,4 +1,4 @@ -import { FetcherError } from '@commerce/utils/errors' +import { FetcherError } from '@vercel/commerce/utils/errors' export function getError(errors: any[] | null, status: number) { errors = errors ?? [{ message: 'Failed to fetch Shopify API' }] diff --git a/framework/shopify/utils/handle-login.ts b/packages/shopify/src/utils/handle-login.ts similarity index 87% rename from framework/shopify/utils/handle-login.ts rename to packages/shopify/src/utils/handle-login.ts index de86fa1d2..dda6f6ebe 100644 --- a/framework/shopify/utils/handle-login.ts +++ b/packages/shopify/src/utils/handle-login.ts @@ -1,5 +1,5 @@ -import { FetcherOptions } from '@commerce/utils/types' -import { CustomerAccessTokenCreateInput } from '../schema' +import { FetcherOptions } from '@vercel/commerce/utils/types' +import { CustomerAccessTokenCreateInput } from '../../schema' import { setCustomerToken } from './customer-token' import { customerAccessTokenCreateMutation } from './mutations' import throwUserErrors from './throw-user-errors' diff --git a/framework/shopify/utils/index.ts b/packages/shopify/src/utils/index.ts similarity index 100% rename from framework/shopify/utils/index.ts rename to packages/shopify/src/utils/index.ts diff --git a/framework/shopify/utils/mutations/associate-customer-with-checkout.ts b/packages/shopify/src/utils/mutations/associate-customer-with-checkout.ts similarity index 100% rename from framework/shopify/utils/mutations/associate-customer-with-checkout.ts rename to packages/shopify/src/utils/mutations/associate-customer-with-checkout.ts diff --git a/framework/shopify/utils/mutations/checkout-create.ts b/packages/shopify/src/utils/mutations/checkout-create.ts similarity index 100% rename from framework/shopify/utils/mutations/checkout-create.ts rename to packages/shopify/src/utils/mutations/checkout-create.ts diff --git a/framework/shopify/utils/mutations/checkout-line-item-add.ts b/packages/shopify/src/utils/mutations/checkout-line-item-add.ts similarity index 100% rename from framework/shopify/utils/mutations/checkout-line-item-add.ts rename to packages/shopify/src/utils/mutations/checkout-line-item-add.ts diff --git a/framework/shopify/utils/mutations/checkout-line-item-remove.ts b/packages/shopify/src/utils/mutations/checkout-line-item-remove.ts similarity index 100% rename from framework/shopify/utils/mutations/checkout-line-item-remove.ts rename to packages/shopify/src/utils/mutations/checkout-line-item-remove.ts diff --git a/framework/shopify/utils/mutations/checkout-line-item-update.ts b/packages/shopify/src/utils/mutations/checkout-line-item-update.ts similarity index 100% rename from framework/shopify/utils/mutations/checkout-line-item-update.ts rename to packages/shopify/src/utils/mutations/checkout-line-item-update.ts diff --git a/framework/shopify/utils/mutations/customer-access-token-create.ts b/packages/shopify/src/utils/mutations/customer-access-token-create.ts similarity index 100% rename from framework/shopify/utils/mutations/customer-access-token-create.ts rename to packages/shopify/src/utils/mutations/customer-access-token-create.ts diff --git a/framework/shopify/utils/mutations/customer-access-token-delete.ts b/packages/shopify/src/utils/mutations/customer-access-token-delete.ts similarity index 100% rename from framework/shopify/utils/mutations/customer-access-token-delete.ts rename to packages/shopify/src/utils/mutations/customer-access-token-delete.ts diff --git a/framework/shopify/utils/mutations/customer-activate-by-url.ts b/packages/shopify/src/utils/mutations/customer-activate-by-url.ts similarity index 100% rename from framework/shopify/utils/mutations/customer-activate-by-url.ts rename to packages/shopify/src/utils/mutations/customer-activate-by-url.ts diff --git a/framework/shopify/utils/mutations/customer-activate.ts b/packages/shopify/src/utils/mutations/customer-activate.ts similarity index 100% rename from framework/shopify/utils/mutations/customer-activate.ts rename to packages/shopify/src/utils/mutations/customer-activate.ts diff --git a/framework/shopify/utils/mutations/customer-create.ts b/packages/shopify/src/utils/mutations/customer-create.ts similarity index 100% rename from framework/shopify/utils/mutations/customer-create.ts rename to packages/shopify/src/utils/mutations/customer-create.ts diff --git a/framework/shopify/utils/mutations/index.ts b/packages/shopify/src/utils/mutations/index.ts similarity index 100% rename from framework/shopify/utils/mutations/index.ts rename to packages/shopify/src/utils/mutations/index.ts diff --git a/framework/shopify/utils/normalize.ts b/packages/shopify/src/utils/normalize.ts similarity index 98% rename from framework/shopify/utils/normalize.ts rename to packages/shopify/src/utils/normalize.ts index 96262f418..2782f59dd 100644 --- a/framework/shopify/utils/normalize.ts +++ b/packages/shopify/src/utils/normalize.ts @@ -15,8 +15,8 @@ import { Page as ShopifyPage, PageEdge, Collection, -} from '../schema' -import { colorMap } from '@lib/colors' +} from '../../schema' +import { colorMap } from './colors' const money = ({ amount, currencyCode }: MoneyV2) => { return { diff --git a/framework/shopify/utils/queries/get-all-collections-query.ts b/packages/shopify/src/utils/queries/get-all-collections-query.ts similarity index 100% rename from framework/shopify/utils/queries/get-all-collections-query.ts rename to packages/shopify/src/utils/queries/get-all-collections-query.ts diff --git a/framework/shopify/utils/queries/get-all-pages-query.ts b/packages/shopify/src/utils/queries/get-all-pages-query.ts similarity index 100% rename from framework/shopify/utils/queries/get-all-pages-query.ts rename to packages/shopify/src/utils/queries/get-all-pages-query.ts diff --git a/framework/shopify/utils/queries/get-all-product-vendors-query.ts b/packages/shopify/src/utils/queries/get-all-product-vendors-query.ts similarity index 100% rename from framework/shopify/utils/queries/get-all-product-vendors-query.ts rename to packages/shopify/src/utils/queries/get-all-product-vendors-query.ts diff --git a/framework/shopify/utils/queries/get-all-products-paths-query.ts b/packages/shopify/src/utils/queries/get-all-products-paths-query.ts similarity index 100% rename from framework/shopify/utils/queries/get-all-products-paths-query.ts rename to packages/shopify/src/utils/queries/get-all-products-paths-query.ts diff --git a/framework/shopify/utils/queries/get-all-products-query.ts b/packages/shopify/src/utils/queries/get-all-products-query.ts similarity index 100% rename from framework/shopify/utils/queries/get-all-products-query.ts rename to packages/shopify/src/utils/queries/get-all-products-query.ts diff --git a/framework/shopify/utils/queries/get-checkout-query.ts b/packages/shopify/src/utils/queries/get-checkout-query.ts similarity index 100% rename from framework/shopify/utils/queries/get-checkout-query.ts rename to packages/shopify/src/utils/queries/get-checkout-query.ts diff --git a/framework/shopify/utils/queries/get-collection-products-query.ts b/packages/shopify/src/utils/queries/get-collection-products-query.ts similarity index 100% rename from framework/shopify/utils/queries/get-collection-products-query.ts rename to packages/shopify/src/utils/queries/get-collection-products-query.ts diff --git a/framework/shopify/utils/queries/get-customer-id-query.ts b/packages/shopify/src/utils/queries/get-customer-id-query.ts similarity index 100% rename from framework/shopify/utils/queries/get-customer-id-query.ts rename to packages/shopify/src/utils/queries/get-customer-id-query.ts diff --git a/framework/shopify/utils/queries/get-customer-query.ts b/packages/shopify/src/utils/queries/get-customer-query.ts similarity index 100% rename from framework/shopify/utils/queries/get-customer-query.ts rename to packages/shopify/src/utils/queries/get-customer-query.ts diff --git a/framework/shopify/utils/queries/get-page-query.ts b/packages/shopify/src/utils/queries/get-page-query.ts similarity index 100% rename from framework/shopify/utils/queries/get-page-query.ts rename to packages/shopify/src/utils/queries/get-page-query.ts diff --git a/framework/shopify/utils/queries/get-product-query.ts b/packages/shopify/src/utils/queries/get-product-query.ts similarity index 100% rename from framework/shopify/utils/queries/get-product-query.ts rename to packages/shopify/src/utils/queries/get-product-query.ts diff --git a/framework/shopify/utils/queries/get-site-info-query.ts b/packages/shopify/src/utils/queries/get-site-info-query.ts similarity index 100% rename from framework/shopify/utils/queries/get-site-info-query.ts rename to packages/shopify/src/utils/queries/get-site-info-query.ts diff --git a/framework/shopify/utils/queries/index.ts b/packages/shopify/src/utils/queries/index.ts similarity index 100% rename from framework/shopify/utils/queries/index.ts rename to packages/shopify/src/utils/queries/index.ts diff --git a/framework/shopify/utils/throw-user-errors.ts b/packages/shopify/src/utils/throw-user-errors.ts similarity index 90% rename from framework/shopify/utils/throw-user-errors.ts rename to packages/shopify/src/utils/throw-user-errors.ts index 5488ba282..2173b2b40 100644 --- a/framework/shopify/utils/throw-user-errors.ts +++ b/packages/shopify/src/utils/throw-user-errors.ts @@ -1,11 +1,11 @@ -import { ValidationError } from '@commerce/utils/errors' +import { ValidationError } from '@vercel/commerce/utils/errors' import { CheckoutErrorCode, CheckoutUserError, CustomerErrorCode, CustomerUserError, -} from '../schema' +} from '../../schema' export type UserErrors = Array diff --git a/framework/vendure/wishlist/use-add-item.tsx b/packages/shopify/src/wishlist/use-add-item.tsx similarity index 100% rename from framework/vendure/wishlist/use-add-item.tsx rename to packages/shopify/src/wishlist/use-add-item.tsx diff --git a/framework/vendure/wishlist/use-remove-item.tsx b/packages/shopify/src/wishlist/use-remove-item.tsx similarity index 100% rename from framework/vendure/wishlist/use-remove-item.tsx rename to packages/shopify/src/wishlist/use-remove-item.tsx diff --git a/framework/shopify/wishlist/use-wishlist.tsx b/packages/shopify/src/wishlist/use-wishlist.tsx similarity index 90% rename from framework/shopify/wishlist/use-wishlist.tsx rename to packages/shopify/src/wishlist/use-wishlist.tsx index d2ce9db5b..c95195040 100644 --- a/framework/shopify/wishlist/use-wishlist.tsx +++ b/packages/shopify/src/wishlist/use-wishlist.tsx @@ -1,8 +1,8 @@ // TODO: replace this hook and other wishlist hooks with a handler, or remove them if // Shopify doesn't have a wishlist -import { HookFetcher } from '@commerce/utils/types' -import { Product } from '../schema' +import { HookFetcher } from '@vercel/commerce/utils/types' +import { Product } from '../../schema' const defaultOpts = {} diff --git a/packages/shopify/taskfile.js b/packages/shopify/taskfile.js new file mode 100644 index 000000000..39b1b2a86 --- /dev/null +++ b/packages/shopify/taskfile.js @@ -0,0 +1,20 @@ +export async function build(task, opts) { + await task + .source('src/**/*.+(ts|tsx|js)') + .swc({ dev: opts.dev, outDir: 'dist', baseUrl: 'src' }) + .target('dist') + .source('src/**/*.+(cjs|json)') + .target('dist') + task.$.log('Compiled src files') +} + +export async function release(task) { + await task.clear('dist').start('build') +} + +export default async function dev(task) { + const opts = { dev: true } + await task.clear('dist') + await task.start('build', opts) + await task.watch('src/**/*.+(ts|tsx|js|cjs|json)', 'build', opts) +} diff --git a/packages/shopify/tsconfig.json b/packages/shopify/tsconfig.json new file mode 100644 index 000000000..cd04ab2ff --- /dev/null +++ b/packages/shopify/tsconfig.json @@ -0,0 +1,21 @@ +{ + "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, + "incremental": true, + "jsx": "react-jsx" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/spree/.env.template b/packages/spree/.env.template new file mode 100644 index 000000000..8f4dbf5dd --- /dev/null +++ b/packages/spree/.env.template @@ -0,0 +1,25 @@ +# Template to be used for creating .env* files (.env, .env.local etc.) in the project's root directory. + +COMMERCE_PROVIDER=spree + +{# - NEXT_PUBLIC_* are exposed to the web browser and the server #} +NEXT_PUBLIC_SPREE_API_HOST=http://localhost:4000 +NEXT_PUBLIC_SPREE_DEFAULT_LOCALE=en-us +NEXT_PUBLIC_SPREE_CART_COOKIE_NAME=spree_cart_token +{# -- cookie expire in days #} +NEXT_PUBLIC_SPREE_CART_COOKIE_EXPIRE=7 +NEXT_PUBLIC_SPREE_USER_COOKIE_NAME=spree_user_token +NEXT_PUBLIC_SPREE_USER_COOKIE_EXPIRE=7 +NEXT_PUBLIC_SPREE_IMAGE_HOST=http://localhost:4000 +NEXT_PUBLIC_SPREE_ALLOWED_IMAGE_DOMAIN=localhost +NEXT_PUBLIC_SPREE_CATEGORIES_TAXONOMY_PERMALINK=categories +NEXT_PUBLIC_SPREE_BRANDS_TAXONOMY_PERMALINK=brands +NEXT_PUBLIC_SPREE_ALL_PRODUCTS_TAXONOMY_ID=false +NEXT_PUBLIC_SPREE_SHOW_SINGLE_VARIANT_OPTIONS=false +NEXT_PUBLIC_SPREE_LAST_UPDATED_PRODUCTS_PRERENDER_COUNT=10 +NEXT_PUBLIC_SPREE_PRODUCT_PLACEHOLDER_IMAGE_URL=/product-img-placeholder.svg +NEXT_PUBLIC_SPREE_LINE_ITEM_PLACEHOLDER_IMAGE_URL=/product-img-placeholder.svg +NEXT_PUBLIC_SPREE_IMAGES_OPTION_FILTER=false +NEXT_PUBLIC_SPREE_IMAGES_SIZE=1000x1000 +NEXT_PUBLIC_SPREE_IMAGES_QUALITY=100 +NEXT_PUBLIC_SPREE_LOGIN_AFTER_SIGNUP=true diff --git a/packages/spree/.prettierignore b/packages/spree/.prettierignore new file mode 100644 index 000000000..f06235c46 --- /dev/null +++ b/packages/spree/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/spree/.prettierrc b/packages/spree/.prettierrc new file mode 100644 index 000000000..e1076edfa --- /dev/null +++ b/packages/spree/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/spree/README-assets/screenshots.png b/packages/spree/README-assets/screenshots.png new file mode 100644 index 000000000..93c133e06 Binary files /dev/null and b/packages/spree/README-assets/screenshots.png differ diff --git a/packages/spree/README.md b/packages/spree/README.md new file mode 100644 index 000000000..0b172cb19 --- /dev/null +++ b/packages/spree/README.md @@ -0,0 +1,33 @@ +# [Spree Commerce][1] Provider + +![Screenshots of Spree Commerce and NextJS Commerce][5] + +An integration of [Spree Commerce](https://spreecommerce.org/) within NextJS Commerce. It supports browsing and searching Spree products and adding products to the cart. + +**Demo**: [https://spree.vercel.store/][6] + +## Installation + +1. Setup Spree - [follow the Getting Started guide](https://dev-docs.spreecommerce.org/getting-started/installation). + +1. Setup Nextjs Commerce - [instructions for setting up NextJS Commerce][2]. + +1. Copy the `.env.template` file in this directory (`/packages/spree`) to `.env.local` in the main directory + + ```bash + cp packages/spree/.env.template .env.local + ``` + +1. Set `NEXT_PUBLIC_SPREE_CATEGORIES_TAXONOMY_PERMALINK` and `NEXT_PUBLIC_SPREE_BRANDS_TAXONOMY_PERMALINK` environment variables: + + - They rely on [taxonomies'](https://dev-docs.spreecommerce.org/internals/products#taxons-and-taxonomies) permalinks in Spree. + - Go to the Spree admin panel and create `Categories` and `Brands` taxonomies if they don't exist and copy their permalinks into `.env.local` in NextJS Commerce. + +1. Finally, run `npm run dev` :tada: + +[1]: https://spreecommerce.org/ +[2]: https://github.com/vercel/commerce +[3]: https://github.com/spree/spree_starter +[4]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS +[5]: ./README-assets/screenshots.png +[6]: https://spree.vercel.store/ diff --git a/packages/spree/package.json b/packages/spree/package.json new file mode 100644 index 000000000..d441f8b6e --- /dev/null +++ b/packages/spree/package.json @@ -0,0 +1,81 @@ +{ + "name": "@vercel/commerce-spree", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "release": "taskr release", + "build": "taskr build", + "dev": "taskr", + "types": "tsc --emitDeclarationOnly", + "prettier-fix": "prettier --write ." + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], + "./next.config": "./dist/next.config.cjs" + }, + "typesVersions": { + "*": { + "*": [ + "src/*", + "src/*/index" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + }, + "files": [ + "dist" + ], + "publishConfig": { + "typesVersions": { + "*": { + "*": [ + "dist/*.d.ts", + "dist/*/index.d.ts" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + } + }, + "dependencies": { + "@spree/storefront-api-v2-sdk": "^5.1.1", + "@vercel/commerce": "^0.0.1", + "@vercel/fetch": "^6.1.1", + "swr": "^1.2.0" + }, + "peerDependencies": { + "next": "^12", + "react": "^17", + "react-dom": "^17" + }, + "devDependencies": { + "@taskr/clear": "^1.1.0", + "@taskr/esnext": "^1.1.0", + "@taskr/watch": "^1.1.0", + "@types/node": "^17.0.8", + "@types/react": "^17.0.38", + "lint-staged": "^12.1.7", + "next": "^12.0.8", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "taskr": "^1.1.0", + "taskr-swc": "^0.0.1", + "typescript": "^4.5.4" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,json}": [ + "prettier --write", + "git add" + ] + } +} diff --git a/packages/spree/src/api/endpoints/cart/index.ts b/packages/spree/src/api/endpoints/cart/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/spree/src/api/endpoints/cart/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/spree/src/api/endpoints/catalog/index.ts b/packages/spree/src/api/endpoints/catalog/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/spree/src/api/endpoints/catalog/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/spree/src/api/endpoints/catalog/products.ts b/packages/spree/src/api/endpoints/catalog/products.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/spree/src/api/endpoints/catalog/products.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/spree/src/api/endpoints/checkout/get-checkout.ts b/packages/spree/src/api/endpoints/checkout/get-checkout.ts new file mode 100644 index 000000000..985239678 --- /dev/null +++ b/packages/spree/src/api/endpoints/checkout/get-checkout.ts @@ -0,0 +1,44 @@ +import type { CheckoutEndpoint } from '.' + +const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ + req: _request, + res: response, + config: _config, +}) => { + try { + const html = ` + + + + + + Checkout + + +
+ + + +

Checkout not yet implemented :(

+

+ See #64 +

+
+ + + ` + + response.status(200) + response.setHeader('Content-Type', 'text/html') + response.write(html) + response.end() + } catch (error) { + console.error(error) + + const message = 'An unexpected error ocurred' + + response.status(500).json({ data: null, errors: [{ message }] }) + } +} + +export default getCheckout diff --git a/packages/spree/src/api/endpoints/checkout/index.ts b/packages/spree/src/api/endpoints/checkout/index.ts new file mode 100644 index 000000000..2be2a5ded --- /dev/null +++ b/packages/spree/src/api/endpoints/checkout/index.ts @@ -0,0 +1,22 @@ +import { createEndpoint } from '@vercel/commerce/api' +import type { GetAPISchema, CommerceAPI } from '@vercel/commerce/api' +import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout' +import type { CheckoutSchema } from '@vercel/commerce/types/checkout' +import getCheckout from './get-checkout' +import type { SpreeApiProvider } from '../..' + +export type CheckoutAPI = GetAPISchema< + CommerceAPI, + CheckoutSchema +> + +export type CheckoutEndpoint = CheckoutAPI['endpoint'] + +export const handlers: CheckoutEndpoint['handlers'] = { getCheckout } + +const checkoutApi = createEndpoint({ + handler: checkoutEndpoint, + handlers, +}) + +export default checkoutApi diff --git a/packages/spree/src/api/endpoints/customer/address.ts b/packages/spree/src/api/endpoints/customer/address.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/spree/src/api/endpoints/customer/address.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/spree/src/api/endpoints/customer/card.ts b/packages/spree/src/api/endpoints/customer/card.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/spree/src/api/endpoints/customer/card.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/spree/src/api/endpoints/customer/index.ts b/packages/spree/src/api/endpoints/customer/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/spree/src/api/endpoints/customer/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/spree/src/api/endpoints/login/index.ts b/packages/spree/src/api/endpoints/login/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/spree/src/api/endpoints/login/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/spree/src/api/endpoints/logout/index.ts b/packages/spree/src/api/endpoints/logout/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/spree/src/api/endpoints/logout/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/spree/src/api/endpoints/signup/index.ts b/packages/spree/src/api/endpoints/signup/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/spree/src/api/endpoints/signup/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/spree/src/api/endpoints/wishlist/index.tsx b/packages/spree/src/api/endpoints/wishlist/index.tsx new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/spree/src/api/endpoints/wishlist/index.tsx @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/spree/src/api/index.ts b/packages/spree/src/api/index.ts new file mode 100644 index 000000000..3971ed540 --- /dev/null +++ b/packages/spree/src/api/index.ts @@ -0,0 +1,45 @@ +import type { CommerceAPI, CommerceAPIConfig } from '@vercel/commerce/api' +import { getCommerceApi as commerceApi } from '@vercel/commerce/api' +import createApiFetch from './utils/create-api-fetch' + +import getAllPages from './operations/get-all-pages' +import getPage from './operations/get-page' +import getSiteInfo from './operations/get-site-info' +import getCustomerWishlist from './operations/get-customer-wishlist' +import getAllProductPaths from './operations/get-all-product-paths' +import getAllProducts from './operations/get-all-products' +import getProduct from './operations/get-product' + +export interface SpreeApiConfig extends CommerceAPIConfig {} + +const config: SpreeApiConfig = { + commerceUrl: '', + apiToken: '', + cartCookie: '', + customerCookie: '', + cartCookieMaxAge: 2592000, + fetch: createApiFetch(() => getCommerceApi().getConfig()), +} + +const operations = { + getAllPages, + getPage, + getSiteInfo, + getCustomerWishlist, + getAllProductPaths, + getAllProducts, + getProduct, +} + +export const provider = { config, operations } + +export type SpreeApiProvider = typeof provider + +export type SpreeApi

= + CommerceAPI

+ +export function getCommerceApi

( + customProvider: P = provider as any +): SpreeApi

{ + return commerceApi(customProvider) +} diff --git a/packages/spree/src/api/operations/get-all-pages.ts b/packages/spree/src/api/operations/get-all-pages.ts new file mode 100644 index 000000000..b5fae62b1 --- /dev/null +++ b/packages/spree/src/api/operations/get-all-pages.ts @@ -0,0 +1,82 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { GetAllPagesOperation, Page } from '@vercel/commerce/types/page' +import { requireConfigValue } from '../../isomorphic-config' +import normalizePage from '../../utils/normalizations/normalize-page' +import type { IPages } from '@spree/storefront-api-v2-sdk/types/interfaces/Page' +import type { SpreeSdkVariables } from '../../types' +import type { SpreeApiConfig, SpreeApiProvider } from '../index' + +export default function getAllPagesOperation({ + commerce, +}: OperationContext) { + async function getAllPages(options?: { + config?: Partial + preview?: boolean + }): Promise + + async function getAllPages( + opts: { + config?: Partial + preview?: boolean + } & OperationOptions + ): Promise + + async function getAllPages({ + config: userConfig, + preview, + query, + url, + }: { + url?: string + config?: Partial + preview?: boolean + query?: string + } = {}): Promise { + console.info( + 'getAllPages called. Configuration: ', + 'query: ', + query, + 'userConfig: ', + userConfig, + 'preview: ', + preview, + 'url: ', + url + ) + + const config = commerce.getConfig(userConfig) + const { fetch: apiFetch } = config + + const variables: SpreeSdkVariables = { + methodPath: 'pages.list', + arguments: [ + { + per_page: 500, + filter: { + locale_eq: + config.locale || (requireConfigValue('defaultLocale') as string), + }, + }, + ], + } + + const { data: spreeSuccessResponse } = await apiFetch< + IPages, + SpreeSdkVariables + >('__UNUSED__', { + variables, + }) + + const normalizedPages: Page[] = spreeSuccessResponse.data.map( + (spreePage) => + normalizePage(spreeSuccessResponse, spreePage, config.locales || []) + ) + + return { pages: normalizedPages } + } + + return getAllPages +} diff --git a/packages/spree/src/api/operations/get-all-product-paths.ts b/packages/spree/src/api/operations/get-all-product-paths.ts new file mode 100644 index 000000000..424f46c4c --- /dev/null +++ b/packages/spree/src/api/operations/get-all-product-paths.ts @@ -0,0 +1,97 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { Product } from '@vercel/commerce/types/product' +import type { GetAllProductPathsOperation } from '@vercel/commerce/types/product' +import { requireConfigValue } from '../../isomorphic-config' +import type { IProductsSlugs, SpreeSdkVariables } from '../../types' +import getProductPath from '../../utils/get-product-path' +import type { SpreeApiConfig, SpreeApiProvider } from '..' + +const imagesSize = requireConfigValue('imagesSize') as string +const imagesQuality = requireConfigValue('imagesQuality') as number + +export default function getAllProductPathsOperation({ + commerce, +}: OperationContext) { + async function getAllProductPaths< + T extends GetAllProductPathsOperation + >(opts?: { + variables?: T['variables'] + config?: Partial + }): Promise + + async function getAllProductPaths( + opts: { + variables?: T['variables'] + config?: Partial + } & OperationOptions + ): Promise + + async function getAllProductPaths({ + query, + variables: getAllProductPathsVariables = {}, + config: userConfig, + }: { + query?: string + variables?: T['variables'] + config?: Partial + } = {}): Promise { + console.info( + 'getAllProductPaths called. Configuration: ', + 'query: ', + query, + 'getAllProductPathsVariables: ', + getAllProductPathsVariables, + 'config: ', + userConfig + ) + + const productsCount = requireConfigValue( + 'lastUpdatedProductsPrerenderCount' + ) + + if (productsCount === 0) { + return { + products: [], + } + } + + const variables: SpreeSdkVariables = { + methodPath: 'products.list', + arguments: [ + {}, + { + fields: { + product: 'slug', + }, + per_page: productsCount, + image_transformation: { + quality: imagesQuality, + size: imagesSize, + }, + }, + ], + } + + const config = commerce.getConfig(userConfig) + const { fetch: apiFetch } = config // TODO: Send config.locale to Spree. + + const { data: spreeSuccessResponse } = await apiFetch< + IProductsSlugs, + SpreeSdkVariables + >('__UNUSED__', { + variables, + }) + + const normalizedProductsPaths: Pick[] = + spreeSuccessResponse.data.map((spreeProduct) => ({ + path: getProductPath(spreeProduct), + })) + + return { products: normalizedProductsPaths } + } + + return getAllProductPaths +} diff --git a/packages/spree/src/api/operations/get-all-products.ts b/packages/spree/src/api/operations/get-all-products.ts new file mode 100644 index 000000000..2b718d929 --- /dev/null +++ b/packages/spree/src/api/operations/get-all-products.ts @@ -0,0 +1,92 @@ +import type { Product } from '@vercel/commerce/types/product' +import type { GetAllProductsOperation } from '@vercel/commerce/types/product' +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { IProducts } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' +import type { SpreeApiConfig, SpreeApiProvider } from '../index' +import type { SpreeSdkVariables } from '../../types' +import normalizeProduct from '../../utils/normalizations/normalize-product' +import { requireConfigValue } from '../../isomorphic-config' + +const imagesSize = requireConfigValue('imagesSize') as string +const imagesQuality = requireConfigValue('imagesQuality') as number + +export default function getAllProductsOperation({ + commerce, +}: OperationContext) { + async function getAllProducts(opts?: { + variables?: T['variables'] + config?: Partial + preview?: boolean + }): Promise + + async function getAllProducts( + opts: { + variables?: T['variables'] + config?: Partial + preview?: boolean + } & OperationOptions + ): Promise + + async function getAllProducts({ + variables: getAllProductsVariables = {}, + config: userConfig, + }: { + variables?: T['variables'] + config?: Partial + } = {}): Promise<{ products: Product[] }> { + console.info( + 'getAllProducts called. Configuration: ', + 'getAllProductsVariables: ', + getAllProductsVariables, + 'config: ', + userConfig + ) + + const defaultProductsTaxonomyId = requireConfigValue( + 'allProductsTaxonomyId' + ) as string | false + + const first = getAllProductsVariables.first + const filter = !defaultProductsTaxonomyId + ? {} + : { filter: { taxons: defaultProductsTaxonomyId }, sort: '-updated_at' } + + const variables: SpreeSdkVariables = { + methodPath: 'products.list', + arguments: [ + {}, + { + include: + 'primary_variant,variants,images,option_types,variants.option_values', + per_page: first, + ...filter, + image_transformation: { + quality: imagesQuality, + size: imagesSize, + }, + }, + ], + } + + const config = commerce.getConfig(userConfig) + const { fetch: apiFetch } = config // TODO: Send config.locale to Spree. + + const { data: spreeSuccessResponse } = await apiFetch< + IProducts, + SpreeSdkVariables + >('__UNUSED__', { + variables, + }) + + const normalizedProducts: Product[] = spreeSuccessResponse.data.map( + (spreeProduct) => normalizeProduct(spreeSuccessResponse, spreeProduct) + ) + + return { products: normalizedProducts } + } + + return getAllProducts +} diff --git a/packages/spree/src/api/operations/get-customer-wishlist.ts b/packages/spree/src/api/operations/get-customer-wishlist.ts new file mode 100644 index 000000000..8c34b9e87 --- /dev/null +++ b/packages/spree/src/api/operations/get-customer-wishlist.ts @@ -0,0 +1,6 @@ +export default function getCustomerWishlistOperation() { + function getCustomerWishlist(): any { + return { wishlist: {} } + } + return getCustomerWishlist +} diff --git a/packages/spree/src/api/operations/get-page.ts b/packages/spree/src/api/operations/get-page.ts new file mode 100644 index 000000000..711870e72 --- /dev/null +++ b/packages/spree/src/api/operations/get-page.ts @@ -0,0 +1,81 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { GetPageOperation } from '@vercel/commerce/types/page' +import type { SpreeSdkVariables } from '../../types' +import type { SpreeApiConfig, SpreeApiProvider } from '..' +import type { IPage } from '@spree/storefront-api-v2-sdk/types/interfaces/Page' +import normalizePage from '../../utils/normalizations/normalize-page' + +export type Page = any +export type GetPageResult = { page?: Page } + +export type PageVariables = { + id: number +} + +export default function getPageOperation({ + commerce, +}: OperationContext) { + async function getPage(opts: { + variables: T['variables'] + config?: Partial + preview?: boolean + }): Promise + + async function getPage( + opts: { + variables: T['variables'] + config?: Partial + preview?: boolean + } & OperationOptions + ): Promise + + async function getPage({ + url, + config: userConfig, + preview, + variables: getPageVariables, + }: { + url?: string + variables: T['variables'] + config?: Partial + preview?: boolean + }): Promise { + console.info( + 'getPage called. Configuration: ', + 'userConfig: ', + userConfig, + 'preview: ', + preview, + 'url: ', + url + ) + + const config = commerce.getConfig(userConfig) + const { fetch: apiFetch } = config + + const variables: SpreeSdkVariables = { + methodPath: 'pages.show', + arguments: [getPageVariables.id], + } + + const { data: spreeSuccessResponse } = await apiFetch< + IPage, + SpreeSdkVariables + >('__UNUSED__', { + variables, + }) + + const normalizedPage: Page = normalizePage( + spreeSuccessResponse, + spreeSuccessResponse.data, + config.locales || [] + ) + + return { page: normalizedPage } + } + + return getPage +} diff --git a/packages/spree/src/api/operations/get-product.ts b/packages/spree/src/api/operations/get-product.ts new file mode 100644 index 000000000..bd93791de --- /dev/null +++ b/packages/spree/src/api/operations/get-product.ts @@ -0,0 +1,90 @@ +import type { SpreeApiConfig, SpreeApiProvider } from '../index' +import type { GetProductOperation } from '@vercel/commerce/types/product' +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { IProduct } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' +import type { SpreeSdkVariables } from '../../types' +import MissingSlugVariableError from '../../errors/MissingSlugVariableError' +import normalizeProduct from '../../utils/normalizations/normalize-product' +import { requireConfigValue } from '../../isomorphic-config' + +const imagesSize = requireConfigValue('imagesSize') as string +const imagesQuality = requireConfigValue('imagesQuality') as number + +export default function getProductOperation({ + commerce, +}: OperationContext) { + async function getProduct(opts: { + variables: T['variables'] + config?: Partial + preview?: boolean + }): Promise + + async function getProduct( + opts: { + variables: T['variables'] + config?: Partial + preview?: boolean + } & OperationOptions + ): Promise + + async function getProduct({ + query = '', + variables: getProductVariables, + config: userConfig, + }: { + query?: string + variables?: T['variables'] + config?: Partial + preview?: boolean + }): Promise { + console.log( + 'getProduct called. Configuration: ', + 'getProductVariables: ', + getProductVariables, + 'config: ', + userConfig + ) + + if (!getProductVariables?.slug) { + throw new MissingSlugVariableError() + } + + const variables: SpreeSdkVariables = { + methodPath: 'products.show', + arguments: [ + getProductVariables.slug, + {}, + { + include: + 'primary_variant,variants,images,option_types,variants.option_values', + image_transformation: { + quality: imagesQuality, + size: imagesSize, + }, + }, + ], + } + + const config = commerce.getConfig(userConfig) + const { fetch: apiFetch } = config // TODO: Send config.locale to Spree. + + const { data: spreeSuccessResponse } = await apiFetch< + IProduct, + SpreeSdkVariables + >('__UNUSED__', { + variables, + }) + + return { + product: normalizeProduct( + spreeSuccessResponse, + spreeSuccessResponse.data + ), + } + } + + return getProduct +} diff --git a/packages/spree/src/api/operations/get-site-info.ts b/packages/spree/src/api/operations/get-site-info.ts new file mode 100644 index 000000000..13b11e4a4 --- /dev/null +++ b/packages/spree/src/api/operations/get-site-info.ts @@ -0,0 +1,138 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { + Category, + GetSiteInfoOperation, +} from '@vercel/commerce/types/site' +import type { + ITaxons, + TaxonAttr, +} from '@spree/storefront-api-v2-sdk/types/interfaces/Taxon' +import { requireConfigValue } from '../../isomorphic-config' +import type { SpreeSdkVariables } from '../../types' +import type { SpreeApiConfig, SpreeApiProvider } from '..' + +const taxonsSort = (spreeTaxon1: TaxonAttr, spreeTaxon2: TaxonAttr): number => { + const { left: left1, right: right1 } = spreeTaxon1.attributes + const { left: left2, right: right2 } = spreeTaxon2.attributes + + if (right1 < left2) { + return -1 + } + + if (right2 < left1) { + return 1 + } + + return 0 +} + +export type GetSiteInfoResult< + T extends { categories: any[]; brands: any[] } = { + categories: Category[] + brands: any[] + } +> = T + +export default function getSiteInfoOperation({ + commerce, +}: OperationContext) { + async function getSiteInfo(opts?: { + config?: Partial + preview?: boolean + }): Promise + + async function getSiteInfo( + opts: { + config?: Partial + preview?: boolean + } & OperationOptions + ): Promise + + async function getSiteInfo({ + query, + variables: getSiteInfoVariables = {}, + config: userConfig, + }: { + query?: string + variables?: any + config?: Partial + preview?: boolean + } = {}): Promise { + console.info( + 'getSiteInfo called. Configuration: ', + 'query: ', + query, + 'getSiteInfoVariables ', + getSiteInfoVariables, + 'config: ', + userConfig + ) + + const createVariables = (parentPermalink: string): SpreeSdkVariables => ({ + methodPath: 'taxons.list', + arguments: [ + { + filter: { + parent_permalink: parentPermalink, + }, + }, + ], + }) + + const config = commerce.getConfig(userConfig) + const { fetch: apiFetch } = config // TODO: Send config.locale to Spree. + + const { data: spreeCategoriesSuccessResponse } = await apiFetch< + ITaxons, + SpreeSdkVariables + >('__UNUSED__', { + variables: createVariables( + requireConfigValue('categoriesTaxonomyPermalink') as string + ), + }) + + const { data: spreeBrandsSuccessResponse } = await apiFetch< + ITaxons, + SpreeSdkVariables + >('__UNUSED__', { + variables: createVariables( + requireConfigValue('brandsTaxonomyPermalink') as string + ), + }) + + const normalizedCategories: GetSiteInfoOperation['data']['categories'] = + spreeCategoriesSuccessResponse.data + .sort(taxonsSort) + .map((spreeTaxon: TaxonAttr) => { + return { + id: spreeTaxon.id, + name: spreeTaxon.attributes.name, + slug: spreeTaxon.id, + path: spreeTaxon.id, + } + }) + + const normalizedBrands: GetSiteInfoOperation['data']['brands'] = + spreeBrandsSuccessResponse.data + .sort(taxonsSort) + .map((spreeTaxon: TaxonAttr) => { + return { + node: { + entityId: spreeTaxon.id, + path: `brands/${spreeTaxon.id}`, + name: spreeTaxon.attributes.name, + }, + } + }) + + return { + categories: normalizedCategories, + brands: normalizedBrands, + } + } + + return getSiteInfo +} diff --git a/packages/spree/src/api/operations/index.ts b/packages/spree/src/api/operations/index.ts new file mode 100644 index 000000000..086fdf83a --- /dev/null +++ b/packages/spree/src/api/operations/index.ts @@ -0,0 +1,6 @@ +export { default as getPage } from './get-page' +export { default as getSiteInfo } from './get-site-info' +export { default as getAllPages } from './get-all-pages' +export { default as getProduct } from './get-product' +export { default as getAllProducts } from './get-all-products' +export { default as getAllProductPaths } from './get-all-product-paths' diff --git a/packages/spree/src/api/utils/create-api-fetch.ts b/packages/spree/src/api/utils/create-api-fetch.ts new file mode 100644 index 000000000..b26a2fb11 --- /dev/null +++ b/packages/spree/src/api/utils/create-api-fetch.ts @@ -0,0 +1,86 @@ +import { SpreeApiConfig } from '..' +import { errors, makeClient } from '@spree/storefront-api-v2-sdk' +import { requireConfigValue } from '../../isomorphic-config' +import convertSpreeErrorToGraphQlError from '../../utils/convert-spree-error-to-graph-ql-error' +import type { ResultResponse } from '@spree/storefront-api-v2-sdk/types/interfaces/ResultResponse' +import getSpreeSdkMethodFromEndpointPath from '../../utils/get-spree-sdk-method-from-endpoint-path' +import SpreeSdkMethodFromEndpointPathError from '../../errors/SpreeSdkMethodFromEndpointPathError' +import { GraphQLFetcher, GraphQLFetcherResult } from '@vercel/commerce/api' +import createCustomizedFetchFetcher, { + fetchResponseKey, +} from '../../utils/create-customized-fetch-fetcher' +import fetch, { Request } from 'node-fetch' +import type { SpreeSdkResponseWithRawResponse } from '../../types' +import prettyPrintSpreeSdkErrors from '../../utils/pretty-print-spree-sdk-errors' + +export type CreateApiFetch = ( + getConfig: () => SpreeApiConfig +) => GraphQLFetcher, any> + +// TODO: GraphQLFetcher, any> should be GraphQLFetcher, SpreeSdkVariables>. +// But CommerceAPIConfig['fetch'] cannot be extended from Variables = any to SpreeSdkVariables. + +const createApiFetch: CreateApiFetch = (_getConfig) => { + const client = makeClient({ + host: requireConfigValue('apiHost') as string, + createFetcher: (fetcherOptions) => { + return createCustomizedFetchFetcher({ + fetch, + requestConstructor: Request, + ...fetcherOptions, + }) + }, + }) + + return async (url, queryData = {}, fetchOptions = {}) => { + console.log( + 'apiFetch called. query = ', + 'url = ', + url, + 'queryData = ', + queryData, + 'fetchOptions = ', + fetchOptions + ) + + const { variables } = queryData + + if (!variables) { + throw new SpreeSdkMethodFromEndpointPathError( + `Required SpreeSdkVariables not provided.` + ) + } + + const storeResponse: ResultResponse = + await getSpreeSdkMethodFromEndpointPath( + client, + variables.methodPath + )(...variables.arguments) + + if (storeResponse.isSuccess()) { + const data = storeResponse.success() + const rawFetchResponse = data[fetchResponseKey] + + return { + data, + res: rawFetchResponse, + } + } + + const storeResponseError = storeResponse.fail() + + if (storeResponseError instanceof errors.SpreeError) { + console.error( + `Request to spree resulted in an error:\n\n${prettyPrintSpreeSdkErrors( + storeResponse.fail() + )}` + ) + + throw convertSpreeErrorToGraphQlError(storeResponseError) + } + + throw storeResponseError + } +} + +export default createApiFetch diff --git a/packages/spree/src/api/utils/fetch.ts b/packages/spree/src/api/utils/fetch.ts new file mode 100644 index 000000000..26f9ab674 --- /dev/null +++ b/packages/spree/src/api/utils/fetch.ts @@ -0,0 +1,3 @@ +import vercelFetch from '@vercel/fetch' + +export default vercelFetch() diff --git a/packages/spree/src/auth/index.ts b/packages/spree/src/auth/index.ts new file mode 100644 index 000000000..36e757a89 --- /dev/null +++ b/packages/spree/src/auth/index.ts @@ -0,0 +1,3 @@ +export { default as useLogin } from './use-login' +export { default as useLogout } from './use-logout' +export { default as useSignup } from './use-signup' diff --git a/packages/spree/src/auth/use-login.tsx b/packages/spree/src/auth/use-login.tsx new file mode 100644 index 000000000..b23b8a649 --- /dev/null +++ b/packages/spree/src/auth/use-login.tsx @@ -0,0 +1,86 @@ +import { useCallback } from 'react' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login' +import type { LoginHook } from '@vercel/commerce/types/login' +import type { AuthTokenAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Authentication' +import { FetcherError, ValidationError } from '@vercel/commerce/utils/errors' +import useCustomer from '../customer/use-customer' +import useCart from '../cart/use-cart' +import useWishlist from '../wishlist/use-wishlist' +import login from '../utils/login' + +export default useLogin as UseLogin + +export const handler: MutationHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + url: 'authentication', + query: 'getToken', + }, + async fetcher({ input, options, fetch }) { + console.info( + 'useLogin fetcher called. Configuration: ', + 'input: ', + input, + 'options: ', + options + ) + + const { email, password } = input + + if (!email || !password) { + throw new ValidationError({ + message: 'Email and password need to be provided.', + }) + } + + const getTokenParameters: AuthTokenAttr = { + username: email, + password, + } + + try { + await login(fetch, getTokenParameters, false) + + return null + } catch (getTokenError) { + if ( + getTokenError instanceof FetcherError && + getTokenError.status === 400 + ) { + // Change the error message to be more user friendly. + throw new FetcherError({ + status: getTokenError.status, + message: 'The email or password is invalid.', + code: getTokenError.code, + }) + } + + throw getTokenError + } + }, + useHook: ({ fetch }) => { + const useWrappedHook: ReturnType< + MutationHook['useHook'] + > = () => { + const customer = useCustomer() + const cart = useCart() + const wishlist = useWishlist() + + return useCallback( + async function login(input) { + const data = await fetch({ input }) + + await customer.mutate() + await cart.mutate() + await wishlist.mutate() + + return data + }, + [customer, cart, wishlist] + ) + } + + return useWrappedHook + }, +} diff --git a/packages/spree/src/auth/use-logout.tsx b/packages/spree/src/auth/use-logout.tsx new file mode 100644 index 000000000..8b2202123 --- /dev/null +++ b/packages/spree/src/auth/use-logout.tsx @@ -0,0 +1,81 @@ +import { MutationHook } from '@vercel/commerce/utils/types' +import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout' +import type { LogoutHook } from '@vercel/commerce/types/logout' +import { useCallback } from 'react' +import useCustomer from '../customer/use-customer' +import useCart from '../cart/use-cart' +import useWishlist from '../wishlist/use-wishlist' +import { + ensureUserTokenResponse, + removeUserTokenResponse, +} from '../utils/tokens/user-token-response' +import revokeUserTokens from '../utils/tokens/revoke-user-tokens' +import TokensNotRejectedError from '../errors/TokensNotRejectedError' + +export default useLogout as UseLogout + +export const handler: MutationHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + url: 'authentication', + query: 'revokeToken', + }, + async fetcher({ input, options, fetch }) { + console.info( + 'useLogout fetcher called. Configuration: ', + 'input: ', + input, + 'options: ', + options + ) + + const userToken = ensureUserTokenResponse() + + if (userToken) { + try { + // Revoke any tokens associated with the logged in user. + await revokeUserTokens(fetch, { + accessToken: userToken.access_token, + refreshToken: userToken.refresh_token, + }) + } catch (revokeUserTokenError) { + // Squash token revocation errors and rethrow anything else. + if (!(revokeUserTokenError instanceof TokensNotRejectedError)) { + throw revokeUserTokenError + } + } + + // Whether token revocation succeeded or not, remove them from local storage. + removeUserTokenResponse() + } + + return null + }, + useHook: ({ fetch }) => { + const useWrappedHook: ReturnType< + MutationHook['useHook'] + > = () => { + const customer = useCustomer({ + swrOptions: { isPaused: () => true }, + }) + const cart = useCart({ + swrOptions: { isPaused: () => true }, + }) + const wishlist = useWishlist({ + swrOptions: { isPaused: () => true }, + }) + + return useCallback(async () => { + const data = await fetch() + + await customer.mutate(null, false) + await cart.mutate(null, false) + await wishlist.mutate(null, false) + + return data + }, [customer, cart, wishlist]) + } + + return useWrappedHook + }, +} diff --git a/packages/spree/src/auth/use-signup.tsx b/packages/spree/src/auth/use-signup.tsx new file mode 100644 index 000000000..7dd8879eb --- /dev/null +++ b/packages/spree/src/auth/use-signup.tsx @@ -0,0 +1,96 @@ +import { useCallback } from 'react' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup' +import type { SignupHook } from '@vercel/commerce/types/signup' +import { ValidationError } from '@vercel/commerce/utils/errors' +import type { IAccount } from '@spree/storefront-api-v2-sdk/types/interfaces/Account' +import type { AuthTokenAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Authentication' +import useCustomer from '../customer/use-customer' +import useCart from '../cart/use-cart' +import useWishlist from '../wishlist/use-wishlist' +import login from '../utils/login' +import { requireConfigValue } from '../isomorphic-config' + +export default useSignup as UseSignup + +export const handler: MutationHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + url: 'account', + query: 'create', + }, + async fetcher({ input, options, fetch }) { + console.info( + 'useSignup fetcher called. Configuration: ', + 'input: ', + input, + 'options: ', + options + ) + + const { email, password } = input + + if (!email || !password) { + throw new ValidationError({ + message: 'Email and password need to be provided.', + }) + } + + // TODO: Replace any with specific type from Spree SDK + // once it's added to the SDK. + const createAccountParameters: any = { + user: { + email, + password, + // The stock NJC interface doesn't have a + // password confirmation field, so just copy password. + passwordConfirmation: password, + }, + } + + // Create the user account. + await fetch>({ + variables: { + methodPath: 'account.create', + arguments: [createAccountParameters], + }, + }) + + const getTokenParameters: AuthTokenAttr = { + username: email, + password, + } + + // Login immediately after the account is created. + if (requireConfigValue('loginAfterSignup')) { + await login(fetch, getTokenParameters, true) + } + + return null + }, + useHook: ({ fetch }) => { + const useWrappedHook: ReturnType< + MutationHook['useHook'] + > = () => { + const customer = useCustomer() + const cart = useCart() + const wishlist = useWishlist() + + return useCallback( + async (input) => { + const data = await fetch({ input }) + + await customer.mutate() + await cart.mutate() + await wishlist.mutate() + + return data + }, + [customer, cart, wishlist] + ) + } + + return useWrappedHook + }, +} diff --git a/packages/spree/src/cart/index.ts b/packages/spree/src/cart/index.ts new file mode 100644 index 000000000..3b8ba990e --- /dev/null +++ b/packages/spree/src/cart/index.ts @@ -0,0 +1,4 @@ +export { default as useCart } from './use-cart' +export { default as useAddItem } from './use-add-item' +export { default as useRemoveItem } from './use-remove-item' +export { default as useUpdateItem } from './use-update-item' diff --git a/packages/spree/src/cart/use-add-item.tsx b/packages/spree/src/cart/use-add-item.tsx new file mode 100644 index 000000000..5f7d1f4d5 --- /dev/null +++ b/packages/spree/src/cart/use-add-item.tsx @@ -0,0 +1,118 @@ +import useAddItem from '@vercel/commerce/cart/use-add-item' +import type { UseAddItem } from '@vercel/commerce/cart/use-add-item' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { useCallback } from 'react' +import useCart from './use-cart' +import type { AddItemHook } from '@vercel/commerce/types/cart' +import normalizeCart from '../utils/normalizations/normalize-cart' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' +import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import type { AddItem } from '@spree/storefront-api-v2-sdk/types/interfaces/endpoints/CartClass' +import { setCartToken } from '../utils/tokens/cart-token' +import ensureIToken from '../utils/tokens/ensure-itoken' +import createEmptyCart from '../utils/create-empty-cart' +import { FetcherError } from '@vercel/commerce/utils/errors' +import isLoggedIn from '../utils/tokens/is-logged-in' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + url: 'cart', + query: 'addItem', + }, + async fetcher({ input, options, fetch }) { + console.info( + 'useAddItem fetcher called. Configuration: ', + 'input: ', + input, + 'options: ', + options + ) + + const { quantity, productId, variantId } = input + + const safeQuantity = quantity ?? 1 + + let token: IToken | undefined = ensureIToken() + + const addItemParameters: AddItem = { + variant_id: variantId, + quantity: safeQuantity, + include: [ + 'line_items', + 'line_items.variant', + 'line_items.variant.product', + 'line_items.variant.product.images', + 'line_items.variant.images', + 'line_items.variant.option_values', + 'line_items.variant.product.option_types', + ].join(','), + } + + if (!token) { + const { data: spreeCartCreateSuccessResponse } = await createEmptyCart( + fetch + ) + + setCartToken(spreeCartCreateSuccessResponse.data.attributes.token) + token = ensureIToken() + } + + try { + const { data: spreeSuccessResponse } = await fetch< + GraphQLFetcherResult + >({ + variables: { + methodPath: 'cart.addItem', + arguments: [token, addItemParameters], + }, + }) + + return normalizeCart(spreeSuccessResponse, spreeSuccessResponse.data) + } catch (addItemError) { + if (addItemError instanceof FetcherError && addItemError.status === 404) { + const { data: spreeRetroactiveCartCreateSuccessResponse } = + await createEmptyCart(fetch) + + if (!isLoggedIn()) { + setCartToken( + spreeRetroactiveCartCreateSuccessResponse.data.attributes.token + ) + } + + // Return an empty cart. The user has to add the item again. + // This is going to be a rare situation. + + return normalizeCart( + spreeRetroactiveCartCreateSuccessResponse, + spreeRetroactiveCartCreateSuccessResponse.data + ) + } + + throw addItemError + } + }, + useHook: ({ fetch }) => { + const useWrappedHook: ReturnType< + MutationHook['useHook'] + > = () => { + const { mutate } = useCart() + + return useCallback( + async (input) => { + const data = await fetch({ input }) + + await mutate(data, false) + + return data + }, + [mutate] + ) + } + + return useWrappedHook + }, +} diff --git a/packages/spree/src/cart/use-cart.tsx b/packages/spree/src/cart/use-cart.tsx new file mode 100644 index 000000000..699a023e1 --- /dev/null +++ b/packages/spree/src/cart/use-cart.tsx @@ -0,0 +1,123 @@ +import { useMemo } from 'react' +import type { SWRHook } from '@vercel/commerce/utils/types' +import useCart from '@vercel/commerce/cart/use-cart' +import type { UseCart } from '@vercel/commerce/cart/use-cart' +import type { GetCartHook } from '@vercel/commerce/types/cart' +import normalizeCart from '../utils/normalizations/normalize-cart' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' +import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import { FetcherError } from '@vercel/commerce/utils/errors' +import { setCartToken } from '../utils/tokens/cart-token' +import ensureIToken from '../utils/tokens/ensure-itoken' +import isLoggedIn from '../utils/tokens/is-logged-in' +import createEmptyCart from '../utils/create-empty-cart' +import { requireConfigValue } from '../isomorphic-config' + +const imagesSize = requireConfigValue('imagesSize') as string +const imagesQuality = requireConfigValue('imagesQuality') as number + +export default useCart as UseCart + +// This handler avoids calling /api/cart. +// There doesn't seem to be a good reason to call it. +// So far, only bigcommerce uses it. +export const handler: SWRHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + url: 'cart', + query: 'show', + }, + async fetcher({ input, options, fetch }) { + console.info( + 'useCart fetcher called. Configuration: ', + 'input: ', + input, + 'options: ', + options + ) + + let spreeCartResponse: IOrder | null + + const token: IToken | undefined = ensureIToken() + + if (!token) { + spreeCartResponse = null + } else { + try { + const { data: spreeCartShowSuccessResponse } = await fetch< + GraphQLFetcherResult + >({ + variables: { + methodPath: 'cart.show', + arguments: [ + token, + { + include: [ + 'line_items', + 'line_items.variant', + 'line_items.variant.product', + 'line_items.variant.product.images', + 'line_items.variant.images', + 'line_items.variant.option_values', + 'line_items.variant.product.option_types', + ].join(','), + image_transformation: { + quality: imagesQuality, + size: imagesSize, + }, + }, + ], + }, + }) + + spreeCartResponse = spreeCartShowSuccessResponse + } catch (fetchCartError) { + if ( + !(fetchCartError instanceof FetcherError) || + fetchCartError.status !== 404 + ) { + throw fetchCartError + } + + spreeCartResponse = null + } + } + + if (!spreeCartResponse || spreeCartResponse?.data.attributes.completed_at) { + const { data: spreeCartCreateSuccessResponse } = await createEmptyCart( + fetch + ) + + spreeCartResponse = spreeCartCreateSuccessResponse + + if (!isLoggedIn()) { + setCartToken(spreeCartResponse.data.attributes.token) + } + } + + return normalizeCart(spreeCartResponse, spreeCartResponse.data) + }, + useHook: ({ useData }) => { + const useWrappedHook: ReturnType['useHook']> = ( + input + ) => { + const response = useData({ + swrOptions: { revalidateOnFocus: false, ...input?.swrOptions }, + }) + + return useMemo(() => { + return Object.create(response, { + isEmpty: { + get() { + return (response.data?.lineItems.length ?? 0) === 0 + }, + enumerable: true, + }, + }) + }, [response]) + } + + return useWrappedHook + }, +} diff --git a/packages/spree/src/cart/use-remove-item.tsx b/packages/spree/src/cart/use-remove-item.tsx new file mode 100644 index 000000000..6bbecd32e --- /dev/null +++ b/packages/spree/src/cart/use-remove-item.tsx @@ -0,0 +1,119 @@ +import type { MutationHook } from '@vercel/commerce/utils/types' +import useRemoveItem from '@vercel/commerce/cart/use-remove-item' +import type { UseRemoveItem } from '@vercel/commerce/cart/use-remove-item' +import type { RemoveItemHook } from '@vercel/commerce/types/cart' +import useCart from './use-cart' +import { useCallback } from 'react' +import normalizeCart from '../utils/normalizations/normalize-cart' +import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { IQuery } from '@spree/storefront-api-v2-sdk/types/interfaces/Query' +import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import ensureIToken from '../utils/tokens/ensure-itoken' +import createEmptyCart from '../utils/create-empty-cart' +import { setCartToken } from '../utils/tokens/cart-token' +import { FetcherError } from '@vercel/commerce/utils/errors' +import isLoggedIn from '../utils/tokens/is-logged-in' + +export default useRemoveItem as UseRemoveItem + +export const handler: MutationHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + url: 'cart', + query: 'removeItem', + }, + async fetcher({ input, options, fetch }) { + console.info( + 'useRemoveItem fetcher called. Configuration: ', + 'input: ', + input, + 'options: ', + options + ) + + const { itemId: lineItemId } = input + + let token: IToken | undefined = ensureIToken() + + if (!token) { + const { data: spreeCartCreateSuccessResponse } = await createEmptyCart( + fetch + ) + + setCartToken(spreeCartCreateSuccessResponse.data.attributes.token) + token = ensureIToken() + } + + const removeItemParameters: IQuery = { + include: [ + 'line_items', + 'line_items.variant', + 'line_items.variant.product', + 'line_items.variant.product.images', + 'line_items.variant.images', + 'line_items.variant.option_values', + 'line_items.variant.product.option_types', + ].join(','), + } + + try { + const { data: spreeSuccessResponse } = await fetch< + GraphQLFetcherResult + >({ + variables: { + methodPath: 'cart.removeItem', + arguments: [token, lineItemId, removeItemParameters], + }, + }) + + return normalizeCart(spreeSuccessResponse, spreeSuccessResponse.data) + } catch (removeItemError) { + if ( + removeItemError instanceof FetcherError && + removeItemError.status === 404 + ) { + const { data: spreeRetroactiveCartCreateSuccessResponse } = + await createEmptyCart(fetch) + + if (!isLoggedIn()) { + setCartToken( + spreeRetroactiveCartCreateSuccessResponse.data.attributes.token + ) + } + + // Return an empty cart. This is going to be a rare situation. + + return normalizeCart( + spreeRetroactiveCartCreateSuccessResponse, + spreeRetroactiveCartCreateSuccessResponse.data + ) + } + + throw removeItemError + } + }, + useHook: ({ fetch }) => { + const useWrappedHook: ReturnType< + MutationHook['useHook'] + > = () => { + const { mutate } = useCart() + + return useCallback( + async (input) => { + const data = await fetch({ input: { itemId: input.id } }) + + // Upon calling cart.removeItem, Spree returns the old version of the cart, + // with the already removed line item. Invalidate the useCart mutation + // to fetch the cart again. + await mutate(data, true) + + return data + }, + [mutate] + ) + } + + return useWrappedHook + }, +} diff --git a/packages/spree/src/cart/use-update-item.tsx b/packages/spree/src/cart/use-update-item.tsx new file mode 100644 index 000000000..679d68ac7 --- /dev/null +++ b/packages/spree/src/cart/use-update-item.tsx @@ -0,0 +1,148 @@ +import type { MutationHook } from '@vercel/commerce/utils/types' +import useUpdateItem, { + UseUpdateItem, +} from '@vercel/commerce/cart/use-update-item' +import type { UpdateItemHook } from '@vercel/commerce/types/cart' +import useCart from './use-cart' +import { useMemo } from 'react' +import { FetcherError, ValidationError } from '@vercel/commerce/utils/errors' +import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import type { SetQuantity } from '@spree/storefront-api-v2-sdk/types/interfaces/endpoints/CartClass' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' +import normalizeCart from '../utils/normalizations/normalize-cart' +import debounce from 'lodash.debounce' +import ensureIToken from '../utils/tokens/ensure-itoken' +import createEmptyCart from '../utils/create-empty-cart' +import { setCartToken } from '../utils/tokens/cart-token' +import isLoggedIn from '../utils/tokens/is-logged-in' + +export default useUpdateItem as UseUpdateItem + +export const handler: MutationHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + url: 'cart', + query: 'setQuantity', + }, + async fetcher({ input, options, fetch }) { + console.info( + 'useRemoveItem fetcher called. Configuration: ', + 'input: ', + input, + 'options: ', + options + ) + + const { itemId, item } = input + + if (!item.quantity) { + throw new ValidationError({ + message: 'Line item quantity needs to be provided.', + }) + } + + let token: IToken | undefined = ensureIToken() + + if (!token) { + const { data: spreeCartCreateSuccessResponse } = await createEmptyCart( + fetch + ) + + setCartToken(spreeCartCreateSuccessResponse.data.attributes.token) + token = ensureIToken() + } + + try { + const setQuantityParameters: SetQuantity = { + line_item_id: itemId, + quantity: item.quantity, + include: [ + 'line_items', + 'line_items.variant', + 'line_items.variant.product', + 'line_items.variant.product.images', + 'line_items.variant.images', + 'line_items.variant.option_values', + 'line_items.variant.product.option_types', + ].join(','), + } + + const { data: spreeSuccessResponse } = await fetch< + GraphQLFetcherResult + >({ + variables: { + methodPath: 'cart.setQuantity', + arguments: [token, setQuantityParameters], + }, + }) + + return normalizeCart(spreeSuccessResponse, spreeSuccessResponse.data) + } catch (updateItemError) { + if ( + updateItemError instanceof FetcherError && + updateItemError.status === 404 + ) { + const { data: spreeRetroactiveCartCreateSuccessResponse } = + await createEmptyCart(fetch) + + if (!isLoggedIn()) { + setCartToken( + spreeRetroactiveCartCreateSuccessResponse.data.attributes.token + ) + } + + // Return an empty cart. The user has to update the item again. + // This is going to be a rare situation. + + return normalizeCart( + spreeRetroactiveCartCreateSuccessResponse, + spreeRetroactiveCartCreateSuccessResponse.data + ) + } + + throw updateItemError + } + }, + useHook: ({ fetch }) => { + const useWrappedHook: ReturnType< + MutationHook['useHook'] + > = (context) => { + const { mutate } = useCart() + + return useMemo( + () => + debounce(async (input: UpdateItemHook['actionInput']) => { + const itemId = context?.item?.id + const productId = input.productId ?? context?.item?.productId + const variantId = input.variantId ?? context?.item?.variantId + const quantity = input.quantity + + if (!itemId || !productId || !variantId) { + throw new ValidationError({ + message: 'Invalid input used for this operation', + }) + } + + const data = await fetch({ + input: { + item: { + productId, + variantId, + quantity, + }, + itemId, + }, + }) + + await mutate(data, false) + + return data + }, context?.wait ?? 500), + [mutate, context] + ) + } + + return useWrappedHook + }, +} diff --git a/packages/spree/src/checkout/use-checkout.tsx b/packages/spree/src/checkout/use-checkout.tsx new file mode 100644 index 000000000..bd8e3ac75 --- /dev/null +++ b/packages/spree/src/checkout/use-checkout.tsx @@ -0,0 +1,19 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { + UseCheckout, +} from '@vercel/commerce/checkout/use-checkout' + +export default useCheckout as UseCheckout + +export const handler: SWRHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + // TODO: Revise url and query + url: 'checkout', + query: 'show', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ useData }) => + async (input) => ({}), +} diff --git a/packages/spree/src/commerce.config.json b/packages/spree/src/commerce.config.json new file mode 100644 index 000000000..6f8399fb5 --- /dev/null +++ b/packages/spree/src/commerce.config.json @@ -0,0 +1,10 @@ +{ + "provider": "spree", + "features": { + "wishlist": true, + "cart": true, + "search": true, + "customerAuth": true, + "customCheckout": false + } +} diff --git a/packages/spree/src/customer/address/use-add-item.tsx b/packages/spree/src/customer/address/use-add-item.tsx new file mode 100644 index 000000000..63296809d --- /dev/null +++ b/packages/spree/src/customer/address/use-add-item.tsx @@ -0,0 +1,18 @@ +import useAddItem from '@vercel/commerce/customer/address/use-add-item' +import type { UseAddItem } from '@vercel/commerce/customer/address/use-add-item' +import type { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + url: 'account', + query: 'createAddress', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/packages/spree/src/customer/card/use-add-item.tsx b/packages/spree/src/customer/card/use-add-item.tsx new file mode 100644 index 000000000..402811453 --- /dev/null +++ b/packages/spree/src/customer/card/use-add-item.tsx @@ -0,0 +1,19 @@ +import useAddItem from '@vercel/commerce/customer/address/use-add-item' +import type { UseAddItem } from '@vercel/commerce/customer/address/use-add-item' +import type { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + // TODO: Revise url and query + url: 'checkout', + query: 'addPayment', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/packages/spree/src/customer/index.ts b/packages/spree/src/customer/index.ts new file mode 100644 index 000000000..6c903ecc5 --- /dev/null +++ b/packages/spree/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/packages/spree/src/customer/use-customer.tsx b/packages/spree/src/customer/use-customer.tsx new file mode 100644 index 000000000..56f330d26 --- /dev/null +++ b/packages/spree/src/customer/use-customer.tsx @@ -0,0 +1,83 @@ +import type { SWRHook } from '@vercel/commerce/utils/types' +import useCustomer from '@vercel/commerce/customer/use-customer' +import type { UseCustomer } from '@vercel/commerce/customer/use-customer' +import type { CustomerHook } from '@vercel/commerce/types/customer' +import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { IAccount } from '@spree/storefront-api-v2-sdk/types/interfaces/Account' +import { FetcherError } from '@vercel/commerce/utils/errors' +import normalizeUser from '../utils/normalizations/normalize-user' +import isLoggedIn from '../utils/tokens/is-logged-in' +import ensureIToken from '../utils/tokens/ensure-itoken' + +export default useCustomer as UseCustomer + +export const handler: SWRHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + url: 'account', + query: 'get', + }, + async fetcher({ input, options, fetch }) { + console.info( + 'useCustomer fetcher called. Configuration: ', + 'input: ', + input, + 'options: ', + options + ) + + if (!isLoggedIn()) { + return null + } + + const token: IToken | undefined = ensureIToken() + + if (!token) { + return null + } + + try { + const { data: spreeAccountInfoSuccessResponse } = await fetch< + GraphQLFetcherResult + >({ + variables: { + methodPath: 'account.accountInfo', + arguments: [token], + }, + }) + + const spreeUser = spreeAccountInfoSuccessResponse.data + + const normalizedUser = normalizeUser( + spreeAccountInfoSuccessResponse, + spreeUser + ) + + return normalizedUser + } catch (fetchUserError) { + if ( + !(fetchUserError instanceof FetcherError) || + fetchUserError.status !== 404 + ) { + throw fetchUserError + } + + return null + } + }, + useHook: ({ useData }) => { + const useWrappedHook: ReturnType['useHook']> = ( + input + ) => { + return useData({ + swrOptions: { + revalidateOnFocus: false, + ...input?.swrOptions, + }, + }) + } + + return useWrappedHook + }, +} diff --git a/packages/spree/src/errors/AccessTokenError.ts b/packages/spree/src/errors/AccessTokenError.ts new file mode 100644 index 000000000..4c79c0be8 --- /dev/null +++ b/packages/spree/src/errors/AccessTokenError.ts @@ -0,0 +1 @@ +export default class AccessTokenError extends Error {} diff --git a/packages/spree/src/errors/MisconfigurationError.ts b/packages/spree/src/errors/MisconfigurationError.ts new file mode 100644 index 000000000..0717ae404 --- /dev/null +++ b/packages/spree/src/errors/MisconfigurationError.ts @@ -0,0 +1 @@ +export default class MisconfigurationError extends Error {} diff --git a/packages/spree/src/errors/MissingConfigurationValueError.ts b/packages/spree/src/errors/MissingConfigurationValueError.ts new file mode 100644 index 000000000..02b497bf1 --- /dev/null +++ b/packages/spree/src/errors/MissingConfigurationValueError.ts @@ -0,0 +1 @@ +export default class MissingConfigurationValueError extends Error {} diff --git a/packages/spree/src/errors/MissingLineItemVariantError.ts b/packages/spree/src/errors/MissingLineItemVariantError.ts new file mode 100644 index 000000000..d9bee0803 --- /dev/null +++ b/packages/spree/src/errors/MissingLineItemVariantError.ts @@ -0,0 +1 @@ +export default class MissingLineItemVariantError extends Error {} diff --git a/packages/spree/src/errors/MissingOptionValueError.ts b/packages/spree/src/errors/MissingOptionValueError.ts new file mode 100644 index 000000000..04457ac5e --- /dev/null +++ b/packages/spree/src/errors/MissingOptionValueError.ts @@ -0,0 +1 @@ +export default class MissingOptionValueError extends Error {} diff --git a/packages/spree/src/errors/MissingPrimaryVariantError.ts b/packages/spree/src/errors/MissingPrimaryVariantError.ts new file mode 100644 index 000000000..f9af41b03 --- /dev/null +++ b/packages/spree/src/errors/MissingPrimaryVariantError.ts @@ -0,0 +1 @@ +export default class MissingPrimaryVariantError extends Error {} diff --git a/packages/spree/src/errors/MissingProductError.ts b/packages/spree/src/errors/MissingProductError.ts new file mode 100644 index 000000000..3098be689 --- /dev/null +++ b/packages/spree/src/errors/MissingProductError.ts @@ -0,0 +1 @@ +export default class MissingProductError extends Error {} diff --git a/packages/spree/src/errors/MissingSlugVariableError.ts b/packages/spree/src/errors/MissingSlugVariableError.ts new file mode 100644 index 000000000..09b9d2e20 --- /dev/null +++ b/packages/spree/src/errors/MissingSlugVariableError.ts @@ -0,0 +1 @@ +export default class MissingSlugVariableError extends Error {} diff --git a/packages/spree/src/errors/MissingVariantError.ts b/packages/spree/src/errors/MissingVariantError.ts new file mode 100644 index 000000000..5ed9e0ed2 --- /dev/null +++ b/packages/spree/src/errors/MissingVariantError.ts @@ -0,0 +1 @@ +export default class MissingVariantError extends Error {} diff --git a/packages/spree/src/errors/RefreshTokenError.ts b/packages/spree/src/errors/RefreshTokenError.ts new file mode 100644 index 000000000..a79365bbb --- /dev/null +++ b/packages/spree/src/errors/RefreshTokenError.ts @@ -0,0 +1 @@ +export default class RefreshTokenError extends Error {} diff --git a/packages/spree/src/errors/SpreeResponseContentError.ts b/packages/spree/src/errors/SpreeResponseContentError.ts new file mode 100644 index 000000000..19c10cf2e --- /dev/null +++ b/packages/spree/src/errors/SpreeResponseContentError.ts @@ -0,0 +1 @@ +export default class SpreeResponseContentError extends Error {} diff --git a/packages/spree/src/errors/SpreeSdkMethodFromEndpointPathError.ts b/packages/spree/src/errors/SpreeSdkMethodFromEndpointPathError.ts new file mode 100644 index 000000000..bf15aada0 --- /dev/null +++ b/packages/spree/src/errors/SpreeSdkMethodFromEndpointPathError.ts @@ -0,0 +1 @@ +export default class SpreeSdkMethodFromEndpointPathError extends Error {} diff --git a/packages/spree/src/errors/TokensNotRejectedError.ts b/packages/spree/src/errors/TokensNotRejectedError.ts new file mode 100644 index 000000000..245f66414 --- /dev/null +++ b/packages/spree/src/errors/TokensNotRejectedError.ts @@ -0,0 +1 @@ +export default class TokensNotRejectedError extends Error {} diff --git a/packages/spree/src/errors/UserTokenResponseParseError.ts b/packages/spree/src/errors/UserTokenResponseParseError.ts new file mode 100644 index 000000000..9631971c1 --- /dev/null +++ b/packages/spree/src/errors/UserTokenResponseParseError.ts @@ -0,0 +1 @@ +export default class UserTokenResponseParseError extends Error {} diff --git a/packages/spree/src/fetcher.ts b/packages/spree/src/fetcher.ts new file mode 100644 index 000000000..cb14c1e61 --- /dev/null +++ b/packages/spree/src/fetcher.ts @@ -0,0 +1,123 @@ +import type { Fetcher } from '@vercel/commerce/utils/types' +import convertSpreeErrorToGraphQlError from './utils/convert-spree-error-to-graph-ql-error' +import { makeClient, errors } from '@spree/storefront-api-v2-sdk' +import type { ResultResponse } from '@spree/storefront-api-v2-sdk/types/interfaces/ResultResponse' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import { requireConfigValue } from './isomorphic-config' +import getSpreeSdkMethodFromEndpointPath from './utils/get-spree-sdk-method-from-endpoint-path' +import SpreeSdkMethodFromEndpointPathError from './errors/SpreeSdkMethodFromEndpointPathError' +import type { + FetcherVariables, + SpreeSdkResponse, + SpreeSdkResponseWithRawResponse, +} from './types' +import createCustomizedFetchFetcher, { + fetchResponseKey, +} from './utils/create-customized-fetch-fetcher' +import ensureFreshUserAccessToken from './utils/tokens/ensure-fresh-user-access-token' +import RefreshTokenError from './errors/RefreshTokenError' +import prettyPrintSpreeSdkErrors from './utils/pretty-print-spree-sdk-errors' + +const client = makeClient({ + host: requireConfigValue('apiHost') as string, + createFetcher: (fetcherOptions) => { + return createCustomizedFetchFetcher({ + fetch: globalThis.fetch, + requestConstructor: globalThis.Request, + ...fetcherOptions, + }) + }, +}) + +const normalizeSpreeSuccessResponse = ( + storeResponse: ResultResponse +): GraphQLFetcherResult => { + const data = storeResponse.success() + const rawFetchResponse = data[fetchResponseKey] + + return { + data, + res: rawFetchResponse, + } +} + +const fetcher: Fetcher> = async ( + requestOptions +) => { + const { url, method, variables, query } = requestOptions + + console.log( + 'Fetcher called. Configuration: ', + 'url = ', + url, + 'requestOptions = ', + requestOptions + ) + + if (!variables) { + throw new SpreeSdkMethodFromEndpointPathError( + `Required FetcherVariables not provided.` + ) + } + + const { + methodPath, + arguments: args, + refreshExpiredAccessToken = true, + replayUnauthorizedRequest = true, + } = variables as FetcherVariables + + if (refreshExpiredAccessToken) { + await ensureFreshUserAccessToken(client) + } + + const spreeSdkMethod = getSpreeSdkMethodFromEndpointPath(client, methodPath) + + const storeResponse: ResultResponse = + await spreeSdkMethod(...args) + + if (storeResponse.isSuccess()) { + return normalizeSpreeSuccessResponse(storeResponse) + } + + const storeResponseError = storeResponse.fail() + + if ( + storeResponseError instanceof errors.SpreeError && + storeResponseError.serverResponse.status === 401 && + replayUnauthorizedRequest + ) { + console.info( + 'Request ended with 401. Replaying request after refreshing the user token.' + ) + + await ensureFreshUserAccessToken(client) + + const replayedStoreResponse: ResultResponse = + await spreeSdkMethod(...args) + + if (replayedStoreResponse.isSuccess()) { + return normalizeSpreeSuccessResponse(replayedStoreResponse) + } + + console.warn('Replaying the request failed', replayedStoreResponse.fail()) + + throw new RefreshTokenError( + 'Could not authorize request with current access token.' + ) + } + + if (storeResponseError instanceof errors.SpreeError) { + console.error( + `Request to spree resulted in an error:\n\n${prettyPrintSpreeSdkErrors( + storeResponse.fail() + )}` + ) + + throw convertSpreeErrorToGraphQlError(storeResponseError) + } + + throw storeResponseError +} + +export default fetcher diff --git a/packages/spree/src/index.tsx b/packages/spree/src/index.tsx new file mode 100644 index 000000000..9291e2b16 --- /dev/null +++ b/packages/spree/src/index.tsx @@ -0,0 +1,49 @@ +import type { ComponentType, FunctionComponent } from 'react' +import { + Provider, + CommerceProviderProps, + CoreCommerceProvider, + useCommerce as useCoreCommerce, +} from '@vercel/commerce' +import { spreeProvider } from './provider' +import type { SpreeProvider } from './provider' +import { SWRConfig } from 'swr' +import handleTokenErrors from './utils/handle-token-errors' +import useLogout from '@vercel/commerce/auth/use-logout' + +export { spreeProvider } +export type { SpreeProvider } + +export const WithTokenErrorsHandling: FunctionComponent = ({ children }) => { + const logout = useLogout() + + return ( + { + handleTokenErrors(error, () => void logout()) + }, + }} + > + {children} + + ) +} + +export const getCommerceProvider =

(provider: P) => { + return function CommerceProvider({ + children, + ...props + }: CommerceProviderProps) { + return ( + + {children} + + ) + } +} + +export const CommerceProvider = + getCommerceProvider(spreeProvider) + +export const useCommerce = () => useCoreCommerce() diff --git a/packages/spree/src/isomorphic-config.ts b/packages/spree/src/isomorphic-config.ts new file mode 100644 index 000000000..b824fd80a --- /dev/null +++ b/packages/spree/src/isomorphic-config.ts @@ -0,0 +1,81 @@ +import forceIsomorphicConfigValues from './utils/force-isomorphic-config-values' +import requireConfig from './utils/require-config' +import validateAllProductsTaxonomyId from './utils/validations/validate-all-products-taxonomy-id' +import validateCookieExpire from './utils/validations/validate-cookie-expire' +import validateImagesOptionFilter from './utils/validations/validate-images-option-filter' +import validatePlaceholderImageUrl from './utils/validations/validate-placeholder-image-url' +import validateProductsPrerenderCount from './utils/validations/validate-products-prerender-count' +import validateImagesSize from './utils/validations/validate-images-size' +import validateImagesQuality from './utils/validations/validate-images-quality' + +const isomorphicConfig = { + apiHost: process.env.NEXT_PUBLIC_SPREE_API_HOST, + defaultLocale: process.env.NEXT_PUBLIC_SPREE_DEFAULT_LOCALE, + cartCookieName: process.env.NEXT_PUBLIC_SPREE_CART_COOKIE_NAME, + cartCookieExpire: validateCookieExpire( + process.env.NEXT_PUBLIC_SPREE_CART_COOKIE_EXPIRE + ), + userCookieName: process.env.NEXT_PUBLIC_SPREE_USER_COOKIE_NAME, + userCookieExpire: validateCookieExpire( + process.env.NEXT_PUBLIC_SPREE_CART_COOKIE_EXPIRE + ), + imageHost: process.env.NEXT_PUBLIC_SPREE_IMAGE_HOST, + categoriesTaxonomyPermalink: + process.env.NEXT_PUBLIC_SPREE_CATEGORIES_TAXONOMY_PERMALINK, + brandsTaxonomyPermalink: + process.env.NEXT_PUBLIC_SPREE_BRANDS_TAXONOMY_PERMALINK, + allProductsTaxonomyId: validateAllProductsTaxonomyId( + process.env.NEXT_PUBLIC_SPREE_ALL_PRODUCTS_TAXONOMY_ID + ), + showSingleVariantOptions: + process.env.NEXT_PUBLIC_SPREE_SHOW_SINGLE_VARIANT_OPTIONS === 'true', + lastUpdatedProductsPrerenderCount: validateProductsPrerenderCount( + process.env.NEXT_PUBLIC_SPREE_LAST_UPDATED_PRODUCTS_PRERENDER_COUNT + ), + productPlaceholderImageUrl: validatePlaceholderImageUrl( + process.env.NEXT_PUBLIC_SPREE_PRODUCT_PLACEHOLDER_IMAGE_URL + ), + lineItemPlaceholderImageUrl: validatePlaceholderImageUrl( + process.env.NEXT_PUBLIC_SPREE_LINE_ITEM_PLACEHOLDER_IMAGE_URL + ), + imagesOptionFilter: validateImagesOptionFilter( + process.env.NEXT_PUBLIC_SPREE_IMAGES_OPTION_FILTER + ), + imagesSize: validateImagesSize(process.env.NEXT_PUBLIC_SPREE_IMAGES_SIZE), + imagesQuality: validateImagesQuality( + process.env.NEXT_PUBLIC_SPREE_IMAGES_QUALITY + ), + loginAfterSignup: process.env.NEXT_PUBLIC_SPREE_LOGIN_AFTER_SIGNUP === 'true', +} + +export default forceIsomorphicConfigValues( + isomorphicConfig, + [], + [ + 'apiHost', + 'defaultLocale', + 'cartCookieName', + 'cartCookieExpire', + 'userCookieName', + 'userCookieExpire', + 'imageHost', + 'categoriesTaxonomyPermalink', + 'brandsTaxonomyPermalink', + 'allProductsTaxonomyId', + 'showSingleVariantOptions', + 'lastUpdatedProductsPrerenderCount', + 'productPlaceholderImageUrl', + 'lineItemPlaceholderImageUrl', + 'imagesOptionFilter', + 'imagesSize', + 'imagesQuality', + 'loginAfterSignup', + ] +) + +type IsomorphicConfig = typeof isomorphicConfig + +const requireConfigValue = (key: keyof IsomorphicConfig) => + requireConfig(isomorphicConfig, key) + +export { requireConfigValue } diff --git a/packages/spree/src/next.config.cjs b/packages/spree/src/next.config.cjs new file mode 100644 index 000000000..0aaa87e0a --- /dev/null +++ b/packages/spree/src/next.config.cjs @@ -0,0 +1,16 @@ +const commerce = require('./commerce.config.json') + +module.exports = { + commerce, + images: { + domains: [process.env.NEXT_PUBLIC_SPREE_ALLOWED_IMAGE_DOMAIN], + }, + rewrites() { + return [ + { + source: '/checkout', + destination: '/api/checkout', + }, + ] + }, +} diff --git a/packages/spree/src/product/index.ts b/packages/spree/src/product/index.ts new file mode 100644 index 000000000..426a3edcd --- /dev/null +++ b/packages/spree/src/product/index.ts @@ -0,0 +1,2 @@ +export { default as usePrice } from './use-price' +export { default as useSearch } from './use-search' diff --git a/packages/spree/src/product/use-price.tsx b/packages/spree/src/product/use-price.tsx new file mode 100644 index 000000000..fd42d7033 --- /dev/null +++ b/packages/spree/src/product/use-price.tsx @@ -0,0 +1,2 @@ +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/packages/spree/src/product/use-search.tsx b/packages/spree/src/product/use-search.tsx new file mode 100644 index 000000000..7de5d8258 --- /dev/null +++ b/packages/spree/src/product/use-search.tsx @@ -0,0 +1,104 @@ +import type { SWRHook } from '@vercel/commerce/utils/types' +import useSearch from '@vercel/commerce/product/use-search' +import type { + Product, + SearchProductsHook, +} from '@vercel/commerce/types/product' +import type { UseSearch } from '@vercel/commerce/product/use-search' +import normalizeProduct from '../utils/normalizations/normalize-product' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import { IProducts } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' +import { requireConfigValue } from '../isomorphic-config' + +const imagesSize = requireConfigValue('imagesSize') as string +const imagesQuality = requireConfigValue('imagesQuality') as number + +const nextToSpreeSortMap: { [key: string]: string } = { + 'trending-desc': 'available_on', + 'latest-desc': 'updated_at', + 'price-asc': 'price', + 'price-desc': '-price', +} + +export const handler: SWRHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + url: 'products', + query: 'list', + }, + async fetcher({ input, options, fetch }) { + // This method is only needed if the options need to be modified before calling the generic fetcher (created in createFetcher). + + console.info( + 'useSearch fetcher called. Configuration: ', + 'input: ', + input, + 'options: ', + options + ) + + const taxons = [input.categoryId, input.brandId].filter(Boolean) + + const filter = { + filter: { + ...(taxons.length > 0 ? { taxons: taxons.join(',') } : {}), + ...(input.search ? { name: input.search } : {}), + }, + } + + const sort = input.sort ? { sort: nextToSpreeSortMap[input.sort] } : {} + + const { data: spreeSuccessResponse } = await fetch< + GraphQLFetcherResult + >({ + variables: { + methodPath: 'products.list', + arguments: [ + {}, + { + include: + 'primary_variant,variants,images,option_types,variants.option_values', + per_page: 50, + ...filter, + ...sort, + image_transformation: { + quality: imagesQuality, + size: imagesSize, + }, + }, + ], + }, + }) + + const normalizedProducts: Product[] = spreeSuccessResponse.data.map( + (spreeProduct) => normalizeProduct(spreeSuccessResponse, spreeProduct) + ) + + const found = spreeSuccessResponse.data.length > 0 + + return { products: normalizedProducts, found } + }, + useHook: ({ useData }) => { + const useWrappedHook: ReturnType['useHook']> = ( + input = {} + ) => { + return useData({ + input: [ + ['search', input.search], + ['categoryId', input.categoryId], + ['brandId', input.brandId], + ['sort', input.sort], + ], + swrOptions: { + revalidateOnFocus: false, + // revalidateOnFocus: false means do not fetch products again when website is refocused in the web browser. + ...input.swrOptions, + }, + }) + } + + return useWrappedHook + }, +} + +export default useSearch as UseSearch diff --git a/packages/spree/src/provider.ts b/packages/spree/src/provider.ts new file mode 100644 index 000000000..de6ddb207 --- /dev/null +++ b/packages/spree/src/provider.ts @@ -0,0 +1,35 @@ +import fetcher from './fetcher' +import { handler as useCart } from './cart/use-cart' +import { handler as useAddItem } from './cart/use-add-item' +import { handler as useUpdateItem } from './cart/use-update-item' +import { handler as useRemoveItem } from './cart/use-remove-item' +import { handler as useCustomer } from './customer/use-customer' +import { handler as useSearch } from './product/use-search' +import { handler as useLogin } from './auth/use-login' +import { handler as useLogout } from './auth/use-logout' +import { handler as useSignup } from './auth/use-signup' +import { handler as useCheckout } from './checkout/use-checkout' +import { handler as useWishlist } from './wishlist/use-wishlist' +import { handler as useWishlistAddItem } from './wishlist/use-add-item' +import { handler as useWishlistRemoveItem } from './wishlist/use-remove-item' +import { requireConfigValue } from './isomorphic-config' + +const spreeProvider = { + locale: requireConfigValue('defaultLocale') as string, + cartCookie: requireConfigValue('cartCookieName') as string, + fetcher, + cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, + customer: { useCustomer }, + products: { useSearch }, + auth: { useLogin, useLogout, useSignup }, + checkout: { useCheckout }, + wishlist: { + useWishlist, + useAddItem: useWishlistAddItem, + useRemoveItem: useWishlistRemoveItem, + }, +} + +export { spreeProvider } + +export type SpreeProvider = typeof spreeProvider diff --git a/packages/spree/src/types/index.ts b/packages/spree/src/types/index.ts new file mode 100644 index 000000000..74ddeb52a --- /dev/null +++ b/packages/spree/src/types/index.ts @@ -0,0 +1,164 @@ +import type { fetchResponseKey } from '../utils/create-customized-fetch-fetcher' +import type { + JsonApiDocument, + JsonApiListResponse, + JsonApiSingleResponse, +} from '@spree/storefront-api-v2-sdk/types/interfaces/JsonApi' +import type { ResultResponse } from '@spree/storefront-api-v2-sdk/types/interfaces/ResultResponse' +import type { Response } from '@vercel/fetch' +import type { ProductOption, Product } from '@vercel/commerce/types/product' +import type { + AddItemHook, + RemoveItemHook, + WishlistItemBody, + WishlistTypes, +} from '@vercel/commerce/types/wishlist' + +export type UnknownObjectValues = Record + +export type NonUndefined = T extends undefined ? never : T + +export type ValueOf = T[keyof T] + +export type SpreeSdkResponse = JsonApiSingleResponse | JsonApiListResponse + +export type SpreeSdkResponseWithRawResponse = SpreeSdkResponse & { + [fetchResponseKey]: Response +} + +export type SpreeSdkResultResponseSuccessType = SpreeSdkResponseWithRawResponse + +export type SpreeSdkMethodReturnType< + ResultResponseSuccessType extends SpreeSdkResultResponseSuccessType = SpreeSdkResultResponseSuccessType +> = Promise> + +export type SpreeSdkMethod< + ResultResponseSuccessType extends SpreeSdkResultResponseSuccessType = SpreeSdkResultResponseSuccessType +> = (...args: any[]) => SpreeSdkMethodReturnType + +export type SpreeSdkVariables = { + methodPath: string + arguments: any[] +} + +export type FetcherVariables = SpreeSdkVariables & { + refreshExpiredAccessToken: boolean + replayUnauthorizedRequest: boolean +} + +export interface ImageStyle { + url: string + width: string + height: string + size: string +} + +export interface SpreeProductImage extends JsonApiDocument { + attributes: { + position: number + alt: string + original_url: string + transformed_url: string | null + styles: ImageStyle[] + } +} + +export interface OptionTypeAttr extends JsonApiDocument { + attributes: { + name: string + presentation: string + position: number + created_at: string + updated_at: string + filterable: boolean + } +} + +export interface LineItemAttr extends JsonApiDocument { + attributes: { + name: string + quantity: number + slug: string + options_text: string + price: string + currency: string + display_price: string + total: string + display_total: string + adjustment_total: string + display_adjustment_total: string + additional_tax_total: string + display_additional_tax_total: string + discounted_amount: string + display_discounted_amount: string + pre_tax_amount: string + display_pre_tax_amount: string + promo_total: string + display_promo_total: string + included_tax_total: string + display_inluded_tax_total: string + } +} + +export interface VariantAttr extends JsonApiDocument { + attributes: { + sku: string + price: string + currency: string + display_price: string + weight: string + height: string + width: string + depth: string + is_master: boolean + options_text: string + purchasable: boolean + in_stock: boolean + backorderable: boolean + } +} + +export interface ProductSlugAttr extends JsonApiDocument { + attributes: { + slug: string + } +} +export interface IProductsSlugs extends JsonApiListResponse { + data: ProductSlugAttr[] +} + +export type ExpandedProductOption = ProductOption & { position: number } + +export type UserOAuthTokens = { + refreshToken: string + accessToken: string +} + +// TODO: ExplicitCommerceWishlist is a temporary type +// derived from tsx views. It will be removed once +// Wishlist in @vercel/commerce/types/wishlist is updated +// to a more specific type than `any`. +export type ExplicitCommerceWishlist = { + id: string + token: string + items: { + id: string + product_id: number + variant_id: number + product: Product + }[] +} + +export type ExplicitWishlistAddItemHook = AddItemHook< + WishlistTypes & { + wishlist: ExplicitCommerceWishlist + itemBody: WishlistItemBody & { + wishlistToken?: string + } + } +> + +export type ExplicitWishlistRemoveItemHook = RemoveItemHook & { + fetcherInput: { wishlistToken?: string } + body: { wishlistToken?: string } +} diff --git a/packages/spree/src/utils/convert-spree-error-to-graph-ql-error.ts b/packages/spree/src/utils/convert-spree-error-to-graph-ql-error.ts new file mode 100644 index 000000000..f35a00da5 --- /dev/null +++ b/packages/spree/src/utils/convert-spree-error-to-graph-ql-error.ts @@ -0,0 +1,52 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' +import { errors } from '@spree/storefront-api-v2-sdk' + +const convertSpreeErrorToGraphQlError = ( + error: errors.SpreeError +): FetcherError => { + if (error instanceof errors.ExpandedSpreeError) { + // Assuming error.errors[key] is a list of strings. + + if ('base' in error.errors) { + const baseErrorMessage = error.errors.base as unknown as string + + return new FetcherError({ + status: error.serverResponse.status, + message: baseErrorMessage, + }) + } + + const fetcherErrors = Object.keys(error.errors).map((sdkErrorKey) => { + const errors = error.errors[sdkErrorKey] as string[] + + // Naively assume sdkErrorKey is a label. Capitalize it for a better + // out-of-the-box experience. + const capitalizedSdkErrorKey = sdkErrorKey.replace(/^\w/, (firstChar) => + firstChar.toUpperCase() + ) + + return { + message: `${capitalizedSdkErrorKey} ${errors.join(', ')}`, + } + }) + + return new FetcherError({ + status: error.serverResponse.status, + errors: fetcherErrors, + }) + } + + if (error instanceof errors.BasicSpreeError) { + return new FetcherError({ + status: error.serverResponse.status, + message: error.summary, + }) + } + + return new FetcherError({ + status: error.serverResponse.status, + message: error.message, + }) +} + +export default convertSpreeErrorToGraphQlError diff --git a/packages/spree/src/utils/create-customized-fetch-fetcher.ts b/packages/spree/src/utils/create-customized-fetch-fetcher.ts new file mode 100644 index 000000000..f0821c19a --- /dev/null +++ b/packages/spree/src/utils/create-customized-fetch-fetcher.ts @@ -0,0 +1,109 @@ +import { + errors, + request as spreeSdkRequestHelpers, +} from '@spree/storefront-api-v2-sdk' +import type { CreateCustomizedFetchFetcher } from '@spree/storefront-api-v2-sdk/types/interfaces/CreateCustomizedFetchFetcher' +import isJsonContentType from './is-json-content-type' + +export const fetchResponseKey = Symbol('fetch-response-key') + +const createCustomizedFetchFetcher: CreateCustomizedFetchFetcher = ( + fetcherOptions +) => { + const { FetchError } = errors + const sharedHeaders = { + 'Content-Type': 'application/json', + } + + const { host, fetch, requestConstructor } = fetcherOptions + + return { + fetch: async (fetchOptions) => { + // This fetcher always returns request equal null, + // because @vercel/fetch doesn't accept a Request object as argument + // and it's not used by NJC anyway. + try { + const { url, params, method, headers, responseParsing } = fetchOptions + const absoluteUrl = new URL(url, host) + let payload + + switch (method.toUpperCase()) { + case 'PUT': + case 'POST': + case 'DELETE': + case 'PATCH': + payload = { body: JSON.stringify(params) } + break + default: + payload = null + absoluteUrl.search = + spreeSdkRequestHelpers.objectToQuerystring(params) + } + + const request: Request = new requestConstructor( + absoluteUrl.toString(), + { + method: method.toUpperCase(), + headers: { ...sharedHeaders, ...headers }, + ...payload, + } + ) + + try { + console.info( + `Calling the Spree API: ${request.method} ${request.url}` + ) + + const response: Response = await fetch(request) + const responseContentType = response.headers.get('content-type') + let data + + if (responseParsing === 'automatic') { + if (responseContentType && isJsonContentType(responseContentType)) { + data = await response.json() + } else { + data = await response.text() + } + } else if (responseParsing === 'text') { + data = await response.text() + } else if (responseParsing === 'json') { + data = await response.json() + } else if (responseParsing === 'stream') { + data = await response.body + } + + if (!response.ok) { + // Use the "traditional" approach and reject non 2xx responses. + throw new FetchError(response, request, data) + } + + data[fetchResponseKey] = response + + return { data } + } catch (error) { + if (error instanceof FetchError) { + throw error + } + + if (!(error instanceof Error)) { + throw error + } + + throw new FetchError(null, request, null, error.message) + } + } catch (error) { + if (error instanceof FetchError) { + throw error + } + + if (!(error instanceof Error)) { + throw error + } + + throw new FetchError(null, null, null, error.message) + } + }, + } +} + +export default createCustomizedFetchFetcher diff --git a/packages/spree/src/utils/create-empty-cart.ts b/packages/spree/src/utils/create-empty-cart.ts new file mode 100644 index 000000000..efbd687f3 --- /dev/null +++ b/packages/spree/src/utils/create-empty-cart.ts @@ -0,0 +1,22 @@ +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { HookFetcherContext } from '@vercel/commerce/utils/types' +import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' +import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import ensureIToken from './tokens/ensure-itoken' + +const createEmptyCart = ( + fetch: HookFetcherContext<{ + data: any + }>['fetch'] +): Promise> => { + const token: IToken | undefined = ensureIToken() + + return fetch>({ + variables: { + methodPath: 'cart.create', + arguments: [token], + }, + }) +} + +export default createEmptyCart diff --git a/packages/spree/src/utils/create-get-absolute-image-url.ts b/packages/spree/src/utils/create-get-absolute-image-url.ts new file mode 100644 index 000000000..6e9e3260a --- /dev/null +++ b/packages/spree/src/utils/create-get-absolute-image-url.ts @@ -0,0 +1,26 @@ +import { SpreeProductImage } from '../types' +import getImageUrl from './get-image-url' + +const createGetAbsoluteImageUrl = + (host: string, useOriginalImageSize: boolean = true) => + ( + image: SpreeProductImage, + minWidth: number, + minHeight: number + ): string | null => { + let url + + if (useOriginalImageSize) { + url = image.attributes.transformed_url || null + } else { + url = getImageUrl(image, minWidth, minHeight) + } + + if (url === null) { + return null + } + + return `${host}${url}` + } + +export default createGetAbsoluteImageUrl diff --git a/packages/spree/src/utils/expand-options.ts b/packages/spree/src/utils/expand-options.ts new file mode 100644 index 000000000..382ea3b5a --- /dev/null +++ b/packages/spree/src/utils/expand-options.ts @@ -0,0 +1,103 @@ +import type { ProductOptionValues } from '@vercel/commerce/types/product' +import type { + JsonApiDocument, + JsonApiResponse, +} from '@spree/storefront-api-v2-sdk/types/interfaces/JsonApi' +import { jsonApi } from '@spree/storefront-api-v2-sdk' +import type { RelationType } from '@spree/storefront-api-v2-sdk/types/interfaces/Relationships' +import SpreeResponseContentError from '../errors/SpreeResponseContentError' +import type { OptionTypeAttr, ExpandedProductOption } from '../types' +import sortOptionsByPosition from '../utils/sort-option-types' + +const isColorProductOption = (productOption: ExpandedProductOption) => { + return productOption.displayName === 'Color' +} + +const expandOptions = ( + spreeSuccessResponse: JsonApiResponse, + spreeOptionValue: JsonApiDocument, + accumulatedOptions: ExpandedProductOption[] +): ExpandedProductOption[] => { + const spreeOptionTypeIdentifier = spreeOptionValue.relationships.option_type + .data as RelationType + + const existingOptionIndex = accumulatedOptions.findIndex( + (option) => option.id == spreeOptionTypeIdentifier.id + ) + + let option: ExpandedProductOption + + if (existingOptionIndex === -1) { + const spreeOptionType = jsonApi.findDocument( + spreeSuccessResponse, + spreeOptionTypeIdentifier + ) + + if (!spreeOptionType) { + throw new SpreeResponseContentError( + `Option type with id ${spreeOptionTypeIdentifier.id} not found.` + ) + } + + option = { + __typename: 'MultipleChoiceOption', + id: spreeOptionType.id, + displayName: spreeOptionType.attributes.presentation, + position: spreeOptionType.attributes.position, + values: [], + } + } else { + const existingOption = accumulatedOptions[existingOptionIndex] + + option = existingOption + } + + let optionValue: ProductOptionValues + + const label = isColorProductOption(option) + ? spreeOptionValue.attributes.name + : spreeOptionValue.attributes.presentation + + const productOptionValueExists = option.values.some( + (optionValue: ProductOptionValues) => optionValue.label === label + ) + + if (!productOptionValueExists) { + if (isColorProductOption(option)) { + optionValue = { + label, + hexColors: [spreeOptionValue.attributes.presentation], + } + } else { + optionValue = { + label, + } + } + + if (existingOptionIndex === -1) { + return [ + ...accumulatedOptions, + { + ...option, + values: [optionValue], + }, + ] + } + + const expandedOptionValues = [...option.values, optionValue] + const expandedOptions = [...accumulatedOptions] + + expandedOptions[existingOptionIndex] = { + ...option, + values: expandedOptionValues, + } + + const sortedOptions = sortOptionsByPosition(expandedOptions) + + return sortedOptions + } + + return accumulatedOptions +} + +export default expandOptions diff --git a/packages/spree/src/utils/force-isomorphic-config-values.ts b/packages/spree/src/utils/force-isomorphic-config-values.ts new file mode 100644 index 000000000..630b6859e --- /dev/null +++ b/packages/spree/src/utils/force-isomorphic-config-values.ts @@ -0,0 +1,43 @@ +import type { NonUndefined, UnknownObjectValues } from '../types' +import MisconfigurationError from '../errors/MisconfigurationError' +import isServer from './is-server' + +const generateMisconfigurationErrorMessage = ( + keys: Array +) => `${keys.join(', ')} must have a value before running the Framework.` + +const forceIsomorphicConfigValues = < + X extends keyof T, + T extends UnknownObjectValues, + H extends Record> +>( + config: T, + requiredServerKeys: string[], + requiredPublicKeys: X[] +) => { + if (isServer) { + const missingServerConfigValues = requiredServerKeys.filter( + (requiredServerKey) => typeof config[requiredServerKey] === 'undefined' + ) + + if (missingServerConfigValues.length > 0) { + throw new MisconfigurationError( + generateMisconfigurationErrorMessage(missingServerConfigValues) + ) + } + } + + const missingPublicConfigValues = requiredPublicKeys.filter( + (requiredPublicKey) => typeof config[requiredPublicKey] === 'undefined' + ) + + if (missingPublicConfigValues.length > 0) { + throw new MisconfigurationError( + generateMisconfigurationErrorMessage(missingPublicConfigValues) + ) + } + + return config as T & H +} + +export default forceIsomorphicConfigValues diff --git a/packages/spree/src/utils/get-image-url.ts b/packages/spree/src/utils/get-image-url.ts new file mode 100644 index 000000000..8594f5c34 --- /dev/null +++ b/packages/spree/src/utils/get-image-url.ts @@ -0,0 +1,44 @@ +// Based on https://github.com/spark-solutions/spree2vuestorefront/blob/d88d85ae1bcd2ec99b13b81cd2e3c25600a0216e/src/utils/index.ts + +import type { ImageStyle, SpreeProductImage } from '../types' + +const getImageUrl = ( + image: SpreeProductImage, + minWidth: number, + _: number +): string | null => { + // every image is still resized in vue-storefront-api, no matter what getImageUrl returns + if (image) { + const { + attributes: { styles }, + } = image + const bestStyleIndex = styles.reduce( + (bSIndex: number | null, style: ImageStyle, styleIndex: number) => { + // assuming all images are the same dimensions, just scaled + if (bSIndex === null) { + return 0 + } + const bestStyle = styles[bSIndex] + const widthDiff = +bestStyle.width - minWidth + const minWidthDiff = +style.width - minWidth + if (widthDiff < 0 && minWidthDiff > 0) { + return styleIndex + } + if (widthDiff > 0 && minWidthDiff < 0) { + return bSIndex + } + return Math.abs(widthDiff) < Math.abs(minWidthDiff) + ? bSIndex + : styleIndex + }, + null + ) + + if (bestStyleIndex !== null) { + return styles[bestStyleIndex].url + } + } + return null +} + +export default getImageUrl diff --git a/packages/spree/src/utils/get-media-gallery.ts b/packages/spree/src/utils/get-media-gallery.ts new file mode 100644 index 000000000..dd2dacb29 --- /dev/null +++ b/packages/spree/src/utils/get-media-gallery.ts @@ -0,0 +1,25 @@ +// Based on https://github.com/spark-solutions/spree2vuestorefront/blob/d88d85ae1bcd2ec99b13b81cd2e3c25600a0216e/src/utils/index.ts + +import type { ProductImage } from '@vercel/commerce/types/product' +import type { SpreeProductImage } from '../types' + +const getMediaGallery = ( + images: SpreeProductImage[], + getImageUrl: ( + image: SpreeProductImage, + minWidth: number, + minHeight: number + ) => string | null +) => { + return images.reduce((productImages, _, imageIndex) => { + const url = getImageUrl(images[imageIndex], 800, 800) + + if (url) { + return [...productImages, { url }] + } + + return productImages + }, []) +} + +export default getMediaGallery diff --git a/packages/spree/src/utils/get-product-path.ts b/packages/spree/src/utils/get-product-path.ts new file mode 100644 index 000000000..6749a4a3e --- /dev/null +++ b/packages/spree/src/utils/get-product-path.ts @@ -0,0 +1,7 @@ +import type { ProductSlugAttr } from '../types' + +const getProductPath = (partialSpreeProduct: ProductSlugAttr) => { + return `/${partialSpreeProduct.attributes.slug}` +} + +export default getProductPath diff --git a/packages/spree/src/utils/get-spree-sdk-method-from-endpoint-path.ts b/packages/spree/src/utils/get-spree-sdk-method-from-endpoint-path.ts new file mode 100644 index 000000000..9b87daadc --- /dev/null +++ b/packages/spree/src/utils/get-spree-sdk-method-from-endpoint-path.ts @@ -0,0 +1,61 @@ +import type { Client } from '@spree/storefront-api-v2-sdk' +import SpreeSdkMethodFromEndpointPathError from '../errors/SpreeSdkMethodFromEndpointPathError' +import type { + SpreeSdkMethod, + SpreeSdkResultResponseSuccessType, +} from '../types' + +const getSpreeSdkMethodFromEndpointPath = < + ExactSpreeSdkClientType extends Client, + ResultResponseSuccessType extends SpreeSdkResultResponseSuccessType = SpreeSdkResultResponseSuccessType +>( + client: ExactSpreeSdkClientType, + path: string +): SpreeSdkMethod => { + const pathParts = path.split('.') + const reachedPath: string[] = [] + let node = >client + + console.log(`Looking for ${path} in Spree Sdk.`) + + while (reachedPath.length < pathParts.length - 1) { + const checkedPathPart = pathParts[reachedPath.length] + const checkedNode = node[checkedPathPart] + + console.log(`Checking part ${checkedPathPart}.`) + + if (typeof checkedNode !== 'object') { + throw new SpreeSdkMethodFromEndpointPathError( + `Couldn't reach ${path}. Farthest path reached was: ${reachedPath.join( + '.' + )}.` + ) + } + + if (checkedNode === null) { + throw new SpreeSdkMethodFromEndpointPathError( + `Path ${path} doesn't exist.` + ) + } + + node = >checkedNode + reachedPath.push(checkedPathPart) + } + + const foundEndpointMethod = node[pathParts[reachedPath.length]] + + if ( + reachedPath.length !== pathParts.length - 1 || + typeof foundEndpointMethod !== 'function' + ) { + throw new SpreeSdkMethodFromEndpointPathError( + `Couldn't reach ${path}. Farthest path reached was: ${reachedPath.join( + '.' + )}.` + ) + } + + return foundEndpointMethod.bind(node) +} + +export default getSpreeSdkMethodFromEndpointPath diff --git a/packages/spree/src/utils/handle-token-errors.ts b/packages/spree/src/utils/handle-token-errors.ts new file mode 100644 index 000000000..a5d49fde6 --- /dev/null +++ b/packages/spree/src/utils/handle-token-errors.ts @@ -0,0 +1,14 @@ +import AccessTokenError from '../errors/AccessTokenError' +import RefreshTokenError from '../errors/RefreshTokenError' + +const handleTokenErrors = (error: unknown, action: () => void): boolean => { + if (error instanceof AccessTokenError || error instanceof RefreshTokenError) { + action() + + return true + } + + return false +} + +export default handleTokenErrors diff --git a/packages/spree/src/utils/is-json-content-type.ts b/packages/spree/src/utils/is-json-content-type.ts new file mode 100644 index 000000000..fd82d65fd --- /dev/null +++ b/packages/spree/src/utils/is-json-content-type.ts @@ -0,0 +1,5 @@ +const isJsonContentType = (contentType: string): boolean => + contentType.includes('application/json') || + contentType.includes('application/vnd.api+json') + +export default isJsonContentType diff --git a/packages/spree/src/utils/is-server.ts b/packages/spree/src/utils/is-server.ts new file mode 100644 index 000000000..4544a4884 --- /dev/null +++ b/packages/spree/src/utils/is-server.ts @@ -0,0 +1 @@ +export default typeof window === 'undefined' diff --git a/packages/spree/src/utils/login.ts b/packages/spree/src/utils/login.ts new file mode 100644 index 000000000..13555664a --- /dev/null +++ b/packages/spree/src/utils/login.ts @@ -0,0 +1,58 @@ +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { HookFetcherContext } from '@vercel/commerce/utils/types' +import type { AuthTokenAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Authentication' +import type { AssociateCart } from '@spree/storefront-api-v2-sdk/types/interfaces/endpoints/CartClass' +import type { IOrder } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' +import type { + IOAuthToken, + IToken, +} from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import { getCartToken, removeCartToken } from './tokens/cart-token' +import { setUserTokenResponse } from './tokens/user-token-response' + +const login = async ( + fetch: HookFetcherContext<{ + data: any + }>['fetch'], + getTokenParameters: AuthTokenAttr, + associateGuestCart: boolean +): Promise => { + const { data: spreeGetTokenSuccessResponse } = await fetch< + GraphQLFetcherResult + >({ + variables: { + methodPath: 'authentication.getToken', + arguments: [getTokenParameters], + }, + }) + + setUserTokenResponse(spreeGetTokenSuccessResponse) + + if (associateGuestCart) { + const cartToken = getCartToken() + + if (cartToken) { + // If the user had a cart as guest still use its contents + // after logging in. + const accessToken = spreeGetTokenSuccessResponse.access_token + const token: IToken = { bearerToken: accessToken } + + const associateGuestCartParameters: AssociateCart = { + guest_order_token: cartToken, + } + + await fetch>({ + variables: { + methodPath: 'cart.associateGuestCart', + arguments: [token, associateGuestCartParameters], + }, + }) + + // We no longer need the guest cart token, so let's remove it. + } + } + + removeCartToken() +} + +export default login diff --git a/packages/spree/src/utils/normalizations/normalize-cart.ts b/packages/spree/src/utils/normalizations/normalize-cart.ts new file mode 100644 index 000000000..c5597fd89 --- /dev/null +++ b/packages/spree/src/utils/normalizations/normalize-cart.ts @@ -0,0 +1,211 @@ +import type { + Cart, + LineItem, + ProductVariant, + SelectedOption, +} from '@vercel/commerce/types/cart' +import MissingLineItemVariantError from '../../errors/MissingLineItemVariantError' +import { requireConfigValue } from '../../isomorphic-config' +import type { OrderAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Order' +import type { ProductAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' +import type { Image } from '@vercel/commerce/types/common' +import { jsonApi } from '@spree/storefront-api-v2-sdk' +import createGetAbsoluteImageUrl from '../create-get-absolute-image-url' +import getMediaGallery from '../get-media-gallery' +import type { + LineItemAttr, + OptionTypeAttr, + SpreeProductImage, + SpreeSdkResponse, + VariantAttr, +} from '../../types' + +const placeholderImage = requireConfigValue('lineItemPlaceholderImageUrl') as + | string + | false + +const isColorProductOption = (productOptionType: OptionTypeAttr) => { + return productOptionType.attributes.presentation === 'Color' +} + +const normalizeVariant = ( + spreeSuccessResponse: SpreeSdkResponse, + spreeVariant: VariantAttr +): ProductVariant => { + const spreeProduct = jsonApi.findSingleRelationshipDocument( + spreeSuccessResponse, + spreeVariant, + 'product' + ) + + if (spreeProduct === null) { + throw new MissingLineItemVariantError( + `Couldn't find product for variant with id ${spreeVariant.id}.` + ) + } + + const spreeVariantImageRecords = + jsonApi.findRelationshipDocuments( + spreeSuccessResponse, + spreeVariant, + 'images' + ) + + let lineItemImage + + const variantImage = getMediaGallery( + spreeVariantImageRecords, + createGetAbsoluteImageUrl(requireConfigValue('imageHost') as string) + )[0] + + if (variantImage) { + lineItemImage = variantImage + } else { + const spreeProductImageRecords = + jsonApi.findRelationshipDocuments( + spreeSuccessResponse, + spreeProduct, + 'images' + ) + + const productImage = getMediaGallery( + spreeProductImageRecords, + createGetAbsoluteImageUrl(requireConfigValue('imageHost') as string) + )[0] + + lineItemImage = productImage + } + + const image: Image = + lineItemImage ?? + (placeholderImage === false ? undefined : { url: placeholderImage }) + + return { + id: spreeVariant.id, + sku: spreeVariant.attributes.sku, + name: spreeProduct.attributes.name, + requiresShipping: true, + price: parseFloat(spreeVariant.attributes.price), + listPrice: parseFloat(spreeVariant.attributes.price), + image, + isInStock: spreeVariant.attributes.in_stock, + availableForSale: spreeVariant.attributes.purchasable, + ...(spreeVariant.attributes.weight === '0.0' + ? {} + : { + weight: { + value: parseFloat(spreeVariant.attributes.weight), + unit: 'KILOGRAMS', + }, + }), + // TODO: Add height, width and depth when Measurement type allows distance measurements. + } +} + +const normalizeLineItem = ( + spreeSuccessResponse: SpreeSdkResponse, + spreeLineItem: LineItemAttr +): LineItem => { + const variant = jsonApi.findSingleRelationshipDocument( + spreeSuccessResponse, + spreeLineItem, + 'variant' + ) + + if (variant === null) { + throw new MissingLineItemVariantError( + `Couldn't find variant for line item with id ${spreeLineItem.id}.` + ) + } + + const product = jsonApi.findSingleRelationshipDocument( + spreeSuccessResponse, + variant, + 'product' + ) + + if (product === null) { + throw new MissingLineItemVariantError( + `Couldn't find product for variant with id ${variant.id}.` + ) + } + + // CartItem.tsx expects path without a '/' prefix unlike pages/product/[slug].tsx and others. + const path = `${product.attributes.slug}` + + const spreeOptionValues = jsonApi.findRelationshipDocuments( + spreeSuccessResponse, + variant, + 'option_values' + ) + + const options: SelectedOption[] = spreeOptionValues.map( + (spreeOptionValue) => { + const spreeOptionType = + jsonApi.findSingleRelationshipDocument( + spreeSuccessResponse, + spreeOptionValue, + 'option_type' + ) + + if (spreeOptionType === null) { + throw new MissingLineItemVariantError( + `Couldn't find option type of option value with id ${spreeOptionValue.id}.` + ) + } + + const label = isColorProductOption(spreeOptionType) + ? spreeOptionValue.attributes.name + : spreeOptionValue.attributes.presentation + + return { + id: spreeOptionValue.id, + name: spreeOptionType.attributes.presentation, + value: label, + } + } + ) + + return { + id: spreeLineItem.id, + variantId: variant.id, + productId: product.id, + name: spreeLineItem.attributes.name, + quantity: spreeLineItem.attributes.quantity, + discounts: [], // TODO: Implement when the template starts displaying them. + path, + variant: normalizeVariant(spreeSuccessResponse, variant), + options, + } +} + +const normalizeCart = ( + spreeSuccessResponse: SpreeSdkResponse, + spreeCart: OrderAttr +): Cart => { + const lineItems = jsonApi + .findRelationshipDocuments( + spreeSuccessResponse, + spreeCart, + 'line_items' + ) + .map((lineItem) => normalizeLineItem(spreeSuccessResponse, lineItem)) + + return { + id: spreeCart.id, + createdAt: spreeCart.attributes.created_at.toString(), + currency: { code: spreeCart.attributes.currency }, + taxesIncluded: true, + lineItems, + lineItemsSubtotalPrice: parseFloat(spreeCart.attributes.item_total), + subtotalPrice: parseFloat(spreeCart.attributes.item_total), + totalPrice: parseFloat(spreeCart.attributes.total), + customerId: spreeCart.attributes.token, + email: spreeCart.attributes.email, + discounts: [], // TODO: Implement when the template starts displaying them. + } +} + +export { normalizeLineItem } + +export default normalizeCart diff --git a/packages/spree/src/utils/normalizations/normalize-page.ts b/packages/spree/src/utils/normalizations/normalize-page.ts new file mode 100644 index 000000000..a2464ffd9 --- /dev/null +++ b/packages/spree/src/utils/normalizations/normalize-page.ts @@ -0,0 +1,42 @@ +import { Page } from '@vercel/commerce/types/page' +import type { PageAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Page' +import { SpreeSdkResponse } from '../../types' + +const normalizePage = ( + _spreeSuccessResponse: SpreeSdkResponse, + spreePage: PageAttr, + commerceLocales: string[] +): Page => { + // If the locale returned by Spree is not available, search + // for a similar one. + + const spreeLocale = spreePage.attributes.locale + let usedCommerceLocale: string + + if (commerceLocales.includes(spreeLocale)) { + usedCommerceLocale = spreeLocale + } else { + const genericSpreeLocale = spreeLocale.split('-')[0] + + const foundExactGenericLocale = commerceLocales.includes(genericSpreeLocale) + + if (foundExactGenericLocale) { + usedCommerceLocale = genericSpreeLocale + } else { + const foundSimilarLocale = commerceLocales.find((locale) => { + return locale.split('-')[0] === genericSpreeLocale + }) + + usedCommerceLocale = foundSimilarLocale || spreeLocale + } + } + + return { + id: spreePage.id, + name: spreePage.attributes.title, + url: `/${usedCommerceLocale}/${spreePage.attributes.slug}`, + body: spreePage.attributes.content, + } +} + +export default normalizePage diff --git a/packages/spree/src/utils/normalizations/normalize-product.ts b/packages/spree/src/utils/normalizations/normalize-product.ts new file mode 100644 index 000000000..6965f0197 --- /dev/null +++ b/packages/spree/src/utils/normalizations/normalize-product.ts @@ -0,0 +1,240 @@ +import type { + Product, + ProductImage, + ProductPrice, + ProductVariant, +} from '@vercel/commerce/types/product' +import type { ProductAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' +import type { RelationType } from '@spree/storefront-api-v2-sdk/types/interfaces/Relationships' +import { jsonApi } from '@spree/storefront-api-v2-sdk' +import { JsonApiDocument } from '@spree/storefront-api-v2-sdk/types/interfaces/JsonApi' +import { requireConfigValue } from '../../isomorphic-config' +import createGetAbsoluteImageUrl from '../create-get-absolute-image-url' +import expandOptions from '../expand-options' +import getMediaGallery from '../get-media-gallery' +import getProductPath from '../get-product-path' +import MissingPrimaryVariantError from '../../errors/MissingPrimaryVariantError' +import MissingOptionValueError from '../../errors/MissingOptionValueError' +import type { + ExpandedProductOption, + SpreeSdkResponse, + VariantAttr, +} from '../../types' + +const placeholderImage = requireConfigValue('productPlaceholderImageUrl') as + | string + | false + +const imagesOptionFilter = requireConfigValue('imagesOptionFilter') as + | string + | false + +const normalizeProduct = ( + spreeSuccessResponse: SpreeSdkResponse, + spreeProduct: ProductAttr +): Product => { + const spreePrimaryVariant = + jsonApi.findSingleRelationshipDocument( + spreeSuccessResponse, + spreeProduct, + 'primary_variant' + ) + + if (spreePrimaryVariant === null) { + throw new MissingPrimaryVariantError( + `Couldn't find primary variant for product with id ${spreeProduct.id}.` + ) + } + + const sku = spreePrimaryVariant.attributes.sku + + const price: ProductPrice = { + value: parseFloat(spreeProduct.attributes.price), + currencyCode: spreeProduct.attributes.currency, + } + + const hasNonMasterVariants = + (spreeProduct.relationships.variants.data as RelationType[]).length > 1 + + const showOptions = + (requireConfigValue('showSingleVariantOptions') as boolean) || + hasNonMasterVariants + + let options: ExpandedProductOption[] = [] + + const spreeVariantRecords = jsonApi.findRelationshipDocuments( + spreeSuccessResponse, + spreeProduct, + 'variants' + ) + + // Use variants with option values if available. Fall back to + // Spree primary_variant if no explicit variants are present. + const spreeOptionsVariantsOrPrimary = + spreeVariantRecords.length === 0 + ? [spreePrimaryVariant] + : spreeVariantRecords + + const variants: ProductVariant[] = spreeOptionsVariantsOrPrimary.map( + (spreeVariantRecord) => { + let variantOptions: ExpandedProductOption[] = [] + + if (showOptions) { + const spreeOptionValues = jsonApi.findRelationshipDocuments( + spreeSuccessResponse, + spreeVariantRecord, + 'option_values' + ) + + // Only include options which are used by variants. + + spreeOptionValues.forEach((spreeOptionValue) => { + variantOptions = expandOptions( + spreeSuccessResponse, + spreeOptionValue, + variantOptions + ) + + options = expandOptions( + spreeSuccessResponse, + spreeOptionValue, + options + ) + }) + } + + return { + id: spreeVariantRecord.id, + options: variantOptions, + } + } + ) + + const spreePrimaryVariantImageRecords = jsonApi.findRelationshipDocuments( + spreeSuccessResponse, + spreePrimaryVariant, + 'images' + ) + + let spreeVariantImageRecords: JsonApiDocument[] + + if (imagesOptionFilter === false) { + spreeVariantImageRecords = spreeVariantRecords.reduce( + (accumulatedImageRecords, spreeVariantRecord) => { + return [ + ...accumulatedImageRecords, + ...jsonApi.findRelationshipDocuments( + spreeSuccessResponse, + spreeVariantRecord, + 'images' + ), + ] + }, + [] + ) + } else { + const spreeOptionTypes = jsonApi.findRelationshipDocuments( + spreeSuccessResponse, + spreeProduct, + 'option_types' + ) + + const imagesFilterOptionType = spreeOptionTypes.find( + (spreeOptionType) => + spreeOptionType.attributes.name === imagesOptionFilter + ) + + if (!imagesFilterOptionType) { + console.warn( + `Couldn't find option type having name ${imagesOptionFilter} for product with id ${spreeProduct.id}.` + + ' Showing no images for this product.' + ) + + spreeVariantImageRecords = [] + } else { + const imagesOptionTypeFilterId = imagesFilterOptionType.id + const includedOptionValuesImagesIds: string[] = [] + + spreeVariantImageRecords = spreeVariantRecords.reduce( + (accumulatedImageRecords, spreeVariantRecord) => { + const spreeVariantOptionValuesIdentifiers: RelationType[] = + spreeVariantRecord.relationships.option_values.data + + const spreeOptionValueOfFilterTypeIdentifier = + spreeVariantOptionValuesIdentifiers.find( + (spreeVariantOptionValuesIdentifier: RelationType) => + imagesFilterOptionType.relationships.option_values.data.some( + (filterOptionTypeValueIdentifier: RelationType) => + filterOptionTypeValueIdentifier.id === + spreeVariantOptionValuesIdentifier.id + ) + ) + + if (!spreeOptionValueOfFilterTypeIdentifier) { + throw new MissingOptionValueError( + `Couldn't find option value related to option type with id ${imagesOptionTypeFilterId}.` + ) + } + + const optionValueImagesAlreadyIncluded = + includedOptionValuesImagesIds.includes( + spreeOptionValueOfFilterTypeIdentifier.id + ) + + if (optionValueImagesAlreadyIncluded) { + return accumulatedImageRecords + } + + includedOptionValuesImagesIds.push( + spreeOptionValueOfFilterTypeIdentifier.id + ) + + return [ + ...accumulatedImageRecords, + ...jsonApi.findRelationshipDocuments( + spreeSuccessResponse, + spreeVariantRecord, + 'images' + ), + ] + }, + [] + ) + } + } + + const spreeImageRecords = [ + ...spreePrimaryVariantImageRecords, + ...spreeVariantImageRecords, + ] + + const productImages = getMediaGallery( + spreeImageRecords, + createGetAbsoluteImageUrl(requireConfigValue('imageHost') as string) + ) + + const images: ProductImage[] = + productImages.length === 0 + ? placeholderImage === false + ? [] + : [{ url: placeholderImage }] + : productImages + + const slug = spreeProduct.attributes.slug + const path = getProductPath(spreeProduct) + + return { + id: spreeProduct.id, + name: spreeProduct.attributes.name, + description: spreeProduct.attributes.description, + images, + variants, + options, + price, + slug, + path, + sku, + } +} + +export default normalizeProduct diff --git a/packages/spree/src/utils/normalizations/normalize-user.ts b/packages/spree/src/utils/normalizations/normalize-user.ts new file mode 100644 index 000000000..8b738fbaf --- /dev/null +++ b/packages/spree/src/utils/normalizations/normalize-user.ts @@ -0,0 +1,16 @@ +import type { Customer } from '@vercel/commerce/types/customer' +import type { AccountAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Account' +import type { SpreeSdkResponse } from '../../types' + +const normalizeUser = ( + _spreeSuccessResponse: SpreeSdkResponse, + spreeUser: AccountAttr +): Customer => { + const email = spreeUser.attributes.email + + return { + email, + } +} + +export default normalizeUser diff --git a/packages/spree/src/utils/normalizations/normalize-wishlist.ts b/packages/spree/src/utils/normalizations/normalize-wishlist.ts new file mode 100644 index 000000000..c9cfee2db --- /dev/null +++ b/packages/spree/src/utils/normalizations/normalize-wishlist.ts @@ -0,0 +1,68 @@ +import MissingProductError from '../../errors/MissingProductError' +import MissingVariantError from '../../errors/MissingVariantError' +import { jsonApi } from '@spree/storefront-api-v2-sdk' +import type { ProductAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Product' +import type { WishedItemAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/WishedItem' +import type { WishlistAttr } from '@spree/storefront-api-v2-sdk/types/interfaces/Wishlist' +import type { + ExplicitCommerceWishlist, + SpreeSdkResponse, + VariantAttr, +} from '../../types' +import normalizeProduct from './normalize-product' + +const normalizeWishlist = ( + spreeSuccessResponse: SpreeSdkResponse, + spreeWishlist: WishlistAttr +): ExplicitCommerceWishlist => { + const spreeWishedItems = jsonApi.findRelationshipDocuments( + spreeSuccessResponse, + spreeWishlist, + 'wished_items' + ) + + const items: ExplicitCommerceWishlist['items'] = spreeWishedItems.map( + (spreeWishedItem) => { + const spreeWishedVariant = + jsonApi.findSingleRelationshipDocument( + spreeSuccessResponse, + spreeWishedItem, + 'variant' + ) + + if (spreeWishedVariant === null) { + throw new MissingVariantError( + `Couldn't find variant for wished item with id ${spreeWishedItem.id}.` + ) + } + + const spreeWishedProduct = + jsonApi.findSingleRelationshipDocument( + spreeSuccessResponse, + spreeWishedVariant, + 'product' + ) + + if (spreeWishedProduct === null) { + throw new MissingProductError( + `Couldn't find product for variant with id ${spreeWishedVariant.id}.` + ) + } + + return { + id: spreeWishedItem.id, + product_id: parseInt(spreeWishedProduct.id, 10), + variant_id: parseInt(spreeWishedVariant.id, 10), + product: normalizeProduct(spreeSuccessResponse, spreeWishedProduct), + } + } + ) + + return { + id: spreeWishlist.id, + token: spreeWishlist.attributes.token, + items, + } +} + +export default normalizeWishlist diff --git a/packages/spree/src/utils/pretty-print-spree-sdk-errors.ts b/packages/spree/src/utils/pretty-print-spree-sdk-errors.ts new file mode 100644 index 000000000..791742046 --- /dev/null +++ b/packages/spree/src/utils/pretty-print-spree-sdk-errors.ts @@ -0,0 +1,21 @@ +import { errors } from '@spree/storefront-api-v2-sdk' + +const prettyPrintSpreeSdkErrors = (error: errors.SpreeSDKError): string => { + let prettyOutput = `Name: ${error.name}\nMessage: ${error.message}` + + if (error instanceof errors.BasicSpreeError) { + prettyOutput += `\nSpree summary: ${error.summary}` + + if (error instanceof errors.ExpandedSpreeError) { + prettyOutput += `\nSpree validation errors:\n${JSON.stringify( + error.errors, + null, + 2 + )}` + } + } + + return prettyOutput +} + +export default prettyPrintSpreeSdkErrors diff --git a/packages/spree/src/utils/require-config.ts b/packages/spree/src/utils/require-config.ts new file mode 100644 index 000000000..92b7916ca --- /dev/null +++ b/packages/spree/src/utils/require-config.ts @@ -0,0 +1,16 @@ +import MissingConfigurationValueError from '../errors/MissingConfigurationValueError' +import type { NonUndefined, ValueOf } from '../types' + +const requireConfig = (isomorphicConfig: T, key: keyof T) => { + const valueUnderKey = isomorphicConfig[key] + + if (typeof valueUnderKey === 'undefined') { + throw new MissingConfigurationValueError( + `Value for configuration key ${key} was undefined.` + ) + } + + return valueUnderKey as NonUndefined> +} + +export default requireConfig diff --git a/packages/spree/src/utils/sort-option-types.ts b/packages/spree/src/utils/sort-option-types.ts new file mode 100644 index 000000000..bac632e09 --- /dev/null +++ b/packages/spree/src/utils/sort-option-types.ts @@ -0,0 +1,11 @@ +import type { ExpandedProductOption } from '../types' + +const sortOptionsByPosition = ( + options: ExpandedProductOption[] +): ExpandedProductOption[] => { + return options.sort((firstOption, secondOption) => { + return firstOption.position - secondOption.position + }) +} + +export default sortOptionsByPosition diff --git a/packages/spree/src/utils/tokens/cart-token.ts b/packages/spree/src/utils/tokens/cart-token.ts new file mode 100644 index 000000000..8352f9ada --- /dev/null +++ b/packages/spree/src/utils/tokens/cart-token.ts @@ -0,0 +1,21 @@ +import { requireConfigValue } from '../../isomorphic-config' +import Cookies from 'js-cookie' + +export const getCartToken = () => + Cookies.get(requireConfigValue('cartCookieName') as string) + +export const setCartToken = (cartToken: string) => { + const cookieOptions = { + expires: requireConfigValue('cartCookieExpire') as number, + } + + Cookies.set( + requireConfigValue('cartCookieName') as string, + cartToken, + cookieOptions + ) +} + +export const removeCartToken = () => { + Cookies.remove(requireConfigValue('cartCookieName') as string) +} diff --git a/packages/spree/src/utils/tokens/ensure-fresh-user-access-token.ts b/packages/spree/src/utils/tokens/ensure-fresh-user-access-token.ts new file mode 100644 index 000000000..de22634fb --- /dev/null +++ b/packages/spree/src/utils/tokens/ensure-fresh-user-access-token.ts @@ -0,0 +1,51 @@ +import { SpreeSdkResponseWithRawResponse } from '../../types' +import type { Client } from '@spree/storefront-api-v2-sdk' +import type { IOAuthToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import getSpreeSdkMethodFromEndpointPath from '../get-spree-sdk-method-from-endpoint-path' +import { + ensureUserTokenResponse, + removeUserTokenResponse, + setUserTokenResponse, +} from './user-token-response' +import AccessTokenError from '../../errors/AccessTokenError' + +/** + * If the user has a saved access token, make sure it's not expired + * If it is expired, attempt to refresh it. + */ +const ensureFreshUserAccessToken = async (client: Client): Promise => { + const userTokenResponse = ensureUserTokenResponse() + + if (!userTokenResponse) { + // There's no user token or it has an invalid format. + return + } + + const isAccessTokenExpired = + (userTokenResponse.created_at + userTokenResponse.expires_in) * 1000 < + Date.now() + + if (!isAccessTokenExpired) { + return + } + + const spreeRefreshAccessTokenSdkMethod = getSpreeSdkMethodFromEndpointPath< + Client, + SpreeSdkResponseWithRawResponse & IOAuthToken + >(client, 'authentication.refreshToken') + + const spreeRefreshAccessTokenResponse = + await spreeRefreshAccessTokenSdkMethod({ + refresh_token: userTokenResponse.refresh_token, + }) + + if (spreeRefreshAccessTokenResponse.isFail()) { + removeUserTokenResponse() + + throw new AccessTokenError('Could not refresh access token.') + } + + setUserTokenResponse(spreeRefreshAccessTokenResponse.success()) +} + +export default ensureFreshUserAccessToken diff --git a/packages/spree/src/utils/tokens/ensure-itoken.ts b/packages/spree/src/utils/tokens/ensure-itoken.ts new file mode 100644 index 000000000..0d4e6f899 --- /dev/null +++ b/packages/spree/src/utils/tokens/ensure-itoken.ts @@ -0,0 +1,25 @@ +import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import { getCartToken } from './cart-token' +import { ensureUserTokenResponse } from './user-token-response' + +const ensureIToken = (): IToken | undefined => { + const userTokenResponse = ensureUserTokenResponse() + + if (userTokenResponse) { + return { + bearerToken: userTokenResponse.access_token, + } + } + + const cartToken = getCartToken() + + if (cartToken) { + return { + orderToken: cartToken, + } + } + + return undefined +} + +export default ensureIToken diff --git a/packages/spree/src/utils/tokens/is-logged-in.ts b/packages/spree/src/utils/tokens/is-logged-in.ts new file mode 100644 index 000000000..218c25bdd --- /dev/null +++ b/packages/spree/src/utils/tokens/is-logged-in.ts @@ -0,0 +1,9 @@ +import { ensureUserTokenResponse } from './user-token-response' + +const isLoggedIn = (): boolean => { + const userTokenResponse = ensureUserTokenResponse() + + return !!userTokenResponse +} + +export default isLoggedIn diff --git a/packages/spree/src/utils/tokens/revoke-user-tokens.ts b/packages/spree/src/utils/tokens/revoke-user-tokens.ts new file mode 100644 index 000000000..82133542f --- /dev/null +++ b/packages/spree/src/utils/tokens/revoke-user-tokens.ts @@ -0,0 +1,49 @@ +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { HookFetcherContext } from '@vercel/commerce/utils/types' +import TokensNotRejectedError from '../../errors/TokensNotRejectedError' +import type { UserOAuthTokens } from '../../types' +import type { EmptyObjectResponse } from '@spree/storefront-api-v2-sdk/types/interfaces/EmptyObject' + +const revokeUserTokens = async ( + fetch: HookFetcherContext<{ + data: any + }>['fetch'], + userTokens: UserOAuthTokens +): Promise => { + const spreeRevokeTokensResponses = await Promise.allSettled([ + fetch>({ + variables: { + methodPath: 'authentication.revokeToken', + arguments: [ + { + token: userTokens.refreshToken, + }, + ], + }, + }), + fetch>({ + variables: { + methodPath: 'authentication.revokeToken', + arguments: [ + { + token: userTokens.accessToken, + }, + ], + }, + }), + ]) + + const anyRejected = spreeRevokeTokensResponses.some( + (response) => response.status === 'rejected' + ) + + if (anyRejected) { + throw new TokensNotRejectedError( + 'Some tokens could not be rejected in Spree.' + ) + } + + return undefined +} + +export default revokeUserTokens diff --git a/packages/spree/src/utils/tokens/user-token-response.ts b/packages/spree/src/utils/tokens/user-token-response.ts new file mode 100644 index 000000000..0c524eccf --- /dev/null +++ b/packages/spree/src/utils/tokens/user-token-response.ts @@ -0,0 +1,58 @@ +import { requireConfigValue } from '../../isomorphic-config' +import Cookies from 'js-cookie' +import type { IOAuthToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import UserTokenResponseParseError from '../../errors/UserTokenResponseParseError' + +export const getUserTokenResponse = (): IOAuthToken | undefined => { + const stringifiedToken = Cookies.get( + requireConfigValue('userCookieName') as string + ) + + if (!stringifiedToken) { + return undefined + } + + try { + const token: IOAuthToken = JSON.parse(stringifiedToken) + + return token + } catch (parseError) { + throw new UserTokenResponseParseError( + 'Could not parse stored user token response.' + ) + } +} + +/** + * Retrieves the saved user token response. If the response fails json parsing, + * removes the saved token and returns @type {undefined} instead. + */ +export const ensureUserTokenResponse = (): IOAuthToken | undefined => { + try { + return getUserTokenResponse() + } catch (error) { + if (error instanceof UserTokenResponseParseError) { + removeUserTokenResponse() + + return undefined + } + + throw error + } +} + +export const setUserTokenResponse = (token: IOAuthToken) => { + const cookieOptions = { + expires: requireConfigValue('userCookieExpire') as number, + } + + Cookies.set( + requireConfigValue('userCookieName') as string, + JSON.stringify(token), + cookieOptions + ) +} + +export const removeUserTokenResponse = () => { + Cookies.remove(requireConfigValue('userCookieName') as string) +} diff --git a/packages/spree/src/utils/validations/validate-all-products-taxonomy-id.ts b/packages/spree/src/utils/validations/validate-all-products-taxonomy-id.ts new file mode 100644 index 000000000..5eaaa0b4b --- /dev/null +++ b/packages/spree/src/utils/validations/validate-all-products-taxonomy-id.ts @@ -0,0 +1,13 @@ +const validateAllProductsTaxonomyId = (taxonomyId: unknown): string | false => { + if (!taxonomyId || taxonomyId === 'false') { + return false + } + + if (typeof taxonomyId === 'string') { + return taxonomyId + } + + throw new TypeError('taxonomyId must be a string or falsy.') +} + +export default validateAllProductsTaxonomyId diff --git a/packages/spree/src/utils/validations/validate-cookie-expire.ts b/packages/spree/src/utils/validations/validate-cookie-expire.ts new file mode 100644 index 000000000..1bd987273 --- /dev/null +++ b/packages/spree/src/utils/validations/validate-cookie-expire.ts @@ -0,0 +1,21 @@ +const validateCookieExpire = (expire: unknown): number => { + let expireInteger: number + + if (typeof expire === 'string') { + expireInteger = parseFloat(expire) + } else if (typeof expire === 'number') { + expireInteger = expire + } else { + throw new TypeError( + 'expire must be a string containing a number or an integer.' + ) + } + + if (expireInteger < 0) { + throw new RangeError('expire must be non-negative.') + } + + return expireInteger +} + +export default validateCookieExpire diff --git a/packages/spree/src/utils/validations/validate-images-option-filter.ts b/packages/spree/src/utils/validations/validate-images-option-filter.ts new file mode 100644 index 000000000..8b6ef9892 --- /dev/null +++ b/packages/spree/src/utils/validations/validate-images-option-filter.ts @@ -0,0 +1,15 @@ +const validateImagesOptionFilter = ( + optionTypeNameOrFalse: unknown +): string | false => { + if (!optionTypeNameOrFalse || optionTypeNameOrFalse === 'false') { + return false + } + + if (typeof optionTypeNameOrFalse === 'string') { + return optionTypeNameOrFalse + } + + throw new TypeError('optionTypeNameOrFalse must be a string or falsy.') +} + +export default validateImagesOptionFilter diff --git a/packages/spree/src/utils/validations/validate-images-quality.ts b/packages/spree/src/utils/validations/validate-images-quality.ts new file mode 100644 index 000000000..909caad57 --- /dev/null +++ b/packages/spree/src/utils/validations/validate-images-quality.ts @@ -0,0 +1,23 @@ +const validateImagesQuality = (quality: unknown): number => { + let quality_level: number + + if (typeof quality === 'string') { + quality_level = parseInt(quality) + } else if (typeof quality === 'number') { + quality_level = quality + } else { + throw new TypeError( + 'prerenderCount count must be a string containing a number or an integer.' + ) + } + + if (quality_level === NaN) { + throw new TypeError( + 'prerenderCount count must be a string containing a number or an integer.' + ) + } + + return quality_level +} + +export default validateImagesQuality diff --git a/packages/spree/src/utils/validations/validate-images-size.ts b/packages/spree/src/utils/validations/validate-images-size.ts new file mode 100644 index 000000000..e02036dad --- /dev/null +++ b/packages/spree/src/utils/validations/validate-images-size.ts @@ -0,0 +1,13 @@ +const validateImagesSize = (size: unknown): string => { + if (typeof size !== 'string') { + throw new TypeError('size must be a string.') + } + + if (!size.includes('x') || size.split('x').length != 2) { + throw new Error("size must have two numbers separated with an 'x'") + } + + return size +} + +export default validateImagesSize diff --git a/packages/spree/src/utils/validations/validate-placeholder-image-url.ts b/packages/spree/src/utils/validations/validate-placeholder-image-url.ts new file mode 100644 index 000000000..cce2e27da --- /dev/null +++ b/packages/spree/src/utils/validations/validate-placeholder-image-url.ts @@ -0,0 +1,15 @@ +const validatePlaceholderImageUrl = ( + placeholderUrlOrFalse: unknown +): string | false => { + if (!placeholderUrlOrFalse || placeholderUrlOrFalse === 'false') { + return false + } + + if (typeof placeholderUrlOrFalse === 'string') { + return placeholderUrlOrFalse + } + + throw new TypeError('placeholderUrlOrFalse must be a string or falsy.') +} + +export default validatePlaceholderImageUrl diff --git a/packages/spree/src/utils/validations/validate-products-prerender-count.ts b/packages/spree/src/utils/validations/validate-products-prerender-count.ts new file mode 100644 index 000000000..024db1ea6 --- /dev/null +++ b/packages/spree/src/utils/validations/validate-products-prerender-count.ts @@ -0,0 +1,21 @@ +const validateProductsPrerenderCount = (prerenderCount: unknown): number => { + let prerenderCountInteger: number + + if (typeof prerenderCount === 'string') { + prerenderCountInteger = parseInt(prerenderCount) + } else if (typeof prerenderCount === 'number') { + prerenderCountInteger = prerenderCount + } else { + throw new TypeError( + 'prerenderCount count must be a string containing a number or an integer.' + ) + } + + if (prerenderCountInteger < 0) { + throw new RangeError('prerenderCount must be non-negative.') + } + + return prerenderCountInteger +} + +export default validateProductsPrerenderCount diff --git a/packages/spree/src/wishlist/index.ts b/packages/spree/src/wishlist/index.ts new file mode 100644 index 000000000..241af3c7e --- /dev/null +++ b/packages/spree/src/wishlist/index.ts @@ -0,0 +1,3 @@ +export { default as useAddItem } from './use-add-item' +export { default as useWishlist } from './use-wishlist' +export { default as useRemoveItem } from './use-remove-item' diff --git a/packages/spree/src/wishlist/use-add-item.tsx b/packages/spree/src/wishlist/use-add-item.tsx new file mode 100644 index 000000000..010a71e7d --- /dev/null +++ b/packages/spree/src/wishlist/use-add-item.tsx @@ -0,0 +1,88 @@ +import { useCallback } from 'react' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useAddItem from '@vercel/commerce/wishlist/use-add-item' +import type { UseAddItem } from '@vercel/commerce/wishlist/use-add-item' +import useWishlist from './use-wishlist' +import type { ExplicitWishlistAddItemHook } from '../types' +import type { + WishedItem, + WishlistsAddWishedItem, +} from '@spree/storefront-api-v2-sdk/types/interfaces/WishedItem' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import ensureIToken from '../utils/tokens/ensure-itoken' +import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import type { AddItemHook } from '@vercel/commerce/types/wishlist' +import isLoggedIn from '../utils/tokens/is-logged-in' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + url: 'wishlists', + query: 'addWishedItem', + }, + async fetcher({ input, options, fetch }) { + console.info( + 'useAddItem (wishlist) fetcher called. Configuration: ', + 'input: ', + input, + 'options: ', + options + ) + + const { + item: { productId, variantId, wishlistToken }, + } = input + + if (!isLoggedIn() || !wishlistToken) { + return null + } + + let token: IToken | undefined = ensureIToken() + + const addItemParameters: WishlistsAddWishedItem = { + variant_id: `${variantId}`, + quantity: 1, + } + + await fetch>({ + variables: { + methodPath: 'wishlists.addWishedItem', + arguments: [token, wishlistToken, addItemParameters], + }, + }) + + return null + }, + useHook: ({ fetch }) => { + const useWrappedHook: ReturnType< + MutationHook['useHook'] + > = () => { + const wishlist = useWishlist() + + return useCallback( + async (item) => { + if (!wishlist.data) { + return null + } + + const data = await fetch({ + input: { + item: { + ...item, + wishlistToken: wishlist.data.token, + }, + }, + }) + + await wishlist.mutate() + + return data + }, + [wishlist] + ) + } + + return useWrappedHook + }, +} diff --git a/packages/spree/src/wishlist/use-remove-item.tsx b/packages/spree/src/wishlist/use-remove-item.tsx new file mode 100644 index 000000000..d8481f5a3 --- /dev/null +++ b/packages/spree/src/wishlist/use-remove-item.tsx @@ -0,0 +1,75 @@ +import { useCallback } from 'react' +import type { MutationHook } from '@vercel/commerce/utils/types' +import useRemoveItem from '@vercel/commerce/wishlist/use-remove-item' +import type { UseRemoveItem } from '@vercel/commerce/wishlist/use-remove-item' +import useWishlist from './use-wishlist' +import type { ExplicitWishlistRemoveItemHook } from '../types' +import isLoggedIn from '../utils/tokens/is-logged-in' +import ensureIToken from '../utils/tokens/ensure-itoken' +import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { WishedItem } from '@spree/storefront-api-v2-sdk/types/interfaces/WishedItem' + +export default useRemoveItem as UseRemoveItem + +export const handler: MutationHook = { + fetchOptions: { + url: 'wishlists', + query: 'removeWishedItem', + }, + async fetcher({ input, options, fetch }) { + console.info( + 'useRemoveItem (wishlist) fetcher called. Configuration: ', + 'input: ', + input, + 'options: ', + options + ) + + const { itemId, wishlistToken } = input + + if (!isLoggedIn() || !wishlistToken) { + return null + } + + let token: IToken | undefined = ensureIToken() + + await fetch>({ + variables: { + methodPath: 'wishlists.removeWishedItem', + arguments: [token, wishlistToken, itemId], + }, + }) + + return null + }, + useHook: ({ fetch }) => { + const useWrappedHook: ReturnType< + MutationHook['useHook'] + > = () => { + const wishlist = useWishlist() + + return useCallback( + async (input) => { + if (!wishlist.data) { + return null + } + + const data = await fetch({ + input: { + itemId: `${input.id}`, + wishlistToken: wishlist.data.token, + }, + }) + + await wishlist.mutate() + + return data + }, + [wishlist] + ) + } + + return useWrappedHook + }, +} diff --git a/packages/spree/src/wishlist/use-wishlist.tsx b/packages/spree/src/wishlist/use-wishlist.tsx new file mode 100644 index 000000000..9f258625e --- /dev/null +++ b/packages/spree/src/wishlist/use-wishlist.tsx @@ -0,0 +1,93 @@ +import { useMemo } from 'react' +import type { SWRHook } from '@vercel/commerce/utils/types' +import useWishlist from '@vercel/commerce/wishlist/use-wishlist' +import type { UseWishlist } from '@vercel/commerce/wishlist/use-wishlist' +import type { GetWishlistHook } from '@vercel/commerce/types/wishlist' +import type { IToken } from '@spree/storefront-api-v2-sdk/types/interfaces/Token' +import type { GraphQLFetcherResult } from '@vercel/commerce/api' +import type { Wishlist } from '@spree/storefront-api-v2-sdk/types/interfaces/Wishlist' +import ensureIToken from '../utils/tokens/ensure-itoken' +import normalizeWishlist from '../utils/normalizations/normalize-wishlist' +import isLoggedIn from '../utils/tokens/is-logged-in' + +export default useWishlist as UseWishlist + +export const handler: SWRHook = { + // Provide fetchOptions for SWR cache key + fetchOptions: { + url: 'wishlists', + query: 'default', + }, + async fetcher({ input, options, fetch }) { + console.info( + 'useWishlist fetcher called. Configuration: ', + 'input: ', + input, + 'options: ', + options + ) + + if (!isLoggedIn()) { + return null + } + + // TODO: Optimize with includeProducts. + + const token: IToken | undefined = ensureIToken() + + const { data: spreeWishlistsDefaultSuccessResponse } = await fetch< + GraphQLFetcherResult + >({ + variables: { + methodPath: 'wishlists.default', + arguments: [ + token, + { + include: [ + 'wished_items', + 'wished_items.variant', + 'wished_items.variant.product', + 'wished_items.variant.product.primary_variant', + 'wished_items.variant.product.images', + 'wished_items.variant.product.option_types', + 'wished_items.variant.product.variants', + 'wished_items.variant.product.variants.option_values', + ].join(','), + }, + ], + }, + }) + + return normalizeWishlist( + spreeWishlistsDefaultSuccessResponse, + spreeWishlistsDefaultSuccessResponse.data + ) + }, + useHook: ({ useData }) => { + const useWrappedHook: ReturnType['useHook']> = ( + input + ) => { + const response = useData({ + swrOptions: { + revalidateOnFocus: false, + ...input?.swrOptions, + }, + }) + + return useMemo( + () => + Object.create(response, { + isEmpty: { + get() { + return (response.data?.items?.length || 0) <= 0 + }, + enumerable: true, + }, + }), + [response] + ) + } + + return useWrappedHook + }, +} diff --git a/packages/spree/taskfile.js b/packages/spree/taskfile.js new file mode 100644 index 000000000..39b1b2a86 --- /dev/null +++ b/packages/spree/taskfile.js @@ -0,0 +1,20 @@ +export async function build(task, opts) { + await task + .source('src/**/*.+(ts|tsx|js)') + .swc({ dev: opts.dev, outDir: 'dist', baseUrl: 'src' }) + .target('dist') + .source('src/**/*.+(cjs|json)') + .target('dist') + task.$.log('Compiled src files') +} + +export async function release(task) { + await task.clear('dist').start('build') +} + +export default async function dev(task) { + const opts = { dev: true } + await task.clear('dist') + await task.start('build', opts) + await task.watch('src/**/*.+(ts|tsx|js|cjs|json)', 'build', opts) +} diff --git a/packages/spree/tsconfig.json b/packages/spree/tsconfig.json new file mode 100644 index 000000000..cd04ab2ff --- /dev/null +++ b/packages/spree/tsconfig.json @@ -0,0 +1,21 @@ +{ + "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, + "incremental": true, + "jsx": "react-jsx" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/framework/swell/.env.template b/packages/swell/.env.template similarity index 100% rename from framework/swell/.env.template rename to packages/swell/.env.template diff --git a/packages/swell/.prettierignore b/packages/swell/.prettierignore new file mode 100644 index 000000000..f06235c46 --- /dev/null +++ b/packages/swell/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/swell/.prettierrc b/packages/swell/.prettierrc new file mode 100644 index 000000000..e1076edfa --- /dev/null +++ b/packages/swell/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/swell/package.json b/packages/swell/package.json new file mode 100644 index 000000000..172f68925 --- /dev/null +++ b/packages/swell/package.json @@ -0,0 +1,81 @@ +{ + "name": "@vercel/commerce-swell", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "release": "taskr release", + "build": "taskr build", + "dev": "taskr", + "types": "tsc --emitDeclarationOnly", + "prettier-fix": "prettier --write ." + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], + "./next.config": "./dist/next.config.cjs" + }, + "typesVersions": { + "*": { + "*": [ + "src/*", + "src/*/index" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + }, + "files": [ + "dist", + "schema.d.ts" + ], + "publishConfig": { + "typesVersions": { + "*": { + "*": [ + "dist/*.d.ts", + "dist/*/index.d.ts" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + } + }, + "dependencies": { + "@vercel/commerce": "^0.0.1", + "@vercel/fetch": "^6.1.1", + "swell-js": "^4.0.0-next.0" + }, + "peerDependencies": { + "next": "^12", + "react": "^17", + "react-dom": "^17" + }, + "devDependencies": { + "@taskr/clear": "^1.1.0", + "@taskr/esnext": "^1.1.0", + "@taskr/watch": "^1.1.0", + "@types/node": "^17.0.8", + "@types/react": "^17.0.38", + "lint-staged": "^12.1.7", + "next": "^12.0.8", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "taskr": "^1.1.0", + "taskr-swc": "^0.0.1", + "typescript": "^4.5.4" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,json}": [ + "prettier --write", + "git add" + ] + } +} diff --git a/framework/swell/schema.d.ts b/packages/swell/schema.d.ts similarity index 99% rename from framework/swell/schema.d.ts rename to packages/swell/schema.d.ts index e77d3c8d9..0ec625048 100644 --- a/framework/swell/schema.d.ts +++ b/packages/swell/schema.d.ts @@ -332,7 +332,7 @@ export type Checkout = { terms_policy?: string refund_policy?: string privacy_policy?: string - theme?: stirng + theme?: string countries: any[] currencies: any[] payment_methods: any[] diff --git a/framework/swell/schema.graphql b/packages/swell/schema.graphql similarity index 100% rename from framework/swell/schema.graphql rename to packages/swell/schema.graphql diff --git a/framework/swell/api/cart/index.ts b/packages/swell/src/api/cart/index.ts similarity index 100% rename from framework/swell/api/cart/index.ts rename to packages/swell/src/api/cart/index.ts diff --git a/framework/swell/api/catalog/index.ts b/packages/swell/src/api/catalog/index.ts similarity index 100% rename from framework/swell/api/catalog/index.ts rename to packages/swell/src/api/catalog/index.ts diff --git a/framework/swell/api/catalog/products.ts b/packages/swell/src/api/catalog/products.ts similarity index 100% rename from framework/swell/api/catalog/products.ts rename to packages/swell/src/api/catalog/products.ts diff --git a/framework/swell/api/customer.ts b/packages/swell/src/api/customer.ts similarity index 100% rename from framework/swell/api/customer.ts rename to packages/swell/src/api/customer.ts diff --git a/framework/swell/api/customers/index.ts b/packages/swell/src/api/customers/index.ts similarity index 100% rename from framework/swell/api/customers/index.ts rename to packages/swell/src/api/customers/index.ts diff --git a/framework/swell/api/customers/logout.ts b/packages/swell/src/api/customers/logout.ts similarity index 100% rename from framework/swell/api/customers/logout.ts rename to packages/swell/src/api/customers/logout.ts diff --git a/framework/swell/api/customers/signup.ts b/packages/swell/src/api/customers/signup.ts similarity index 100% rename from framework/swell/api/customers/signup.ts rename to packages/swell/src/api/customers/signup.ts diff --git a/framework/swell/api/endpoints/cart.ts b/packages/swell/src/api/endpoints/cart.ts similarity index 100% rename from framework/swell/api/endpoints/cart.ts rename to packages/swell/src/api/endpoints/cart.ts diff --git a/framework/swell/api/endpoints/catalog/products.ts b/packages/swell/src/api/endpoints/catalog/products.ts similarity index 100% rename from framework/swell/api/endpoints/catalog/products.ts rename to packages/swell/src/api/endpoints/catalog/products.ts diff --git a/framework/swell/api/endpoints/checkout/index.ts b/packages/swell/src/api/endpoints/checkout/index.ts similarity index 58% rename from framework/swell/api/endpoints/checkout/index.ts rename to packages/swell/src/api/endpoints/checkout/index.ts index ab17a3767..2695ea385 100644 --- a/framework/swell/api/endpoints/checkout/index.ts +++ b/packages/swell/src/api/endpoints/checkout/index.ts @@ -1,9 +1,9 @@ -import { CommerceAPI, createEndpoint, GetAPISchema } from '@commerce/api' -import { CheckoutSchema } from '@commerce/types/checkout' +import { CommerceAPI, createEndpoint, GetAPISchema } from '@vercel/commerce/api' +import { CheckoutSchema } from '@vercel/commerce/types/checkout' import { SWELL_CHECKOUT_URL_COOKIE } from '../../../const' -import checkoutEndpoint from '@commerce/api/endpoints/checkout' +import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout' -const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({ +const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ req, res, config, @@ -17,7 +17,7 @@ const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({ res.redirect('/cart') } } -export const handlers: CheckoutEndpoint['handlers'] = { checkout } +export const handlers: CheckoutEndpoint['handlers'] = { getCheckout } export type CheckoutAPI = GetAPISchema export type CheckoutEndpoint = CheckoutAPI['endpoint'] diff --git a/packages/swell/src/api/endpoints/customer/address.ts b/packages/swell/src/api/endpoints/customer/address.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/swell/src/api/endpoints/customer/address.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/swell/src/api/endpoints/customer/card.ts b/packages/swell/src/api/endpoints/customer/card.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/swell/src/api/endpoints/customer/card.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/swell/src/api/endpoints/customer/index.ts b/packages/swell/src/api/endpoints/customer/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/swell/src/api/endpoints/customer/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/framework/swell/api/endpoints/login.ts b/packages/swell/src/api/endpoints/login.ts similarity index 100% rename from framework/swell/api/endpoints/login.ts rename to packages/swell/src/api/endpoints/login.ts diff --git a/framework/swell/api/endpoints/logout.ts b/packages/swell/src/api/endpoints/logout.ts similarity index 100% rename from framework/swell/api/endpoints/logout.ts rename to packages/swell/src/api/endpoints/logout.ts diff --git a/framework/swell/api/endpoints/signup.ts b/packages/swell/src/api/endpoints/signup.ts similarity index 100% rename from framework/swell/api/endpoints/signup.ts rename to packages/swell/src/api/endpoints/signup.ts diff --git a/framework/swell/api/endpoints/wishlist.ts b/packages/swell/src/api/endpoints/wishlist.ts similarity index 100% rename from framework/swell/api/endpoints/wishlist.ts rename to packages/swell/src/api/endpoints/wishlist.ts diff --git a/framework/swell/api/index.ts b/packages/swell/src/api/index.ts similarity index 97% rename from framework/swell/api/index.ts rename to packages/swell/src/api/index.ts index 463c42fae..589acae4e 100644 --- a/framework/swell/api/index.ts +++ b/packages/swell/src/api/index.ts @@ -2,7 +2,7 @@ import { CommerceAPI, CommerceAPIConfig, getCommerceApi as commerceApi, -} from '@commerce/api' +} from '@vercel/commerce/api' import { SWELL_CHECKOUT_ID_COOKIE, SWELL_CUSTOMER_TOKEN_COOKIE, diff --git a/framework/swell/api/operations/get-all-pages.ts b/packages/swell/src/api/operations/get-all-pages.ts similarity index 93% rename from framework/swell/api/operations/get-all-pages.ts rename to packages/swell/src/api/operations/get-all-pages.ts index e157c0138..7097d6859 100644 --- a/framework/swell/api/operations/get-all-pages.ts +++ b/packages/swell/src/api/operations/get-all-pages.ts @@ -1,5 +1,5 @@ import { Provider, SwellConfig } from '..' -import type { OperationContext } from '@commerce/api/operations' +import type { OperationContext } from '@vercel/commerce/api/operations' import type { Page } from '../../types/page' export type GetAllPagesResult = diff --git a/framework/swell/api/operations/get-all-product-paths.ts b/packages/swell/src/api/operations/get-all-product-paths.ts similarity index 88% rename from framework/swell/api/operations/get-all-product-paths.ts rename to packages/swell/src/api/operations/get-all-product-paths.ts index 4d95253e8..1e5088608 100644 --- a/framework/swell/api/operations/get-all-product-paths.ts +++ b/packages/swell/src/api/operations/get-all-product-paths.ts @@ -1,7 +1,10 @@ import { SwellProduct } from '../../types' import { SwellConfig, Provider } from '..' -import { OperationContext, OperationOptions } from '@commerce/api/operations' -import { GetAllProductPathsOperation } from '@commerce/types/product' +import { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import { GetAllProductPathsOperation } from '@vercel/commerce/types/product' export default function getAllProductPathsOperation({ commerce, diff --git a/framework/swell/api/operations/get-all-products.ts b/packages/swell/src/api/operations/get-all-products.ts similarity index 89% rename from framework/swell/api/operations/get-all-products.ts rename to packages/swell/src/api/operations/get-all-products.ts index 7e8e99a5c..6527fb986 100644 --- a/framework/swell/api/operations/get-all-products.ts +++ b/packages/swell/src/api/operations/get-all-products.ts @@ -1,8 +1,8 @@ import { normalizeProduct } from '../../utils/normalize' import { SwellProduct } from '../../types' -import { Product } from '@commerce/types/product' +import { Product } from '@vercel/commerce/types/product' import { Provider, SwellConfig } from '../' -import { OperationContext } from '@commerce/api/operations' +import { OperationContext } from '@vercel/commerce/api/operations' export type ProductVariables = { first?: number } diff --git a/framework/swell/api/operations/get-page.ts b/packages/swell/src/api/operations/get-page.ts similarity index 90% rename from framework/swell/api/operations/get-page.ts rename to packages/swell/src/api/operations/get-page.ts index 99fbac04d..7e71f7575 100644 --- a/framework/swell/api/operations/get-page.ts +++ b/packages/swell/src/api/operations/get-page.ts @@ -1,6 +1,9 @@ -import { Page } from '../../schema' +import { Page } from '../../../schema' import { SwellConfig, Provider } from '..' -import { OperationContext, OperationOptions } from '@commerce/api/operations' +import { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' import { GetPageOperation } from '../../types/page' export type GetPageResult = T diff --git a/framework/swell/api/operations/get-product.ts b/packages/swell/src/api/operations/get-product.ts similarity index 85% rename from framework/swell/api/operations/get-product.ts rename to packages/swell/src/api/operations/get-product.ts index c9a3d6f1d..fff62570f 100644 --- a/framework/swell/api/operations/get-product.ts +++ b/packages/swell/src/api/operations/get-product.ts @@ -1,7 +1,7 @@ import { normalizeProduct } from '../../utils' -import { Product } from '@commerce/types/product' -import { OperationContext } from '@commerce/api/operations' +import { Product } from '@vercel/commerce/types/product' +import { OperationContext } from '@vercel/commerce/api/operations' import { Provider, SwellConfig } from '../' export default function getProductOperation({ diff --git a/framework/swell/api/operations/get-site-info.ts b/packages/swell/src/api/operations/get-site-info.ts similarity index 86% rename from framework/swell/api/operations/get-site-info.ts rename to packages/swell/src/api/operations/get-site-info.ts index ffb0c1542..88386ad3e 100644 --- a/framework/swell/api/operations/get-site-info.ts +++ b/packages/swell/src/api/operations/get-site-info.ts @@ -1,8 +1,8 @@ import getCategories from '../../utils/get-categories' import getVendors, { Brands } from '../../utils/get-vendors' import { Provider, SwellConfig } from '../' -import type { OperationContext } from '@commerce/api/operations' -import type { Category } from '@commerce/types/site' +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { Category } from '@vercel/commerce/types/site' export type GetSiteInfoResult< T extends { categories: any[]; brands: any[] } = { diff --git a/framework/swell/api/operations/login.ts b/packages/swell/src/api/operations/login.ts similarity index 96% rename from framework/swell/api/operations/login.ts rename to packages/swell/src/api/operations/login.ts index 33e1e2948..44ff37a53 100644 --- a/framework/swell/api/operations/login.ts +++ b/packages/swell/src/api/operations/login.ts @@ -2,7 +2,7 @@ import type { ServerResponse } from 'http' import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' +} from '@vercel/commerce/api/operations' import type { LoginOperation } from '../../types/login' import { Provider, SwellConfig } from '..' diff --git a/framework/swell/api/utils/fetch-swell-api.ts b/packages/swell/src/api/utils/fetch-swell-api.ts similarity index 68% rename from framework/swell/api/utils/fetch-swell-api.ts rename to packages/swell/src/api/utils/fetch-swell-api.ts index 65caed763..83055c5c0 100644 --- a/framework/swell/api/utils/fetch-swell-api.ts +++ b/packages/swell/src/api/utils/fetch-swell-api.ts @@ -1,7 +1,7 @@ -import { swellConfig } from '../..' +import swell from '../../swell' const fetchApi = async (query: string, method: string, variables: [] = []) => { - const { swell } = swellConfig return swell[query][method](...variables) } + export default fetchApi diff --git a/framework/swell/api/utils/fetch.ts b/packages/swell/src/api/utils/fetch.ts similarity index 100% rename from framework/swell/api/utils/fetch.ts rename to packages/swell/src/api/utils/fetch.ts diff --git a/framework/swell/api/utils/is-allowed-method.ts b/packages/swell/src/api/utils/is-allowed-method.ts similarity index 100% rename from framework/swell/api/utils/is-allowed-method.ts rename to packages/swell/src/api/utils/is-allowed-method.ts diff --git a/framework/swell/api/wishlist/index.tsx b/packages/swell/src/api/wishlist/index.tsx similarity index 100% rename from framework/swell/api/wishlist/index.tsx rename to packages/swell/src/api/wishlist/index.tsx diff --git a/framework/swell/auth/use-login.tsx b/packages/swell/src/auth/use-login.tsx similarity index 83% rename from framework/swell/auth/use-login.tsx rename to packages/swell/src/auth/use-login.tsx index 5a34975fa..b3fe9f52d 100644 --- a/framework/swell/auth/use-login.tsx +++ b/packages/swell/src/auth/use-login.tsx @@ -1,13 +1,13 @@ import { useCallback } from 'react' -import type { MutationHook } from '@commerce/utils/types' -import { CommerceError, ValidationError } from '@commerce/utils/errors' +import type { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError, ValidationError } from '@vercel/commerce/utils/errors' import useCustomer from '../customer/use-customer' import { CustomerUserError, Mutation, MutationCheckoutCreateArgs, -} from '../schema' -import useLogin, { UseLogin } from '@commerce/auth/use-login' +} from '../../schema' +import useLogin, { UseLogin } from '@vercel/commerce/auth/use-login' import { LoginHook } from '../types/login' import { setCustomerToken } from '../utils' @@ -62,15 +62,15 @@ export const handler: MutationHook = { useHook: ({ fetch }) => () => { - const { revalidate } = useCustomer() + const { mutate } = useCustomer() return useCallback( async function login(input) { const data = await fetch({ input }) - await revalidate() + await mutate() return data }, - [fetch, revalidate] + [fetch, mutate] ) }, } diff --git a/framework/swell/auth/use-logout.tsx b/packages/swell/src/auth/use-logout.tsx similarity index 86% rename from framework/swell/auth/use-logout.tsx rename to packages/swell/src/auth/use-logout.tsx index 0e08ce9c6..08eec0bac 100644 --- a/framework/swell/auth/use-logout.tsx +++ b/packages/swell/src/auth/use-logout.tsx @@ -1,6 +1,6 @@ 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 { getCustomerToken, setCustomerToken } from '../utils/customer-token' import { LogoutHook } from '../types/logout' diff --git a/framework/swell/auth/use-signup.tsx b/packages/swell/src/auth/use-signup.tsx similarity index 81% rename from framework/swell/auth/use-signup.tsx rename to packages/swell/src/auth/use-signup.tsx index 246285ece..581312db9 100644 --- a/framework/swell/auth/use-signup.tsx +++ b/packages/swell/src/auth/use-signup.tsx @@ -1,7 +1,7 @@ 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 { SignupHook } from '../types/signup' import handleLogin from '../utils/handle-login' @@ -47,15 +47,15 @@ export const handler: MutationHook = { useHook: ({ fetch }) => () => { - const { revalidate } = useCustomer() + const { mutate } = useCustomer() return useCallback( async function signup(input) { const data = await fetch({ input }) - await revalidate() + await mutate() return data }, - [fetch, revalidate] + [fetch, mutate] ) }, } diff --git a/framework/swell/cart/index.ts b/packages/swell/src/cart/index.ts similarity index 100% rename from framework/swell/cart/index.ts rename to packages/swell/src/cart/index.ts diff --git a/framework/swell/cart/use-add-item.tsx b/packages/swell/src/cart/use-add-item.tsx similarity index 87% rename from framework/swell/cart/use-add-item.tsx rename to packages/swell/src/cart/use-add-item.tsx index dac4fb9bb..048a1f45d 100644 --- a/framework/swell/cart/use-add-item.tsx +++ b/packages/swell/src/cart/use-add-item.tsx @@ -1,6 +1,6 @@ -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 { checkoutToCart } from './utils' import { getCheckoutId } from '../utils' diff --git a/framework/swell/cart/use-cart.tsx b/packages/swell/src/cart/use-cart.tsx similarity index 82% rename from framework/swell/cart/use-cart.tsx rename to packages/swell/src/cart/use-cart.tsx index 7dc48b052..5842d1e95 100644 --- a/framework/swell/cart/use-cart.tsx +++ b/packages/swell/src/cart/use-cart.tsx @@ -1,9 +1,9 @@ -import useCart, { UseCart } from '@commerce/cart/use-cart' -import { SWRHook } from '@commerce/utils/types' +import useCart, { UseCart } from '@vercel/commerce/cart/use-cart' +import { SWRHook } from '@vercel/commerce/utils/types' import { useMemo } from 'react' import { normalizeCart } from '../utils/normalize' import { checkoutCreate, checkoutToCart } from './utils' -import type { GetCartHook } from '@commerce/types/cart' +import type { GetCartHook } from '@vercel/commerce/types/cart' export default useCart as UseCart diff --git a/framework/swell/cart/use-remove-item.tsx b/packages/swell/src/cart/use-remove-item.tsx similarity index 85% rename from framework/swell/cart/use-remove-item.tsx rename to packages/swell/src/cart/use-remove-item.tsx index fe1ee24ca..6e511656b 100644 --- a/framework/swell/cart/use-remove-item.tsx +++ b/packages/swell/src/cart/use-remove-item.tsx @@ -2,10 +2,16 @@ import { useCallback } from 'react' import type { MutationHookContext, HookFetcherContext, -} from '@commerce/utils/types' +} from '@vercel/commerce/utils/types' -import useRemoveItem, { UseRemoveItem } from '@commerce/cart/use-remove-item' -import type { Cart, LineItem, RemoveItemHook } from '@commerce/types/cart' +import useRemoveItem, { + UseRemoveItem, +} from '@vercel/commerce/cart/use-remove-item' +import type { + Cart, + LineItem, + RemoveItemHook, +} from '@vercel/commerce/types/cart' import useCart from './use-cart' import { checkoutToCart } from './utils' diff --git a/framework/swell/cart/use-update-item.tsx b/packages/swell/src/cart/use-update-item.tsx similarity index 89% rename from framework/swell/cart/use-update-item.tsx rename to packages/swell/src/cart/use-update-item.tsx index 5d705c5e5..c741250c2 100644 --- a/framework/swell/cart/use-update-item.tsx +++ b/packages/swell/src/cart/use-update-item.tsx @@ -4,16 +4,18 @@ import type { HookFetcherContext, MutationHook, MutationHookContext, -} from '@commerce/utils/types' -import { ValidationError } from '@commerce/utils/errors' +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' // import useUpdateItem, { // UpdateItemInput as UpdateItemInputBase, // UseUpdateItem, -// } from '@commerce/cart/use-update-item' -import useUpdateItem, { UseUpdateItem } from '@commerce/cart/use-update-item' +// } from '@vercel/commerce/cart/use-update-item' +import useUpdateItem, { + UseUpdateItem, +} from '@vercel/commerce/cart/use-update-item' import useCart from './use-cart' import { handler as removeItemHandler } from './use-remove-item' -import { CartItemBody, LineItem } from '@commerce/types/cart' +import { CartItemBody, LineItem } from '@vercel/commerce/types/cart' import { checkoutToCart } from './utils' import { UpdateItemHook } from '../types/cart' // export type UpdateItemInput = T extends LineItem diff --git a/framework/swell/cart/utils/checkout-create.ts b/packages/swell/src/cart/utils/checkout-create.ts similarity index 100% rename from framework/swell/cart/utils/checkout-create.ts rename to packages/swell/src/cart/utils/checkout-create.ts diff --git a/framework/swell/cart/utils/checkout-to-cart.ts b/packages/swell/src/cart/utils/checkout-to-cart.ts similarity index 87% rename from framework/swell/cart/utils/checkout-to-cart.ts rename to packages/swell/src/cart/utils/checkout-to-cart.ts index d6dfda206..c9becb104 100644 --- a/framework/swell/cart/utils/checkout-to-cart.ts +++ b/packages/swell/src/cart/utils/checkout-to-cart.ts @@ -1,12 +1,12 @@ import { Cart } from '../../types' -import { CommerceError } from '@commerce/utils/errors' +import { CommerceError } from '@vercel/commerce/utils/errors' import { CheckoutLineItemsAddPayload, CheckoutLineItemsRemovePayload, CheckoutLineItemsUpdatePayload, Maybe, -} from '../../schema' +} from '../../../schema' import { normalizeCart } from '../../utils' export type CheckoutPayload = diff --git a/framework/swell/cart/utils/index.ts b/packages/swell/src/cart/utils/index.ts similarity index 100% rename from framework/swell/cart/utils/index.ts rename to packages/swell/src/cart/utils/index.ts diff --git a/packages/swell/src/checkout/use-checkout.tsx b/packages/swell/src/checkout/use-checkout.tsx new file mode 100644 index 000000000..76997be73 --- /dev/null +++ b/packages/swell/src/checkout/use-checkout.tsx @@ -0,0 +1,16 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { + UseCheckout, +} from '@vercel/commerce/checkout/use-checkout' + +export default useCheckout as UseCheckout + +export const handler: SWRHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ useData }) => + async (input) => ({}), +} diff --git a/framework/swell/commerce.config.json b/packages/swell/src/commerce.config.json similarity index 100% rename from framework/swell/commerce.config.json rename to packages/swell/src/commerce.config.json diff --git a/framework/swell/const.ts b/packages/swell/src/const.ts similarity index 83% rename from framework/swell/const.ts rename to packages/swell/src/const.ts index 669194298..16d493896 100644 --- a/framework/swell/const.ts +++ b/packages/swell/src/const.ts @@ -4,8 +4,6 @@ export const SWELL_CHECKOUT_URL_COOKIE = 'swell_checkoutUrl' export const SWELL_CUSTOMER_TOKEN_COOKIE = 'swell_customerToken' -export const STORE_DOMAIN = process.env.NEXT_PUBLIC_SWELL_STORE_DOMAIN - export const SWELL_COOKIE_EXPIRE = 30 export const SWELL_STORE_ID = process.env.NEXT_PUBLIC_SWELL_STORE_ID diff --git a/packages/swell/src/customer/address/use-add-item.tsx b/packages/swell/src/customer/address/use-add-item.tsx new file mode 100644 index 000000000..4f85c8472 --- /dev/null +++ b/packages/swell/src/customer/address/use-add-item.tsx @@ -0,0 +1,17 @@ +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/address/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/packages/swell/src/customer/card/use-add-item.tsx b/packages/swell/src/customer/card/use-add-item.tsx new file mode 100644 index 000000000..77d149eff --- /dev/null +++ b/packages/swell/src/customer/card/use-add-item.tsx @@ -0,0 +1,17 @@ +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/card/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/packages/swell/src/customer/index.ts b/packages/swell/src/customer/index.ts new file mode 100644 index 000000000..6c903ecc5 --- /dev/null +++ b/packages/swell/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/framework/swell/customer/use-customer.tsx b/packages/swell/src/customer/use-customer.tsx similarity index 81% rename from framework/swell/customer/use-customer.tsx rename to packages/swell/src/customer/use-customer.tsx index 3371db89c..0875310fd 100644 --- a/framework/swell/customer/use-customer.tsx +++ b/packages/swell/src/customer/use-customer.tsx @@ -1,5 +1,7 @@ -import useCustomer, { UseCustomer } from '@commerce/customer/use-customer' -import { SWRHook } from '@commerce/utils/types' +import useCustomer, { + UseCustomer, +} from '@vercel/commerce/customer/use-customer' +import { SWRHook } from '@vercel/commerce/utils/types' import { normalizeCustomer } from '../utils/normalize' import type { CustomerHook } from '../types/customer' diff --git a/framework/swell/fetcher.ts b/packages/swell/src/fetcher.ts similarity index 79% rename from framework/swell/fetcher.ts rename to packages/swell/src/fetcher.ts index f18dcf667..1d50bf5a7 100644 --- a/framework/swell/fetcher.ts +++ b/packages/swell/src/fetcher.ts @@ -1,11 +1,9 @@ -import { Fetcher } from '@commerce/utils/types' +import { Fetcher } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' import { handleFetchResponse } from './utils' -import { swellConfig } from './index' -import { CommerceError } from '@commerce/utils/errors' +import swell from './swell' const fetcher: Fetcher = async ({ method = 'get', variables, query }) => { - const { swell } = swellConfig - async function callSwell() { if (Array.isArray(variables)) { const arg1 = variables[0] diff --git a/packages/swell/src/index.tsx b/packages/swell/src/index.tsx new file mode 100644 index 000000000..d88d75c31 --- /dev/null +++ b/packages/swell/src/index.tsx @@ -0,0 +1,12 @@ +import { + getCommerceProvider, + useCommerce as useCoreCommerce, +} from '@vercel/commerce' +import { swellProvider, SwellProvider } from './provider' + +export { swellProvider } +export type { SwellProvider } + +export const CommerceProvider = getCommerceProvider(swellProvider) + +export const useCommerce = () => useCoreCommerce() diff --git a/framework/swell/next.config.js b/packages/swell/src/next.config.cjs similarity index 100% rename from framework/swell/next.config.js rename to packages/swell/src/next.config.cjs diff --git a/packages/swell/src/product/index.ts b/packages/swell/src/product/index.ts new file mode 100644 index 000000000..426a3edcd --- /dev/null +++ b/packages/swell/src/product/index.ts @@ -0,0 +1,2 @@ +export { default as usePrice } from './use-price' +export { default as useSearch } from './use-search' diff --git a/packages/swell/src/product/use-price.tsx b/packages/swell/src/product/use-price.tsx new file mode 100644 index 000000000..fd42d7033 --- /dev/null +++ b/packages/swell/src/product/use-price.tsx @@ -0,0 +1,2 @@ +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/framework/swell/product/use-search.tsx b/packages/swell/src/product/use-search.tsx similarity index 91% rename from framework/swell/product/use-search.tsx rename to packages/swell/src/product/use-search.tsx index 62f813368..b996099a4 100644 --- a/framework/swell/product/use-search.tsx +++ b/packages/swell/src/product/use-search.tsx @@ -1,5 +1,5 @@ -import { SWRHook } from '@commerce/utils/types' -import useSearch, { UseSearch } from '@commerce/product/use-search' +import { SWRHook } from '@vercel/commerce/utils/types' +import useSearch, { UseSearch } from '@vercel/commerce/product/use-search' import { normalizeProduct } from '../utils' import { SwellProduct } from '../types' import type { SearchProductsHook } from '../types/product' diff --git a/framework/swell/provider.ts b/packages/swell/src/provider.ts similarity index 78% rename from framework/swell/provider.ts rename to packages/swell/src/provider.ts index aa7be31d4..afe07dcfd 100644 --- a/framework/swell/provider.ts +++ b/packages/swell/src/provider.ts @@ -1,6 +1,5 @@ -import { Provider } from '@commerce' - -import { SWELL_CHECKOUT_URL_COOKIE, STORE_DOMAIN } from './const' +import { Provider } from '@vercel/commerce' +import { SWELL_CHECKOUT_ID_COOKIE } from './const' import { handler as useCart } from './cart/use-cart' import { handler as useAddItem } from './cart/use-add-item' @@ -15,11 +14,12 @@ import { handler as useLogout } from './auth/use-logout' import { handler as useSignup } from './auth/use-signup' import fetcher from './fetcher' +import swell from './swell' -export const swellProvider: Provider = { +export const swellProvider: Provider & { swell: any } = { locale: 'en-us', - cartCookie: SWELL_CHECKOUT_URL_COOKIE, - // storeDomain: STORE_DOMAIN, + cartCookie: SWELL_CHECKOUT_ID_COOKIE, + swell, fetcher, cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, customer: { useCustomer }, diff --git a/packages/swell/src/swell.ts b/packages/swell/src/swell.ts new file mode 100644 index 000000000..eb49ce55d --- /dev/null +++ b/packages/swell/src/swell.ts @@ -0,0 +1,7 @@ +// @ts-ignore +import swell from 'swell-js' +import { SWELL_STORE_ID, SWELL_PUBLIC_KEY } from './const' + +swell.init(SWELL_STORE_ID, SWELL_PUBLIC_KEY) + +export default swell diff --git a/framework/swell/types.ts b/packages/swell/src/types.ts similarity index 92% rename from framework/swell/types.ts rename to packages/swell/src/types.ts index ad8ee3b68..b02bbd8ca 100644 --- a/framework/swell/types.ts +++ b/packages/swell/src/types.ts @@ -1,6 +1,6 @@ -import * as Core from '@commerce/types/cart' -import { Customer } from '@commerce/types' -import { CheckoutLineItem } from './schema' +import * as Core from '@vercel/commerce/types/cart' +import { Customer } from '@vercel/commerce/types' +import { CheckoutLineItem } from '../schema' export type SwellImage = { file: { diff --git a/packages/swell/src/types/cart.ts b/packages/swell/src/types/cart.ts new file mode 100644 index 000000000..e6838fb45 --- /dev/null +++ b/packages/swell/src/types/cart.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/cart' diff --git a/packages/swell/src/types/checkout.ts b/packages/swell/src/types/checkout.ts new file mode 100644 index 000000000..d139db685 --- /dev/null +++ b/packages/swell/src/types/checkout.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/checkout' diff --git a/packages/swell/src/types/common.ts b/packages/swell/src/types/common.ts new file mode 100644 index 000000000..23b8daa11 --- /dev/null +++ b/packages/swell/src/types/common.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/common' diff --git a/packages/swell/src/types/customer.ts b/packages/swell/src/types/customer.ts new file mode 100644 index 000000000..c637055b9 --- /dev/null +++ b/packages/swell/src/types/customer.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/customer' diff --git a/framework/vendure/types/index.ts b/packages/swell/src/types/index.ts similarity index 100% rename from framework/vendure/types/index.ts rename to packages/swell/src/types/index.ts diff --git a/packages/swell/src/types/login.ts b/packages/swell/src/types/login.ts new file mode 100644 index 000000000..44b017dcd --- /dev/null +++ b/packages/swell/src/types/login.ts @@ -0,0 +1,11 @@ +import * as Core from '@vercel/commerce/types/login' +import { LoginBody, LoginTypes } from '@vercel/commerce/types/login' + +export * from '@vercel/commerce/types/login' + +export type LoginHook = { + data: null + actionInput: LoginBody + fetcherInput: LoginBody + body: T['body'] +} diff --git a/packages/swell/src/types/logout.ts b/packages/swell/src/types/logout.ts new file mode 100644 index 000000000..1de06f8dc --- /dev/null +++ b/packages/swell/src/types/logout.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/logout' diff --git a/packages/swell/src/types/page.ts b/packages/swell/src/types/page.ts new file mode 100644 index 000000000..12f6b02d7 --- /dev/null +++ b/packages/swell/src/types/page.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/page' diff --git a/packages/swell/src/types/product.ts b/packages/swell/src/types/product.ts new file mode 100644 index 000000000..72ca02f02 --- /dev/null +++ b/packages/swell/src/types/product.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/product' diff --git a/packages/swell/src/types/signup.ts b/packages/swell/src/types/signup.ts new file mode 100644 index 000000000..3f0d1af5a --- /dev/null +++ b/packages/swell/src/types/signup.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/signup' diff --git a/packages/swell/src/types/site.ts b/packages/swell/src/types/site.ts new file mode 100644 index 000000000..96a2e476e --- /dev/null +++ b/packages/swell/src/types/site.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/site' diff --git a/packages/swell/src/types/wishlist.ts b/packages/swell/src/types/wishlist.ts new file mode 100644 index 000000000..af92d9f63 --- /dev/null +++ b/packages/swell/src/types/wishlist.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/wishlist' diff --git a/framework/swell/utils/customer-token.ts b/packages/swell/src/utils/customer-token.ts similarity index 100% rename from framework/swell/utils/customer-token.ts rename to packages/swell/src/utils/customer-token.ts diff --git a/framework/swell/utils/get-categories.ts b/packages/swell/src/utils/get-categories.ts similarity index 100% rename from framework/swell/utils/get-categories.ts rename to packages/swell/src/utils/get-categories.ts diff --git a/framework/swell/utils/get-checkout-id.ts b/packages/swell/src/utils/get-checkout-id.ts similarity index 100% rename from framework/swell/utils/get-checkout-id.ts rename to packages/swell/src/utils/get-checkout-id.ts diff --git a/framework/swell/utils/get-search-variables.ts b/packages/swell/src/utils/get-search-variables.ts similarity index 100% rename from framework/swell/utils/get-search-variables.ts rename to packages/swell/src/utils/get-search-variables.ts diff --git a/framework/swell/utils/get-sort-variables.ts b/packages/swell/src/utils/get-sort-variables.ts similarity index 100% rename from framework/swell/utils/get-sort-variables.ts rename to packages/swell/src/utils/get-sort-variables.ts diff --git a/framework/swell/utils/get-vendors.ts b/packages/swell/src/utils/get-vendors.ts similarity index 100% rename from framework/swell/utils/get-vendors.ts rename to packages/swell/src/utils/get-vendors.ts diff --git a/framework/swell/utils/handle-fetch-response.ts b/packages/swell/src/utils/handle-fetch-response.ts similarity index 82% rename from framework/swell/utils/handle-fetch-response.ts rename to packages/swell/src/utils/handle-fetch-response.ts index 2688c9c70..d120cab13 100644 --- a/framework/swell/utils/handle-fetch-response.ts +++ b/packages/swell/src/utils/handle-fetch-response.ts @@ -1,4 +1,4 @@ -import { CommerceError } from '@commerce/utils/errors' +import { CommerceError } from '@vercel/commerce/utils/errors' type SwellFetchResponse = { error: { diff --git a/framework/swell/utils/handle-login.ts b/packages/swell/src/utils/handle-login.ts similarity index 92% rename from framework/swell/utils/handle-login.ts rename to packages/swell/src/utils/handle-login.ts index 77b6873e3..8628262ca 100644 --- a/framework/swell/utils/handle-login.ts +++ b/packages/swell/src/utils/handle-login.ts @@ -1,4 +1,4 @@ -import { ValidationError } from '@commerce/utils/errors' +import { ValidationError } from '@vercel/commerce/utils/errors' import { setCustomerToken } from './customer-token' const getErrorMessage = ({ diff --git a/framework/swell/utils/index.ts b/packages/swell/src/utils/index.ts similarity index 100% rename from framework/swell/utils/index.ts rename to packages/swell/src/utils/index.ts diff --git a/framework/swell/utils/normalize.ts b/packages/swell/src/utils/normalize.ts similarity index 99% rename from framework/swell/utils/normalize.ts rename to packages/swell/src/utils/normalize.ts index 2306f0662..9bbad5961 100644 --- a/framework/swell/utils/normalize.ts +++ b/packages/swell/src/utils/normalize.ts @@ -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, diff --git a/framework/swell/utils/storage.ts b/packages/swell/src/utils/storage.ts similarity index 100% rename from framework/swell/utils/storage.ts rename to packages/swell/src/utils/storage.ts diff --git a/packages/swell/src/wishlist/use-add-item.tsx b/packages/swell/src/wishlist/use-add-item.tsx new file mode 100644 index 000000000..75f067c3a --- /dev/null +++ b/packages/swell/src/wishlist/use-add-item.tsx @@ -0,0 +1,13 @@ +import { useCallback } from 'react' + +export function emptyHook() { + const useEmptyHook = async (options = {}) => { + return useCallback(async function () { + return Promise.resolve() + }, []) + } + + return useEmptyHook +} + +export default emptyHook diff --git a/packages/swell/src/wishlist/use-remove-item.tsx b/packages/swell/src/wishlist/use-remove-item.tsx new file mode 100644 index 000000000..a2d3a8a05 --- /dev/null +++ b/packages/swell/src/wishlist/use-remove-item.tsx @@ -0,0 +1,17 @@ +import { useCallback } from 'react' + +type Options = { + includeProducts?: boolean +} + +export function emptyHook(options?: Options) { + const useEmptyHook = async ({ id }: { id: string | number }) => { + return useCallback(async function () { + return Promise.resolve() + }, []) + } + + return useEmptyHook +} + +export default emptyHook diff --git a/framework/swell/wishlist/use-wishlist.tsx b/packages/swell/src/wishlist/use-wishlist.tsx similarity index 90% rename from framework/swell/wishlist/use-wishlist.tsx rename to packages/swell/src/wishlist/use-wishlist.tsx index cd1bfa0ad..0506ae9d4 100644 --- a/framework/swell/wishlist/use-wishlist.tsx +++ b/packages/swell/src/wishlist/use-wishlist.tsx @@ -1,8 +1,8 @@ // TODO: replace this hook and other wishlist hooks with a handler, or remove them if // Swell doesn't have a wishlist -import { HookFetcher } from '@commerce/utils/types' -import { Product } from '../schema' +import { HookFetcher } from '@vercel/commerce/utils/types' +import { Product } from '../../schema' const defaultOpts = {} diff --git a/packages/swell/taskfile.js b/packages/swell/taskfile.js new file mode 100644 index 000000000..39b1b2a86 --- /dev/null +++ b/packages/swell/taskfile.js @@ -0,0 +1,20 @@ +export async function build(task, opts) { + await task + .source('src/**/*.+(ts|tsx|js)') + .swc({ dev: opts.dev, outDir: 'dist', baseUrl: 'src' }) + .target('dist') + .source('src/**/*.+(cjs|json)') + .target('dist') + task.$.log('Compiled src files') +} + +export async function release(task) { + await task.clear('dist').start('build') +} + +export default async function dev(task) { + const opts = { dev: true } + await task.clear('dist') + await task.start('build', opts) + await task.watch('src/**/*.+(ts|tsx|js|cjs|json)', 'build', opts) +} diff --git a/packages/swell/tsconfig.json b/packages/swell/tsconfig.json new file mode 100644 index 000000000..cd04ab2ff --- /dev/null +++ b/packages/swell/tsconfig.json @@ -0,0 +1,21 @@ +{ + "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, + "incremental": true, + "jsx": "react-jsx" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/taskr-swc/.prettierrc b/packages/taskr-swc/.prettierrc new file mode 100644 index 000000000..a4fb43a48 --- /dev/null +++ b/packages/taskr-swc/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/taskr-swc/package.json b/packages/taskr-swc/package.json new file mode 100644 index 000000000..1a91b5b38 --- /dev/null +++ b/packages/taskr-swc/package.json @@ -0,0 +1,16 @@ +{ + "name": "taskr-swc", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "prettier-fix": "prettier --write ." + }, + "main": "taskfile-swc.js", + "files": [ + "taskfile-swc.js" + ], + "devDependencies": { + "@swc/core": "^1.2.138", + "prettier": "^2.5.1" + } +} diff --git a/packages/taskr-swc/taskfile-swc.js b/packages/taskr-swc/taskfile-swc.js new file mode 100644 index 000000000..26fcad520 --- /dev/null +++ b/packages/taskr-swc/taskfile-swc.js @@ -0,0 +1,123 @@ +// Based on +// https://github.com/vercel/next.js/blob/canary/packages/next/taskfile-swc.js + +// taskr babel plugin with Babel 7 support +// https://github.com/lukeed/taskr/pull/305 + +const path = require('path') +const transform = require('@swc/core').transform + +module.exports = function (task) { + task.plugin( + 'swc', + {}, + function* ( + file, + { server = true, stripExtension, dev, outDir = 'dist', baseUrl = '' } = {} + ) { + // Don't compile .d.ts + if (file.base.endsWith('.d.ts')) return + + const swcClientOptions = { + module: { + type: 'es6', + ignoreDynamic: true, + }, + jsc: { + loose: true, + target: 'es2016', + parser: { + syntax: 'typescript', + dynamicImport: true, + tsx: file.base.endsWith('.tsx'), + }, + transform: { + react: { + runtime: 'automatic', + pragma: 'React.createElement', + pragmaFrag: 'React.Fragment', + throwIfNamespace: true, + development: false, + useBuiltins: true, + }, + }, + }, + } + const swcServerOptions = { + module: { + type: 'es6', + ignoreDynamic: true, + }, + env: { + targets: { + node: '14.0.0', + }, + }, + jsc: { + loose: true, + parser: { + syntax: 'typescript', + dynamicImport: true, + tsx: file.base.endsWith('.tsx'), + }, + transform: { + react: { + runtime: 'automatic', + pragma: 'React.createElement', + pragmaFrag: 'React.Fragment', + throwIfNamespace: true, + development: false, + useBuiltins: true, + }, + }, + }, + } + + const swcOptions = server ? swcServerOptions : swcClientOptions + const filePath = path.join(file.dir, file.base) + const options = { + filename: filePath, + sourceMaps: false, + ...swcOptions, + } + + if (options.sourceMaps && !options.sourceFileName) { + // Using `outDir` and `baseUrl` build a relative path from `outDir` to + // the `baseUrl` path for source maps + const basePath = path.join(__dirname, baseUrl) + const relativeFilePath = path.relative(basePath, filePath) + const fullFilePath = path.join(__dirname, filePath) + const distFilePath = path.dirname( + path.join(__dirname, outDir, relativeFilePath) + ) + + options.sourceFileName = path.relative(distFilePath, fullFilePath) + } + + const output = yield transform(file.data.toString('utf-8'), options) + const ext = path.extname(file.base) + + // Replace `.ts|.tsx` with `.js` in files with an extension + if (ext) { + const extRegex = new RegExp(ext.replace('.', '\\.') + '$', 'i') + // Remove the extension if stripExtension is enabled or replace it with `.js` + file.base = file.base.replace(extRegex, stripExtension ? '' : '.js') + } + + if (output.map) { + const map = `${file.base}.map` + + output.code += Buffer.from(`\n//# sourceMappingURL=${map}`) + + // add sourcemap to `files` array + this._.files.push({ + base: map, + dir: file.dir, + data: Buffer.from(output.map), + }) + } + + file.data = Buffer.from(output.code) + } + ) +} diff --git a/framework/vendure/.env.template b/packages/vendure/.env.template similarity index 100% rename from framework/vendure/.env.template rename to packages/vendure/.env.template diff --git a/packages/vendure/.prettierignore b/packages/vendure/.prettierignore new file mode 100644 index 000000000..f06235c46 --- /dev/null +++ b/packages/vendure/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/vendure/.prettierrc b/packages/vendure/.prettierrc new file mode 100644 index 000000000..e1076edfa --- /dev/null +++ b/packages/vendure/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/framework/vendure/README.md b/packages/vendure/README.md similarity index 95% rename from framework/vendure/README.md rename to packages/vendure/README.md index 7f1dccb3f..485125ce2 100644 --- a/framework/vendure/README.md +++ b/packages/vendure/README.md @@ -28,8 +28,10 @@ This provider makes use of GraphQL code generation. The [schema.graphql](./schem When developing the provider, changes to any GraphQL operations should be followed by re-generation of the types and schema files: -From the project root dir, run +From the package dir, run ```sh -graphql-codegen --config ./framework/vendure/codegen.json +yarn generate +# or +npm run generate ``` diff --git a/framework/vendure/codegen.json b/packages/vendure/codegen.json similarity index 75% rename from framework/vendure/codegen.json rename to packages/vendure/codegen.json index 79a2b6ffa..8c84d29a9 100644 --- a/framework/vendure/codegen.json +++ b/packages/vendure/codegen.json @@ -4,13 +4,13 @@ }, "documents": [ { - "./framework/vendure/**/*.{ts,tsx}": { + "./src/**/*.{ts,tsx}": { "noRequire": true } } ], "generates": { - "./framework/vendure/schema.d.ts": { + "./schema.d.ts": { "plugins": ["typescript", "typescript-operations"], "config": { "scalars": { @@ -18,7 +18,7 @@ } } }, - "./framework/vendure/schema.graphql": { + "./schema.graphql": { "plugins": ["schema-ast"] } }, diff --git a/packages/vendure/package.json b/packages/vendure/package.json new file mode 100644 index 000000000..484a52743 --- /dev/null +++ b/packages/vendure/package.json @@ -0,0 +1,85 @@ +{ + "name": "@vercel/commerce-vendure", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "release": "taskr release", + "build": "taskr build", + "dev": "taskr", + "types": "tsc --emitDeclarationOnly", + "prettier-fix": "prettier --write .", + "generate": "graphql-codegen" + }, + "sideEffects": false, + "type": "module", + "exports": { + ".": "./dist/index.js", + "./*": [ + "./dist/*.js", + "./dist/*/index.js" + ], + "./next.config": "./dist/next.config.cjs" + }, + "typesVersions": { + "*": { + "*": [ + "src/*", + "src/*/index" + ], + "next.config": [ + "dist/next.config.d.cts" + ] + } + }, + "files": [ + "dist", + "schema.d.ts" + ], + "publishConfig": { + "typesVersions": { + "*": { + "*": [ + "dist/*.d.ts", + "dist/*/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": { + "@graphql-codegen/cli": "^2.3.1", + "@graphql-codegen/schema-ast": "^2.4.1", + "@graphql-codegen/typescript": "^2.4.2", + "@graphql-codegen/typescript-operations": "^2.2.2", + "@taskr/clear": "^1.1.0", + "@taskr/esnext": "^1.1.0", + "@taskr/watch": "^1.1.0", + "@types/node": "^17.0.8", + "@types/react": "^17.0.38", + "lint-staged": "^12.1.7", + "next": "^12.0.8", + "prettier": "^2.5.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "taskr": "^1.1.0", + "taskr-swc": "^0.0.1", + "typescript": "^4.5.4" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,json}": [ + "prettier --write", + "git add" + ] + } +} diff --git a/framework/vendure/schema.d.ts b/packages/vendure/schema.d.ts similarity index 100% rename from framework/vendure/schema.d.ts rename to packages/vendure/schema.d.ts diff --git a/framework/vendure/schema.graphql b/packages/vendure/schema.graphql similarity index 100% rename from framework/vendure/schema.graphql rename to packages/vendure/schema.graphql diff --git a/packages/vendure/src/api/endpoints/cart/index.ts b/packages/vendure/src/api/endpoints/cart/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/vendure/src/api/endpoints/cart/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/vendure/src/api/endpoints/catalog/index.ts b/packages/vendure/src/api/endpoints/catalog/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/vendure/src/api/endpoints/catalog/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/vendure/src/api/endpoints/catalog/products.ts b/packages/vendure/src/api/endpoints/catalog/products.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/vendure/src/api/endpoints/catalog/products.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/framework/vendure/api/endpoints/checkout/index.ts b/packages/vendure/src/api/endpoints/checkout/index.ts similarity index 81% rename from framework/vendure/api/endpoints/checkout/index.ts rename to packages/vendure/src/api/endpoints/checkout/index.ts index 00c17f993..e063dbf58 100644 --- a/framework/vendure/api/endpoints/checkout/index.ts +++ b/packages/vendure/src/api/endpoints/checkout/index.ts @@ -1,9 +1,9 @@ import { NextApiHandler } from 'next' -import { CommerceAPI, createEndpoint, GetAPISchema } from '@commerce/api' -import { CheckoutSchema } from '@commerce/types/checkout' -import checkoutEndpoint from '@commerce/api/endpoints/checkout' +import { CommerceAPI, createEndpoint, GetAPISchema } from '@vercel/commerce/api' +import { CheckoutSchema } from '@vercel/commerce/types/checkout' +import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout' -const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({ +const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ req, res, config, @@ -48,7 +48,7 @@ export type CheckoutAPI = GetAPISchema export type CheckoutEndpoint = CheckoutAPI['endpoint'] -export const handlers: CheckoutEndpoint['handlers'] = { checkout } +export const handlers: CheckoutEndpoint['handlers'] = { getCheckout } const checkoutApi = createEndpoint({ handler: checkoutEndpoint, diff --git a/packages/vendure/src/api/endpoints/customer/address.ts b/packages/vendure/src/api/endpoints/customer/address.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/vendure/src/api/endpoints/customer/address.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/vendure/src/api/endpoints/customer/card.ts b/packages/vendure/src/api/endpoints/customer/card.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/vendure/src/api/endpoints/customer/card.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/vendure/src/api/endpoints/customer/index.ts b/packages/vendure/src/api/endpoints/customer/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/vendure/src/api/endpoints/customer/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/vendure/src/api/endpoints/login/index.ts b/packages/vendure/src/api/endpoints/login/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/vendure/src/api/endpoints/login/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/vendure/src/api/endpoints/logout/index.ts b/packages/vendure/src/api/endpoints/logout/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/vendure/src/api/endpoints/logout/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/vendure/src/api/endpoints/signup/index.ts b/packages/vendure/src/api/endpoints/signup/index.ts new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/vendure/src/api/endpoints/signup/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/vendure/src/api/endpoints/wishlist/index.tsx b/packages/vendure/src/api/endpoints/wishlist/index.tsx new file mode 100644 index 000000000..491bf0ac9 --- /dev/null +++ b/packages/vendure/src/api/endpoints/wishlist/index.tsx @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/framework/vendure/api/index.ts b/packages/vendure/src/api/index.ts similarity index 90% rename from framework/vendure/api/index.ts rename to packages/vendure/src/api/index.ts index 6762ee6aa..cbe56be56 100644 --- a/framework/vendure/api/index.ts +++ b/packages/vendure/src/api/index.ts @@ -1,5 +1,8 @@ -import type { APIProvider, CommerceAPIConfig } from '@commerce/api' -import { CommerceAPI, getCommerceApi as commerceApi } from '@commerce/api' +import type { CommerceAPIConfig } from '@vercel/commerce/api' +import { + CommerceAPI, + getCommerceApi as commerceApi, +} from '@vercel/commerce/api' import fetchGraphqlApi from './utils/fetch-graphql-api' import login from './operations/login' diff --git a/framework/vendure/api/operations/get-all-pages.ts b/packages/vendure/src/api/operations/get-all-pages.ts similarity index 88% rename from framework/vendure/api/operations/get-all-pages.ts rename to packages/vendure/src/api/operations/get-all-pages.ts index f76b7390f..7865cf908 100644 --- a/framework/vendure/api/operations/get-all-pages.ts +++ b/packages/vendure/src/api/operations/get-all-pages.ts @@ -1,6 +1,6 @@ import { VendureConfig } from '../' -import { OperationContext } from '@commerce/api/operations' -import { Provider } from '../../../bigcommerce/api' +import { OperationContext } from '@vercel/commerce/api/operations' +import { Provider } from '../' export type Page = any diff --git a/framework/vendure/api/operations/get-all-product-paths.ts b/packages/vendure/src/api/operations/get-all-product-paths.ts similarity index 78% rename from framework/vendure/api/operations/get-all-product-paths.ts rename to packages/vendure/src/api/operations/get-all-product-paths.ts index 54ca3b136..bdb47974f 100644 --- a/framework/vendure/api/operations/get-all-product-paths.ts +++ b/packages/vendure/src/api/operations/get-all-product-paths.ts @@ -1,9 +1,12 @@ -import { OperationContext, OperationOptions } from '@commerce/api/operations' -import type { GetAllProductPathsQuery } from '../../schema' +import { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +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' -import { BigcommerceConfig } from '../../../bigcommerce/api' +import { GetAllProductPathsOperation } from '@vercel/commerce/types/product' +import { VendureConfig } from '../' export type GetAllProductPathsResult = { products: Array<{ node: { path: string } }> @@ -16,13 +19,13 @@ export default function getAllProductPathsOperation({ T extends GetAllProductPathsOperation >(opts?: { variables?: T['variables'] - config?: BigcommerceConfig + config?: VendureConfig }): Promise async function getAllProductPaths( opts: { variables?: T['variables'] - config?: BigcommerceConfig + config?: VendureConfig } & OperationOptions ): Promise @@ -33,7 +36,7 @@ export default function getAllProductPathsOperation({ }: { query?: string variables?: T['variables'] - config?: BigcommerceConfig + config?: VendureConfig } = {}): Promise { const config = commerce.getConfig(cfg) // RecursivePartial forces the method to check for every prop in the data, which is diff --git a/framework/vendure/api/operations/get-all-products.ts b/packages/vendure/src/api/operations/get-all-products.ts similarity index 86% rename from framework/vendure/api/operations/get-all-products.ts rename to packages/vendure/src/api/operations/get-all-products.ts index 68d4ce9b7..f609ac805 100644 --- a/framework/vendure/api/operations/get-all-products.ts +++ b/packages/vendure/src/api/operations/get-all-products.ts @@ -1,9 +1,9 @@ -import { Product } from '@commerce/types/product' +import { Product } from '@vercel/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' +import { OperationContext } from '@vercel/commerce/api/operations' export type ProductVariables = { first?: number } diff --git a/framework/vendure/api/operations/get-customer-wishlist.ts b/packages/vendure/src/api/operations/get-customer-wishlist.ts similarity index 89% rename from framework/vendure/api/operations/get-customer-wishlist.ts rename to packages/vendure/src/api/operations/get-customer-wishlist.ts index 0040ef36d..35fca53c7 100644 --- a/framework/vendure/api/operations/get-customer-wishlist.ts +++ b/packages/vendure/src/api/operations/get-customer-wishlist.ts @@ -1,4 +1,4 @@ -import { OperationContext } from '@commerce/api/operations' +import { OperationContext } from '@vercel/commerce/api/operations' import { Provider, VendureConfig } from '../' export default function getCustomerWishlistOperation({ diff --git a/framework/vendure/api/operations/get-page.ts b/packages/vendure/src/api/operations/get-page.ts similarity index 93% rename from framework/vendure/api/operations/get-page.ts rename to packages/vendure/src/api/operations/get-page.ts index 59717dc84..909277b48 100644 --- a/framework/vendure/api/operations/get-page.ts +++ b/packages/vendure/src/api/operations/get-page.ts @@ -1,5 +1,5 @@ import { VendureConfig, Provider } from '../' -import { OperationContext } from '@commerce/api/operations' +import { OperationContext } from '@vercel/commerce/api/operations' export type Page = any diff --git a/framework/vendure/api/operations/get-product.ts b/packages/vendure/src/api/operations/get-product.ts similarity index 92% rename from framework/vendure/api/operations/get-product.ts rename to packages/vendure/src/api/operations/get-product.ts index 4ab9ed2d9..6b58e9694 100644 --- a/framework/vendure/api/operations/get-product.ts +++ b/packages/vendure/src/api/operations/get-product.ts @@ -1,7 +1,7 @@ -import { Product } from '@commerce/types/product' -import { OperationContext } from '@commerce/api/operations' +import { Product } from '@vercel/commerce/types/product' +import { OperationContext } from '@vercel/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({ diff --git a/framework/vendure/api/operations/get-site-info.ts b/packages/vendure/src/api/operations/get-site-info.ts similarity index 87% rename from framework/vendure/api/operations/get-site-info.ts rename to packages/vendure/src/api/operations/get-site-info.ts index acfcea424..ce2f5fa3f 100644 --- a/framework/vendure/api/operations/get-site-info.ts +++ b/packages/vendure/src/api/operations/get-site-info.ts @@ -1,9 +1,9 @@ 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' -import { Category } from '@commerce/types/site' +import { OperationContext } from '@vercel/commerce/api/operations' +import { Category } from '@vercel/commerce/types/site' export type GetSiteInfoResult< T extends { categories: any[]; brands: any[] } = { diff --git a/framework/vendure/api/operations/login.ts b/packages/vendure/src/api/operations/login.ts similarity index 90% rename from framework/vendure/api/operations/login.ts rename to packages/vendure/src/api/operations/login.ts index 4ad408e0a..07ee5fa1d 100644 --- a/framework/vendure/api/operations/login.ts +++ b/packages/vendure/src/api/operations/login.ts @@ -2,10 +2,10 @@ import type { ServerResponse } from 'http' import type { OperationContext, OperationOptions, -} from '@commerce/api/operations' -import { ValidationError } from '@commerce/utils/errors' +} from '@vercel/commerce/api/operations' +import { ValidationError } from '@vercel/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' diff --git a/framework/vendure/api/utils/fetch-graphql-api.ts b/packages/vendure/src/api/utils/fetch-graphql-api.ts similarity index 86% rename from framework/vendure/api/utils/fetch-graphql-api.ts rename to packages/vendure/src/api/utils/fetch-graphql-api.ts index 64a02dde5..7c0fbc792 100644 --- a/framework/vendure/api/utils/fetch-graphql-api.ts +++ b/packages/vendure/src/api/utils/fetch-graphql-api.ts @@ -1,5 +1,5 @@ -import { FetcherError } from '@commerce/utils/errors' -import type { GraphQLFetcher } from '@commerce/api' +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { GraphQLFetcher } from '@vercel/commerce/api' import { getCommerceApi } from '../' import fetch from './fetch' diff --git a/framework/vendure/api/utils/fetch.ts b/packages/vendure/src/api/utils/fetch.ts similarity index 100% rename from framework/vendure/api/utils/fetch.ts rename to packages/vendure/src/api/utils/fetch.ts diff --git a/packages/vendure/src/auth/index.ts b/packages/vendure/src/auth/index.ts new file mode 100644 index 000000000..36e757a89 --- /dev/null +++ b/packages/vendure/src/auth/index.ts @@ -0,0 +1,3 @@ +export { default as useLogin } from './use-login' +export { default as useLogout } from './use-logout' +export { default as useSignup } from './use-signup' diff --git a/framework/vendure/auth/use-login.tsx b/packages/vendure/src/auth/use-login.tsx similarity index 74% rename from framework/vendure/auth/use-login.tsx rename to packages/vendure/src/auth/use-login.tsx index a9b63e895..ce1a45456 100644 --- a/framework/vendure/auth/use-login.tsx +++ b/packages/vendure/src/auth/use-login.tsx @@ -1,10 +1,10 @@ import { useCallback } from 'react' -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' import { LoginHook } from '../types/login' -import { CommerceError, ValidationError } from '@commerce/utils/errors' +import { CommerceError, ValidationError } from '@vercel/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 @@ -39,15 +39,15 @@ export const handler: MutationHook = { useHook: ({ fetch }) => () => { - const { revalidate } = useCustomer() + const { mutate } = useCustomer() return useCallback( async function login(input) { const data = await fetch({ input }) - await revalidate() + await mutate() return data }, - [fetch, revalidate] + [fetch, mutate] ) }, } diff --git a/framework/vendure/auth/use-logout.tsx b/packages/vendure/src/auth/use-logout.tsx similarity index 81% rename from framework/vendure/auth/use-logout.tsx rename to packages/vendure/src/auth/use-logout.tsx index be1b18586..8a099cf77 100644 --- a/framework/vendure/auth/use-logout.tsx +++ b/packages/vendure/src/auth/use-logout.tsx @@ -1,8 +1,8 @@ import { useCallback } from 'react' -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' 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' diff --git a/framework/vendure/auth/use-signup.tsx b/packages/vendure/src/auth/use-signup.tsx similarity index 82% rename from framework/vendure/auth/use-signup.tsx rename to packages/vendure/src/auth/use-signup.tsx index 4018baed6..0c19c91bb 100644 --- a/framework/vendure/auth/use-signup.tsx +++ b/packages/vendure/src/auth/use-signup.tsx @@ -1,13 +1,13 @@ import { useCallback } from 'react' -import { MutationHook } from '@commerce/utils/types' -import { CommerceError, ValidationError } from '@commerce/utils/errors' -import useSignup, { UseSignup } from '@commerce/auth/use-signup' +import { MutationHook } from '@vercel/commerce/utils/types' +import { CommerceError, ValidationError } from '@vercel/commerce/utils/errors' +import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup' import useCustomer from '../customer/use-customer' import { RegisterCustomerInput, SignupMutation, SignupMutationVariables, -} from '../schema' +} from '../../schema' import { signupMutation } from '../utils/mutations/sign-up-mutation' import { SignupHook } from '../types/signup' @@ -57,15 +57,15 @@ export const handler: MutationHook = { useHook: ({ fetch }) => () => { - const { revalidate } = useCustomer() + const { mutate } = useCustomer() return useCallback( async function signup(input) { const data = await fetch({ input }) - await revalidate() + await mutate() return data }, - [fetch, revalidate] + [fetch, mutate] ) }, } diff --git a/packages/vendure/src/cart/index.ts b/packages/vendure/src/cart/index.ts new file mode 100644 index 000000000..3b8ba990e --- /dev/null +++ b/packages/vendure/src/cart/index.ts @@ -0,0 +1,4 @@ +export { default as useCart } from './use-cart' +export { default as useAddItem } from './use-add-item' +export { default as useRemoveItem } from './use-remove-item' +export { default as useUpdateItem } from './use-update-item' diff --git a/framework/vendure/cart/use-add-item.tsx b/packages/vendure/src/cart/use-add-item.tsx similarity index 84% rename from framework/vendure/cart/use-add-item.tsx rename to packages/vendure/src/cart/use-add-item.tsx index 7c131eaea..d7bb0bf66 100644 --- a/framework/vendure/cart/use-add-item.tsx +++ b/packages/vendure/src/cart/use-add-item.tsx @@ -1,9 +1,9 @@ -import useAddItem, { UseAddItem } from '@commerce/cart/use-add-item' -import { CommerceError } from '@commerce/utils/errors' -import { MutationHook } from '@commerce/utils/types' +import useAddItem, { UseAddItem } from '@vercel/commerce/cart/use-add-item' +import { CommerceError } from '@vercel/commerce/utils/errors' +import { MutationHook } from '@vercel/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' diff --git a/framework/vendure/cart/use-cart.tsx b/packages/vendure/src/cart/use-cart.tsx similarity index 86% rename from framework/vendure/cart/use-cart.tsx rename to packages/vendure/src/cart/use-cart.tsx index de42036b8..750f11040 100644 --- a/framework/vendure/cart/use-cart.tsx +++ b/packages/vendure/src/cart/use-cart.tsx @@ -1,6 +1,6 @@ -import { SWRHook } from '@commerce/utils/types' -import useCart, { UseCart } from '@commerce/cart/use-cart' -import { ActiveOrderQuery, CartFragment } from '../schema' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCart, { UseCart } from '@vercel/commerce/cart/use-cart' +import { ActiveOrderQuery, CartFragment } from '../../schema' import { normalizeCart } from '../utils/normalize' import { useMemo } from 'react' import { getCartQuery } from '../utils/queries/get-cart-query' diff --git a/framework/vendure/cart/use-remove-item.tsx b/packages/vendure/src/cart/use-remove-item.tsx similarity index 83% rename from framework/vendure/cart/use-remove-item.tsx rename to packages/vendure/src/cart/use-remove-item.tsx index dde8e18b3..2aa316505 100644 --- a/framework/vendure/cart/use-remove-item.tsx +++ b/packages/vendure/src/cart/use-remove-item.tsx @@ -4,15 +4,17 @@ import { MutationHook, MutationHookContext, SWRHook, -} from '@commerce/utils/types' -import useRemoveItem, { UseRemoveItem } from '@commerce/cart/use-remove-item' -import { CommerceError } from '@commerce/utils/errors' -import { Cart } from '@commerce/types/cart' +} from '@vercel/commerce/utils/types' +import useRemoveItem, { + UseRemoveItem, +} from '@vercel/commerce/cart/use-remove-item' +import { CommerceError } from '@vercel/commerce/utils/errors' +import { Cart } from '@vercel/commerce/types/cart' 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' diff --git a/framework/vendure/cart/use-update-item.tsx b/packages/vendure/src/cart/use-update-item.tsx similarity index 88% rename from framework/vendure/cart/use-update-item.tsx rename to packages/vendure/src/cart/use-update-item.tsx index 029966c5a..2f3c8d47b 100644 --- a/framework/vendure/cart/use-update-item.tsx +++ b/packages/vendure/src/cart/use-update-item.tsx @@ -3,15 +3,17 @@ import { HookFetcherContext, MutationHook, MutationHookContext, -} from '@commerce/utils/types' -import { CommerceError, ValidationError } from '@commerce/utils/errors' -import useUpdateItem, { UseUpdateItem } from '@commerce/cart/use-update-item' -import { CartItemBody, LineItem } from '@commerce/types/cart' +} from '@vercel/commerce/utils/types' +import { CommerceError, ValidationError } from '@vercel/commerce/utils/errors' +import useUpdateItem, { + UseUpdateItem, +} from '@vercel/commerce/cart/use-update-item' +import { CartItemBody, LineItem } from '@vercel/commerce/types/cart' 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' diff --git a/packages/vendure/src/checkout/use-checkout.tsx b/packages/vendure/src/checkout/use-checkout.tsx new file mode 100644 index 000000000..76997be73 --- /dev/null +++ b/packages/vendure/src/checkout/use-checkout.tsx @@ -0,0 +1,16 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useCheckout, { + UseCheckout, +} from '@vercel/commerce/checkout/use-checkout' + +export default useCheckout as UseCheckout + +export const handler: SWRHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ useData }) => + async (input) => ({}), +} diff --git a/framework/vendure/commerce.config.json b/packages/vendure/src/commerce.config.json similarity index 100% rename from framework/vendure/commerce.config.json rename to packages/vendure/src/commerce.config.json diff --git a/packages/vendure/src/customer/address/use-add-item.tsx b/packages/vendure/src/customer/address/use-add-item.tsx new file mode 100644 index 000000000..4f85c8472 --- /dev/null +++ b/packages/vendure/src/customer/address/use-add-item.tsx @@ -0,0 +1,17 @@ +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/address/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/packages/vendure/src/customer/card/use-add-item.tsx b/packages/vendure/src/customer/card/use-add-item.tsx new file mode 100644 index 000000000..77d149eff --- /dev/null +++ b/packages/vendure/src/customer/card/use-add-item.tsx @@ -0,0 +1,17 @@ +import useAddItem, { + UseAddItem, +} from '@vercel/commerce/customer/card/use-add-item' +import { MutationHook } from '@vercel/commerce/utils/types' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => + async () => ({}), +} diff --git a/packages/vendure/src/customer/index.ts b/packages/vendure/src/customer/index.ts new file mode 100644 index 000000000..6c903ecc5 --- /dev/null +++ b/packages/vendure/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/framework/vendure/customer/use-customer.tsx b/packages/vendure/src/customer/use-customer.tsx similarity index 81% rename from framework/vendure/customer/use-customer.tsx rename to packages/vendure/src/customer/use-customer.tsx index e9047485b..80da077ff 100644 --- a/framework/vendure/customer/use-customer.tsx +++ b/packages/vendure/src/customer/use-customer.tsx @@ -1,6 +1,8 @@ -import { SWRHook } from '@commerce/utils/types' -import useCustomer, { UseCustomer } from '@commerce/customer/use-customer' -import { ActiveCustomerQuery } from '../schema' +import { SWRHook } from '@vercel/commerce/utils/types' +import useCustomer, { + UseCustomer, +} from '@vercel/commerce/customer/use-customer' +import { ActiveCustomerQuery } from '../../schema' import { activeCustomerQuery } from '../utils/queries/active-customer-query' import { CustomerHook } from '../types/customer' diff --git a/framework/vendure/fetcher.ts b/packages/vendure/src/fetcher.ts similarity index 82% rename from framework/vendure/fetcher.ts rename to packages/vendure/src/fetcher.ts index bf8f0dcd8..ad0d4bc66 100644 --- a/framework/vendure/fetcher.ts +++ b/packages/vendure/src/fetcher.ts @@ -1,5 +1,5 @@ -import { Fetcher } from '@commerce/utils/types' -import { FetcherError } from '@commerce/utils/errors' +import { Fetcher } from '@vercel/commerce/utils/types' +import { FetcherError } from '@vercel/commerce/utils/errors' async function getText(res: Response) { try { @@ -41,9 +41,11 @@ export const fetcher: Fetcher = async ({ headers, credentials: 'include', }) - if (res.ok) { - const { data } = await res.json() + const { data, errors } = await res.json() + if (errors) { + throw await new FetcherError({ status: res.status, errors }) + } return data } diff --git a/packages/vendure/src/index.tsx b/packages/vendure/src/index.tsx new file mode 100644 index 000000000..14d0d4c3a --- /dev/null +++ b/packages/vendure/src/index.tsx @@ -0,0 +1,12 @@ +import { + getCommerceProvider, + useCommerce as useCoreCommerce, +} from '@vercel/commerce' +import { vendureProvider, VendureProvider } from './provider' + +export { vendureProvider } +export type { VendureProvider } + +export const CommerceProvider = getCommerceProvider(vendureProvider) + +export const useCommerce = () => useCoreCommerce() diff --git a/packages/vendure/src/next.config.cjs b/packages/vendure/src/next.config.cjs new file mode 100644 index 000000000..2e6842f00 --- /dev/null +++ b/packages/vendure/src/next.config.cjs @@ -0,0 +1,8 @@ +const commerce = require('./commerce.config.json') + +module.exports = { + commerce, + images: { + domains: ['localhost', 'demo.vendure.io','readonlydemo.vendure.io'], + }, +} diff --git a/packages/vendure/src/product/index.ts b/packages/vendure/src/product/index.ts new file mode 100644 index 000000000..426a3edcd --- /dev/null +++ b/packages/vendure/src/product/index.ts @@ -0,0 +1,2 @@ +export { default as usePrice } from './use-price' +export { default as useSearch } from './use-search' diff --git a/packages/vendure/src/product/use-price.tsx b/packages/vendure/src/product/use-price.tsx new file mode 100644 index 000000000..fd42d7033 --- /dev/null +++ b/packages/vendure/src/product/use-price.tsx @@ -0,0 +1,2 @@ +export * from '@vercel/commerce/product/use-price' +export { default } from '@vercel/commerce/product/use-price' diff --git a/framework/vendure/product/use-search.tsx b/packages/vendure/src/product/use-search.tsx similarity index 85% rename from framework/vendure/product/use-search.tsx rename to packages/vendure/src/product/use-search.tsx index 827b23623..86c6467d1 100644 --- a/framework/vendure/product/use-search.tsx +++ b/packages/vendure/src/product/use-search.tsx @@ -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 { SWRHook } from '@vercel/commerce/utils/types' +import useSearch, { UseSearch } from '@vercel/commerce/product/use-search' +import { Product } from '@vercel/commerce/types/product' +import { SearchQuery, SearchQueryVariables } from '../../schema' import { normalizeSearchResult } from '../utils/normalize' import { searchQuery } from '../utils/queries/search-query' import { SearchProductsHook } from '../types/product' diff --git a/framework/vendure/provider.ts b/packages/vendure/src/provider.ts similarity index 90% rename from framework/vendure/provider.ts rename to packages/vendure/src/provider.ts index e100c277b..73f7dd5b2 100644 --- a/framework/vendure/provider.ts +++ b/packages/vendure/src/provider.ts @@ -1,4 +1,3 @@ -import { Provider } from '@commerce' import { handler as useCart } from './cart/use-cart' import { handler as useAddItem } from './cart/use-add-item' import { handler as useUpdateItem } from './cart/use-update-item' @@ -10,7 +9,7 @@ import { handler as useLogout } from './auth/use-logout' import { handler as useSignup } from './auth/use-signup' import { fetcher } from './fetcher' -export const vendureProvider: Provider = { +export const vendureProvider = { locale: 'en-us', cartCookie: 'session', fetcher, @@ -19,3 +18,5 @@ export const vendureProvider: Provider = { products: { useSearch }, auth: { useLogin, useLogout, useSignup }, } + +export type VendureProvider = typeof vendureProvider diff --git a/packages/vendure/src/types/cart.ts b/packages/vendure/src/types/cart.ts new file mode 100644 index 000000000..e6838fb45 --- /dev/null +++ b/packages/vendure/src/types/cart.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/cart' diff --git a/packages/vendure/src/types/checkout.ts b/packages/vendure/src/types/checkout.ts new file mode 100644 index 000000000..d139db685 --- /dev/null +++ b/packages/vendure/src/types/checkout.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/checkout' diff --git a/packages/vendure/src/types/common.ts b/packages/vendure/src/types/common.ts new file mode 100644 index 000000000..23b8daa11 --- /dev/null +++ b/packages/vendure/src/types/common.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/common' diff --git a/packages/vendure/src/types/customer.ts b/packages/vendure/src/types/customer.ts new file mode 100644 index 000000000..c637055b9 --- /dev/null +++ b/packages/vendure/src/types/customer.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/customer' diff --git a/packages/vendure/src/types/index.ts b/packages/vendure/src/types/index.ts new file mode 100644 index 000000000..7ab0b7f64 --- /dev/null +++ b/packages/vendure/src/types/index.ts @@ -0,0 +1,25 @@ +import * as Cart from './cart' +import * as Checkout from './checkout' +import * as Common from './common' +import * as Customer from './customer' +import * as Login from './login' +import * as Logout from './logout' +import * as Page from './page' +import * as Product from './product' +import * as Signup from './signup' +import * as Site from './site' +import * as Wishlist from './wishlist' + +export type { + Cart, + Checkout, + Common, + Customer, + Login, + Logout, + Page, + Product, + Signup, + Site, + Wishlist, +} diff --git a/packages/vendure/src/types/login.ts b/packages/vendure/src/types/login.ts new file mode 100644 index 000000000..283a5751c --- /dev/null +++ b/packages/vendure/src/types/login.ts @@ -0,0 +1,12 @@ +import * as Core from '@vercel/commerce/types/login' +import type { LoginMutationVariables } from '../../schema' +import { LoginBody, LoginTypes } from '@vercel/commerce/types/login' + +export * from '@vercel/commerce/types/login' + +export type LoginHook = { + data: null + actionInput: LoginBody + fetcherInput: LoginBody + body: T['body'] +} diff --git a/packages/vendure/src/types/logout.ts b/packages/vendure/src/types/logout.ts new file mode 100644 index 000000000..1de06f8dc --- /dev/null +++ b/packages/vendure/src/types/logout.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/logout' diff --git a/packages/vendure/src/types/page.ts b/packages/vendure/src/types/page.ts new file mode 100644 index 000000000..12f6b02d7 --- /dev/null +++ b/packages/vendure/src/types/page.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/page' diff --git a/packages/vendure/src/types/product.ts b/packages/vendure/src/types/product.ts new file mode 100644 index 000000000..72ca02f02 --- /dev/null +++ b/packages/vendure/src/types/product.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/product' diff --git a/packages/vendure/src/types/signup.ts b/packages/vendure/src/types/signup.ts new file mode 100644 index 000000000..3f0d1af5a --- /dev/null +++ b/packages/vendure/src/types/signup.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/signup' diff --git a/packages/vendure/src/types/site.ts b/packages/vendure/src/types/site.ts new file mode 100644 index 000000000..96a2e476e --- /dev/null +++ b/packages/vendure/src/types/site.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/site' diff --git a/packages/vendure/src/types/wishlist.ts b/packages/vendure/src/types/wishlist.ts new file mode 100644 index 000000000..af92d9f63 --- /dev/null +++ b/packages/vendure/src/types/wishlist.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/wishlist' diff --git a/framework/vendure/utils/array-to-tree.ts b/packages/vendure/src/utils/array-to-tree.ts similarity index 100% rename from framework/vendure/utils/array-to-tree.ts rename to packages/vendure/src/utils/array-to-tree.ts diff --git a/framework/vendure/utils/fragments/cart-fragment.ts b/packages/vendure/src/utils/fragments/cart-fragment.ts similarity index 100% rename from framework/vendure/utils/fragments/cart-fragment.ts rename to packages/vendure/src/utils/fragments/cart-fragment.ts diff --git a/framework/vendure/utils/fragments/search-result-fragment.ts b/packages/vendure/src/utils/fragments/search-result-fragment.ts similarity index 95% rename from framework/vendure/utils/fragments/search-result-fragment.ts rename to packages/vendure/src/utils/fragments/search-result-fragment.ts index 6155b5b47..e143ce20b 100644 --- a/framework/vendure/utils/fragments/search-result-fragment.ts +++ b/packages/vendure/src/utils/fragments/search-result-fragment.ts @@ -3,7 +3,6 @@ export const searchResultFragment = /* GraphQL */ ` productId productName description - description slug sku currencyCode diff --git a/framework/vendure/utils/mutations/add-item-to-order-mutation.ts b/packages/vendure/src/utils/mutations/add-item-to-order-mutation.ts similarity index 100% rename from framework/vendure/utils/mutations/add-item-to-order-mutation.ts rename to packages/vendure/src/utils/mutations/add-item-to-order-mutation.ts diff --git a/framework/vendure/utils/mutations/adjust-order-line-mutation.ts b/packages/vendure/src/utils/mutations/adjust-order-line-mutation.ts similarity index 100% rename from framework/vendure/utils/mutations/adjust-order-line-mutation.ts rename to packages/vendure/src/utils/mutations/adjust-order-line-mutation.ts diff --git a/framework/vendure/utils/mutations/log-in-mutation.ts b/packages/vendure/src/utils/mutations/log-in-mutation.ts similarity index 100% rename from framework/vendure/utils/mutations/log-in-mutation.ts rename to packages/vendure/src/utils/mutations/log-in-mutation.ts diff --git a/framework/vendure/utils/mutations/log-out-mutation.ts b/packages/vendure/src/utils/mutations/log-out-mutation.ts similarity index 100% rename from framework/vendure/utils/mutations/log-out-mutation.ts rename to packages/vendure/src/utils/mutations/log-out-mutation.ts diff --git a/framework/vendure/utils/mutations/remove-order-line-mutation.ts b/packages/vendure/src/utils/mutations/remove-order-line-mutation.ts similarity index 100% rename from framework/vendure/utils/mutations/remove-order-line-mutation.ts rename to packages/vendure/src/utils/mutations/remove-order-line-mutation.ts diff --git a/framework/vendure/utils/mutations/sign-up-mutation.ts b/packages/vendure/src/utils/mutations/sign-up-mutation.ts similarity index 100% rename from framework/vendure/utils/mutations/sign-up-mutation.ts rename to packages/vendure/src/utils/mutations/sign-up-mutation.ts diff --git a/framework/vendure/utils/normalize.ts b/packages/vendure/src/utils/normalize.ts similarity index 82% rename from framework/vendure/utils/normalize.ts rename to packages/vendure/src/utils/normalize.ts index 09c1c6e42..adde43674 100644 --- a/framework/vendure/utils/normalize.ts +++ b/packages/vendure/src/utils/normalize.ts @@ -1,6 +1,6 @@ -import { Product } from '@commerce/types/product' -import { Cart } from '@commerce/types/cart' -import { CartFragment, SearchResultFragment } from '../schema' +import { Product } from '@vercel/commerce/types/product' +import { Cart } from '@vercel/commerce/types/cart' +import { CartFragment, SearchResultFragment } from '../../schema' export function normalizeSearchResult(item: SearchResultFragment): Product { return { @@ -9,7 +9,13 @@ export function normalizeSearchResult(item: SearchResultFragment): Product { description: item.description, slug: item.slug, path: item.slug, - images: [{ url: item.productAsset?.preview + '?w=800&mode=crop' || '' }], + images: [ + { + url: item.productAsset?.preview + ? item.productAsset?.preview + '?w=800&mode=crop' + : '', + }, + ], variants: [], price: { value: (item.priceWithTax as any).min / 100, diff --git a/framework/vendure/utils/queries/active-customer-query.ts b/packages/vendure/src/utils/queries/active-customer-query.ts similarity index 100% rename from framework/vendure/utils/queries/active-customer-query.ts rename to packages/vendure/src/utils/queries/active-customer-query.ts diff --git a/framework/vendure/utils/queries/get-all-product-paths-query.ts b/packages/vendure/src/utils/queries/get-all-product-paths-query.ts similarity index 100% rename from framework/vendure/utils/queries/get-all-product-paths-query.ts rename to packages/vendure/src/utils/queries/get-all-product-paths-query.ts diff --git a/framework/vendure/utils/queries/get-all-products-query.ts b/packages/vendure/src/utils/queries/get-all-products-query.ts similarity index 100% rename from framework/vendure/utils/queries/get-all-products-query.ts rename to packages/vendure/src/utils/queries/get-all-products-query.ts diff --git a/framework/vendure/utils/queries/get-cart-query.ts b/packages/vendure/src/utils/queries/get-cart-query.ts similarity index 100% rename from framework/vendure/utils/queries/get-cart-query.ts rename to packages/vendure/src/utils/queries/get-cart-query.ts diff --git a/framework/vendure/utils/queries/get-collections-query.ts b/packages/vendure/src/utils/queries/get-collections-query.ts similarity index 100% rename from framework/vendure/utils/queries/get-collections-query.ts rename to packages/vendure/src/utils/queries/get-collections-query.ts diff --git a/framework/vendure/utils/queries/get-product-query.ts b/packages/vendure/src/utils/queries/get-product-query.ts similarity index 100% rename from framework/vendure/utils/queries/get-product-query.ts rename to packages/vendure/src/utils/queries/get-product-query.ts diff --git a/framework/vendure/utils/queries/search-query.ts b/packages/vendure/src/utils/queries/search-query.ts similarity index 100% rename from framework/vendure/utils/queries/search-query.ts rename to packages/vendure/src/utils/queries/search-query.ts diff --git a/packages/vendure/src/wishlist/use-add-item.tsx b/packages/vendure/src/wishlist/use-add-item.tsx new file mode 100644 index 000000000..75f067c3a --- /dev/null +++ b/packages/vendure/src/wishlist/use-add-item.tsx @@ -0,0 +1,13 @@ +import { useCallback } from 'react' + +export function emptyHook() { + const useEmptyHook = async (options = {}) => { + return useCallback(async function () { + return Promise.resolve() + }, []) + } + + return useEmptyHook +} + +export default emptyHook diff --git a/packages/vendure/src/wishlist/use-remove-item.tsx b/packages/vendure/src/wishlist/use-remove-item.tsx new file mode 100644 index 000000000..a2d3a8a05 --- /dev/null +++ b/packages/vendure/src/wishlist/use-remove-item.tsx @@ -0,0 +1,17 @@ +import { useCallback } from 'react' + +type Options = { + includeProducts?: boolean +} + +export function emptyHook(options?: Options) { + const useEmptyHook = async ({ id }: { id: string | number }) => { + return useCallback(async function () { + return Promise.resolve() + }, []) + } + + return useEmptyHook +} + +export default emptyHook diff --git a/framework/vendure/wishlist/use-wishlist.tsx b/packages/vendure/src/wishlist/use-wishlist.tsx similarity index 90% rename from framework/vendure/wishlist/use-wishlist.tsx rename to packages/vendure/src/wishlist/use-wishlist.tsx index da941bf31..ab4192171 100644 --- a/framework/vendure/wishlist/use-wishlist.tsx +++ b/packages/vendure/src/wishlist/use-wishlist.tsx @@ -1,8 +1,8 @@ // TODO: replace this hook and other wishlist hooks with a handler, or remove them if // Vendure doesn't have a built-in wishlist -import { HookFetcher } from '@commerce/utils/types' -import { Product } from '../schema' +import { HookFetcher } from '@vercel/commerce/utils/types' +import { Product } from '../../schema' const defaultOpts = {} diff --git a/packages/vendure/taskfile.js b/packages/vendure/taskfile.js new file mode 100644 index 000000000..39b1b2a86 --- /dev/null +++ b/packages/vendure/taskfile.js @@ -0,0 +1,20 @@ +export async function build(task, opts) { + await task + .source('src/**/*.+(ts|tsx|js)') + .swc({ dev: opts.dev, outDir: 'dist', baseUrl: 'src' }) + .target('dist') + .source('src/**/*.+(cjs|json)') + .target('dist') + task.$.log('Compiled src files') +} + +export async function release(task) { + await task.clear('dist').start('build') +} + +export default async function dev(task) { + const opts = { dev: true } + await task.clear('dist') + await task.start('build', opts) + await task.watch('src/**/*.+(ts|tsx|js|cjs|json)', 'build', opts) +} diff --git a/packages/vendure/tsconfig.json b/packages/vendure/tsconfig.json new file mode 100644 index 000000000..cd04ab2ff --- /dev/null +++ b/packages/vendure/tsconfig.json @@ -0,0 +1,21 @@ +{ + "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, + "incremental": true, + "jsx": "react-jsx" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/.env.template b/site/.env.template similarity index 50% rename from .env.template rename to site/.env.template index 1f0fe0536..47b3df3c4 100644 --- a/.env.template +++ b/site/.env.template @@ -1,4 +1,14 @@ -# Available providers: bigcommerce, shopify, swell +# Available providers: +# @vercel/commerce-local +# @vercel/commerce-bigcommerce +# @vercel/commerce-shopify +# @vercel/commerce-swell +# @vercel/commerce-saleor +# @vercel/commerce-spree +# @vercel/commerce-ordercloud +# @vercel/commerce-vendure +# @vercel/commerce-kibocommerce +# @vercel/commerce-commercejs COMMERCE_PROVIDER= BIGCOMMERCE_STOREFRONT_API_URL= @@ -23,3 +33,17 @@ NEXT_PUBLIC_SALEOR_CHANNEL= NEXT_PUBLIC_VENDURE_SHOP_API_URL= NEXT_PUBLIC_VENDURE_LOCAL_URL= + +ORDERCLOUD_CLIENT_ID= +ORDERCLOUD_CLIENT_SECRET= +STRIPE_SECRET= + +KIBO_API_URL= +KIBO_CLIENT_ID= +KIBO_SHARED_SECRET= +KIBO_CART_COOKIE= +KIBO_CUSTOMER_COOKIE= +KIBO_API_HOST= + +NEXT_PUBLIC_COMMERCEJS_PUBLIC_KEY= +NEXT_PUBLIC_COMMERCEJS_DEPLOYMENT_URL= diff --git a/site/.eslintrc b/site/.eslintrc new file mode 100644 index 000000000..96856ac29 --- /dev/null +++ b/site/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": ["next", "prettier"], + "rules": { + "react/no-unescaped-entities": "off" + } +} diff --git a/site/.gitignore b/site/.gitignore new file mode 100644 index 000000000..22f1bf4f3 --- /dev/null +++ b/site/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +.next/ +out/ + +# production +/build + +# misc +.DS_Store +*.pem +.idea + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# vercel +.vercel diff --git a/site/.prettierignore b/site/.prettierignore new file mode 100644 index 000000000..105738ca9 --- /dev/null +++ b/site/.prettierignore @@ -0,0 +1,3 @@ +node_modules +.next +public \ No newline at end of file diff --git a/site/.prettierrc b/site/.prettierrc new file mode 100644 index 000000000..e1076edfa --- /dev/null +++ b/site/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/assets/base.css b/site/assets/base.css similarity index 100% rename from assets/base.css rename to site/assets/base.css diff --git a/assets/chrome-bug.css b/site/assets/chrome-bug.css similarity index 100% rename from assets/chrome-bug.css rename to site/assets/chrome-bug.css diff --git a/assets/components.css b/site/assets/components.css similarity index 100% rename from assets/components.css rename to site/assets/components.css diff --git a/assets/main.css b/site/assets/main.css similarity index 100% rename from assets/main.css rename to site/assets/main.css diff --git a/site/commerce-config.js b/site/commerce-config.js new file mode 100644 index 000000000..d52797e51 --- /dev/null +++ b/site/commerce-config.js @@ -0,0 +1,105 @@ +/** + * This file is expected to be used in next.config.js only + */ + +const path = require('path') +const fs = require('fs') +const merge = require('deepmerge') +const prettier = require('prettier') +const core = require('@vercel/commerce/config') + +const PROVIDERS = [ + '@vercel/commerce-local', + '@vercel/commerce-bigcommerce', + '@vercel/commerce-saleor', + '@vercel/commerce-shopify', + '@vercel/commerce-swell', + '@vercel/commerce-vendure', + '@vercel/commerce-ordercloud', + '@vercel/commerce-kibocommerce', + '@vercel/commerce-spree', + '@vercel/commerce-commercejs', +] + +function getProviderName() { + return ( + process.env.COMMERCE_PROVIDER || + (process.env.BIGCOMMERCE_STOREFRONT_API_URL + ? '@vercel/commerce-bigcommerce' + : process.env.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN + ? '@vercel/commerce-shopify' + : process.env.NEXT_PUBLIC_SWELL_STORE_ID + ? '@vercel/commerce-swell' + : '@vercel/commerce-local') + ) +} + +function withCommerceConfig(nextConfig = {}) { + const config = merge( + { commerce: { provider: getProviderName() } }, + nextConfig + ) + const { commerce } = config + const { provider } = commerce + + if (!provider) { + throw new Error( + `The commerce provider is missing, please add a valid provider name or its environment variables` + ) + } + if (!PROVIDERS.includes(provider)) { + throw new Error( + `The commerce provider "${provider}" can't be found, please use one of "${PROVIDERS.join( + ', ' + )}"` + ) + } + + // Update paths in `tsconfig.json` to point to the selected provider + if (commerce.updateTSConfig !== false) { + const tsconfigPath = path.join( + process.cwd(), + commerce.tsconfigPath || 'tsconfig.json' + ) + const tsconfig = require(tsconfigPath) + // The module path is a symlink in node_modules + // -> /node_modules/[name]/dist/index.js + const absolutePath = require.resolve(provider) + // but we want references to go to the real path in /packages instead + // -> packages/[name]/dist + const distPath = path.join(path.relative(process.cwd(), absolutePath), '..') + // -> /packages/[name]/src + const modulePath = path.join(distPath, '../src') + + tsconfig.compilerOptions.paths['@framework'] = [`${modulePath}`] + tsconfig.compilerOptions.paths['@framework/*'] = [`${modulePath}/*`] + + fs.writeFileSync( + tsconfigPath, + prettier.format(JSON.stringify(tsconfig), { parser: 'json' }) + ) + + const webpack = config.webpack + + // To improve the DX of using references, we'll switch from `src` to `dist` + // only for webpack so imports resolve correctly but typechecking goes to `src` + config.webpack = (cfg, options) => { + if (Array.isArray(cfg.resolve.plugins)) { + const jsconfigPaths = cfg.resolve.plugins.find( + (plugin) => plugin.constructor.name === 'JsConfigPathsPlugin' + ) + + if (jsconfigPaths) { + jsconfigPaths.paths['@framework'] = [distPath] + jsconfigPaths.paths['@framework/*'] = [`${distPath}/*`] + } + } + + return webpack ? webpack(cfg, options) : cfg + } + } + + return core.withCommerceConfig(config) +} + +module.exports = { withCommerceConfig, getProviderName } diff --git a/site/commerce.config.json b/site/commerce.config.json new file mode 100644 index 000000000..dd43ae077 --- /dev/null +++ b/site/commerce.config.json @@ -0,0 +1,15 @@ +{ + "features": { + "cart": true, + "search": true, + "wishlist": false, + "customerAuth": false, + "customCheckout": false + }, + "@vercel/commerce-bigcommerce": { + "features": { + "wishlist": false, + "customerAuth": false + } + } +} diff --git a/components/auth/ForgotPassword.tsx b/site/components/auth/ForgotPassword.tsx similarity index 100% rename from components/auth/ForgotPassword.tsx rename to site/components/auth/ForgotPassword.tsx diff --git a/components/auth/LoginView.tsx b/site/components/auth/LoginView.tsx similarity index 95% rename from components/auth/LoginView.tsx rename to site/components/auth/LoginView.tsx index 5e513deb9..3c8faef7c 100644 --- a/components/auth/LoginView.tsx +++ b/site/components/auth/LoginView.tsx @@ -4,9 +4,7 @@ import useLogin from '@framework/auth/use-login' import { useUI } from '@components/ui/context' import { validate } from 'email-validator' -interface Props {} - -const LoginView: FC = () => { +const LoginView: React.FC = () => { // Form State const [email, setEmail] = useState('') const [password, setPassword] = useState('') @@ -35,8 +33,8 @@ const LoginView: FC = () => { }) setLoading(false) closeModal() - } catch ({ errors }) { - setMessage(errors[0].message) + } catch (e: any) { + setMessage(e.errors[0].message) setLoading(false) setDisabled(false) } diff --git a/components/auth/SignUpView.tsx b/site/components/auth/SignUpView.tsx similarity index 100% rename from components/auth/SignUpView.tsx rename to site/components/auth/SignUpView.tsx diff --git a/components/auth/index.ts b/site/components/auth/index.ts similarity index 100% rename from components/auth/index.ts rename to site/components/auth/index.ts diff --git a/components/cart/CartItem/CartItem.module.css b/site/components/cart/CartItem/CartItem.module.css similarity index 100% rename from components/cart/CartItem/CartItem.module.css rename to site/components/cart/CartItem/CartItem.module.css diff --git a/components/cart/CartItem/CartItem.tsx b/site/components/cart/CartItem/CartItem.tsx similarity index 82% rename from components/cart/CartItem/CartItem.tsx rename to site/components/cart/CartItem/CartItem.tsx index a59024e06..ecd3e39ae 100644 --- a/components/cart/CartItem/CartItem.tsx +++ b/site/components/cart/CartItem/CartItem.tsx @@ -1,9 +1,8 @@ import { ChangeEvent, FocusEventHandler, useEffect, useState } from 'react' -import cn from 'classnames' +import cn from 'clsx' import Image from 'next/image' import Link from 'next/link' import s from './CartItem.module.css' -import { Trash, Plus, Minus, Cross } from '@components/icons' import { useUI } from '@components/ui/context' import type { LineItem } from '@commerce/types/cart' import usePrice from '@framework/product/use-price' @@ -18,6 +17,8 @@ type ItemOption = { valueId: number } +const placeholderImg = '/product-img-placeholder.svg' + const CartItem = ({ item, variant = 'default', @@ -70,6 +71,9 @@ const CartItem = ({ if (item.quantity !== Number(quantity)) { setQuantity(item.quantity) } + // TODO: currently not including quantity in deps is intended, but we should + // do this differently as it could break easily + // eslint-disable-next-line react-hooks/exhaustive-deps }, [item.quantity]) return ( @@ -82,25 +86,29 @@ const CartItem = ({

- closeSidebarIfPresent()} - className={s.productImage} - width={150} - height={150} - src={item.variant.image!.url} - alt={item.variant.image!.altText} - unoptimized - /> + + closeSidebarIfPresent()} + className={s.productImage} + width={150} + height={150} + src={item.variant.image?.url || placeholderImg} + alt={item.variant.image?.altText || "Product Image"} + unoptimized + /> +
- closeSidebarIfPresent()} - > - {item.name} - + + closeSidebarIfPresent()} + > + {item.name} + + {options && options.length > 0 && (
diff --git a/components/cart/CartItem/index.ts b/site/components/cart/CartItem/index.ts similarity index 100% rename from components/cart/CartItem/index.ts rename to site/components/cart/CartItem/index.ts diff --git a/components/cart/CartSidebarView/CartSidebarView.module.css b/site/components/cart/CartSidebarView/CartSidebarView.module.css similarity index 100% rename from components/cart/CartSidebarView/CartSidebarView.module.css rename to site/components/cart/CartSidebarView/CartSidebarView.module.css diff --git a/components/cart/CartSidebarView/CartSidebarView.tsx b/site/components/cart/CartSidebarView/CartSidebarView.tsx similarity index 96% rename from components/cart/CartSidebarView/CartSidebarView.tsx rename to site/components/cart/CartSidebarView/CartSidebarView.tsx index 128b928a8..327602c0b 100644 --- a/components/cart/CartSidebarView/CartSidebarView.tsx +++ b/site/components/cart/CartSidebarView/CartSidebarView.tsx @@ -1,4 +1,4 @@ -import cn from 'classnames' +import cn from 'clsx' import Link from 'next/link' import { FC } from 'react' import s from './CartSidebarView.module.css' @@ -74,9 +74,11 @@ const CartSidebarView: FC = () => { <>
- - My Cart - + + + My Cart + +
    {data!.lineItems.map((item: any) => ( diff --git a/components/cart/CartSidebarView/index.ts b/site/components/cart/CartSidebarView/index.ts similarity index 100% rename from components/cart/CartSidebarView/index.ts rename to site/components/cart/CartSidebarView/index.ts diff --git a/components/cart/index.ts b/site/components/cart/index.ts similarity index 100% rename from components/cart/index.ts rename to site/components/cart/index.ts diff --git a/components/checkout/CheckoutSidebarView/CheckoutSidebarView.module.css b/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.module.css similarity index 100% rename from components/checkout/CheckoutSidebarView/CheckoutSidebarView.module.css rename to site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.module.css diff --git a/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx b/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx similarity index 50% rename from components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx rename to site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx index 74c2e09b7..20542c8f2 100644 --- a/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx +++ b/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx @@ -1,35 +1,56 @@ import Link from 'next/link' -import { FC } from 'react' +import { FC, useState } from 'react' import CartItem from '@components/cart/CartItem' import { Button, Text } from '@components/ui' -import { initialState as initialUIState, useUI } from '@components/ui/context' +import { useUI } from '@components/ui/context' +import SidebarLayout from '@components/common/SidebarLayout' import useCart from '@framework/cart/use-cart' import usePrice from '@framework/product/use-price' +import useCheckout from '@framework/checkout/use-checkout' import ShippingWidget from '../ShippingWidget' import PaymentWidget from '../PaymentWidget' -import SidebarLayout from '@components/common/SidebarLayout' import s from './CheckoutSidebarView.module.css' +import { useCheckoutContext } from '../context' const CheckoutSidebarView: FC = () => { - const { paymentMethodDetails, setPaymentMethodDetails, setSidebarView } = useUI() - const { data } = useCart() + const [loadingSubmit, setLoadingSubmit] = useState(false) + const { paymentMethodDetails, setPaymentMethodDetails, setSidebarView, closeSidebar } = useUI() + const { data: cartData, mutate: refreshCart } = useCart() + const { data: checkoutData, submit: onCheckout } = useCheckout() + const { clearCheckoutFields } = useCheckoutContext() + + async function handleSubmit(event: React.ChangeEvent) { + try { + setLoadingSubmit(true) + event.preventDefault() + + await onCheckout() + clearCheckoutFields() + setLoadingSubmit(false) + refreshCart() + closeSidebar() + } catch { + // TODO - handle error UI here. + setLoadingSubmit(false) + } + } const { price: subTotal } = usePrice( - data && { - amount: Number(data.subtotalPrice), - currencyCode: data.currency.code, + cartData && { + amount: Number(cartData.subtotalPrice), + currencyCode: cartData.currency.code, } ) const { price: total } = usePrice( - data && { - amount: Number(data.totalPrice), - currencyCode: data.currency.code, + cartData && { + amount: Number(cartData.totalPrice), + currencyCode: cartData.currency.code, } ) const { price: taxes } = usePrice( data && { - amount: Number(data.taxes), - currencyCode: data.currency.code, + amount: Number(cartData.taxes), + currencyCode: cartData.currency.code, } ) @@ -40,10 +61,13 @@ const CheckoutSidebarView: FC = () => { >
    - Checkout + + Checkout + { if (paymentMethodDetails.paymentMethod) { setPaymentMethodDetails(initialUIState.paymentMethodDetails) @@ -52,21 +76,27 @@ const CheckoutSidebarView: FC = () => { } }} /> - setSidebarView('SHIPPING_VIEW')} /> + setSidebarView('SHIPPING_VIEW')} + />
      - {data!.lineItems?.map((item: any) => ( + {cartData!.lineItems.map((item: any) => ( ))}
    -
    +
    • Subtotal @@ -74,7 +104,7 @@ const CheckoutSidebarView: FC = () => {
    • Taxes - {data.taxes ? taxes : 'Calculated at checkout'} + {cartData.taxes ? taxes : 'Calculated at checkout'}
    • Shipping @@ -86,15 +116,17 @@ const CheckoutSidebarView: FC = () => { {total}
    - {/* Once data is correcly filled */} - {/* */} -
    -
+ ) } diff --git a/components/checkout/CheckoutSidebarView/index.ts b/site/components/checkout/CheckoutSidebarView/index.ts similarity index 100% rename from components/checkout/CheckoutSidebarView/index.ts rename to site/components/checkout/CheckoutSidebarView/index.ts diff --git a/components/checkout/PaymentMethodView/PaymentMethodView.module.css b/site/components/checkout/PaymentMethodView/PaymentMethodView.module.css similarity index 100% rename from components/checkout/PaymentMethodView/PaymentMethodView.module.css rename to site/components/checkout/PaymentMethodView/PaymentMethodView.module.css diff --git a/site/components/checkout/PaymentMethodView/PaymentMethodView.tsx b/site/components/checkout/PaymentMethodView/PaymentMethodView.tsx new file mode 100644 index 000000000..092559421 --- /dev/null +++ b/site/components/checkout/PaymentMethodView/PaymentMethodView.tsx @@ -0,0 +1,208 @@ +import { FC } from 'react' +import cn from 'clsx' +import { + CardNumberElement, + CardExpiryElement, + CardCvcElement, + useStripe, + useElements +} from '@stripe/react-stripe-js' +import useAddCard from '@framework/customer/card/use-add-item' +import { Button, Text } from '@components/ui' +import { useUI } from '@components/ui/context' +import SidebarLayout from '@components/common/SidebarLayout' +import countries from '@lib/countries' +import s from './PaymentMethodView.module.css' + +interface Form extends HTMLFormElement { + cardHolder: HTMLInputElement + cardNumber: HTMLInputElement + cardExpireDate: HTMLInputElement + cardCvc: HTMLInputElement + firstName: HTMLInputElement + lastName: HTMLInputElement + company: HTMLInputElement + streetNumber: HTMLInputElement + zipCode: HTMLInputElement + city: HTMLInputElement + country: HTMLSelectElement +} + +const PaymentMethodView: FC = () => { + const { paymentMethodDetails, setPaymentMethodDetails, setSidebarView } = useUI() + const { address } = paymentMethodDetails + + const addCard = useAddCard() + + const stripe = useStripe() + const elements = useElements() + + async function handleSubmit(event: React.ChangeEvent
) { + event.preventDefault() + if (!stripe || !elements) { + return + } + + const card = elements.getElement(CardNumberElement) + + const { error, paymentMethod } = await stripe.createPaymentMethod({ + type: 'card', + card + }) + + if (error) { + console.error(error) + } + + setPaymentMethodDetails({ address, paymentMethod }) + + await addCard({ + cardHolder: event.target.cardHolder.value, + cardNumber: event.target.cardNumber.value, + cardExpireDate: event.target.cardExpireDate.value, + cardCvc: event.target.cardCvc.value, + firstName: event.target.firstName.value, + lastName: event.target.lastName.value, + company: event.target.company.value, + streetNumber: event.target.streetNumber.value, + zipCode: event.target.zipCode.value, + city: event.target.city.value, + country: event.target.country.value, + }) + + setSidebarView('CHECKOUT_VIEW') + } + + const updateAddressData = ({ target }: any) => setPaymentMethodDetails({ + ...paymentMethodDetails, + address: { + ...paymentMethodDetails.address, + [target.name]: target.value, + }, + }) + + return ( + + setSidebarView('CHECKOUT_VIEW')}> +
+ Payment Method +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+
+ + +
+
+
+
+ +
+
+
+ ) +} + +export default PaymentMethodView diff --git a/components/checkout/PaymentMethodView/index.ts b/site/components/checkout/PaymentMethodView/index.ts similarity index 100% rename from components/checkout/PaymentMethodView/index.ts rename to site/components/checkout/PaymentMethodView/index.ts diff --git a/components/checkout/PaymentWidget/PaymentWidget.module.css b/site/components/checkout/PaymentWidget/PaymentWidget.module.css similarity index 100% rename from components/checkout/PaymentWidget/PaymentWidget.module.css rename to site/components/checkout/PaymentWidget/PaymentWidget.module.css diff --git a/components/checkout/PaymentWidget/PaymentWidget.tsx b/site/components/checkout/PaymentWidget/PaymentWidget.tsx similarity index 79% rename from components/checkout/PaymentWidget/PaymentWidget.tsx rename to site/components/checkout/PaymentWidget/PaymentWidget.tsx index f3e89c730..2533118c6 100644 --- a/components/checkout/PaymentWidget/PaymentWidget.tsx +++ b/site/components/checkout/PaymentWidget/PaymentWidget.tsx @@ -1,13 +1,14 @@ import { FC } from 'react' import s from './PaymentWidget.module.css' -import { ChevronRight, CreditCard, Trash } from '@components/icons' +import { ChevronRight, CreditCard, Check, Trash } from '@components/icons' import { useUI } from '@components/ui/context' interface ComponentProps { onClick?: () => any + isValid?: boolean } -const PaymentWidget: FC = ({ onClick }) => { +const PaymentWidget: FC = ({ onClick, isValid }) => { const { paymentMethodDetails } = useUI() console.log(paymentMethodDetails) @@ -30,13 +31,7 @@ const PaymentWidget: FC = ({ onClick }) => { }
-
- {paymentMethodDetails?.paymentMethod ? - - : - - } -
+
{isValid ? : }
) } diff --git a/components/checkout/PaymentWidget/index.ts b/site/components/checkout/PaymentWidget/index.ts similarity index 100% rename from components/checkout/PaymentWidget/index.ts rename to site/components/checkout/PaymentWidget/index.ts diff --git a/components/checkout/ShippingView/ShippingView.module.css b/site/components/checkout/ShippingView/ShippingView.module.css similarity index 100% rename from components/checkout/ShippingView/ShippingView.module.css rename to site/components/checkout/ShippingView/ShippingView.module.css diff --git a/site/components/checkout/ShippingView/ShippingView.tsx b/site/components/checkout/ShippingView/ShippingView.tsx new file mode 100644 index 000000000..ef7c74325 --- /dev/null +++ b/site/components/checkout/ShippingView/ShippingView.tsx @@ -0,0 +1,118 @@ +import { FC } from 'react' +import cn from 'clsx' + +import Button from '@components/ui/Button' +import { useUI } from '@components/ui/context' +import SidebarLayout from '@components/common/SidebarLayout' +import useAddAddress from '@framework/customer/address/use-add-item' + +import s from './ShippingView.module.css' + +interface Form extends HTMLFormElement { + cardHolder: HTMLInputElement + cardNumber: HTMLInputElement + cardExpireDate: HTMLInputElement + cardCvc: HTMLInputElement + firstName: HTMLInputElement + lastName: HTMLInputElement + company: HTMLInputElement + streetNumber: HTMLInputElement + zipCode: HTMLInputElement + city: HTMLInputElement + country: HTMLSelectElement +} + +const ShippingView: FC = () => { + const { setSidebarView } = useUI() + const addAddress = useAddAddress() + + async function handleSubmit(event: React.ChangeEvent
) { + event.preventDefault() + + await addAddress({ + type: event.target.type.value, + firstName: event.target.firstName.value, + lastName: event.target.lastName.value, + company: event.target.company.value, + streetNumber: event.target.streetNumber.value, + apartments: event.target.streetNumber.value, + zipCode: event.target.zipCode.value, + city: event.target.city.value, + country: event.target.country.value, + }) + + setSidebarView('CHECKOUT_VIEW') + } + + return ( + + setSidebarView('CHECKOUT_VIEW')}> +
+

+ Shipping +

+
+
+ + Same as billing address +
+
+ + + Use a different shipping address + +
+
+
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+
+ + +
+
+
+
+ +
+
+
+ ) +} + +export default ShippingView diff --git a/components/checkout/ShippingView/index.ts b/site/components/checkout/ShippingView/index.ts similarity index 100% rename from components/checkout/ShippingView/index.ts rename to site/components/checkout/ShippingView/index.ts diff --git a/components/checkout/ShippingWidget/ShippingWidget.module.css b/site/components/checkout/ShippingWidget/ShippingWidget.module.css similarity index 100% rename from components/checkout/ShippingWidget/ShippingWidget.module.css rename to site/components/checkout/ShippingWidget/ShippingWidget.module.css diff --git a/components/checkout/ShippingWidget/ShippingWidget.tsx b/site/components/checkout/ShippingWidget/ShippingWidget.tsx similarity index 83% rename from components/checkout/ShippingWidget/ShippingWidget.tsx rename to site/components/checkout/ShippingWidget/ShippingWidget.tsx index 15c4783cb..c97b6a4bb 100644 --- a/components/checkout/ShippingWidget/ShippingWidget.tsx +++ b/site/components/checkout/ShippingWidget/ShippingWidget.tsx @@ -1,13 +1,14 @@ import { FC } from 'react' import s from './ShippingWidget.module.css' -import { ChevronRight, MapPin } from '@components/icons' import { useUI } from '@components/ui/context' +import { ChevronRight, MapPin, Check } from '@components/icons' interface ComponentProps { onClick?: () => any + isValid?: boolean } -const ShippingWidget: FC = ({ onClick }) => { +const ShippingWidget: FC = ({ onClick, isValid }) => { const { shippingAddress } = useUI() const isAddressKnown = shippingAddress.addressLine1 !== '' && shippingAddress.city !== '' && shippingAddress.countryOrRegion !== '' @@ -32,9 +33,7 @@ const ShippingWidget: FC = ({ onClick }) => { }
-
- -
+
{isValid ? : }
) } diff --git a/components/checkout/ShippingWidget/index.ts b/site/components/checkout/ShippingWidget/index.ts similarity index 100% rename from components/checkout/ShippingWidget/index.ts rename to site/components/checkout/ShippingWidget/index.ts diff --git a/site/components/checkout/context.tsx b/site/components/checkout/context.tsx new file mode 100644 index 000000000..b53b45a5d --- /dev/null +++ b/site/components/checkout/context.tsx @@ -0,0 +1,111 @@ +import React, { + FC, + useCallback, + useMemo, + useReducer, + useContext, + createContext, +} from 'react' +import type { CardFields } from '@commerce/types/customer/card' +import type { AddressFields } from '@commerce/types/customer/address' + +export type State = { + cardFields: CardFields + addressFields: AddressFields +} + +type CheckoutContextType = State & { + setCardFields: (cardFields: CardFields) => void + setAddressFields: (addressFields: AddressFields) => void + clearCheckoutFields: () => void +} + +type Action = + | { + type: 'SET_CARD_FIELDS' + card: CardFields + } + | { + type: 'SET_ADDRESS_FIELDS' + address: AddressFields + } + | { + type: 'CLEAR_CHECKOUT_FIELDS' + } + +const initialState: State = { + cardFields: {} as CardFields, + addressFields: {} as AddressFields, +} + +export const CheckoutContext = createContext(initialState) + +CheckoutContext.displayName = 'CheckoutContext' + +const checkoutReducer = (state: State, action: Action): State => { + switch (action.type) { + case 'SET_CARD_FIELDS': + return { + ...state, + cardFields: action.card, + } + case 'SET_ADDRESS_FIELDS': + return { + ...state, + addressFields: action.address, + } + case 'CLEAR_CHECKOUT_FIELDS': + return { + ...state, + cardFields: initialState.cardFields, + addressFields: initialState.addressFields, + } + default: + return state + } +} + +export const CheckoutProvider: FC = (props) => { + const [state, dispatch] = useReducer(checkoutReducer, initialState) + + const setCardFields = useCallback( + (card: CardFields) => dispatch({ type: 'SET_CARD_FIELDS', card }), + [dispatch] + ) + + const setAddressFields = useCallback( + (address: AddressFields) => + dispatch({ type: 'SET_ADDRESS_FIELDS', address }), + [dispatch] + ) + + const clearCheckoutFields = useCallback( + () => dispatch({ type: 'CLEAR_CHECKOUT_FIELDS' }), + [dispatch] + ) + + const cardFields = useMemo(() => state.cardFields, [state.cardFields]) + + const addressFields = useMemo(() => state.addressFields, [state.addressFields]) + + const value = useMemo( + () => ({ + cardFields, + addressFields, + setCardFields, + setAddressFields, + clearCheckoutFields, + }), + [cardFields, addressFields, setCardFields, setAddressFields, clearCheckoutFields] + ) + + return +} + +export const useCheckoutContext = () => { + const context = useContext(CheckoutContext) + if (context === undefined) { + throw new Error(`useCheckoutContext must be used within a CheckoutProvider`) + } + return context +} diff --git a/components/checkout/withStripeElements.tsx b/site/components/checkout/withStripeElements.tsx similarity index 100% rename from components/checkout/withStripeElements.tsx rename to site/components/checkout/withStripeElements.tsx diff --git a/components/common/Avatar/Avatar.tsx b/site/components/common/Avatar/Avatar.tsx similarity index 100% rename from components/common/Avatar/Avatar.tsx rename to site/components/common/Avatar/Avatar.tsx diff --git a/components/common/Avatar/index.ts b/site/components/common/Avatar/index.ts similarity index 100% rename from components/common/Avatar/index.ts rename to site/components/common/Avatar/index.ts diff --git a/site/components/common/FeatureBar/FeatureBar.module.css b/site/components/common/FeatureBar/FeatureBar.module.css new file mode 100644 index 000000000..50ebeca57 --- /dev/null +++ b/site/components/common/FeatureBar/FeatureBar.module.css @@ -0,0 +1,6 @@ +.root { + @apply text-center p-6 bg-primary text-sm flex-row + justify-center items-center font-medium fixed bottom-0 + w-full z-30 transition-all duration-300 ease-out + md:flex md:text-left; +} diff --git a/components/common/FeatureBar/FeatureBar.tsx b/site/components/common/FeatureBar/FeatureBar.tsx similarity index 96% rename from components/common/FeatureBar/FeatureBar.tsx rename to site/components/common/FeatureBar/FeatureBar.tsx index 8923a721e..075528618 100644 --- a/components/common/FeatureBar/FeatureBar.tsx +++ b/site/components/common/FeatureBar/FeatureBar.tsx @@ -1,4 +1,4 @@ -import cn from 'classnames' +import cn from 'clsx' import s from './FeatureBar.module.css' interface FeatureBarProps { diff --git a/components/common/FeatureBar/index.ts b/site/components/common/FeatureBar/index.ts similarity index 100% rename from components/common/FeatureBar/index.ts rename to site/components/common/FeatureBar/index.ts diff --git a/components/common/Footer/Footer.module.css b/site/components/common/Footer/Footer.module.css similarity index 100% rename from components/common/Footer/Footer.module.css rename to site/components/common/Footer/Footer.module.css diff --git a/components/common/Footer/Footer.tsx b/site/components/common/Footer/Footer.tsx similarity index 98% rename from components/common/Footer/Footer.tsx rename to site/components/common/Footer/Footer.tsx index 04b80404e..18e9b4027 100644 --- a/components/common/Footer/Footer.tsx +++ b/site/components/common/Footer/Footer.tsx @@ -1,5 +1,5 @@ import { FC } from 'react' -import cn from 'classnames' +import cn from 'clsx' import Link from 'next/link' import { useRouter } from 'next/router' import type { Page } from '@commerce/types/page' @@ -73,7 +73,7 @@ const Footer: FC = ({ className, pages }) => {
Created by { + return ( + + + + + ) +} + +export default Head diff --git a/components/common/Head/index.ts b/site/components/common/Head/index.ts similarity index 100% rename from components/common/Head/index.ts rename to site/components/common/Head/index.ts diff --git a/components/common/HomeAllProductsGrid/HomeAllProductsGrid.module.css b/site/components/common/HomeAllProductsGrid/HomeAllProductsGrid.module.css similarity index 100% rename from components/common/HomeAllProductsGrid/HomeAllProductsGrid.module.css rename to site/components/common/HomeAllProductsGrid/HomeAllProductsGrid.module.css diff --git a/components/common/HomeAllProductsGrid/HomeAllProductsGrid.tsx b/site/components/common/HomeAllProductsGrid/HomeAllProductsGrid.tsx similarity index 100% rename from components/common/HomeAllProductsGrid/HomeAllProductsGrid.tsx rename to site/components/common/HomeAllProductsGrid/HomeAllProductsGrid.tsx diff --git a/components/common/HomeAllProductsGrid/index.ts b/site/components/common/HomeAllProductsGrid/index.ts similarity index 100% rename from components/common/HomeAllProductsGrid/index.ts rename to site/components/common/HomeAllProductsGrid/index.ts diff --git a/components/common/I18nWidget/I18nWidget.module.css b/site/components/common/I18nWidget/I18nWidget.module.css similarity index 92% rename from components/common/I18nWidget/I18nWidget.module.css rename to site/components/common/I18nWidget/I18nWidget.module.css index 269aa5f61..5b486d537 100644 --- a/components/common/I18nWidget/I18nWidget.module.css +++ b/site/components/common/I18nWidget/I18nWidget.module.css @@ -16,16 +16,6 @@ .dropdownMenu { @apply fixed right-0 top-12 mt-2 origin-top-right outline-none bg-primary z-40 w-full h-full; - - @screen lg { - @apply absolute border border-accent-1 shadow-lg w-56 h-auto; - } -} - -.closeButton { - @screen md { - @apply hidden; - } } .item { @@ -44,3 +34,15 @@ .icon.active { transform: rotate(180deg); } + +@screen lg { + .dropdownMenu { + @apply absolute border border-accent-1 shadow-lg w-56 h-auto; + } +} + +@screen md { + .closeButton { + @apply hidden; + } +} diff --git a/components/common/I18nWidget/I18nWidget.tsx b/site/components/common/I18nWidget/I18nWidget.tsx similarity index 98% rename from components/common/I18nWidget/I18nWidget.tsx rename to site/components/common/I18nWidget/I18nWidget.tsx index 58135f12a..d09dd1d6d 100644 --- a/components/common/I18nWidget/I18nWidget.tsx +++ b/site/components/common/I18nWidget/I18nWidget.tsx @@ -1,4 +1,4 @@ -import cn from 'classnames' +import cn from 'clsx' import Link from 'next/link' import { FC, useState } from 'react' import { useRouter } from 'next/router' diff --git a/components/common/I18nWidget/index.ts b/site/components/common/I18nWidget/index.ts similarity index 100% rename from components/common/I18nWidget/index.ts rename to site/components/common/I18nWidget/index.ts diff --git a/components/common/Layout/Layout.module.css b/site/components/common/Layout/Layout.module.css similarity index 100% rename from components/common/Layout/Layout.module.css rename to site/components/common/Layout/Layout.module.css diff --git a/components/common/Layout/Layout.tsx b/site/components/common/Layout/Layout.tsx similarity index 76% rename from components/common/Layout/Layout.tsx rename to site/components/common/Layout/Layout.tsx index bf761255a..756292c4c 100644 --- a/components/common/Layout/Layout.tsx +++ b/site/components/common/Layout/Layout.tsx @@ -1,4 +1,4 @@ -import cn from 'classnames' +import cn from 'clsx' import React, { FC } from 'react' import dynamic from 'next/dynamic' import { useRouter } from 'next/router' @@ -10,9 +10,12 @@ import type { Category } from '@commerce/types/site' import ShippingView from '@components/checkout/ShippingView' import CartSidebarView from '@components/cart/CartSidebarView' import { useAcceptCookies } from '@lib/hooks/useAcceptCookies' -import { Sidebar, Button, Modal, LoadingDots } from '@components/ui' +import { Sidebar, Button, LoadingDots } from '@components/ui' import PaymentMethodView from '@components/checkout/PaymentMethodView' import CheckoutSidebarView from '@components/checkout/CheckoutSidebarView' +import { CheckoutProvider } from '@components/checkout/context' +import MenuSidebarView, { Link } from '../UserNav/MenuSidebarView' + import LoginView from '@components/auth/LoginView' import s from './Layout.module.css' import withStripeElements from '@components/checkout/withStripeElements' @@ -24,22 +27,36 @@ const Loading = () => ( ) const dynamicProps = { - loading: () => , + loading: Loading, } const SignUpView = dynamic( () => import('@components/auth/SignUpView'), - dynamicProps + { + ...dynamicProps + } ) const ForgotPassword = dynamic( () => import('@components/auth/ForgotPassword'), - dynamicProps + { + ...dynamicProps + } ) const FeatureBar = dynamic( () => import('@components/common/FeatureBar'), - dynamicProps + { + ...dynamicProps + } +) + +const Modal = dynamic( + () => import('@components/ui/Modal'), + { + ...dynamicProps, + ssr: false + } ) interface Props { @@ -69,12 +86,14 @@ const ModalUI: FC = () => { ) : null } -const SidebarView: FC<{ sidebarView: string; closeSidebar(): any }> = ({ - sidebarView, - closeSidebar, -}) => { +const SidebarView: FC<{ + sidebarView: string + closeSidebar(): any + links: Link[] +}> = ({ sidebarView, closeSidebar, links }) => { return ( + {sidebarView === 'MOBILEMENU_VIEW' && } {sidebarView === 'CART_VIEW' && } {sidebarView === 'CHECKOUT_VIEW' && } {sidebarView === 'PAYMENT_VIEW' && } @@ -83,12 +102,14 @@ const SidebarView: FC<{ sidebarView: string; closeSidebar(): any }> = ({ ) } -const SidebarUI: FC = () => { - const { displaySidebar, closeSidebar, shippingAddress, sidebarView, paymentMethodDetails } = useUI() - console.log("paymentMethodDetails", paymentMethodDetails) - console.log("shippingAddress", shippingAddress) +const SidebarUI: FC<{ links: any }> = ({ links }) => { + const { displaySidebar, closeSidebar, sidebarView } = useUI() return displaySidebar ? ( - + ) : null } @@ -110,7 +131,9 @@ const Layout: FC = ({
{children}
- + + + = ({ links }) => (
-
- -
+ {process.env.COMMERCE_SEARCH_ENABLED && ( +
+ +
+ )} ) diff --git a/components/common/Navbar/NavbarRoot.tsx b/site/components/common/Navbar/NavbarRoot.tsx similarity index 96% rename from components/common/Navbar/NavbarRoot.tsx rename to site/components/common/Navbar/NavbarRoot.tsx index 2eb8c5429..16556e842 100644 --- a/components/common/Navbar/NavbarRoot.tsx +++ b/site/components/common/Navbar/NavbarRoot.tsx @@ -1,6 +1,6 @@ import { FC, useState, useEffect } from 'react' import throttle from 'lodash.throttle' -import cn from 'classnames' +import cn from 'clsx' import s from './Navbar.module.css' const NavbarRoot: FC = ({ children }) => { diff --git a/components/common/Navbar/index.ts b/site/components/common/Navbar/index.ts similarity index 100% rename from components/common/Navbar/index.ts rename to site/components/common/Navbar/index.ts diff --git a/site/components/common/SEO/SEO.tsx b/site/components/common/SEO/SEO.tsx new file mode 100644 index 000000000..b5e3ad23b --- /dev/null +++ b/site/components/common/SEO/SEO.tsx @@ -0,0 +1,157 @@ +import Head from 'next/head' +import { FC, Fragment, ReactNode } from 'react' +import config from '@config/seo_meta.json' + +const storeUrl = + process.env.NEXT_PUBLIC_STORE_URL || process.env.NEXT_PUBLIC_VERCEL_URL +const storeBaseUrl = storeUrl ? `https://${storeUrl}` : null + +interface OgImage { + url?: string + width?: string + height?: string + alt?: string +} + +interface Props { + title?: string + description?: string + robots?: string + openGraph?: { + title?: string + type?: string + locale?: string + description?: string + site_name?: string + url?: string + images?: OgImage[] + } + children?: ReactNode +} + +const ogImage = ({ url, width, height, alt }: OgImage, index: number) => { + // generate full URL for OG image url with store base URL + const imgUrl = storeBaseUrl ? new URL(url!, storeBaseUrl).toString() : url + return ( + + + + + + + ) +} + +const SEO: FC = ({ + title, + description, + openGraph, + robots, + children, +}) => { + /** + * @see https://nextjs.org/docs/api-reference/next/head + * + * meta or any other elements need to be contained as direct children of the Head element, + * or wrapped into maximum one level of or arrays + * otherwise the tags won't be correctly picked up on client-side navigations. + * + * The `key` property makes the tag is only rendered once, + */ + return ( + + + {title ? `${config.titleTemplate.replace(/%s/g, title)}` : config.title} + + + + + + + + {openGraph?.locale && ( + + )} + {openGraph?.images?.length + ? openGraph.images.map((img, index) => ogImage(img, index)) + : ogImage(config.openGraph.images[0], 0)} + {config.twitter.cardType && ( + + )} + {config.twitter.site && ( + + )} + {config.twitter.handle && ( + + )} + + + {children} + + ) +} + +export default SEO diff --git a/site/components/common/SEO/index.ts b/site/components/common/SEO/index.ts new file mode 100644 index 000000000..e20ec8600 --- /dev/null +++ b/site/components/common/SEO/index.ts @@ -0,0 +1 @@ +export { default } from './SEO' diff --git a/components/common/Searchbar/Searchbar.module.css b/site/components/common/Searchbar/Searchbar.module.css similarity index 100% rename from components/common/Searchbar/Searchbar.module.css rename to site/components/common/Searchbar/Searchbar.module.css diff --git a/site/components/common/Searchbar/Searchbar.tsx b/site/components/common/Searchbar/Searchbar.tsx new file mode 100644 index 000000000..0d9c8e807 --- /dev/null +++ b/site/components/common/Searchbar/Searchbar.tsx @@ -0,0 +1,60 @@ +import { FC, memo, useEffect } from 'react' +import cn from 'clsx' +import s from './Searchbar.module.css' +import { useRouter } from 'next/router' + +interface Props { + className?: string + id?: string +} + +const Searchbar: FC = ({ className, id = 'search' }) => { + const router = useRouter() + + useEffect(() => { + router.prefetch('/search') + }, [router]) + + const handleKeyUp = (e: React.KeyboardEvent) => { + e.preventDefault() + + if (e.key === 'Enter') { + const q = e.currentTarget.value + + router.push( + { + pathname: `/search`, + query: q ? { q } : {}, + }, + undefined, + { shallow: true } + ) + } + } + + return ( +
+ + +
+ + + +
+
+ ) +} + +export default memo(Searchbar) diff --git a/components/common/Searchbar/index.ts b/site/components/common/Searchbar/index.ts similarity index 100% rename from components/common/Searchbar/index.ts rename to site/components/common/Searchbar/index.ts diff --git a/components/common/SidebarLayout/SidebarLayout.module.css b/site/components/common/SidebarLayout/SidebarLayout.module.css similarity index 100% rename from components/common/SidebarLayout/SidebarLayout.module.css rename to site/components/common/SidebarLayout/SidebarLayout.module.css diff --git a/components/common/SidebarLayout/SidebarLayout.tsx b/site/components/common/SidebarLayout/SidebarLayout.tsx similarity index 94% rename from components/common/SidebarLayout/SidebarLayout.tsx rename to site/components/common/SidebarLayout/SidebarLayout.tsx index a4e60a758..407a938ea 100644 --- a/components/common/SidebarLayout/SidebarLayout.tsx +++ b/site/components/common/SidebarLayout/SidebarLayout.tsx @@ -1,7 +1,7 @@ import React, { FC } from 'react' import { Cross, ChevronLeft } from '@components/icons' import { UserNav } from '@components/common' -import cn from 'classnames' +import cn from 'clsx' import s from './SidebarLayout.module.css' type ComponentProps = { className?: string } & ( @@ -22,7 +22,7 @@ const SidebarLayout: FC = ({
)} {process.env.COMMERCE_WISHLIST_ENABLED && ( @@ -55,6 +70,19 @@ const UserNav: FC = ({ className }) => { )} )} +
  • + +
  • ) diff --git a/components/common/UserNav/index.ts b/site/components/common/UserNav/index.ts similarity index 100% rename from components/common/UserNav/index.ts rename to site/components/common/UserNav/index.ts diff --git a/components/common/index.ts b/site/components/common/index.ts similarity index 91% rename from components/common/index.ts rename to site/components/common/index.ts index 98dd3394b..054110c75 100644 --- a/components/common/index.ts +++ b/site/components/common/index.ts @@ -7,3 +7,4 @@ export { default as Searchbar } from './Searchbar' export { default as UserNav } from './UserNav' export { default as Head } from './Head' export { default as I18nWidget } from './I18nWidget' +export { default as SEO } from './SEO' diff --git a/components/icons/ArrowLeft.tsx b/site/components/icons/ArrowLeft.tsx similarity index 100% rename from components/icons/ArrowLeft.tsx rename to site/components/icons/ArrowLeft.tsx diff --git a/components/icons/ArrowRight.tsx b/site/components/icons/ArrowRight.tsx similarity index 100% rename from components/icons/ArrowRight.tsx rename to site/components/icons/ArrowRight.tsx diff --git a/components/icons/Bag.tsx b/site/components/icons/Bag.tsx similarity index 100% rename from components/icons/Bag.tsx rename to site/components/icons/Bag.tsx diff --git a/components/icons/Check.tsx b/site/components/icons/Check.tsx similarity index 100% rename from components/icons/Check.tsx rename to site/components/icons/Check.tsx diff --git a/components/icons/ChevronDown.tsx b/site/components/icons/ChevronDown.tsx similarity index 100% rename from components/icons/ChevronDown.tsx rename to site/components/icons/ChevronDown.tsx diff --git a/components/icons/ChevronLeft.tsx b/site/components/icons/ChevronLeft.tsx similarity index 100% rename from components/icons/ChevronLeft.tsx rename to site/components/icons/ChevronLeft.tsx diff --git a/components/icons/ChevronRight.tsx b/site/components/icons/ChevronRight.tsx similarity index 82% rename from components/icons/ChevronRight.tsx rename to site/components/icons/ChevronRight.tsx index d72b77a32..8da0122ca 100644 --- a/components/icons/ChevronRight.tsx +++ b/site/components/icons/ChevronRight.tsx @@ -1,4 +1,4 @@ -const ChevronUp = ({ ...props }) => { +const ChevronRight = ({ ...props }) => { return ( { ) } -export default ChevronUp +export default ChevronRight diff --git a/components/icons/ChevronUp.tsx b/site/components/icons/ChevronUp.tsx similarity index 100% rename from components/icons/ChevronUp.tsx rename to site/components/icons/ChevronUp.tsx diff --git a/components/icons/CreditCard.tsx b/site/components/icons/CreditCard.tsx similarity index 100% rename from components/icons/CreditCard.tsx rename to site/components/icons/CreditCard.tsx diff --git a/components/icons/Cross.tsx b/site/components/icons/Cross.tsx similarity index 100% rename from components/icons/Cross.tsx rename to site/components/icons/Cross.tsx diff --git a/components/icons/DoubleChevron.tsx b/site/components/icons/DoubleChevron.tsx similarity index 100% rename from components/icons/DoubleChevron.tsx rename to site/components/icons/DoubleChevron.tsx diff --git a/components/icons/Github.tsx b/site/components/icons/Github.tsx similarity index 100% rename from components/icons/Github.tsx rename to site/components/icons/Github.tsx diff --git a/components/icons/Heart.tsx b/site/components/icons/Heart.tsx similarity index 100% rename from components/icons/Heart.tsx rename to site/components/icons/Heart.tsx diff --git a/components/icons/Info.tsx b/site/components/icons/Info.tsx similarity index 100% rename from components/icons/Info.tsx rename to site/components/icons/Info.tsx diff --git a/components/icons/MapPin.tsx b/site/components/icons/MapPin.tsx similarity index 100% rename from components/icons/MapPin.tsx rename to site/components/icons/MapPin.tsx diff --git a/site/components/icons/Menu.tsx b/site/components/icons/Menu.tsx new file mode 100644 index 000000000..3f280e31f --- /dev/null +++ b/site/components/icons/Menu.tsx @@ -0,0 +1,21 @@ +const Menu = ({ ...props }) => { + return ( + + + + ) +} + +export default Menu diff --git a/components/icons/Minus.tsx b/site/components/icons/Minus.tsx similarity index 100% rename from components/icons/Minus.tsx rename to site/components/icons/Minus.tsx diff --git a/components/icons/Moon.tsx b/site/components/icons/Moon.tsx similarity index 100% rename from components/icons/Moon.tsx rename to site/components/icons/Moon.tsx diff --git a/components/icons/Plus.tsx b/site/components/icons/Plus.tsx similarity index 100% rename from components/icons/Plus.tsx rename to site/components/icons/Plus.tsx diff --git a/components/icons/Star.tsx b/site/components/icons/Star.tsx similarity index 100% rename from components/icons/Star.tsx rename to site/components/icons/Star.tsx diff --git a/components/icons/Sun.tsx b/site/components/icons/Sun.tsx similarity index 100% rename from components/icons/Sun.tsx rename to site/components/icons/Sun.tsx diff --git a/components/icons/Trash.tsx b/site/components/icons/Trash.tsx similarity index 100% rename from components/icons/Trash.tsx rename to site/components/icons/Trash.tsx diff --git a/components/icons/Vercel.tsx b/site/components/icons/Vercel.tsx similarity index 100% rename from components/icons/Vercel.tsx rename to site/components/icons/Vercel.tsx diff --git a/components/icons/index.ts b/site/components/icons/index.ts similarity index 100% rename from components/icons/index.ts rename to site/components/icons/index.ts diff --git a/components/product/ProductCard/ProductCard.module.css b/site/components/product/ProductCard/ProductCard.module.css similarity index 100% rename from components/product/ProductCard/ProductCard.module.css rename to site/components/product/ProductCard/ProductCard.module.css diff --git a/components/product/ProductCard/ProductCard.tsx b/site/components/product/ProductCard/ProductCard.tsx similarity index 73% rename from components/product/ProductCard/ProductCard.tsx rename to site/components/product/ProductCard/ProductCard.tsx index 95f2f3f07..c70461f6c 100644 --- a/components/product/ProductCard/ProductCard.tsx +++ b/site/components/product/ProductCard/ProductCard.tsx @@ -1,5 +1,5 @@ import { FC } from 'react' -import cn from 'classnames' +import cn from 'clsx' import Link from 'next/link' import type { Product } from '@commerce/types/product' import s from './ProductCard.module.css' @@ -39,22 +39,24 @@ const ProductCard: FC = ({ return ( - + {variant === 'slim' && ( <>
    {product.name}
    {product?.images && ( - {product.name +
    + {product.name +
    )} )} @@ -80,16 +82,18 @@ const ProductCard: FC = ({ )}
    {product?.images && ( - {product.name +
    + {product.name +
    )}
    @@ -110,16 +114,18 @@ const ProductCard: FC = ({ />
    {product?.images && ( - {product.name +
    + {product.name +
    )}
    diff --git a/components/product/ProductCard/index.ts b/site/components/product/ProductCard/index.ts similarity index 100% rename from components/product/ProductCard/index.ts rename to site/components/product/ProductCard/index.ts diff --git a/site/components/product/ProductOptions/ProductOptions.tsx b/site/components/product/ProductOptions/ProductOptions.tsx new file mode 100644 index 000000000..15c229edb --- /dev/null +++ b/site/components/product/ProductOptions/ProductOptions.tsx @@ -0,0 +1,52 @@ +import { memo } from 'react' +import { Swatch } from '@components/product' +import type { ProductOption } from '@commerce/types/product' +import { SelectedOptions } from '../helpers' + +interface ProductOptionsProps { + options: ProductOption[] + selectedOptions: SelectedOptions + setSelectedOptions: React.Dispatch> +} + +const ProductOptions: React.FC = ({ + options, + selectedOptions, + setSelectedOptions, +}) => { + return ( +
    + {options.map((opt) => ( +
    +

    + {opt.displayName} +

    +
    + {opt.values.map((v, i: number) => { + const active = selectedOptions[opt.displayName.toLowerCase()] + return ( + { + setSelectedOptions((selectedOptions) => { + return { + ...selectedOptions, + [opt.displayName.toLowerCase()]: v.label.toLowerCase(), + } + }) + }} + /> + ) + })} +
    +
    + ))} +
    + ) +} + +export default memo(ProductOptions) diff --git a/components/product/ProductOptions/index.ts b/site/components/product/ProductOptions/index.ts similarity index 100% rename from components/product/ProductOptions/index.ts rename to site/components/product/ProductOptions/index.ts diff --git a/components/product/ProductSidebar/ProductSidebar.module.css b/site/components/product/ProductSidebar/ProductSidebar.module.css similarity index 100% rename from components/product/ProductSidebar/ProductSidebar.module.css rename to site/components/product/ProductSidebar/ProductSidebar.module.css diff --git a/components/product/ProductSidebar/ProductSidebar.tsx b/site/components/product/ProductSidebar/ProductSidebar.tsx similarity index 99% rename from components/product/ProductSidebar/ProductSidebar.tsx rename to site/components/product/ProductSidebar/ProductSidebar.tsx index 9482f2b67..fed09d159 100644 --- a/components/product/ProductSidebar/ProductSidebar.tsx +++ b/site/components/product/ProductSidebar/ProductSidebar.tsx @@ -23,7 +23,7 @@ const ProductSidebar: FC = ({ product, className }) => { useEffect(() => { selectDefaultOptionFromProduct(product, setSelectedOptions) - }, []) + }, [product]) const variant = getProductVariant(product, selectedOptions) const addToCart = async () => { diff --git a/components/product/ProductSidebar/index.ts b/site/components/product/ProductSidebar/index.ts similarity index 100% rename from components/product/ProductSidebar/index.ts rename to site/components/product/ProductSidebar/index.ts diff --git a/components/product/ProductSlider/ProductSlider.module.css b/site/components/product/ProductSlider/ProductSlider.module.css similarity index 77% rename from components/product/ProductSlider/ProductSlider.module.css rename to site/components/product/ProductSlider/ProductSlider.module.css index 8d7265eb8..b95bffdd0 100644 --- a/components/product/ProductSlider/ProductSlider.module.css +++ b/site/components/product/ProductSlider/ProductSlider.module.css @@ -13,9 +13,7 @@ } .thumb { - @apply transition-transform transition-colors - ease-linear duration-75 overflow-hidden inline-block - cursor-pointer h-full; + @apply overflow-hidden inline-block cursor-pointer h-full; width: 125px; width: calc(100% / 3); } @@ -48,11 +46,6 @@ @screen md { .thumb:hover { transform: scale(1.02); - background-color: rgba(255, 255, 255, 0.08); - } - - .thumb.selected { - @apply bg-white; } .album { diff --git a/components/product/ProductSlider/ProductSlider.tsx b/site/components/product/ProductSlider/ProductSlider.tsx similarity index 82% rename from components/product/ProductSlider/ProductSlider.tsx rename to site/components/product/ProductSlider/ProductSlider.tsx index 8c3441906..009d058c8 100644 --- a/components/product/ProductSlider/ProductSlider.tsx +++ b/site/components/product/ProductSlider/ProductSlider.tsx @@ -1,13 +1,12 @@ import { useKeenSlider } from 'keen-slider/react' import React, { Children, - FC, isValidElement, useState, useRef, useEffect, } from 'react' -import cn from 'classnames' +import cn from 'clsx' import { a } from '@react-spring/web' import s from './ProductSlider.module.css' import ProductSliderControl from '../ProductSliderControl' @@ -28,16 +27,14 @@ const ProductSlider: React.FC = ({ const [ref, slider] = useKeenSlider({ loop: true, - slidesPerView: 1, - mounted: () => setIsMounted(true), + slides: { perView: 1 }, + created: () => setIsMounted(true), slideChanged(s) { - const slideNumber = s.details().relativeSlide + const slideNumber = s.track.details.rel setCurrentSlide(slideNumber) if (thumbsContainerRef.current) { - const $el = document.getElementById( - `thumb-${s.details().relativeSlide}` - ) + const $el = document.getElementById(`thumb-${slideNumber}`) if (slideNumber >= 3) { thumbsContainerRef.current.scrollLeft = $el!.offsetLeft } else { @@ -66,23 +63,19 @@ const ProductSlider: React.FC = ({ event.preventDefault() } - sliderContainerRef.current!.addEventListener( - 'touchstart', - preventNavigation - ) + const slider = sliderContainerRef.current! + + slider.addEventListener('touchstart', preventNavigation) return () => { - if (sliderContainerRef.current) { - sliderContainerRef.current!.removeEventListener( - 'touchstart', - preventNavigation - ) + if (slider) { + slider.removeEventListener('touchstart', preventNavigation) } } }, []) - const onPrev = React.useCallback(() => slider.prev(), [slider]) - const onNext = React.useCallback(() => slider.next(), [slider]) + const onPrev = React.useCallback(() => slider.current?.prev(), [slider]) + const onNext = React.useCallback(() => slider.current?.next(), [slider]) return (
    @@ -121,7 +114,7 @@ const ProductSlider: React.FC = ({ }), id: `thumb-${idx}`, onClick: () => { - slider.moveToSlideRelative(idx) + slider.current?.moveToIdx(idx) }, }, } diff --git a/components/product/ProductSlider/index.ts b/site/components/product/ProductSlider/index.ts similarity index 100% rename from components/product/ProductSlider/index.ts rename to site/components/product/ProductSlider/index.ts diff --git a/components/product/ProductSliderControl/ProductSliderControl.module.css b/site/components/product/ProductSliderControl/ProductSliderControl.module.css similarity index 100% rename from components/product/ProductSliderControl/ProductSliderControl.module.css rename to site/components/product/ProductSliderControl/ProductSliderControl.module.css diff --git a/site/components/product/ProductSliderControl/ProductSliderControl.tsx b/site/components/product/ProductSliderControl/ProductSliderControl.tsx new file mode 100644 index 000000000..29b30b789 --- /dev/null +++ b/site/components/product/ProductSliderControl/ProductSliderControl.tsx @@ -0,0 +1,30 @@ +import { FC, MouseEventHandler, memo } from 'react' +import cn from 'clsx' +import s from './ProductSliderControl.module.css' +import { ArrowLeft, ArrowRight } from '@components/icons' + +interface ProductSliderControl { + onPrev: MouseEventHandler + onNext: MouseEventHandler +} + +const ProductSliderControl: FC = ({ onPrev, onNext }) => ( +
    + + +
    +) + +export default memo(ProductSliderControl) diff --git a/components/product/ProductSliderControl/index.ts b/site/components/product/ProductSliderControl/index.ts similarity index 100% rename from components/product/ProductSliderControl/index.ts rename to site/components/product/ProductSliderControl/index.ts diff --git a/components/product/ProductTag/ProductTag.module.css b/site/components/product/ProductTag/ProductTag.module.css similarity index 93% rename from components/product/ProductTag/ProductTag.module.css rename to site/components/product/ProductTag/ProductTag.module.css index faf2fd97f..c36b43aa6 100644 --- a/components/product/ProductTag/ProductTag.module.css +++ b/site/components/product/ProductTag/ProductTag.module.css @@ -7,7 +7,7 @@ @apply pt-0 max-w-full w-full leading-extra-loose; font-size: 2rem; letter-spacing: 0.4px; - line-height: 2.2em; + line-height: 2.1em; } .root .name span { @@ -27,4 +27,5 @@ .root .price { @apply pt-2 px-6 pb-4 text-sm bg-primary text-accent-9 font-semibold inline-block tracking-wide; + margin-top: -1px; } diff --git a/components/product/ProductTag/ProductTag.tsx b/site/components/product/ProductTag/ProductTag.tsx similarity index 96% rename from components/product/ProductTag/ProductTag.tsx rename to site/components/product/ProductTag/ProductTag.tsx index 2bc80b878..0db4866e9 100644 --- a/components/product/ProductTag/ProductTag.tsx +++ b/site/components/product/ProductTag/ProductTag.tsx @@ -1,4 +1,4 @@ -import cn from 'classnames' +import cn from 'clsx' import { inherits } from 'util' import s from './ProductTag.module.css' diff --git a/components/product/ProductTag/index.ts b/site/components/product/ProductTag/index.ts similarity index 100% rename from components/product/ProductTag/index.ts rename to site/components/product/ProductTag/index.ts diff --git a/components/product/ProductView/ProductView.module.css b/site/components/product/ProductView/ProductView.module.css similarity index 85% rename from components/product/ProductView/ProductView.module.css rename to site/components/product/ProductView/ProductView.module.css index 0b3ebf564..e68c76f21 100644 --- a/components/product/ProductView/ProductView.module.css +++ b/site/components/product/ProductView/ProductView.module.css @@ -17,16 +17,15 @@ } .imageContainer { - @apply text-center; + @apply text-center h-full relative; } -.imageContainer > div, -.imageContainer > div > div { - @apply h-full; +.imageContainer > span { + height: 100% !important; } .sliderContainer .img { - @apply w-full h-auto max-h-full object-cover; + @apply w-full h-full max-h-full object-cover; } .button { diff --git a/components/product/ProductView/ProductView.tsx b/site/components/product/ProductView/ProductView.tsx similarity index 92% rename from components/product/ProductView/ProductView.tsx rename to site/components/product/ProductView/ProductView.tsx index f689030d6..31cbcd577 100644 --- a/components/product/ProductView/ProductView.tsx +++ b/site/components/product/ProductView/ProductView.tsx @@ -1,6 +1,5 @@ -import cn from 'classnames' +import cn from 'clsx' import Image from 'next/image' -import { NextSeo } from 'next-seo' import s from './ProductView.module.css' import { FC } from 'react' import type { Product } from '@commerce/types/product' @@ -8,6 +7,7 @@ import usePrice from '@framework/product/use-price' import { WishlistButton } from '@components/wishlist' import { ProductSlider, ProductCard } from '@components/product' import { Container, Text } from '@components/ui' +import { SEO } from '@components/common' import ProductSidebar from '../ProductSidebar' import ProductTag from '../ProductTag' interface ProductViewProps { @@ -58,7 +58,11 @@ const ProductView: FC = ({ product, relatedProducts }) => { )}
    - +
    @@ -85,7 +89,7 @@ const ProductView: FC = ({ product, relatedProducts }) => {
    - = ({ product, relatedProducts }) => { images: [ { url: product.images[0]?.url!, - width: 800, - height: 600, + width: '800', + height: '600', alt: product.name, }, ], diff --git a/components/product/ProductView/index.ts b/site/components/product/ProductView/index.ts similarity index 100% rename from components/product/ProductView/index.ts rename to site/components/product/ProductView/index.ts diff --git a/components/product/Swatch/Swatch.module.css b/site/components/product/Swatch/Swatch.module.css similarity index 100% rename from components/product/Swatch/Swatch.module.css rename to site/components/product/Swatch/Swatch.module.css diff --git a/site/components/product/Swatch/Swatch.tsx b/site/components/product/Swatch/Swatch.tsx new file mode 100644 index 000000000..865f43398 --- /dev/null +++ b/site/components/product/Swatch/Swatch.tsx @@ -0,0 +1,62 @@ +import cn from 'clsx' +import React from 'react' +import s from './Swatch.module.css' +import { Check } from '@components/icons' +import Button, { ButtonProps } from '@components/ui/Button' +import { isDark } from '@lib/colors' +interface SwatchProps { + active?: boolean + children?: any + className?: string + variant?: 'size' | 'color' | string + color?: string + label?: string | null +} + +const Swatch: React.FC & SwatchProps> = ({ + active, + className, + color = '', + label = null, + variant = 'size', + ...props +}) => { + variant = variant?.toLowerCase() + + if (label) { + label = label?.toLowerCase() + } + + const swatchClassName = cn( + s.swatch, + { + [s.color]: color, + [s.active]: active, + [s.size]: variant === 'size', + [s.dark]: color ? isDark(color) : false, + [s.textLabel]: !color && label && label.length > 3, + }, + className + ) + + return ( + + ) +} + +export default React.memo(Swatch) diff --git a/components/product/Swatch/index.ts b/site/components/product/Swatch/index.ts similarity index 100% rename from components/product/Swatch/index.ts rename to site/components/product/Swatch/index.ts diff --git a/components/product/helpers.ts b/site/components/product/helpers.ts similarity index 95% rename from components/product/helpers.ts rename to site/components/product/helpers.ts index d3fbd5ef5..77e385bb8 100644 --- a/components/product/helpers.ts +++ b/site/components/product/helpers.ts @@ -23,7 +23,7 @@ export function selectDefaultOptionFromProduct( updater: Dispatch> ) { // Selects the default option - product.variants[0].options?.forEach((v) => { + product.variants[0]?.options?.forEach((v) => { updater((choices) => ({ ...choices, [v.displayName.toLowerCase()]: v.values[0].label.toLowerCase(), diff --git a/components/product/index.ts b/site/components/product/index.ts similarity index 100% rename from components/product/index.ts rename to site/components/product/index.ts diff --git a/components/search.tsx b/site/components/search.tsx similarity index 98% rename from components/search.tsx rename to site/components/search.tsx index 10fd5df68..664085e5b 100644 --- a/components/search.tsx +++ b/site/components/search.tsx @@ -1,4 +1,4 @@ -import cn from 'classnames' +import cn from 'clsx' import type { SearchPropsType } from '@lib/search-props' import Link from 'next/link' import { useState } from 'react' @@ -7,19 +7,19 @@ import { useRouter } from 'next/router' import { Layout } from '@components/common' import { ProductCard } from '@components/product' import type { Product } from '@commerce/types/product' -import { Container, Grid, Skeleton } from '@components/ui' +import { Container, Skeleton } from '@components/ui' import useSearch from '@framework/product/use-search' import getSlug from '@lib/get-slug' import rangeMap from '@lib/range-map' -const SORT = Object.entries({ +const SORT = { 'trending-desc': 'Trending', 'latest-desc': 'Latest arrivals', 'price-asc': 'Price: Low to high', 'price-desc': 'Price: High to low', -}) +} import { filterQuery, @@ -351,7 +351,7 @@ export default function Search({ categories, brands }: SearchPropsType) { aria-haspopup="true" aria-expanded="true" > - {sort ? `Sort: ${sort}` : 'Relevance'} + {sort ? SORT[sort as keyof typeof SORT] : 'Relevance'} - {SORT.map(([key, text]) => ( + {Object.entries(SORT).map(([key, text]) => (
  • { href?: string className?: string - variant?: 'flat' | 'slim' | 'ghost' + variant?: 'flat' | 'slim' | 'ghost' | 'naked' active?: boolean type?: 'submit' | 'reset' | 'button' Component?: string | JSXElementConstructor @@ -21,6 +21,7 @@ export interface ButtonProps extends ButtonHTMLAttributes { disabled?: boolean } +// eslint-disable-next-line react/display-name const Button: React.FC = forwardRef((props, buttonRef) => { const { className, @@ -41,6 +42,7 @@ const Button: React.FC = forwardRef((props, buttonRef) => { { [s.ghost]: variant === 'ghost', [s.slim]: variant === 'slim', + [s.naked]: variant === 'naked', [s.loading]: loading, [s.disabled]: disabled, }, diff --git a/components/ui/Button/index.ts b/site/components/ui/Button/index.ts similarity index 100% rename from components/ui/Button/index.ts rename to site/components/ui/Button/index.ts diff --git a/components/ui/Collapse/Collapse.module.css b/site/components/ui/Collapse/Collapse.module.css similarity index 100% rename from components/ui/Collapse/Collapse.module.css rename to site/components/ui/Collapse/Collapse.module.css diff --git a/components/ui/Collapse/Collapse.tsx b/site/components/ui/Collapse/Collapse.tsx similarity index 89% rename from components/ui/Collapse/Collapse.tsx rename to site/components/ui/Collapse/Collapse.tsx index b2f9525ac..8ec71ee5a 100644 --- a/components/ui/Collapse/Collapse.tsx +++ b/site/components/ui/Collapse/Collapse.tsx @@ -1,4 +1,4 @@ -import cn from 'classnames' +import cn from 'clsx' import React, { FC, ReactNode, useState } from 'react' import s from './Collapse.module.css' import { ChevronRight } from '@components/icons' @@ -10,7 +10,7 @@ export interface CollapseProps { children: ReactNode } -const Collapse: FC = React.memo(({ title, children }) => { +const Collapse: FC = ({ title, children }) => { const [isActive, setActive] = useState(false) const [ref, { height: viewHeight }] = useMeasure() @@ -41,6 +41,6 @@ const Collapse: FC = React.memo(({ title, children }) => { ) -}) +} -export default Collapse +export default React.memo(Collapse) diff --git a/components/ui/Collapse/index.ts b/site/components/ui/Collapse/index.ts similarity index 100% rename from components/ui/Collapse/index.ts rename to site/components/ui/Collapse/index.ts diff --git a/components/ui/Container/Container.tsx b/site/components/ui/Container/Container.tsx similarity index 94% rename from components/ui/Container/Container.tsx rename to site/components/ui/Container/Container.tsx index 538b1cac7..095d4f9d4 100644 --- a/components/ui/Container/Container.tsx +++ b/site/components/ui/Container/Container.tsx @@ -1,4 +1,4 @@ -import cn from 'classnames' +import cn from 'clsx' import React, { FC } from 'react' interface ContainerProps { diff --git a/components/ui/Container/index.ts b/site/components/ui/Container/index.ts similarity index 100% rename from components/ui/Container/index.ts rename to site/components/ui/Container/index.ts diff --git a/components/ui/Grid/Grid.module.css b/site/components/ui/Grid/Grid.module.css similarity index 75% rename from components/ui/Grid/Grid.module.css rename to site/components/ui/Grid/Grid.module.css index 27e4c5b19..9e6ab69b1 100644 --- a/components/ui/Grid/Grid.module.css +++ b/site/components/ui/Grid/Grid.module.css @@ -1,53 +1,25 @@ .root { @apply grid grid-cols-1 gap-0; - - @screen lg { - @apply grid-cols-3 grid-rows-2; - } - - & > * { - @apply row-span-1 bg-transparent box-border overflow-hidden; - height: 500px; - max-height: 800px; - - @screen lg { - @apply col-span-1; - height: inherit; - } - } +} +.root > * { + @apply row-span-1 bg-transparent box-border overflow-hidden; + height: 500px; + max-height: 800px; } -.default { - & > * { - @apply bg-transparent; - } +.default > * { + @apply bg-transparent; } .layoutNormal { @apply gap-3; } -@screen md { - .layoutNormal > * { - max-height: min-content !important; - } -} - -@screen lg { - .layoutNormal > * { - max-height: 400px; - } -} - .layoutA { & > *:nth-child(6n + 1), & > *:nth-child(6n + 5) { - @apply row-span-2; + @apply row-span-2 lg:col-span-2; height: var(--row-height); - - @screen lg { - @apply col-span-2; - } } &.filled { @@ -72,12 +44,8 @@ .layoutB { & > *:nth-child(6n + 2), & > *:nth-child(6n + 4) { - @apply row-span-2; + @apply row-span-2 lg:col-span-2; height: var(--row-height); - - @screen lg { - @apply col-span-2; - } } &.filled { @@ -102,12 +70,8 @@ .layoutC { & > *:nth-child(12n + 1), & > *:nth-child(12n + 8) { - @apply row-span-2; + @apply row-span-2 lg:col-span-2; height: var(--row-height); - - @screen lg { - @apply col-span-2; - } } &.filled { @@ -130,12 +94,8 @@ .layoutD { & > *:nth-child(12n + 2), & > *:nth-child(12n + 7) { - @apply row-span-2; + @apply row-span-2 lg:col-span-2; height: var(--row-height); - - @screen lg { - @apply col-span-2; - } } &.filled { @@ -152,3 +112,24 @@ } } } + +@screen md { + .layoutNormal > * { + max-height: min-content !important; + } +} + +@screen lg { + .root { + @apply grid-cols-3 grid-rows-2; + } + + .root > * { + @apply col-span-1; + height: inherit; + } + + .layoutNormal > * { + max-height: 400px; + } +} diff --git a/components/ui/Grid/Grid.tsx b/site/components/ui/Grid/Grid.tsx similarity index 96% rename from components/ui/Grid/Grid.tsx rename to site/components/ui/Grid/Grid.tsx index 55ca78277..9b033c0a1 100644 --- a/components/ui/Grid/Grid.tsx +++ b/site/components/ui/Grid/Grid.tsx @@ -1,4 +1,4 @@ -import cn from 'classnames' +import cn from 'clsx' import { FC, ReactNode, Component } from 'react' import s from './Grid.module.css' diff --git a/components/ui/Grid/index.ts b/site/components/ui/Grid/index.ts similarity index 100% rename from components/ui/Grid/index.ts rename to site/components/ui/Grid/index.ts diff --git a/components/ui/Hero/Hero.module.css b/site/components/ui/Hero/Hero.module.css similarity index 100% rename from components/ui/Hero/Hero.module.css rename to site/components/ui/Hero/Hero.module.css diff --git a/components/ui/Hero/Hero.tsx b/site/components/ui/Hero/Hero.tsx similarity index 100% rename from components/ui/Hero/Hero.tsx rename to site/components/ui/Hero/Hero.tsx diff --git a/components/ui/Hero/index.ts b/site/components/ui/Hero/index.ts similarity index 100% rename from components/ui/Hero/index.ts rename to site/components/ui/Hero/index.ts diff --git a/components/ui/Input/Input.module.css b/site/components/ui/Input/Input.module.css similarity index 100% rename from components/ui/Input/Input.module.css rename to site/components/ui/Input/Input.module.css diff --git a/components/ui/Input/Input.tsx b/site/components/ui/Input/Input.tsx similarity index 96% rename from components/ui/Input/Input.tsx rename to site/components/ui/Input/Input.tsx index e630728b2..8a17588be 100644 --- a/components/ui/Input/Input.tsx +++ b/site/components/ui/Input/Input.tsx @@ -1,4 +1,4 @@ -import cn from 'classnames' +import cn from 'clsx' import s from './Input.module.css' import React, { InputHTMLAttributes } from 'react' diff --git a/components/ui/Input/index.ts b/site/components/ui/Input/index.ts similarity index 100% rename from components/ui/Input/index.ts rename to site/components/ui/Input/index.ts diff --git a/components/ui/Link/Link.tsx b/site/components/ui/Link/Link.tsx similarity index 100% rename from components/ui/Link/Link.tsx rename to site/components/ui/Link/Link.tsx diff --git a/components/ui/Link/index.ts b/site/components/ui/Link/index.ts similarity index 100% rename from components/ui/Link/index.ts rename to site/components/ui/Link/index.ts diff --git a/components/ui/LoadingDots/LoadingDots.module.css b/site/components/ui/LoadingDots/LoadingDots.module.css similarity index 100% rename from components/ui/LoadingDots/LoadingDots.module.css rename to site/components/ui/LoadingDots/LoadingDots.module.css diff --git a/components/ui/LoadingDots/LoadingDots.tsx b/site/components/ui/LoadingDots/LoadingDots.tsx similarity index 100% rename from components/ui/LoadingDots/LoadingDots.tsx rename to site/components/ui/LoadingDots/LoadingDots.tsx diff --git a/components/ui/LoadingDots/index.ts b/site/components/ui/LoadingDots/index.ts similarity index 100% rename from components/ui/LoadingDots/index.ts rename to site/components/ui/LoadingDots/index.ts diff --git a/components/ui/Logo/Logo.tsx b/site/components/ui/Logo/Logo.tsx similarity index 100% rename from components/ui/Logo/Logo.tsx rename to site/components/ui/Logo/Logo.tsx diff --git a/components/ui/Logo/index.ts b/site/components/ui/Logo/index.ts similarity index 100% rename from components/ui/Logo/index.ts rename to site/components/ui/Logo/index.ts diff --git a/components/ui/Marquee/Marquee.module.css b/site/components/ui/Marquee/Marquee.module.css similarity index 100% rename from components/ui/Marquee/Marquee.module.css rename to site/components/ui/Marquee/Marquee.module.css diff --git a/components/ui/Marquee/Marquee.tsx b/site/components/ui/Marquee/Marquee.tsx similarity index 96% rename from components/ui/Marquee/Marquee.tsx rename to site/components/ui/Marquee/Marquee.tsx index ce5ec2338..cf5bd436b 100644 --- a/components/ui/Marquee/Marquee.tsx +++ b/site/components/ui/Marquee/Marquee.tsx @@ -1,4 +1,4 @@ -import cn from 'classnames' +import cn from 'clsx' import s from './Marquee.module.css' import { FC, ReactNode, Component, Children } from 'react' import { default as FastMarquee } from 'react-fast-marquee' diff --git a/components/ui/Marquee/index.ts b/site/components/ui/Marquee/index.ts similarity index 100% rename from components/ui/Marquee/index.ts rename to site/components/ui/Marquee/index.ts diff --git a/components/ui/Modal/Modal.module.css b/site/components/ui/Modal/Modal.module.css similarity index 100% rename from components/ui/Modal/Modal.module.css rename to site/components/ui/Modal/Modal.module.css diff --git a/components/ui/Modal/Modal.tsx b/site/components/ui/Modal/Modal.tsx similarity index 81% rename from components/ui/Modal/Modal.tsx rename to site/components/ui/Modal/Modal.tsx index bb42b3d1b..40ed3b3ff 100644 --- a/components/ui/Modal/Modal.tsx +++ b/site/components/ui/Modal/Modal.tsx @@ -2,11 +2,8 @@ import { FC, useRef, useEffect, useCallback } from 'react' import s from './Modal.module.css' import FocusTrap from '@lib/focus-trap' import { Cross } from '@components/icons' -import { - disableBodyScroll, - clearAllBodyScrollLocks, - enableBodyScroll, -} from 'body-scroll-lock' +import { disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock' + interface ModalProps { className?: string children?: any @@ -27,14 +24,13 @@ const Modal: FC = ({ children, onClose }) => { ) useEffect(() => { - if (ref.current) { - disableBodyScroll(ref.current, { reserveScrollBarGap: true }) + const modal = ref.current + + if (modal) { + disableBodyScroll(modal, { reserveScrollBarGap: true }) window.addEventListener('keydown', handleKey) } return () => { - if (ref && ref.current) { - enableBodyScroll(ref.current) - } clearAllBodyScrollLocks() window.removeEventListener('keydown', handleKey) } diff --git a/components/ui/Modal/index.ts b/site/components/ui/Modal/index.ts similarity index 100% rename from components/ui/Modal/index.ts rename to site/components/ui/Modal/index.ts diff --git a/components/ui/Quantity/Quantity.module.css b/site/components/ui/Quantity/Quantity.module.css similarity index 100% rename from components/ui/Quantity/Quantity.module.css rename to site/components/ui/Quantity/Quantity.module.css diff --git a/components/ui/Quantity/Quantity.tsx b/site/components/ui/Quantity/Quantity.tsx similarity index 98% rename from components/ui/Quantity/Quantity.tsx rename to site/components/ui/Quantity/Quantity.tsx index abde145aa..7317ddbe6 100644 --- a/components/ui/Quantity/Quantity.tsx +++ b/site/components/ui/Quantity/Quantity.tsx @@ -1,7 +1,7 @@ import React, { FC } from 'react' import s from './Quantity.module.css' import { Cross, Plus, Minus } from '@components/icons' -import cn from 'classnames' +import cn from 'clsx' export interface QuantityProps { value: number increase: () => any diff --git a/components/ui/Quantity/index.ts b/site/components/ui/Quantity/index.ts similarity index 100% rename from components/ui/Quantity/index.ts rename to site/components/ui/Quantity/index.ts diff --git a/components/ui/README.md b/site/components/ui/README.md similarity index 100% rename from components/ui/README.md rename to site/components/ui/README.md diff --git a/components/ui/Rating/Rating.module.css b/site/components/ui/Rating/Rating.module.css similarity index 100% rename from components/ui/Rating/Rating.module.css rename to site/components/ui/Rating/Rating.module.css diff --git a/site/components/ui/Rating/Rating.tsx b/site/components/ui/Rating/Rating.tsx new file mode 100644 index 000000000..efd2ca0d8 --- /dev/null +++ b/site/components/ui/Rating/Rating.tsx @@ -0,0 +1,25 @@ +import { FC, memo } from 'react' +import rangeMap from '@lib/range-map' +import { Star } from '@components/icons' +import cn from 'clsx' + +export interface RatingProps { + value: number +} + +const Quantity: FC = ({ value = 5 }) => ( +
    + {rangeMap(5, (i) => ( + = Math.floor(value), + })} + > + + + ))} +
    +) + +export default memo(Quantity) diff --git a/components/ui/Rating/index.ts b/site/components/ui/Rating/index.ts similarity index 100% rename from components/ui/Rating/index.ts rename to site/components/ui/Rating/index.ts diff --git a/components/ui/Sidebar/Sidebar.module.css b/site/components/ui/Sidebar/Sidebar.module.css similarity index 84% rename from components/ui/Sidebar/Sidebar.module.css rename to site/components/ui/Sidebar/Sidebar.module.css index f6a49387f..71a85995e 100644 --- a/components/ui/Sidebar/Sidebar.module.css +++ b/site/components/ui/Sidebar/Sidebar.module.css @@ -1,5 +1,5 @@ .root { - @apply fixed inset-0 h-full z-50 box-border; + @apply fixed inset-0 h-full z-50 box-border outline-none; } .sidebar { diff --git a/site/components/ui/Sidebar/Sidebar.tsx b/site/components/ui/Sidebar/Sidebar.tsx new file mode 100644 index 000000000..fd0ce9057 --- /dev/null +++ b/site/components/ui/Sidebar/Sidebar.tsx @@ -0,0 +1,58 @@ +import { FC, useEffect, useRef } from 'react' +import s from './Sidebar.module.css' +import cn from 'clsx' +import { disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock' + +interface SidebarProps { + children: any + onClose: () => void +} + +const Sidebar: FC = ({ children, onClose }) => { + const sidebarRef = useRef() as React.MutableRefObject + const contentRef = useRef() as React.MutableRefObject + + const onKeyDownSidebar = (event: React.KeyboardEvent) => { + if (event.code === 'Escape') { + onClose() + } + } + + useEffect(() => { + if (sidebarRef.current) { + sidebarRef.current.focus() + } + + const contentElement = contentRef.current + + if (contentElement) { + disableBodyScroll(contentElement, { reserveScrollBarGap: true }) + } + + return () => { + clearAllBodyScrollLocks() + } + }, []) + + return ( +
    +
    +
    +
    +
    +
    + {children} +
    +
    +
    +
    +
    + ) +} + +export default Sidebar diff --git a/components/ui/Sidebar/index.ts b/site/components/ui/Sidebar/index.ts similarity index 100% rename from components/ui/Sidebar/index.ts rename to site/components/ui/Sidebar/index.ts diff --git a/components/ui/Skeleton/Skeleton.module.css b/site/components/ui/Skeleton/Skeleton.module.css similarity index 100% rename from components/ui/Skeleton/Skeleton.module.css rename to site/components/ui/Skeleton/Skeleton.module.css diff --git a/components/ui/Skeleton/Skeleton.tsx b/site/components/ui/Skeleton/Skeleton.tsx similarity index 97% rename from components/ui/Skeleton/Skeleton.tsx rename to site/components/ui/Skeleton/Skeleton.tsx index 9cef2c1ac..f4ca677e6 100644 --- a/components/ui/Skeleton/Skeleton.tsx +++ b/site/components/ui/Skeleton/Skeleton.tsx @@ -1,5 +1,5 @@ import React, { CSSProperties } from 'react' -import cn from 'classnames' +import cn from 'clsx' import px from '@lib/to-pixels' import s from './Skeleton.module.css' diff --git a/components/ui/Skeleton/index.ts b/site/components/ui/Skeleton/index.ts similarity index 100% rename from components/ui/Skeleton/index.ts rename to site/components/ui/Skeleton/index.ts diff --git a/site/components/ui/Text/Text.module.css b/site/components/ui/Text/Text.module.css new file mode 100644 index 000000000..dd35ff63b --- /dev/null +++ b/site/components/ui/Text/Text.module.css @@ -0,0 +1,75 @@ +.body { + @apply text-base leading-7 max-w-6xl mx-auto; +} + +.heading { + @apply text-5xl pt-1 pb-2 font-semibold tracking-wide cursor-pointer mb-2; +} + +.pageHeading { + @apply pt-1 pb-4 text-2xl leading-7 font-bold tracking-wide; +} + +.sectionHeading { + @apply pt-1 pb-2 text-2xl font-bold tracking-wide cursor-pointer mb-2; +} + +/* Apply base font sizes and styles for typography markup (h2, h2, ul, p, etc.). + A helpful addition for whenn page content is consumed from a source managed through a wysiwyg editor. */ + +.body :is(h1, h2, h3, h4, h5, h6, p, ul, ol) { + @apply mb-4; +} + +.body :is(h1, h2, h3, h4, h5, h6):not(:first-child) { + @apply mt-8; +} + +.body :is(h1, h2, h3, h4, h5, h6) { + @apply font-semibold tracking-wide; +} + +.body h1 { + @apply text-5xl; +} + +.body h2 { + @apply text-4xl; +} + +.body h3 { + @apply text-3xl; +} + +.body h4 { + @apply text-2xl; +} + +.body h5 { + @apply text-xl; +} + +.body h6 { + @apply text-lg; +} + +.body ul, +.body ol { + @apply pl-6; +} + +.body ul { + @apply list-disc; +} + +.body ol { + @apply list-decimal; +} + +.body a { + @apply underline; +} + +.body a:hover { + @apply no-underline; +} diff --git a/components/ui/Text/Text.tsx b/site/components/ui/Text/Text.tsx similarity index 98% rename from components/ui/Text/Text.tsx rename to site/components/ui/Text/Text.tsx index 6106c209a..486b77d3d 100644 --- a/components/ui/Text/Text.tsx +++ b/site/components/ui/Text/Text.tsx @@ -3,7 +3,7 @@ import React, { JSXElementConstructor, CSSProperties, } from 'react' -import cn from 'classnames' +import cn from 'clsx' import s from './Text.module.css' interface TextProps { diff --git a/components/ui/Text/index.ts b/site/components/ui/Text/index.ts similarity index 100% rename from components/ui/Text/index.ts rename to site/components/ui/Text/index.ts diff --git a/components/ui/context.tsx b/site/components/ui/context.tsx similarity index 100% rename from components/ui/context.tsx rename to site/components/ui/context.tsx diff --git a/components/ui/index.ts b/site/components/ui/index.ts similarity index 100% rename from components/ui/index.ts rename to site/components/ui/index.ts diff --git a/components/wishlist/WishlistButton/WishlistButton.module.css b/site/components/wishlist/WishlistButton/WishlistButton.module.css similarity index 100% rename from components/wishlist/WishlistButton/WishlistButton.module.css rename to site/components/wishlist/WishlistButton/WishlistButton.module.css diff --git a/components/wishlist/WishlistButton/WishlistButton.tsx b/site/components/wishlist/WishlistButton/WishlistButton.tsx similarity index 93% rename from components/wishlist/WishlistButton/WishlistButton.tsx rename to site/components/wishlist/WishlistButton/WishlistButton.tsx index a48eac170..419d271a5 100644 --- a/components/wishlist/WishlistButton/WishlistButton.tsx +++ b/site/components/wishlist/WishlistButton/WishlistButton.tsx @@ -1,5 +1,5 @@ import React, { FC, useState } from 'react' -import cn from 'classnames' +import cn from 'clsx' import { useUI } from '@components/ui' import { Heart } from '@components/icons' import useAddItem from '@framework/wishlist/use-add-item' @@ -31,8 +31,8 @@ const WishlistButton: FC = ({ const itemInWishlist = data?.items?.find( // @ts-ignore Wishlist is not always enabled (item) => - item.product_id === Number(productId) && - (item.variant_id as any) === Number(variant.id) + item.product_id === productId && + item.variant_id === variant.id ) const handleWishlistChange = async (e: any) => { diff --git a/components/wishlist/WishlistButton/index.ts b/site/components/wishlist/WishlistButton/index.ts similarity index 100% rename from components/wishlist/WishlistButton/index.ts rename to site/components/wishlist/WishlistButton/index.ts diff --git a/components/wishlist/WishlistCard/WishlistCard.module.css b/site/components/wishlist/WishlistCard/WishlistCard.module.css similarity index 100% rename from components/wishlist/WishlistCard/WishlistCard.module.css rename to site/components/wishlist/WishlistCard/WishlistCard.module.css diff --git a/components/wishlist/WishlistCard/WishlistCard.tsx b/site/components/wishlist/WishlistCard/WishlistCard.tsx similarity index 85% rename from components/wishlist/WishlistCard/WishlistCard.tsx rename to site/components/wishlist/WishlistCard/WishlistCard.tsx index dfc1165c2..7d0c6710a 100644 --- a/components/wishlist/WishlistCard/WishlistCard.tsx +++ b/site/components/wishlist/WishlistCard/WishlistCard.tsx @@ -1,5 +1,5 @@ import { FC, useState } from 'react' -import cn from 'classnames' +import cn from 'clsx' import Link from 'next/link' import Image from 'next/image' import s from './WishlistCard.module.css' @@ -11,14 +11,16 @@ import type { Product } from '@commerce/types/product' import usePrice from '@framework/product/use-price' import useAddItem from '@framework/cart/use-add-item' import useRemoveItem from '@framework/wishlist/use-remove-item' +import type { Wishlist } from '@commerce/types/wishlist' interface Props { - product: Product + item: Wishlist } const placeholderImg = '/product-img-placeholder.svg' -const WishlistCard: FC = ({ product }) => { +const WishlistCard: FC = ({ item }) => { + const product: Product = item.product const { price } = usePrice({ amount: product.price?.value, baseAmount: product.price?.retailPrice, @@ -40,7 +42,7 @@ const WishlistCard: FC = ({ product }) => { try { // If this action succeeds then there's no need to do `setRemoving(true)` // because the component will be removed from the view - await removeItem({ id: product.id! }) + await removeItem({ id: item.id! }) } catch (error) { setRemoving(false) } @@ -62,12 +64,14 @@ const WishlistCard: FC = ({ product }) => { return (
    - {product.images[0]?.alt +
    + {product.images[0]?.alt +
    diff --git a/components/wishlist/WishlistCard/index.ts b/site/components/wishlist/WishlistCard/index.ts similarity index 100% rename from components/wishlist/WishlistCard/index.ts rename to site/components/wishlist/WishlistCard/index.ts diff --git a/components/wishlist/index.ts b/site/components/wishlist/index.ts similarity index 100% rename from components/wishlist/index.ts rename to site/components/wishlist/index.ts diff --git a/config/seo.json b/site/config/seo_meta.json similarity index 90% rename from config/seo.json rename to site/config/seo_meta.json index 82520cf9b..c9c5fc226 100644 --- a/config/seo.json +++ b/site/config/seo_meta.json @@ -6,14 +6,13 @@ "title": "ACME Storefront | Powered by Next.js Commerce", "description": "Next.js Commerce - https://www.nextjs.org/commerce", "type": "website", - "locale": "en_IE", "url": "https://nextjs.org/commerce", "site_name": "Next.js Commerce", "images": [ { "url": "/card.png", - "width": 800, - "height": 600, + "width": "800", + "height": "600", "alt": "Next.js Commerce" } ] diff --git a/global.d.ts b/site/global.d.ts similarity index 100% rename from global.d.ts rename to site/global.d.ts diff --git a/lib/api/commerce.ts b/site/lib/api/commerce.ts similarity index 100% rename from lib/api/commerce.ts rename to site/lib/api/commerce.ts diff --git a/lib/click-outside/click-outside.tsx b/site/lib/click-outside/click-outside.tsx similarity index 100% rename from lib/click-outside/click-outside.tsx rename to site/lib/click-outside/click-outside.tsx diff --git a/lib/click-outside/has-parent.js b/site/lib/click-outside/has-parent.js similarity index 100% rename from lib/click-outside/has-parent.js rename to site/lib/click-outside/has-parent.js diff --git a/lib/click-outside/index.ts b/site/lib/click-outside/index.ts similarity index 100% rename from lib/click-outside/index.ts rename to site/lib/click-outside/index.ts diff --git a/lib/click-outside/is-in-dom.js b/site/lib/click-outside/is-in-dom.js similarity index 100% rename from lib/click-outside/is-in-dom.js rename to site/lib/click-outside/is-in-dom.js diff --git a/lib/colors.ts b/site/lib/colors.ts similarity index 100% rename from lib/colors.ts rename to site/lib/colors.ts diff --git a/lib/countries.ts b/site/lib/countries.ts similarity index 100% rename from lib/countries.ts rename to site/lib/countries.ts diff --git a/lib/focus-trap.tsx b/site/lib/focus-trap.tsx similarity index 90% rename from lib/focus-trap.tsx rename to site/lib/focus-trap.tsx index 6e1dc5fef..d886d6df2 100644 --- a/lib/focus-trap.tsx +++ b/site/lib/focus-trap.tsx @@ -55,10 +55,13 @@ export default function FocusTrap({ children, focusFirst = false }: Props) { } }, [root, children]) - return React.createElement('div', { - ref: root, - children, - className: 'outline-none focus-trap', - tabIndex: -1, - }) + return React.createElement( + 'div', + { + ref: root, + className: 'outline-none focus-trap', + tabIndex: -1, + }, + children + ) } diff --git a/site/lib/get-slug.ts b/site/lib/get-slug.ts new file mode 100644 index 000000000..329c5a27e --- /dev/null +++ b/site/lib/get-slug.ts @@ -0,0 +1,5 @@ +// Remove trailing and leading slash, usually included in nodes +// returned by the BigCommerce API +const getSlug = (path: string) => path.replace(/^\/|\/$/g, '') + +export default getSlug diff --git a/lib/hooks/useAcceptCookies.ts b/site/lib/hooks/useAcceptCookies.ts similarity index 100% rename from lib/hooks/useAcceptCookies.ts rename to site/lib/hooks/useAcceptCookies.ts diff --git a/lib/hooks/useUserAvatar.ts b/site/lib/hooks/useUserAvatar.ts similarity index 100% rename from lib/hooks/useUserAvatar.ts rename to site/lib/hooks/useUserAvatar.ts diff --git a/lib/range-map.ts b/site/lib/range-map.ts similarity index 100% rename from lib/range-map.ts rename to site/lib/range-map.ts diff --git a/lib/search-props.tsx b/site/lib/search-props.tsx similarity index 100% rename from lib/search-props.tsx rename to site/lib/search-props.tsx diff --git a/lib/search.tsx b/site/lib/search.tsx similarity index 93% rename from lib/search.tsx rename to site/lib/search.tsx index 87b42db36..eaeaf66fc 100644 --- a/lib/search.tsx +++ b/site/lib/search.tsx @@ -18,10 +18,10 @@ export function useSearchMeta(asPath: string) { c = parts[4] } - setPathname(path) + if (path !== pathname) setPathname(path) if (c !== category) setCategory(c) if (b !== brand) setBrand(b) - }, [asPath]) + }, [asPath, pathname, category, brand]) return { pathname, category, brand } } diff --git a/lib/to-pixels.ts b/site/lib/to-pixels.ts similarity index 100% rename from lib/to-pixels.ts rename to site/lib/to-pixels.ts diff --git a/lib/usage-warns.ts b/site/lib/usage-warns.ts similarity index 100% rename from lib/usage-warns.ts rename to site/lib/usage-warns.ts diff --git a/site/next-env.d.ts b/site/next-env.d.ts new file mode 100644 index 000000000..4f11a03dc --- /dev/null +++ b/site/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/next.config.js b/site/next.config.js similarity index 74% rename from next.config.js rename to site/next.config.js index dd576aba5..d2378d7df 100644 --- a/next.config.js +++ b/site/next.config.js @@ -1,15 +1,12 @@ const commerce = require('./commerce.config.json') -const { - withCommerceConfig, - getProviderName, -} = require('./framework/commerce/config') +const { withCommerceConfig, getProviderName } = require('./commerce-config') const provider = commerce.provider || getProviderName() -const isBC = provider === 'bigcommerce' -const isShopify = provider === 'shopify' -const isSaleor = provider === 'saleor' -const isSwell = provider === 'swell' -const isVendure = provider === 'vendure' +const isBC = provider === '@vercel/commerce-bigcommerce' +const isShopify = provider === '@vercel/commerce-shopify' +const isSaleor = provider === '@vercel/commerce-saleor' +const isSwell = provider === '@vercel/commerce-swell' +const isVendure = provider === '@vercel/commerce-vendure' module.exports = withCommerceConfig({ env: { @@ -23,7 +20,7 @@ module.exports = withCommerceConfig({ }, rewrites() { return [ - (isBC || isShopify || isSwell || isVendure) && { + (isBC || isShopify || isSwell || isVendure || isSaleor) && { source: '/checkout', destination: '/api/checkout', }, diff --git a/site/package.json b/site/package.json new file mode 100644 index 000000000..f5b38acfd --- /dev/null +++ b/site/package.json @@ -0,0 +1,105 @@ +{ + "name": "next-commerce", + "version": "0.0.1", + "license": "MIT", + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "analyze": "BUNDLE_ANALYZE=both next build", + "lint": "next lint", + "prettier-fix": "prettier --write .", + "find:unused": "npx next-unused" + }, + "sideEffects": false, + "dependencies": { + "@react-spring/web": "^9.4.1", + "@vercel/commerce": "^0.0.1", + "@vercel/commerce-bigcommerce": "^0.0.1", + "@vercel/commerce-commercejs": "^0.0.1", + "@vercel/commerce-kibocommerce": "^0.0.1", + "@vercel/commerce-local": "^0.0.1", + "@vercel/commerce-ordercloud": "^0.0.1", + "@vercel/commerce-saleor": "^0.0.1", + "@vercel/commerce-shopify": "^0.0.1", + "@vercel/commerce-spree": "^0.0.1", + "@vercel/commerce-swell": "^0.0.1", + "@vercel/commerce-vendure": "^0.0.1", + "autoprefixer": "^10.4.2", + "body-scroll-lock": "^4.0.0-beta.0", + "clsx": "^1.1.1", + "email-validator": "^2.0.4", + "js-cookie": "^3.0.1", + "keen-slider": "^6.6.3", + "lodash.random": "^3.2.0", + "lodash.throttle": "^4.1.1", + "next": "^12.0.8", + "next-themes": "^0.0.15", + "postcss": "^8.3.5", + "postcss-nesting": "^8.0.1", + "react": "^17.0.2", + "react-dom": "^17.0.2", + "react-fast-marquee": "^1.3.1", + "react-merge-refs": "^1.1.0", + "react-use-measure": "^2.1.1", + "tabbable": "^5.2.1", + "tailwindcss": "^3.0.13" + }, + "devDependencies": { + "@next/bundle-analyzer": "^12.0.8", + "@types/body-scroll-lock": "^3.1.0", + "@types/js-cookie": "^3.0.1", + "@types/lodash.random": "^3.2.6", + "@types/lodash.throttle": "^4.1.6", + "@types/node": "^17.0.8", + "@types/react": "^17.0.38", + "eslint": "^8.6.0", + "eslint-config-next": "^12.0.8", + "eslint-config-prettier": "^8.3.0", + "lint-staged": "^12.1.7", + "postcss-flexbugs-fixes": "^5.0.2", + "postcss-preset-env": "^7.2.3", + "prettier": "^2.5.1", + "typescript": "4.3.4" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx}": [ + "eslint", + "prettier --write", + "git add" + ], + "**/*.{md,mdx,json}": [ + "prettier --write", + "git add" + ] + }, + "next-unused": { + "alias": { + "@lib/*": [ + "lib/*" + ], + "@assets/*": [ + "assets/*" + ], + "@config/*": [ + "config/*" + ], + "@components/*": [ + "components/*" + ], + "@utils/*": [ + "utils/*" + ] + }, + "debug": true, + "include": [ + "components", + "lib", + "pages" + ], + "exclude": [], + "entrypoints": [ + "pages" + ] + } +} diff --git a/pages/404.tsx b/site/pages/404.tsx similarity index 100% rename from pages/404.tsx rename to site/pages/404.tsx diff --git a/pages/[...pages].tsx b/site/pages/[...pages].tsx similarity index 100% rename from pages/[...pages].tsx rename to site/pages/[...pages].tsx diff --git a/pages/_app.tsx b/site/pages/_app.tsx similarity index 100% rename from pages/_app.tsx rename to site/pages/_app.tsx diff --git a/pages/_document.tsx b/site/pages/_document.tsx similarity index 100% rename from pages/_document.tsx rename to site/pages/_document.tsx diff --git a/pages/api/cart.ts b/site/pages/api/cart.ts similarity index 100% rename from pages/api/cart.ts rename to site/pages/api/cart.ts diff --git a/pages/api/catalog/products.ts b/site/pages/api/catalog/products.ts similarity index 100% rename from pages/api/catalog/products.ts rename to site/pages/api/catalog/products.ts diff --git a/pages/api/checkout.ts b/site/pages/api/checkout.ts similarity index 100% rename from pages/api/checkout.ts rename to site/pages/api/checkout.ts diff --git a/site/pages/api/customer/address.ts b/site/pages/api/customer/address.ts new file mode 100644 index 000000000..5815ea462 --- /dev/null +++ b/site/pages/api/customer/address.ts @@ -0,0 +1,4 @@ +import customerAddressApi from '@framework/api/endpoints/customer/address' +import commerce from '@lib/api/commerce' + +export default customerAddressApi(commerce) diff --git a/site/pages/api/customer/card.ts b/site/pages/api/customer/card.ts new file mode 100644 index 000000000..6f88b8c74 --- /dev/null +++ b/site/pages/api/customer/card.ts @@ -0,0 +1,4 @@ +import customerCardApi from '@framework/api/endpoints/customer/card' +import commerce from '@lib/api/commerce' + +export default customerCardApi(commerce) diff --git a/pages/api/customer.ts b/site/pages/api/customer/index.ts similarity index 100% rename from pages/api/customer.ts rename to site/pages/api/customer/index.ts diff --git a/pages/api/login.ts b/site/pages/api/login.ts similarity index 100% rename from pages/api/login.ts rename to site/pages/api/login.ts diff --git a/pages/api/logout.ts b/site/pages/api/logout.ts similarity index 100% rename from pages/api/logout.ts rename to site/pages/api/logout.ts diff --git a/pages/api/signup.ts b/site/pages/api/signup.ts similarity index 100% rename from pages/api/signup.ts rename to site/pages/api/signup.ts diff --git a/pages/api/wishlist.ts b/site/pages/api/wishlist.ts similarity index 100% rename from pages/api/wishlist.ts rename to site/pages/api/wishlist.ts diff --git a/pages/cart.tsx b/site/pages/cart.tsx similarity index 91% rename from pages/cart.tsx rename to site/pages/cart.tsx index 3279301da..09a2227a2 100644 --- a/pages/cart.tsx +++ b/site/pages/cart.tsx @@ -6,6 +6,7 @@ import { Layout } from '@components/common' import { Button, Text } from '@components/ui' import { Bag, Cross, Check, MapPin, CreditCard } from '@components/icons' import { CartItem } from '@components/cart' +import { useUI } from '@components/ui/context' export async function getStaticProps({ preview, @@ -26,6 +27,7 @@ export default function Cart() { const error = null const success = null const { data, isLoading, isEmpty } = useCart() + const { openSidebar, setSidebarView } = useUI() const { price: subTotal } = usePrice( data && { @@ -40,6 +42,11 @@ export default function Cart() { } ) + const goToCheckout = () => { + openSidebar() + setSidebarView('CHECKOUT_VIEW') + } + return (
    @@ -162,9 +169,17 @@ export default function Cart() { Continue Shopping ) : ( - + <> + {process.env.COMMERCE_CUSTOMCHECKOUT_ENABLED ? ( + + ) : ( + + )} + )}
    diff --git a/pages/index.tsx b/site/pages/index.tsx similarity index 98% rename from pages/index.tsx rename to site/pages/index.tsx index b399923f7..8db7fe589 100644 --- a/pages/index.tsx +++ b/site/pages/index.tsx @@ -48,6 +48,7 @@ export default function Home({ imgProps={{ width: i === 0 ? 1080 : 540, height: i === 0 ? 1080 : 540, + priority: true, }} /> ))} diff --git a/pages/orders.tsx b/site/pages/orders.tsx similarity index 100% rename from pages/orders.tsx rename to site/pages/orders.tsx diff --git a/pages/product/[slug].tsx b/site/pages/product/[slug].tsx similarity index 100% rename from pages/product/[slug].tsx rename to site/pages/product/[slug].tsx diff --git a/pages/profile.tsx b/site/pages/profile.tsx similarity index 100% rename from pages/profile.tsx rename to site/pages/profile.tsx diff --git a/pages/search.tsx b/site/pages/search.tsx similarity index 100% rename from pages/search.tsx rename to site/pages/search.tsx diff --git a/pages/search/[category].tsx b/site/pages/search/[category].tsx similarity index 100% rename from pages/search/[category].tsx rename to site/pages/search/[category].tsx diff --git a/pages/search/designers/[name].tsx b/site/pages/search/designers/[name].tsx similarity index 100% rename from pages/search/designers/[name].tsx rename to site/pages/search/designers/[name].tsx diff --git a/pages/search/designers/[name]/[category].tsx b/site/pages/search/designers/[name]/[category].tsx similarity index 100% rename from pages/search/designers/[name]/[category].tsx rename to site/pages/search/designers/[name]/[category].tsx diff --git a/pages/wishlist.tsx b/site/pages/wishlist.tsx similarity index 73% rename from pages/wishlist.tsx rename to site/pages/wishlist.tsx index fd28edff4..389e7aaab 100644 --- a/pages/wishlist.tsx +++ b/site/pages/wishlist.tsx @@ -2,10 +2,11 @@ import type { GetStaticPropsContext } from 'next' import commerce from '@lib/api/commerce' import { Heart } from '@components/icons' import { Layout } from '@components/common' -import { Text, Container } from '@components/ui' +import { Text, Container, Skeleton } from '@components/ui' import { useCustomer } from '@framework/customer' import { WishlistCard } from '@components/wishlist' import useWishlist from '@framework/wishlist/use-wishlist' +import rangeMap from '@lib/range-map' export async function getStaticProps({ preview, @@ -43,7 +44,15 @@ export default function Wishlist() {
    My Wishlist
    - {isLoading || isEmpty ? ( + {isLoading ? ( +
    + {rangeMap(12, (i) => ( + +
    + + ))} +
    + ) : isEmpty ? (
    @@ -56,11 +65,13 @@ export default function Wishlist() {

    ) : ( - data && - // @ts-ignore Shopify - Fix this types - data.items?.map((item) => ( - - )) +
    + {data && + // @ts-ignore Shopify - Fix this types + data.items?.map((item) => ( + + ))} +
    )}
    diff --git a/postcss.config.js b/site/postcss.config.js similarity index 86% rename from postcss.config.js rename to site/postcss.config.js index 9e0f0b2ca..5f89537e1 100644 --- a/postcss.config.js +++ b/site/postcss.config.js @@ -1,7 +1,8 @@ module.exports = { plugins: [ + 'tailwindcss/nesting', 'tailwindcss', - 'postcss-nesting', + 'autoprefixer', 'postcss-flexbugs-fixes', [ 'postcss-preset-env', diff --git a/public/assets/drop-shirt-0.png b/site/public/assets/drop-shirt-0.png similarity index 100% rename from public/assets/drop-shirt-0.png rename to site/public/assets/drop-shirt-0.png diff --git a/public/assets/drop-shirt-1.png b/site/public/assets/drop-shirt-1.png similarity index 100% rename from public/assets/drop-shirt-1.png rename to site/public/assets/drop-shirt-1.png diff --git a/public/assets/drop-shirt-2.png b/site/public/assets/drop-shirt-2.png similarity index 100% rename from public/assets/drop-shirt-2.png rename to site/public/assets/drop-shirt-2.png diff --git a/public/assets/drop-shirt.png b/site/public/assets/drop-shirt.png similarity index 100% rename from public/assets/drop-shirt.png rename to site/public/assets/drop-shirt.png diff --git a/public/assets/lightweight-jacket-0.png b/site/public/assets/lightweight-jacket-0.png similarity index 100% rename from public/assets/lightweight-jacket-0.png rename to site/public/assets/lightweight-jacket-0.png diff --git a/public/assets/lightweight-jacket-1.png b/site/public/assets/lightweight-jacket-1.png similarity index 100% rename from public/assets/lightweight-jacket-1.png rename to site/public/assets/lightweight-jacket-1.png diff --git a/public/assets/lightweight-jacket-2.png b/site/public/assets/lightweight-jacket-2.png similarity index 100% rename from public/assets/lightweight-jacket-2.png rename to site/public/assets/lightweight-jacket-2.png diff --git a/public/assets/t-shirt-0.png b/site/public/assets/t-shirt-0.png similarity index 100% rename from public/assets/t-shirt-0.png rename to site/public/assets/t-shirt-0.png diff --git a/public/assets/t-shirt-1.png b/site/public/assets/t-shirt-1.png similarity index 100% rename from public/assets/t-shirt-1.png rename to site/public/assets/t-shirt-1.png diff --git a/public/assets/t-shirt-2.png b/site/public/assets/t-shirt-2.png similarity index 100% rename from public/assets/t-shirt-2.png rename to site/public/assets/t-shirt-2.png diff --git a/public/assets/t-shirt-3.png b/site/public/assets/t-shirt-3.png similarity index 100% rename from public/assets/t-shirt-3.png rename to site/public/assets/t-shirt-3.png diff --git a/public/assets/t-shirt-4.png b/site/public/assets/t-shirt-4.png similarity index 100% rename from public/assets/t-shirt-4.png rename to site/public/assets/t-shirt-4.png diff --git a/public/bg-products.svg b/site/public/bg-products.svg similarity index 100% rename from public/bg-products.svg rename to site/public/bg-products.svg diff --git a/public/card.png b/site/public/card.png similarity index 100% rename from public/card.png rename to site/public/card.png diff --git a/public/cursor-left.png b/site/public/cursor-left.png similarity index 100% rename from public/cursor-left.png rename to site/public/cursor-left.png diff --git a/public/cursor-right.png b/site/public/cursor-right.png similarity index 100% rename from public/cursor-right.png rename to site/public/cursor-right.png diff --git a/public/favicon.ico b/site/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to site/public/favicon.ico diff --git a/public/flag-en-us.svg b/site/public/flag-en-us.svg similarity index 100% rename from public/flag-en-us.svg rename to site/public/flag-en-us.svg diff --git a/public/flag-es-ar.svg b/site/public/flag-es-ar.svg similarity index 100% rename from public/flag-es-ar.svg rename to site/public/flag-es-ar.svg diff --git a/public/flag-es-co.svg b/site/public/flag-es-co.svg similarity index 100% rename from public/flag-es-co.svg rename to site/public/flag-es-co.svg diff --git a/public/flag-es.svg b/site/public/flag-es.svg similarity index 100% rename from public/flag-es.svg rename to site/public/flag-es.svg diff --git a/public/icon-144x144.png b/site/public/icon-144x144.png similarity index 100% rename from public/icon-144x144.png rename to site/public/icon-144x144.png diff --git a/public/icon-192x192.png b/site/public/icon-192x192.png similarity index 100% rename from public/icon-192x192.png rename to site/public/icon-192x192.png diff --git a/public/icon-512x512.png b/site/public/icon-512x512.png similarity index 100% rename from public/icon-512x512.png rename to site/public/icon-512x512.png diff --git a/public/icon.png b/site/public/icon.png similarity index 100% rename from public/icon.png rename to site/public/icon.png diff --git a/public/product-img-placeholder.svg b/site/public/product-img-placeholder.svg similarity index 100% rename from public/product-img-placeholder.svg rename to site/public/product-img-placeholder.svg diff --git a/public/site.webmanifest b/site/public/site.webmanifest similarity index 100% rename from public/site.webmanifest rename to site/public/site.webmanifest diff --git a/public/slider-arrows.png b/site/public/slider-arrows.png similarity index 100% rename from public/slider-arrows.png rename to site/public/slider-arrows.png diff --git a/public/vercel.svg b/site/public/vercel.svg similarity index 100% rename from public/vercel.svg rename to site/public/vercel.svg diff --git a/tailwind.config.js b/site/tailwind.config.js similarity index 84% rename from tailwind.config.js rename to site/tailwind.config.js index 25f9d8e38..09a8d21cb 100644 --- a/tailwind.config.js +++ b/site/tailwind.config.js @@ -1,19 +1,9 @@ module.exports = { - future: { - purgeLayersByDefault: true, - applyComplexClasses: true, - }, - purge: { - content: [ - './pages/**/*.{js,ts,jsx,tsx}', - './components/**/*.{js,ts,jsx,tsx}', - ], - options: { - safelist: { - standard: ['outline-none'], - }, - }, - }, + content: [ + './pages/**/*.{js,ts,jsx,tsx}', + './components/**/*.{js,ts,jsx,tsx}', + ], + safelist: ['outline-none'], theme: { extend: { maxWidth: { diff --git a/tsconfig.json b/site/tsconfig.json similarity index 73% rename from tsconfig.json rename to site/tsconfig.json index 21fc08cf9..f3de48254 100644 --- a/tsconfig.json +++ b/site/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "baseUrl": ".", "target": "esnext", + "module": "esnext", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, @@ -9,7 +10,6 @@ "forceConsistentCasingInFileNames": true, "noEmit": true, "esModuleInterop": true, - "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, @@ -21,20 +21,12 @@ "@config/*": ["config/*"], "@assets/*": ["assets/*"], "@components/*": ["components/*"], - "@commerce": ["framework/commerce"], - "@commerce/*": ["framework/commerce/*"], + "@commerce": ["../packages/commerce/src"], + "@commerce/*": ["../packages/commerce/src/*"], "@framework": ["framework/reactioncommerce"], "@framework/*": ["framework/reactioncommerce/*"] } }, "include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"], - "exclude": [ - "node_modules", - "./framework/bigcommerce", - "./framework/shopify", - "./framework/swell", - "./framework/vendure", - "./framework/saleor", - "./framework/reactioncommerce" - ] + "exclude": ["node_modules"] } diff --git a/swell-js.d.ts b/swell-js.d.ts deleted file mode 100644 index 64a94d89e..000000000 --- a/swell-js.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'swell-js' diff --git a/turbo.json b/turbo.json new file mode 100644 index 000000000..8e38ccddc --- /dev/null +++ b/turbo.json @@ -0,0 +1,38 @@ +{ + "baseBranch": "origin/main", + "pipeline": { + "build": { + "dependsOn": ["^build"], + "outputs": ["dist/**"] + }, + "next-commerce#build": { + "dependsOn": [ + "^build", + "$COMMERCE_PROVIDER", + "$BIGCOMMERCE_STOREFRONT_API_URL", + "$NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN", + "$NEXT_PUBLIC_SWELL_STORE_ID" + ], + "outputs": [".next/**"] + }, + "test": { + "dependsOn": ["^build"], + "outputs": [] + }, + "lint": { + "outputs": [] + }, + "prettier-fix": { + "outputs": [] + }, + "dev": { + "cache": false + }, + "start": { + "cache": false + }, + "types": { + "outputs": ["dist/**/*.d.ts"] + } + } +} diff --git a/yarn.lock b/yarn.lock index b5e304464..32a625bce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,241 +2,238 @@ # yarn lockfile v1 -"@ardatan/aggregate-error@0.0.6": - version "0.0.6" - resolved "https://registry.yarnpkg.com/@ardatan/aggregate-error/-/aggregate-error-0.0.6.tgz#fe6924771ea40fc98dc7a7045c2e872dc8527609" - integrity sha512-vyrkEHG1jrukmzTPtyWB4NLPauUw5bQeg4uhn8f+1SSynmrOcyvlb1GKQjjgoBzElLdfXCRYX8UnBlhklOHYRQ== +"@ampproject/remapping@^2.1.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.1.2.tgz#4edca94973ded9630d20101cd8559cedb8d8bd34" + integrity sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg== dependencies: - tslib "~2.0.1" + "@jridgewell/trace-mapping" "^0.3.0" -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" + integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== dependencies: - "@babel/highlight" "^7.10.4" + "@babel/highlight" "^7.16.7" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" - integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== +"@babel/compat-data@^7.16.4", "@babel/compat-data@^7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.0.tgz#86850b8597ea6962089770952075dcaabb8dba34" + integrity sha512-392byTlpGWXMv4FbyWw3sAZ/FrW/DrwqLGXpy0mbyNe9Taqv1mg9yON5/o0cnr8XYCkFTZbC1eV+c+LAROgrng== + +"@babel/core@^7.14.0": + version "7.17.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.5.tgz#6cd2e836058c28f06a4ca8ee7ed955bbf37c8225" + integrity sha512-/BBMw4EvjmyquN5O+t5eh0+YqB3XXJkYD2cjKpYtWOfFy4lQ4UozNSmxAcWT8r2XtZs0ewG+zrfsqeR15i1ajA== dependencies: - "@babel/highlight" "^7.14.5" - -"@babel/compat-data@^7.14.5", "@babel/compat-data@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.7.tgz#7b047d7a3a89a67d2258dc61f604f098f1bc7e08" - integrity sha512-nS6dZaISCXJ3+518CWiBfEr//gHyMO02uDxBkXTKZDN5POruCnOZ1N4YBRZDCabwF8nZMWBpRxIicmXtBs+fvw== - -"@babel/core@^7.0.0": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.6.tgz#e0814ec1a950032ff16c13a2721de39a8416fcab" - integrity sha512-gJnOEWSqTk96qG5BoIrl5bVtc23DCycmIePPYnamY9RboYdI4nFy5vAQMSl81O5K/W0sLDWfGysnOECC+KUUCA== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.14.5" - "@babel/helper-compilation-targets" "^7.14.5" - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helpers" "^7.14.6" - "@babel/parser" "^7.14.6" - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.17.3" + "@babel/helper-compilation-targets" "^7.16.7" + "@babel/helper-module-transforms" "^7.16.7" + "@babel/helpers" "^7.17.2" + "@babel/parser" "^7.17.3" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.17.3" + "@babel/types" "^7.17.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.1.2" semver "^6.3.0" - source-map "^0.5.0" -"@babel/generator@^7.12.13", "@babel/generator@^7.14.5", "@babel/generator@^7.5.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.5.tgz#848d7b9f031caca9d0cd0af01b063f226f52d785" - integrity sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA== +"@babel/generator@^7.14.0", "@babel/generator@^7.17.3": + version "7.17.3" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.3.tgz#a2c30b0c4f89858cb87050c3ffdfd36bdf443200" + integrity sha512-+R6Dctil/MgUsZsZAkYgK+ADNSZzJRRy0TvY65T71z/CR854xHQ1EweBYXdfT+HNeN7w0cSJJEzgxZMv40pxsg== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.17.0" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.14.5.tgz#7bf478ec3b71726d56a8ca5775b046fc29879e61" - integrity sha512-EivH9EgBIb+G8ij1B2jAwSH36WnGvkQSEC6CkX/6v6ZFlw5fVOHvsgGF4uiEHO2GzMvunZb6tDLQEQSdrdocrA== +"@babel/helper-annotate-as-pure@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz#bb2339a7534a9c128e3102024c60760a3a7f3862" + integrity sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.16.7" -"@babel/helper-compilation-targets@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.5.tgz#7a99c5d0967911e972fe2c3411f7d5b498498ecf" - integrity sha512-v+QtZqXEiOnpO6EYvlImB6zCD2Lel06RzOPzmkz/D/XgQiUu3C/Jb1LOqSt/AIA34TYi/Q+KlT8vTQrgdxkbLw== +"@babel/helper-compilation-targets@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz#06e66c5f299601e6c7da350049315e83209d551b" + integrity sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA== dependencies: - "@babel/compat-data" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" + "@babel/compat-data" "^7.16.4" + "@babel/helper-validator-option" "^7.16.7" + browserslist "^4.17.5" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.14.5": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.6.tgz#f114469b6c06f8b5c59c6c4e74621f5085362542" - integrity sha512-Z6gsfGofTxH/+LQXqYEK45kxmcensbzmk/oi8DmaQytlQCgqNZt9XQF8iqlI/SeXWVjaMNxvYvzaYw+kh42mDg== +"@babel/helper-create-class-features-plugin@^7.16.7": + version "7.17.6" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.6.tgz#3778c1ed09a7f3e65e6d6e0f6fbfcc53809d92c9" + integrity sha512-SogLLSxXm2OkBbSsHZMM4tUi8fUzjs63AT/d0YQIzr6GSd8Hxsbk2KYDX0k0DweAzGMj/YWeiCsorIdtdcW8Eg== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-member-expression-to-functions" "^7.14.5" - "@babel/helper-optimise-call-expression" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" - "@babel/helper-split-export-declaration" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-member-expression-to-functions" "^7.16.7" + "@babel/helper-optimise-call-expression" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" -"@babel/helper-function-name@^7.12.13", "@babel/helper-function-name@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz#89e2c474972f15d8e233b52ee8c480e2cfcd50c4" - integrity sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ== +"@babel/helper-environment-visitor@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7" + integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag== dependencies: - "@babel/helper-get-function-arity" "^7.14.5" - "@babel/template" "^7.14.5" - "@babel/types" "^7.14.5" + "@babel/types" "^7.16.7" -"@babel/helper-get-function-arity@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz#25fbfa579b0937eee1f3b805ece4ce398c431815" - integrity sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg== +"@babel/helper-function-name@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" + integrity sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA== dependencies: - "@babel/types" "^7.14.5" + "@babel/helper-get-function-arity" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/types" "^7.16.7" -"@babel/helper-hoist-variables@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz#e0dd27c33a78e577d7c8884916a3e7ef1f7c7f8d" - integrity sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ== +"@babel/helper-get-function-arity@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" + integrity sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.16.7" -"@babel/helper-member-expression-to-functions@^7.14.5": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.14.7.tgz#97e56244beb94211fe277bd818e3a329c66f7970" - integrity sha512-TMUt4xKxJn6ccjcOW7c4hlwyJArizskAhoSTOCkA0uZ+KghIaci0Qg9R043kUMWI9mtQfgny+NQ5QATnZ+paaA== +"@babel/helper-hoist-variables@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" + integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.16.7" -"@babel/helper-module-imports@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz#6d1a44df6a38c957aa7c312da076429f11b422f3" - integrity sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ== +"@babel/helper-member-expression-to-functions@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.7.tgz#42b9ca4b2b200123c3b7e726b0ae5153924905b0" + integrity sha512-VtJ/65tYiU/6AbMTDwyoXGPKHgTsfRarivm+YbB5uAzKUyuPjgZSgAFeG87FCigc7KNHu2Pegh1XIT3lXjvz3Q== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.16.7" -"@babel/helper-module-transforms@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.14.5.tgz#7de42f10d789b423eb902ebd24031ca77cb1e10e" - integrity sha512-iXpX4KW8LVODuAieD7MzhNjmM6dzYY5tfRqT+R9HDXWl0jPn/djKmA+G9s/2C2T9zggw5tK1QNqZ70USfedOwA== +"@babel/helper-module-imports@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" + integrity sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg== dependencies: - "@babel/helper-module-imports" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" - "@babel/helper-simple-access" "^7.14.5" - "@babel/helper-split-export-declaration" "^7.14.5" - "@babel/helper-validator-identifier" "^7.14.5" - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" + "@babel/types" "^7.16.7" -"@babel/helper-optimise-call-expression@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz#f27395a8619e0665b3f0364cddb41c25d71b499c" - integrity sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA== +"@babel/helper-module-transforms@^7.16.7": + version "7.17.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.6.tgz#3c3b03cc6617e33d68ef5a27a67419ac5199ccd0" + integrity sha512-2ULmRdqoOMpdvkbT8jONrZML/XALfzxlb052bldftkicAUy8AxSCkD5trDPQcwHNmolcl7wP6ehNqMlyUw6AaA== dependencies: - "@babel/types" "^7.14.5" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-module-imports" "^7.16.7" + "@babel/helper-simple-access" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/helper-validator-identifier" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.17.3" + "@babel/types" "^7.17.0" -"@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" - integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== - -"@babel/helper-replace-supers@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.14.5.tgz#0ecc0b03c41cd567b4024ea016134c28414abb94" - integrity sha512-3i1Qe9/8x/hCHINujn+iuHy+mMRLoc77b2nI9TB0zjH1hvn9qGlXjWlggdwUcju36PkPCy/lpM7LLUdcTyH4Ow== +"@babel/helper-optimise-call-expression@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz#a34e3560605abbd31a18546bd2aad3e6d9a174f2" + integrity sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w== dependencies: - "@babel/helper-member-expression-to-functions" "^7.14.5" - "@babel/helper-optimise-call-expression" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" + "@babel/types" "^7.16.7" -"@babel/helper-simple-access@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.14.5.tgz#66ea85cf53ba0b4e588ba77fc813f53abcaa41c4" - integrity sha512-nfBN9xvmCt6nrMZjfhkl7i0oTV3yxR4/FztsbOASyTvVcoYd0TRHh7eMLdlEcCqobydC0LAF3LtC92Iwxo0wyw== +"@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.8.0": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5" + integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA== + +"@babel/helper-replace-supers@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz#e9f5f5f32ac90429c1a4bdec0f231ef0c2838ab1" + integrity sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw== dependencies: - "@babel/types" "^7.14.5" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-member-expression-to-functions" "^7.16.7" + "@babel/helper-optimise-call-expression" "^7.16.7" + "@babel/traverse" "^7.16.7" + "@babel/types" "^7.16.7" -"@babel/helper-skip-transparent-expression-wrappers@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.14.5.tgz#96f486ac050ca9f44b009fbe5b7d394cab3a0ee4" - integrity sha512-dmqZB7mrb94PZSAOYtr+ZN5qt5owZIAgqtoTuqiFbHFtxgEcmQlRJVI+bO++fciBunXtB6MK7HrzrfcAzIz2NQ== +"@babel/helper-simple-access@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz#d656654b9ea08dbb9659b69d61063ccd343ff0f7" + integrity sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.16.7" -"@babel/helper-split-export-declaration@^7.12.13", "@babel/helper-split-export-declaration@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz#22b23a54ef51c2b7605d851930c1976dd0bc693a" - integrity sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA== +"@babel/helper-skip-transparent-expression-wrappers@^7.16.0": + version "7.16.0" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz#0ee3388070147c3ae051e487eca3ebb0e2e8bb09" + integrity sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.16.0" -"@babel/helper-validator-identifier@^7.12.11", "@babel/helper-validator-identifier@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz#d0f0e277c512e0c938277faa85a3968c9a44c0e8" - integrity sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg== - -"@babel/helper-validator-option@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" - integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== - -"@babel/helpers@^7.14.6": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.14.6.tgz#5b58306b95f1b47e2a0199434fa8658fa6c21635" - integrity sha512-yesp1ENQBiLI+iYHSJdoZKUtRpfTlL1grDIX9NRlAVppljLw/4tTyYupIB7uIYmC3stW/imAv8EqaKaS/ibmeA== +"@babel/helper-split-export-declaration@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" + integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== dependencies: - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.14.5" - "@babel/types" "^7.14.5" + "@babel/types" "^7.16.7" -"@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== +"@babel/helper-validator-identifier@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" + integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== + +"@babel/helper-validator-option@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" + integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== + +"@babel/helpers@^7.17.2": + version "7.17.2" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.2.tgz#23f0a0746c8e287773ccd27c14be428891f63417" + integrity sha512-0Qu7RLR1dILozr/6M0xgj+DFPmi6Bnulgm9M8BVa9ZCWxDqlSnqt3cf8IDPB5m45sVXUZ0kuQAgUrdSFFH79fQ== dependencies: - "@babel/helper-validator-identifier" "^7.14.5" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.17.0" + "@babel/types" "^7.17.0" + +"@babel/highlight@^7.16.7": + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" + integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== + dependencies: + "@babel/helper-validator-identifier" "^7.16.7" chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@7.12.16": - version "7.12.16" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.16.tgz#cc31257419d2c3189d394081635703f549fc1ed4" - integrity sha512-c/+u9cqV6F0+4Hpq01jnJO+GLp2DdT63ppz9Xa+6cHaajM9VFzK/iDXiKK65YtpeVwu+ctfS6iqlMqRgQRzeCw== - -"@babel/parser@^7.0.0", "@babel/parser@^7.12.13", "@babel/parser@^7.14.5", "@babel/parser@^7.14.6", "@babel/parser@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595" - integrity sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA== +"@babel/parser@^7.14.0", "@babel/parser@^7.16.7", "@babel/parser@^7.16.8", "@babel/parser@^7.17.3": + version "7.17.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.3.tgz#b07702b982990bf6fdc1da5049a23fece4c5c3d0" + integrity sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA== "@babel/plugin-proposal-class-properties@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.14.5.tgz#40d1ee140c5b1e31a350f4f5eed945096559b42e" - integrity sha512-q/PLpv5Ko4dVc1LYMpCY7RVAAO4uk55qPwrIuJ5QJ8c6cVuAmhu7I/49JOppXL6gXf7ZHzpRVEUZdYoPLM04Gg== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz#925cad7b3b1a2fcea7e59ecc8eb5954f961f91b0" + integrity sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww== dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-proposal-object-rest-spread@^7.0.0": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.7.tgz#5920a2b3df7f7901df0205974c0641b13fd9d363" - integrity sha512-082hsZz+sVabfmDWo1Oct1u1AgbKbUAyVgmX4otIc7bdsRgHBXwTwb3DpDmD4Eyyx6DNiuz5UAATT655k+kL5g== + version "7.17.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.17.3.tgz#d9eb649a54628a51701aef7e0ea3d17e2b9dd390" + integrity sha512-yuL5iQA/TbZn+RGAfxQXfi7CNLmKi1f8zInn4IgobuCWcAb7i+zj4TYzQ9l8cEzVyJ89PDGuqxK1xZpUDISesw== dependencies: - "@babel/compat-data" "^7.14.7" - "@babel/helper-compilation-targets" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/compat-data" "^7.17.0" + "@babel/helper-compilation-targets" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.14.5" + "@babel/plugin-transform-parameters" "^7.16.7" "@babel/plugin-syntax-class-properties@^7.0.0": version "7.12.13" @@ -245,19 +242,19 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-syntax-flow@^7.0.0", "@babel/plugin-syntax-flow@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.14.5.tgz#2ff654999497d7d7d142493260005263731da180" - integrity sha512-9WK5ZwKCdWHxVuU13XNT6X73FGmutAXeor5lGFq6qhOFtMFUF4jkbijuyUdZZlpYq6E2hZeZf/u3959X9wsv0Q== +"@babel/plugin-syntax-flow@^7.0.0", "@babel/plugin-syntax-flow@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.16.7.tgz#202b147e5892b8452bbb0bb269c7ed2539ab8832" + integrity sha512-UDo3YGQO0jH6ytzVwgSLv9i/CzMcUjbKenL67dTrAZPPv6GFAtDhe6jqnvmoKzC/7htNTohhos+onPtDMqJwaQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-syntax-jsx@^7.0.0", "@babel/plugin-syntax-jsx@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.14.5.tgz#000e2e25d8673cce49300517a3eda44c263e4201" - integrity sha512-ohuFIsOMXJnbOMRfX7/w7LocdR6R7whhuRD4ax8IipLcLPlZGJKkBxgHp++U4N/vKyU16/YDQr2f5seajD3jIw== +"@babel/plugin-syntax-jsx@^7.0.0", "@babel/plugin-syntax-jsx@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.16.7.tgz#50b6571d13f764266a113d77c82b4a6508bbe665" + integrity sha512-Esxmk7YjA8QysKeT3VhTXvF6y77f/a91SIs4pWb4H2eWGQkCKFgQaG6hdoEVZtGsrAcb2K5BW66XsOErD4WU3Q== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" @@ -267,167 +264,170 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-transform-arrow-functions@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz#f7187d9588a768dd080bf4c9ffe117ea62f7862a" - integrity sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz#44125e653d94b98db76369de9c396dc14bef4154" + integrity sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-block-scoped-functions@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz#e48641d999d4bc157a67ef336aeb54bc44fd3ad4" - integrity sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz#4d0d57d9632ef6062cdf354bb717102ee042a620" + integrity sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-block-scoping@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.5.tgz#8cc63e61e50f42e078e6f09be775a75f23ef9939" - integrity sha512-LBYm4ZocNgoCqyxMLoOnwpsmQ18HWTQvql64t3GvMUzLQrNoV1BDG0lNftC8QKYERkZgCCT/7J5xWGObGAyHDw== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz#f50664ab99ddeaee5bc681b8f3a6ea9d72ab4f87" + integrity sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-classes@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.5.tgz#0e98e82097b38550b03b483f9b51a78de0acb2cf" - integrity sha512-J4VxKAMykM06K/64z9rwiL6xnBHgB1+FVspqvlgCdwD1KUbQNfszeKVVOMh59w3sztHYIZDgnhOC4WbdEfHFDA== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.7.tgz#8f4b9562850cd973de3b498f1218796eb181ce00" + integrity sha512-WY7og38SFAGYRe64BrjKf8OrE6ulEHtr5jEYaZMwox9KebgqPi67Zqz8K53EKk1fFEJgm96r32rkKZ3qA2nCWQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-optimise-call-expression" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" - "@babel/helper-split-export-declaration" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-optimise-call-expression" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" globals "^11.1.0" "@babel/plugin-transform-computed-properties@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz#1b9d78987420d11223d41195461cc43b974b204f" - integrity sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz#66dee12e46f61d2aae7a73710f591eb3df616470" + integrity sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-destructuring@^7.0.0": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.7.tgz#0ad58ed37e23e22084d109f185260835e5557576" - integrity sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw== + version "7.17.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.17.3.tgz#c445f75819641788a27a0a3a759d9df911df6abc" + integrity sha512-dDFzegDYKlPqa72xIlbmSkly5MluLoaC1JswABGktyt6NTXSBcUuse/kWE/wvKFWJHPETpi158qJZFS3JmykJg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-flow-strip-types@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.14.5.tgz#0dc9c1d11dcdc873417903d6df4bed019ef0f85e" - integrity sha512-KhcolBKfXbvjwI3TV7r7TkYm8oNXHNBqGOy6JDVwtecFaRoKYsUUqJdS10q0YDKW1c6aZQgO+Ys3LfGkox8pXA== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.16.7.tgz#291fb140c78dabbf87f2427e7c7c332b126964b8" + integrity sha512-mzmCq3cNsDpZZu9FADYYyfZJIOrSONmHcop2XEKPdBNMa4PDC4eEvcOvzZaCNcjKu72v0XQlA5y1g58aLRXdYg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-flow" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/plugin-syntax-flow" "^7.16.7" "@babel/plugin-transform-for-of@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.14.5.tgz#dae384613de8f77c196a8869cbf602a44f7fc0eb" - integrity sha512-CfmqxSUZzBl0rSjpoQSFoR9UEj3HzbGuGNL21/iFTmjb5gFggJp3ph0xR1YBhexmLoKRHzgxuFvty2xdSt6gTA== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz#649d639d4617dff502a9a158c479b3b556728d8c" + integrity sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-function-name@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz#e81c65ecb900746d7f31802f6bed1f52d915d6f2" - integrity sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz#5ab34375c64d61d083d7d2f05c38d90b97ec65cf" + integrity sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA== dependencies: - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-compilation-targets" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-literals@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz#41d06c7ff5d4d09e3cf4587bd3ecf3930c730f78" - integrity sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz#254c9618c5ff749e87cb0c0cef1a0a050c0bdab1" + integrity sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-member-expression-literals@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.14.5.tgz#b39cd5212a2bf235a617d320ec2b48bcc091b8a7" - integrity sha512-WkNXxH1VXVTKarWFqmso83xl+2V3Eo28YY5utIkbsmXoItO8Q3aZxN4BTS2k0hz9dGUloHK26mJMyQEYfkn/+Q== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz#6e5dcf906ef8a098e630149d14c867dd28f92384" + integrity sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-modules-commonjs@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.5.tgz#7aaee0ea98283de94da98b28f8c35701429dad97" - integrity sha512-en8GfBtgnydoao2PS+87mKyw62k02k7kJ9ltbKe0fXTHrQmG6QZZflYuGI1VVG7sVpx4E1n7KBpNlPb8m78J+A== + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.8.tgz#cdee19aae887b16b9d331009aa9a219af7c86afe" + integrity sha512-oflKPvsLT2+uKQopesJt3ApiaIS2HW+hzHFcwRNtyDGieAeC/dIHZX8buJQ2J2X1rxGPy4eRcUijm3qcSPjYcA== dependencies: - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-simple-access" "^7.14.5" + "@babel/helper-module-transforms" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-simple-access" "^7.16.7" babel-plugin-dynamic-import-node "^2.3.3" "@babel/plugin-transform-object-super@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz#d0b5faeac9e98597a161a9cf78c527ed934cdc45" - integrity sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz#ac359cf8d32cf4354d27a46867999490b6c32a94" + integrity sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" -"@babel/plugin-transform-parameters@^7.0.0", "@babel/plugin-transform-parameters@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.5.tgz#49662e86a1f3ddccac6363a7dfb1ff0a158afeb3" - integrity sha512-Tl7LWdr6HUxTmzQtzuU14SqbgrSKmaR77M0OKyq4njZLQTPfOvzblNKyNkGwOfEFCEx7KeYHQHDI0P3F02IVkA== +"@babel/plugin-transform-parameters@^7.0.0", "@babel/plugin-transform-parameters@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz#a1721f55b99b736511cb7e0152f61f17688f331f" + integrity sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-property-literals@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.14.5.tgz#0ddbaa1f83db3606f1cdf4846fa1dfb473458b34" - integrity sha512-r1uilDthkgXW8Z1vJz2dKYLV1tuw2xsbrp3MrZmD99Wh9vsfKoob+JTgri5VUb/JqyKRXotlOtwgu4stIYCmnw== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz#2dadac85155436f22c696c4827730e0fe1057a55" + integrity sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-react-display-name@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.14.5.tgz#baa92d15c4570411301a85a74c13534873885b65" - integrity sha512-07aqY1ChoPgIxsuDviptRpVkWCSbXWmzQqcgy65C6YSFOfPFvb/DX3bBRHh7pCd/PMEEYHYWUTSVkCbkVainYQ== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.16.7.tgz#7b6d40d232f4c0f550ea348593db3b21e2404340" + integrity sha512-qgIg8BcZgd0G/Cz916D5+9kqX0c7nPZyXaP8R2tLNN5tkyIZdG5fEwBrxwplzSnjC1jvQmyMNVwUCZPcbGY7Pg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-react-jsx@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.14.5.tgz#39749f0ee1efd8a1bd729152cf5f78f1d247a44a" - integrity sha512-7RylxNeDnxc1OleDm0F5Q/BSL+whYRbOAR+bwgCxIr0L32v7UFh/pz1DLMZideAUxKT6eMoS2zQH6fyODLEi8Q== + version "7.17.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.17.3.tgz#eac1565da176ccb1a715dae0b4609858808008c1" + integrity sha512-9tjBm4O07f7mzKSIlEmPdiE6ub7kfIe6Cd+w+oQebpATfTQMAgW+YOuWxogbKVTulA+MEO7byMeIUtQ1z+z+ZQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - "@babel/helper-module-imports" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-jsx" "^7.14.5" - "@babel/types" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-module-imports" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/plugin-syntax-jsx" "^7.16.7" + "@babel/types" "^7.17.0" "@babel/plugin-transform-shorthand-properties@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz#97f13855f1409338d8cadcbaca670ad79e091a58" - integrity sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz#e8549ae4afcf8382f711794c0c7b6b934c5fbd2a" + integrity sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-spread@^7.0.0": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.6.tgz#6bd40e57fe7de94aa904851963b5616652f73144" - integrity sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz#a303e2122f9f12e0105daeedd0f30fb197d8ff44" + integrity sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" "@babel/plugin-transform-template-literals@^7.0.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz#a5f2bc233937d8453885dc736bdd8d9ffabf3d93" - integrity sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz#f3d1c45d28967c8e80f53666fc9c3e50618217ab" + integrity sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/runtime@7.12.5": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e" - integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg== +"@babel/runtime-corejs3@^7.10.2": + version "7.17.2" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.17.2.tgz#fdca2cd05fba63388babe85d349b6801b008fd13" + integrity sha512-NcKtr2epxfIrNM4VOmPKO46TvDMCBhgi2CrSHaEarrz+Plk2K5r9QemmOFTGpZaoKnWoGH5MO+CzeRsih/Fcgg== dependencies: + core-js-pure "^3.20.2" regenerator-runtime "^0.13.4" "@babel/runtime@7.4.5": @@ -437,82 +437,112 @@ dependencies: regenerator-runtime "^0.13.2" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.13", "@babel/runtime@^7.14.0": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d" - integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg== +"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.13", "@babel/runtime@^7.14.0", "@babel/runtime@^7.16.3", "@babel/runtime@^7.7.4": + version "7.17.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.2.tgz#66f68591605e59da47523c631416b18508779941" + integrity sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4" - integrity sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g== +"@babel/template@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" + integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.14.5" - "@babel/types" "^7.14.5" + "@babel/code-frame" "^7.16.7" + "@babel/parser" "^7.16.7" + "@babel/types" "^7.16.7" -"@babel/traverse@7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.13.tgz#689f0e4b4c08587ad26622832632735fb8c4e0c0" - integrity sha512-3Zb4w7eE/OslI0fTp8c7b286/cQps3+vdLW3UcwC8VSJC6GbKn55aeVVu2QJNuCDoeKyptLOFrPq8WqZZBodyA== +"@babel/traverse@^7.14.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.17.0", "@babel/traverse@^7.17.3": + version "7.17.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57" + integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw== dependencies: - "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.12.13" - "@babel/helper-function-name" "^7.12.13" - "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.12.13" - "@babel/types" "^7.12.13" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.19" - -"@babel/traverse@^7.0.0", "@babel/traverse@^7.14.5": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.7.tgz#64007c9774cfdc3abd23b0780bc18a3ce3631753" - integrity sha512-9vDr5NzHu27wgwejuKL7kIOm4bwEtaPQ4Z6cpCmjSuaRqpH/7xc4qcGEscwMqlkwgcXl6MvqoAjZkQ24uSdIZQ== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.14.5" - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-hoist-variables" "^7.14.5" - "@babel/helper-split-export-declaration" "^7.14.5" - "@babel/parser" "^7.14.7" - "@babel/types" "^7.14.5" + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.17.3" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-hoist-variables" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/parser" "^7.17.3" + "@babel/types" "^7.17.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.13.tgz#8be1aa8f2c876da11a9cf650c0ecf656913ad611" - integrity sha512-oKrdZTld2im1z8bDwTOQvUbxKwE+854zc16qWZQlcTqMN00pWxHQ4ZeOq0yDMnisOpRykH2/5Qqcrk/OlbAjiQ== +"@babel/types@^7.0.0", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b" + integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw== dependencies: - "@babel/helper-validator-identifier" "^7.12.11" - lodash "^4.17.19" + "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" -"@babel/types@7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.8.3.tgz#5a383dffa5416db1b73dedffd311ffd0788fb31c" - integrity sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg== +"@chec/commerce.js@^2.8.0": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@chec/commerce.js/-/commerce.js-2.8.0.tgz#c213cfcc2bc366fe66b77ea561dfa4b3aa7abc8c" + integrity sha512-OPBphT/hU33iDp52zzYOqz/oSXLhEuhGVUg2UNvYtmBW4eCNmtsM0dqW0+wu+6K0d6fZojurCBdVQMKb2R7l3g== dependencies: - esutils "^2.0.2" - lodash "^4.17.13" - to-fast-properties "^2.0.0" + "@babel/runtime" "^7.7.4" + axios "^0.21.1" -"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.5.tgz#3bb997ba829a2104cedb20689c4a5b8121d383ff" - integrity sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg== +"@csstools/postcss-color-function@^1.0.2": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@csstools/postcss-color-function/-/postcss-color-function-1.0.3.tgz#251c961a852c99e9aabdbbdbefd50e9a96e8a9ff" + integrity sha512-J26I69pT2B3MYiLY/uzCGKVJyMYVg9TCpXkWsRlt+Yfq+nELUEm72QXIMYXs4xA9cJA4Oqs2EylrfokKl3mJEQ== dependencies: - "@babel/helper-validator-identifier" "^7.14.5" - to-fast-properties "^2.0.0" + "@csstools/postcss-progressive-custom-properties" "^1.1.0" + postcss-value-parser "^4.2.0" -"@csstools/convert-colors@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7" - integrity sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw== +"@csstools/postcss-font-format-keywords@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@csstools/postcss-font-format-keywords/-/postcss-font-format-keywords-1.0.0.tgz#7e7df948a83a0dfb7eb150a96e2390ac642356a1" + integrity sha512-oO0cZt8do8FdVBX8INftvIA4lUrKUSCcWUf9IwH9IPWOgKT22oAZFXeHLoDK7nhB2SmkNycp5brxfNMRLIhd6Q== + dependencies: + postcss-value-parser "^4.2.0" + +"@csstools/postcss-hwb-function@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@csstools/postcss-hwb-function/-/postcss-hwb-function-1.0.0.tgz#d6785c1c5ba8152d1d392c66f3a6a446c6034f6d" + integrity sha512-VSTd7hGjmde4rTj1rR30sokY3ONJph1reCBTUXqeW1fKwETPy1x4t/XIeaaqbMbC5Xg4SM/lyXZ2S8NELT2TaA== + dependencies: + postcss-value-parser "^4.2.0" + +"@csstools/postcss-ic-unit@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@csstools/postcss-ic-unit/-/postcss-ic-unit-1.0.0.tgz#f484db59fc94f35a21b6d680d23b0ec69b286b7f" + integrity sha512-i4yps1mBp2ijrx7E96RXrQXQQHm6F4ym1TOD0D69/sjDjZvQ22tqiEvaNw7pFZTUO5b9vWRHzbHzP9+UKuw+bA== + dependencies: + "@csstools/postcss-progressive-custom-properties" "^1.1.0" + postcss-value-parser "^4.2.0" + +"@csstools/postcss-is-pseudo-class@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@csstools/postcss-is-pseudo-class/-/postcss-is-pseudo-class-2.0.1.tgz#472fff2cf434bdf832f7145b2a5491587e790c9e" + integrity sha512-Og5RrTzwFhrKoA79c3MLkfrIBYmwuf/X83s+JQtz/Dkk/MpsaKtqHV1OOzYkogQ+tj3oYp5Mq39XotBXNqVc3Q== + dependencies: + postcss-selector-parser "^6.0.9" + +"@csstools/postcss-normalize-display-values@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@csstools/postcss-normalize-display-values/-/postcss-normalize-display-values-1.0.0.tgz#ce698f688c28517447aedf15a9037987e3d2dc97" + integrity sha512-bX+nx5V8XTJEmGtpWTO6kywdS725t71YSLlxWt78XoHUbELWgoCXeOFymRJmL3SU1TLlKSIi7v52EWqe60vJTQ== + dependencies: + postcss-value-parser "^4.2.0" + +"@csstools/postcss-oklab-function@^1.0.1": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@csstools/postcss-oklab-function/-/postcss-oklab-function-1.0.2.tgz#87cd646e9450347a5721e405b4f7cc35157b7866" + integrity sha512-QwhWesEkMlp4narAwUi6pgc6kcooh8cC7zfxa9LSQNYXqzcdNUtNBzbGc5nuyAVreb7uf5Ox4qH1vYT3GA1wOg== + dependencies: + "@csstools/postcss-progressive-custom-properties" "^1.1.0" + postcss-value-parser "^4.2.0" + +"@csstools/postcss-progressive-custom-properties@^1.1.0", "@csstools/postcss-progressive-custom-properties@^1.2.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@csstools/postcss-progressive-custom-properties/-/postcss-progressive-custom-properties-1.3.0.tgz#542292558384361776b45c85226b9a3a34f276fa" + integrity sha512-ASA9W1aIy5ygskZYuWams4BzafD12ULvSypmaLJT2jvQ8G0M3I8PRQhC0h7mG0Z3LI05+agZjqSR9+K9yaQQjA== + dependencies: + postcss-value-parser "^4.2.0" "@endemolshinegroup/cosmiconfig-typescript-loader@3.0.2": version "3.0.2" @@ -524,118 +554,129 @@ ts-node "^9" tslib "^2" -"@fullhuman/postcss-purgecss@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@fullhuman/postcss-purgecss/-/postcss-purgecss-4.0.3.tgz#55d71712ec1c7a88e0d1ba5f10ce7fb6aa05beb4" - integrity sha512-/EnQ9UDWGGqHkn1UKAwSgh+gJHPKmD+Z+5dQ4gWT4qq2NUyez3zqAfZNwFH3eSgmgO+wjTXfhlLchx2M9/K+7Q== +"@eslint/eslintrc@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.2.0.tgz#7ce1547a5c46dfe56e1e45c3c9ed18038c721c6a" + integrity sha512-igm9SjJHNEJRiUnecP/1R5T3wKLEJ7pL6e2P+GUSfCd0dGjPYYZve08uzw8L2J8foVHFz+NGu12JxRcU2gGo6w== dependencies: - purgecss "^4.0.3" + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.3.1" + globals "^13.9.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" -"@graphql-codegen/cli@^1.21.5": - version "1.21.5" - resolved "https://registry.yarnpkg.com/@graphql-codegen/cli/-/cli-1.21.5.tgz#b9041553747cfb2dee7c3473a2e2461ec3e7ada5" - integrity sha512-w3SovNJ9qtMhFLAdPZeCdGvHXDgfdb53mueWDTyncOt04m+tohVnY4qExvyKLTN5zlGxrA/5ubp2x8Az0xQarA== +"@graphql-codegen/cli@^2.3.1": + version "2.6.2" + resolved "https://registry.yarnpkg.com/@graphql-codegen/cli/-/cli-2.6.2.tgz#a9aa4656141ee0998cae8c7ad7d0bf9ca8e0c9ae" + integrity sha512-UO75msoVgvLEvfjCezM09cQQqp32+mR8Ma1ACsBpr7nroFvHbgcu2ulx1cMovg4sxDBCsvd9Eq/xOOMpARUxtw== dependencies: - "@graphql-codegen/core" "1.17.10" - "@graphql-codegen/plugin-helpers" "^1.18.7" - "@graphql-tools/apollo-engine-loader" "^6.2.5" - "@graphql-tools/code-file-loader" "^6.3.1" - "@graphql-tools/git-loader" "^6.2.6" - "@graphql-tools/github-loader" "^6.2.5" - "@graphql-tools/graphql-file-loader" "^6.2.7" - "@graphql-tools/json-file-loader" "^6.2.6" - "@graphql-tools/load" "^6.2.8" - "@graphql-tools/prisma-loader" "^6.3.0" - "@graphql-tools/url-loader" "^6.10.1" - "@graphql-tools/utils" "^7.9.1" + "@graphql-codegen/core" "2.5.1" + "@graphql-codegen/plugin-helpers" "^2.4.1" + "@graphql-tools/apollo-engine-loader" "^7.0.5" + "@graphql-tools/code-file-loader" "^7.0.6" + "@graphql-tools/git-loader" "^7.0.5" + "@graphql-tools/github-loader" "^7.0.5" + "@graphql-tools/graphql-file-loader" "^7.0.5" + "@graphql-tools/json-file-loader" "^7.1.2" + "@graphql-tools/load" "^7.3.0" + "@graphql-tools/prisma-loader" "^7.0.6" + "@graphql-tools/url-loader" "^7.0.11" + "@graphql-tools/utils" "^8.1.1" ansi-escapes "^4.3.1" chalk "^4.1.0" change-case-all "1.0.14" - chokidar "^3.5.1" + chokidar "^3.5.2" common-tags "^1.8.0" cosmiconfig "^7.0.0" debounce "^1.2.0" dependency-graph "^0.11.0" detect-indent "^6.0.0" glob "^7.1.6" - graphql-config "^3.3.0" - inquirer "^7.3.3" + globby "^11.0.4" + graphql-config "^4.1.0" + inquirer "^8.0.0" is-glob "^4.0.1" json-to-pretty-yaml "^1.2.2" latest-version "5.1.0" listr "^0.14.3" listr-update-renderer "^0.5.0" log-symbols "^4.0.0" - minimatch "^3.0.4" + minimatch "^4.0.0" mkdirp "^1.0.4" string-env-interpolation "^1.0.1" ts-log "^2.2.3" - tslib "~2.2.0" + tslib "~2.3.0" valid-url "^1.0.9" wrap-ansi "^7.0.0" yaml "^1.10.0" yargs "^17.0.0" -"@graphql-codegen/core@1.17.10": - version "1.17.10" - resolved "https://registry.yarnpkg.com/@graphql-codegen/core/-/core-1.17.10.tgz#3b85b5bc2e84fcacbd25fced5af47a4bb2d7a8bd" - integrity sha512-RA3umgVDs/RI/+ztHh+H4GfJxrJUfWJQqoAkMfX4qPTVO5qsy3R4vPudE0oP8w+kFbL8dFsRfAAPUZxI4jV/hQ== +"@graphql-codegen/core@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@graphql-codegen/core/-/core-2.5.1.tgz#e3d50d3449b8c58b74ea08e97faf656a1b7fc8a1" + integrity sha512-alctBVl2hMnBXDLwkgmnFPrZVIiBDsWJSmxJcM4GKg1PB23+xuov35GE47YAyAhQItE1B1fbYnbb1PtGiDZ4LA== dependencies: - "@graphql-codegen/plugin-helpers" "^1.18.7" - "@graphql-tools/merge" "^6.2.14" - "@graphql-tools/utils" "^7.9.1" - tslib "~2.2.0" + "@graphql-codegen/plugin-helpers" "^2.4.1" + "@graphql-tools/schema" "^8.1.2" + "@graphql-tools/utils" "^8.1.1" + tslib "~2.3.0" -"@graphql-codegen/plugin-helpers@^1.18.7": - version "1.18.7" - resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-1.18.7.tgz#465af3e5b02de89e49ddc76ad2546b880fe240f2" - integrity sha512-8ICOrXlsvyL1dpVz8C9b7H31d4DJpDd75WfjMn6Xjqz81Ah8xDn1Bi+7YXRCCILCBmvI94k6fi8qpsIVhFBBjQ== +"@graphql-codegen/plugin-helpers@^2.3.2", "@graphql-codegen/plugin-helpers@^2.4.0", "@graphql-codegen/plugin-helpers@^2.4.1": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.4.2.tgz#e4f6b74dddcf8a9974fef5ce48562ae0980f9fed" + integrity sha512-LJNvwAPv/sKtI3RnRDm+nPD+JeOfOuSOS4FFIpQCMUCyMnFcchV/CPTTv7tT12fLUpEg6XjuFfDBvOwndti30Q== dependencies: - "@graphql-tools/utils" "^7.9.1" - common-tags "1.8.0" - import-from "3.0.0" + "@graphql-tools/utils" "^8.5.2" + change-case-all "1.0.14" + common-tags "1.8.2" + import-from "4.0.0" lodash "~4.17.0" - tslib "~2.2.0" + tslib "~2.3.0" -"@graphql-codegen/schema-ast@^1.18.3": - version "1.18.3" - resolved "https://registry.yarnpkg.com/@graphql-codegen/schema-ast/-/schema-ast-1.18.3.tgz#7ba7422df716ff2038b1281c503e5751a8414ef2" - integrity sha512-D0uheH039ztSG3mboW5enmyaFwTcevLSR8yNrdN+NEKoQJJoDWsb9P/G6NTdFu5Bb03IvNhIFTpG1ttWtRP/aQ== +"@graphql-codegen/schema-ast@^2.4.1": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@graphql-codegen/schema-ast/-/schema-ast-2.4.1.tgz#ad742b53e32f7a2fbff8ea8a91ba7e617e6ef236" + integrity sha512-bIWlKk/ShoVJfghA4Rt1OWnd34/dQmZM/vAe6fu6QKyOh44aAdqPtYQ2dbTyFXoknmu504etKJGEDllYNUJRfg== dependencies: - "@graphql-codegen/plugin-helpers" "^1.18.7" - "@graphql-tools/utils" "^7.9.1" - tslib "~2.2.0" + "@graphql-codegen/plugin-helpers" "^2.3.2" + "@graphql-tools/utils" "^8.1.1" + tslib "~2.3.0" -"@graphql-codegen/typescript-operations@^1.18.1": - version "1.18.2" - resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-operations/-/typescript-operations-1.18.2.tgz#c1cba14eaf7584a875a63035f97b07fb232bcbae" - integrity sha512-AF9OCNBq0HuW3C5nsO11+53fgFGE40lNUtjSIJocvMcstEKvHx4GrzYO0XIpZsjRPrnyds00Y5xTSynLqB0XxA== +"@graphql-codegen/typescript-operations@^2.2.2": + version "2.3.4" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-operations/-/typescript-operations-2.3.4.tgz#3341f940d7fae0417e5738787fa8793696277d54" + integrity sha512-Jnsx+YTCqwq8F0ebyZAJGVtt+PQNuB/0uv9mEMbgcUbo/7w6EX6NZ8JArRuuz8MUb/gbpeO+GkfuNX+F6A8ikw== dependencies: - "@graphql-codegen/plugin-helpers" "^1.18.7" - "@graphql-codegen/typescript" "^1.22.3" - "@graphql-codegen/visitor-plugin-common" "1.21.2" + "@graphql-codegen/plugin-helpers" "^2.4.0" + "@graphql-codegen/typescript" "^2.4.7" + "@graphql-codegen/visitor-plugin-common" "2.7.3" auto-bind "~4.0.0" tslib "~2.3.0" -"@graphql-codegen/typescript@^1.22.2", "@graphql-codegen/typescript@^1.22.3": - version "1.22.3" - resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript/-/typescript-1.22.3.tgz#aaa85246974d74a9f544a950ae1611facabea7e6" - integrity sha512-qLSnVN2g/UxxzhRWHZcHw/Xkvx5wZh0RDzmg9MjAlPnDwAI89jg/ljKDwtTOfN+F6M8W4gQ9mjkWd6NxBQRgXw== +"@graphql-codegen/typescript@^2.4.2", "@graphql-codegen/typescript@^2.4.7": + version "2.4.7" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript/-/typescript-2.4.7.tgz#e72e87cd47a51b2bc232293762573a86182de469" + integrity sha512-1YAK+m9SZRS1Uy8hdXVQAaAG/WF2jdFD76wbMRQ8Lf5e9YbmtJuy1RpI13nZJTZbhFopd9zqoWFJHsU/oy4i7g== dependencies: - "@graphql-codegen/plugin-helpers" "^1.18.7" - "@graphql-codegen/visitor-plugin-common" "1.21.2" + "@graphql-codegen/plugin-helpers" "^2.4.0" + "@graphql-codegen/schema-ast" "^2.4.1" + "@graphql-codegen/visitor-plugin-common" "2.7.3" auto-bind "~4.0.0" tslib "~2.3.0" -"@graphql-codegen/visitor-plugin-common@1.21.2": - version "1.21.2" - resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-1.21.2.tgz#c72f1f47bee2ba03ceb48abf14e2cb82d9184b32" - integrity sha512-Bb5P2Hw7f+lNWfazjcGwVcX434stNd7/EhgA+S2Ro0Bn1xVCK/WL0IHT2TGb+pf6/lWg3Y+J9wo2aOKkqDHT6A== +"@graphql-codegen/visitor-plugin-common@2.7.3": + version "2.7.3" + resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-2.7.3.tgz#f374e8974ae4ab7b1059a7f8748db6393f20c138" + integrity sha512-rODPGkrHEf9aHD8SgVWS0xie8VmJoYXLWgQR8PFKrwCUFjf7nvDuATAL2lTFiHATlVBWg1meXVPdUlkKeJj/0Q== dependencies: - "@graphql-codegen/plugin-helpers" "^1.18.7" + "@graphql-codegen/plugin-helpers" "^2.4.0" "@graphql-tools/optimize" "^1.0.1" - "@graphql-tools/relay-operation-optimizer" "^6.3.0" - array.prototype.flatmap "^1.2.4" + "@graphql-tools/relay-operation-optimizer" "^6.3.7" + "@graphql-tools/utils" "^8.3.0" auto-bind "~4.0.0" change-case-all "1.0.14" dependency-graph "^0.11.0" @@ -643,149 +684,154 @@ parse-filepath "^1.0.2" tslib "~2.3.0" -"@graphql-tools/apollo-engine-loader@^6.2.5": - version "6.2.5" - resolved "https://registry.yarnpkg.com/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-6.2.5.tgz#b9e65744f522bb9f6ca50651e5622820c4f059a8" - integrity sha512-CE4uef6PyxtSG+7OnLklIr2BZZDgjO89ZXK47EKdY7jQy/BQD/9o+8SxPsgiBc+2NsDJH2I6P/nqoaJMOEat6g== +"@graphql-tools/apollo-engine-loader@^7.0.5": + version "7.2.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-7.2.3.tgz#6bebabefa3fd8fb0fc8215a61e53448490b1764c" + integrity sha512-c1AVwAoKf/dSQw6yn/OfwobybplDuAJWLvJS7K7Bm4BiFv0/YXiizPTMsYvxlJYg3uGvmA7fsoeicrzBdlwOpA== dependencies: - "@graphql-tools/utils" "^7.0.0" - cross-fetch "3.0.6" - tslib "~2.0.1" + "@graphql-tools/utils" "^8.6.2" + cross-undici-fetch "^0.1.19" + sync-fetch "0.3.1" + tslib "~2.3.0" -"@graphql-tools/batch-execute@^7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-7.1.2.tgz#35ba09a1e0f80f34f1ce111d23c40f039d4403a0" - integrity sha512-IuR2SB2MnC2ztA/XeTMTfWcA0Wy7ZH5u+nDkDNLAdX+AaSyDnsQS35sCmHqG0VOGTl7rzoyBWLCKGwSJplgtwg== +"@graphql-tools/batch-execute@^8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-8.3.2.tgz#8b5a731d5343f0147734f12d480aafde2a1b6eba" + integrity sha512-ICWqM+MvEkIPHm18Q0cmkvm134zeQMomBKmTRxyxMNhL/ouz6Nqld52/brSlaHnzA3fczupeRJzZ0YatruGBcQ== dependencies: - "@graphql-tools/utils" "^7.7.0" + "@graphql-tools/utils" "^8.6.2" dataloader "2.0.0" - tslib "~2.2.0" - value-or-promise "1.0.6" + tslib "~2.3.0" + value-or-promise "1.0.11" -"@graphql-tools/code-file-loader@^6.3.1": - version "6.3.1" - resolved "https://registry.yarnpkg.com/@graphql-tools/code-file-loader/-/code-file-loader-6.3.1.tgz#42dfd4db5b968acdb453382f172ec684fa0c34ed" - integrity sha512-ZJimcm2ig+avgsEOWWVvAaxZrXXhiiSZyYYOJi0hk9wh5BxZcLUNKkTp6EFnZE/jmGUwuos3pIjUD3Hwi3Bwhg== +"@graphql-tools/code-file-loader@^7.0.6": + version "7.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/code-file-loader/-/code-file-loader-7.2.4.tgz#f35bf3050b4375ee5c2da0c34a896392cc7bea3f" + integrity sha512-KjIxYKDIbrtRGzeboYC98OnRnCvDVDC3E+suH48J4/KxweSjrG+ZpD++T/A11FdIcFb1Y5OceCw+OwjHI5OoyQ== dependencies: - "@graphql-tools/graphql-tag-pluck" "^6.5.1" - "@graphql-tools/utils" "^7.0.0" - tslib "~2.1.0" + "@graphql-tools/graphql-tag-pluck" "^7.1.6" + "@graphql-tools/utils" "^8.6.2" + globby "^11.0.3" + tslib "~2.3.0" + unixify "^1.0.0" -"@graphql-tools/delegate@^7.0.1", "@graphql-tools/delegate@^7.1.5": - version "7.1.5" - resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-7.1.5.tgz#0b027819b7047eff29bacbd5032e34a3d64bd093" - integrity sha512-bQu+hDd37e+FZ0CQGEEczmRSfQRnnXeUxI/0miDV+NV/zCbEdIJj5tYFNrKT03W6wgdqx8U06d8L23LxvGri/g== +"@graphql-tools/delegate@^8.5.1": + version "8.5.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-8.5.1.tgz#3d146cc3bb74935116d3f4bddb3affdf14a9712d" + integrity sha512-/YPmVxitt57F8sH50pnfXASzOOjEfaUDkX48eF5q6f16+JBncej2zeu+Zm2c68q8MbIxhPlEGfpd0QZeqTvAxw== dependencies: - "@ardatan/aggregate-error" "0.0.6" - "@graphql-tools/batch-execute" "^7.1.2" - "@graphql-tools/schema" "^7.1.5" - "@graphql-tools/utils" "^7.7.1" + "@graphql-tools/batch-execute" "^8.3.2" + "@graphql-tools/schema" "^8.3.2" + "@graphql-tools/utils" "^8.6.2" dataloader "2.0.0" - tslib "~2.2.0" - value-or-promise "1.0.6" + graphql-executor "0.0.18" + tslib "~2.3.0" + value-or-promise "1.0.11" -"@graphql-tools/git-loader@^6.2.6": - version "6.2.6" - resolved "https://registry.yarnpkg.com/@graphql-tools/git-loader/-/git-loader-6.2.6.tgz#c2226f4b8f51f1c05c9ab2649ba32d49c68cd077" - integrity sha512-ooQTt2CaG47vEYPP3CPD+nbA0F+FYQXfzrB1Y1ABN9K3d3O2RK3g8qwslzZaI8VJQthvKwt0A95ZeE4XxteYfw== +"@graphql-tools/git-loader@^7.0.5": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/git-loader/-/git-loader-7.1.3.tgz#080c57ec2ab83bc0d8d1e3c881c6960b0c7afebd" + integrity sha512-Ya0jRizD6F1hbajk2rwfqJKAp6dQRvzW1gzkOQmlNcQOTtTjWITsFtzk7fS02gZRWkfFBenlTBguGufh91I6bg== dependencies: - "@graphql-tools/graphql-tag-pluck" "^6.2.6" - "@graphql-tools/utils" "^7.0.0" - tslib "~2.1.0" + "@graphql-tools/graphql-tag-pluck" "^7.1.6" + "@graphql-tools/utils" "^8.6.2" + is-glob "4.0.3" + micromatch "^4.0.4" + tslib "~2.3.0" + unixify "^1.0.0" -"@graphql-tools/github-loader@^6.2.5": - version "6.2.5" - resolved "https://registry.yarnpkg.com/@graphql-tools/github-loader/-/github-loader-6.2.5.tgz#460dff6f5bbaa26957a5ea3be4f452b89cc6a44b" - integrity sha512-DLuQmYeNNdPo8oWus8EePxWCfCAyUXPZ/p1PWqjrX/NGPyH2ZObdqtDAfRHztljt0F/qkBHbGHCEk2TKbRZTRw== +"@graphql-tools/github-loader@^7.0.5": + version "7.2.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/github-loader/-/github-loader-7.2.4.tgz#fe5688037015be0f190a1684c953b57279f0fa58" + integrity sha512-QuSN2GWgm/h3lp7o5zpi8TzHnzom4b/f5Zq4Hvprn1OsGaOviHLXQUx6AaWa07cmFvPL0se79R0sEkMZlXlpQQ== dependencies: - "@graphql-tools/graphql-tag-pluck" "^6.2.6" - "@graphql-tools/utils" "^7.0.0" - cross-fetch "3.0.6" - tslib "~2.0.1" + "@graphql-tools/graphql-tag-pluck" "^7.1.6" + "@graphql-tools/utils" "^8.6.2" + cross-undici-fetch "^0.1.19" + sync-fetch "0.3.1" + tslib "~2.3.0" -"@graphql-tools/graphql-file-loader@^6.0.0", "@graphql-tools/graphql-file-loader@^6.2.7": - version "6.2.7" - resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-file-loader/-/graphql-file-loader-6.2.7.tgz#d3720f2c4f4bb90eb2a03a7869a780c61945e143" - integrity sha512-5k2SNz0W87tDcymhEMZMkd6/vs6QawDyjQXWtqkuLTBF3vxjxPD1I4dwHoxgWPIjjANhXybvulD7E+St/7s9TQ== +"@graphql-tools/graphql-file-loader@^7.0.5", "@graphql-tools/graphql-file-loader@^7.3.2": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-file-loader/-/graphql-file-loader-7.3.4.tgz#61e3e7e6223a21fbdd987f2abaa6f14104ab7b4a" + integrity sha512-Q0/YtDq0APR6syRclsQMNguWKRlchd8nFTOpLhfc7Xeiy21VhEEi4Ik+quRySfb7ubDfJGhiUq4MQW43FhWJvg== dependencies: - "@graphql-tools/import" "^6.2.6" - "@graphql-tools/utils" "^7.0.0" - tslib "~2.1.0" + "@graphql-tools/import" "^6.6.6" + "@graphql-tools/utils" "^8.6.2" + globby "^11.0.3" + tslib "~2.3.0" + unixify "^1.0.0" -"@graphql-tools/graphql-tag-pluck@^6.2.6", "@graphql-tools/graphql-tag-pluck@^6.5.1": - version "6.5.1" - resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-tag-pluck/-/graphql-tag-pluck-6.5.1.tgz#5fb227dbb1e19f4b037792b50f646f16a2d4c686" - integrity sha512-7qkm82iFmcpb8M6/yRgzjShtW6Qu2OlCSZp8uatA3J0eMl87TxyJoUmL3M3UMMOSundAK8GmoyNVFUrueueV5Q== +"@graphql-tools/graphql-tag-pluck@^7.1.6": + version "7.1.6" + resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-tag-pluck/-/graphql-tag-pluck-7.1.6.tgz#c78a3f416e06194069609fac6d44c09dd40f6bda" + integrity sha512-VdubvdS8pIrAPVDq6hV7ARXz2Yh8/2153+RO6i+RJOMgyFw8wOW3jRCKE93eN+Hk2pZBC2x3kzdNeUAyVpuslg== dependencies: - "@babel/parser" "7.12.16" - "@babel/traverse" "7.12.13" - "@babel/types" "7.12.13" - "@graphql-tools/utils" "^7.0.0" - tslib "~2.1.0" + "@babel/parser" "^7.16.8" + "@babel/traverse" "^7.16.8" + "@babel/types" "^7.16.8" + "@graphql-tools/utils" "^8.6.2" + tslib "~2.3.0" -"@graphql-tools/import@^6.2.6": - version "6.3.1" - resolved "https://registry.yarnpkg.com/@graphql-tools/import/-/import-6.3.1.tgz#731c47ab6c6ac9f7994d75c76b6c2fa127d2d483" - integrity sha512-1szR19JI6WPibjYurMLdadHKZoG9C//8I/FZ0Dt4vJSbrMdVNp8WFxg4QnZrDeMG4MzZc90etsyF5ofKjcC+jw== +"@graphql-tools/import@^6.6.6": + version "6.6.6" + resolved "https://registry.yarnpkg.com/@graphql-tools/import/-/import-6.6.6.tgz#a4ff216e6b8a49c392bb8a4378d4e9caf2b303d7" + integrity sha512-a0aVajxqu1MsL8EwavA44Osw20lBOIhq8IM2ZIHFPP62cPAcOB26P+Sq57DHMsSyX5YQ0ab9XPM2o4e1dQhs0w== dependencies: + "@graphql-tools/utils" "8.6.2" resolve-from "5.0.0" - tslib "~2.2.0" + tslib "~2.3.0" -"@graphql-tools/json-file-loader@^6.0.0", "@graphql-tools/json-file-loader@^6.2.6": - version "6.2.6" - resolved "https://registry.yarnpkg.com/@graphql-tools/json-file-loader/-/json-file-loader-6.2.6.tgz#830482cfd3721a0799cbf2fe5b09959d9332739a" - integrity sha512-CnfwBSY5926zyb6fkDBHnlTblHnHI4hoBALFYXnrg0Ev4yWU8B04DZl/pBRUc459VNgO2x8/mxGIZj2hPJG1EA== +"@graphql-tools/json-file-loader@^7.1.2", "@graphql-tools/json-file-loader@^7.3.2": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/json-file-loader/-/json-file-loader-7.3.4.tgz#41e505f83885f2710ce6781bb150144368ff843a" + integrity sha512-1AROMFh8Lyorf2gTWXgVaUbU3ic84gzAgpRmJCsCla/Nnvn6JiCs4aWHsalk4ZWVXCaK04c8gk8Px1uNQUj02Q== dependencies: - "@graphql-tools/utils" "^7.0.0" - tslib "~2.0.1" + "@graphql-tools/utils" "^8.6.2" + globby "^11.0.3" + tslib "~2.3.0" + unixify "^1.0.0" -"@graphql-tools/load@^6.0.0", "@graphql-tools/load@^6.2.8": - version "6.2.8" - resolved "https://registry.yarnpkg.com/@graphql-tools/load/-/load-6.2.8.tgz#16900fb6e75e1d075cad8f7ea439b334feb0b96a" - integrity sha512-JpbyXOXd8fJXdBh2ta0Q4w8ia6uK5FHzrTNmcvYBvflFuWly2LDTk2abbSl81zKkzswQMEd2UIYghXELRg8eTA== +"@graphql-tools/load@^7.3.0", "@graphql-tools/load@^7.4.1": + version "7.5.2" + resolved "https://registry.yarnpkg.com/@graphql-tools/load/-/load-7.5.2.tgz#0e46129f412bd038ac56996083458c1b8828526f" + integrity sha512-URPqVP77mYxdZxT895DzrWf2C23S3yC/oAmXD4D4YlxR5eVVH/fxu0aZR78WcEKF331fWSiFwWy9j7BZWvkj7g== dependencies: - "@graphql-tools/merge" "^6.2.12" - "@graphql-tools/utils" "^7.5.0" - globby "11.0.3" - import-from "3.0.0" - is-glob "4.0.1" + "@graphql-tools/schema" "8.3.2" + "@graphql-tools/utils" "^8.6.2" p-limit "3.1.0" - tslib "~2.2.0" - unixify "1.0.0" - valid-url "1.0.9" + tslib "~2.3.0" -"@graphql-tools/merge@^6.0.0", "@graphql-tools/merge@^6.2.12", "@graphql-tools/merge@^6.2.14": - version "6.2.14" - resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-6.2.14.tgz#694e2a2785ba47558e5665687feddd2935e9d94e" - integrity sha512-RWT4Td0ROJai2eR66NHejgf8UwnXJqZxXgDWDI+7hua5vNA2OW8Mf9K1Wav1ZkjWnuRp4ztNtkZGie5ISw55ow== +"@graphql-tools/merge@^8.2.1", "@graphql-tools/merge@^8.2.3": + version "8.2.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-8.2.3.tgz#a2861fec230ee7be9dc42d72fed2ac075c31669f" + integrity sha512-XCSmL6/Xg8259OTWNp69B57CPWiVL69kB7pposFrufG/zaAlI9BS68dgzrxmmSqZV5ZHU4r/6Tbf6fwnEJGiSw== dependencies: - "@graphql-tools/schema" "^7.0.0" - "@graphql-tools/utils" "^7.7.0" - tslib "~2.2.0" + "@graphql-tools/utils" "^8.6.2" + tslib "~2.3.0" "@graphql-tools/optimize@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@graphql-tools/optimize/-/optimize-1.0.1.tgz#9933fffc5a3c63f95102b1cb6076fb16ac7bb22d" - integrity sha512-cRlUNsbErYoBtzzS6zXahXeTBZGPVlPHXCpnEZ0XiK/KY/sQL96cyzak0fM/Gk6qEI9/l32MYEICjasiBQrl5w== + version "1.2.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/optimize/-/optimize-1.2.0.tgz#292d0a269f95d04bc6d822c034569bb7e591fb26" + integrity sha512-l0PTqgHeorQdeOizUor6RB49eOAng9+abSxiC5/aHRo6hMmXVaqv5eqndlmxCpx9BkgNb3URQbK+ZZHVktkP/g== dependencies: - tslib "~2.0.1" + tslib "~2.3.0" -"@graphql-tools/prisma-loader@^6.3.0": - version "6.3.0" - resolved "https://registry.yarnpkg.com/@graphql-tools/prisma-loader/-/prisma-loader-6.3.0.tgz#c907e17751ff2b26e7c2bc75d0913ebf03f970da" - integrity sha512-9V3W/kzsFBmUQqOsd96V4a4k7Didz66yh/IK89B1/rrvy9rYj+ULjEqR73x9BYZ+ww9FV8yP8LasWAJwWaqqJQ== +"@graphql-tools/prisma-loader@^7.0.6": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@graphql-tools/prisma-loader/-/prisma-loader-7.1.2.tgz#a4cb15eacca5e182f36ee0d3a94d76fce002dc86" + integrity sha512-AK/MIEaCDtcV41JTtdTmRBV8I6DM102FWJDbb3rTOVtIYSjU62G23yrPca8aMVcnIneQQNJ7MKYO18agCYXzqw== dependencies: - "@graphql-tools/url-loader" "^6.8.2" - "@graphql-tools/utils" "^7.0.0" - "@types/http-proxy-agent" "^2.0.2" + "@graphql-tools/url-loader" "^7.7.2" + "@graphql-tools/utils" "^8.6.2" "@types/js-yaml" "^4.0.0" "@types/json-stable-stringify" "^1.0.32" "@types/jsonwebtoken" "^8.5.0" chalk "^4.1.0" debug "^4.3.1" - dotenv "^8.2.0" - graphql-request "^3.3.0" - http-proxy-agent "^4.0.1" + dotenv "^16.0.0" + graphql-request "^4.0.0" + http-proxy-agent "^5.0.0" https-proxy-agent "^5.0.0" isomorphic-fetch "^3.0.0" js-yaml "^4.0.0" @@ -794,140 +840,186 @@ lodash "^4.17.20" replaceall "^0.1.6" scuid "^1.1.0" - tslib "~2.1.0" + tslib "~2.3.0" yaml-ast-parser "^0.0.43" -"@graphql-tools/relay-operation-optimizer@^6.3.0": - version "6.3.0" - resolved "https://registry.yarnpkg.com/@graphql-tools/relay-operation-optimizer/-/relay-operation-optimizer-6.3.0.tgz#f8c7f6c8aa4a9cf50ab151fbc5db4f4282a79532" - integrity sha512-Or3UgRvkY9Fq1AAx7q38oPqFmTepLz7kp6wDHKyR0ceG7AvHv5En22R12mAeISInbhff4Rpwgf6cE8zHRu6bCw== +"@graphql-tools/relay-operation-optimizer@^6.3.7": + version "6.4.2" + resolved "https://registry.yarnpkg.com/@graphql-tools/relay-operation-optimizer/-/relay-operation-optimizer-6.4.2.tgz#18e20fed783f5de3081ce90d3b4d82047ea8d46b" + integrity sha512-pc/cliYO0veVbMyM5H54lZzQh+9SxnjawqR623rc+jPuY9JUQcuIKkZzM1+E5blbtr4dvh7Bi4uzf3rJ0sxG0Q== dependencies: - "@graphql-tools/utils" "^7.1.0" - relay-compiler "10.1.0" - tslib "~2.0.1" + "@graphql-tools/utils" "^8.6.2" + relay-compiler "12.0.0" + tslib "~2.3.0" -"@graphql-tools/schema@^7.0.0", "@graphql-tools/schema@^7.1.5": - version "7.1.5" - resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-7.1.5.tgz#07b24e52b182e736a6b77c829fc48b84d89aa711" - integrity sha512-uyn3HSNSckf4mvQSq0Q07CPaVZMNFCYEVxroApOaw802m9DcZPgf9XVPy/gda5GWj9AhbijfRYVTZQgHnJ4CXA== +"@graphql-tools/schema@8.3.2", "@graphql-tools/schema@^8.1.2", "@graphql-tools/schema@^8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-8.3.2.tgz#5b949d7a2cc3936f73507d91cc609996f1266d11" + integrity sha512-77feSmIuHdoxMXRbRyxE8rEziKesd/AcqKV6fmxe7Zt+PgIQITxNDew2XJJg7qFTMNM43W77Ia6njUSBxNOkwg== dependencies: - "@graphql-tools/utils" "^7.1.2" - tslib "~2.2.0" - value-or-promise "1.0.6" + "@graphql-tools/merge" "^8.2.3" + "@graphql-tools/utils" "^8.6.2" + tslib "~2.3.0" + value-or-promise "1.0.11" -"@graphql-tools/url-loader@^6.0.0", "@graphql-tools/url-loader@^6.10.1", "@graphql-tools/url-loader@^6.8.2": - version "6.10.1" - resolved "https://registry.yarnpkg.com/@graphql-tools/url-loader/-/url-loader-6.10.1.tgz#dc741e4299e0e7ddf435eba50a1f713b3e763b33" - integrity sha512-DSDrbhQIv7fheQ60pfDpGD256ixUQIR6Hhf9Z5bRjVkXOCvO5XrkwoWLiU7iHL81GB1r0Ba31bf+sl+D4nyyfw== +"@graphql-tools/url-loader@^7.0.11", "@graphql-tools/url-loader@^7.4.2", "@graphql-tools/url-loader@^7.7.2": + version "7.8.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/url-loader/-/url-loader-7.8.0.tgz#f2e6f093dd283734a8d81cc6515898199f897170" + integrity sha512-4j5X40hpYInM5J7KbURSspEJCi6tPqvEE2kyBOyP0C0YIOYtKgUJTAryjbBXqr+HWGyEwJ2zuQ2cQdVMn8l78A== dependencies: - "@graphql-tools/delegate" "^7.0.1" - "@graphql-tools/utils" "^7.9.0" - "@graphql-tools/wrap" "^7.0.4" - "@microsoft/fetch-event-source" "2.0.1" - "@types/websocket" "1.0.2" - abort-controller "3.0.0" - cross-fetch "3.1.4" - extract-files "9.0.0" - form-data "4.0.0" - graphql-ws "^4.4.1" - is-promise "4.0.0" - isomorphic-ws "4.0.1" - lodash "4.17.21" - meros "1.1.4" - subscriptions-transport-ws "^0.9.18" - sync-fetch "0.3.0" - tslib "~2.2.0" - valid-url "1.0.9" - ws "7.4.5" + "@graphql-tools/delegate" "^8.5.1" + "@graphql-tools/utils" "^8.6.2" + "@graphql-tools/wrap" "^8.4.2" + "@n1ru4l/graphql-live-query" "^0.9.0" + "@types/websocket" "^1.0.4" + "@types/ws" "^8.0.0" + cross-undici-fetch "^0.1.19" + dset "^3.1.0" + extract-files "^11.0.0" + graphql-sse "^1.0.1" + graphql-ws "^5.4.1" + isomorphic-ws "^4.0.1" + meros "^1.1.4" + subscriptions-transport-ws "^0.11.0" + sync-fetch "^0.3.1" + tslib "^2.3.0" + valid-url "^1.0.9" + value-or-promise "^1.0.11" + ws "^8.3.0" -"@graphql-tools/utils@^7.0.0", "@graphql-tools/utils@^7.1.0", "@graphql-tools/utils@^7.1.2", "@graphql-tools/utils@^7.5.0", "@graphql-tools/utils@^7.7.0", "@graphql-tools/utils@^7.7.1", "@graphql-tools/utils@^7.8.1", "@graphql-tools/utils@^7.9.0", "@graphql-tools/utils@^7.9.1": - version "7.10.0" - resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-7.10.0.tgz#07a4cb5d1bec1ff1dc1d47a935919ee6abd38699" - integrity sha512-d334r6bo9mxdSqZW6zWboEnnOOFRrAPVQJ7LkU8/6grglrbcu6WhwCLzHb90E94JI3TD3ricC3YGbUqIi9Xg0w== +"@graphql-tools/utils@8.6.2", "@graphql-tools/utils@^8.1.1", "@graphql-tools/utils@^8.3.0", "@graphql-tools/utils@^8.5.1", "@graphql-tools/utils@^8.5.2", "@graphql-tools/utils@^8.6.2": + version "8.6.2" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.6.2.tgz#095408135f091aac68fe18a0a21b708e685500da" + integrity sha512-x1DG0cJgpJtImUlNE780B/dfp8pxvVxOD6UeykFH5rHes26S4kGokbgU8F1IgrJ1vAPm/OVBHtd2kicTsPfwdA== dependencies: - "@ardatan/aggregate-error" "0.0.6" - camel-case "4.1.2" - tslib "~2.2.0" + tslib "~2.3.0" -"@graphql-tools/wrap@^7.0.4": - version "7.0.8" - resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-7.0.8.tgz#ad41e487135ca3ea1ae0ea04bb3f596177fb4f50" - integrity sha512-1NDUymworsOlb53Qfh7fonDi2STvqCtbeE68ntKY9K/Ju/be2ZNxrFSbrBHwnxWcN9PjISNnLcAyJ1L5tCUyhg== +"@graphql-tools/wrap@^8.4.2": + version "8.4.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-8.4.3.tgz#cb7d703c41cebe3c32b999d3a28c17e3eac12783" + integrity sha512-2bd3GtlqV72idEphLTM8SRiSxEDrMPGE556faW8N5Q2qK7qlCEu9AQK0HNKWKdtEPTHqahndZtIPcdpNN6xGig== dependencies: - "@graphql-tools/delegate" "^7.1.5" - "@graphql-tools/schema" "^7.1.5" - "@graphql-tools/utils" "^7.8.1" - tslib "~2.2.0" - value-or-promise "1.0.6" + "@graphql-tools/delegate" "^8.5.1" + "@graphql-tools/schema" "^8.3.2" + "@graphql-tools/utils" "^8.6.2" + tslib "~2.3.0" + value-or-promise "1.0.11" -"@hapi/accept@5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@hapi/accept/-/accept-5.0.2.tgz#ab7043b037e68b722f93f376afb05e85c0699523" - integrity sha512-CmzBx/bXUR8451fnZRuZAJRlzgm0Jgu5dltTX/bszmR2lheb9BpyN47Q1RbaGTsvFzn0PXAEs+lXDKfshccYZw== +"@humanwhocodes/config-array@^0.9.2": + version "0.9.5" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" + integrity sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw== dependencies: - "@hapi/boom" "9.x.x" - "@hapi/hoek" "9.x.x" + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.4" -"@hapi/boom@9.x.x": - version "9.1.2" - resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-9.1.2.tgz#48bd41d67437164a2d636e3b5bc954f8c8dc5e38" - integrity sha512-uJEJtiNHzKw80JpngDGBCGAmWjBtzxDCz17A9NO2zCi8LLBlb5Frpq4pXwyN+2JQMod4pKz5BALwyneCgDg89Q== - dependencies: - "@hapi/hoek" "9.x.x" - -"@hapi/hoek@9.x.x": - version "9.2.0" - resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.2.0.tgz#f3933a44e365864f4dad5db94158106d511e8131" - integrity sha512-sqKVVVOe5ivCaXDWivIJYVSaEgdQK9ul7a4Kity5Iw7u9+wBAPbX1RMSnLLmp7O4Vzj0WOWwMAJsTL00xwaNug== +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== "@iarna/toml@^2.2.5": version "2.2.5" resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.5.tgz#b32366c89b43c6f8cefbdefac778b9c828e3ba8c" integrity sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg== -"@microsoft/fetch-event-source@2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@microsoft/fetch-event-source/-/fetch-event-source-2.0.1.tgz#9ceecc94b49fbaa15666e38ae8587f64acce007d" - integrity sha512-W6CLUJ2eBMw3Rec70qrsEW0jOm/3twwJv21mrmj2yORiaVmVYGS4sSS5yUwvQc1ZlDLYGPnClVWmUUMagKNsfA== +"@jridgewell/resolve-uri@^3.0.3": + version "3.0.5" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz#68eb521368db76d040a6315cdb24bf2483037b9c" + integrity sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew== -"@next/bundle-analyzer@^10.2.3": - version "10.2.3" - resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-10.2.3.tgz#6526e31f46cd48145986dc3bf911ff693e2acdf7" - integrity sha512-vEfQhGWgJugZOlSUlj3DZWs/KsK0SO2SPKoHSZ7KkzpruKzc/e45G0oUh0rffzdhasMQZM1TuSBkxO+1UcnDNw== +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.11" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz#771a1d8d744eeb71b6adb35808e1a6c7b9b8c8ec" + integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== + +"@jridgewell/trace-mapping@^0.3.0": + version "0.3.4" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz#f6a0832dffd5b8a6aaa633b7d9f8e8e94c83a0c3" + integrity sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@n1ru4l/graphql-live-query@^0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@n1ru4l/graphql-live-query/-/graphql-live-query-0.9.0.tgz#defaebdd31f625bee49e6745934f36312532b2bc" + integrity sha512-BTpWy1e+FxN82RnLz4x1+JcEewVdfmUhV1C6/XYD5AjS7PQp9QFF7K8bCD6gzPTr2l+prvqOyVueQhFJxB1vfg== + +"@next/bundle-analyzer@^12.0.8": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-12.1.0.tgz#9f6d6cda2a26220c936805be407243e22790f4b7" + integrity sha512-pOtWRWaKQXff8A80Ex3E67EH8XuERHxBPn8cQgKzfhRKQwoTEareHe2nWJO1uXTQm6m7ZRhmhb4+uwp+UvmITQ== dependencies: webpack-bundle-analyzer "4.3.0" -"@next/env@11.0.1": - version "11.0.1" - resolved "https://registry.yarnpkg.com/@next/env/-/env-11.0.1.tgz#6dc96ac76f1663ab747340e907e8933f190cc8fd" - integrity sha512-yZfKh2U6R9tEYyNUrs2V3SBvCMufkJ07xMH5uWy8wqcl5gAXoEw6A/1LDqwX3j7pUutF9d1ZxpdGDA3Uag+aQQ== +"@next/env@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/env/-/env-12.1.0.tgz#73713399399b34aa5a01771fb73272b55b22c314" + integrity sha512-nrIgY6t17FQ9xxwH3jj0a6EOiQ/WDHUos35Hghtr+SWN/ntHIQ7UpuvSi0vaLzZVHQWaDupKI+liO5vANcDeTQ== -"@next/polyfill-module@11.0.1": - version "11.0.1" - resolved "https://registry.yarnpkg.com/@next/polyfill-module/-/polyfill-module-11.0.1.tgz#ca2a110c1c44672cbcff6c2b983f0c0549d87291" - integrity sha512-Cjs7rrKCg4CF4Jhri8PCKlBXhszTfOQNl9AjzdNy4K5jXFyxyoSzuX2rK4IuoyE+yGp5A3XJCBEmOQ4xbUp9Mg== - -"@next/react-dev-overlay@11.0.1": - version "11.0.1" - resolved "https://registry.yarnpkg.com/@next/react-dev-overlay/-/react-dev-overlay-11.0.1.tgz#3c481e83347255abd466dcf7e59ac8a79a0d7fd6" - integrity sha512-lvUjMVpLsgzADs9Q8wtC5LNqvfdN+M0BDMSrqr04EDWAyyX0vURHC9hkvLbyEYWyh+WW32pwjKBXdkMnJhoqMg== +"@next/eslint-plugin-next@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-12.1.0.tgz#32586a11378b3ffa5a93ac40a3c44ad99d70e95a" + integrity sha512-WFiyvSM2G5cQmh32t/SiQuJ+I2O+FHVlK/RFw5b1565O2kEM/36EXncjt88Pa+X5oSc+1SS+tWxowWJd1lqI+g== dependencies: - "@babel/code-frame" "7.12.11" - anser "1.4.9" - chalk "4.0.0" - classnames "2.2.6" - css.escape "1.5.1" - data-uri-to-buffer "3.0.1" - platform "1.3.6" - shell-quote "1.7.2" - source-map "0.8.0-beta.0" - stacktrace-parser "0.1.10" - strip-ansi "6.0.0" + glob "7.1.7" -"@next/react-refresh-utils@11.0.1": - version "11.0.1" - resolved "https://registry.yarnpkg.com/@next/react-refresh-utils/-/react-refresh-utils-11.0.1.tgz#a7509f22b6f70c13101a26573afd295295f1c020" - integrity sha512-K347DM6Z7gBSE+TfUaTTceWvbj0B6iNAsFZXbFZOlfg3uyz2sbKpzPYYFocCc27yjLaS8OfR8DEdS2mZXi8Saw== +"@next/swc-android-arm64@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.1.0.tgz#865ba3a9afc204ff2bdeea49dd64d58705007a39" + integrity sha512-/280MLdZe0W03stA69iL+v6I+J1ascrQ6FrXBlXGCsGzrfMaGr7fskMa0T5AhQIVQD4nA/46QQWxG//DYuFBcA== + +"@next/swc-darwin-arm64@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.1.0.tgz#08e8b411b8accd095009ed12efbc2f1d4d547135" + integrity sha512-R8vcXE2/iONJ1Unf5Ptqjk6LRW3bggH+8drNkkzH4FLEQkHtELhvcmJwkXcuipyQCsIakldAXhRbZmm3YN1vXg== + +"@next/swc-darwin-x64@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.1.0.tgz#fcd684497a76e8feaca88db3c394480ff0b007cd" + integrity sha512-ieAz0/J0PhmbZBB8+EA/JGdhRHBogF8BWaeqR7hwveb6SYEIJaDNQy0I+ZN8gF8hLj63bEDxJAs/cEhdnTq+ug== + +"@next/swc-linux-arm-gnueabihf@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.1.0.tgz#9ec6380a27938a5799aaa6035c205b3c478468a7" + integrity sha512-njUd9hpl6o6A5d08dC0cKAgXKCzm5fFtgGe6i0eko8IAdtAPbtHxtpre3VeSxdZvuGFh+hb0REySQP9T1ttkog== + +"@next/swc-linux-arm64-gnu@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.1.0.tgz#7f4196dff1049cea479607c75b81033ae2dbd093" + integrity sha512-OqangJLkRxVxMhDtcb7Qn1xjzFA3s50EIxY7mljbSCLybU+sByPaWAHY4px97ieOlr2y4S0xdPKkQ3BCAwyo6Q== + +"@next/swc-linux-arm64-musl@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.1.0.tgz#b445f767569cdc2dddee785ca495e1a88c025566" + integrity sha512-hB8cLSt4GdmOpcwRe2UzI5UWn6HHO/vLkr5OTuNvCJ5xGDwpPXelVkYW/0+C3g5axbDW2Tym4S+MQCkkH9QfWA== + +"@next/swc-linux-x64-gnu@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.1.0.tgz#67610e9be4fbc987de7535f1bcb17e45fe12f90e" + integrity sha512-OKO4R/digvrVuweSw/uBM4nSdyzsBV5EwkUeeG4KVpkIZEe64ZwRpnFB65bC6hGwxIBnTv5NMSnJ+0K/WmG78A== + +"@next/swc-linux-x64-musl@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.1.0.tgz#ea19a23db08a9f2e34ac30401f774cf7d1669d31" + integrity sha512-JohhgAHZvOD3rQY7tlp7NlmvtvYHBYgY0x5ZCecUT6eCCcl9lv6iV3nfu82ErkxNk1H893fqH0FUpznZ/H3pSw== + +"@next/swc-win32-arm64-msvc@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.1.0.tgz#eadf054fc412085659b98e145435bbba200b5283" + integrity sha512-T/3gIE6QEfKIJ4dmJk75v9hhNiYZhQYAoYm4iVo1TgcsuaKLFa+zMPh4056AHiG6n9tn2UQ1CFE8EoybEsqsSw== + +"@next/swc-win32-ia32-msvc@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.1.0.tgz#68faeae10c89f698bf9d28759172b74c9c21bda1" + integrity sha512-iwnKgHJdqhIW19H9PRPM9j55V6RdcOo6rX+5imx832BCWzkDbyomWnlzBfr6ByUYfhohb8QuH4hSGEikpPqI0Q== + +"@next/swc-win32-x64-msvc@12.1.0": + version "12.1.0" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.1.0.tgz#d27e7e76c87a460a4da99c5bfdb1618dcd6cd064" + integrity sha512-aBvcbMwuanDH4EMrL2TthNJy+4nP59Bimn8egqv6GHMVj0a44cU6Au4PjOhLNqEh9l+IpRGBqMTzec94UdC5xg== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -943,62 +1035,68 @@ integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== "@nodelib/fs.walk@^1.2.3": - version "1.2.7" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.7.tgz#94c23db18ee4653e129abd26fb06f870ac9e1ee2" - integrity sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA== + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== dependencies: "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@polka/url@^1.0.0-next.15": - version "1.0.0-next.15" - resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.15.tgz#6a9d143f7f4f49db2d782f9e1c8839a29b43ae23" - integrity sha512-15spi3V28QdevleWBNXE4pIls3nFZmBbUGrW9IVPwiQczuSb9n76TCB4bsk8TSel+I1OkHEdPhu5QKMfY6rQHA== +"@polka/url@^1.0.0-next.20": + version "1.0.0-next.21" + resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" + integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== -"@react-spring/animated@~9.2.0": - version "9.2.3" - resolved "https://registry.yarnpkg.com/@react-spring/animated/-/animated-9.2.3.tgz#271226099d356b7b6d99240375dd8f62f450e997" - integrity sha512-xxYOxxrk4r+yy218lVnkR027GXGvHcadDnnXRW0l6atcL+1AGYwimMwIuvzlvnsVnyoK0YUABEeGjk9ENOrVMQ== +"@react-spring/animated@~9.4.3-beta.0": + version "9.4.3" + resolved "https://registry.yarnpkg.com/@react-spring/animated/-/animated-9.4.3.tgz#2f8d2b50dfc1975fa490ed3bc03f5ad865180866" + integrity sha512-hKKmeXPoGpJ/zrG/RC8stwW8PmMH0BbewHD8aUPLbyzD9fNvZEJ0mjKmOI0CcSwMpb43kuwY2nX3ZJVImPQCoQ== dependencies: - "@react-spring/shared" "~9.2.0" - "@react-spring/types" "~9.2.0" + "@react-spring/shared" "~9.4.3-beta.0" + "@react-spring/types" "~9.4.3-beta.0" -"@react-spring/core@~9.2.0": - version "9.2.3" - resolved "https://registry.yarnpkg.com/@react-spring/core/-/core-9.2.3.tgz#b3926ef8f2694bfb251318d7b44abac1fa5321d0" - integrity sha512-8qJbj0xjjoYGVqdmNd2bVaFzKSAwrMVLweHkaYJiTY6p0g7LhSdt5KSl1MjYA4Rj6S4wO1KgefAPK6mH6MtGtA== +"@react-spring/core@~9.4.3-beta.0": + version "9.4.3" + resolved "https://registry.yarnpkg.com/@react-spring/core/-/core-9.4.3.tgz#95c883fa53ff534ff882ba42f863a26a26a6a1c8" + integrity sha512-Jr6/GjHwXYxAtttcYDXOtH36krO0XGjYaSsGR6g+vOUO4y0zAPPXoAwpK6vS7Haip5fRwk7rMdNG+OzU7bB4Bg== dependencies: - "@react-spring/animated" "~9.2.0" - "@react-spring/shared" "~9.2.0" - "@react-spring/types" "~9.2.0" + "@react-spring/animated" "~9.4.3-beta.0" + "@react-spring/rafz" "~9.4.3-beta.0" + "@react-spring/shared" "~9.4.3-beta.0" + "@react-spring/types" "~9.4.3-beta.0" -"@react-spring/rafz@~9.2.0": - version "9.2.3" - resolved "https://registry.yarnpkg.com/@react-spring/rafz/-/rafz-9.2.3.tgz#ffde337240b6880a2488d3ca67e4b01688881793" - integrity sha512-ThBI3HWp1Y82uRSFVpoykwgM3M9s3SJD6ilKKp9C2OTPcGhWiRGt1IMjzKPwB+F1NX3psbPTt30Bev8WzA/DQQ== +"@react-spring/rafz@~9.4.3-beta.0": + version "9.4.3" + resolved "https://registry.yarnpkg.com/@react-spring/rafz/-/rafz-9.4.3.tgz#0d578072c9692ef5ab74a3b1d49c1432dce32ab6" + integrity sha512-KnujiZNIHzXsRq1D4tVbCajl8Lx+e6vtvUk7o69KbuneSpEgil9P/x3b+hMDk8U0NHGhJjzhU7723/CNsQansA== -"@react-spring/shared@~9.2.0": - version "9.2.3" - resolved "https://registry.yarnpkg.com/@react-spring/shared/-/shared-9.2.3.tgz#eaa4a4e6bf4f43d10b4a5c920a917e84047ac50e" - integrity sha512-MehdmKao1oUAwSEJo8BXOz1OGgsSav/dimD1Vz920hirShj9s/I4zKnWtkdK92xQ4n35D/xD3hATHkXbt/WSvg== +"@react-spring/shared@~9.4.3-beta.0": + version "9.4.3" + resolved "https://registry.yarnpkg.com/@react-spring/shared/-/shared-9.4.3.tgz#86e03ddd47911ba89be1d0f5a6d11966e305ee04" + integrity sha512-mB1UUD/pl1LzaY0XeNWZtvJzxMa8gLQf02nY12HAz4Rukm9dFRj0jeYwQYLdfYLsGFo1ldvHNurun6hZMG7kiQ== dependencies: - "@react-spring/rafz" "~9.2.0" - "@react-spring/types" "~9.2.0" + "@react-spring/rafz" "~9.4.3-beta.0" + "@react-spring/types" "~9.4.3-beta.0" -"@react-spring/types@~9.2.0": - version "9.2.3" - resolved "https://registry.yarnpkg.com/@react-spring/types/-/types-9.2.3.tgz#08b5ca1cb262328529ee558796395f073b6029b0" - integrity sha512-G7AWUJavwsvvvprnYmqUXE5N1XKINktc8V72ipvkFTE3DD3GApYpX/ORNmieJljKJYvBSBzpRSIzk2qELUs30Q== +"@react-spring/types@~9.4.3-beta.0": + version "9.4.3" + resolved "https://registry.yarnpkg.com/@react-spring/types/-/types-9.4.3.tgz#8926d7a09812374127b1f8a904a755c7579124e6" + integrity sha512-dzJrPvUc42K2un9y6D1IsrPQO5tKsbWwUo+wsATnXjG3ePWyuDBIOMJuPe605NhIXUmPH+Vik2wMoZz06hD1uA== -"@react-spring/web@^9.2.1": - version "9.2.3" - resolved "https://registry.yarnpkg.com/@react-spring/web/-/web-9.2.3.tgz#b9037719b489863ca2ad39caaacff6d315bbaea8" - integrity sha512-dWRcgVDbO2UI9I03n/HVmCx9tY++Na+RwRzkzXv3E53BcFsjvnWGArnpj+xE/XgXiaII3ep2RmUj5jyYoukqGg== +"@react-spring/web@^9.4.1": + version "9.4.3" + resolved "https://registry.yarnpkg.com/@react-spring/web/-/web-9.4.3.tgz#b59c1491de344545590598b7fde52b607c4e5d10" + integrity sha512-llKve/uJ73JVagBAVvA74S/LfZP4oSB3XP1qmggSUNXzPZZo5ylIMrs55PxpLyxgzzihuhDU5N17ct3ATViOHw== dependencies: - "@react-spring/animated" "~9.2.0" - "@react-spring/core" "~9.2.0" - "@react-spring/shared" "~9.2.0" - "@react-spring/types" "~9.2.0" + "@react-spring/animated" "~9.4.3-beta.0" + "@react-spring/core" "~9.4.3-beta.0" + "@react-spring/shared" "~9.4.3-beta.0" + "@react-spring/types" "~9.4.3-beta.0" + +"@rushstack/eslint-patch@^1.0.8": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.0.tgz#7f698254aadf921e48dda8c0a6b304026b8a9323" + integrity sha512-JLo+Y592QzIE+q7Dl2pMUtt4q8SKYI5jDrZxrozEQxnGVOyYE+GWK9eLkwTaeN9DDctlaRAQ3TBmzZ1qdLE30A== "@samverschueren/stream-to-observable@^0.3.0": version "0.3.1" @@ -1012,17 +1110,94 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== -"@stripe/react-stripe-js@^1.4.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@stripe/react-stripe-js/-/react-stripe-js-1.4.1.tgz#884d59286fff00ba77389b32c045516f65d7a340" - integrity sha512-FjcVrhf72+9fUL3Lz3xi02ni9tzH1A1x6elXlr6tvBDgSD55oPJuodoP8eC7xTnBIKq0olF5uJvgtkJyDCdzjA== - dependencies: - prop-types "^15.7.2" +"@spree/storefront-api-v2-sdk@^5.1.1": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@spree/storefront-api-v2-sdk/-/storefront-api-v2-sdk-5.1.4.tgz#d073d2bda98b9dd2e72daf527593c4874e504150" + integrity sha512-KvAVQ9wDAy+2EajiEGoFmw3iZRi9xERR/wKS2z+h2BaQsHMEJhe/xh06lFecEu9RKH4/k3m2dqrijyNzWLJ+Gw== -"@stripe/stripe-js@^1.16.0": - version "1.16.0" - resolved "https://registry.yarnpkg.com/@stripe/stripe-js/-/stripe-js-1.16.0.tgz#73bce24fb7f47d719caa6b151e58e49b4167d463" - integrity sha512-ZSHbiwTrISoaTbpercmYGuY7QTg7HxfFyNgbJBaYbwHWbzMhpEdGTsmMpaBXIU6iiqwEEDaIyD8O6yJ+H5DWCg== +"@swc/core-android-arm-eabi@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.2.151.tgz#e44fe75b2d8ba4685fbbf5727082b58b13bb2775" + integrity sha512-Suk3IcHdha33K4hq9tfBCwkXJsENh7kjXCseLqL8Yvy8QobqkXjf1fcoJxX9BdCmPwsKmIw0ZgCBYR+Hl83M2w== + +"@swc/core-android-arm64@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.2.151.tgz#8b7d02c8aed574a1cd5c312780abae9e17db159e" + integrity sha512-HZVy69dVWT5RgrMJMRK5aiicPmhzkyCHAexApYAHYLgAIhsxL7uoAIPmuRKRkrKNJjrwsWL7H27bBH5bddRDvg== + +"@swc/core-darwin-arm64@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.151.tgz#dc241a17bc920b7ece073579e3f9059ce0dc5ae5" + integrity sha512-Ql7rXMu+IC76TemRtkt+opl5iSpX2ApAXVSfvf6afNVTrfTKLpDwiR3ySRRlG0FnNIv6TfOCJpHf655xp01S/g== + +"@swc/core-darwin-x64@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.2.151.tgz#083dbf276d07c4537257bc25ad376602a34584b6" + integrity sha512-N1OBIB7xatR5eybLo91ZhvMJMxT0zxRQURV/a9I8o5CyP4iLd1k8gmrYvBbtj08ohS8F9z7k/dFjxk/9ve5Drw== + +"@swc/core-freebsd-x64@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.151.tgz#568a35267f1cccdef2fdc3e53c4f9a6095173706" + integrity sha512-WVIRiDzuz+/W7BMjVtg1Cmk1+zmDT18Qq+Ygr9J6aFQ1JQUkLEE1pvtkGD3JIEa6Jhz/VwM6AFHtY5o1CrZ21w== + +"@swc/core-linux-arm-gnueabihf@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.151.tgz#24859f442a255220ca1caa7f8f5f087f2c22fd08" + integrity sha512-pfBrIUwu3cR/M7DzDCUJAw9jFKXvJ/Ge8auFk07lRb+JcDnPm0XxLyrLqGvNQWdcHgXeXfmnS4fMQxdb9GUN1w== + +"@swc/core-linux-arm64-gnu@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.151.tgz#a4ae2d8f7b0cfb0836466ca57b608be7505b13e7" + integrity sha512-M+BTkTdPY7gteM+0dYz9wrU/j9taL4ccqPEHkDEKP21lS24y99UtuKsvdBLzDm/6ShBVLFAkgIBPu5cEb7y6ig== + +"@swc/core-linux-arm64-musl@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.151.tgz#16785fa421244d9df02123ce8b4bf8964b37412a" + integrity sha512-7A+yTtSvPJVwO8X1cxUbD/PVCx8G9MKn83G9pH/r+9sQMBXqxyw6/NR0DG6nMMiyOmJkmYWgh5mO47BN7WC4dQ== + +"@swc/core-linux-x64-gnu@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.151.tgz#b0717cb662becec95d306632fbd40f612d3db700" + integrity sha512-ORlbN3wf1w0IQGjGToYYC/hV/Vwfcs88Ohfxc4X+IQaw/VxKG6/XT65c0btK640F2TVhvhH1MbYFJJlsycsW7g== + +"@swc/core-linux-x64-musl@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.151.tgz#7d703b3a96da37538bd69e4582c8ee70c9d36a37" + integrity sha512-r6odKE3+9+ReVdnNTZnICt5tscyFFtP4GFcmPQzBSlVoD9LZX6O4WeOlFXn77rVK/+205n2ag/KkKgZH+vdPuQ== + +"@swc/core-win32-arm64-msvc@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.151.tgz#aa97ef1df5e740c0ae1b4b0586f6c544983f11a7" + integrity sha512-jnjJTNHpLhBaPwRgiKv1TdrMljL88ePqMCdVMantyd7yl4lP0D2e5/xR9ysR9S4EGcUnOyo9w8WUYhx/TioMZw== + +"@swc/core-win32-ia32-msvc@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.151.tgz#6ab6889078ef820a7c644d7df72403cbb534d4e2" + integrity sha512-hSCxAiyDDXKvdUExj4jSIhzWFePqoqak1qdNUjlhEhEinDG8T8PTRCLalyW6fqZDcLf6Tqde7H79AqbfhRlYGQ== + +"@swc/core-win32-x64-msvc@1.2.151": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.151.tgz#525c9554da57c0d4b07956349680b1dc9c4dee4f" + integrity sha512-HOkqcJWCChps83Maj0M5kifPDuZ2sGPqpLM67poawspTFkBh0QJ9TMmxW1doQw+74cqsTpRi1ewr/KhsN18i5g== + +"@swc/core@^1.2.138": + version "1.2.151" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.2.151.tgz#8d4154a2e4ced74c5fd215c5905baa08775553d6" + integrity sha512-oHgqKwK/Djv765zUHPiGqfMCaKIxXTgQyyCUBKLBQfAJwe/7FVobQ2fghBp4FsZA/NE1LZBmMPpRZNQwlGjeHw== + optionalDependencies: + "@swc/core-android-arm-eabi" "1.2.151" + "@swc/core-android-arm64" "1.2.151" + "@swc/core-darwin-arm64" "1.2.151" + "@swc/core-darwin-x64" "1.2.151" + "@swc/core-freebsd-x64" "1.2.151" + "@swc/core-linux-arm-gnueabihf" "1.2.151" + "@swc/core-linux-arm64-gnu" "1.2.151" + "@swc/core-linux-arm64-musl" "1.2.151" + "@swc/core-linux-x64-gnu" "1.2.151" + "@swc/core-linux-x64-musl" "1.2.151" + "@swc/core-win32-arm64-msvc" "1.2.151" + "@swc/core-win32-ia32-msvc" "1.2.151" + "@swc/core-win32-x64-msvc" "1.2.151" "@szmarczak/http-timer@^1.1.2": version "1.1.2" @@ -1031,52 +1206,87 @@ dependencies: defer-to-connect "^1.0.1" -"@tootallnate/once@1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" - integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@taskr/clear@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@taskr/clear/-/clear-1.1.0.tgz#0a88d180bed2f91f310136375a72c00b50834fd1" + integrity sha1-CojRgL7S+R8xATY3WnLAC1CDT9E= + dependencies: + bluebird "^3.5.0" + rimraf "^2.5.4" + +"@taskr/esnext@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@taskr/esnext/-/esnext-1.1.0.tgz#e8ca509f45fc57a4e2152945c27500c531cf87dd" + integrity sha1-6MpQn0X8V6TiFSlFwnUAxTHPh90= + dependencies: + require-like "^0.1.2" + rewrite-imports "^1.0.0" + +"@taskr/watch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@taskr/watch/-/watch-1.1.0.tgz#bf447178cfac71fc99b250ff46c40ad3f96173d6" + integrity sha1-v0RxeM+scfyZslD/RsQK0/lhc9Y= + dependencies: + chokidar "^1.7.0" + +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== "@types/async-retry@1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@types/async-retry/-/async-retry-1.2.1.tgz#fa9ac165907a8ee78f4924f4e393b656c65b5bb4" integrity sha512-yMQ6CVgICWtyFNBqJT3zqOc+TnqqEPLo4nKJNPFwcialiylil38Ie6q1ENeFTjvaLOkVim9K5LisHgAKJWidGQ== -"@types/body-scroll-lock@^2.6.1": - version "2.6.1" - resolved "https://registry.yarnpkg.com/@types/body-scroll-lock/-/body-scroll-lock-2.6.1.tgz#0dbd2b6ad2f4cfcece7102d6cf8630ce95508ee0" - integrity sha512-PPFm/2A6LfKmSpvMg58gHtSqwwMChbcKKGhSCRIhY4MyFzhY8moAN6HrTCpOeZQUqkFdTFfMqr7njeqGLKt72Q== - -"@types/cookie@^0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.4.0.tgz#14f854c0f93d326e39da6e3b6f34f7d37513d108" - integrity sha512-y7mImlc/rNkvCRmg8gC3/lj87S7pTUIJ6QGjwHR9WQJcFs+ZMTOaoPrkdFA/YdbuqVEmEbb5RdhVxMkAcgOnpg== - -"@types/http-proxy-agent@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@types/http-proxy-agent/-/http-proxy-agent-2.0.2.tgz#942c1f35c7e1f0edd1b6ffae5d0f9051cfb32be1" - integrity sha512-2S6IuBRhqUnH1/AUx9k8KWtY3Esg4eqri946MnxTG5HwehF1S5mqLln8fcyMiuQkY72p2gH3W+rIPqp5li0LyQ== +"@types/async-retry@^1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@types/async-retry/-/async-retry-1.4.3.tgz#8b78f6ce88d97e568961732cdd9e5325cdc8c246" + integrity sha512-B3C9QmmNULVPL2uSJQ088eGWTNPIeUk35hca6CV8rRDJ8GXuQJP5CCVWA1ZUCrb9xYP7Js/RkLqnNNwKhe+Zsw== dependencies: - "@types/node" "*" + "@types/retry" "*" -"@types/js-cookie@^2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@types/js-cookie/-/js-cookie-2.2.6.tgz#f1a1cb35aff47bc5cfb05cb0c441ca91e914c26f" - integrity sha512-+oY0FDTO2GYKEV0YPvSshGq9t7YozVkgvXLty7zogQNuCxBhT9/3INX9Q7H1aRZ4SUDRXAKlJuA4EA5nTt7SNw== +"@types/body-scroll-lock@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@types/body-scroll-lock/-/body-scroll-lock-3.1.0.tgz#435f6abf682bf58640e1c2ee5978320b891970e7" + integrity sha512-3owAC4iJub5WPqRhxd8INarF2bWeQq1yQHBgYhN0XLBJMpd5ED10RrJ3aKiAwlTyL5wK7RkBD4SZUQz2AAAMdA== + +"@types/chec__commerce.js@*", "@types/chec__commerce.js@^2.8.4": + version "2.8.4" + resolved "https://registry.yarnpkg.com/@types/chec__commerce.js/-/chec__commerce.js-2.8.4.tgz#9f671a1ebeb16ee2c21de0fd19cfaeb6c4c5a780" + integrity sha512-hyR2OXEB3gIRp/ESWOQaFStefBG+C5OdnkxGC1Gmp0ePVzl/wk5FyvaK5NsT1ddNC/y1YsmDAVPe+DArr6/9Jg== + dependencies: + "@types/chec__commerce.js" "*" + +"@types/cookie@^0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.4.1.tgz#bfd02c1f2224567676c1545199f87c3a861d878d" + integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q== + +"@types/js-cookie@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/js-cookie/-/js-cookie-3.0.1.tgz#04aa743e2e0a85a22ee9aa61f6591a8bc19b5d68" + integrity sha512-7wg/8gfHltklehP+oyJnZrz9XBuX5ZPP4zB6UsI84utdlkRYLnOm2HfpLXazTwZA+fpGn0ir8tGNgVnMEleBGQ== "@types/js-yaml@^4.0.0": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.1.tgz#5544730b65a480b18ace6b6ce914e519cec2d43b" - integrity sha512-xdOvNmXmrZqqPy3kuCQ+fz6wA0xU5pji9cd1nDrflWaAWtYLLGk5ykW0H6yg5TVyehHP1pfmuuSaZkhP+kspVA== + version "4.0.5" + resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.5.tgz#738dd390a6ecc5442f35e7f03fa1431353f7e138" + integrity sha512-FhpRzf927MNQdRZP0J5DLIdTXhjLYzeUTmLAu69mnVksLH9CJY3IuSeEgbKUki7GQZm0WqDkGzyxju2EZGD2wA== "@types/json-stable-stringify@^1.0.32": - version "1.0.32" - resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.0.32.tgz#121f6917c4389db3923640b2e68de5fa64dda88e" - integrity sha512-q9Q6+eUEGwQkv4Sbst3J4PNgDOvpuVuKj79Hl/qnmBMEIPzB5QoFRUtjcgcg2xNUZyYUGXBk5wYIBKHt0A+Mxw== + version "1.0.34" + resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.0.34.tgz#c0fb25e4d957e0ee2e497c1f553d7f8bb668fd75" + integrity sha512-s2cfwagOQAS8o06TcwKfr9Wx11dNGbH2E9vJz1cqV+a/LOyhWNLUNd6JSRYNzvB4d29UuJX2M0Dj9vE1T8fRXw== -"@types/jsonwebtoken@^8.5.0": - version "8.5.2" - resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-8.5.2.tgz#eb71c717b3b8681bb85fbd2950c9c4c5d4506748" - integrity sha512-X8BOCkp+WJVNYCYIBugREtVZa4Y09Or9HDx6xqRZem5F8jJV8FuJgNessXyMuv9+U8pjnvdezASwU28uw+1scw== +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + +"@types/jsonwebtoken@^8.5.0", "@types/jsonwebtoken@^8.5.7": + version "8.5.8" + resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-8.5.8.tgz#01b39711eb844777b7af1d1f2b4cf22fda1c0c44" + integrity sha512-zm6xBQpFDIDM6o9r6HSgDeIcLy82TKWctCXEPbJJcXb5AKmi5BNNdLXneixK4lplX3PqIVcwLBCGE/kAGnlD4A== dependencies: "@types/node" "*" @@ -1102,26 +1312,27 @@ "@types/lodash" "*" "@types/lodash@*": - version "4.14.170" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.170.tgz#0d67711d4bf7f4ca5147e9091b847479b87925d6" - integrity sha512-bpcvu/MKHHeYX+qeEN8GE7DIravODWdACVA1ctevD8CN24RhPZIKMn9ntfAsrvLfSX3cR5RrBKAbYm9bGs0A+Q== + version "4.14.179" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.179.tgz#490ec3288088c91295780237d2497a3aa9dfb5c5" + integrity sha512-uwc1x90yCKqGcIOAT6DwOSuxnrAbpkdPsUOZtwrXb4D/6wZs+6qG7QnIawDuZWg0sWpxl+ltIKCaLoMlna678w== "@types/lru-cache@4.1.1": version "4.1.1" resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-4.1.1.tgz#b2d87a5e3df8d4b18ca426c5105cd701c2306d40" integrity sha512-8mNEUG6diOrI6pMqOHrHPDBB1JsrpedeMK9AWGzVCQ7StRRribiT9BRvUmF8aUws9iBbVlgVekOT5Sgzc1MTKw== -"@types/node-fetch@2.3.2": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.3.2.tgz#e01893b176c6fa1367743726380d65bce5d6576b" - integrity sha512-yW0EOebSsQme9yKu09XbdDfle4/SmWZMK4dfteWcSLCYNQQcF+YOv0kIrvm+9pO11/ghA4E6A+RNQqvYj4Nr3A== +"@types/node-fetch@^2.6.1": + version "2.6.1" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.1.tgz#8f127c50481db65886800ef496f20bbf15518975" + integrity sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA== dependencies: "@types/node" "*" + form-data "^3.0.0" -"@types/node@*", "@types/node@^15.12.4": - version "15.12.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.4.tgz#e1cf817d70a1e118e81922c4ff6683ce9d422e26" - integrity sha512-zrNj1+yqYF4WskCMOHwN+w9iuD12+dGm0rQ35HLl9/Ouuq52cEtd0CH9qMgrdNmi5ejC1/V7vKEXYubB+65DkA== +"@types/node@*", "@types/node@>=8.1.0", "@types/node@^17.0.8": + version "17.0.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.21.tgz#864b987c0c68d07b4345845c3e63b75edd143644" + integrity sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ== "@types/node@10.12.18": version "10.12.18" @@ -1134,64 +1345,120 @@ integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== "@types/prop-types@*": - version "15.7.3" - resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" - integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== + version "15.7.4" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz#fcf7205c25dff795ee79af1e30da2c9790808f11" + integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== -"@types/react@^17.0.8": - version "17.0.11" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.11.tgz#67fcd0ddbf5a0b083a0f94e926c7d63f3b836451" - integrity sha512-yFRQbD+whVonItSk7ZzP/L+gPTJVBkL/7shLEF+i9GC/1cV3JmUxEQz6+9ylhUpWSDuqo1N9qEvqS6vTj4USUA== +"@types/react@^17.0.38": + version "17.0.39" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.39.tgz#d0f4cde092502a6db00a1cded6e6bf2abb7633ce" + integrity sha512-UVavlfAxDd/AgAacMa60Azl7ygyQNRwC/DsHZmKgNvPmRR5p70AJ5Q9EAmL2NWOJmeV+vVUI4IAP7GZrN8h8Ug== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" csstype "^3.0.2" +"@types/retry@*": + version "0.12.1" + resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.1.tgz#d8f1c0d0dc23afad6dc16a9e993a0865774b4065" + integrity sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g== + "@types/scheduler@*": - version "0.16.1" - resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" - integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== + version "0.16.2" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" + integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== "@types/uuid@8.3.1": version "8.3.1" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.1.tgz#1a32969cf8f0364b3d8c8af9cc3555b7805df14f" integrity sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg== -"@types/websocket@1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.2.tgz#d2855c6a312b7da73ed16ba6781815bf30c6187a" - integrity sha512-B5m9aq7cbbD/5/jThEr33nUY8WEfVi6A2YKCTOvw5Ldy7mtsOkqRvGjnzy6g7iMMDsgu7xREuCzqATLDLQVKcQ== +"@types/websocket@^1.0.4": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.5.tgz#3fb80ed8e07f88e51961211cd3682a3a4a81569c" + integrity sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ== dependencies: "@types/node" "*" +"@types/ws@^8.0.0": + version "8.5.2" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.2.tgz#77e0c2e360e9579da930ffcfa53c5975ea3bdd26" + integrity sha512-VXI82ykONr5tacHEojnErTQk+KQSoYbW1NB6iz6wUwrNd+BqfkfggQNoNdCqhJSzbNumShPERbM+Pc5zpfhlbw== + dependencies: + "@types/node" "*" + +"@typescript-eslint/parser@^5.0.0": + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.14.0.tgz#7c79f898aa3cff0ceee6f1d34eeed0f034fb9ef3" + integrity sha512-aHJN8/FuIy1Zvqk4U/gcO/fxeMKyoSv/rS46UXMXOJKVsLQ+iYPuXNbpbH7cBLcpSbmyyFbwrniLx5+kutu1pw== + dependencies: + "@typescript-eslint/scope-manager" "5.14.0" + "@typescript-eslint/types" "5.14.0" + "@typescript-eslint/typescript-estree" "5.14.0" + debug "^4.3.2" + +"@typescript-eslint/scope-manager@5.14.0": + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.14.0.tgz#ea518962b42db8ed0a55152ea959c218cb53ca7b" + integrity sha512-LazdcMlGnv+xUc5R4qIlqH0OWARyl2kaP8pVCS39qSL3Pd1F7mI10DbdXeARcE62sVQE4fHNvEqMWsypWO+yEw== + dependencies: + "@typescript-eslint/types" "5.14.0" + "@typescript-eslint/visitor-keys" "5.14.0" + +"@typescript-eslint/types@5.14.0": + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.14.0.tgz#96317cf116cea4befabc0defef371a1013f8ab11" + integrity sha512-BR6Y9eE9360LNnW3eEUqAg6HxS9Q35kSIs4rp4vNHRdfg0s+/PgHgskvu5DFTM7G5VKAVjuyaN476LCPrdA7Mw== + +"@typescript-eslint/typescript-estree@5.14.0": + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.14.0.tgz#78b7f7385d5b6f2748aacea5c9b7f6ae62058314" + integrity sha512-QGnxvROrCVtLQ1724GLTHBTR0lZVu13izOp9njRvMkCBgWX26PKvmMP8k82nmXBRD3DQcFFq2oj3cKDwr0FaUA== + dependencies: + "@typescript-eslint/types" "5.14.0" + "@typescript-eslint/visitor-keys" "5.14.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" + +"@typescript-eslint/visitor-keys@5.14.0": + version "5.14.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.14.0.tgz#1927005b3434ccd0d3ae1b2ecf60e65943c36986" + integrity sha512-yL0XxfzR94UEkjBqyymMLgCBdojzEuy/eim7N9/RIcTNxpJudAcqsU8eRyfzBbcEzGoPWfdM3AGak3cN08WOIw== + dependencies: + "@typescript-eslint/types" "5.14.0" + eslint-visitor-keys "^3.0.0" + "@vercel/fetch-cached-dns@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@vercel/fetch-cached-dns/-/fetch-cached-dns-2.0.2.tgz#975c395cf53f188fa618fad57f27af6b5ffc5bab" - integrity sha512-gDqKEV8CeY2YmCdZpP1rn3tFK1L07Vw2+HYkCK8zpRHOVGr/sP8yhBsW+C/yqGVj0i9z/rIvqIHe5emvRvxwgw== + version "2.1.0" + resolved "https://registry.yarnpkg.com/@vercel/fetch-cached-dns/-/fetch-cached-dns-2.1.0.tgz#15332b49cbeeb476eecbed0d3660e76808b3365a" + integrity sha512-dIQWF+bG2EOYeCCCeT3E77qZZa7VgW2quEKw4k8/keeoD8lRMjiNi//Ww7LJ8wXecfv7XXtprwN5uLLLGo/ktg== dependencies: - "@types/node-fetch" "2.3.2" - "@zeit/dns-cached-resolve" "2.1.2" + "@types/node-fetch" "^2.6.1" + "@zeit/dns-cached-resolve" "^2.1.2" -"@vercel/fetch-retry@^5.0.2": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@vercel/fetch-retry/-/fetch-retry-5.0.3.tgz#cce5d23f6e64f6f525c24e2ac7c78f65d6c5b1f4" - integrity sha512-DIIoBY92r+sQ6iHSf5WjKiYvkdsDIMPWKYATlE0KcUAj2RV6SZK9UWpUzBRKsofXqedOqpVjrI0IE6AWL7JRtg== +"@vercel/fetch-retry@^5.0.3": + version "5.1.3" + resolved "https://registry.yarnpkg.com/@vercel/fetch-retry/-/fetch-retry-5.1.3.tgz#1bca6531d4a006e3961469472d726a70edc459f2" + integrity sha512-UIbFc4VsEZHOr6dWuE+kxY4NxnOLXFMCWm0fSKRRHUEtrIzaJLzHpWk2QskCXTSzFgFvhkLAvSrBK2XZg7NSzg== dependencies: - async-retry "^1.3.1" - debug "^3.1.0" + async-retry "^1.3.3" + debug "^4.3.3" -"@vercel/fetch@^6.1.0": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@vercel/fetch/-/fetch-6.1.1.tgz#6564bfe9050f871842cf4834bb0117eaafd3915e" - integrity sha512-nddCkgpA0aVIqOlzh+qVlzDNcQq0cSnqefM+x6SciGI4GCvVZeaZ7WEowgX8I/HwBAq8Uj5Bdnd+r0+sYsJsig== +"@vercel/fetch@^6.1.1": + version "6.2.0" + resolved "https://registry.yarnpkg.com/@vercel/fetch/-/fetch-6.2.0.tgz#149b97dddeb2c98a23439665f42baa66d5aa3903" + integrity sha512-MU+Mzh06NIAXxwdnyHmBFg+/lTKBbzDkCSNhAwWTFJ4rHuBc4pHc8E6XP+qnwqaWugjOBQgFfQCGDLnV820c9A== dependencies: - "@types/async-retry" "1.2.1" + "@types/async-retry" "^1.4.3" "@vercel/fetch-cached-dns" "^2.0.2" - "@vercel/fetch-retry" "^5.0.2" - agentkeepalive "3.4.1" - debug "3.1.0" + "@vercel/fetch-retry" "^5.0.3" + agentkeepalive "^4.2.1" + debug "^4.3.3" -"@zeit/dns-cached-resolve@2.1.2": +"@zeit/dns-cached-resolve@^2.1.2": version "2.1.2" resolved "https://registry.yarnpkg.com/@zeit/dns-cached-resolve/-/dns-cached-resolve-2.1.2.tgz#2c2e33d682d67f94341c9a06ac0e2a8f14ff035f" integrity sha512-A/5gbBskKPETTBqHwvlaW1Ri2orO62yqoFoXdxna1SQ7A/lXjpWgpJ1wdY3IQEcz5LydpS4sJ8SzI2gFyyLEhg== @@ -1202,13 +1469,18 @@ async-retry "1.2.3" lru-cache "5.1.1" -abort-controller@3.0.0: +abort-controller@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== dependencies: event-target-shim "^5.0.0" +acorn-jsx@^5.3.1: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + acorn-node@^1.6.1: version "1.8.2" resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.8.2.tgz#114c95d64539e53dede23de8b9d96df7c7ae2af8" @@ -1224,19 +1496,19 @@ acorn-walk@^7.0.0: integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== acorn-walk@^8.0.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.1.0.tgz#d3c6a9faf00987a5e2b9bdb506c2aa76cd707f83" - integrity sha512-mjmzmv12YIG/G8JQdQuz2MUDShEJ6teYpT5bmWA4q7iwoGen8xtt3twF3OvzIUl+Q06aWIjvnwQUKvQ6TtMRjg== + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== acorn@^7.0.0: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4: - version "8.4.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.4.0.tgz#af53266e698d7cffa416714b503066a82221be60" - integrity sha512-ULr0LDaEqQrMFGyQ3bhJkLsbtrQ8QibAseGZeaSUiT/6zb9IvIkomWHJIvgvwad+hinRAgsI51JcWk2yvwyL+w== +acorn@^8.0.4, acorn@^8.7.0: + version "8.7.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" + integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== agent-base@6: version "6.0.2" @@ -1245,11 +1517,13 @@ agent-base@6: dependencies: debug "4" -agentkeepalive@3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-3.4.1.tgz#aa95aebc3a749bca5ed53e3880a09f5235b48f0c" - integrity sha512-MPIwsZU9PP9kOrZpyu2042kYA8Fdt/AedQYkYXucHgF9QoD9dXVp0ypuGnHXSR0hTstBxdt85Xkh4JolYfK5wg== +agentkeepalive@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.2.1.tgz#a7975cbb9f83b367f06c90cc51ff28fe7d499717" + integrity sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA== dependencies: + debug "^4.1.0" + depd "^1.1.2" humanize-ms "^1.2.1" aggregate-error@^3.0.0: @@ -1260,15 +1534,15 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -anser@1.4.9: - version "1.4.9" - resolved "https://registry.yarnpkg.com/anser/-/anser-1.4.9.tgz#1f85423a5dcf8da4631a341665ff675b96845760" - integrity sha512-AI+BjTeGt2+WFk4eWcqbQ7snZpDBt8SaLlj0RT2h5xfdWaiy51OjYvqwMrNzJLGy8iOAL6nKDITWO+rd4MkYEA== - -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== +ajv@^6.10.0, ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" ansi-escapes@^3.0.0: version "3.2.0" @@ -1292,10 +1566,15 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== ansi-styles@^2.2.1: version "2.2.1" @@ -1316,12 +1595,25 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" +ansi-styles@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.1.0.tgz#87313c102b8118abd57371afab34618bf7350ed3" + integrity sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ== + any-observable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== -anymatch@~3.1.1, anymatch@~3.1.2: +anymatch@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== + dependencies: + micromatch "^2.1.5" + normalize-path "^2.0.0" + +anymatch@~3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== @@ -1334,16 +1626,46 @@ arg@^4.1.0: resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== -arg@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.0.tgz#a20e2bb5710e82950a516b3f933fee5ed478be90" - integrity sha512-4P8Zm2H+BRS+c/xX1LrHw0qKpEhdlZjLCgWy+d78T9vqa2Z2SiD2wMrYuWIAFy5IZUD7nnNXroRttz+0RzlrzQ== +arg@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.1.tgz#eb0c9a8f77786cad2af8ff2b862899842d7b6adb" + integrity sha512-e0hDa9H2Z9AwFkk2qDlwhoMYE4eToKarchkQHovNdLTCYMHZHeRjI71crOh+dio4K6u1IcwubQqo79Ga4CyAQA== argparse@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +aria-query@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" + integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== + dependencies: + "@babel/runtime" "^7.10.2" + "@babel/runtime-corejs3" "^7.10.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= + dependencies: + arr-flatten "^1.0.1" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + array-includes-with-glob@^3.0.6: version "3.1.0" resolved "https://registry.yarnpkg.com/array-includes-with-glob/-/array-includes-with-glob-3.1.0.tgz#f04e8172f231ab8261e52bfe9756b65c08b87ab9" @@ -1352,64 +1674,75 @@ array-includes-with-glob@^3.0.6: "@babel/runtime" "^7.14.0" matcher "^4.0.0" +array-includes@^3.1.3, array-includes@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9" + integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + get-intrinsic "^1.1.1" + is-string "^1.0.7" + array-union@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== -array.prototype.flatmap@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.4.tgz#94cfd47cc1556ec0747d97f7c7738c58122004c9" - integrity sha512-r9Z0zYoxqHz60vvQbWEdXIEtCwHF0yxaWfno9qzXeNHvfyl3BZqygmGzb84dsubyaXLH4husF+NFgMSdpZhk2Q== +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +array.prototype.flat@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz#07e0975d84bbc7c48cd1879d609e682598d33e13" + integrity sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + +array.prototype.flatmap@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.5.tgz#908dc82d8a406930fdf38598d51e7411d18d4446" + integrity sha512-08u6rVyi1Lj7oqWbS9nUxliETrtIROT4XGTA4D/LWGten6E3ocm7cy9SIrmNHOL5XVbVuckUp3X6Xyg8/zpvHA== dependencies: call-bind "^1.0.0" define-properties "^1.1.3" - es-abstract "^1.18.0-next.1" - function-bind "^1.1.1" + es-abstract "^1.19.0" asap@~2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= -asn1.js@^5.2.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" - integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - safer-buffer "^2.1.0" +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -assert@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/assert/-/assert-2.0.0.tgz#95fc1c616d48713510680f2eaf2d10dd22e02d32" - integrity sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A== - dependencies: - es6-object-assign "^1.1.0" - is-nan "^1.2.1" - object-is "^1.0.1" - util "^0.12.0" - -assert@^1.1.1: - version "1.5.0" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" - integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== - dependencies: - object-assign "^4.1.1" - util "0.10.3" - -ast-types@0.13.2: - version "0.13.2" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.2.tgz#df39b677a911a83f3a049644fb74fdded23cea48" - integrity sha512-uWMHxJxtfj/1oZClOxDEV1sQ1HCDkA4MG8Gr69KKeBjEVH0R84WlejZ0y2DcwyBlpAEMltmVYkVgqfLFb2oyiA== +ast-types-flow@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= astral-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +async-each@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" + integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + async-retry@1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.2.3.tgz#a6521f338358d322b1a0012b79030c6f411d1ce0" @@ -1417,52 +1750,56 @@ async-retry@1.2.3: dependencies: retry "0.12.0" -async-retry@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.1.tgz#139f31f8ddce50c0870b0ba558a6079684aaed55" - integrity sha512-aiieFW/7h3hY0Bq5d+ktDBejxuwR78vRu9hDUdR8rNhSaQ29VzPL4AoIRG7D/c7tdenwOcKvgPM6tIxB3cB6HA== +async-retry@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" + integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw== dependencies: - retry "0.12.0" + retry "0.13.1" asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= +atob@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + auto-bind@~4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-4.0.0.tgz#e3589fc6c2da8f7ca43ba9f84fa52a744fc997fb" integrity sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ== -autoprefixer@^10.2.6: - version "10.2.6" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.2.6.tgz#aadd9ec34e1c98d403e01950038049f0eb252949" - integrity sha512-8lChSmdU6dCNMCQopIf4Pe5kipkAGj/fvTMslCsih0uHpOrXOPUEVOmYMMqmw3cekQkSD7EhIeuYl5y0BLdKqg== +autoprefixer@^10.4.2: + version "10.4.2" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.2.tgz#25e1df09a31a9fba5c40b578936b90d35c9d4d3b" + integrity sha512-9fOPpHKuDW1w/0EKfRmVnxTDt8166MAnLI3mgZ1JCnhNtYWxcJ6Ud5CO/AVOZi/AvFa8DY9RTy3h3+tFBlrrdQ== dependencies: - browserslist "^4.16.6" - caniuse-lite "^1.0.30001230" - colorette "^1.2.2" - fraction.js "^4.1.1" + browserslist "^4.19.1" + caniuse-lite "^1.0.30001297" + fraction.js "^4.1.2" normalize-range "^0.1.2" - postcss-value-parser "^4.1.0" + picocolors "^1.0.0" + postcss-value-parser "^4.2.0" -autoprefixer@^9.6.1: - version "9.8.6" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.8.6.tgz#3b73594ca1bf9266320c5acf1588d74dea74210f" - integrity sha512-XrvP4VVHdRBCdX1S3WXVD8+RyG9qeb1D5Sn1DeLiG2xfSpzellk5k54xbUERJ3M5DggQxes39UGOTP8CFrEGbg== +axe-core@^4.3.5: + version "4.4.1" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.1.tgz#7dbdc25989298f9ad006645cd396782443757413" + integrity sha512-gd1kmb21kwNuWr6BQz8fv6GNECPBnUasepcoLbekws23NVBLODdsClRZ+bQ8+9Uomf3Sm3+Vwn0oYG9NvwnJCw== + +axios@^0.21.1: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== dependencies: - browserslist "^4.12.0" - caniuse-lite "^1.0.30001109" - colorette "^1.2.1" - normalize-range "^0.1.2" - num2fraction "^1.2.2" - postcss "^7.0.32" - postcss-value-parser "^4.1.0" + follow-redirects "^1.14.0" -available-typed-arrays@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.4.tgz#9e0ae84ecff20caae6a94a1c3bc39b955649b7a9" - integrity sha512-SA5mXJWrId1TaQjfxUYghbqQ/hYioKmLJvPJyDuYRtXXenFNMjj4hSSt1Cf1xsuXSXrtxrVC5Ot4eU6cOtBDdA== +axobject-query@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" + integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA== babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" @@ -1471,17 +1808,12 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" -babel-plugin-syntax-jsx@6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" - integrity sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY= - babel-plugin-syntax-trailing-function-commas@^7.0.0-beta.0: version "7.0.0-beta.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-7.0.0-beta.0.tgz#aa213c1435e2bffeb6fca842287ef534ad05d5cf" integrity sha512-Xj9XuRuz3nTSbaTXWv3itLOcxyF4oPD8douBBmj7U9BBC6nEBYfyOJYQMf/8PJAFotC62UY5dFfIGEPr7WswzQ== -babel-preset-fbjs@^3.3.0: +babel-preset-fbjs@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/babel-preset-fbjs/-/babel-preset-fbjs-3.4.0.tgz#38a14e5a7a3b285a3f3a86552d650dca5cf6111c" integrity sha512-9ywCsCvo1ojrw0b+XYk7aFvTH6D9064t0RIL1rtMf3nsa02Xw41MS7sZw216Im35xj/UY0PDBQsa1brUDDF1Ow== @@ -1524,35 +1856,59 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base64-js@^1.0.2, base64-js@^1.3.1: +base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -big.js@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" - integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +binary-extensions@^1.0.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" + integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: - version "4.12.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== +bindings@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" -bn.js@^5.0.0, bn.js@^5.1.1: - version "5.2.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== +bl@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" -body-scroll-lock@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/body-scroll-lock/-/body-scroll-lock-3.1.5.tgz#c1392d9217ed2c3e237fee1e910f6cdd80b7aaec" - integrity sha512-Yi1Xaml0EvNA0OYWxXiYNqY24AfWkbA6w5vxE7GWxtKfzIbZM+Qw+aSmkgsbWzbHiy/RCSkUZBplVxTA+E4jJg== +bluebird@^3.5.0: + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== + +body-scroll-lock@^4.0.0-beta.0: + version "4.0.0-beta.0" + resolved "https://registry.yarnpkg.com/body-scroll-lock/-/body-scroll-lock-4.0.0-beta.0.tgz#4f78789d10e6388115c0460cd6d7d4dd2bbc4f7e" + integrity sha512-a7tP5+0Mw3YlUJcGAKUqIBkYYGlYxk2fnCasq/FUph1hadxlTRjF+gAcZksxANnaMnALjxEddmSi/H3OR8ugcQ== brace-expansion@^1.1.7: version "1.1.11" @@ -1562,6 +1918,31 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + braces@^3.0.1, braces@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -1569,82 +1950,16 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" -brorand@^1.0.1, brorand@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= - -browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== +browserslist@^4.17.5, browserslist@^4.19.1, browserslist@^4.19.3: + version "4.20.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.0.tgz#35951e3541078c125d36df76056e94738a52ebe9" + integrity sha512-bnpOoa+DownbciXj0jVGENf8VYQnE2LNWomhYuCsMmmx9Jd9lwq0WXODuwpSsp8AVdKM2/HorrzxAfbKvWTByQ== dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -browserify-cipher@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" - integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" - integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d" - integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog== - dependencies: - bn.js "^5.0.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.1.tgz#eaf4add46dd54be3bb3b36c0cf15abbeba7956c3" - integrity sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg== - dependencies: - bn.js "^5.1.1" - browserify-rsa "^4.0.1" - create-hash "^1.2.0" - create-hmac "^1.1.7" - elliptic "^6.5.3" - inherits "^2.0.4" - parse-asn1 "^5.1.5" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -browserify-zlib@0.2.0, browserify-zlib@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" - integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== - dependencies: - pako "~1.0.5" - -browserslist@4.16.6, browserslist@^4.12.0, browserslist@^4.16.6, browserslist@^4.6.4: - version "4.16.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" - integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== - dependencies: - caniuse-lite "^1.0.30001219" - colorette "^1.2.2" - electron-to-chromium "^1.3.723" + caniuse-lite "^1.0.30001313" + electron-to-chromium "^1.4.76" escalade "^3.1.1" - node-releases "^1.1.71" + node-releases "^2.0.2" + picocolors "^1.0.0" bser@2.1.1: version "2.1.1" @@ -1659,33 +1974,11 @@ buffer-equal-constant-time@1.0.1: integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= - -buffer@5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786" - integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - -buffer@^4.3.0: - version "4.9.2" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" - integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - isarray "^1.0.0" - -buffer@^5.7.0: +buffer@^5.5.0, buffer@^5.7.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -1693,15 +1986,20 @@ buffer@^5.7.0: base64-js "^1.3.1" ieee754 "^1.1.13" -builtin-status-codes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= - -bytes@3.1.0, bytes@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" cacheable-request@^6.0.0: version "6.1.0" @@ -1729,7 +2027,7 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camel-case@4.1.2, camel-case@^4.1.2: +camel-case@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-4.1.2.tgz#9728072a954f805228225a6deea6b38461e1bd5a" integrity sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw== @@ -1747,10 +2045,10 @@ camelcase@^5.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001202, caniuse-lite@^1.0.30001219, caniuse-lite@^1.0.30001228, caniuse-lite@^1.0.30001230: - version "1.0.30001239" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001239.tgz#66e8669985bb2cb84ccb10f68c25ce6dd3e4d2b8" - integrity sha512-cyBkXJDMeI4wthy8xJ2FvDU6+0dtcZSJW3voUF8+e9f1bBeuvyZfc3PNbkOETyhbR+dGCPzn9E7MA3iwzusOhQ== +caniuse-lite@^1.0.30001283, caniuse-lite@^1.0.30001297, caniuse-lite@^1.0.30001313: + version "1.0.30001314" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001314.tgz#65c7f9fb7e4594fca0a333bec1d8939662377596" + integrity sha512-0zaSO+TnCHtHJIbpLroX7nsD+vYuOVjl3uzFbJO1wMVbuveJA0RK2WcQA9ZUIOiO0/ArMiMgHJLxfEZhQiC0kw== capital-case@^1.0.4: version "1.0.4" @@ -1761,23 +2059,6 @@ capital-case@^1.0.4: tslib "^2.0.3" upper-case-first "^2.0.2" -chalk@2.4.2, chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.0.0.tgz#6e98081ed2d17faab615eb52ac66ec1fe6209e72" - integrity sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - chalk@^1.0.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -1789,10 +2070,19 @@ chalk@^1.0.0, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" - integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== +chalk@^2.0.0, chalk@^2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" supports-color "^7.1.0" @@ -1836,25 +2126,26 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -chokidar@3.5.1: - version "3.5.1" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" - integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== +chokidar@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.5.0" + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" optionalDependencies: - fsevents "~2.3.1" + fsevents "^1.0.0" -chokidar@^3.5.1: - version "3.5.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== +chokidar@^3.5.2, chokidar@^3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: anymatch "~3.1.2" braces "~3.0.2" @@ -1866,23 +2157,15 @@ chokidar@^3.5.1: optionalDependencies: fsevents "~2.3.2" -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -classnames@2.2.6: - version "2.2.6" - resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce" - integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q== - -classnames@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e" - integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA== + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" clean-stack@^2.0.0: version "2.2.0" @@ -1903,6 +2186,11 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" +cli-spinners@^2.5.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d" + integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== + cli-truncate@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" @@ -1919,6 +2207,14 @@ cli-truncate@^2.1.0: slice-ansi "^3.0.0" string-width "^4.2.0" +cli-truncate@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-3.1.0.tgz#3f23ab12535e3d73e839bb43e73c9de487db1389" + integrity sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA== + dependencies: + slice-ansi "^5.0.0" + string-width "^5.0.0" + cli-width@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" @@ -1949,12 +2245,35 @@ clone-response@^1.0.2: dependencies: mimic-response "^1.0.0" +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= + +clor@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/clor/-/clor-5.2.0.tgz#9ddc74e7e86728cfcd05a80546ba58d317b81035" + integrity sha512-Z+jjxoF4lNUJQtsdz7d9HLz7yP49hnt4CH76AB7DLusHws14gOlVMl/ShtkMPfoFculqejaiQW5EG2Gt5/cCdg== + +clsx@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.1.1.tgz#98b3134f9abbdf23b2663491ace13c5c03a73188" + integrity sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA== + code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= -color-convert@^1.9.0, color-convert@^1.9.1: +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== @@ -1973,31 +2292,15 @@ color-name@1.1.3: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= -color-name@^1.0.0, color-name@~1.1.4: +color-name@^1.1.4, color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-string@^1.5.4: - version "1.5.5" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.5.tgz#65474a8f0e7439625f3d27a6a19d89fc45223014" - integrity sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg== - dependencies: - color-name "^1.0.0" - simple-swizzle "^0.2.2" - -color@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/color/-/color-3.1.3.tgz#ca67fb4e7b97d611dcde39eceed422067d91596e" - integrity sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ== - dependencies: - color-convert "^1.9.1" - color-string "^1.5.4" - -colorette@^1.2.1, colorette@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" - integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== +colorette@^2.0.16: + version "2.0.16" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" + integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== combined-stream@^1.0.8: version "1.0.8" @@ -2006,36 +2309,31 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" -commander@^6.0.0, commander@^6.2.0: +commander@^6.2.0: version "6.2.1" resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== -commander@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== +commander@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== -common-tags@1.8.0, common-tags@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937" - integrity sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw== +common-tags@1.8.2, common-tags@^1.8.0: + version "1.8.2" + resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6" + integrity sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA== -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -console-browserify@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" - integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== - constant-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-3.0.4.tgz#3b84a9aeaf4cf31ec45e6bf5de91bdfb0589faf1" @@ -2045,18 +2343,6 @@ constant-case@^3.0.4: tslib "^2.0.3" upper-case "^2.0.2" -constants-browserify@1.0.0, constants-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= - -convert-source-map@1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" - integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== - dependencies: - safe-buffer "~5.1.1" - convert-source-map@^1.7.0: version "1.8.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" @@ -2065,14 +2351,24 @@ convert-source-map@^1.7.0: safe-buffer "~5.1.1" cookie@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" - integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== + version "0.4.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js-pure@^3.20.2: + version "3.21.1" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.21.1.tgz#8c4d1e78839f5f46208de7230cebfb72bc3bdb51" + integrity sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ== core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + version "1.0.3" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== cosmiconfig-toml-loader@1.0.0: version "1.0.0" @@ -2081,10 +2377,10 @@ cosmiconfig-toml-loader@1.0.0: dependencies: "@iarna/toml" "^2.2.5" -cosmiconfig@7.0.0, cosmiconfig@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.0.tgz#ef9b44d773959cae63ddecd122de23853b60f8d3" - integrity sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA== +cosmiconfig@7.0.1, cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" + integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== dependencies: "@types/parse-json" "^4.0.0" import-fresh "^3.2.1" @@ -2092,57 +2388,19 @@ cosmiconfig@7.0.0, cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -create-ecdh@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" - integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== - dependencies: - bn.js "^4.1.0" - elliptic "^6.5.3" - -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - create-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-fetch@3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c" - integrity sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ== +cross-fetch@^3.0.6, cross-fetch@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" + integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== dependencies: - node-fetch "2.6.1" + node-fetch "2.6.7" -cross-fetch@3.1.4, cross-fetch@^3.0.4, cross-fetch@^3.0.6: - version "3.1.4" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" - integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== - dependencies: - node-fetch "2.6.1" - -cross-spawn@^7.0.3: +cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -2151,93 +2409,56 @@ cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -crypto-browserify@3.12.0, crypto-browserify@^3.11.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== +cross-undici-fetch@^0.1.19: + version "0.1.25" + resolved "https://registry.yarnpkg.com/cross-undici-fetch/-/cross-undici-fetch-0.1.25.tgz#8c6826dd0ffbb45fcb1a554be5984e0eaef7f3ba" + integrity sha512-KS6hm/VuRO+3jIrg4uidz3mQ8NWvCbiTTOg3yoH30zuGVUvjqZlnXw66h0kuzyfP21hDkrdIbufXCW6BAQdSNw== dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" + abort-controller "^3.0.0" + form-data-encoder "^1.7.1" + formdata-node "^4.3.1" + node-fetch "^2.6.7" + undici "^4.9.3" + web-streams-polyfill "^3.2.0" -css-blank-pseudo@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/css-blank-pseudo/-/css-blank-pseudo-0.1.4.tgz#dfdefd3254bf8a82027993674ccf35483bfcb3c5" - integrity sha512-LHz35Hr83dnFeipc7oqFDmsjHdljj3TQtxGGiNWSOsTLIAubSm4TEz8qCaKFpk7idaQ1GfWscF4E6mgpBysA1w== +css-blank-pseudo@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/css-blank-pseudo/-/css-blank-pseudo-3.0.3.tgz#36523b01c12a25d812df343a32c322d2a2324561" + integrity sha512-VS90XWtsHGqoM0t4KpH053c4ehxZ2E6HtGI7x68YFV0pTo/QmkV/YFA+NnlvK8guxZVNWGQhVNJGC39Q8XF4OQ== dependencies: - postcss "^7.0.5" + postcss-selector-parser "^6.0.9" -css-has-pseudo@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/css-has-pseudo/-/css-has-pseudo-0.10.0.tgz#3c642ab34ca242c59c41a125df9105841f6966ee" - integrity sha512-Z8hnfsZu4o/kt+AuFzeGpLVhFOGO9mluyHBaA2bA8aCGTwah5sT3WV/fTHH8UNZUytOIImuGPrl/prlb4oX4qQ== +css-has-pseudo@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/css-has-pseudo/-/css-has-pseudo-3.0.4.tgz#57f6be91ca242d5c9020ee3e51bbb5b89fc7af73" + integrity sha512-Vse0xpR1K9MNlp2j5w1pgWIJtm1a8qS0JwS9goFYcImjlHEmywP9VUF05aGBXzGpDJF86QXk4L0ypBmwPhGArw== dependencies: - postcss "^7.0.6" - postcss-selector-parser "^5.0.0-rc.4" + postcss-selector-parser "^6.0.9" -css-prefers-color-scheme@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/css-prefers-color-scheme/-/css-prefers-color-scheme-3.1.1.tgz#6f830a2714199d4f0d0d0bb8a27916ed65cff1f4" - integrity sha512-MTu6+tMs9S3EUqzmqLXEcgNRbNkkD/TGFvowpeoWJn5Vfq7FMgsmRQs9X5NXAURiOBmOxm/lLjsDNXDE6k9bhg== - dependencies: - postcss "^7.0.5" +css-prefers-color-scheme@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/css-prefers-color-scheme/-/css-prefers-color-scheme-6.0.3.tgz#ca8a22e5992c10a5b9d315155e7caee625903349" + integrity sha512-4BqMbZksRkJQx2zAjrokiGMd07RqOa2IxIrrN10lyBe9xhn9DEvjUK79J6jkeiv9D9hQFXKb6g1jwU62jziJZA== -css-unit-converter@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/css-unit-converter/-/css-unit-converter-1.1.2.tgz#4c77f5a1954e6dbff60695ecb214e3270436ab21" - integrity sha512-IiJwMC8rdZE0+xiEZHeru6YoONC4rfPMqGm2W85jMIbkFvv5nFTwJVFHam2eFrN6txmoUYFAFXiv8ICVeTO0MA== - -css.escape@1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb" - integrity sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s= - -cssdb@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/cssdb/-/cssdb-4.4.0.tgz#3bf2f2a68c10f5c6a08abd92378331ee803cddb0" - integrity sha512-LsTAR1JPEM9TpGhl/0p3nQecC2LJ0kD8X5YARu1hk/9I1gril5vDtMZyNxcEpxxDj34YNck/ucjuoUd66K03oQ== - -cssesc@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-2.0.0.tgz#3b13bd1bb1cb36e1bcb5a4dcd27f54c5dcb35703" - integrity sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg== +cssdb@^6.4.0: + version "6.4.1" + resolved "https://registry.yarnpkg.com/cssdb/-/cssdb-6.4.1.tgz#a2b5955e3283d8df6b6bb86e4107fedaeec1521b" + integrity sha512-R70R/Q1fPlM1D6Y+Kpat0QjiY+aMsY2/8lekdVoYcJ7ZQs9kw71W78FdOMf8DFq975KHQf1089PNg1dLsbAhoA== cssesc@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -cssnano-preset-simple@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/cssnano-preset-simple/-/cssnano-preset-simple-2.0.0.tgz#b55e72cb970713f425560a0e141b0335249e2f96" - integrity sha512-HkufSLkaBJbKBFx/7aj5HmCK9Ni/JedRQm0mT2qBzMG/dEuJOLnMt2lK6K1rwOOyV4j9aSY+knbW9WoS7BYpzg== - dependencies: - caniuse-lite "^1.0.30001202" - -cssnano-simple@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/cssnano-simple/-/cssnano-simple-2.0.0.tgz#930d9dcd8ba105c5a62ce719cb00854da58b5c05" - integrity sha512-0G3TXaFxlh/szPEG/o3VcmCwl0N3E60XNb9YZZijew5eIs6fLjJuOPxQd9yEBaX2p/YfJtt49i4vYi38iH6/6w== - dependencies: - cssnano-preset-simple "^2.0.0" - csstype@^3.0.2: - version "3.0.8" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.8.tgz#d2266a792729fb227cd216fb572f43728e1ad340" - integrity sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw== + version "3.0.11" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.11.tgz#d66700c5eacfac1940deb4e3ee5642792d85cd33" + integrity sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw== -data-uri-to-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636" - integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== +damerau-levenshtein@^1.0.7: + version "1.0.8" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" + integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== dataloader@2.0.0: version "2.0.0" @@ -2249,33 +2470,26 @@ date-fns@^1.27.2: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== -debounce@^1.2.0: +debounce@^1.2.0, debounce@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.1.tgz#38881d8f4166a5c5848020c11827b834bcb3e0a5" integrity sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug== -debug@2: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3: + version "4.3.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" + integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== + dependencies: + ms "2.1.2" + +debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -debug@4, debug@^4.1.0, debug@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== - dependencies: - ms "2.1.2" - -debug@^3.1.0: +debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== @@ -2287,6 +2501,11 @@ decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + decompress-response@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" @@ -2294,21 +2513,28 @@ decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" -dedent@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= - deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + deepmerge@4.2.2, deepmerge@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== +defaults@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= + dependencies: + clone "^1.0.2" + defer-to-connect@^1.0.1: version "1.1.3" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" @@ -2321,6 +2547,28 @@ define-properties@^1.1.3: dependencies: object-keys "^1.0.12" +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + defined@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" @@ -2331,7 +2579,7 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= -depd@~1.1.2: +depd@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= @@ -2341,19 +2589,6 @@ dependency-graph@^0.11.0: resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.11.0.tgz#ac0ce7ed68a54da22165a85e97a01d53f5eb2e27" integrity sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg== -dequal@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.2.tgz#85ca22025e3a87e65ef75a7a437b35284a7e319d" - integrity sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug== - -des.js@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" - integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - detect-indent@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" @@ -2368,25 +2603,16 @@ detective@^5.2.0: defined "^1.0.0" minimist "^1.1.1" -didyoumean@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.1.tgz#e92edfdada6537d484d73c0172fd1eba0c4976ff" - integrity sha1-6S7f2tplN9SE1zwBcv0eugxJdv8= +didyoumean@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.2.tgz#989346ffe9e839b4555ecf5666edea0d3e8ad037" + integrity sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw== diff@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -diffie-hellman@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -2399,15 +2625,19 @@ dlv@^1.1.3: resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79" integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA== -domain-browser@4.19.0: - version "4.19.0" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-4.19.0.tgz#1093e17c0a17dbd521182fe90d49ac1370054af1" - integrity sha512-fRA+BaAWOR/yr/t7T9E9GJztHPeFjj8U35ajyAjCDtAAnTn1Rc1f6W6VGPJrO1tkQv9zWu+JRof7z6oQtiYVFQ== +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" -domain-browser@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" - integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" dot-case@^3.0.4: version "3.0.4" @@ -2417,10 +2647,20 @@ dot-case@^3.0.4: no-case "^3.0.4" tslib "^2.0.3" -dotenv@^8.2.0: - version "8.6.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" - integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== +dotenv@^12.0.3: + version "12.0.4" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-12.0.4.tgz#87e302cfddeef475fcaf9a617f7b44f80ac555bc" + integrity sha512-oWdqbSywffzH1l4WXKPHWA0TWYpqp7IyLfqjipT4upoIFS0HPMqtNotykQpD4iIg0BqtNmdgPCh2WMvMt7yTiw== + +dotenv@^16.0.0: + version "16.0.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.0.tgz#c619001253be89ebb638d027b609c75c26e47411" + integrity sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q== + +dset@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.1.tgz#07de5af7a8d03eab337ad1a8ba77fe17bba61a8c" + integrity sha512-hYf+jZNNqJBD2GiMYb+5mqOIX4R4RRHXU3qWMWYN+rqcR2/YpRL2bUHr8C8fU+5DNvqYjJ8YvMGSLuVPWU1cNg== duplexer3@^0.1.4: version "0.1.4" @@ -2432,6 +2672,11 @@ duplexer@^0.1.2: resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + ecdsa-sig-formatter@1.0.11: version "1.0.11" resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" @@ -2439,29 +2684,16 @@ ecdsa-sig-formatter@1.0.11: dependencies: safe-buffer "^5.0.1" -electron-to-chromium@^1.3.723: - version "1.3.755" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.755.tgz#4b6101f13de910cf3f0a1789ddc57328133b9332" - integrity sha512-BJ1s/kuUuOeo1bF/EM2E4yqW9te0Hpof3wgwBx40AWJE18zsD1Tqo0kr7ijnOc+lRsrlrqKPauJAHqaxOItoUA== +electron-to-chromium@^1.4.76: + version "1.4.78" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.78.tgz#7a1cf853efafde2c4cf6e86facf3e5792d3541a5" + integrity sha512-o61+D/Lx7j/E0LIin/efOqeHpXhwi1TaQco9vUcRmr91m25SfZY6L5hWJDv/r+6kNjboFKgBw1LbfM0lbhuK6Q== elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= -elliptic@^6.5.3: - version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - email-validator@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/email-validator/-/email-validator-2.0.4.tgz#b8dfaa5d0dae28f1b03c95881d904d4e40bfe7ed" @@ -2472,17 +2704,10 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= - -encoding@0.1.13: - version "0.1.13" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" - integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== - dependencies: - iconv-lite "^0.6.2" +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== end-of-stream@^1.1.0: version "1.4.4" @@ -2491,13 +2716,6 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enquirer@^2.3.6: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -2505,22 +2723,26 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2: - version "1.18.3" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.3.tgz#25c4c3380a27aa203c44b2b685bba94da31b63e0" - integrity sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw== +es-abstract@^1.19.0, es-abstract@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" + integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== dependencies: call-bind "^1.0.2" es-to-primitive "^1.2.1" function-bind "^1.1.1" get-intrinsic "^1.1.1" + get-symbol-description "^1.0.0" has "^1.0.3" has-symbols "^1.0.2" - is-callable "^1.2.3" + internal-slot "^1.0.3" + is-callable "^1.2.4" is-negative-zero "^2.0.1" - is-regex "^1.1.3" - is-string "^1.0.6" - object-inspect "^1.10.3" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.1" + is-string "^1.0.7" + is-weakref "^1.0.1" + object-inspect "^1.11.0" object-keys "^1.1.1" object.assign "^4.1.2" string.prototype.trimend "^1.0.4" @@ -2536,11 +2758,6 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -es6-object-assign@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c" - integrity sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw= - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -2556,16 +2773,214 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +eslint-config-next@^12.0.8: + version "12.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-12.1.0.tgz#8ace680dc5207e6ab6c915f3989adec122f582e7" + integrity sha512-tBhuUgoDITcdcM7xFvensi9I5WTI4dnvH4ETGRg1U8ZKpXrZsWQFdOKIDzR3RLP5HR3xXrLviaMM4c3zVoE/pA== + dependencies: + "@next/eslint-plugin-next" "12.1.0" + "@rushstack/eslint-patch" "^1.0.8" + "@typescript-eslint/parser" "^5.0.0" + eslint-import-resolver-node "^0.3.4" + eslint-import-resolver-typescript "^2.4.0" + eslint-plugin-import "^2.25.2" + eslint-plugin-jsx-a11y "^6.5.1" + eslint-plugin-react "^7.27.0" + eslint-plugin-react-hooks "^4.3.0" + +eslint-config-prettier@^8.3.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1" + integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q== + +eslint-import-resolver-node@^0.3.4, eslint-import-resolver-node@^0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" + integrity sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw== + dependencies: + debug "^3.2.7" + resolve "^1.20.0" + +eslint-import-resolver-typescript@^2.4.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.5.0.tgz#07661966b272d14ba97f597b51e1a588f9722f0a" + integrity sha512-qZ6e5CFr+I7K4VVhQu3M/9xGv9/YmwsEXrsm3nimw8vWaVHRDrQRp26BgCypTxBp3vUp4o5aVEJRiy0F2DFddQ== + dependencies: + debug "^4.3.1" + glob "^7.1.7" + is-glob "^4.0.1" + resolve "^1.20.0" + tsconfig-paths "^3.9.0" + +eslint-module-utils@^2.7.2: + version "2.7.3" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz#ad7e3a10552fdd0642e1e55292781bd6e34876ee" + integrity sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ== + dependencies: + debug "^3.2.7" + find-up "^2.1.0" + +eslint-plugin-import@^2.25.2: + version "2.25.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz#322f3f916a4e9e991ac7af32032c25ce313209f1" + integrity sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA== + dependencies: + array-includes "^3.1.4" + array.prototype.flat "^1.2.5" + debug "^2.6.9" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.6" + eslint-module-utils "^2.7.2" + has "^1.0.3" + is-core-module "^2.8.0" + is-glob "^4.0.3" + minimatch "^3.0.4" + object.values "^1.1.5" + resolve "^1.20.0" + tsconfig-paths "^3.12.0" + +eslint-plugin-jsx-a11y@^6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.5.1.tgz#cdbf2df901040ca140b6ec14715c988889c2a6d8" + integrity sha512-sVCFKX9fllURnXT2JwLN5Qgo24Ug5NF6dxhkmxsMEUZhXRcGg+X3e1JbJ84YePQKBl5E0ZjAH5Q4rkdcGY99+g== + dependencies: + "@babel/runtime" "^7.16.3" + aria-query "^4.2.2" + array-includes "^3.1.4" + ast-types-flow "^0.0.7" + axe-core "^4.3.5" + axobject-query "^2.2.0" + damerau-levenshtein "^1.0.7" + emoji-regex "^9.2.2" + has "^1.0.3" + jsx-ast-utils "^3.2.1" + language-tags "^1.0.5" + minimatch "^3.0.4" + +eslint-plugin-react-hooks@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.3.0.tgz#318dbf312e06fab1c835a4abef00121751ac1172" + integrity sha512-XslZy0LnMn+84NEG9jSGR6eGqaZB3133L8xewQo3fQagbQuGt7a63gf+P1NGKZavEYEC3UXaWEAA/AqDkuN6xA== + +eslint-plugin-react@^7.27.0: + version "7.29.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.29.3.tgz#f4eab757f2756d25d6d4c2a58a9e20b004791f05" + integrity sha512-MzW6TuCnDOcta67CkpDyRfRsEVx9FNMDV8wZsDqe1luHPdGTrQIUaUXD27Ja3gHsdOIs/cXzNchWGlqm+qRVRg== + dependencies: + array-includes "^3.1.4" + array.prototype.flatmap "^1.2.5" + doctrine "^2.1.0" + estraverse "^5.3.0" + jsx-ast-utils "^2.4.1 || ^3.0.0" + minimatch "^3.1.2" + object.entries "^1.1.5" + object.fromentries "^2.0.5" + object.hasown "^1.1.0" + object.values "^1.1.5" + prop-types "^15.8.1" + resolve "^2.0.0-next.3" + semver "^6.3.0" + string.prototype.matchall "^4.0.6" + +eslint-scope@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" + integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + +eslint@^8.6.0: + version "8.10.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.10.0.tgz#931be395eb60f900c01658b278e05b6dae47199d" + integrity sha512-tcI1D9lfVec+R4LE1mNDnzoJ/f71Kl/9Cv4nG47jOueCMBrCCKYXr4AUVS7go6mWYGFD4+EoN6+eXSrEbRzXVw== + dependencies: + "@eslint/eslintrc" "^1.2.0" + "@humanwhocodes/config-array" "^0.9.2" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.1" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.3.0" + espree "^9.3.1" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^6.0.1" + globals "^13.6.0" + ignore "^5.2.0" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.0.4" + natural-compare "^1.4.0" + optionator "^0.9.1" + regexpp "^3.2.0" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + +espree@^9.3.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.1.tgz#8793b4bc27ea4c778c19908e0719e7b8f4115bcd" + integrity sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ== + dependencies: + acorn "^8.7.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^3.3.0" + +esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -etag@1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - event-target-shim@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" @@ -2576,20 +2991,7 @@ eventemitter3@^3.1.0: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== -events@^3.0.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" - integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== - -evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -execa@^5.0.0: +execa@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== @@ -2604,6 +3006,48 @@ execa@^5.0.0: signal-exit "^3.0.3" strip-final-newline "^2.0.0" +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= + dependencies: + is-posix-bracket "^0.1.0" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= + dependencies: + fill-range "^2.1.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + external-editor@^3.0.3: version "3.1.0" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" @@ -2613,27 +3057,67 @@ external-editor@^3.0.3: iconv-lite "^0.4.24" tmp "^0.0.33" -extract-files@9.0.0, extract-files@^9.0.0: +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= + dependencies: + is-extglob "^1.0.0" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extract-files@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/extract-files/-/extract-files-11.0.0.tgz#b72d428712f787eef1f5193aff8ab5351ca8469a" + integrity sha512-FuoE1qtbJ4bBVvv94CC7s0oTnKUGvQs+Rjf1L2SJFfS+HTVVjhPFtehPdQ0JiGPqVNfSSZvL5yzHHQq2Z4WNhQ== + +extract-files@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/extract-files/-/extract-files-9.0.0.tgz#8a7744f2437f81f5ed3250ed9f1550de902fe54a" integrity sha512-CvdFfHkC95B4bBBk36hcEmvdR2awOdhhVUYH6S/zrVj3477zven/fJMYg7121h4T1xHZC+tetUpubpAhxwI7hQ== -fast-glob@^3.1.1, fast-glob@^3.2.5: - version "3.2.5" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" - integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg== +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-glob@^3.2.11, fast-glob@^3.2.9: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.0" + glob-parent "^5.1.2" merge2 "^1.3.0" - micromatch "^4.0.2" - picomatch "^2.2.1" + micromatch "^4.0.4" + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fastq@^1.6.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.0.tgz#bb9fb955a07130a918eb63c1f5161cc32a5d0858" - integrity sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g== + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== dependencies: reusify "^1.0.4" @@ -2650,17 +3134,17 @@ fbjs-css-vars@^1.0.0: integrity sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ== fbjs@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-3.0.0.tgz#0907067fb3f57a78f45d95f1eacffcacd623c165" - integrity sha512-dJd4PiDOFuhe7vk4F80Mba83Vr2QuK86FoxtgPmzBqEJahncp+13YCmfoa53KHCo6OnlXLG7eeMWPfB5CrpVKg== + version "3.0.4" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-3.0.4.tgz#e1871c6bd3083bac71ff2da868ad5067d37716c6" + integrity sha512-ucV0tDODnGV3JCnnkmoszb5lf4bNpzjv80K41wd4k798Etq+UYD0y0TIfalLjZoKgjive6/adkRnszwapiDgBQ== dependencies: - cross-fetch "^3.0.4" + cross-fetch "^3.1.5" fbjs-css-vars "^1.0.0" loose-envify "^1.0.0" object-assign "^4.1.0" promise "^7.1.1" setimmediate "^1.0.5" - ua-parser-js "^0.7.18" + ua-parser-js "^0.7.30" figures@^1.7.0: version "1.7.0" @@ -2684,6 +3168,44 @@ figures@^3.0.0: dependencies: escape-string-regexp "^1.0.5" +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -2691,16 +3213,14 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -find-cache-dir@3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" - integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= dependencies: - commondir "^1.0.1" - make-dir "^3.0.2" - pkg-dir "^4.1.0" + locate-path "^2.0.0" -find-up@^4.0.0, find-up@^4.1.0: +find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -2708,24 +3228,40 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -flatten@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.3.tgz#c1283ac9f27b368abc1e36d1ff7b04501a30356b" - integrity sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg== - -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= - -form-data@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + version "3.2.5" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" + integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== + +follow-redirects@^1.14.0: + version "1.14.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" + integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== + +for-in@^1.0.1, for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= + dependencies: + for-in "^1.0.1" + +form-data-encoder@^1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.1.tgz#ac80660e4f87ee0d3d3c3638b7da8278ddb8ec96" + integrity sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg== form-data@^3.0.0: version "3.0.1" @@ -2736,26 +3272,40 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -fraction.js@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.1.1.tgz#ac4e520473dae67012d618aab91eda09bcb400ff" - integrity sha512-MHOhvvxHTfRFpF1geTK9czMIZ6xclsEor2wkIGYYq+PxcQqT7vStJqjhe6S1TenZrMZzo+wlqOufBDVepUEgPg== - -fs-extra@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" - integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== +formdata-node@^4.3.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/formdata-node/-/formdata-node-4.3.2.tgz#0262e94931e36db7239c2b08bdb6aaf18ec47d21" + integrity sha512-k7lYJyzDOSL6h917favP8j1L0/wNyylzU+x+1w4p5haGVHNlP58dbpdJhiCUsDbWsa9HwEtLp89obQgXl2e0qg== dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" + node-domexception "1.0.0" + web-streams-polyfill "4.0.0-beta.1" + +fraction.js@^4.1.2: + version "4.2.0" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.2.0.tgz#448e5109a313a3527f5a3ab2119ec4cf0e0e2950" + integrity sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA== + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@~2.3.1, fsevents@~2.3.2: +fsevents@^1.0.0: + version "1.2.13" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" + integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== + dependencies: + bindings "^1.5.0" + nan "^2.12.1" + +fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -2765,6 +3315,11 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -2775,7 +3330,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== @@ -2784,18 +3339,6 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.1" -get-orientation@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/get-orientation/-/get-orientation-1.1.2.tgz#20507928951814f8a91ded0a0e67b29dfab98947" - integrity sha512-/pViTfifW+gBbh/RnlFYHINvELT9Znt+SYyDKAUL6uV6By019AK/s+i9XP4jSwq7lwP38Fd8HVeTxym3+hkwmQ== - dependencies: - stream-parser "^0.3.1" - -get-own-enumerable-property-symbols@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" - integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g== - get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -2815,26 +3358,49 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -glob-parent@^5.1.0, glob-parent@~5.1.0, glob-parent@~5.1.2: +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= + dependencies: + is-glob "^2.0.0" + +glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" -glob-parent@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.0.tgz#f851b59b388e788f3a44d63fab50382b2859c33c" - integrity sha512-Hdd4287VEJcZXUwv1l8a+vXC1GjOQqXe+VS30w/ypihpcnu9M1n3xeYeJu5CBpeEQj2nAab2xxz28GuA3vp4Ww== +glob-parent@^6.0.1, glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== dependencies: - is-glob "^4.0.1" + is-glob "^4.0.3" -glob-to-regexp@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" - integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== - -glob@^7.0.0, glob@^7.1.1, glob@^7.1.3, glob@^7.1.6: +glob@7.1.7: version "7.1.7" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== @@ -2846,21 +3412,40 @@ glob@^7.0.0, glob@^7.1.1, glob@^7.1.3, glob@^7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.6, glob@^7.1.7: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globby@11.0.3: - version "11.0.3" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb" - integrity sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg== +globals@^13.6.0, globals@^13.9.0: + version "13.12.1" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.12.1.tgz#ec206be932e6c77236677127577aa8e50bf1c5cb" + integrity sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw== + dependencies: + type-fest "^0.20.2" + +globby@^11.0.3, globby@^11.0.4: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" slash "^3.0.0" got@^9.6.0: @@ -2880,53 +3465,58 @@ got@^9.6.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: - version "4.2.6" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" - integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== +graceful-fs@^4.1.11: + version "4.2.9" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" + integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== -graphql-config@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/graphql-config/-/graphql-config-3.3.0.tgz#24c3672a427cb67c0c717ca3b9d70e9f0c9e752b" - integrity sha512-mSQIsPMssr7QrgqhnjI+CyVH6oQgCrgS6irHsTvwf7RFDRnR2k9kqpQOQgVoOytBSn0DOYryS0w0SAg9xor/Jw== +graphql-config@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/graphql-config/-/graphql-config-4.1.0.tgz#a3b28d3fb537952ebeb69c75e4430605a10695e3" + integrity sha512-Myqay6pmdcmX3KqoH+bMbeKZ1cTODpHS2CxF1ZzNnfTE+YUpGTcp01bOw6LpzamRb0T/WTYtGFbZeXGo9Hab2Q== dependencies: "@endemolshinegroup/cosmiconfig-typescript-loader" "3.0.2" - "@graphql-tools/graphql-file-loader" "^6.0.0" - "@graphql-tools/json-file-loader" "^6.0.0" - "@graphql-tools/load" "^6.0.0" - "@graphql-tools/merge" "^6.0.0" - "@graphql-tools/url-loader" "^6.0.0" - "@graphql-tools/utils" "^7.0.0" - cosmiconfig "7.0.0" + "@graphql-tools/graphql-file-loader" "^7.3.2" + "@graphql-tools/json-file-loader" "^7.3.2" + "@graphql-tools/load" "^7.4.1" + "@graphql-tools/merge" "^8.2.1" + "@graphql-tools/url-loader" "^7.4.2" + "@graphql-tools/utils" "^8.5.1" + cosmiconfig "7.0.1" cosmiconfig-toml-loader "1.0.0" minimatch "3.0.4" string-env-interpolation "1.0.1" -graphql-request@^3.3.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-3.4.0.tgz#3a400cd5511eb3c064b1873afb059196bbea9c2b" - integrity sha512-acrTzidSlwAj8wBNO7Q/UQHS8T+z5qRGquCQRv9J1InwR01BBWV9ObnoE+JS5nCCEj8wSGS0yrDXVDoRiKZuOg== +graphql-executor@0.0.18: + version "0.0.18" + resolved "https://registry.yarnpkg.com/graphql-executor/-/graphql-executor-0.0.18.tgz#6aa4b39e1ca773e159c2a602621e90606df0109a" + integrity sha512-upUSl7tfZCZ5dWG1XkOvpG70Yk3duZKcCoi/uJso4WxJVT6KIrcK4nZ4+2X/hzx46pL8wAukgYHY6iNmocRN+g== + +graphql-request@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-4.0.0.tgz#5e4361d33df1a95ccd7ad23a8ebb6bbca9d5622f" + integrity sha512-cdqQLCXlBGkaLdkLYRl4LtkwaZU6TfpE7/tnUQFl3wXfUPWN74Ov+Q61VuIh+AltS789YfGB6whghmCmeXLvTw== dependencies: cross-fetch "^3.0.6" extract-files "^9.0.0" form-data "^3.0.0" +graphql-sse@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/graphql-sse/-/graphql-sse-1.1.0.tgz#05a8ea0528b4bde1c042caa5a7a63ef244bd3c56" + integrity sha512-xE8AGPJa5X+g7iFmRQw/8H+7lXIDJvSkW6lou/XSSq17opPQl+dbKOMiqraHMx52VrDgS061ZVx90OSuqS6ykA== + graphql-tag@^2.11.0: - version "2.12.4" - resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.4.tgz#d34066688a4f09e72d6f4663c74211e9b4b7c4bf" - integrity sha512-VV1U4O+9x99EkNpNmCUV5RZwq6MnK4+pGbRYWG+lA/m3uo7TSqJF81OkcOP148gFP6fzdl7JWYBrwWVTS9jXww== + version "2.12.6" + resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.6.tgz#d441a569c1d2537ef10ca3d1633b48725329b5f1" + integrity sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg== dependencies: tslib "^2.1.0" -graphql-ws@^4.4.1: - version "4.9.0" - resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-4.9.0.tgz#5cfd8bb490b35e86583d8322f5d5d099c26e365c" - integrity sha512-sHkK9+lUm20/BGawNEWNtVAeJzhZeBg21VmvmLoT5NdGVeZWv5PdIhkcayQIAgjSyyQ17WMKmbDijIPG2On+Ag== - -graphql@^15.5.1: - version "15.5.1" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.1.tgz#f2f84415d8985e7b84731e7f3536f8bb9d383aad" - integrity sha512-FeTRX67T3LoE3LWAxxOlW2K3Bz+rMYAC18rRguK4wgXaTZMiJwSUwDmPFo3UadAKbzirKIg5Qy+sNJXbpPRnQw== +graphql-ws@^5.4.1: + version "5.6.2" + resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.6.2.tgz#c7e5e382bd80d7fef637ea0b86ef4b1cb3d0b09b" + integrity sha512-TsjovINNEGfv52uKWYSVCOLX9LFe6wAhf9n7hIsV3zjflky1dv/mAP+kjXAXsnzV1jH5Sx0S73CtBFNvxus+SQ== gzip-size@^6.0.0: version "6.0.0" @@ -2958,9 +3548,47 @@ has-flag@^4.0.0: integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== has-symbols@^1.0.1, has-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" has@^1.0.3: version "1.0.3" @@ -2969,28 +3597,6 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -he@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - header-case@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/header-case/-/header-case-2.0.4.tgz#5a42e63b55177349cf405beb8d775acabb92c063" @@ -2999,50 +3605,20 @@ header-case@^2.0.4: capital-case "^1.0.4" tslib "^2.0.3" -hmac-drbg@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -html-tags@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.1.0.tgz#7b5e6f7e665e9fb41f30007ed9e0d41e97fb2140" - integrity sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg== - http-cache-semantics@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== -http-errors@1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" - integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== - dependencies: - "@tootallnate/once" "1" + "@tootallnate/once" "2" agent-base "6" debug "4" -https-browserify@1.0.0, https-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= - https-proxy-agent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" @@ -3063,41 +3639,32 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -husky@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-6.0.0.tgz#810f11869adf51604c32ea577edbc377d7f9319e" - integrity sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ== +husky@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535" + integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ== -iconv-lite@0.4.24, iconv-lite@^0.4.24: +iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@^0.6.2: - version "0.6.3" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== - dependencies: - safer-buffer ">= 2.1.2 < 3.0.0" - -ieee754@^1.1.13, ieee754@^1.1.4: +ieee754@^1.1.13: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore@^5.1.4: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -image-size@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/image-size/-/image-size-1.0.0.tgz#58b31fe4743b1cec0a0ac26f5c914d3c5b2f0750" - integrity sha512-JLJ6OwBfO1KcA+TvJT+v8gbE6iWbj24LyDNFgFEN0lzegn6cC6a/p3NIDaepMsJjQjlUWqIC7wJv8lBFxPNjcw== - dependencies: - queue "6.0.2" +ignore@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== immutability-helper@^3.1.1: version "3.1.1" @@ -3116,7 +3683,7 @@ import-cwd@^3.0.0: dependencies: import-from "^3.0.0" -import-fresh@^3.2.1: +import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -3124,13 +3691,23 @@ import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" -import-from@3.0.0, import-from@^3.0.0: +import-from@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/import-from/-/import-from-4.0.0.tgz#2710b8d66817d232e16f4166e319248d3d5492e2" + integrity sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ== + +import-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/import-from/-/import-from-3.0.0.tgz#055cfec38cd5a27d8057ca51376d7d3bf0891966" integrity sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ== dependencies: resolve-from "^5.0.0" +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + indent-string@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" @@ -3141,11 +3718,6 @@ indent-string@^4.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== -indexes-of@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" - integrity sha1-8w9xbI4r00bHtn0985FVZqfAVgc= - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -3154,45 +3726,52 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3, inherits@~2.0.4: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= - -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - ini@~1.3.0: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -inquirer@^7.3.3: - version "7.3.3" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" - integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== +inquirer@^8.0.0: + version "8.2.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.1.tgz#e00022e3e8930a92662f760f020686530a84671d" + integrity sha512-pxhBaw9cyTFMjwKtkjePWDhvwzvrNGAw7En4hottzlPvz80GZaMZthdDU35aA6/f5FRZf3uhE057q8w1DE3V2g== dependencies: ansi-escapes "^4.2.1" - chalk "^4.1.0" + chalk "^4.1.1" cli-cursor "^3.1.0" cli-width "^3.0.0" external-editor "^3.0.3" figures "^3.0.0" - lodash "^4.17.19" + lodash "^4.17.21" mute-stream "0.0.8" + ora "^5.4.1" run-async "^2.4.0" - rxjs "^6.6.0" + rxjs "^7.5.5" string-width "^4.1.0" strip-ansi "^6.0.0" through "^2.3.6" +internal-slot@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" + integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== + dependencies: + get-intrinsic "^1.1.0" + has "^1.0.3" + side-channel "^1.0.4" + +invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + is-absolute@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" @@ -3201,27 +3780,38 @@ is-absolute@^1.0.0: is-relative "^1.0.0" is-windows "^1.0.1" -is-arguments@^1.0.4: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9" - integrity sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg== +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= dependencies: - call-bind "^1.0.0" + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= -is-arrayish@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" - integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== - is-bigint@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a" - integrity sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA== + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + dependencies: + binary-extensions "^1.0.0" is-binary-path@~2.1.0: version "2.1.0" @@ -3231,28 +3821,97 @@ is-binary-path@~2.1.0: binary-extensions "^2.0.0" is-boolean-object@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.1.tgz#3c0878f035cb821228d350d2e1e36719716a3de8" - integrity sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng== + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== dependencies: call-bind "^1.0.2" + has-tostringtag "^1.0.0" -is-callable@^1.1.4, is-callable@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" - integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-core-module@^2.2.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1" - integrity sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A== +is-callable@^1.1.4, is-callable@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== + +is-core-module@^2.2.0, is-core-module@^2.8.0, is-core-module@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" + integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== dependencies: has "^1.0.3" +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + is-date-object@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5" - integrity sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A== + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= is-extglob@^2.1.1: version "2.1.1" @@ -3276,18 +3935,30 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-generator-function@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.9.tgz#e5f82c2323673e7fcad3d12858c83c4039f6399c" - integrity sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A== +is-fullwidth-code-point@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz#fae3167c729e7463f8461ce512b080a49268aa88" + integrity sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ== -is-glob@4.0.1, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== +is-glob@4.0.3, is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= + dependencies: + is-extglob "^1.0.0" + +is-interactive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" + integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== + is-lower-case@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/is-lower-case/-/is-lower-case-2.0.2.tgz#1c0884d3012c841556243483aa5d522f47396d2a" @@ -3295,34 +3966,42 @@ is-lower-case@^2.0.2: dependencies: tslib "^2.0.3" -is-nan@^1.2.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" - integrity sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - is-negative-zero@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" - integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== is-number-object@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.5.tgz#6edfaeed7950cff19afedce9fbfca9ee6dd289eb" - integrity sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw== + version "1.0.6" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" + integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== + dependencies: + has-tostringtag "^1.0.0" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-obj@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= - is-observable@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" @@ -3330,28 +4009,35 @@ is-observable@^1.1.0: dependencies: symbol-observable "^1.1.0" -is-promise@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-4.0.0.tgz#42ff9f84206c1991d26debf520dd5c01042dd2f3" - integrity sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ== +is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= is-promise@^2.1.0: version "2.2.2" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== -is-regex@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f" - integrity sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ== +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== dependencies: call-bind "^1.0.2" - has-symbols "^1.0.2" - -is-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" - integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= + has-tostringtag "^1.0.0" is-relative@^1.0.0: version "1.0.0" @@ -3360,20 +4046,27 @@ is-relative@^1.0.0: dependencies: is-unc-path "^1.0.0" +is-shared-array-buffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" + integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== + is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= is-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-string@^1.0.5, is-string@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f" - integrity sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w== +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" is-symbol@^1.0.2, is-symbol@^1.0.3: version "1.0.4" @@ -3382,17 +4075,6 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" -is-typed-array@^1.1.3: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.5.tgz#f32e6e096455e329eb7b423862456aa213f0eb4e" - integrity sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug== - dependencies: - available-typed-arrays "^1.0.2" - call-bind "^1.0.2" - es-abstract "^1.18.0-next.2" - foreach "^2.0.5" - has-symbols "^1.0.1" - is-unc-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" @@ -3412,12 +4094,19 @@ is-upper-case@^2.0.2: dependencies: tslib "^2.0.3" -is-windows@^1.0.1: +is-weakref@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + +is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== -isarray@^1.0.0, isarray@~1.0.0: +isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= @@ -3427,6 +4116,18 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + isomorphic-fetch@3.0.0, isomorphic-fetch@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4" @@ -3435,7 +4136,7 @@ isomorphic-fetch@3.0.0, isomorphic-fetch@^3.0.0: node-fetch "^2.6.1" whatwg-fetch "^3.4.1" -isomorphic-ws@4.0.1: +isomorphic-ws@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== @@ -3445,26 +4146,17 @@ iterall@^1.2.1: resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea" integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg== -jest-worker@27.0.0-next.5: - version "27.0.0-next.5" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.0-next.5.tgz#5985ee29b12a4e191f4aae4bb73b97971d86ec28" - integrity sha512-mk0umAQ5lT+CaOJ+Qp01N6kz48sJG2kr2n1rX0koqKf6FIygQV0qLOdN9SCYID4IVeSigDOcPeGLozdMLYfb5g== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^8.0.0" - -js-cookie@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" - integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== +js-cookie@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-3.0.1.tgz#9e39b4c6c2f56563708d7d31f6f5f21873a92414" + integrity sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw== "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^4.0.0: +js-yaml@^4.0.0, js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== @@ -3486,6 +4178,16 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" @@ -3515,15 +4217,6 @@ json5@^2.1.2: dependencies: minimist "^1.2.5" -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" @@ -3545,6 +4238,14 @@ jsonwebtoken@^8.5.1: ms "^2.1.1" semver "^5.6.0" +"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.2.1.tgz#720b97bfe7d901b927d87c3773637ae8ea48781b" + integrity sha512-uP5vu8xfy2F9A6LGC22KO7e2/vGTS1MhP+18f++ZNlf0Ohaxbc9nIEwHAsejlJKyzfZzU5UIhe5ItYkitcZnZA== + dependencies: + array-includes "^3.1.3" + object.assign "^4.1.2" + jwa@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.4.1.tgz#743c32985cb9e98655530d53641b66c8645b039a" @@ -3562,10 +4263,10 @@ jws@^3.2.2: jwa "^1.4.1" safe-buffer "^5.0.1" -keen-slider@^5.5.1: - version "5.5.1" - resolved "https://registry.yarnpkg.com/keen-slider/-/keen-slider-5.5.1.tgz#1493f552eadf0f5b8229defd83c626eb6dd58c13" - integrity sha512-QXGZGt5Hbe0YufR/RYbOG03MmOk43RQEXqkkSvjr8ZS67sVR7LRp5RIvJALfjl+A7BnHNr1wd1QBOemwy65Lfw== +keen-slider@^6.6.3: + version "6.6.3" + resolved "https://registry.yarnpkg.com/keen-slider/-/keen-slider-6.6.3.tgz#b99eb61aa2c4f3cae5274a3424e2a010b26b7081" + integrity sha512-IDJh3CNeiCY/0N/ht+4/TUUD0plS064ijO8AcQ2sJXS07PhJOnv7kNUVsQdNh+t8Vmmy3sJ+sHNubSGdrEcMlQ== keyv@^3.0.0: version "3.1.0" @@ -3574,6 +4275,42 @@ keyv@^3.0.0: dependencies: json-buffer "3.0.0" +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +language-subtag-registry@~0.3.2: + version "0.3.21" + resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.21.tgz#04ac218bea46f04cb039084602c6da9e788dd45a" + integrity sha512-L0IqwlIXjilBVVYKFT37X9Ih11Um5NEl9cbJIuU/SwP/zEEAbBPOnEeeuxVMf45ydWQRDQN3Nqc96OgbH1K+Pg== + +language-tags@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.5.tgz#d321dbc4da30ba8bf3024e040fa5c14661f9193a" + integrity sha1-0yHbxNowuovzAk4ED6XBRmH5GTo= + dependencies: + language-subtag-registry "~0.3.2" + latest-version@5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" @@ -3581,36 +4318,42 @@ latest-version@5.1.0: dependencies: package-json "^6.3.0" -lilconfig@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.3.tgz#68f3005e921dafbd2a2afb48379986aa6d2579fd" - integrity sha512-EHKqr/+ZvdKCifpNrJCKxBTgk5XupZA3y/aCPY9mxfgBzmgh93Mt/WqjjQ38oMxXuvDokaKiM3lAgvSH2sjtHg== +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +lilconfig@2.0.4, lilconfig@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.4.tgz#f4507d043d7058b380b6a8f5cb7bcd4b34cee082" + integrity sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA== lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== -lint-staged@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-11.0.0.tgz#24d0a95aa316ba28e257f5c4613369a75a10c712" - integrity sha512-3rsRIoyaE8IphSUtO1RVTFl1e0SLBtxxUOPBtHxQgBHS5/i6nqvjcUfNioMa4BU9yGnPzbO+xkfLtXtxBpCzjw== +lint-staged@^12.1.7: + version "12.3.5" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-12.3.5.tgz#8048ce048c3cac12f57200a06344a54dc91c8fa9" + integrity sha512-oOH36RUs1It7b9U/C7Nl/a0sLfoIBcMB8ramiB3nuJ6brBqzsWiUAFSR5DQ3yyP/OR7XKMpijtgKl2DV1lQ3lA== dependencies: - chalk "^4.1.1" - cli-truncate "^2.1.0" - commander "^7.2.0" - cosmiconfig "^7.0.0" - debug "^4.3.1" - dedent "^0.7.0" - enquirer "^2.3.6" - execa "^5.0.0" - listr2 "^3.8.2" - log-symbols "^4.1.0" + cli-truncate "^3.1.0" + colorette "^2.0.16" + commander "^8.3.0" + debug "^4.3.3" + execa "^5.1.1" + lilconfig "2.0.4" + listr2 "^4.0.1" micromatch "^4.0.4" normalize-path "^3.0.0" - please-upgrade-node "^3.2.0" - string-argv "0.3.1" - stringify-object "^3.3.0" + object-inspect "^1.12.0" + string-argv "^0.3.1" + supports-color "^9.2.1" + yaml "^1.10.2" listr-silent-renderer@^1.1.1: version "1.1.1" @@ -3641,16 +4384,17 @@ listr-verbose-renderer@^0.5.0: date-fns "^1.27.2" figures "^2.0.0" -listr2@^3.8.2: - version "3.10.0" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.10.0.tgz#58105a53ed7fa1430d1b738c6055ef7bb006160f" - integrity sha512-eP40ZHihu70sSmqFNbNy2NL1YwImmlMmPh9WO5sLmPDleurMHt3n+SwEWNu2kzKScexZnkyFtc1VI0z/TGlmpw== +listr2@^4.0.1: + version "4.0.5" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-4.0.5.tgz#9dcc50221583e8b4c71c43f9c7dfd0ef546b75d5" + integrity sha512-juGHV1doQdpNT3GSTs9IUN43QJb7KHdF9uqg7Vufs/tG9VTzpFphqF4pm/ICdAABGQxsyNn9CiYA3StkI6jpwA== dependencies: cli-truncate "^2.1.0" - colorette "^1.2.2" + colorette "^2.0.16" log-update "^4.0.0" p-map "^4.0.0" - rxjs "^6.6.7" + rfdc "^1.3.0" + rxjs "^7.5.5" through "^2.3.8" wrap-ansi "^7.0.0" @@ -3669,14 +4413,13 @@ listr@^0.14.3: p-map "^2.0.0" rxjs "^6.3.3" -loader-utils@1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" - integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= dependencies: - big.js "^5.2.2" - emojis-list "^2.0.0" - json5 "^1.0.1" + p-locate "^2.0.0" + path-exists "^3.0.0" locate-path@^5.0.0: version "5.0.0" @@ -3740,6 +4483,11 @@ lodash.isstring@^4.0.1: resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + lodash.once@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" @@ -3755,32 +4503,17 @@ lodash.snakecase@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" integrity sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40= -lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= - lodash.throttle@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= -lodash.toarray@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.toarray/-/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561" - integrity sha1-JMS/zWsvuji/0FlNsRedjptlZWE= - -lodash.topath@^4.5.2: - version "4.5.2" - resolved "https://registry.yarnpkg.com/lodash.topath/-/lodash.topath-4.5.2.tgz#3616351f3bba61994a0931989660bd03254fd009" - integrity sha1-NhY1Hzu6YZlKCTGYlmC9AyVP0Ak= - lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@4.17.21, lodash@^4.17.13, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@~4.17.0: +lodash@4.17.21, lodash@^4.17.20, lodash@^4.17.21, lodash@~4.17.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -3857,23 +4590,30 @@ lru-cache@5.1.1: dependencies: yallist "^3.0.2" -make-dir@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== dependencies: - semver "^6.0.0" + yallist "^4.0.0" make-error@^1, make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -map-cache@^0.2.0: +map-cache@^0.2.0, map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + matcher@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/matcher/-/matcher-4.0.0.tgz#a42a05a09aaed92e2d241eb91fddac689461ea51" @@ -3881,31 +4621,65 @@ matcher@^4.0.0: dependencies: escape-string-regexp "^4.0.0" -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" +math-random@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" + integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.3.0: +merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -meros@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/meros/-/meros-1.1.4.tgz#c17994d3133db8b23807f62bec7f0cb276cfd948" - integrity sha512-E9ZXfK9iQfG9s73ars9qvvvbSIkJZF5yOo9j4tcwM5tN8mUKfj/EKN5PzOr3ZH0y5wL7dLAHw3RVEfpQV9Q7VQ== +meros@^1.1.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/meros/-/meros-1.2.0.tgz#096cdede2eb0b1610b219b1031b935260de1ad08" + integrity sha512-3QRZIS707pZQnijHdhbttXRWwrHhZJ/gzolneoxKVz9N/xmsvY/7Ls8lpnI9gxbgxjcHsAVEW3mgwiZCo6kkJQ== -micromatch@^4.0.2, micromatch@^4.0.4: +micromatch@^2.1.5: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +micromatch@^3.1.10: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +micromatch@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== @@ -3913,30 +4687,17 @@ micromatch@^4.0.2, micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - -mime-db@1.48.0: - version "1.48.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d" - integrity sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ== +mime-db@1.51.0: + version "1.51.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" + integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== mime-types@^2.1.12: - version "2.1.31" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b" - integrity sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg== + version "2.1.34" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" + integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== dependencies: - mime-db "1.48.0" - -mime@^2.3.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" - integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== + mime-db "1.51.0" mimic-fn@^1.0.0: version "1.2.0" @@ -3953,37 +4714,59 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= - -minimatch@3.0.4, minimatch@^3.0.4: +minimatch@3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" +minimatch@^3.0.4, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^4.0.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-4.2.1.tgz#40d9d511a46bdc4e563c22c3080cde9c0d8299b4" + integrity sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g== + dependencies: + brace-expansion "^1.1.7" + minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== +mixin-deep@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mk-dirs@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mk-dirs/-/mk-dirs-1.0.0.tgz#44ee67f82341c6762718e88e85e577882e1f67fd" + integrity sha1-RO5n+CNBxnYnGOiOheV3iC4fZ/0= + mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -modern-normalize@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/modern-normalize/-/modern-normalize-1.1.0.tgz#da8e80140d9221426bd4f725c6e11283d34f90b7" - integrity sha512-2lMlY1Yc1+CUy0gw4H95uNN7vjbpoED7NNRSBHE25nWfLBdmMzFCsPshlzbxHz+gYMcBEUN8V4pU16prcdPSgA== +mri@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" + integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== + +mrmime@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.0.tgz#14d387f0585a5233d291baba339b063752a2398b" + integrity sha512-a70zx7zFfVO7XpnQ2IX1Myh9yY4UYvfld/dikWRnsXxbyvMcfz+u6UfgNAtH+k2QqtJuzVpv6eLTx1G2+WKZbQ== ms@2.0.0: version "2.0.0" @@ -4005,83 +4788,65 @@ mute-stream@0.0.8: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== -nanoid@^3.1.22, nanoid@^3.1.23: - version "3.1.23" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.23.tgz#f744086ce7c2bc47ee0a8472574d5c78e4183a81" - integrity sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw== +nan@^2.12.1: + version "2.15.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" + integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== -native-url@0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/native-url/-/native-url-0.3.4.tgz#29c943172aed86c63cee62c8c04db7f5756661f8" - integrity sha512-6iM8R99ze45ivyH8vybJ7X0yekIcPf5GgLV5K0ENCbmRcaRIDoj37BC8iLEmaaBfqqb8enuZ5p0uhY+lVAbAcA== +nanoid@^3.1.30, nanoid@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" + integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== dependencies: - querystring "^0.2.0" + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" -next-seo@^4.26.0: - version "4.26.0" - resolved "https://registry.yarnpkg.com/next-seo/-/next-seo-4.26.0.tgz#4218cfae5651fdc2e330dcdf1cc1b34ce199d41c" - integrity sha512-5TqywQ3XAwqdmEU1AyNZjR7WdDKFTkDD8aBtgQelPvzBUEy8i0mTjtiw+09jhiHFNik6FqS8uPKCaYcY6jRgSQ== +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -next-themes@^0.0.14: - version "0.0.14" - resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.0.14.tgz#2b9861990bc453149e23d8e6ef1a25a119e36675" - integrity sha512-x09OaM+wg3SIlEjOv8B21aw/E36jxTtfW3Dm/DPwMsSMluGt7twe1LigA6nc+mXP1u0qu9MxBaIrPPH6UTiKnA== +next-themes@^0.0.15: + version "0.0.15" + resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.0.15.tgz#ab0cee69cd763b77d41211f631e108beab39bf7d" + integrity sha512-LTmtqYi03c4gMTJmWwVK9XkHL7h0/+XrtR970Ujvtu3s0kZNeJN24aJsi4rkZOI8i19+qq6f8j+8Duwy5jqcrQ== -next@^11.0.0: - version "11.0.1" - resolved "https://registry.yarnpkg.com/next/-/next-11.0.1.tgz#b8e3914d153aaf7143cb98c09bcd3c8230eeb17a" - integrity sha512-yR7be7asNbvpVNpi6xxEg28wZ7Gqmj1nOt0sABH9qORmF3+pms2KZ7Cng33oK5nqPIzEEFJD0pp2PCe3/ueMIg== +next@^12.0.8: + version "12.1.0" + resolved "https://registry.yarnpkg.com/next/-/next-12.1.0.tgz#c33d753b644be92fc58e06e5a214f143da61dd5d" + integrity sha512-s885kWvnIlxsUFHq9UGyIyLiuD0G3BUC/xrH0CEnH5lHEWkwQcHOORgbDF0hbrW9vr/7am4ETfX4A7M6DjrE7Q== dependencies: - "@babel/runtime" "7.12.5" - "@hapi/accept" "5.0.2" - "@next/env" "11.0.1" - "@next/polyfill-module" "11.0.1" - "@next/react-dev-overlay" "11.0.1" - "@next/react-refresh-utils" "11.0.1" - assert "2.0.0" - ast-types "0.13.2" - browserify-zlib "0.2.0" - browserslist "4.16.6" - buffer "5.6.0" - caniuse-lite "^1.0.30001228" - chalk "2.4.2" - chokidar "3.5.1" - constants-browserify "1.0.0" - crypto-browserify "3.12.0" - cssnano-simple "2.0.0" - domain-browser "4.19.0" - encoding "0.1.13" - etag "1.8.1" - find-cache-dir "3.3.1" - get-orientation "1.1.2" - https-browserify "1.0.0" - image-size "1.0.0" - jest-worker "27.0.0-next.5" - native-url "0.3.4" - node-fetch "2.6.1" - node-html-parser "1.4.9" - node-libs-browser "^2.2.1" - os-browserify "0.3.0" - p-limit "3.1.0" - path-browserify "1.0.1" - pnp-webpack-plugin "1.6.4" - postcss "8.2.13" - process "0.11.10" - prop-types "15.7.2" - querystring-es3 "0.2.1" - raw-body "2.4.1" - react-is "17.0.2" - react-refresh "0.8.3" - stream-browserify "3.0.0" - stream-http "3.1.1" - string_decoder "1.3.0" - styled-jsx "3.3.2" - timers-browserify "2.0.12" - tty-browserify "0.0.1" + "@next/env" "12.1.0" + caniuse-lite "^1.0.30001283" + postcss "8.4.5" + styled-jsx "5.0.0" use-subscription "1.5.1" - util "0.12.3" - vm-browserify "1.1.2" - watchpack "2.1.1" + optionalDependencies: + "@next/swc-android-arm64" "12.1.0" + "@next/swc-darwin-arm64" "12.1.0" + "@next/swc-darwin-x64" "12.1.0" + "@next/swc-linux-arm-gnueabihf" "12.1.0" + "@next/swc-linux-arm64-gnu" "12.1.0" + "@next/swc-linux-arm64-musl" "12.1.0" + "@next/swc-linux-x64-gnu" "12.1.0" + "@next/swc-linux-x64-musl" "12.1.0" + "@next/swc-win32-arm64-msvc" "12.1.0" + "@next/swc-win32-ia32-msvc" "12.1.0" + "@next/swc-win32-x64-msvc" "12.1.0" no-case@^3.0.4: version "3.0.4" @@ -4091,65 +4856,29 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -node-emoji@^1.8.1: - version "1.10.0" - resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.10.0.tgz#8886abd25d9c7bb61802a658523d1f8d2a89b2da" - integrity sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw== - dependencies: - lodash.toarray "^4.4.0" +node-domexception@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" + integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@2.6.1, node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - -node-html-parser@1.4.9: - version "1.4.9" - resolved "https://registry.yarnpkg.com/node-html-parser/-/node-html-parser-1.4.9.tgz#3c8f6cac46479fae5800725edb532e9ae8fd816c" - integrity sha512-UVcirFD1Bn0O+TSmloHeHqZZCxHjvtIeGdVdGMhyZ8/PWlEiZaZ5iJzR189yKZr8p0FXN58BUeC7RHRkf/KYGw== +node-fetch@2.6.7, node-fetch@^2.6.1, node-fetch@^2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== dependencies: - he "1.2.0" + whatwg-url "^5.0.0" node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= -node-libs-browser@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" - integrity sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q== - dependencies: - assert "^1.1.1" - browserify-zlib "^0.2.0" - buffer "^4.3.0" - console-browserify "^1.1.0" - constants-browserify "^1.0.0" - crypto-browserify "^3.11.0" - domain-browser "^1.1.1" - events "^3.0.0" - https-browserify "^1.0.0" - os-browserify "^0.3.0" - path-browserify "0.0.1" - process "^0.11.10" - punycode "^1.2.4" - querystring-es3 "^0.2.0" - readable-stream "^2.3.3" - stream-browserify "^2.0.1" - stream-http "^2.7.2" - string_decoder "^1.0.0" - timers-browserify "^2.0.4" - tty-browserify "0.0.0" - url "^0.11.0" - util "^0.11.0" - vm-browserify "^1.0.1" +node-releases@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.2.tgz#7139fe71e2f4f11b47d4d2986aaf8c48699e0c01" + integrity sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg== -node-releases@^1.1.71: - version "1.1.73" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.73.tgz#dd4e81ddd5277ff846b80b52bb40c49edf7a7b20" - integrity sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg== - -normalize-path@^2.1.1: +normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= @@ -4183,11 +4912,6 @@ nullthrows@^1.1.1: resolved "https://registry.yarnpkg.com/nullthrows/-/nullthrows-1.1.1.tgz#7818258843856ae971eae4208ad7d7eb19a431b1" integrity sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw== -num2fraction@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" - integrity sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4= - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -4198,23 +4922,24 @@ object-assign@^4.1.0, object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + object-hash@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5" integrity sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw== -object-inspect@^1.10.3: - version "1.10.3" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369" - integrity sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw== - -object-is@^1.0.1: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" - integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" +object-inspect@^1.11.0, object-inspect@^1.12.0, object-inspect@^1.9.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" + integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== object-keys-normalizer@1.0.1: version "1.0.1" @@ -4243,6 +4968,13 @@ object-merge-advanced@12.0.3: lodash.uniq "^4.5.0" util-nonempty "^3.0.6" +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + object.assign@^4.1.0, object.assign@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" @@ -4253,6 +4985,56 @@ object.assign@^4.1.0, object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" +object.entries@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861" + integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + +object.fromentries@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.5.tgz#7b37b205109c21e741e605727fe8b0ad5fa08251" + integrity sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + +object.hasown@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.0.tgz#7232ed266f34d197d15cac5880232f7a4790afe5" + integrity sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.19.1" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +object.values@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" + integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -4279,10 +5061,32 @@ opener@^1.5.2: resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== -os-browserify@0.3.0, os-browserify@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" + +ora@^5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" + integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== + dependencies: + bl "^4.1.0" + chalk "^4.1.0" + cli-cursor "^3.1.0" + cli-spinners "^2.5.0" + is-interactive "^1.0.0" + is-unicode-supported "^0.1.0" + log-symbols "^4.1.0" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" os-tmpdir@~1.0.2: version "1.0.2" @@ -4301,6 +5105,13 @@ p-limit@3.1.0: dependencies: yocto-queue "^0.1.0" +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -4308,6 +5119,13 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + p-locate@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -4327,6 +5145,11 @@ p-map@^4.0.0: dependencies: aggregate-error "^3.0.0" +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -4342,11 +5165,6 @@ package-json@^6.3.0: registry-url "^5.0.0" semver "^6.2.0" -pako@~1.0.5: - version "1.0.11" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" - integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== - param-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5" @@ -4362,17 +5180,6 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-asn1@^5.0.0, parse-asn1@^5.1.5: - version "5.1.6" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4" - integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw== - dependencies: - asn1.js "^5.2.0" - browserify-aes "^1.0.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - safe-buffer "^5.1.1" - parse-filepath@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" @@ -4382,6 +5189,16 @@ parse-filepath@^1.0.2: map-cache "^0.2.0" path-root "^0.1.1" +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + parse-json@^5.0.0: version "5.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" @@ -4400,15 +5217,10 @@ pascal-case@^3.1.2: no-case "^3.0.4" tslib "^2.0.3" -path-browserify@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" - integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ== - -path-browserify@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= path-case@^3.0.4: version "3.0.4" @@ -4418,6 +5230,11 @@ path-case@^3.0.4: dot-case "^3.0.4" tslib "^2.0.3" +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -4433,7 +5250,7 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-parse@^1.0.6: +path-parse@^1.0.6, path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== @@ -4455,436 +5272,328 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pbkdf2@^3.0.3: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" - integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -pkg-dir@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +postcss-attribute-case-insensitive@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-5.0.0.tgz#39cbf6babf3ded1e4abf37d09d6eda21c644105c" + integrity sha512-b4g9eagFGq9T5SWX4+USfVyjIb3liPnjhHHRMP7FMB2kFVpYyfEscV0wP3eaXhKlcHKUut8lt5BGoeylWA/dBQ== dependencies: - find-up "^4.0.0" - -platform@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7" - integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg== - -please-upgrade-node@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" - integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== - dependencies: - semver-compare "^1.0.0" - -pnp-webpack-plugin@1.6.4: - version "1.6.4" - resolved "https://registry.yarnpkg.com/pnp-webpack-plugin/-/pnp-webpack-plugin-1.6.4.tgz#c9711ac4dc48a685dabafc86f8b6dd9f8df84149" - integrity sha512-7Wjy+9E3WwLOEL30D+m8TSTF7qJJUJLONBnwQp0518siuMxUQUbgZwssaFX+QKlZkjHZcw/IpZCt/H0srrntSg== - dependencies: - ts-pnp "^1.1.6" - -postcss-attribute-case-insensitive@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-4.0.2.tgz#d93e46b504589e94ac7277b0463226c68041a880" - integrity sha512-clkFxk/9pcdb4Vkn0hAHq3YnxBQ2p0CGD1dy24jN+reBck+EWxMbxSUqN4Yj7t0w8csl87K6p0gxBe1utkJsYA== - dependencies: - postcss "^7.0.2" postcss-selector-parser "^6.0.2" -postcss-color-functional-notation@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/postcss-color-functional-notation/-/postcss-color-functional-notation-2.0.1.tgz#5efd37a88fbabeb00a2966d1e53d98ced93f74e0" - integrity sha512-ZBARCypjEDofW4P6IdPVTLhDNXPRn8T2s1zHbZidW6rPaaZvcnCS2soYFIQJrMZSxiePJ2XIYTlcb2ztr/eT2g== +postcss-color-functional-notation@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/postcss-color-functional-notation/-/postcss-color-functional-notation-4.2.2.tgz#f59ccaeb4ee78f1b32987d43df146109cc743073" + integrity sha512-DXVtwUhIk4f49KK5EGuEdgx4Gnyj6+t2jBSEmxvpIK9QI40tWrpS2Pua8Q7iIZWBrki2QOaeUdEaLPPa91K0RQ== dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" + postcss-value-parser "^4.2.0" -postcss-color-gray@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/postcss-color-gray/-/postcss-color-gray-5.0.0.tgz#532a31eb909f8da898ceffe296fdc1f864be8547" - integrity sha512-q6BuRnAGKM/ZRpfDascZlIZPjvwsRye7UDNalqVz3s7GDxMtqPY6+Q871liNxsonUw8oC61OG+PSaysYpl1bnw== +postcss-color-hex-alpha@^8.0.3: + version "8.0.3" + resolved "https://registry.yarnpkg.com/postcss-color-hex-alpha/-/postcss-color-hex-alpha-8.0.3.tgz#61a0fd151d28b128aa6a8a21a2dad24eebb34d52" + integrity sha512-fESawWJCrBV035DcbKRPAVmy21LpoyiXdPTuHUfWJ14ZRjY7Y7PA6P4g8z6LQGYhU1WAxkTxjIjurXzoe68Glw== dependencies: - "@csstools/convert-colors" "^1.4.0" - postcss "^7.0.5" - postcss-values-parser "^2.0.0" + postcss-value-parser "^4.2.0" -postcss-color-hex-alpha@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/postcss-color-hex-alpha/-/postcss-color-hex-alpha-5.0.3.tgz#a8d9ca4c39d497c9661e374b9c51899ef0f87388" - integrity sha512-PF4GDel8q3kkreVXKLAGNpHKilXsZ6xuu+mOQMHWHLPNyjiUBOr75sp5ZKJfmv1MCus5/DWUGcK9hm6qHEnXYw== +postcss-color-rebeccapurple@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-7.0.2.tgz#5d397039424a58a9ca628762eb0b88a61a66e079" + integrity sha512-SFc3MaocHaQ6k3oZaFwH8io6MdypkUtEy/eXzXEB1vEQlO3S3oDc/FSZA8AsS04Z25RirQhlDlHLh3dn7XewWw== dependencies: - postcss "^7.0.14" - postcss-values-parser "^2.0.1" + postcss-value-parser "^4.2.0" -postcss-color-mod-function@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/postcss-color-mod-function/-/postcss-color-mod-function-3.0.3.tgz#816ba145ac11cc3cb6baa905a75a49f903e4d31d" - integrity sha512-YP4VG+xufxaVtzV6ZmhEtc+/aTXH3d0JLpnYfxqTvwZPbJhWqp8bSY3nfNzNRFLgB4XSaBA82OE4VjOOKpCdVQ== - dependencies: - "@csstools/convert-colors" "^1.4.0" - postcss "^7.0.2" - postcss-values-parser "^2.0.0" +postcss-custom-media@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/postcss-custom-media/-/postcss-custom-media-8.0.0.tgz#1be6aff8be7dc9bf1fe014bde3b71b92bb4552f1" + integrity sha512-FvO2GzMUaTN0t1fBULDeIvxr5IvbDXcIatt6pnJghc736nqNgsGao5NT+5+WVLAQiTt6Cb3YUms0jiPaXhL//g== -postcss-color-rebeccapurple@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-4.0.1.tgz#c7a89be872bb74e45b1e3022bfe5748823e6de77" - integrity sha512-aAe3OhkS6qJXBbqzvZth2Au4V3KieR5sRQ4ptb2b2O8wgvB3SJBsdG+jsn2BZbbwekDG8nTfcCNKcSfe/lEy8g== +postcss-custom-properties@^12.1.4: + version "12.1.4" + resolved "https://registry.yarnpkg.com/postcss-custom-properties/-/postcss-custom-properties-12.1.4.tgz#e3d8a8000f28094453b836dff5132385f2862285" + integrity sha512-i6AytuTCoDLJkWN/MtAIGriJz3j7UX6bV7Z5t+KgFz+dwZS15/mlTJY1S0kRizlk6ba0V8u8hN50Fz5Nm7tdZw== dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" + postcss-value-parser "^4.2.0" -postcss-custom-media@^7.0.8: - version "7.0.8" - resolved "https://registry.yarnpkg.com/postcss-custom-media/-/postcss-custom-media-7.0.8.tgz#fffd13ffeffad73621be5f387076a28b00294e0c" - integrity sha512-c9s5iX0Ge15o00HKbuRuTqNndsJUbaXdiNsksnVH8H4gdc+zbLzr/UasOwNG6CTDpLFekVY4672eWdiiWu2GUg== +postcss-custom-selectors@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/postcss-custom-selectors/-/postcss-custom-selectors-6.0.0.tgz#022839e41fbf71c47ae6e316cb0e6213012df5ef" + integrity sha512-/1iyBhz/W8jUepjGyu7V1OPcGbc636snN1yXEQCinb6Bwt7KxsiU7/bLQlp8GwAXzCh7cobBU5odNn/2zQWR8Q== dependencies: - postcss "^7.0.14" + postcss-selector-parser "^6.0.4" -postcss-custom-properties@^8.0.11: - version "8.0.11" - resolved "https://registry.yarnpkg.com/postcss-custom-properties/-/postcss-custom-properties-8.0.11.tgz#2d61772d6e92f22f5e0d52602df8fae46fa30d97" - integrity sha512-nm+o0eLdYqdnJ5abAJeXp4CEU1c1k+eB2yMCvhgzsds/e0umabFrN6HoTy/8Q4K5ilxERdl/JD1LO5ANoYBeMA== +postcss-dir-pseudo-class@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/postcss-dir-pseudo-class/-/postcss-dir-pseudo-class-6.0.4.tgz#9afe49ea631f0cb36fa0076e7c2feb4e7e3f049c" + integrity sha512-I8epwGy5ftdzNWEYok9VjW9whC4xnelAtbajGv4adql4FIF09rnrxnA9Y8xSHN47y7gqFIv10C5+ImsLeJpKBw== dependencies: - postcss "^7.0.17" - postcss-values-parser "^2.0.1" + postcss-selector-parser "^6.0.9" -postcss-custom-selectors@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/postcss-custom-selectors/-/postcss-custom-selectors-5.1.2.tgz#64858c6eb2ecff2fb41d0b28c9dd7b3db4de7fba" - integrity sha512-DSGDhqinCqXqlS4R7KGxL1OSycd1lydugJ1ky4iRXPHdBRiozyMHrdu0H3o7qNOCiZwySZTUI5MV0T8QhCLu+w== +postcss-double-position-gradients@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/postcss-double-position-gradients/-/postcss-double-position-gradients-3.1.1.tgz#a12cfdb7d11fa1a99ccecc747f0c19718fb37152" + integrity sha512-jM+CGkTs4FcG53sMPjrrGE0rIvLDdCrqMzgDC5fLI7JHDO7o6QG8C5TQBtExb13hdBdoH9C2QVbG4jo2y9lErQ== dependencies: - postcss "^7.0.2" - postcss-selector-parser "^5.0.0-rc.3" + "@csstools/postcss-progressive-custom-properties" "^1.1.0" + postcss-value-parser "^4.2.0" -postcss-dir-pseudo-class@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/postcss-dir-pseudo-class/-/postcss-dir-pseudo-class-5.0.0.tgz#6e3a4177d0edb3abcc85fdb6fbb1c26dabaeaba2" - integrity sha512-3pm4oq8HYWMZePJY+5ANriPs3P07q+LW6FAdTlkFH2XqDdP4HeeJYMOzn0HYLhRSjBO3fhiqSwwU9xEULSrPgw== +postcss-env-function@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/postcss-env-function/-/postcss-env-function-4.0.5.tgz#b9614d50abd91e4c88a114644a9766880dabe393" + integrity sha512-gPUJc71ji9XKyl0WSzAalBeEA/89kU+XpffpPxSaaaZ1c48OL36r1Ep5R6+9XAPkIiDlSvVAwP4io12q/vTcvA== dependencies: - postcss "^7.0.2" - postcss-selector-parser "^5.0.0-rc.3" - -postcss-double-position-gradients@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/postcss-double-position-gradients/-/postcss-double-position-gradients-1.0.0.tgz#fc927d52fddc896cb3a2812ebc5df147e110522e" - integrity sha512-G+nV8EnQq25fOI8CH/B6krEohGWnF5+3A6H/+JEpOncu5dCnkS1QQ6+ct3Jkaepw1NGVqqOZH6lqrm244mCftA== - dependencies: - postcss "^7.0.5" - postcss-values-parser "^2.0.0" - -postcss-env-function@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/postcss-env-function/-/postcss-env-function-2.0.2.tgz#0f3e3d3c57f094a92c2baf4b6241f0b0da5365d7" - integrity sha512-rwac4BuZlITeUbiBq60h/xbLzXY43qOsIErngWa4l7Mt+RaSkT7QBjXVGTcBHupykkblHMDrBFh30zchYPaOUw== - dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" + postcss-value-parser "^4.2.0" postcss-flexbugs-fixes@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-5.0.2.tgz#2028e145313074fc9abe276cb7ca14e5401eb49d" integrity sha512-18f9voByak7bTktR2QgDveglpn9DTbBWPUzSOe9g0N4WR/2eSt6Vrcbf0hmspvMI6YWGywz6B9f7jzpFNJJgnQ== -postcss-focus-visible@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-focus-visible/-/postcss-focus-visible-4.0.0.tgz#477d107113ade6024b14128317ade2bd1e17046e" - integrity sha512-Z5CkWBw0+idJHSV6+Bgf2peDOFf/x4o+vX/pwcNYrWpXFrSfTkQ3JQ1ojrq9yS+upnAlNRHeg8uEwFTgorjI8g== +postcss-focus-visible@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/postcss-focus-visible/-/postcss-focus-visible-6.0.4.tgz#50c9ea9afa0ee657fb75635fabad25e18d76bf9e" + integrity sha512-QcKuUU/dgNsstIK6HELFRT5Y3lbrMLEOwG+A4s5cA+fx3A3y/JTq3X9LaOj3OC3ALH0XqyrgQIgey/MIZ8Wczw== dependencies: - postcss "^7.0.2" + postcss-selector-parser "^6.0.9" -postcss-focus-within@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-focus-within/-/postcss-focus-within-3.0.0.tgz#763b8788596cee9b874c999201cdde80659ef680" - integrity sha512-W0APui8jQeBKbCGZudW37EeMCjDeVxKgiYfIIEo8Bdh5SpB9sxds/Iq8SEuzS0Q4YFOlG7EPFulbbxujpkrV2w== +postcss-focus-within@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/postcss-focus-within/-/postcss-focus-within-5.0.4.tgz#5b1d2ec603195f3344b716c0b75f61e44e8d2e20" + integrity sha512-vvjDN++C0mu8jz4af5d52CB184ogg/sSxAFS+oUJQq2SuCe7T5U2iIsVJtsCp2d6R4j0jr5+q3rPkBVZkXD9fQ== dependencies: - postcss "^7.0.2" + postcss-selector-parser "^6.0.9" -postcss-font-variant@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-font-variant/-/postcss-font-variant-4.0.1.tgz#42d4c0ab30894f60f98b17561eb5c0321f502641" - integrity sha512-I3ADQSTNtLTTd8uxZhtSOrTCQ9G4qUVKPjHiDk0bV75QSxXjVWiJVJ2VLdspGUi9fbW9BcjKJoRvxAH1pckqmA== - dependencies: - postcss "^7.0.2" +postcss-font-variant@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/postcss-font-variant/-/postcss-font-variant-5.0.0.tgz#efd59b4b7ea8bb06127f2d031bfbb7f24d32fa66" + integrity sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA== -postcss-gap-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-gap-properties/-/postcss-gap-properties-2.0.0.tgz#431c192ab3ed96a3c3d09f2ff615960f902c1715" - integrity sha512-QZSqDaMgXCHuHTEzMsS2KfVDOq7ZFiknSpkrPJY6jmxbugUPTuSzs/vuE5I3zv0WAS+3vhrlqhijiprnuQfzmg== - dependencies: - postcss "^7.0.2" - -postcss-image-set-function@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/postcss-image-set-function/-/postcss-image-set-function-3.0.1.tgz#28920a2f29945bed4c3198d7df6496d410d3f288" - integrity sha512-oPTcFFip5LZy8Y/whto91L9xdRHCWEMs3e1MdJxhgt4jy2WYXfhkng59fH5qLXSCPN8k4n94p1Czrfe5IOkKUw== - dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" - -postcss-initial@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/postcss-initial/-/postcss-initial-3.0.4.tgz#9d32069a10531fe2ecafa0b6ac750ee0bc7efc53" - integrity sha512-3RLn6DIpMsK1l5UUy9jxQvoDeUN4gP939tDcKUHD/kM8SGSKbFAnvkpFpj3Bhtz3HGk1jWY5ZNWX6mPta5M9fg== - dependencies: - postcss "^7.0.2" - -postcss-js@^3.0.3: +postcss-gap-properties@^3.0.3: version "3.0.3" - resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-3.0.3.tgz#2f0bd370a2e8599d45439f6970403b5873abda33" - integrity sha512-gWnoWQXKFw65Hk/mi2+WTQTHdPD5UJdDXZmX073EY/B3BWnYjO4F4t0VneTCnCGQ5E5GsCdMkzPaTXwl3r5dJw== + resolved "https://registry.yarnpkg.com/postcss-gap-properties/-/postcss-gap-properties-3.0.3.tgz#6401bb2f67d9cf255d677042928a70a915e6ba60" + integrity sha512-rPPZRLPmEKgLk/KlXMqRaNkYTUpE7YC+bOIQFN5xcu1Vp11Y4faIXv6/Jpft6FMnl6YRxZqDZG0qQOW80stzxQ== + +postcss-image-set-function@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/postcss-image-set-function/-/postcss-image-set-function-4.0.6.tgz#bcff2794efae778c09441498f40e0c77374870a9" + integrity sha512-KfdC6vg53GC+vPd2+HYzsZ6obmPqOk6HY09kttU19+Gj1nC3S3XBVEXDHxkhxTohgZqzbUb94bKXvKDnYWBm/A== + dependencies: + postcss-value-parser "^4.2.0" + +postcss-initial@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-initial/-/postcss-initial-4.0.1.tgz#529f735f72c5724a0fb30527df6fb7ac54d7de42" + integrity sha512-0ueD7rPqX8Pn1xJIjay0AZeIuDoF+V+VvMt/uOnn+4ezUKhZM/NokDeP6DwMNyIoYByuN/94IQnt5FEkaN59xQ== + +postcss-js@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-4.0.0.tgz#31db79889531b80dc7bc9b0ad283e418dce0ac00" + integrity sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ== dependencies: camelcase-css "^2.0.1" - postcss "^8.1.6" -postcss-lab-function@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/postcss-lab-function/-/postcss-lab-function-2.0.1.tgz#bb51a6856cd12289ab4ae20db1e3821ef13d7d2e" - integrity sha512-whLy1IeZKY+3fYdqQFuDBf8Auw+qFuVnChWjmxm/UhHWqNHZx+B99EwxTvGYmUBqe3Fjxs4L1BoZTJmPu6usVg== +postcss-lab-function@^4.1.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/postcss-lab-function/-/postcss-lab-function-4.1.2.tgz#b75afe43ba9c1f16bfe9bb12c8109cabd55b5fc2" + integrity sha512-isudf5ldhg4fk16M8viAwAbg6Gv14lVO35N3Z/49NhbwPQ2xbiEoHgrRgpgQojosF4vF7jY653ktB6dDrUOR8Q== dependencies: - "@csstools/convert-colors" "^1.4.0" - postcss "^7.0.2" - postcss-values-parser "^2.0.0" + "@csstools/postcss-progressive-custom-properties" "^1.1.0" + postcss-value-parser "^4.2.0" -postcss-load-config@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.0.tgz#d39c47091c4aec37f50272373a6a648ef5e97829" - integrity sha512-ipM8Ds01ZUophjDTQYSVP70slFSYg3T0/zyfII5vzhN6V57YSxMgG5syXuwi5VtS8wSf3iL30v0uBdoIVx4Q0g== +postcss-load-config@^3.1.0: + version "3.1.3" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.3.tgz#21935b2c43b9a86e6581a576ca7ee1bde2bd1d23" + integrity sha512-5EYgaM9auHGtO//ljHH+v/aC/TQ5LHXtL7bQajNAUBKUVKiYE8rYpFms7+V26D9FncaGe2zwCoPQsFKb5zF/Hw== dependencies: - import-cwd "^3.0.0" - lilconfig "^2.0.3" + lilconfig "^2.0.4" yaml "^1.10.2" -postcss-logical@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-logical/-/postcss-logical-3.0.0.tgz#2495d0f8b82e9f262725f75f9401b34e7b45d5b5" - integrity sha512-1SUKdJc2vuMOmeItqGuNaC+N8MzBWFWEkAnRnLpFYj1tGGa7NqyVBujfRtgNa2gXR+6RkGUiB2O5Vmh7E2RmiA== - dependencies: - postcss "^7.0.2" +postcss-logical@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/postcss-logical/-/postcss-logical-5.0.4.tgz#ec75b1ee54421acc04d5921576b7d8db6b0e6f73" + integrity sha512-RHXxplCeLh9VjinvMrZONq7im4wjWGlRJAqmAVLXyZaXwfDWP73/oq4NdIp+OZwhQUMj0zjqDfM5Fj7qby+B4g== -postcss-media-minmax@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-media-minmax/-/postcss-media-minmax-4.0.0.tgz#b75bb6cbc217c8ac49433e12f22048814a4f5ed5" - integrity sha512-fo9moya6qyxsjbFAYl97qKO9gyre3qvbMnkOZeZwlsW6XYFsvs2DMGDlchVLfAd8LHPZDxivu/+qW2SMQeTHBw== - dependencies: - postcss "^7.0.2" +postcss-media-minmax@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/postcss-media-minmax/-/postcss-media-minmax-5.0.0.tgz#7140bddec173e2d6d657edbd8554a55794e2a5b5" + integrity sha512-yDUvFf9QdFZTuCUg0g0uNSHVlJ5X1lSzDZjPSFaiCWvjgsvu8vEVxtahPrLMinIDEEGnx6cBe6iqdx5YWz08wQ== -postcss-nested@5.0.5: - version "5.0.5" - resolved "https://registry.yarnpkg.com/postcss-nested/-/postcss-nested-5.0.5.tgz#f0a107d33a9fab11d7637205f5321e27223e3603" - integrity sha512-GSRXYz5bccobpTzLQZXOnSOfKl6TwVr5CyAQJUPub4nuRJSOECK5AqurxVgmtxP48p0Kc/ndY/YyS1yqldX0Ew== +postcss-nested@5.0.6: + version "5.0.6" + resolved "https://registry.yarnpkg.com/postcss-nested/-/postcss-nested-5.0.6.tgz#466343f7fc8d3d46af3e7dba3fcd47d052a945bc" + integrity sha512-rKqm2Fk0KbA8Vt3AdGN0FB9OBOMDVajMG6ZCf/GoHgdxUJ4sBFp0A/uMIRm+MJUdo33YXEtjqIz8u7DAp8B7DA== dependencies: - postcss-selector-parser "^6.0.4" + postcss-selector-parser "^6.0.6" -postcss-nesting@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-nesting/-/postcss-nesting-7.0.1.tgz#b50ad7b7f0173e5b5e3880c3501344703e04c052" - integrity sha512-FrorPb0H3nuVq0Sff7W2rnc3SmIcruVC6YwpcS+k687VxyxO33iE1amna7wHuRVzM8vfiYofXSBHNAZ3QhLvYg== +postcss-nesting@^10.1.2: + version "10.1.3" + resolved "https://registry.yarnpkg.com/postcss-nesting/-/postcss-nesting-10.1.3.tgz#f0b1cd7ae675c697ab6a5a5ca1feea4784a2ef77" + integrity sha512-wUC+/YCik4wH3StsbC5fBG1s2Z3ZV74vjGqBFYtmYKlVxoio5TYGM06AiaKkQPPlkXWn72HKfS7Cw5PYxnoXSw== dependencies: - postcss "^7.0.2" + postcss-selector-parser "^6.0.9" postcss-nesting@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/postcss-nesting/-/postcss-nesting-8.0.1.tgz#4a8ab3c540a0f138fd3f5d2ee65e4a24d1888024" integrity sha512-cHPNhW5VvRQjszFDxmy16mis9qFQqQLBNw6KVmueLqqE3M182ZAk9+QoxGqbGVryzLVhannw2B5Yhosqq522fA== -postcss-overflow-shorthand@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-overflow-shorthand/-/postcss-overflow-shorthand-2.0.0.tgz#31ecf350e9c6f6ddc250a78f0c3e111f32dd4c30" - integrity sha512-aK0fHc9CBNx8jbzMYhshZcEv8LtYnBIRYQD5i7w/K/wS9c2+0NSR6B3OVMu5y0hBHYLcMGjfU+dmWYNKH0I85g== - dependencies: - postcss "^7.0.2" +postcss-opacity-percentage@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/postcss-opacity-percentage/-/postcss-opacity-percentage-1.1.2.tgz#bd698bb3670a0a27f6d657cc16744b3ebf3b1145" + integrity sha512-lyUfF7miG+yewZ8EAk9XUBIlrHyUE6fijnesuz+Mj5zrIHIEw6KcIZSOk/elVMqzLvREmXB83Zi/5QpNRYd47w== -postcss-page-break@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-page-break/-/postcss-page-break-2.0.0.tgz#add52d0e0a528cabe6afee8b46e2abb277df46bf" - integrity sha512-tkpTSrLpfLfD9HvgOlJuigLuk39wVTbbd8RKcy8/ugV2bNBUW3xU+AIqyxhDrQr1VUj1RmyJrBn1YWrqUm9zAQ== - dependencies: - postcss "^7.0.2" +postcss-overflow-shorthand@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/postcss-overflow-shorthand/-/postcss-overflow-shorthand-3.0.3.tgz#ebcfc0483a15bbf1b27fdd9b3c10125372f4cbc2" + integrity sha512-CxZwoWup9KXzQeeIxtgOciQ00tDtnylYIlJBBODqkgS/PU2jISuWOL/mYLHmZb9ZhZiCaNKsCRiLp22dZUtNsg== -postcss-place@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-place/-/postcss-place-4.0.1.tgz#e9f39d33d2dc584e46ee1db45adb77ca9d1dcc62" - integrity sha512-Zb6byCSLkgRKLODj/5mQugyuj9bvAAw9LqJJjgwz5cYryGeXfFZfSXoP1UfveccFmeq0b/2xxwcTEVScnqGxBg== - dependencies: - postcss "^7.0.2" - postcss-values-parser "^2.0.0" +postcss-page-break@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/postcss-page-break/-/postcss-page-break-3.0.4.tgz#7fbf741c233621622b68d435babfb70dd8c1ee5f" + integrity sha512-1JGu8oCjVXLa9q9rFTo4MbeeA5FMe00/9C7lN4va606Rdb+HkxXtXsmEDrIraQ11fGz/WvKWa8gMuCKkrXpTsQ== -postcss-preset-env@^6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/postcss-preset-env/-/postcss-preset-env-6.7.0.tgz#c34ddacf8f902383b35ad1e030f178f4cdf118a5" - integrity sha512-eU4/K5xzSFwUFJ8hTdTQzo2RBLbDVt83QZrAvI07TULOkmyQlnYlpwep+2yIK+K+0KlZO4BvFcleOCCcUtwchg== +postcss-place@^7.0.4: + version "7.0.4" + resolved "https://registry.yarnpkg.com/postcss-place/-/postcss-place-7.0.4.tgz#eb026650b7f769ae57ca4f938c1addd6be2f62c9" + integrity sha512-MrgKeiiu5OC/TETQO45kV3npRjOFxEHthsqGtkh3I1rPbZSbXGD/lZVi9j13cYh+NA8PIAPyk6sGjT9QbRyvSg== dependencies: - autoprefixer "^9.6.1" - browserslist "^4.6.4" - caniuse-lite "^1.0.30000981" - css-blank-pseudo "^0.1.4" - css-has-pseudo "^0.10.0" - css-prefers-color-scheme "^3.1.1" - cssdb "^4.4.0" - postcss "^7.0.17" - postcss-attribute-case-insensitive "^4.0.1" - postcss-color-functional-notation "^2.0.1" - postcss-color-gray "^5.0.0" - postcss-color-hex-alpha "^5.0.3" - postcss-color-mod-function "^3.0.3" - postcss-color-rebeccapurple "^4.0.1" - postcss-custom-media "^7.0.8" - postcss-custom-properties "^8.0.11" - postcss-custom-selectors "^5.1.2" - postcss-dir-pseudo-class "^5.0.0" - postcss-double-position-gradients "^1.0.0" - postcss-env-function "^2.0.2" - postcss-focus-visible "^4.0.0" - postcss-focus-within "^3.0.0" - postcss-font-variant "^4.0.0" - postcss-gap-properties "^2.0.0" - postcss-image-set-function "^3.0.1" - postcss-initial "^3.0.0" - postcss-lab-function "^2.0.1" - postcss-logical "^3.0.0" - postcss-media-minmax "^4.0.0" - postcss-nesting "^7.0.0" - postcss-overflow-shorthand "^2.0.0" - postcss-page-break "^2.0.0" - postcss-place "^4.0.1" - postcss-pseudo-class-any-link "^6.0.0" - postcss-replace-overflow-wrap "^3.0.0" - postcss-selector-matches "^4.0.0" - postcss-selector-not "^4.0.0" + postcss-value-parser "^4.2.0" -postcss-pseudo-class-any-link@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-6.0.0.tgz#2ed3eed393b3702879dec4a87032b210daeb04d1" - integrity sha512-lgXW9sYJdLqtmw23otOzrtbDXofUdfYzNm4PIpNE322/swES3VU9XlXHeJS46zT2onFO7V1QFdD4Q9LiZj8mew== +postcss-preset-env@^7.2.3: + version "7.4.2" + resolved "https://registry.yarnpkg.com/postcss-preset-env/-/postcss-preset-env-7.4.2.tgz#2ff3e4787bd9d89710659535855d6ce85ce6110b" + integrity sha512-AmOkb8AeNNQwE/z2fHl1iwOIt8J50V8WR0rmLagcgIDoqlJZWjV3NdtOPnLGco1oN8DZe+Ss5B9ULbBeS6HfeA== dependencies: - postcss "^7.0.2" - postcss-selector-parser "^5.0.0-rc.3" + "@csstools/postcss-color-function" "^1.0.2" + "@csstools/postcss-font-format-keywords" "^1.0.0" + "@csstools/postcss-hwb-function" "^1.0.0" + "@csstools/postcss-ic-unit" "^1.0.0" + "@csstools/postcss-is-pseudo-class" "^2.0.0" + "@csstools/postcss-normalize-display-values" "^1.0.0" + "@csstools/postcss-oklab-function" "^1.0.1" + "@csstools/postcss-progressive-custom-properties" "^1.2.0" + autoprefixer "^10.4.2" + browserslist "^4.19.3" + css-blank-pseudo "^3.0.3" + css-has-pseudo "^3.0.4" + css-prefers-color-scheme "^6.0.3" + cssdb "^6.4.0" + postcss-attribute-case-insensitive "^5.0.0" + postcss-color-functional-notation "^4.2.2" + postcss-color-hex-alpha "^8.0.3" + postcss-color-rebeccapurple "^7.0.2" + postcss-custom-media "^8.0.0" + postcss-custom-properties "^12.1.4" + postcss-custom-selectors "^6.0.0" + postcss-dir-pseudo-class "^6.0.4" + postcss-double-position-gradients "^3.1.0" + postcss-env-function "^4.0.5" + postcss-focus-visible "^6.0.4" + postcss-focus-within "^5.0.4" + postcss-font-variant "^5.0.0" + postcss-gap-properties "^3.0.3" + postcss-image-set-function "^4.0.6" + postcss-initial "^4.0.1" + postcss-lab-function "^4.1.1" + postcss-logical "^5.0.4" + postcss-media-minmax "^5.0.0" + postcss-nesting "^10.1.2" + postcss-opacity-percentage "^1.1.2" + postcss-overflow-shorthand "^3.0.3" + postcss-page-break "^3.0.4" + postcss-place "^7.0.4" + postcss-pseudo-class-any-link "^7.1.1" + postcss-replace-overflow-wrap "^4.0.0" + postcss-selector-not "^5.0.0" + postcss-value-parser "^4.2.0" -postcss-replace-overflow-wrap@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-3.0.0.tgz#61b360ffdaedca84c7c918d2b0f0d0ea559ab01c" - integrity sha512-2T5hcEHArDT6X9+9dVSPQdo7QHzG4XKclFT8rU5TzJPDN7RIRTbO9c4drUISOVemLj03aezStHCR2AIcr8XLpw== +postcss-pseudo-class-any-link@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-7.1.1.tgz#534eb1dadd9945eb07830dbcc06fb4d5d865b8e0" + integrity sha512-JRoLFvPEX/1YTPxRxp1JO4WxBVXJYrSY7NHeak5LImwJ+VobFMwYDQHvfTXEpcn+7fYIeGkC29zYFhFWIZD8fg== dependencies: - postcss "^7.0.2" + postcss-selector-parser "^6.0.9" -postcss-selector-matches@^4.0.0: +postcss-replace-overflow-wrap@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-selector-matches/-/postcss-selector-matches-4.0.0.tgz#71c8248f917ba2cc93037c9637ee09c64436fcff" - integrity sha512-LgsHwQR/EsRYSqlwdGzeaPKVT0Ml7LAT6E75T8W8xLJY62CE4S/l03BWIt3jT8Taq22kXP08s2SfTSzaraoPww== - dependencies: - balanced-match "^1.0.0" - postcss "^7.0.2" + resolved "https://registry.yarnpkg.com/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-4.0.0.tgz#d2df6bed10b477bf9c52fab28c568b4b29ca4319" + integrity sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw== -postcss-selector-not@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-selector-not/-/postcss-selector-not-4.0.1.tgz#263016eef1cf219e0ade9a913780fc1f48204cbf" - integrity sha512-YolvBgInEK5/79C+bdFMyzqTg6pkYqDbzZIST/PDMqa/o3qtXenD05apBG2jLgT0/BQ77d4U2UK12jWpilqMAQ== - dependencies: - balanced-match "^1.0.0" - postcss "^7.0.2" - -postcss-selector-parser@^5.0.0-rc.3, postcss-selector-parser@^5.0.0-rc.4: +postcss-selector-not@^5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz#249044356697b33b64f1a8f7c80922dddee7195c" - integrity sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ== + resolved "https://registry.yarnpkg.com/postcss-selector-not/-/postcss-selector-not-5.0.0.tgz#ac5fc506f7565dd872f82f5314c0f81a05630dc7" + integrity sha512-/2K3A4TCP9orP4TNS7u3tGdRFVKqz/E6pX3aGnriPG0jU78of8wsUcqE4QAhWEU0d+WnMSF93Ah3F//vUtK+iQ== dependencies: - cssesc "^2.0.0" - indexes-of "^1.0.1" - uniq "^1.0.1" + balanced-match "^1.0.0" -postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.6: - version "6.0.6" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.6.tgz#2c5bba8174ac2f6981ab631a42ab0ee54af332ea" - integrity sha512-9LXrvaaX3+mcv5xkg5kFwqSzSH1JIObIx51PrndZwlmznwXRfxMddDvo9gve3gVR8ZTKgoFDdWkbRFmEhT4PMg== +postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.6, postcss-selector-parser@^6.0.9: + version "6.0.9" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.9.tgz#ee71c3b9ff63d9cd130838876c13a2ec1a992b2f" + integrity sha512-UO3SgnZOVTwu4kyLR22UQ1xZh086RyNZppb7lLAKBFK8a32ttG5i87Y/P3+2bRSjZNyJ1B7hfFNo273tKe9YxQ== dependencies: cssesc "^3.0.0" util-deprecate "^1.0.2" -postcss-value-parser@^3.3.0: - version "3.3.1" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281" - integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== +postcss-value-parser@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" + integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== -postcss-value-parser@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" - integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== - -postcss-values-parser@^2.0.0, postcss-values-parser@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz#da8b472d901da1e205b47bdc98637b9e9e550e5f" - integrity sha512-2tLuBsA6P4rYTNKCXYG/71C7j1pU6pK503suYOmn4xYrQIzW+opD+7FAFNuGSdZC/3Qfy334QbeMu7MEb8gOxg== +postcss@8.4.5: + version "8.4.5" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.5.tgz#bae665764dfd4c6fcc24dc0fdf7e7aa00cc77f95" + integrity sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg== dependencies: - flatten "^1.0.2" - indexes-of "^1.0.1" - uniq "^1.0.1" + nanoid "^3.1.30" + picocolors "^1.0.0" + source-map-js "^1.0.1" -postcss@8.2.13: - version "8.2.13" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.2.13.tgz#dbe043e26e3c068e45113b1ed6375d2d37e2129f" - integrity sha512-FCE5xLH+hjbzRdpbRb1IMCvPv9yZx2QnDarBEYSN0N0HYk+TcXsEhwdFcFb+SRWOKzKGErhIEbBK2ogyLdTtfQ== +postcss@^8.3.5, postcss@^8.4.6: + version "8.4.8" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.8.tgz#dad963a76e82c081a0657d3a2f3602ce10c2e032" + integrity sha512-2tXEqGxrjvAO6U+CJzDL2Fk2kPHTv1jQsYkSoMeOis2SsYaXRO2COxTdQp99cYvif9JTXaAk9lYGc3VhJt7JPQ== dependencies: - colorette "^1.2.2" - nanoid "^3.1.22" - source-map "^0.6.1" + nanoid "^3.3.1" + picocolors "^1.0.0" + source-map-js "^1.0.2" -postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.32, postcss@^7.0.5, postcss@^7.0.6: - version "7.0.36" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.36.tgz#056f8cffa939662a8f5905950c07d5285644dfcb" - integrity sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw== - dependencies: - chalk "^2.4.2" - source-map "^0.6.1" - supports-color "^6.1.0" - -postcss@^8.1.6, postcss@^8.2.1, postcss@^8.3.5: - version "8.3.5" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.5.tgz#982216b113412bc20a86289e91eb994952a5b709" - integrity sha512-NxTuJocUhYGsMiMFHDUkmjSKT3EdH4/WbGF6GCi1NDGk+vbcUTun4fpbOqaPtD8IIsztA2ilZm2DhYCuyN58gA== - dependencies: - colorette "^1.2.2" - nanoid "^3.1.23" - source-map-js "^0.6.2" +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== prepend-http@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= -prettier@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.1.tgz#76903c3f8c4449bc9ac597acefa24dc5ad4cbea6" - integrity sha512-p+vNbgpLjif/+D+DwAZAbndtRrR0md0MwfmOVN9N+2RgyACMT+7tfaRnT+WDPkqnuVwleyuBIG2XBxKDme3hPA== +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= -pretty-hrtime@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" - integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= +prettier@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" + integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -process@0.11.10, process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= - promise@^7.1.1: version "7.3.1" resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" @@ -4892,26 +5601,14 @@ promise@^7.1.1: dependencies: asap "~2.0.3" -prop-types@15.7.2, prop-types@^15.7.2: - version "15.7.2" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" - integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== +prop-types@^15.8.1: + version "15.8.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" + integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== dependencies: loose-envify "^1.4.0" object-assign "^4.1.1" - react-is "^16.8.1" - -public-encrypt@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" - integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - safe-buffer "^5.1.2" + react-is "^16.13.1" pump@^3.0.0: version "3.0.0" @@ -4921,92 +5618,41 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= - -punycode@^1.2.4: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= - punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -purgecss@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/purgecss/-/purgecss-4.0.3.tgz#8147b429f9c09db719e05d64908ea8b672913742" - integrity sha512-PYOIn5ibRIP34PBU9zohUcCI09c7drPJJtTDAc0Q6QlRz2/CHQ8ywGLdE7ZhxU2VTqB7p5wkvj5Qcm05Rz3Jmw== - dependencies: - commander "^6.0.0" - glob "^7.0.0" - postcss "^8.2.1" - postcss-selector-parser "^6.0.2" - qs@6.7.0: version "6.7.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== -querystring-es3@0.2.1, querystring-es3@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= - -querystring@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" - integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== +qs@^6.6.0: + version "6.10.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" + integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== + dependencies: + side-channel "^1.0.4" queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -queue@6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/queue/-/queue-6.0.2.tgz#b91525283e2315c7553d2efa18d83e76432fed65" - integrity sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA== - dependencies: - inherits "~2.0.3" - quick-lru@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== +randomatic@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" + integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== dependencies: - safe-buffer "^5.1.0" - -randomfill@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== - dependencies: - randombytes "^2.0.5" - safe-buffer "^5.1.0" - -raw-body@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c" - integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== - dependencies: - bytes "3.1.0" - http-errors "1.7.3" - iconv-lite "0.4.24" - unpipe "1.0.0" + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" rc@^1.2.8: version "1.2.8" @@ -5027,17 +5673,12 @@ react-dom@^17.0.2: object-assign "^4.1.1" scheduler "^0.20.2" -react-fast-marquee@^1.1.4: - version "1.2.1" - resolved "https://registry.yarnpkg.com/react-fast-marquee/-/react-fast-marquee-1.2.1.tgz#8a8ee91ec0cee04bcff7f1ea5c3fd5a2c4dc227d" - integrity sha512-rd9ZDhiUrrL2puZNlnb633df/1gjtknuIaf749LIgTLXa18fzPIdFBrz4VjERu1ECUdU9tniaF5FuosNt/GYKQ== +react-fast-marquee@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/react-fast-marquee/-/react-fast-marquee-1.3.1.tgz#e026ecbf95e73f287c94af9233bed5886913883c" + integrity sha512-JUlQMU+IVVNKV+D4BRfRaNEaBj+VyHcI0uupBKyeFhkSY2GBkKw7oGvpNdCkPtKd8Q3H0M5eY7PyUj7AdmKCRA== -react-is@17.0.2: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" - integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== - -react-is@^16.8.1: +react-is@^16.13.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -5047,17 +5688,12 @@ react-merge-refs@^1.1.0: resolved "https://registry.yarnpkg.com/react-merge-refs/-/react-merge-refs-1.1.0.tgz#73d88b892c6c68cbb7a66e0800faa374f4c38b06" integrity sha512-alTKsjEL0dKH/ru1Iyn7vliS2QRcBp9zZPGoWxUOvRGWPUYgjo+V01is7p04It6KhgrzhJGnIj9GgX8W4bZoCQ== -react-refresh@0.8.3: - version "0.8.3" - resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.3.tgz#721d4657672d400c5e3c75d063c4a85fb2d5d68f" - integrity sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg== - -react-use-measure@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/react-use-measure/-/react-use-measure-2.0.4.tgz#cb675b36eaeaf3681b94d5f5e08b2a1e081fedc9" - integrity sha512-7K2HIGaPMl3Q9ZQiEVjen3tRXl4UDda8LiTPy/QxP8dP2rl5gPBhf7mMH6MVjjRNv3loU7sNzey/ycPNnHVTxQ== +react-use-measure@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/react-use-measure/-/react-use-measure-2.1.1.tgz#5824537f4ee01c9469c45d5f7a8446177c6cc4ba" + integrity sha512-nocZhN26cproIiIduswYpV5y5lQpSQS1y/4KuvUCjSKmw7ZWIS/+g3aFnX3WdBkyuGUtTLif3UTqnLLhbDoQig== dependencies: - debounce "^1.2.0" + debounce "^1.2.1" react@^17.0.2: version "17.0.2" @@ -5067,7 +5703,7 @@ react@^17.0.2: loose-envify "^1.1.0" object-assign "^4.1.1" -readable-stream@^2.0.2, readable-stream@^2.3.3, readable-stream@^2.3.6: +readable-stream@^2.0.2: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -5080,7 +5716,7 @@ readable-stream@^2.0.2, readable-stream@^2.3.3, readable-stream@^2.3.6: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@^3.5.0, readable-stream@^3.6.0: +readable-stream@^3.4.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -5089,12 +5725,14 @@ readable-stream@^3.5.0, readable-stream@^3.6.0: string_decoder "^1.1.1" util-deprecate "^1.0.1" -readdirp@~3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" - integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== +readdirp@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== dependencies: - picomatch "^2.2.1" + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" readdirp@~3.6.0: version "3.6.0" @@ -5103,18 +5741,38 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -reduce-css-calc@^2.1.8: - version "2.1.8" - resolved "https://registry.yarnpkg.com/reduce-css-calc/-/reduce-css-calc-2.1.8.tgz#7ef8761a28d614980dc0c982f772c93f7a99de03" - integrity sha512-8liAVezDmUcH+tdzoEGrhfbGcP7nOV4NkGE3a74+qqvE7nt9i4sKLGBuZNOnpI4WiGksiNPklZxva80061QiPg== - dependencies: - css-unit-converter "^1.1.1" - postcss-value-parser "^3.3.0" - regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.4: - version "0.13.7" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" - integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== + dependencies: + is-equal-shallow "^0.1.3" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexp.prototype.flags@^1.3.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.1.tgz#b3f4c0059af9e47eca9f3f660e51d81307e72307" + integrity sha512-pMR7hBVUUGI7PMA37m2ofIdQCsomVnas+Jn5UPGAHQ+/LlwKm/aTLJHdasmHRzlfeZwHiAOaRSo2rbBDm3nNUQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +regexpp@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== registry-auth-token@^4.0.0: version "4.2.1" @@ -5130,35 +5788,37 @@ registry-url@^5.0.0: dependencies: rc "^1.2.8" -relay-compiler@10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/relay-compiler/-/relay-compiler-10.1.0.tgz#fb4672cdbe9b54869a3a79759edd8c2d91609cbe" - integrity sha512-HPqc3N3tNgEgUH5+lTr5lnLbgnsZMt+MRiyS0uAVNhuPY2It0X1ZJG+9qdA3L9IqKFUNwVn6zTO7RArjMZbARQ== +relay-compiler@12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/relay-compiler/-/relay-compiler-12.0.0.tgz#9f292d483fb871976018704138423a96c8a45439" + integrity sha512-SWqeSQZ+AMU/Cr7iZsHi1e78Z7oh00I5SvR092iCJq79aupqJ6Ds+I1Pz/Vzo5uY5PY0jvC4rBJXzlIN5g9boQ== dependencies: - "@babel/core" "^7.0.0" - "@babel/generator" "^7.5.0" - "@babel/parser" "^7.0.0" + "@babel/core" "^7.14.0" + "@babel/generator" "^7.14.0" + "@babel/parser" "^7.14.0" "@babel/runtime" "^7.0.0" - "@babel/traverse" "^7.0.0" + "@babel/traverse" "^7.14.0" "@babel/types" "^7.0.0" - babel-preset-fbjs "^3.3.0" + babel-preset-fbjs "^3.4.0" chalk "^4.0.0" fb-watchman "^2.0.0" fbjs "^3.0.0" glob "^7.1.1" immutable "~3.7.6" + invariant "^2.2.4" nullthrows "^1.1.1" - relay-runtime "10.1.0" + relay-runtime "12.0.0" signedsource "^1.0.0" yargs "^15.3.1" -relay-runtime@10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/relay-runtime/-/relay-runtime-10.1.0.tgz#4753bf36e95e8d862cef33608e3d98b4ed730d16" - integrity sha512-bxznLnQ1ST6APN/cFi7l0FpjbZVchWQjjhj9mAuJBuUqNNCh9uV+UTRhpQF7Q8ycsPp19LHTpVyGhYb0ustuRQ== +relay-runtime@12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/relay-runtime/-/relay-runtime-12.0.0.tgz#1e039282bdb5e0c1b9a7dc7f6b9a09d4f4ff8237" + integrity sha512-QU6JKr1tMsry22DXNy9Whsq5rmvwr3LSZiiWV/9+DFpuTWvp+WFhobWMc8TC4OjKFfNhEZy7mOiqUAn5atQtug== dependencies: "@babel/runtime" "^7.0.0" fbjs "^3.0.0" + invariant "^2.2.4" remedial@^1.0.7: version "1.0.8" @@ -5175,6 +5835,16 @@ remove-trailing-spaces@^1.0.6: resolved "https://registry.yarnpkg.com/remove-trailing-spaces/-/remove-trailing-spaces-1.0.8.tgz#4354d22f3236374702f58ee373168f6d6887ada7" integrity sha512-O3vsMYfWighyFbTd8hk8VaSj9UAGENxAtX+//ugIst2RMk5e03h6RoIS+0ylsFxY1gvmPuAY/PO4It+gPEeySA== +repeat-element@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" + integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== + +repeat-string@^1.5.2, repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + replaceall@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/replaceall/-/replaceall-0.1.6.tgz#81d81ac7aeb72d7f5c4942adf2697a3220688d8e" @@ -5185,6 +5855,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= +require-like@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/require-like/-/require-like-0.1.2.tgz#ad6f30c13becd797010c468afa775c0c0a6b47fa" + integrity sha1-rW8wwTvs15cBDEaK+ndcDAprR/o= + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" @@ -5200,10 +5875,24 @@ resolve-from@^4.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve@^1.20.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@^1.20.0, resolve@^1.22.0: + version "1.22.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" + integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== + dependencies: + is-core-module "^2.8.1" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +resolve@^2.0.0-next.3: + version "2.0.0-next.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.3.tgz#d41016293d4a8586a39ca5d9b5f15cbea1f55e46" + integrity sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q== dependencies: is-core-module "^2.2.0" path-parse "^1.0.6" @@ -5231,31 +5920,50 @@ restore-cursor@^3.1.0: onetime "^5.1.0" signal-exit "^3.0.2" +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + retry@0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= +retry@0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== + reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@^3.0.0: +rewrite-imports@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/rewrite-imports/-/rewrite-imports-1.4.0.tgz#198ebb73f59cfee8d214516c774b6aeef2c54a6e" + integrity sha512-k4pGuRsZ6UMSLW4mxpKVxqvGAwXCC81ZnLD+o+S9/7b3+fZ/pguNLHZpZ7qgi/5AmtqzuzppInhaARBjjDquOA== + +rfdc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" + integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== + +rimraf@^2.5.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== dependencies: glob "^7.1.3" -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - run-async@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" @@ -5268,14 +5976,21 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^6.3.3, rxjs@^6.6.0, rxjs@^6.6.7: +rxjs@^6.3.3: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +rxjs@^7.5.5: + version "7.5.5" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.5.tgz#2ebad89af0f560f460ad5cc4213219e1f7dd4e9f" + integrity sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw== + dependencies: + tslib "^2.1.0" + +safe-buffer@^5.0.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -5285,7 +6000,14 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.1.0: +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -5303,21 +6025,23 @@ scuid@^1.1.0: resolved "https://registry.yarnpkg.com/scuid/-/scuid-1.1.0.tgz#d3f9f920956e737a60f72d0e4ad280bf324d5dab" integrity sha512-MuCAyrGZcTLfQoH2XoBlQ8C6bzwN88XT/0slOGz0pn8+gIP85BOAfYa44ZXQUTOwRwPU0QvgU+V+OSajl/59Xg== -semver-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" - integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= - semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: +semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.3.5: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + sentence-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/sentence-case/-/sentence-case-3.0.4.tgz#3645a7b8c117c787fde8702056225bb62a45131f" @@ -5332,24 +6056,21 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= -setimmediate@^1.0.4, setimmediate@^1.0.5: +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -5362,35 +6083,32 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -shell-quote@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" - integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== signedsource@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/signedsource/-/signedsource-1.0.0.tgz#1ddace4981798f93bd833973803d80d52e93ad6a" integrity sha1-HdrOSYF5j5O9gzlzgD2A1S6TrWo= -simple-swizzle@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" - integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= - dependencies: - is-arrayish "^0.3.1" - sirv@^1.0.7: - version "1.0.12" - resolved "https://registry.yarnpkg.com/sirv/-/sirv-1.0.12.tgz#d816c882b35489b3c63290e2f455ae3eccd5f652" - integrity sha512-+jQoCxndz7L2tqQL4ZyzfDhky0W/4ZJip3XoOuxyQWnAwMxindLl3Xv1qT4x1YX/re0leShvTm8Uk0kQspGhBg== + version "1.0.19" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-1.0.19.tgz#1d73979b38c7fe91fcba49c85280daa9c2363b49" + integrity sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ== dependencies: - "@polka/url" "^1.0.0-next.15" - mime "^2.3.1" + "@polka/url" "^1.0.0-next.20" + mrmime "^1.0.0" totalist "^1.0.0" slash@^3.0.0: @@ -5421,6 +6139,14 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" +slice-ansi@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-5.0.0.tgz#b73063c57aa96f9cd881654b15294d95d285c42a" + integrity sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ== + dependencies: + ansi-styles "^6.0.0" + is-fullwidth-code-point "^4.0.0" + snake-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" @@ -5429,41 +6155,82 @@ snake-case@^3.0.4: dot-case "^3.0.4" tslib "^2.0.3" -source-map-js@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e" - integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug== +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +source-map-js@^1.0.1, source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + +source-map-resolve@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" source-map-support@^0.5.17: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" -source-map@0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== +source-map-url@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" + integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== -source-map@0.8.0-beta.0: - version "0.8.0-beta.0" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.8.0-beta.0.tgz#d4c1bb42c3f7ee925f005927ba10709e0d1d1f11" - integrity sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA== - dependencies: - whatwg-url "^7.0.0" - -source-map@^0.5.0: +source-map@^0.5.0, source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0, source-map@^0.6.1: +source-map@^0.6.0: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + sponge-case@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/sponge-case/-/sponge-case-1.0.1.tgz#260833b86453883d974f84854cdb63aecc5aef4c" @@ -5471,63 +6238,15 @@ sponge-case@^1.0.1: dependencies: tslib "^2.0.3" -stacktrace-parser@0.1.10: - version "0.1.10" - resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" - integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= dependencies: - type-fest "^0.7.1" + define-property "^0.2.5" + object-copy "^0.1.0" -"statuses@>= 1.5.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -stream-browserify@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f" - integrity sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA== - dependencies: - inherits "~2.0.4" - readable-stream "^3.5.0" - -stream-browserify@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" - integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== - dependencies: - inherits "~2.0.1" - readable-stream "^2.0.2" - -stream-http@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-3.1.1.tgz#0370a8017cf8d050b9a8554afe608f043eaff564" - integrity sha512-S7OqaYu0EkFpgeGFb/NPOoPLxFko7TPqtEeFg5DXPB4v/KETHG0Ln6fRFrNezoelpaDKmycEmmZ81cC9DAwgYg== - dependencies: - builtin-status-codes "^3.0.0" - inherits "^2.0.4" - readable-stream "^3.6.0" - xtend "^4.0.2" - -stream-http@^2.7.2: - version "2.8.3" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" - integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== - dependencies: - builtin-status-codes "^3.0.0" - inherits "^2.0.1" - readable-stream "^2.3.6" - to-arraybuffer "^1.0.0" - xtend "^4.0.0" - -stream-parser@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/stream-parser/-/stream-parser-0.3.1.tgz#1618548694420021a1182ff0af1911c129761773" - integrity sha1-FhhUhpRCACGhGC/wrxkRwSl2F3M= - dependencies: - debug "2" - -string-argv@0.3.1: +string-argv@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== @@ -5537,11 +6256,6 @@ string-env-interpolation@1.0.1, string-env-interpolation@^1.0.1: resolved "https://registry.yarnpkg.com/string-env-interpolation/-/string-env-interpolation-1.0.1.tgz#ad4397ae4ac53fe6c91d1402ad6f6a52862c7152" integrity sha512-78lwMoCcn0nNu8LszbP1UA7g55OeE4v7rCeWnM5B453rnNr4aq+5it3FEYtZrSEiMvHZOZ9Jlqb0OD0M2VInqg== -string-hash@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b" - integrity sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs= - string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -5559,14 +6273,37 @@ string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5" - integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA== +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" + +string-width@^5.0.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + +string.prototype.matchall@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.6.tgz#5abb5dabc94c7b0ea2380f65ba610b3a544b15fa" + integrity sha512-6WgDX8HmQqvEd7J+G6VtAahhsQIssiZ8zl7zKh1VDMFyL3hRTJP4FTNA3RbIp2TOQ9AYNDcc7e3fH0Qbup+DBg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + get-intrinsic "^1.1.1" + has-symbols "^1.0.2" + internal-slot "^1.0.3" + regexp.prototype.flags "^1.3.1" + side-channel "^1.0.4" string.prototype.trimend@^1.0.4: version "1.0.4" @@ -5584,7 +6321,7 @@ string.prototype.trimstart@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" -string_decoder@1.3.0, string_decoder@^1.0.0, string_decoder@^1.1.1: +string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== @@ -5598,22 +6335,6 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -stringify-object@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" - integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== - dependencies: - get-own-enumerable-property-symbols "^3.0.0" - is-obj "^1.0.1" - is-regexp "^1.0.0" - -strip-ansi@6.0.0, strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== - dependencies: - ansi-regex "^5.0.0" - strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -5628,44 +6349,57 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" + integrity sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw== + dependencies: + ansi-regex "^6.0.1" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + strip-final-newline@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -styled-jsx@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-3.3.2.tgz#2474601a26670a6049fb4d3f94bd91695b3ce018" - integrity sha512-daAkGd5mqhbBhLd6jYAjYBa9LpxYCzsgo/f6qzPdFxVB8yoGbhxvzQgkC0pfmCVvW3JuAEBn0UzFLBfkHVZG1g== +stripe@^8.197.0: + version "8.207.0" + resolved "https://registry.yarnpkg.com/stripe/-/stripe-8.207.0.tgz#4b7002f19cecefbc3c48f09f6658c39e359f99c1" + integrity sha512-ZCjdqN2adGfrC5uAAo0v7IquzaiQ3+pDzB324/iV3Q3Deiot9VO7KMVSNVx/0i6E6ywhgV33ko3FMT7iUgxKYA== dependencies: - "@babel/types" "7.8.3" - babel-plugin-syntax-jsx "6.18.0" - convert-source-map "1.7.0" - loader-utils "1.2.3" - source-map "0.7.3" - string-hash "1.1.3" - stylis "3.5.4" - stylis-rule-sheet "0.0.10" + "@types/node" ">=8.1.0" + qs "^6.6.0" -stylis-rule-sheet@0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz#44e64a2b076643f4b52e5ff71efc04d8c3c4a430" - integrity sha512-nTbZoaqoBnmK+ptANthb10ZRZOGC+EmTLLUxeYIuHNkEKcmKgXX1XWKkUBT2Ac4es3NybooPe0SmvKdhKJZAuw== +styled-jsx@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.0.tgz#816b4b92e07b1786c6b7111821750e0ba4d26e77" + integrity sha512-qUqsWoBquEdERe10EW8vLp3jT25s/ssG1/qX5gZ4wu15OZpmSMFI2v+fWlRhLfykA5rFtlJ1ME8A8pm/peV4WA== -stylis@3.5.4: - version "3.5.4" - resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.5.4.tgz#f665f25f5e299cf3d64654ab949a57c768b73fbe" - integrity sha512-8/3pSmthWM7lsPBKv7NXkzn2Uc9W7NotcwGNpJaa3k7WMM1XDCA4MgT5k/8BIexd5ydZdboXtU90XH9Ec4Bv/Q== - -subscriptions-transport-ws@^0.9.18: - version "0.9.19" - resolved "https://registry.yarnpkg.com/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.19.tgz#10ca32f7e291d5ee8eb728b9c02e43c52606cdcf" - integrity sha512-dxdemxFFB0ppCLg10FTtRqH/31FNRL1y1BQv8209MK5I4CwALb7iihQg+7p65lFcIl8MHatINWBLOqpgU4Kyyw== +subscriptions-transport-ws@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/subscriptions-transport-ws/-/subscriptions-transport-ws-0.11.0.tgz#baf88f050cba51d52afe781de5e81b3c31f89883" + integrity sha512-8D4C6DIH5tGiAIpp5I0wD/xRlNiZAPGHygzCe7VzyzUoxHtawzjNAY9SUTXU05/EY2NMY9/9GF0ycizkXr1CWQ== dependencies: backo2 "^1.0.2" eventemitter3 "^3.1.0" @@ -5685,13 +6419,6 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -supports-color@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" - integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== - dependencies: - has-flag "^3.0.0" - supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -5699,12 +6426,15 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" +supports-color@^9.2.1: + version "9.2.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-9.2.1.tgz#599dc9d45acf74c6176e0d880bab1d7d718fe891" + integrity sha512-Obv7ycoCTG51N7y175StI9BlAXrmgZrFhZOb0/PyjHBher/NmsdBgbbQ1Inhq+gIhz6+7Gb+jWF2Vqi7Mf1xnQ== + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== swap-case@^2.0.2: version "2.0.2" @@ -5726,79 +6456,82 @@ swell-js@^4.0.0-next.0: object-merge-advanced "12.0.3" qs "6.7.0" -swr@^0.5.6: - version "0.5.6" - resolved "https://registry.yarnpkg.com/swr/-/swr-0.5.6.tgz#70bfe9bc9d7ac49a064be4a0f4acf57982e55a31" - integrity sha512-Bmx3L4geMZjYT5S2Z6EE6/5Cx6v1Ka0LhqZKq8d6WL2eu9y6gHWz3dUzfIK/ymZVHVfwT/EweFXiYGgfifei3w== - dependencies: - dequal "2.0.2" +swr@^1.2.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/swr/-/swr-1.2.2.tgz#6cae09928d30593a7980d80f85823e57468fac5d" + integrity sha512-ky0BskS/V47GpW8d6RU7CPsr6J8cr7mQD6+do5eky3bM0IyJaoi3vO8UhvrzJaObuTlGhPl2szodeB2dUd76Xw== symbol-observable@^1.0.4, symbol-observable@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== -sync-fetch@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/sync-fetch/-/sync-fetch-0.3.0.tgz#77246da949389310ad978ab26790bb05f88d1335" - integrity sha512-dJp4qg+x4JwSEW1HibAuMi0IIrBI3wuQr2GimmqB7OXR50wmwzfdusG+p39R9w3R6aFtZ2mzvxvWKQ3Bd/vx3g== +sync-fetch@0.3.1, sync-fetch@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/sync-fetch/-/sync-fetch-0.3.1.tgz#62aa82c4b4d43afd6906bfd7b5f92056458509f0" + integrity sha512-xj5qiCDap/03kpci5a+qc5wSJjc8ZSixgG2EUmH1B8Ea2sfWclQA7eH40hiHPCtkCn6MCk4Wb+dqcXdCy2PP3g== dependencies: buffer "^5.7.0" node-fetch "^2.6.1" -tabbable@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-5.2.0.tgz#4fba60991d8bb89d06e5d9455c92b453acf88fb2" - integrity sha512-0uyt8wbP0P3T4rrsfYg/5Rg3cIJ8Shl1RJ54QMqYxm1TLdWqJD1u6+RQjr2Lor3wmfT7JRHkirIwy99ydBsyPg== +tabbable@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-5.2.1.tgz#e3fda7367ddbb172dcda9f871c0fdb36d1c4cd9c" + integrity sha512-40pEZ2mhjaZzK0BnI+QGNjJO8UYx9pP5v7BGe17SORTO0OEuuaAwQTkAp8whcZvqon44wKFOikD+Al11K3JICQ== -tailwindcss@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-2.2.2.tgz#28a99c87b5a6b2bf6298a77d88dc0590e84fa8ee" - integrity sha512-OzFWhlnfrO3JXZKHQiqZcb0Wwl3oJSmQ7PvT2jdIgCjV5iUoAyql9bb9ZLCSBI5TYXmawujXAoNxXVfP5Auy/Q== +tailwindcss@^3.0.13: + version "3.0.23" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.0.23.tgz#c620521d53a289650872a66adfcb4129d2200d10" + integrity sha512-+OZOV9ubyQ6oI2BXEhzw4HrqvgcARY38xv3zKcjnWtMIZstEsXdI9xftd1iB7+RbOnj2HOEzkA0OyB5BaSxPQA== dependencies: - "@fullhuman/postcss-purgecss" "^4.0.3" - arg "^5.0.0" - bytes "^3.0.0" - chalk "^4.1.1" - chokidar "^3.5.1" - color "^3.1.3" - cosmiconfig "^7.0.0" + arg "^5.0.1" + chalk "^4.1.2" + chokidar "^3.5.3" + color-name "^1.1.4" + cosmiconfig "^7.0.1" detective "^5.2.0" - didyoumean "^1.2.1" + didyoumean "^1.2.2" dlv "^1.1.3" - fast-glob "^3.2.5" - fs-extra "^10.0.0" - glob-parent "^6.0.0" - html-tags "^3.1.0" - is-glob "^4.0.1" - lodash "^4.17.21" - lodash.topath "^4.5.2" - modern-normalize "^1.1.0" - node-emoji "^1.8.1" + fast-glob "^3.2.11" + glob-parent "^6.0.2" + is-glob "^4.0.3" normalize-path "^3.0.0" object-hash "^2.2.0" - postcss-js "^3.0.3" - postcss-load-config "^3.0.1" - postcss-nested "5.0.5" - postcss-selector-parser "^6.0.6" - postcss-value-parser "^4.1.0" - pretty-hrtime "^1.0.3" + postcss "^8.4.6" + postcss-js "^4.0.0" + postcss-load-config "^3.1.0" + postcss-nested "5.0.6" + postcss-selector-parser "^6.0.9" + postcss-value-parser "^4.2.0" quick-lru "^5.1.1" - reduce-css-calc "^2.1.8" - resolve "^1.20.0" - tmp "^0.2.1" + resolve "^1.22.0" + +taskr@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/taskr/-/taskr-1.1.0.tgz#4f29d0ace26f4deae9a478eabf9aa0432e884438" + integrity sha1-TynQrOJvTerppHjqv5qgQy6IRDg= + dependencies: + bluebird "^3.5.0" + clor "^5.1.0" + glob "^7.1.2" + mk-dirs "^1.0.0" + mri "^1.1.0" + tinydate "^1.0.0" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= through@^2.3.6, through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= -timers-browserify@2.0.12, timers-browserify@^2.0.4: - version "2.0.12" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.12.tgz#44a45c11fbf407f34f97bccd1577c652361b00ee" - integrity sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ== - dependencies: - setimmediate "^1.0.4" +tinydate@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/tinydate/-/tinydate-1.3.0.tgz#e6ca8e5a22b51bb4ea1c3a2a4fd1352dbd4c57fb" + integrity sha512-7cR8rLy2QhYHpsBDBVYnnWXm8uRTr38RoZakFSW7Bs7PzfMPNZthuMLkwqZv7MTu8lhQ91cOFYS5a7iFj2oR3w== title-case@^3.0.3: version "3.0.3" @@ -5814,28 +6547,31 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" -tmp@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" - integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== - dependencies: - rimraf "^3.0.0" - -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= - to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + to-readable-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -5843,27 +6579,30 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" totalist@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df" integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g== -tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= - dependencies: - punycode "^2.1.0" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= ts-log@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/ts-log/-/ts-log-2.2.3.tgz#4da5640fe25a9fb52642cd32391c886721318efb" - integrity sha512-XvB+OdKSJ708Dmf9ore4Uf/q62AYDTzFcAdxc8KNML1mmAWywRFVt/dn1KYJH8Agt5UJNujfM3znU5PxgAzA2w== + version "2.2.4" + resolved "https://registry.yarnpkg.com/ts-log/-/ts-log-2.2.4.tgz#d672cf904b33735eaba67a7395c93d45fba475b3" + integrity sha512-DEQrfv6l7IvN2jlzc/VTdZJYsWUnQNCsueYjMkC/iXoEoi5fNan6MjeDqkvhfzbmHgdz9UxDUluX3V5HdjTydQ== ts-node@^9: version "9.1.1" @@ -5877,65 +6616,142 @@ ts-node@^9: source-map-support "^0.5.17" yn "3.1.1" -ts-pnp@^1.1.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92" - integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw== +tsconfig-paths@^3.12.0, tsconfig-paths@^3.9.0: + version "3.13.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.13.0.tgz#f3e9b8f6876698581d94470c03c95b3a48c0e3d7" + integrity sha512-nWuffZppoaYK0vQ1SQmkSsQzJoHA4s6uzdb2waRpD806x9yfq153AdVsWz4je2qZcW+pENrMQXbGQ3sMCkXuhw== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.0" + strip-bom "^3.0.0" -tslib@^1.9.0: +tslib@^1.8.1, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2, tslib@^2.0.3, tslib@^2.1.0, tslib@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e" - integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg== +tslib@^2, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@~2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" + integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== -tslib@~2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" - integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ== +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" -tslib@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" - integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== +turbo-darwin-64@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-1.1.5.tgz#7800af2d0a20df5ff674a8a6fb96d32957d11f48" + integrity sha512-qdGMylQ408NmYhzuMmx+25W0iHFyFMRPO4579tDEv+WBiVDfAEYEzjajE4c+CQOLhd1aVEaPdSa+YhngQUgoDQ== -tslib@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.2.0.tgz#fb2c475977e35e241311ede2693cee1ec6698f5c" - integrity sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w== +turbo-darwin-arm64@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo-darwin-arm64/-/turbo-darwin-arm64-1.1.5.tgz#d70a9b791c1d2a930f1ac49fdf4ab6728b19fa7b" + integrity sha512-mXU324d3vYzxRT9FSSkW9yG2BvFosd0f4DUvqy4qms8wzM6Yv9Aeo4zZTL86rF88UYGUkbiRaPQUeceb/QARVg== -tty-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= +turbo-freebsd-64@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo-freebsd-64/-/turbo-freebsd-64-1.1.5.tgz#39808f38d6af1400dd3bad0531c18444d9df9eab" + integrity sha512-qjjPTnZKOxw2x1Ito3yZAYDcwsCEg/5kYJwbPVvDn1jyXoxr3pUxTHUohroxQ6EmyxQ28qL7QpCVWDoQpDwrOQ== -tty-browserify@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" - integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== +turbo-freebsd-arm64@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo-freebsd-arm64/-/turbo-freebsd-arm64-1.1.5.tgz#91b3b71b7a34d9845179cc8d6bdc5c28de252885" + integrity sha512-jYW+Th9Y6yEYevaFe7v3lFQoxyrpd8wX5KuuvqLazMRbNxvKgqTDmT7AbCOGJY5ejzqGnMlTGkQr8c3g3B8ndA== + +turbo-linux-32@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo-linux-32/-/turbo-linux-32-1.1.5.tgz#9fc0970d2aa20871e9541f3d7d228c5c81b4b853" + integrity sha512-c5I8tdR1jD8L8pJWk+rlO734bpWI1gwGdvNOaA/IGZxzOfDSn4CGoUErnUPgOadT8azi7lT9UPQf/pLfEvjCOw== + +turbo-linux-64@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo-linux-64/-/turbo-linux-64-1.1.5.tgz#2bb481bf0634b4ad578752cfb6f81fbbc2794568" + integrity sha512-BZAxLfIkEtQa7u+VPYpdeVVJH6ab4WwXv4oCrUDaZf2BseDUxr57y2ASAWNFsg40T3oXXt4Kcbdc5LibjWQdtQ== + +turbo-linux-arm64@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo-linux-arm64/-/turbo-linux-arm64-1.1.5.tgz#bb4ad4ba101d72363d6b191c8a6f4de84631aeea" + integrity sha512-8/yz5L0B6Jb0pNcvx/08LcPswizqggxQ0zlFEw+Oh9RAC+ZM5+X2YiMyKolvLCpkoRqrlKku0lmXH7mx6DWbig== + +turbo-linux-arm@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo-linux-arm/-/turbo-linux-arm-1.1.5.tgz#ba321a3b6086a0e633cff41c1a1312245240abe9" + integrity sha512-X6J05gQSWTc2c/TCkOQdFLhr35pUjEExY6K8yanYs2QKgd4GvDHmxYaBZ+6f90qcIUHYpe++adDPJcuAUv+8ug== + +turbo-linux-mips64le@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo-linux-mips64le/-/turbo-linux-mips64le-1.1.5.tgz#70f544e38317a536170636dfef1f68e9ebae7746" + integrity sha512-K26bEFcLDGPkcaW7Eq4CMSxUbJf/x58aE92+0tONhrxXzamaBqTrSxPYlk/T8OoH7HxOvja2ctkpeI/NRAoIyw== + +turbo-linux-ppc64le@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo-linux-ppc64le/-/turbo-linux-ppc64le-1.1.5.tgz#2a6c8bda8a61d1c09a7bb95942a285c4f6cf9cba" + integrity sha512-fr1/5yf8fe1BJiW/6Y9lmV+kxZZC3u3xvSBC5AXDSl9u3aJFZl96CRE9tOJbTZMaOVGxhplKD+EiHbjIxUnTrA== + +turbo-windows-32@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo-windows-32/-/turbo-windows-32-1.1.5.tgz#3606e5b860e8d6c33f7dc6fa12ed7414d4862f20" + integrity sha512-K9LdIgQXJ7jL0aLJS0l2asJAH/vYBFP7qFzODiAcJ1EeKBjYqAVnIxFQrUN07lzNDtL9WK/aN5q0bJCDnhwTQw== + +turbo-windows-64@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-1.1.5.tgz#aeeef0d598b8d1c17170a676a29b2ff0839d0069" + integrity sha512-c2Jkmw8yGZVz4opzEvB5HAf9XkA8CZBnorie46s44ec0FaNbcP9SCuUNvgAHxqDIHTGWC4A5PoPn0owkD3ss6A== + +turbo@^1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/turbo/-/turbo-1.1.5.tgz#2ca8a1bcfd9de4c59feaff022672ffd2c4fbc4b4" + integrity sha512-jXW8G4lr01/E/jS/66LYpEjwWFQAksC8TxR8gi3VGea7OeNj28l8zmXoY3IgT5H22MBnhmtOKV/GhsbPjI2Jrg== + optionalDependencies: + turbo-darwin-64 "1.1.5" + turbo-darwin-arm64 "1.1.5" + turbo-freebsd-64 "1.1.5" + turbo-freebsd-arm64 "1.1.5" + turbo-linux-32 "1.1.5" + turbo-linux-64 "1.1.5" + turbo-linux-arm "1.1.5" + turbo-linux-arm64 "1.1.5" + turbo-linux-mips64le "1.1.5" + turbo-linux-ppc64le "1.1.5" + turbo-windows-32 "1.1.5" + turbo-windows-64 "1.1.5" + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== type-fest@^0.21.3: version "0.21.3" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-fest@^0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" - integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== - typescript@4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc" integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew== -ua-parser-js@^0.7.18: - version "0.7.28" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.28.tgz#8ba04e653f35ce210239c64661685bf9121dec31" - integrity sha512-6Gurc1n//gjp9eQNXjD9O3M/sMwVtN5S8Lv9bvOYBfKfDNiIIhqiyi01vMBO45u4zkDE420w/e0se7Vs+sIg+g== +typescript@^4.5.4: + version "4.6.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.2.tgz#fe12d2727b708f4eef40f51598b3398baa9611d4" + integrity sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg== + +ua-parser-js@^0.7.30: + version "0.7.31" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.31.tgz#649a656b191dffab4f21d5e053e27ca17cbff5c6" + integrity sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ== unbox-primitive@^1.0.1: version "1.0.1" @@ -5952,27 +6768,35 @@ unc-path-regex@^0.1.2: resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= -uniq@^1.0.1: +undici@^4.9.3: + version "4.15.1" + resolved "https://registry.yarnpkg.com/undici/-/undici-4.15.1.tgz#c2c0e75f232178f0e6781f6b46c81ccc15065f6e" + integrity sha512-h8LJybhMKD09IyQZoQadNtIR/GmugVhTOVREunJrpV6RStriKBFdSVoFzEzTihwXi/27DIBO+Z0OGF+Mzfi0lA== + +union-value@^1.0.0: version "1.0.1" - resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" - integrity sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8= + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" -universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== - -unixify@1.0.0: +unixify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unixify/-/unixify-1.0.0.tgz#3a641c8c2ffbce4da683a5c70f03a462940c2090" integrity sha1-OmQcjC/7zk2mg6XHDwOkYpQMIJA= dependencies: normalize-path "^2.1.1" -unpipe@1.0.0: +unset-value@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" upper-case-first@^2.0.2: version "2.0.2" @@ -5988,6 +6812,18 @@ upper-case@^2.0.2: dependencies: tslib "^2.0.3" +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + url-parse-lax@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" @@ -5995,14 +6831,6 @@ url-parse-lax@^3.0.0: dependencies: prepend-http "^2.0.0" -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= - dependencies: - punycode "1.3.2" - querystring "0.2.0" - use-subscription@1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/use-subscription/-/use-subscription-1.5.1.tgz#73501107f02fad84c6dd57965beb0b75c68c42d1" @@ -6010,6 +6838,11 @@ use-subscription@1.5.1: dependencies: object-assign "^4.1.1" +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -6023,84 +6856,55 @@ util-nonempty@^3.0.6: "@babel/runtime" "^7.14.0" lodash.isplainobject "^4.0.6" -util@0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= - dependencies: - inherits "2.0.1" - -util@0.12.3: - version "0.12.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.12.3.tgz#971bb0292d2cc0c892dab7c6a5d37c2bec707888" - integrity sha512-I8XkoQwE+fPQEhy9v012V+TSdH2kp9ts29i20TaaDUXsg7x/onePbhFJUExBfv/2ay1ZOp/Vsm3nDlmnFGSAog== - dependencies: - inherits "^2.0.3" - is-arguments "^1.0.4" - is-generator-function "^1.0.7" - is-typed-array "^1.1.3" - safe-buffer "^5.1.2" - which-typed-array "^1.1.2" - -util@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" - integrity sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ== - dependencies: - inherits "2.0.3" - -util@^0.12.0: - version "0.12.4" - resolved "https://registry.yarnpkg.com/util/-/util-0.12.4.tgz#66121a31420df8f01ca0c464be15dfa1d1850253" - integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw== - dependencies: - inherits "^2.0.3" - is-arguments "^1.0.4" - is-generator-function "^1.0.7" - is-typed-array "^1.1.3" - safe-buffer "^5.1.2" - which-typed-array "^1.1.2" - uuid@8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuidv4@^6.2.10: - version "6.2.11" - resolved "https://registry.yarnpkg.com/uuidv4/-/uuidv4-6.2.11.tgz#34d5a03324eb38296b87ae523a64233b5286cc27" - integrity sha512-OTS4waH9KplrXNADKo+Q1kT9AHWr8DaC0S5F54RQzEwcUaEzBEWQQlJyDUw/u1bkRhJyqkqhLD4M4lbFbV+89g== +uuidv4@^6.2.12: + version "6.2.12" + resolved "https://registry.yarnpkg.com/uuidv4/-/uuidv4-6.2.12.tgz#e8c1d1d733c3fa4963d4610b8a3a09b4ec58ca96" + integrity sha512-UnN4ThIYWhv3ZUE8UwDnnCvh4JafCNu+sQkxmLyjCVwK3rjLfkg3DYiEv6oCMDIAIVEDP4INg4kX/C5hKaRzZA== dependencies: "@types/uuid" "8.3.1" uuid "8.3.2" -valid-url@1.0.9, valid-url@^1.0.9: +v8-compile-cache@^2.0.3: + version "2.3.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" + integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== + +valid-url@^1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200" integrity sha1-HBRHm0DxOXp1eC8RXkCGRHQzogA= -value-or-promise@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.6.tgz#218aa4794aa2ee24dcf48a29aba4413ed584747f" - integrity sha512-9r0wQsWD8z/BxPOvnwbPf05ZvFngXyouE9EKB+5GbYix+BYnAwrIChCUyFIinfbf2FL/U71z+CPpbnmTdxrwBg== +value-or-promise@1.0.11, value-or-promise@^1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.11.tgz#3e90299af31dd014fe843fe309cefa7c1d94b140" + integrity sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg== -vm-browserify@1.1.2, vm-browserify@^1.0.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" - integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== - -watchpack@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.1.1.tgz#e99630550fca07df9f90a06056987baa40a689c7" - integrity sha512-Oo7LXCmc1eE1AjyuSBmtC3+Wy4HcV8PxWh2kP6fOl8yTlNS7r0K9l1ao2lrrUza7V39Y3D/BbJgY8VeSlc5JKw== +wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= dependencies: - glob-to-regexp "^0.4.1" - graceful-fs "^4.1.2" + defaults "^1.0.3" -webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== +web-streams-polyfill@4.0.0-beta.1: + version "4.0.0-beta.1" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.1.tgz#3b19b9817374b7cee06d374ba7eeb3aeb80e8c95" + integrity sha512-3ux37gEX670UUphBF9AMCq8XM6iQ8Ac6A+DSRRjDoRBm1ufCkaCDdNVbaqq60PsEkdNlLKrGtv/YBP4EJXqNtQ== + +web-streams-polyfill@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz#a6b74026b38e4885869fb5c589e90b95ccfc7965" + integrity sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA== + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= webpack-bundle-analyzer@4.3.0: version "4.3.0" @@ -6122,14 +6926,13 @@ whatwg-fetch@^3.4.1: resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== -whatwg-url@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" - integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" + tr46 "~0.0.3" + webidl-conversions "^3.0.0" which-boxed-primitive@^1.0.2: version "1.0.2" @@ -6147,19 +6950,6 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which-typed-array@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.4.tgz#8fcb7d3ee5adf2d771066fba7cf37e32fe8711ff" - integrity sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA== - dependencies: - available-typed-arrays "^1.0.2" - call-bind "^1.0.0" - es-abstract "^1.18.0-next.1" - foreach "^2.0.5" - function-bind "^1.1.1" - has-symbols "^1.0.1" - is-typed-array "^1.1.3" - which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" @@ -6167,6 +6957,11 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + wrap-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" @@ -6198,17 +6993,17 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -ws@7.4.5: - version "7.4.5" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.5.tgz#a484dd851e9beb6fdb420027e3885e8ce48986c1" - integrity sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g== - "ws@^5.2.0 || ^6.0.0 || ^7.0.0", ws@^7.3.1: - version "7.5.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.0.tgz#0033bafea031fb9df041b2026fc72a571ca44691" - integrity sha512-6ezXvzOZupqKj4jUqbQ9tXuJNo+BR2gU8fFRk3XCP3e0G6WT414u5ELe6Y0vtp7kmSJ3F7YWObSNr1ESsgi4vw== + version "7.5.7" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" + integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A== -xtend@^4.0.0, xtend@^4.0.2: +ws@^8.3.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" + integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg== + +xtend@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== @@ -6228,6 +7023,11 @@ yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + yaml-ast-parser@^0.0.43: version "0.0.43" resolved "https://registry.yarnpkg.com/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz#e8a23e6fb4c38076ab92995c5dca33f3d3d7c9bb" @@ -6246,10 +7046,10 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== +yargs-parser@^21.0.0: + version "21.0.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" + integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== yargs@^15.3.1: version "15.4.1" @@ -6269,17 +7069,17 @@ yargs@^15.3.1: yargs-parser "^18.1.2" yargs@^17.0.0: - version "17.0.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.0.1.tgz#6a1ced4ed5ee0b388010ba9fd67af83b9362e0bb" - integrity sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ== + version "17.3.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.3.1.tgz#da56b28f32e2fd45aefb402ed9c26f42be4c07b9" + integrity sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA== dependencies: cliui "^7.0.2" escalade "^3.1.1" get-caller-file "^2.0.5" require-directory "^2.1.1" - string-width "^4.2.0" + string-width "^4.2.3" y18n "^5.0.5" - yargs-parser "^20.2.2" + yargs-parser "^21.0.0" yn@3.1.1: version "3.1.1"