diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..11ebf4e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,23 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +tab_width = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[*.js] +quote_type = single + +[{*.c,*.cc,*.h,*.hh,*.cpp,*.hpp,*.m,*.mm,*.mpp,*.js,*.java,*.go,*.rs,*.php,*.ng,*.jsx,*.ts,*.d,*.cs,*.swift}] +curly_bracket_next_line = false +spaces_around_operators = true +spaces_around_brackets = outside +# close enough to 1TB +indent_brace_style = K&R diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b7301fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +# 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 +dist + +# 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 + +# Turborepo +.turbo diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..1c8b279 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +# Every package defines its prettier config +node_modules +dist +.next +public diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..e1076ed --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..60907f7 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "esbenp.prettier-vscode", + "csstools.postcss", + "bradlc.vscode-tailwindcss", + "ms-vscode.vscode-typescript-next" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9bf4d12 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true +} diff --git a/ISSUE_TEMPLATE/1.core_bug_report.yml b/ISSUE_TEMPLATE/1.core_bug_report.yml new file mode 100644 index 0000000..6d38488 --- /dev/null +++ b/ISSUE_TEMPLATE/1.core_bug_report.yml @@ -0,0 +1,55 @@ +name: Core package Bug Report +description: Create a bug report for the Next.js commerce core package +labels: 'template: core bug' +body: + - type: markdown + attributes: + value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible. + - type: checkboxes + attributes: + label: Verify latest commit + description: `main` is the latest version of Next.js Commerce. + options: + - label: I verified that the issue exists on `main` + required: true + - type: textarea + attributes: + label: Provide environment information + description: Please run `npx --no-install next info` in the root directory of your project and paste the results. + validations: + required: true + - type: input + attributes: + label: What browser are you using? (if relevant) + description: 'Please specify the exact version. For example: Chrome 100.0.4878.0' + - type: input + attributes: + label: How are you deploying your application? (if relevant) + description: 'For example: next start, next export, Vercel, Other platform' + - type: textarea + attributes: + label: Describe the Bug + description: A clear and concise description of what the bug is. + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: A clear and concise description of what you expected to happen. + validations: + required: true + - type: textarea + attributes: + label: To Reproduce + description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below. + validations: + required: true + - type: markdown + attributes: + value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. + - type: markdown + attributes: + value: Contributors should be able to follow the steps provided in order to reproduce the bug. + - type: markdown + attributes: + value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance! diff --git a/ISSUE_TEMPLATE/2.provider_bug_report.yml b/ISSUE_TEMPLATE/2.provider_bug_report.yml new file mode 100644 index 0000000..a600c37 --- /dev/null +++ b/ISSUE_TEMPLATE/2.provider_bug_report.yml @@ -0,0 +1,59 @@ +name: Provider package Bug Report +description: Create a bug report for the Next.js commerce core package +labels: 'template: provider bug' +body: + - type: markdown + attributes: + value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible. + - type: checkboxes + attributes: + label: Verify latest commit + description: `main` is the latest version of Next.js Commerce. + options: + - label: I verified that the issue exists on `main` + required: true + - type: textarea + attributes: + label: Provide environment information + description: Please run `npx --no-install next info` in the root directory of your project and paste the results. + validations: + required: true + - type: input + attributes: + label: What Provider are you using? + description: 'Please specify the provider package name. For example: `bigcommerce`' + - type: input + attributes: + label: What browser are you using? (if relevant) + description: 'Please specify the exact version. For example: Chrome 100.0.4878.0' + - type: input + attributes: + label: How are you deploying your application? (if relevant) + description: 'For example: next start, next export, Vercel, Other platform' + - type: textarea + attributes: + label: Describe the Bug + description: A clear and concise description of what the bug is. + validations: + required: true + - type: textarea + attributes: + label: Expected Behavior + description: A clear and concise description of what you expected to happen. + validations: + required: true + - type: textarea + attributes: + label: To Reproduce + description: Steps to reproduce the behavior, please provide a clear code snippets that always reproduces the issue or a GitHub repository. Screenshots can be provided in the issue body below. + validations: + required: true + - type: markdown + attributes: + value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. + - type: markdown + attributes: + value: Contributors should be able to follow the steps provided in order to reproduce the bug. + - type: markdown + attributes: + value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance! diff --git a/ISSUE_TEMPLATE/3.feature_request.yml b/ISSUE_TEMPLATE/3.feature_request.yml new file mode 100644 index 0000000..2655aff --- /dev/null +++ b/ISSUE_TEMPLATE/3.feature_request.yml @@ -0,0 +1,28 @@ +name: Feature Request +description: Create a feature request for the Next.js core +labels: 'template: story' +body: + - type: markdown + attributes: + value: Thanks for taking the time to file a feature request! Please fill out this form as completely as possible. + - type: markdown + attributes: + value: 'Feature requests will be converted to the GitHub Discussions "Ideas" section.' + - type: textarea + attributes: + label: Describe the feature you'd like to request + description: A clear and concise description of what you want and what your use case is. + validations: + required: true + - type: textarea + attributes: + label: Describe the solution you'd like + description: A clear and concise description of what you want to happen. + validations: + required: true + - type: textarea + attributes: + label: Describe alternatives you've considered + description: A clear and concise description of any alternative solutions or features you've considered. + validations: + required: true diff --git a/ISSUE_TEMPLATE/4.docs_request.yml b/ISSUE_TEMPLATE/4.docs_request.yml new file mode 100644 index 0000000..72acd89 --- /dev/null +++ b/ISSUE_TEMPLATE/4.docs_request.yml @@ -0,0 +1,18 @@ +name: 'Docs Request for an Update or Improvement' +description: A request to update or improve Next.js Commerce documentation +title: 'Docs: ' +labels: + - 'template: documentation' +body: + - type: textarea + attributes: + label: What is the improvement or update you wish to see? + description: 'Example: I would like to see more examples of how to use hooks.' + validations: + required: true + - type: textarea + attributes: + label: Is there any context that might help us understand? + description: A clear description of any added context that might help us understand. + validations: + required: true \ No newline at end of file diff --git a/ISSUE_TEMPLATE/config.yml b/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..dcefd31 --- /dev/null +++ b/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Ask a question + url: https://github.com/vercel/commerce/discussions + about: Ask questions and discuss with other community members diff --git a/README.md b/README.md new file mode 100644 index 0000000..1050201 --- /dev/null +++ b/README.md @@ -0,0 +1,198 @@ +[![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 + +The all-in-one starter kit for high-performance e-commerce sites. With a few clicks, Next.js developers can clone, deploy and fully customize their own store. +Start right now at [nextjs.org/commerce](https://nextjs.org/commerce) + +Demo live at: [demo.vercel.store](https://demo.vercel.store/) + +- Shopify Demo: https://shopify.vercel.store/ +- Swell Demo: https://swell.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/ +- SalesForce Cloud Commerce Demo: https://salesforce-cloud-commerce.vercel.store/ + +## Run minimal version locally + +> To run a minimal version of Next.js Commerce you can start with the default local provider `@vercel/commerce-local` that has disabled all features (cart, auth) and use static files for the backend + +```bash +yarn # run this command in root folder of the mono repo +yarn dev +``` + +> If you encounter any problems while installing and running for the first time, please see the Troubleshoot section + +## Features + +- Performant by default +- SEO Ready +- Internationalization +- Responsive +- UI Components +- Theming +- Standardized Data Hooks +- Integrations - Integrate seamlessly with the most common ecommerce platforms. +- Dark Mode Support + +## Integrations + +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 + +- `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. + +## Configuration + +### How to change providers + +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=@vercel/commerce-shopify +NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx +NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN=xxxxxxx.myshopify.com +``` + +### Features + +Every provider defines the features that it supports under `packages/{provider}/src/commerce.config.json` + +#### Features Available + +The following features can be enabled or disabled. This means that the UI will remove all code related to the feature. +For example: Turning `cart` off will disable Cart capabilities. + +- cart +- search +- wishlist +- customerAuth +- customCheckout + +#### How to turn Features on and off + +> 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 `site/commerce.config.json` +- You'll see a config file like this: + ```json + { + "features": { + "wishlist": false, + "customCheckout": true + } + } + ``` +- Turn `wishlist` on by setting `wishlist` to `true`. +- Run the app and the wishlist functionality should be back on. + +### How to create a new provider + +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. + +## Contribute + +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 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, @dominiksipowicz, @gbibeaul. + +## Troubleshoot + +
+I already own a BigCommerce store. What should I do? +
+First thing you do is: set your environment variables +
+
+.env.local + +```sh +BIGCOMMERCE_STOREFRONT_API_URL=<> +BIGCOMMERCE_STOREFRONT_API_TOKEN=<> +BIGCOMMERCE_STORE_API_URL=<> +BIGCOMMERCE_STORE_API_TOKEN=<> +BIGCOMMERCE_STORE_API_CLIENT_ID=<> +BIGCOMMERCE_CHANNEL_ID=<> +``` + +If your project was started with a "Deploy with Vercel" button, you can use Vercel's CLI to retrieve these credentials. + +1. Install Vercel CLI: `npm i -g vercel` +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.. + +
+ +
+BigCommerce shows a Coming Soon page and requests a Preview Code +
+After Email confirmation, Checkout should be manually enabled through BigCommerce platform. Look for "Review & test your store" section through BigCommerce's dashboard. +
+
+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/license.md b/license.md new file mode 100644 index 0000000..fa5d39b --- /dev/null +++ b/license.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Vercel, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package.json b/package.json new file mode 100644 index 0000000..fc97f30 --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "commerce", + "license": "MIT", + "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": { + "husky": "^7.0.4", + "prettier": "^2.5.1", + "turbo": "^1.1.2" + }, + "husky": { + "hooks": { + "pre-commit": "turbo run lint" + } + }, + "packageManager": "yarn@1.22.17" +} diff --git a/packages/bigcommerce/.env.template b/packages/bigcommerce/.env.template new file mode 100644 index 0000000..b5d12f5 --- /dev/null +++ b/packages/bigcommerce/.env.template @@ -0,0 +1,8 @@ +COMMERCE_PROVIDER=@vercel/commerce-bigcommerce + +BIGCOMMERCE_STOREFRONT_API_URL= +BIGCOMMERCE_STOREFRONT_API_TOKEN= +BIGCOMMERCE_STORE_API_URL= +BIGCOMMERCE_STORE_API_TOKEN= +BIGCOMMERCE_STORE_API_CLIENT_ID= +BIGCOMMERCE_CHANNEL_ID= diff --git a/packages/bigcommerce/.prettierignore b/packages/bigcommerce/.prettierignore new file mode 100644 index 0000000..f06235c --- /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 0000000..e1076ed --- /dev/null +++ b/packages/bigcommerce/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/bigcommerce/README.md b/packages/bigcommerce/README.md new file mode 100644 index 0000000..1e8c6cb --- /dev/null +++ b/packages/bigcommerce/README.md @@ -0,0 +1,59 @@ +# Bigcommerce Provider + +**Demo:** https://bigcommerce.demo.vercel.store/ + +With the deploy button below you'll be able to have a [BigCommerce](https://www.bigcommerce.com/) account and a store that works with this starter: + +[![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) + +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 packages/bigcommerce/.env.template .env.local +``` + +Then, set the environment variables in `.env.local` to match the ones from your store. + +## 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). + +## Troubleshoot + +
+I already own a BigCommerce store. What should I do? +
+First thing you do is: set your environment variables +
+
+.env.local + +```sh +BIGCOMMERCE_STOREFRONT_API_URL=<> +BIGCOMMERCE_STOREFRONT_API_TOKEN=<> +BIGCOMMERCE_STORE_API_URL=<> +BIGCOMMERCE_STORE_API_TOKEN=<> +BIGCOMMERCE_STORE_API_CLIENT_ID=<> +BIGCOMMERCE_CHANNEL_ID=<> +``` + +If your project was started with a "Deploy with Vercel" button, you can use Vercel's CLI to retrieve these credentials. + +1. Install Vercel CLI: `npm i -g vercel` +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. + +
+ +
+BigCommerce shows a Coming Soon page and requests a Preview Code +
+After Email confirmation, Checkout should be manually enabled through BigCommerce platform. Look for "Review & test your store" section through BigCommerce's dashboard. +
+
+BigCommerce team has been notified and they plan to add more detailed about this subject. +
diff --git a/packages/bigcommerce/codegen.json b/packages/bigcommerce/codegen.json new file mode 100644 index 0000000..7346508 --- /dev/null +++ b/packages/bigcommerce/codegen.json @@ -0,0 +1,27 @@ +{ + "schema": { + "https://buybutton.store/graphql": { + "headers": { + "Authorization": "Bearer xzy" + } + } + }, + "documents": [ + { + "./src/api/**/*.ts": { + "noRequire": true + } + } + ], + "generates": { + "./schema.d.ts": { + "plugins": ["typescript", "typescript-operations"] + }, + "./schema.graphql": { + "plugins": ["schema-ast"] + } + }, + "hooks": { + "afterAllFileWrite": ["prettier --write"] + } +} diff --git a/packages/bigcommerce/package.json b/packages/bigcommerce/package.json new file mode 100644 index 0000000..34b8ac6 --- /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/packages/bigcommerce/schema.d.ts b/packages/bigcommerce/schema.d.ts new file mode 100644 index 0000000..04824e2 --- /dev/null +++ b/packages/bigcommerce/schema.d.ts @@ -0,0 +1,2064 @@ +export type Maybe = T | null +export type Exact = { + [K in keyof T]: T[K] +} +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string + String: string + Boolean: boolean + Int: number + Float: number + DateTime: any + /** The `BigDecimal` scalar type represents signed fractional values with arbitrary precision. */ + BigDecimal: any + /** The `Long` scalar type represents non-fractional signed whole numeric values. Long can represent values between -(2^63) and 2^63 - 1. */ + Long: any +} + +/** Login result */ +export type LoginResult = { + __typename?: 'LoginResult' + /** The result of a login */ + result: Scalars['String'] +} + +/** Logout result */ +export type LogoutResult = { + __typename?: 'LogoutResult' + /** The result of a logout */ + result: Scalars['String'] +} + +export type Mutation = { + __typename?: 'Mutation' + login: LoginResult + logout: LogoutResult +} + +export type MutationLoginArgs = { + email: Scalars['String'] + password: Scalars['String'] +} + +/** Aggregated */ +export type Aggregated = { + __typename?: 'Aggregated' + /** Number of available products in stock. This can be 'null' if inventory is not set orif the store's Inventory Settings disable displaying stock levels on the storefront. */ + availableToSell: Scalars['Long'] + /** Indicates a threshold low-stock level. This can be 'null' if the inventory warning level is not set or if the store's Inventory Settings disable displaying stock levels on the storefront. */ + warningLevel: Scalars['Int'] +} + +/** Aggregated Product Inventory */ +export type AggregatedInventory = { + __typename?: 'AggregatedInventory' + /** Number of available products in stock. This can be 'null' if inventory is not set orif the store's Inventory Settings disable displaying stock levels on the storefront. */ + availableToSell: Scalars['Int'] + /** Indicates a threshold low-stock level. This can be 'null' if the inventory warning level is not set or if the store's Inventory Settings disable displaying stock levels on the storefront. */ + warningLevel: Scalars['Int'] +} + +/** Brand */ +export type Brand = Node & { + __typename?: 'Brand' + /** The ID of an object */ + id: Scalars['ID'] + /** Id of the brand. */ + entityId: Scalars['Int'] + /** Name of the brand. */ + name: Scalars['String'] + /** Default image for brand. */ + defaultImage?: Maybe + /** Page title for the brand. */ + pageTitle: Scalars['String'] + /** Meta description for the brand. */ + metaDesc: Scalars['String'] + /** Meta keywords for the brand. */ + metaKeywords: Array + /** Search keywords for the brand. */ + searchKeywords: Array + /** Path for the brand page. */ + path: Scalars['String'] + products: ProductConnection + /** Metafield data related to a brand. */ + metafields: MetafieldConnection +} + +/** Brand */ +export type BrandProductsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Brand */ +export type BrandMetafieldsArgs = { + namespace: Scalars['String'] + keys?: Maybe> + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** A connection to a list of items. */ +export type BrandConnection = { + __typename?: 'BrandConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type BrandEdge = { + __typename?: 'BrandEdge' + /** The item at the end of the edge. */ + node: Brand + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Breadcrumb */ +export type Breadcrumb = { + __typename?: 'Breadcrumb' + /** Category id. */ + entityId: Scalars['Int'] + /** Name of the category. */ + name: Scalars['String'] +} + +/** A connection to a list of items. */ +export type BreadcrumbConnection = { + __typename?: 'BreadcrumbConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type BreadcrumbEdge = { + __typename?: 'BreadcrumbEdge' + /** The item at the end of the edge. */ + node: Breadcrumb + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Bulk pricing tier that sets a fixed price for the product or variant. */ +export type BulkPricingFixedPriceDiscount = BulkPricingTier & { + __typename?: 'BulkPricingFixedPriceDiscount' + /** This price will override the current product price. */ + price: Scalars['BigDecimal'] + /** Minimum item quantity that applies to this bulk pricing tier. */ + minimumQuantity: Scalars['Int'] + /** Maximum item quantity that applies to this bulk pricing tier - if not defined then the tier does not have an upper bound. */ + maximumQuantity?: Maybe +} + +/** Bulk pricing tier that reduces the price of the product or variant by a percentage. */ +export type BulkPricingPercentageDiscount = BulkPricingTier & { + __typename?: 'BulkPricingPercentageDiscount' + /** The percentage that will be removed from the product price. */ + percentOff: Scalars['BigDecimal'] + /** Minimum item quantity that applies to this bulk pricing tier. */ + minimumQuantity: Scalars['Int'] + /** Maximum item quantity that applies to this bulk pricing tier - if not defined then the tier does not have an upper bound. */ + maximumQuantity?: Maybe +} + +/** Bulk pricing tier that will subtract an amount from the price of the product or variant. */ +export type BulkPricingRelativePriceDiscount = BulkPricingTier & { + __typename?: 'BulkPricingRelativePriceDiscount' + /** The price of the product/variant will be reduced by this priceAdjustment. */ + priceAdjustment: Scalars['BigDecimal'] + /** Minimum item quantity that applies to this bulk pricing tier. */ + minimumQuantity: Scalars['Int'] + /** Maximum item quantity that applies to this bulk pricing tier - if not defined then the tier does not have an upper bound. */ + maximumQuantity?: Maybe +} + +/** A set of bulk pricing tiers that define price discounts which apply when purchasing specified quantities of a product or variant. */ +export type BulkPricingTier = { + /** Minimum item quantity that applies to this bulk pricing tier. */ + minimumQuantity: Scalars['Int'] + /** Maximum item quantity that applies to this bulk pricing tier - if not defined then the tier does not have an upper bound. */ + maximumQuantity?: Maybe +} + +/** Product Option */ +export type CatalogProductOption = { + /** Unique ID for the option. */ + entityId: Scalars['Int'] + /** Display name for the option. */ + displayName: Scalars['String'] + /** One of the option values is required to be selected for the checkout. */ + isRequired: Scalars['Boolean'] +} + +/** Product Option Value */ +export type CatalogProductOptionValue = { + /** Unique ID for the option value. */ + entityId: Scalars['Int'] + /** Label for the option value. */ + label: Scalars['String'] + /** Indicates whether this value is the chosen default selected value. */ + isDefault: Scalars['Boolean'] +} + +/** Category */ +export type Category = Node & { + __typename?: 'Category' + /** The ID of an object */ + id: Scalars['ID'] + /** Unique ID for the category. */ + entityId: Scalars['Int'] + /** Category name. */ + name: Scalars['String'] + /** Category path. */ + path: Scalars['String'] + /** Default image for the category. */ + defaultImage?: Maybe + /** Category description. */ + description: Scalars['String'] + /** Category breadcrumbs. */ + breadcrumbs: BreadcrumbConnection + products: ProductConnection + /** Metafield data related to a category. */ + metafields: MetafieldConnection +} + +/** Category */ +export type CategoryBreadcrumbsArgs = { + depth: Scalars['Int'] + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Category */ +export type CategoryProductsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Category */ +export type CategoryMetafieldsArgs = { + namespace: Scalars['String'] + keys?: Maybe> + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** A connection to a list of items. */ +export type CategoryConnection = { + __typename?: 'CategoryConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type CategoryEdge = { + __typename?: 'CategoryEdge' + /** The item at the end of the edge. */ + node: Category + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** An item in a tree of categories. */ +export type CategoryTreeItem = { + __typename?: 'CategoryTreeItem' + /** The id category. */ + entityId: Scalars['Int'] + /** The name of category. */ + name: Scalars['String'] + /** Path assigned to this category */ + path: Scalars['String'] + /** The description of this category. */ + description: Scalars['String'] + /** The number of products in this category. */ + productCount: Scalars['Int'] + /** Subcategories of this category */ + children: Array +} + +/** A simple yes/no question represented by a checkbox. */ +export type CheckboxOption = CatalogProductOption & { + __typename?: 'CheckboxOption' + /** Indicates the default checked status. */ + checkedByDefault: Scalars['Boolean'] + /** Unique ID for the option. */ + entityId: Scalars['Int'] + /** Display name for the option. */ + displayName: Scalars['String'] + /** One of the option values is required to be selected for the checkout. */ + isRequired: Scalars['Boolean'] +} + +/** Contact field */ +export type ContactField = { + __typename?: 'ContactField' + /** Store address line. */ + address: Scalars['String'] + /** Store country. */ + country: Scalars['String'] + /** Store address type. */ + addressType: Scalars['String'] + /** Store email. */ + email: Scalars['String'] + /** Store phone number. */ + phone: Scalars['String'] +} + +/** Custom field */ +export type CustomField = { + __typename?: 'CustomField' + /** Custom field id. */ + entityId: Scalars['Int'] + /** Name of the custom field. */ + name: Scalars['String'] + /** Value of the custom field. */ + value: Scalars['String'] +} + +/** A connection to a list of items. */ +export type CustomFieldConnection = { + __typename?: 'CustomFieldConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type CustomFieldEdge = { + __typename?: 'CustomFieldEdge' + /** The item at the end of the edge. */ + node: CustomField + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** A customer that shops on a store */ +export type Customer = { + __typename?: 'Customer' + /** The ID of the customer. */ + entityId: Scalars['Int'] + /** The company name of the customer. */ + company: Scalars['String'] + /** The customer group id of the customer. */ + customerGroupId: Scalars['Int'] + /** The email address of the customer. */ + email: Scalars['String'] + /** The first name of the customer. */ + firstName: Scalars['String'] + /** The last name of the customer. */ + lastName: Scalars['String'] + /** The notes of the customer. */ + notes: Scalars['String'] + /** The phone number of the customer. */ + phone: Scalars['String'] + /** The tax exempt category of the customer. */ + taxExemptCategory: Scalars['String'] + /** Customer addresses count. */ + addressCount: Scalars['Int'] + /** Customer attributes count. */ + attributeCount: Scalars['Int'] + /** Customer store credit. */ + storeCredit: Array + /** Customer attributes. */ + attributes: CustomerAttributes +} + +/** A custom, store-specific attribute for a customer */ +export type CustomerAttribute = { + __typename?: 'CustomerAttribute' + /** The ID of the custom customer attribute */ + entityId: Scalars['Int'] + /** The value of the custom customer attribute */ + value?: Maybe + /** The name of the custom customer attribute */ + name: Scalars['String'] +} + +/** Custom, store-specific customer attributes */ +export type CustomerAttributes = { + __typename?: 'CustomerAttributes' + attribute: CustomerAttribute +} + +/** Custom, store-specific customer attributes */ +export type CustomerAttributesAttributeArgs = { + entityId: Scalars['Int'] +} + +/** A calendar for allowing selection of a date. */ +export type DateFieldOption = CatalogProductOption & { + __typename?: 'DateFieldOption' + /** Unique ID for the option. */ + entityId: Scalars['Int'] + /** Display name for the option. */ + displayName: Scalars['String'] + /** One of the option values is required to be selected for the checkout. */ + isRequired: Scalars['Boolean'] +} + +/** Date Time Extended */ +export type DateTimeExtended = { + __typename?: 'DateTimeExtended' + /** ISO-8601 formatted date in UTC */ + utc: Scalars['DateTime'] +} + +/** Display field */ +export type DisplayField = { + __typename?: 'DisplayField' + /** Short date format. */ + shortDateFormat: Scalars['String'] + /** Extended date format. */ + extendedDateFormat: Scalars['String'] +} + +/** A form allowing selection and uploading of a file from the user's local computer. */ +export type FileUploadFieldOption = CatalogProductOption & { + __typename?: 'FileUploadFieldOption' + /** Unique ID for the option. */ + entityId: Scalars['Int'] + /** Display name for the option. */ + displayName: Scalars['String'] + /** One of the option values is required to be selected for the checkout. */ + isRequired: Scalars['Boolean'] +} + +/** Image */ +export type Image = { + __typename?: 'Image' + /** Absolute path to image using store CDN. */ + url: Scalars['String'] + /** Absolute path to original image using store CDN. */ + urlOriginal: Scalars['String'] + /** Text description of an image that can be used for SEO and/or accessibility purposes. */ + altText: Scalars['String'] + /** Indicates whether this is the primary image. */ + isDefault: Scalars['Boolean'] +} + +/** Image */ +export type ImageUrlArgs = { + width: Scalars['Int'] + height?: Maybe +} + +/** A connection to a list of items. */ +export type ImageConnection = { + __typename?: 'ImageConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type ImageEdge = { + __typename?: 'ImageEdge' + /** The item at the end of the edge. */ + node: Image + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** An inventory */ +export type Inventory = { + __typename?: 'Inventory' + /** Locations */ + locations: LocationConnection +} + +/** An inventory */ +export type InventoryLocationsArgs = { + entityIds?: Maybe> + codes?: Maybe> + typeIds?: Maybe> + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Inventory By Locations */ +export type InventoryByLocations = { + __typename?: 'InventoryByLocations' + /** Location id. */ + locationEntityId: Scalars['Long'] + /** Number of available products in stock. */ + availableToSell: Scalars['Long'] + /** Indicates a threshold low-stock level. */ + warningLevel: Scalars['Int'] + /** Indicates whether this product is in stock. */ + isInStock: Scalars['Boolean'] +} + +/** A connection to a list of items. */ +export type LocationConnection = { + __typename?: 'LocationConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type LocationEdge = { + __typename?: 'LocationEdge' + /** The item at the end of the edge. */ + node: InventoryByLocations + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Logo field */ +export type LogoField = { + __typename?: 'LogoField' + /** Logo title. */ + title: Scalars['String'] + /** Store logo image. */ + image: Image +} + +/** Measurement */ +export type Measurement = { + __typename?: 'Measurement' + /** Unformatted weight measurement value. */ + value: Scalars['Float'] + /** Unit of measurement. */ + unit: Scalars['String'] +} + +/** A connection to a list of items. */ +export type MetafieldConnection = { + __typename?: 'MetafieldConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type MetafieldEdge = { + __typename?: 'MetafieldEdge' + /** The item at the end of the edge. */ + node: Metafields + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Key/Value pairs of data attached tied to a resource entity (product, brand, category, etc.) */ +export type Metafields = { + __typename?: 'Metafields' + /** The ID of an object */ + id: Scalars['ID'] + /** The ID of the metafield when referencing via our backend API. */ + entityId: Scalars['Int'] + /** A label for identifying a metafield data value. */ + key: Scalars['String'] + /** A metafield value. */ + value: Scalars['String'] +} + +/** A money object - includes currency code and a money amount */ +export type Money = { + __typename?: 'Money' + /** Currency code of the current money. */ + currencyCode: Scalars['String'] + /** The amount of money. */ + value: Scalars['BigDecimal'] +} + +/** A min and max pair of money objects */ +export type MoneyRange = { + __typename?: 'MoneyRange' + /** Minimum money object. */ + min: Money + /** Maximum money object. */ + max: Money +} + +/** A multi-line text input field, aka a text box. */ +export type MultiLineTextFieldOption = CatalogProductOption & { + __typename?: 'MultiLineTextFieldOption' + /** Unique ID for the option. */ + entityId: Scalars['Int'] + /** Display name for the option. */ + displayName: Scalars['String'] + /** One of the option values is required to be selected for the checkout. */ + isRequired: Scalars['Boolean'] +} + +/** An option type that has a fixed list of values. */ +export type MultipleChoiceOption = CatalogProductOption & { + __typename?: 'MultipleChoiceOption' + /** The chosen display style for this multiple choice option. */ + displayStyle: Scalars['String'] + /** List of option values. */ + values: ProductOptionValueConnection + /** Unique ID for the option. */ + entityId: Scalars['Int'] + /** Display name for the option. */ + displayName: Scalars['String'] + /** One of the option values is required to be selected for the checkout. */ + isRequired: Scalars['Boolean'] +} + +/** An option type that has a fixed list of values. */ +export type MultipleChoiceOptionValuesArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** A simple multiple choice value comprised of an id and a label. */ +export type MultipleChoiceOptionValue = CatalogProductOptionValue & { + __typename?: 'MultipleChoiceOptionValue' + /** Unique ID for the option value. */ + entityId: Scalars['Int'] + /** Label for the option value. */ + label: Scalars['String'] + /** Indicates whether this value is the chosen default selected value. */ + isDefault: Scalars['Boolean'] +} + +/** An object with an ID */ +export type Node = { + /** The id of the object. */ + id: Scalars['ID'] +} + +/** A single line text input field that only accepts numbers. */ +export type NumberFieldOption = CatalogProductOption & { + __typename?: 'NumberFieldOption' + /** Unique ID for the option. */ + entityId: Scalars['Int'] + /** Display name for the option. */ + displayName: Scalars['String'] + /** One of the option values is required to be selected for the checkout. */ + isRequired: Scalars['Boolean'] +} + +/** A connection to a list of items. */ +export type OptionConnection = { + __typename?: 'OptionConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type OptionEdge = { + __typename?: 'OptionEdge' + /** The item at the end of the edge. */ + node: ProductOption + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** A connection to a list of items. */ +export type OptionValueConnection = { + __typename?: 'OptionValueConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type OptionValueEdge = { + __typename?: 'OptionValueEdge' + /** The item at the end of the edge. */ + node: ProductOptionValue + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +export type OptionValueId = { + optionEntityId: Scalars['Int'] + valueEntityId: Scalars['Int'] +} + +/** Information about pagination in a connection. */ +export type PageInfo = { + __typename?: 'PageInfo' + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean'] + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean'] + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe +} + +/** The min and max range of prices that apply to this product. */ +export type PriceRanges = { + __typename?: 'PriceRanges' + /** Product price min/max range. */ + priceRange: MoneyRange + /** Product retail price min/max range. */ + retailPriceRange?: Maybe +} + +/** The various prices that can be set on a product. */ +export type Prices = { + __typename?: 'Prices' + /** Calculated price of the product. */ + price: Money + /** Sale price of the product. */ + salePrice?: Maybe + /** Original price of the product. */ + basePrice?: Maybe + /** Retail price of the product. */ + retailPrice?: Maybe + /** Minimum advertised price of the product. */ + mapPrice?: Maybe + /** Product price min/max range. */ + priceRange: MoneyRange + /** Product retail price min/max range. */ + retailPriceRange?: Maybe + /** The difference between the retail price (MSRP) and the current price, which can be presented to the shopper as their savings. */ + saved?: Maybe + /** List of bulk pricing tiers applicable to a product or variant. */ + bulkPricing: Array +} + +/** Product */ +export type Product = Node & { + __typename?: 'Product' + /** The ID of an object */ + id: Scalars['ID'] + /** Id of the product. */ + entityId: Scalars['Int'] + /** Default product variant when no options are selected. */ + sku: Scalars['String'] + /** Relative URL path to product page. */ + path: Scalars['String'] + /** Name of the product. */ + name: Scalars['String'] + /** Description of the product. */ + description: Scalars['String'] + /** Description of the product in plain text. */ + plainTextDescription: Scalars['String'] + /** Warranty information of the product. */ + warranty: Scalars['String'] + /** Minimum purchasable quantity for this product in a single order. */ + minPurchaseQuantity?: Maybe + /** Maximum purchasable quantity for this product in a single order. */ + maxPurchaseQuantity?: Maybe + /** Absolute URL path for adding a product to cart. */ + addToCartUrl: Scalars['String'] + /** Absolute URL path for adding a product to customer's wishlist. */ + addToWishlistUrl: Scalars['String'] + /** Prices object determined by supplied product ID, variant ID, and selected option IDs. */ + prices?: Maybe + /** + * The minimum and maximum price of this product based on variant pricing and/or modifier price rules. + * @deprecated Use priceRanges inside prices node instead. + */ + priceRanges?: Maybe + /** Weight of the product. */ + weight?: Maybe + /** Height of the product. */ + height?: Maybe + /** Width of the product. */ + width?: Maybe + /** Depth of the product. */ + depth?: Maybe + /** Product options. */ + options: OptionConnection + /** Product options. */ + productOptions: ProductOptionConnection + /** Summary of the product reviews, includes the total number of reviews submitted and summation of the ratings on the reviews (ratings range from 0-5 per review). */ + reviewSummary: Reviews + /** Type of product, ex: physical, digital */ + type: Scalars['String'] + /** + * The availability state of the product. + * @deprecated Use status inside availabilityV2 instead. + */ + availability: Scalars['String'] + /** + * A few words telling the customer how long it will normally take to ship this product, such as 'Usually ships in 24 hours'. + * @deprecated Use description inside availabilityV2 instead. + */ + availabilityDescription: Scalars['String'] + /** The availability state of the product. */ + availabilityV2: ProductAvailability + /** List of categories associated with the product. */ + categories: CategoryConnection + /** Brand associated with the product. */ + brand?: Maybe + /** Variants associated with the product. */ + variants: VariantConnection + /** Custom fields of the product. */ + customFields: CustomFieldConnection + /** A list of the images for a product. */ + images: ImageConnection + /** Default image for a product. */ + defaultImage?: Maybe + /** Related products for this product. */ + relatedProducts: RelatedProductsConnection + /** Inventory information of the product. */ + inventory: ProductInventory + /** Metafield data related to a product. */ + metafields: MetafieldConnection + /** + * Product creation date + * @deprecated Alpha version. Do not use in production. + */ + createdAt: DateTimeExtended +} + +/** Product */ +export type ProductPlainTextDescriptionArgs = { + characterLimit?: Maybe +} + +/** Product */ +export type ProductPricesArgs = { + includeTax?: Maybe + currencyCode?: Maybe +} + +/** Product */ +export type ProductPriceRangesArgs = { + includeTax?: Maybe +} + +/** Product */ +export type ProductOptionsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Product */ +export type ProductProductOptionsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Product */ +export type ProductCategoriesArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Product */ +export type ProductVariantsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe + entityIds?: Maybe> + optionValueIds?: Maybe> +} + +/** Product */ +export type ProductCustomFieldsArgs = { + names?: Maybe> + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Product */ +export type ProductImagesArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Product */ +export type ProductRelatedProductsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Product */ +export type ProductMetafieldsArgs = { + namespace: Scalars['String'] + keys?: Maybe> + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Product availability */ +export type ProductAvailability = { + /** The availability state of the product. */ + status: ProductAvailabilityStatus + /** A few words telling the customer how long it will normally take to ship this product, such as 'Usually ships in 24 hours'. */ + description: Scalars['String'] +} + +/** Product availability status */ +export enum ProductAvailabilityStatus { + Available = 'Available', + Preorder = 'Preorder', + Unavailable = 'Unavailable', +} + +/** Available Product */ +export type ProductAvailable = ProductAvailability & { + __typename?: 'ProductAvailable' + /** The availability state of the product. */ + status: ProductAvailabilityStatus + /** A few words telling the customer how long it will normally take to ship this product, such as 'Usually ships in 24 hours'. */ + description: Scalars['String'] +} + +/** A connection to a list of items. */ +export type ProductConnection = { + __typename?: 'ProductConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type ProductEdge = { + __typename?: 'ProductEdge' + /** The item at the end of the edge. */ + node: Product + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Product Inventory Information */ +export type ProductInventory = { + __typename?: 'ProductInventory' + /** Indicates whether this product is in stock. */ + isInStock: Scalars['Boolean'] + /** Indicates whether this product's inventory is being tracked on variant level. If true, you may wish to check the variants node to understand the true inventory of each individual variant, rather than relying on this product-level aggregate to understand how many items may be added to cart. */ + hasVariantInventory: Scalars['Boolean'] + /** Aggregated product inventory information. This data may not be available if not set or if the store's Inventory Settings have disabled displaying stock levels on the storefront. */ + aggregated?: Maybe +} + +/** Product Option */ +export type ProductOption = { + __typename?: 'ProductOption' + /** Unique ID for the option. */ + entityId: Scalars['Int'] + /** Display name for the option. */ + displayName: Scalars['String'] + /** One of the option values is required to be selected for the checkout. */ + isRequired: Scalars['Boolean'] + /** Option values. */ + values: OptionValueConnection +} + +/** Product Option */ +export type ProductOptionValuesArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** A connection to a list of items. */ +export type ProductOptionConnection = { + __typename?: 'ProductOptionConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type ProductOptionEdge = { + __typename?: 'ProductOptionEdge' + /** The item at the end of the edge. */ + node: CatalogProductOption + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Product Option Value */ +export type ProductOptionValue = { + __typename?: 'ProductOptionValue' + /** Unique ID for the option value. */ + entityId: Scalars['Int'] + /** Label for the option value. */ + label: Scalars['String'] +} + +/** A connection to a list of items. */ +export type ProductOptionValueConnection = { + __typename?: 'ProductOptionValueConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type ProductOptionValueEdge = { + __typename?: 'ProductOptionValueEdge' + /** The item at the end of the edge. */ + node: CatalogProductOptionValue + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** A Product PickList Value - a product to be mapped to the base product if selected. */ +export type ProductPickListOptionValue = CatalogProductOptionValue & { + __typename?: 'ProductPickListOptionValue' + /** The ID of the product associated with this option value. */ + productId: Scalars['Int'] + /** Unique ID for the option value. */ + entityId: Scalars['Int'] + /** Label for the option value. */ + label: Scalars['String'] + /** Indicates whether this value is the chosen default selected value. */ + isDefault: Scalars['Boolean'] +} + +/** PreOrder Product */ +export type ProductPreOrder = ProductAvailability & { + __typename?: 'ProductPreOrder' + /** The message to be shown in the store when a product is put into the pre-order availability state, e.g. "Expected release date is %%DATE%%" */ + message?: Maybe + /** Product release date */ + willBeReleasedAt?: Maybe + /** The availability state of the product. */ + status: ProductAvailabilityStatus + /** A few words telling the customer how long it will normally take to ship this product, such as 'Usually ships in 24 hours'. */ + description: Scalars['String'] +} + +/** Unavailable Product */ +export type ProductUnavailable = ProductAvailability & { + __typename?: 'ProductUnavailable' + /** The message to be shown in the store when "Call for pricing" is enabled for this product, e.g. "Contact us at 555-5555" */ + message?: Maybe + /** The availability state of the product. */ + status: ProductAvailabilityStatus + /** A few words telling the customer how long it will normally take to ship this product, such as 'Usually ships in 24 hours'. */ + description: Scalars['String'] +} + +export type Query = { + __typename?: 'Query' + site: Site + /** The currently logged in customer. */ + customer?: Maybe + /** Fetches an object given its ID */ + node?: Maybe + /** @deprecated Alpha version. Do not use in production. */ + inventory: Inventory +} + +export type QueryNodeArgs = { + id: Scalars['ID'] +} + +/** A connection to a list of items. */ +export type RelatedProductsConnection = { + __typename?: 'RelatedProductsConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type RelatedProductsEdge = { + __typename?: 'RelatedProductsEdge' + /** The item at the end of the edge. */ + node: Product + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Review Rating Summary */ +export type Reviews = { + __typename?: 'Reviews' + /** Total number of reviews on product. */ + numberOfReviews: Scalars['Int'] + /** Summation of rating scores from each review. */ + summationOfRatings: Scalars['Int'] +} + +/** route */ +export type Route = { + __typename?: 'Route' + /** node */ + node?: Maybe +} + +/** Store settings information from the control panel. */ +export type Settings = { + __typename?: 'Settings' + /** The name of the store. */ + storeName: Scalars['String'] + /** The hash of the store. */ + storeHash: Scalars['String'] + /** The current store status. */ + status: StorefrontStatusType + /** Logo information for the store. */ + logo: LogoField + /** Contact information for the store. */ + contact?: Maybe + /** Store urls. */ + url: UrlField + /** Store display format information. */ + display: DisplayField + /** Channel ID. */ + channelId: Scalars['Long'] +} + +/** A site */ +export type Site = { + __typename?: 'Site' + categoryTree: Array + /** Details of the brand. */ + brands: BrandConnection + /** Details of the products. */ + products: ProductConnection + /** Details of the newest products. */ + newestProducts: ProductConnection + /** Details of the best selling products. */ + bestSellingProducts: ProductConnection + /** Details of the featured products. */ + featuredProducts: ProductConnection + /** A single product object with variant pricing overlay capabilities. */ + product?: Maybe + /** Route for a node */ + route: Route + /** Store settings. */ + settings?: Maybe +} + +/** A site */ +export type SiteBrandsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe + productEntityIds?: Maybe> +} + +/** A site */ +export type SiteProductsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe + ids?: Maybe> + entityIds?: Maybe> +} + +/** A site */ +export type SiteNewestProductsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** A site */ +export type SiteBestSellingProductsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** A site */ +export type SiteFeaturedProductsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** A site */ +export type SiteProductArgs = { + id?: Maybe + entityId?: Maybe + variantEntityId?: Maybe + optionValueIds?: Maybe> + sku?: Maybe +} + +/** A site */ +export type SiteRouteArgs = { + path: Scalars['String'] +} + +/** Storefront Mode */ +export enum StorefrontStatusType { + Launched = 'LAUNCHED', + Maintenance = 'MAINTENANCE', + PreLaunch = 'PRE_LAUNCH', + Hibernation = 'HIBERNATION', +} + +/** A swatch option value - swatch values can be associated with a list of hexidecimal colors or an image. */ +export type SwatchOptionValue = CatalogProductOptionValue & { + __typename?: 'SwatchOptionValue' + /** List of up to 3 hex encoded colors to associate with a swatch value. */ + hexColors: Array + /** Absolute path of a swatch texture image. */ + imageUrl?: Maybe + /** Unique ID for the option value. */ + entityId: Scalars['Int'] + /** Label for the option value. */ + label: Scalars['String'] + /** Indicates whether this value is the chosen default selected value. */ + isDefault: Scalars['Boolean'] +} + +/** A swatch option value - swatch values can be associated with a list of hexidecimal colors or an image. */ +export type SwatchOptionValueImageUrlArgs = { + width: Scalars['Int'] + height?: Maybe +} + +/** A single line text input field. */ +export type TextFieldOption = CatalogProductOption & { + __typename?: 'TextFieldOption' + /** Unique ID for the option. */ + entityId: Scalars['Int'] + /** Display name for the option. */ + displayName: Scalars['String'] + /** One of the option values is required to be selected for the checkout. */ + isRequired: Scalars['Boolean'] +} + +/** Url field */ +export type UrlField = { + __typename?: 'UrlField' + /** Store url. */ + vanityUrl: Scalars['String'] + /** CDN url to fetch assets. */ + cdnUrl: Scalars['String'] +} + +/** Variant */ +export type Variant = Node & { + __typename?: 'Variant' + /** The ID of an object */ + id: Scalars['ID'] + /** Id of the variant. */ + entityId: Scalars['Int'] + /** Sku of the variant. */ + sku: Scalars['String'] + /** The variant's weight. If a weight was not explicitly specified on the variant, this will be the product's weight. */ + weight?: Maybe + /** The variant's height. If a height was not explicitly specified on the variant, this will be the product's height. */ + height?: Maybe + /** The variant's width. If a width was not explicitly specified on the variant, this will be the product's width. */ + width?: Maybe + /** The variant's depth. If a depth was not explicitly specified on the variant, this will be the product's depth. */ + depth?: Maybe + /** The options which define a variant. */ + options: OptionConnection + /** Product options that compose this variant. */ + productOptions: ProductOptionConnection + /** Default image for a variant. */ + defaultImage?: Maybe + /** Variant prices */ + prices?: Maybe + /** Variant inventory */ + inventory?: Maybe + /** Metafield data related to a variant. */ + metafields: MetafieldConnection +} + +/** Variant */ +export type VariantOptionsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Variant */ +export type VariantProductOptionsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Variant */ +export type VariantPricesArgs = { + includeTax?: Maybe + currencyCode?: Maybe +} + +/** Variant */ +export type VariantMetafieldsArgs = { + namespace: Scalars['String'] + keys?: Maybe> + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** A connection to a list of items. */ +export type VariantConnection = { + __typename?: 'VariantConnection' + /** Information to aid in pagination. */ + pageInfo: PageInfo + /** A list of edges. */ + edges?: Maybe>> +} + +/** An edge in a connection. */ +export type VariantEdge = { + __typename?: 'VariantEdge' + /** The item at the end of the edge. */ + node: Variant + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Variant Inventory */ +export type VariantInventory = { + __typename?: 'VariantInventory' + /** Aggregated product variant inventory information. This data may not be available if not set or if the store's Inventory Settings have disabled displaying stock levels on the storefront. */ + aggregated?: Maybe + /** Indicates whether this product is in stock. */ + isInStock: Scalars['Boolean'] + /** Inventory by locations. */ + byLocation?: Maybe +} + +/** Variant Inventory */ +export type VariantInventoryByLocationArgs = { + locationEntityIds?: Maybe> + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Please select a currency */ +export enum CurrencyCode { + Adp = 'ADP', + Aed = 'AED', + Afa = 'AFA', + Afn = 'AFN', + Alk = 'ALK', + All = 'ALL', + Amd = 'AMD', + Ang = 'ANG', + Aoa = 'AOA', + Aok = 'AOK', + Aon = 'AON', + Aor = 'AOR', + Ara = 'ARA', + Arl = 'ARL', + Arm = 'ARM', + Arp = 'ARP', + Ars = 'ARS', + Ats = 'ATS', + Aud = 'AUD', + Awg = 'AWG', + Azm = 'AZM', + Azn = 'AZN', + Bad = 'BAD', + Bam = 'BAM', + Ban = 'BAN', + Bbd = 'BBD', + Bdt = 'BDT', + Bec = 'BEC', + Bef = 'BEF', + Bel = 'BEL', + Bgl = 'BGL', + Bgm = 'BGM', + Bgn = 'BGN', + Bgo = 'BGO', + Bhd = 'BHD', + Bif = 'BIF', + Bmd = 'BMD', + Bnd = 'BND', + Bob = 'BOB', + Bol = 'BOL', + Bop = 'BOP', + Bov = 'BOV', + Brb = 'BRB', + Brc = 'BRC', + Bre = 'BRE', + Brl = 'BRL', + Brn = 'BRN', + Brr = 'BRR', + Brz = 'BRZ', + Bsd = 'BSD', + Btn = 'BTN', + Buk = 'BUK', + Bwp = 'BWP', + Byb = 'BYB', + Byr = 'BYR', + Bzd = 'BZD', + Cad = 'CAD', + Cdf = 'CDF', + Che = 'CHE', + Chf = 'CHF', + Chw = 'CHW', + Cle = 'CLE', + Clf = 'CLF', + Clp = 'CLP', + Cnx = 'CNX', + Cny = 'CNY', + Cop = 'COP', + Cou = 'COU', + Crc = 'CRC', + Csd = 'CSD', + Csk = 'CSK', + Cve = 'CVE', + Cyp = 'CYP', + Czk = 'CZK', + Ddm = 'DDM', + Dem = 'DEM', + Djf = 'DJF', + Dkk = 'DKK', + Dop = 'DOP', + Dzd = 'DZD', + Ecs = 'ECS', + Ecv = 'ECV', + Eek = 'EEK', + Egp = 'EGP', + Ern = 'ERN', + Esa = 'ESA', + Esb = 'ESB', + Esp = 'ESP', + Etb = 'ETB', + Eur = 'EUR', + Fim = 'FIM', + Fjd = 'FJD', + Fkp = 'FKP', + Frf = 'FRF', + Gbp = 'GBP', + Gek = 'GEK', + Gel = 'GEL', + Ghc = 'GHC', + Ghs = 'GHS', + Gip = 'GIP', + Gmd = 'GMD', + Gnf = 'GNF', + Gns = 'GNS', + Gqe = 'GQE', + Grd = 'GRD', + Gtq = 'GTQ', + Gwe = 'GWE', + Gwp = 'GWP', + Gyd = 'GYD', + Hkd = 'HKD', + Hnl = 'HNL', + Hrd = 'HRD', + Hrk = 'HRK', + Htg = 'HTG', + Huf = 'HUF', + Idr = 'IDR', + Iep = 'IEP', + Ilp = 'ILP', + Ilr = 'ILR', + Ils = 'ILS', + Inr = 'INR', + Iqd = 'IQD', + Isj = 'ISJ', + Isk = 'ISK', + Itl = 'ITL', + Jmd = 'JMD', + Jod = 'JOD', + Jpy = 'JPY', + Kes = 'KES', + Kgs = 'KGS', + Khr = 'KHR', + Kmf = 'KMF', + Krh = 'KRH', + Kro = 'KRO', + Krw = 'KRW', + Kwd = 'KWD', + Kyd = 'KYD', + Kzt = 'KZT', + Lak = 'LAK', + Lbp = 'LBP', + Lkr = 'LKR', + Lrd = 'LRD', + Lsl = 'LSL', + Ltl = 'LTL', + Ltt = 'LTT', + Luc = 'LUC', + Luf = 'LUF', + Lul = 'LUL', + Lvl = 'LVL', + Lvr = 'LVR', + Lyd = 'LYD', + Mad = 'MAD', + Maf = 'MAF', + Mcf = 'MCF', + Mdc = 'MDC', + Mdl = 'MDL', + Mga = 'MGA', + Mgf = 'MGF', + Mkd = 'MKD', + Mkn = 'MKN', + Mlf = 'MLF', + Mmk = 'MMK', + Mnt = 'MNT', + Mop = 'MOP', + Mro = 'MRO', + Mtl = 'MTL', + Mtp = 'MTP', + Mur = 'MUR', + Mvp = 'MVP', + Mvr = 'MVR', + Mwk = 'MWK', + Mxn = 'MXN', + Mxp = 'MXP', + Mxv = 'MXV', + Myr = 'MYR', + Mze = 'MZE', + Mzm = 'MZM', + Mzn = 'MZN', + Nad = 'NAD', + Ngn = 'NGN', + Nic = 'NIC', + Nio = 'NIO', + Nlg = 'NLG', + Nok = 'NOK', + Npr = 'NPR', + Nzd = 'NZD', + Omr = 'OMR', + Pab = 'PAB', + Pei = 'PEI', + Pen = 'PEN', + Pes = 'PES', + Pgk = 'PGK', + Php = 'PHP', + Pkr = 'PKR', + Pln = 'PLN', + Plz = 'PLZ', + Pte = 'PTE', + Pyg = 'PYG', + Qar = 'QAR', + Rhd = 'RHD', + Rol = 'ROL', + Ron = 'RON', + Rsd = 'RSD', + Rub = 'RUB', + Rur = 'RUR', + Rwf = 'RWF', + Sar = 'SAR', + Sbd = 'SBD', + Scr = 'SCR', + Sdd = 'SDD', + Sdg = 'SDG', + Sdp = 'SDP', + Sek = 'SEK', + Sgd = 'SGD', + Shp = 'SHP', + Sit = 'SIT', + Skk = 'SKK', + Sll = 'SLL', + Sos = 'SOS', + Srd = 'SRD', + Srg = 'SRG', + Ssp = 'SSP', + Std = 'STD', + Sur = 'SUR', + Svc = 'SVC', + Syp = 'SYP', + Szl = 'SZL', + Thb = 'THB', + Tjr = 'TJR', + Tjs = 'TJS', + Tmm = 'TMM', + Tmt = 'TMT', + Tnd = 'TND', + Top = 'TOP', + Tpe = 'TPE', + Trl = 'TRL', + Try = 'TRY', + Ttd = 'TTD', + Twd = 'TWD', + Tzs = 'TZS', + Uah = 'UAH', + Uak = 'UAK', + Ugs = 'UGS', + Ugx = 'UGX', + Usd = 'USD', + Usn = 'USN', + Uss = 'USS', + Uyi = 'UYI', + Uyp = 'UYP', + Uyu = 'UYU', + Uzs = 'UZS', + Veb = 'VEB', + Vef = 'VEF', + Vnd = 'VND', + Vnn = 'VNN', + Vuv = 'VUV', + Wst = 'WST', + Xaf = 'XAF', + Xcd = 'XCD', + Xeu = 'XEU', + Xfo = 'XFO', + Xfu = 'XFU', + Xof = 'XOF', + Xpf = 'XPF', + Xre = 'XRE', + Ydd = 'YDD', + Yer = 'YER', + Yud = 'YUD', + Yum = 'YUM', + Yun = 'YUN', + Yur = 'YUR', + Zal = 'ZAL', + Zar = 'ZAR', + Zmk = 'ZMK', + Zmw = 'ZMW', + Zrn = 'ZRN', + Zrz = 'ZRZ', + Zwd = 'ZWD', + Zwl = 'ZWL', + Zwr = 'ZWR', +} + +export type GetLoggedInCustomerQueryVariables = Exact<{ [key: string]: never }> + +export type GetLoggedInCustomerQuery = { __typename?: 'Query' } & { + customer?: Maybe< + { __typename?: 'Customer' } & Pick< + Customer, + | 'entityId' + | 'firstName' + | 'lastName' + | 'email' + | 'company' + | 'customerGroupId' + | 'notes' + | 'phone' + | 'addressCount' + | 'attributeCount' + > & { + storeCredit: Array< + { __typename?: 'Money' } & Pick + > + } + > +} + +export type CategoryTreeItemFragment = { + __typename?: 'CategoryTreeItem' +} & Pick< + CategoryTreeItem, + 'entityId' | 'name' | 'path' | 'description' | 'productCount' +> + +export type ProductPricesFragment = { __typename?: 'Prices' } & { + price: { __typename?: 'Money' } & Pick + salePrice?: Maybe< + { __typename?: 'Money' } & Pick + > + retailPrice?: Maybe< + { __typename?: 'Money' } & Pick + > +} + +export type SwatchOptionFragment = { __typename?: 'SwatchOptionValue' } & Pick< + SwatchOptionValue, + 'isDefault' | 'hexColors' +> + +export type MultipleChoiceOptionFragment = { + __typename?: 'MultipleChoiceOption' +} & { + values: { __typename?: 'ProductOptionValueConnection' } & { + edges?: Maybe< + Array< + Maybe< + { __typename?: 'ProductOptionValueEdge' } & { + node: + | ({ __typename?: 'MultipleChoiceOptionValue' } & Pick< + MultipleChoiceOptionValue, + 'label' + >) + | ({ __typename?: 'ProductPickListOptionValue' } & Pick< + ProductPickListOptionValue, + 'label' + >) + | ({ __typename?: 'SwatchOptionValue' } & Pick< + SwatchOptionValue, + 'label' + > & + SwatchOptionFragment) + } + > + > + > + } +} + +export type ProductInfoFragment = { __typename?: 'Product' } & Pick< + Product, + 'entityId' | 'name' | 'path' | 'description' +> & { + brand?: Maybe<{ __typename?: 'Brand' } & Pick> + prices?: Maybe<{ __typename?: 'Prices' } & ProductPricesFragment> + images: { __typename?: 'ImageConnection' } & { + edges?: Maybe< + Array< + Maybe< + { __typename?: 'ImageEdge' } & { + node: { __typename?: 'Image' } & Pick< + Image, + 'urlOriginal' | 'altText' | 'isDefault' + > + } + > + > + > + } + variants: { __typename?: 'VariantConnection' } & { + edges?: Maybe< + Array< + Maybe< + { __typename?: 'VariantEdge' } & { + node: { __typename?: 'Variant' } & Pick & { + defaultImage?: Maybe< + { __typename?: 'Image' } & Pick< + Image, + 'urlOriginal' | 'altText' | 'isDefault' + > + > + } + } + > + > + > + } + productOptions: { __typename?: 'ProductOptionConnection' } & { + edges?: Maybe< + Array< + Maybe< + { __typename?: 'ProductOptionEdge' } & { + node: + | ({ __typename: 'CheckboxOption' } & Pick< + CheckboxOption, + 'entityId' | 'displayName' + >) + | ({ __typename: 'DateFieldOption' } & Pick< + DateFieldOption, + 'entityId' | 'displayName' + >) + | ({ __typename: 'FileUploadFieldOption' } & Pick< + FileUploadFieldOption, + 'entityId' | 'displayName' + >) + | ({ __typename: 'MultiLineTextFieldOption' } & Pick< + MultiLineTextFieldOption, + 'entityId' | 'displayName' + >) + | ({ __typename: 'MultipleChoiceOption' } & Pick< + MultipleChoiceOption, + 'entityId' | 'displayName' + > & + MultipleChoiceOptionFragment) + | ({ __typename: 'NumberFieldOption' } & Pick< + NumberFieldOption, + 'entityId' | 'displayName' + >) + | ({ __typename: 'TextFieldOption' } & Pick< + TextFieldOption, + 'entityId' | 'displayName' + >) + } + > + > + > + } + localeMeta: { __typename?: 'MetafieldConnection' } & { + edges?: Maybe< + Array< + Maybe< + { __typename?: 'MetafieldEdge' } & { + node: { __typename?: 'Metafields' } & Pick< + Metafields, + 'key' | 'value' + > + } + > + > + > + } + } + +export type ProductConnnectionFragment = { + __typename?: 'ProductConnection' +} & { + pageInfo: { __typename?: 'PageInfo' } & Pick< + PageInfo, + 'startCursor' | 'endCursor' + > + edges?: Maybe< + Array< + Maybe< + { __typename?: 'ProductEdge' } & Pick & { + node: { __typename?: 'Product' } & ProductInfoFragment + } + > + > + > +} + +export type GetAllProductPathsQueryVariables = Exact<{ + first?: Maybe +}> + +export type GetAllProductPathsQuery = { __typename?: 'Query' } & { + site: { __typename?: 'Site' } & { + products: { __typename?: 'ProductConnection' } & { + edges?: Maybe< + Array< + Maybe< + { __typename?: 'ProductEdge' } & { + node: { __typename?: 'Product' } & Pick + } + > + > + > + } + } +} + +export type GetAllProductsQueryVariables = Exact<{ + hasLocale?: Maybe + locale?: Maybe + entityIds?: Maybe> + first?: Maybe + products?: Maybe + featuredProducts?: Maybe + bestSellingProducts?: Maybe + newestProducts?: Maybe +}> + +export type GetAllProductsQuery = { __typename?: 'Query' } & { + site: { __typename?: 'Site' } & { + products: { __typename?: 'ProductConnection' } & ProductConnnectionFragment + featuredProducts: { + __typename?: 'ProductConnection' + } & ProductConnnectionFragment + bestSellingProducts: { + __typename?: 'ProductConnection' + } & ProductConnnectionFragment + newestProducts: { + __typename?: 'ProductConnection' + } & ProductConnnectionFragment + } +} + +export type GetCustomerIdQueryVariables = Exact<{ [key: string]: never }> + +export type GetCustomerIdQuery = { __typename?: 'Query' } & { + customer?: Maybe<{ __typename?: 'Customer' } & Pick> +} + +export type GetProductQueryVariables = Exact<{ + hasLocale?: Maybe + locale?: Maybe + path: Scalars['String'] +}> + +export type GetProductQuery = { __typename?: 'Query' } & { + site: { __typename?: 'Site' } & { + route: { __typename?: 'Route' } & { + node?: Maybe< + | { __typename: 'Brand' } + | { __typename: 'Category' } + | ({ __typename: 'Product' } & { + variants: { __typename?: 'VariantConnection' } & { + edges?: Maybe< + Array< + Maybe< + { __typename?: 'VariantEdge' } & { + node: { __typename?: 'Variant' } & Pick< + Variant, + 'entityId' + > & { + defaultImage?: Maybe< + { __typename?: 'Image' } & Pick< + Image, + 'urlOriginal' | 'altText' | 'isDefault' + > + > + prices?: Maybe< + { __typename?: 'Prices' } & ProductPricesFragment + > + inventory?: Maybe< + { __typename?: 'VariantInventory' } & Pick< + VariantInventory, + 'isInStock' + > & { + aggregated?: Maybe< + { __typename?: 'Aggregated' } & Pick< + Aggregated, + 'availableToSell' | 'warningLevel' + > + > + } + > + productOptions: { + __typename?: 'ProductOptionConnection' + } & { + edges?: Maybe< + Array< + Maybe< + { __typename?: 'ProductOptionEdge' } & { + node: + | ({ + __typename: 'CheckboxOption' + } & Pick< + CheckboxOption, + 'entityId' | 'displayName' + >) + | ({ + __typename: 'DateFieldOption' + } & Pick< + DateFieldOption, + 'entityId' | 'displayName' + >) + | ({ + __typename: 'FileUploadFieldOption' + } & Pick< + FileUploadFieldOption, + 'entityId' | 'displayName' + >) + | ({ + __typename: 'MultiLineTextFieldOption' + } & Pick< + MultiLineTextFieldOption, + 'entityId' | 'displayName' + >) + | ({ + __typename: 'MultipleChoiceOption' + } & Pick< + MultipleChoiceOption, + 'entityId' | 'displayName' + > & + MultipleChoiceOptionFragment) + | ({ + __typename: 'NumberFieldOption' + } & Pick< + NumberFieldOption, + 'entityId' | 'displayName' + >) + | ({ + __typename: 'TextFieldOption' + } & Pick< + TextFieldOption, + 'entityId' | 'displayName' + >) + } + > + > + > + } + } + } + > + > + > + } + } & ProductInfoFragment) + | { __typename: 'Variant' } + > + } + } +} + +export type GetSiteInfoQueryVariables = Exact<{ [key: string]: never }> + +export type GetSiteInfoQuery = { __typename?: 'Query' } & { + site: { __typename?: 'Site' } & { + categoryTree: Array< + { __typename?: 'CategoryTreeItem' } & { + children: Array< + { __typename?: 'CategoryTreeItem' } & { + children: Array< + { __typename?: 'CategoryTreeItem' } & CategoryTreeItemFragment + > + } & CategoryTreeItemFragment + > + } & CategoryTreeItemFragment + > + brands: { __typename?: 'BrandConnection' } & { + pageInfo: { __typename?: 'PageInfo' } & Pick< + PageInfo, + 'startCursor' | 'endCursor' + > + edges?: Maybe< + Array< + Maybe< + { __typename?: 'BrandEdge' } & Pick & { + node: { __typename?: 'Brand' } & Pick< + Brand, + | 'entityId' + | 'name' + | 'pageTitle' + | 'metaDesc' + | 'metaKeywords' + | 'searchKeywords' + | 'path' + > & { + defaultImage?: Maybe< + { __typename?: 'Image' } & Pick< + Image, + 'urlOriginal' | 'altText' + > + > + } + } + > + > + > + } + } +} + +export type LoginMutationVariables = Exact<{ + email: Scalars['String'] + password: Scalars['String'] +}> + +export type LoginMutation = { __typename?: 'Mutation' } & { + login: { __typename?: 'LoginResult' } & Pick +} diff --git a/packages/bigcommerce/schema.graphql b/packages/bigcommerce/schema.graphql new file mode 100644 index 0000000..79de347 --- /dev/null +++ b/packages/bigcommerce/schema.graphql @@ -0,0 +1,2422 @@ +""" +Login result +""" +type LoginResult { + """ + The result of a login + """ + result: String! +} + +""" +Logout result +""" +type LogoutResult { + """ + The result of a logout + """ + result: String! +} + +type Mutation { + login(email: String!, password: String!): LoginResult! + logout: LogoutResult! +} + +""" +Aggregated +""" +type Aggregated { + """ + Number of available products in stock. This can be 'null' if inventory is not set orif the store's Inventory Settings disable displaying stock levels on the storefront. + """ + availableToSell: Long! + + """ + Indicates a threshold low-stock level. This can be 'null' if the inventory warning level is not set or if the store's Inventory Settings disable displaying stock levels on the storefront. + """ + warningLevel: Int! +} + +""" +Aggregated Product Inventory +""" +type AggregatedInventory { + """ + Number of available products in stock. This can be 'null' if inventory is not set orif the store's Inventory Settings disable displaying stock levels on the storefront. + """ + availableToSell: Int! + + """ + Indicates a threshold low-stock level. This can be 'null' if the inventory warning level is not set or if the store's Inventory Settings disable displaying stock levels on the storefront. + """ + warningLevel: Int! +} + +""" +Brand +""" +type Brand implements Node { + """ + The ID of an object + """ + id: ID! + + """ + Id of the brand. + """ + entityId: Int! + + """ + Name of the brand. + """ + name: String! + + """ + Default image for brand. + """ + defaultImage: Image + + """ + Page title for the brand. + """ + pageTitle: String! + + """ + Meta description for the brand. + """ + metaDesc: String! + + """ + Meta keywords for the brand. + """ + metaKeywords: [String!]! + + """ + Search keywords for the brand. + """ + searchKeywords: [String!]! + + """ + Path for the brand page. + """ + path: String! + products( + before: String + after: String + first: Int + last: Int + ): ProductConnection! + + """ + Metafield data related to a brand. + """ + metafields( + namespace: String! + keys: [String!] = [] + before: String + after: String + first: Int + last: Int + ): MetafieldConnection! +} + +""" +A connection to a list of items. +""" +type BrandConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [BrandEdge] +} + +""" +An edge in a connection. +""" +type BrandEdge { + """ + The item at the end of the edge. + """ + node: Brand! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Breadcrumb +""" +type Breadcrumb { + """ + Category id. + """ + entityId: Int! + + """ + Name of the category. + """ + name: String! +} + +""" +A connection to a list of items. +""" +type BreadcrumbConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [BreadcrumbEdge] +} + +""" +An edge in a connection. +""" +type BreadcrumbEdge { + """ + The item at the end of the edge. + """ + node: Breadcrumb! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Bulk pricing tier that sets a fixed price for the product or variant. +""" +type BulkPricingFixedPriceDiscount implements BulkPricingTier { + """ + This price will override the current product price. + """ + price: BigDecimal! + + """ + Minimum item quantity that applies to this bulk pricing tier. + """ + minimumQuantity: Int! + + """ + Maximum item quantity that applies to this bulk pricing tier - if not defined then the tier does not have an upper bound. + """ + maximumQuantity: Int +} + +""" +Bulk pricing tier that reduces the price of the product or variant by a percentage. +""" +type BulkPricingPercentageDiscount implements BulkPricingTier { + """ + The percentage that will be removed from the product price. + """ + percentOff: BigDecimal! + + """ + Minimum item quantity that applies to this bulk pricing tier. + """ + minimumQuantity: Int! + + """ + Maximum item quantity that applies to this bulk pricing tier - if not defined then the tier does not have an upper bound. + """ + maximumQuantity: Int +} + +""" +Bulk pricing tier that will subtract an amount from the price of the product or variant. +""" +type BulkPricingRelativePriceDiscount implements BulkPricingTier { + """ + The price of the product/variant will be reduced by this priceAdjustment. + """ + priceAdjustment: BigDecimal! + + """ + Minimum item quantity that applies to this bulk pricing tier. + """ + minimumQuantity: Int! + + """ + Maximum item quantity that applies to this bulk pricing tier - if not defined then the tier does not have an upper bound. + """ + maximumQuantity: Int +} + +""" +A set of bulk pricing tiers that define price discounts which apply when purchasing specified quantities of a product or variant. +""" +interface BulkPricingTier { + """ + Minimum item quantity that applies to this bulk pricing tier. + """ + minimumQuantity: Int! + + """ + Maximum item quantity that applies to this bulk pricing tier - if not defined then the tier does not have an upper bound. + """ + maximumQuantity: Int +} + +""" +Product Option +""" +interface CatalogProductOption { + """ + Unique ID for the option. + """ + entityId: Int! + + """ + Display name for the option. + """ + displayName: String! + + """ + One of the option values is required to be selected for the checkout. + """ + isRequired: Boolean! +} + +""" +Product Option Value +""" +interface CatalogProductOptionValue { + """ + Unique ID for the option value. + """ + entityId: Int! + + """ + Label for the option value. + """ + label: String! + + """ + Indicates whether this value is the chosen default selected value. + """ + isDefault: Boolean! +} + +""" +Category +""" +type Category implements Node { + """ + The ID of an object + """ + id: ID! + + """ + Unique ID for the category. + """ + entityId: Int! + + """ + Category name. + """ + name: String! + + """ + Category path. + """ + path: String! + + """ + Default image for the category. + """ + defaultImage: Image + + """ + Category description. + """ + description: String! + + """ + Category breadcrumbs. + """ + breadcrumbs( + depth: Int! + before: String + after: String + first: Int + last: Int + ): BreadcrumbConnection! + products( + before: String + after: String + first: Int + last: Int + ): ProductConnection! + + """ + Metafield data related to a category. + """ + metafields( + namespace: String! + keys: [String!] = [] + before: String + after: String + first: Int + last: Int + ): MetafieldConnection! +} + +""" +A connection to a list of items. +""" +type CategoryConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [CategoryEdge] +} + +""" +An edge in a connection. +""" +type CategoryEdge { + """ + The item at the end of the edge. + """ + node: Category! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +An item in a tree of categories. +""" +type CategoryTreeItem { + """ + The id category. + """ + entityId: Int! + + """ + The name of category. + """ + name: String! + + """ + Path assigned to this category + """ + path: String! + + """ + The description of this category. + """ + description: String! + + """ + The number of products in this category. + """ + productCount: Int! + + """ + Subcategories of this category + """ + children: [CategoryTreeItem!]! +} + +""" +A simple yes/no question represented by a checkbox. +""" +type CheckboxOption implements CatalogProductOption { + """ + Indicates the default checked status. + """ + checkedByDefault: Boolean! + + """ + Unique ID for the option. + """ + entityId: Int! + + """ + Display name for the option. + """ + displayName: String! + + """ + One of the option values is required to be selected for the checkout. + """ + isRequired: Boolean! +} + +""" +Contact field +""" +type ContactField { + """ + Store address line. + """ + address: String! + + """ + Store country. + """ + country: String! + + """ + Store address type. + """ + addressType: String! + + """ + Store email. + """ + email: String! + + """ + Store phone number. + """ + phone: String! +} + +""" +Custom field +""" +type CustomField { + """ + Custom field id. + """ + entityId: Int! + + """ + Name of the custom field. + """ + name: String! + + """ + Value of the custom field. + """ + value: String! +} + +""" +A connection to a list of items. +""" +type CustomFieldConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [CustomFieldEdge] +} + +""" +An edge in a connection. +""" +type CustomFieldEdge { + """ + The item at the end of the edge. + """ + node: CustomField! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +A customer that shops on a store +""" +type Customer { + """ + The ID of the customer. + """ + entityId: Int! + + """ + The company name of the customer. + """ + company: String! + + """ + The customer group id of the customer. + """ + customerGroupId: Int! + + """ + The email address of the customer. + """ + email: String! + + """ + The first name of the customer. + """ + firstName: String! + + """ + The last name of the customer. + """ + lastName: String! + + """ + The notes of the customer. + """ + notes: String! + + """ + The phone number of the customer. + """ + phone: String! + + """ + The tax exempt category of the customer. + """ + taxExemptCategory: String! + + """ + Customer addresses count. + """ + addressCount: Int! + + """ + Customer attributes count. + """ + attributeCount: Int! + + """ + Customer store credit. + """ + storeCredit: [Money!]! + + """ + Customer attributes. + """ + attributes: CustomerAttributes! +} + +""" +A custom, store-specific attribute for a customer +""" +type CustomerAttribute { + """ + The ID of the custom customer attribute + """ + entityId: Int! + + """ + The value of the custom customer attribute + """ + value: String + + """ + The name of the custom customer attribute + """ + name: String! +} + +""" +Custom, store-specific customer attributes +""" +type CustomerAttributes { + attribute( + """ + The ID of the customer attribute + """ + entityId: Int! + ): CustomerAttribute! +} + +""" +A calendar for allowing selection of a date. +""" +type DateFieldOption implements CatalogProductOption { + """ + Unique ID for the option. + """ + entityId: Int! + + """ + Display name for the option. + """ + displayName: String! + + """ + One of the option values is required to be selected for the checkout. + """ + isRequired: Boolean! +} + +scalar DateTime + +""" +Date Time Extended +""" +type DateTimeExtended { + """ + ISO-8601 formatted date in UTC + """ + utc: DateTime! +} + +""" +Display field +""" +type DisplayField { + """ + Short date format. + """ + shortDateFormat: String! + + """ + Extended date format. + """ + extendedDateFormat: String! +} + +""" +A form allowing selection and uploading of a file from the user's local computer. +""" +type FileUploadFieldOption implements CatalogProductOption { + """ + Unique ID for the option. + """ + entityId: Int! + + """ + Display name for the option. + """ + displayName: String! + + """ + One of the option values is required to be selected for the checkout. + """ + isRequired: Boolean! +} + +""" +Image +""" +type Image { + """ + Absolute path to image using store CDN. + """ + url(width: Int!, height: Int): String! + + """ + Absolute path to original image using store CDN. + """ + urlOriginal: String! + + """ + Text description of an image that can be used for SEO and/or accessibility purposes. + """ + altText: String! + + """ + Indicates whether this is the primary image. + """ + isDefault: Boolean! +} + +""" +A connection to a list of items. +""" +type ImageConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [ImageEdge] +} + +""" +An edge in a connection. +""" +type ImageEdge { + """ + The item at the end of the edge. + """ + node: Image! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +An inventory +""" +type Inventory { + """ + Locations + """ + locations( + entityIds: [Int!] + codes: [String!] + typeIds: [String!] + before: String + after: String + first: Int + last: Int + ): LocationConnection! +} + +""" +Inventory By Locations +""" +type InventoryByLocations { + """ + Location id. + """ + locationEntityId: Long! + + """ + Number of available products in stock. + """ + availableToSell: Long! + + """ + Indicates a threshold low-stock level. + """ + warningLevel: Int! + + """ + Indicates whether this product is in stock. + """ + isInStock: Boolean! +} + +""" +A connection to a list of items. +""" +type LocationConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [LocationEdge] +} + +""" +An edge in a connection. +""" +type LocationEdge { + """ + The item at the end of the edge. + """ + node: InventoryByLocations! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Logo field +""" +type LogoField { + """ + Logo title. + """ + title: String! + + """ + Store logo image. + """ + image: Image! +} + +""" +Measurement +""" +type Measurement { + """ + Unformatted weight measurement value. + """ + value: Float! + + """ + Unit of measurement. + """ + unit: String! +} + +""" +A connection to a list of items. +""" +type MetafieldConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [MetafieldEdge] +} + +""" +An edge in a connection. +""" +type MetafieldEdge { + """ + The item at the end of the edge. + """ + node: Metafields! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Key/Value pairs of data attached tied to a resource entity (product, brand, category, etc.) +""" +type Metafields { + """ + The ID of an object + """ + id: ID! + + """ + The ID of the metafield when referencing via our backend API. + """ + entityId: Int! + + """ + A label for identifying a metafield data value. + """ + key: String! + + """ + A metafield value. + """ + value: String! +} + +""" +A money object - includes currency code and a money amount +""" +type Money { + """ + Currency code of the current money. + """ + currencyCode: String! + + """ + The amount of money. + """ + value: BigDecimal! +} + +""" +A min and max pair of money objects +""" +type MoneyRange { + """ + Minimum money object. + """ + min: Money! + + """ + Maximum money object. + """ + max: Money! +} + +""" +A multi-line text input field, aka a text box. +""" +type MultiLineTextFieldOption implements CatalogProductOption { + """ + Unique ID for the option. + """ + entityId: Int! + + """ + Display name for the option. + """ + displayName: String! + + """ + One of the option values is required to be selected for the checkout. + """ + isRequired: Boolean! +} + +""" +An option type that has a fixed list of values. +""" +type MultipleChoiceOption implements CatalogProductOption { + """ + The chosen display style for this multiple choice option. + """ + displayStyle: String! + + """ + List of option values. + """ + values( + before: String + after: String + first: Int + last: Int + ): ProductOptionValueConnection! + + """ + Unique ID for the option. + """ + entityId: Int! + + """ + Display name for the option. + """ + displayName: String! + + """ + One of the option values is required to be selected for the checkout. + """ + isRequired: Boolean! +} + +""" +A simple multiple choice value comprised of an id and a label. +""" +type MultipleChoiceOptionValue implements CatalogProductOptionValue { + """ + Unique ID for the option value. + """ + entityId: Int! + + """ + Label for the option value. + """ + label: String! + + """ + Indicates whether this value is the chosen default selected value. + """ + isDefault: Boolean! +} + +""" +An object with an ID +""" +interface Node { + """ + The id of the object. + """ + id: ID! +} + +""" +A single line text input field that only accepts numbers. +""" +type NumberFieldOption implements CatalogProductOption { + """ + Unique ID for the option. + """ + entityId: Int! + + """ + Display name for the option. + """ + displayName: String! + + """ + One of the option values is required to be selected for the checkout. + """ + isRequired: Boolean! +} + +""" +A connection to a list of items. +""" +type OptionConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [OptionEdge] +} + +""" +An edge in a connection. +""" +type OptionEdge { + """ + The item at the end of the edge. + """ + node: ProductOption! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +A connection to a list of items. +""" +type OptionValueConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [OptionValueEdge] +} + +""" +An edge in a connection. +""" +type OptionValueEdge { + """ + The item at the end of the edge. + """ + node: ProductOptionValue! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +input OptionValueId { + optionEntityId: Int! + valueEntityId: Int! +} + +""" +Information about pagination in a connection. +""" +type PageInfo { + """ + When paginating forwards, are there more items? + """ + hasNextPage: Boolean! + + """ + When paginating backwards, are there more items? + """ + hasPreviousPage: Boolean! + + """ + When paginating backwards, the cursor to continue. + """ + startCursor: String + + """ + When paginating forwards, the cursor to continue. + """ + endCursor: String +} + +""" +The min and max range of prices that apply to this product. +""" +type PriceRanges { + """ + Product price min/max range. + """ + priceRange: MoneyRange! + + """ + Product retail price min/max range. + """ + retailPriceRange: MoneyRange +} + +""" +The various prices that can be set on a product. +""" +type Prices { + """ + Calculated price of the product. + """ + price: Money! + + """ + Sale price of the product. + """ + salePrice: Money + + """ + Original price of the product. + """ + basePrice: Money + + """ + Retail price of the product. + """ + retailPrice: Money + + """ + Minimum advertised price of the product. + """ + mapPrice: Money + + """ + Product price min/max range. + """ + priceRange: MoneyRange! + + """ + Product retail price min/max range. + """ + retailPriceRange: MoneyRange + + """ + The difference between the retail price (MSRP) and the current price, which can be presented to the shopper as their savings. + """ + saved: Money + + """ + List of bulk pricing tiers applicable to a product or variant. + """ + bulkPricing: [BulkPricingTier!]! +} + +""" +Product +""" +type Product implements Node { + """ + The ID of an object + """ + id: ID! + + """ + Id of the product. + """ + entityId: Int! + + """ + Default product variant when no options are selected. + """ + sku: String! + + """ + Relative URL path to product page. + """ + path: String! + + """ + Name of the product. + """ + name: String! + + """ + Description of the product. + """ + description: String! + + """ + Description of the product in plain text. + """ + plainTextDescription(characterLimit: Int = 120): String! + + """ + Warranty information of the product. + """ + warranty: String! + + """ + Minimum purchasable quantity for this product in a single order. + """ + minPurchaseQuantity: Int + + """ + Maximum purchasable quantity for this product in a single order. + """ + maxPurchaseQuantity: Int + + """ + Absolute URL path for adding a product to cart. + """ + addToCartUrl: String! + + """ + Absolute URL path for adding a product to customer's wishlist. + """ + addToWishlistUrl: String! + + """ + Prices object determined by supplied product ID, variant ID, and selected option IDs. + """ + prices(includeTax: Boolean = false, currencyCode: currencyCode): Prices + + """ + The minimum and maximum price of this product based on variant pricing and/or modifier price rules. + """ + priceRanges(includeTax: Boolean = false): PriceRanges + @deprecated(reason: "Use priceRanges inside prices node instead.") + + """ + Weight of the product. + """ + weight: Measurement + + """ + Height of the product. + """ + height: Measurement + + """ + Width of the product. + """ + width: Measurement + + """ + Depth of the product. + """ + depth: Measurement + + """ + Product options. + """ + options( + before: String + after: String + first: Int + last: Int + ): OptionConnection! + + """ + Product options. + """ + productOptions( + before: String + after: String + first: Int + last: Int + ): ProductOptionConnection! + + """ + Summary of the product reviews, includes the total number of reviews submitted and summation of the ratings on the reviews (ratings range from 0-5 per review). + """ + reviewSummary: Reviews! + + """ + Type of product, ex: physical, digital + """ + type: String! + + """ + The availability state of the product. + """ + availability: String! + @deprecated(reason: "Use status inside availabilityV2 instead.") + + """ + A few words telling the customer how long it will normally take to ship this product, such as 'Usually ships in 24 hours'. + """ + availabilityDescription: String! + @deprecated(reason: "Use description inside availabilityV2 instead.") + + """ + The availability state of the product. + """ + availabilityV2: ProductAvailability! + + """ + List of categories associated with the product. + """ + categories( + before: String + after: String + first: Int + last: Int + ): CategoryConnection! + + """ + Brand associated with the product. + """ + brand: Brand + + """ + Variants associated with the product. + """ + variants( + before: String + after: String + first: Int + last: Int + entityIds: [Int!] = [] + optionValueIds: [OptionValueId!] = [] + ): VariantConnection! + + """ + Custom fields of the product. + """ + customFields( + names: [String!] = [] + before: String + after: String + first: Int + last: Int + ): CustomFieldConnection! + + """ + A list of the images for a product. + """ + images(before: String, after: String, first: Int, last: Int): ImageConnection! + + """ + Default image for a product. + """ + defaultImage: Image + + """ + Related products for this product. + """ + relatedProducts( + before: String + after: String + first: Int + last: Int + ): RelatedProductsConnection! + + """ + Inventory information of the product. + """ + inventory: ProductInventory! + + """ + Metafield data related to a product. + """ + metafields( + namespace: String! + keys: [String!] = [] + before: String + after: String + first: Int + last: Int + ): MetafieldConnection! + + """ + Product creation date + """ + createdAt: DateTimeExtended! + @deprecated(reason: "Alpha version. Do not use in production.") +} + +""" +Product availability +""" +interface ProductAvailability { + """ + The availability state of the product. + """ + status: ProductAvailabilityStatus! + + """ + A few words telling the customer how long it will normally take to ship this product, such as 'Usually ships in 24 hours'. + """ + description: String! +} + +""" +Product availability status +""" +enum ProductAvailabilityStatus { + Available + Preorder + Unavailable +} + +""" +Available Product +""" +type ProductAvailable implements ProductAvailability { + """ + The availability state of the product. + """ + status: ProductAvailabilityStatus! + + """ + A few words telling the customer how long it will normally take to ship this product, such as 'Usually ships in 24 hours'. + """ + description: String! +} + +""" +A connection to a list of items. +""" +type ProductConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [ProductEdge] +} + +""" +An edge in a connection. +""" +type ProductEdge { + """ + The item at the end of the edge. + """ + node: Product! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Product Inventory Information +""" +type ProductInventory { + """ + Indicates whether this product is in stock. + """ + isInStock: Boolean! + + """ + Indicates whether this product's inventory is being tracked on variant level. If true, you may wish to check the variants node to understand the true inventory of each individual variant, rather than relying on this product-level aggregate to understand how many items may be added to cart. + """ + hasVariantInventory: Boolean! + + """ + Aggregated product inventory information. This data may not be available if not set or if the store's Inventory Settings have disabled displaying stock levels on the storefront. + """ + aggregated: AggregatedInventory +} + +""" +Product Option +""" +type ProductOption { + """ + Unique ID for the option. + """ + entityId: Int! + + """ + Display name for the option. + """ + displayName: String! + + """ + One of the option values is required to be selected for the checkout. + """ + isRequired: Boolean! + + """ + Option values. + """ + values( + before: String + after: String + first: Int + last: Int + ): OptionValueConnection! +} + +""" +A connection to a list of items. +""" +type ProductOptionConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [ProductOptionEdge] +} + +""" +An edge in a connection. +""" +type ProductOptionEdge { + """ + The item at the end of the edge. + """ + node: CatalogProductOption! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Product Option Value +""" +type ProductOptionValue { + """ + Unique ID for the option value. + """ + entityId: Int! + + """ + Label for the option value. + """ + label: String! +} + +""" +A connection to a list of items. +""" +type ProductOptionValueConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [ProductOptionValueEdge] +} + +""" +An edge in a connection. +""" +type ProductOptionValueEdge { + """ + The item at the end of the edge. + """ + node: CatalogProductOptionValue! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +A Product PickList Value - a product to be mapped to the base product if selected. +""" +type ProductPickListOptionValue implements CatalogProductOptionValue { + """ + The ID of the product associated with this option value. + """ + productId: Int! + + """ + Unique ID for the option value. + """ + entityId: Int! + + """ + Label for the option value. + """ + label: String! + + """ + Indicates whether this value is the chosen default selected value. + """ + isDefault: Boolean! +} + +""" +PreOrder Product +""" +type ProductPreOrder implements ProductAvailability { + """ + The message to be shown in the store when a product is put into the pre-order availability state, e.g. "Expected release date is %%DATE%%" + """ + message: String + + """ + Product release date + """ + willBeReleasedAt: DateTimeExtended + + """ + The availability state of the product. + """ + status: ProductAvailabilityStatus! + + """ + A few words telling the customer how long it will normally take to ship this product, such as 'Usually ships in 24 hours'. + """ + description: String! +} + +""" +Unavailable Product +""" +type ProductUnavailable implements ProductAvailability { + """ + The message to be shown in the store when "Call for pricing" is enabled for this product, e.g. "Contact us at 555-5555" + """ + message: String + + """ + The availability state of the product. + """ + status: ProductAvailabilityStatus! + + """ + A few words telling the customer how long it will normally take to ship this product, such as 'Usually ships in 24 hours'. + """ + description: String! +} + +type Query { + site: Site! + + """ + The currently logged in customer. + """ + customer: Customer + + """ + Fetches an object given its ID + """ + node( + """ + The ID of an object + """ + id: ID! + ): Node + inventory: Inventory! + @deprecated(reason: "Alpha version. Do not use in production.") +} + +""" +A connection to a list of items. +""" +type RelatedProductsConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [RelatedProductsEdge] +} + +""" +An edge in a connection. +""" +type RelatedProductsEdge { + """ + The item at the end of the edge. + """ + node: Product! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Review Rating Summary +""" +type Reviews { + """ + Total number of reviews on product. + """ + numberOfReviews: Int! + + """ + Summation of rating scores from each review. + """ + summationOfRatings: Int! +} + +""" +route +""" +type Route { + """ + node + """ + node: Node +} + +""" +Store settings information from the control panel. +""" +type Settings { + """ + The name of the store. + """ + storeName: String! + + """ + The hash of the store. + """ + storeHash: String! + + """ + The current store status. + """ + status: StorefrontStatusType! + + """ + Logo information for the store. + """ + logo: LogoField! + + """ + Contact information for the store. + """ + contact: ContactField + + """ + Store urls. + """ + url: UrlField! + + """ + Store display format information. + """ + display: DisplayField! + + """ + Channel ID. + """ + channelId: Long! +} + +""" +A site +""" +type Site { + categoryTree: [CategoryTreeItem!]! + + """ + Details of the brand. + """ + brands( + before: String + after: String + first: Int + last: Int + productEntityIds: [Int!] = [] + ): BrandConnection! + + """ + Details of the products. + """ + products( + before: String + after: String + first: Int + last: Int + ids: [ID!] = [] + entityIds: [Int!] = [] + ): ProductConnection! + + """ + Details of the newest products. + """ + newestProducts( + before: String + after: String + first: Int + last: Int + ): ProductConnection! + + """ + Details of the best selling products. + """ + bestSellingProducts( + before: String + after: String + first: Int + last: Int + ): ProductConnection! + + """ + Details of the featured products. + """ + featuredProducts( + before: String + after: String + first: Int + last: Int + ): ProductConnection! + + """ + A single product object with variant pricing overlay capabilities. + """ + product( + id: ID + entityId: Int + variantEntityId: Int + optionValueIds: [OptionValueId!] = [] + sku: String + ): Product + + """ + Route for a node + """ + route(path: String!): Route! + + """ + Store settings. + """ + settings: Settings +} + +""" +Storefront Mode +""" +enum StorefrontStatusType { + LAUNCHED + MAINTENANCE + PRE_LAUNCH + HIBERNATION +} + +""" +A swatch option value - swatch values can be associated with a list of hexidecimal colors or an image. +""" +type SwatchOptionValue implements CatalogProductOptionValue { + """ + List of up to 3 hex encoded colors to associate with a swatch value. + """ + hexColors: [String!]! + + """ + Absolute path of a swatch texture image. + """ + imageUrl(width: Int!, height: Int): String + + """ + Unique ID for the option value. + """ + entityId: Int! + + """ + Label for the option value. + """ + label: String! + + """ + Indicates whether this value is the chosen default selected value. + """ + isDefault: Boolean! +} + +""" +A single line text input field. +""" +type TextFieldOption implements CatalogProductOption { + """ + Unique ID for the option. + """ + entityId: Int! + + """ + Display name for the option. + """ + displayName: String! + + """ + One of the option values is required to be selected for the checkout. + """ + isRequired: Boolean! +} + +""" +Url field +""" +type UrlField { + """ + Store url. + """ + vanityUrl: String! + + """ + CDN url to fetch assets. + """ + cdnUrl: String! +} + +""" +Variant +""" +type Variant implements Node { + """ + The ID of an object + """ + id: ID! + + """ + Id of the variant. + """ + entityId: Int! + + """ + Sku of the variant. + """ + sku: String! + + """ + The variant's weight. If a weight was not explicitly specified on the variant, this will be the product's weight. + """ + weight: Measurement + + """ + The variant's height. If a height was not explicitly specified on the variant, this will be the product's height. + """ + height: Measurement + + """ + The variant's width. If a width was not explicitly specified on the variant, this will be the product's width. + """ + width: Measurement + + """ + The variant's depth. If a depth was not explicitly specified on the variant, this will be the product's depth. + """ + depth: Measurement + + """ + The options which define a variant. + """ + options( + before: String + after: String + first: Int + last: Int + ): OptionConnection! + + """ + Product options that compose this variant. + """ + productOptions( + before: String + after: String + first: Int + last: Int + ): ProductOptionConnection! + + """ + Default image for a variant. + """ + defaultImage: Image + + """ + Variant prices + """ + prices(includeTax: Boolean = false, currencyCode: currencyCode): Prices + + """ + Variant inventory + """ + inventory: VariantInventory + + """ + Metafield data related to a variant. + """ + metafields( + namespace: String! + keys: [String!] = [] + before: String + after: String + first: Int + last: Int + ): MetafieldConnection! +} + +""" +A connection to a list of items. +""" +type VariantConnection { + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + A list of edges. + """ + edges: [VariantEdge] +} + +""" +An edge in a connection. +""" +type VariantEdge { + """ + The item at the end of the edge. + """ + node: Variant! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Variant Inventory +""" +type VariantInventory { + """ + Aggregated product variant inventory information. This data may not be available if not set or if the store's Inventory Settings have disabled displaying stock levels on the storefront. + """ + aggregated: Aggregated + + """ + Indicates whether this product is in stock. + """ + isInStock: Boolean! + + """ + Inventory by locations. + """ + byLocation( + locationEntityIds: [Int!] = [] + before: String + after: String + first: Int + last: Int + ): LocationConnection +} + +""" +Please select a currency +""" +enum currencyCode { + ADP + AED + AFA + AFN + ALK + ALL + AMD + ANG + AOA + AOK + AON + AOR + ARA + ARL + ARM + ARP + ARS + ATS + AUD + AWG + AZM + AZN + BAD + BAM + BAN + BBD + BDT + BEC + BEF + BEL + BGL + BGM + BGN + BGO + BHD + BIF + BMD + BND + BOB + BOL + BOP + BOV + BRB + BRC + BRE + BRL + BRN + BRR + BRZ + BSD + BTN + BUK + BWP + BYB + BYR + BZD + CAD + CDF + CHE + CHF + CHW + CLE + CLF + CLP + CNX + CNY + COP + COU + CRC + CSD + CSK + CVE + CYP + CZK + DDM + DEM + DJF + DKK + DOP + DZD + ECS + ECV + EEK + EGP + ERN + ESA + ESB + ESP + ETB + EUR + FIM + FJD + FKP + FRF + GBP + GEK + GEL + GHC + GHS + GIP + GMD + GNF + GNS + GQE + GRD + GTQ + GWE + GWP + GYD + HKD + HNL + HRD + HRK + HTG + HUF + IDR + IEP + ILP + ILR + ILS + INR + IQD + ISJ + ISK + ITL + JMD + JOD + JPY + KES + KGS + KHR + KMF + KRH + KRO + KRW + KWD + KYD + KZT + LAK + LBP + LKR + LRD + LSL + LTL + LTT + LUC + LUF + LUL + LVL + LVR + LYD + MAD + MAF + MCF + MDC + MDL + MGA + MGF + MKD + MKN + MLF + MMK + MNT + MOP + MRO + MTL + MTP + MUR + MVP + MVR + MWK + MXN + MXP + MXV + MYR + MZE + MZM + MZN + NAD + NGN + NIC + NIO + NLG + NOK + NPR + NZD + OMR + PAB + PEI + PEN + PES + PGK + PHP + PKR + PLN + PLZ + PTE + PYG + QAR + RHD + ROL + RON + RSD + RUB + RUR + RWF + SAR + SBD + SCR + SDD + SDG + SDP + SEK + SGD + SHP + SIT + SKK + SLL + SOS + SRD + SRG + SSP + STD + SUR + SVC + SYP + SZL + THB + TJR + TJS + TMM + TMT + TND + TOP + TPE + TRL + TRY + TTD + TWD + TZS + UAH + UAK + UGS + UGX + USD + USN + USS + UYI + UYP + UYU + UZS + VEB + VEF + VND + VNN + VUV + WST + XAF + XCD + XEU + XFO + XFU + XOF + XPF + XRE + YDD + YER + YUD + YUM + YUN + YUR + ZAL + ZAR + ZMK + ZMW + ZRN + ZRZ + ZWD + ZWL + ZWR +} + +""" +The `BigDecimal` scalar type represents signed fractional values with arbitrary precision. +""" +scalar BigDecimal + +""" +The `Long` scalar type represents non-fractional signed whole numeric values. Long can represent values between -(2^63) and 2^63 - 1. +""" +scalar Long diff --git a/packages/bigcommerce/scripts/generate-definitions.js b/packages/bigcommerce/scripts/generate-definitions.js new file mode 100644 index 0000000..a2b830d --- /dev/null +++ b/packages/bigcommerce/scripts/generate-definitions.js @@ -0,0 +1,49 @@ +/** + * Generates definitions for REST API endpoints that are being + * used by ../api using https://github.com/drwpow/swagger-to-ts + */ +const { readFileSync, promises } = require('fs') +const path = require('path') +const fetch = require('node-fetch') +const swaggerToTS = require('@manifoldco/swagger-to-ts').default + +async function getSchema(filename) { + const url = `https://next-api.stoplight.io/projects/8433/files/${filename}` + const res = await fetch(url) + + if (!res.ok) { + throw new Error(`Request failed with ${res.status}: ${res.statusText}`) + } + + return res.json() +} + +const schemas = Object.entries({ + '../api/definitions/catalog.ts': + 'BigCommerce_Catalog_API.oas2.yml?ref=version%2F20.930', + '../api/definitions/store-content.ts': + 'BigCommerce_Store_Content_API.oas2.yml?ref=version%2F20.930', + '../api/definitions/wishlist.ts': + 'BigCommerce_Wishlist_API.oas2.yml?ref=version%2F20.930', + // swagger-to-ts is not working for the schema of the cart API + // '../api/definitions/cart.ts': + // 'BigCommerce_Server_to_Server_Cart_API.oas2.yml', +}) + +async function writeDefinitions() { + const ops = schemas.map(async ([dest, filename]) => { + const destination = path.join(__dirname, dest) + const schema = await getSchema(filename) + const definition = swaggerToTS(schema.content, { + prettierConfig: 'package.json', + }) + + await promises.writeFile(destination, definition) + + console.log(`✔️ Added definitions for: ${dest}`) + }) + + await Promise.all(ops) +} + +writeDefinitions() diff --git a/packages/bigcommerce/src/api/definitions/catalog.ts b/packages/bigcommerce/src/api/definitions/catalog.ts new file mode 100644 index 0000000..2c483f7 --- /dev/null +++ b/packages/bigcommerce/src/api/definitions/catalog.ts @@ -0,0 +1,2993 @@ +/** + * This file was auto-generated by swagger-to-ts. + * Do not make direct changes to the file. + */ + +export interface definitions { + /** + * Common Modifier properties. + */ + productModifier_Base: { + /** + * BigCommerce API, which determines how it will display on the storefront. Acceptable values: `date`, `checkbox`, `file`, `text`, `multi_line_text`, `numbers_only_text`, `radio_buttons`, `rectangles`, `dropdown`, `product_list`, `product_list_with_images`, `swatch`. Required in a /POST. + */ + type: + | 'date' + | 'checkbox' + | 'file' + | 'text' + | 'multi_line_text' + | 'numbers_only_text' + | 'radio_buttons' + | 'rectangles' + | 'dropdown' + | 'product_list' + | 'product_list_with_images' + | 'swatch' + /** + * Whether or not this modifer is required or not at checkout. Required in a /POST. + */ + required: boolean + /** + * The order the modifiers display on the product detail page. + */ + sort_order?: number + config?: definitions['config_Full'] + /** + * The name of the option shown on the storefront. + */ + display_name?: string + } + /** + * Product Modifier + */ + productModifier_Full: definitions['productModifier_Base'] & { + /** + * The unique numeric ID of the modifier; increments sequentially. + */ + id?: number + /** + * The unique numeric ID of the product to which the option belongs. + */ + product_id?: number + /** + * The unique option name. Auto-generated from the display name, a timestamp, and the product ID. + */ + name?: string + option_values?: definitions['productModifierOptionValue_Full'][] + } + /** + * The model for a POST to create a modifier on a product. + */ + productModifier_Post: { + /** + * BigCommerce API, which determines how it will display on the storefront. Acceptable values: `date`, `checkbox`, `file`, `text`, `multi_line_text`, `numbers_only_text`, `radio_buttons`, `rectangles`, `dropdown`, `product_list`, `product_list_with_images`, `swatch`. Required in a /POST. + */ + type: + | 'date' + | 'checkbox' + | 'file' + | 'text' + | 'multi_line_text' + | 'numbers_only_text' + | 'radio_buttons' + | 'rectangles' + | 'dropdown' + | 'product_list' + | 'product_list_with_images' + | 'swatch' + /** + * Whether or not this modifer is required or not at checkout. Required in a /POST. + */ + required: boolean + /** + * The order the modifiers display on the product detail page. + */ + sort_order?: number + /** + * The values for option config can vary based on the Modifier created. + */ + config?: { + /** + * (date, text, multi_line_text, numbers_only_text) The default value. Shown on a date option as an ISO-8601–formatted string, or on a text option as a string. + */ + default_value?: string + /** + * (checkbox) Flag for setting the checkbox to be checked by default. + */ + checked_by_default?: boolean + /** + * (checkbox) Label displayed for the checkbox option. + */ + checkbox_label?: string + /** + * (date) Flag to limit the dates allowed to be entered on a date option. + */ + date_limited?: boolean + /** + * (date) The type of limit that is allowed to be entered on a date option. + */ + date_limit_mode?: 'earliest' | 'range' | 'latest' + /** + * (date) The earliest date allowed to be entered on the date option, as an ISO-8601 formatted string. + */ + date_earliest_value?: string + /** + * (date) The latest date allowed to be entered on the date option, as an ISO-8601 formatted string. + */ + date_latest_value?: string + /** + * (file) The kind of restriction on the file types that can be uploaded with a file upload option. Values: `specific` - restricts uploads to particular file types; `all` - allows all file types. + */ + file_types_mode?: 'specific' | 'all' + /** + * (file) The type of files allowed to be uploaded if the `file_type_option` is set to `specific`. Values: + * `images` - Allows upload of image MIME types (`bmp`, `gif`, `jpg`, `jpeg`, `jpe`, `jif`, `jfif`, `jfi`, `png`, `wbmp`, `xbm`, `tiff`). `documents` - Allows upload of document MIME types (`txt`, `pdf`, `rtf`, `doc`, `docx`, `xls`, `xlsx`, `accdb`, `mdb`, `one`, `pps`, `ppsx`, `ppt`, `pptx`, `pub`, `odt`, `ods`, `odp`, `odg`, `odf`). + * `other` - Allows file types defined in the `file_types_other` array. + */ + file_types_supported?: string[] + /** + * (file) A list of other file types allowed with the file upload option. + */ + file_types_other?: string[] + /** + * (file) The maximum size for a file that can be used with the file upload option. This will still be limited by the server. + */ + file_max_size?: number + /** + * (text, multi_line_text) Flag to validate the length of a text or multi-line text input. + */ + text_characters_limited?: boolean + /** + * (text, multi_line_text) The minimum length allowed for a text or multi-line text option. + */ + text_min_length?: number + /** + * (text, multi_line_text) The maximum length allowed for a text or multi line text option. + */ + text_max_length?: number + /** + * (multi_line_text) Flag to validate the maximum number of lines allowed on a multi-line text input. + */ + text_lines_limited?: boolean + /** + * (multi_line_text) The maximum number of lines allowed on a multi-line text input. + */ + text_max_lines?: number + /** + * (numbers_only_text) Flag to limit the value of a number option. + */ + number_limited?: boolean + /** + * (numbers_only_text) The type of limit on values entered for a number option. + */ + number_limit_mode?: 'lowest' | 'highest' | 'range' + /** + * (numbers_only_text) The lowest allowed value for a number option if `number_limited` is true. + */ + number_lowest_value?: number + /** + * (numbers_only_text) The highest allowed value for a number option if `number_limited` is true. + */ + number_highest_value?: number + /** + * (numbers_only_text) Flag to limit the input on a number option to whole numbers only. + */ + number_integers_only?: boolean + /** + * (product_list, product_list_with_images) Flag for automatically adjusting inventory on a product included in the list. + */ + product_list_adjusts_inventory?: boolean + /** + * (product_list, product_list_with_images) Flag to add the optional product's price to the main product's price. + */ + product_list_adjusts_pricing?: boolean + /** + * (product_list, product_list_with_images) How to factor the optional product's weight and package dimensions into the shipping quote. Values: `none` - don't adjust; `weight` - use shipping weight only; `package` - use weight and dimensions. + */ + product_list_shipping_calc?: 'none' | 'weight' | 'package' + } + option_values?: (({ + /** + * The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers. + */ + is_default?: boolean + /** + * The text display identifying the value on the storefront. Required in a /POST. + */ + label: string + /** + * The order in which the value will be displayed on the product page. Required in a /POST. + */ + sort_order: number + /** + * Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state. + */ + value_data?: { [key: string]: any } + } & { + adjusters?: { + /** + * Adjuster for Complex Rules. + */ + price?: { + /** + * The type of adjuster for either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster?: 'relative' | 'percentage' + /** + * The numeric amount by which the adjuster will change either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster_value?: number + } + /** + * Adjuster for Complex Rules. + */ + weight?: { + /** + * The type of adjuster for either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster?: 'relative' | 'percentage' + /** + * The numeric amount by which the adjuster will change either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster_value?: number + } + /** + * The URL for an image displayed on the storefront when the modifier value is selected.Limit of 8MB per file. + */ + image_url?: string + purchasing_disabled?: { + /** + * Flag for whether the modifier value disables purchasing when selected on the storefront. This can be used for temporarily disabling a particular modifier value. + */ + status?: boolean + /** + * The message displayed on the storefront when the purchasing disabled status is `true`. + */ + message?: string + } + } + }) & { + /** + * The unique numeric ID of the value; increments sequentially. + */ + id?: number + })[] + } & { + /** + * The name of the option shown on the storefront. + */ + display_name: string + } + /** + * The model for a PUT to update a modifier on a product. + */ + productModifier_Put: { + /** + * BigCommerce API, which determines how it will display on the storefront. Acceptable values: `date`, `checkbox`, `file`, `text`, `multi_line_text`, `numbers_only_text`, `radio_buttons`, `rectangles`, `dropdown`, `product_list`, `product_list_with_images`, `swatch`. Required in a /POST. + */ + type: + | 'date' + | 'checkbox' + | 'file' + | 'text' + | 'multi_line_text' + | 'numbers_only_text' + | 'radio_buttons' + | 'rectangles' + | 'dropdown' + | 'product_list' + | 'product_list_with_images' + | 'swatch' + /** + * Whether or not this modifer is required or not at checkout. Required in a /POST. + */ + required: boolean + /** + * The order the modifiers display on the product detail page. + */ + sort_order?: number + /** + * The values for option config can vary based on the Modifier created. + */ + config?: { + /** + * (date, text, multi_line_text, numbers_only_text) The default value. Shown on a date option as an ISO-8601–formatted string, or on a text option as a string. + */ + default_value?: string + /** + * (checkbox) Flag for setting the checkbox to be checked by default. + */ + checked_by_default?: boolean + /** + * (checkbox) Label displayed for the checkbox option. + */ + checkbox_label?: string + /** + * (date) Flag to limit the dates allowed to be entered on a date option. + */ + date_limited?: boolean + /** + * (date) The type of limit that is allowed to be entered on a date option. + */ + date_limit_mode?: 'earliest' | 'range' | 'latest' + /** + * (date) The earliest date allowed to be entered on the date option, as an ISO-8601 formatted string. + */ + date_earliest_value?: string + /** + * (date) The latest date allowed to be entered on the date option, as an ISO-8601 formatted string. + */ + date_latest_value?: string + /** + * (file) The kind of restriction on the file types that can be uploaded with a file upload option. Values: `specific` - restricts uploads to particular file types; `all` - allows all file types. + */ + file_types_mode?: 'specific' | 'all' + /** + * (file) The type of files allowed to be uploaded if the `file_type_option` is set to `specific`. Values: + * `images` - Allows upload of image MIME types (`bmp`, `gif`, `jpg`, `jpeg`, `jpe`, `jif`, `jfif`, `jfi`, `png`, `wbmp`, `xbm`, `tiff`). `documents` - Allows upload of document MIME types (`txt`, `pdf`, `rtf`, `doc`, `docx`, `xls`, `xlsx`, `accdb`, `mdb`, `one`, `pps`, `ppsx`, `ppt`, `pptx`, `pub`, `odt`, `ods`, `odp`, `odg`, `odf`). + * `other` - Allows file types defined in the `file_types_other` array. + */ + file_types_supported?: string[] + /** + * (file) A list of other file types allowed with the file upload option. + */ + file_types_other?: string[] + /** + * (file) The maximum size for a file that can be used with the file upload option. This will still be limited by the server. + */ + file_max_size?: number + /** + * (text, multi_line_text) Flag to validate the length of a text or multi-line text input. + */ + text_characters_limited?: boolean + /** + * (text, multi_line_text) The minimum length allowed for a text or multi-line text option. + */ + text_min_length?: number + /** + * (text, multi_line_text) The maximum length allowed for a text or multi line text option. + */ + text_max_length?: number + /** + * (multi_line_text) Flag to validate the maximum number of lines allowed on a multi-line text input. + */ + text_lines_limited?: boolean + /** + * (multi_line_text) The maximum number of lines allowed on a multi-line text input. + */ + text_max_lines?: number + /** + * (numbers_only_text) Flag to limit the value of a number option. + */ + number_limited?: boolean + /** + * (numbers_only_text) The type of limit on values entered for a number option. + */ + number_limit_mode?: 'lowest' | 'highest' | 'range' + /** + * (numbers_only_text) The lowest allowed value for a number option if `number_limited` is true. + */ + number_lowest_value?: number + /** + * (numbers_only_text) The highest allowed value for a number option if `number_limited` is true. + */ + number_highest_value?: number + /** + * (numbers_only_text) Flag to limit the input on a number option to whole numbers only. + */ + number_integers_only?: boolean + /** + * (product_list, product_list_with_images) Flag for automatically adjusting inventory on a product included in the list. + */ + product_list_adjusts_inventory?: boolean + /** + * (product_list, product_list_with_images) Flag to add the optional product's price to the main product's price. + */ + product_list_adjusts_pricing?: boolean + /** + * (product_list, product_list_with_images) How to factor the optional product's weight and package dimensions into the shipping quote. Values: `none` - don't adjust; `weight` - use shipping weight only; `package` - use weight and dimensions. + */ + product_list_shipping_calc?: 'none' | 'weight' | 'package' + } + option_values?: (({ + /** + * The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers. + */ + is_default?: boolean + /** + * The text display identifying the value on the storefront. Required in a /POST. + */ + label: string + /** + * The order in which the value will be displayed on the product page. Required in a /POST. + */ + sort_order: number + /** + * Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state. + */ + value_data?: { [key: string]: any } + } & { + adjusters?: { + /** + * Adjuster for Complex Rules. + */ + price?: { + /** + * The type of adjuster for either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster?: 'relative' | 'percentage' + /** + * The numeric amount by which the adjuster will change either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster_value?: number + } + /** + * Adjuster for Complex Rules. + */ + weight?: { + /** + * The type of adjuster for either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster?: 'relative' | 'percentage' + /** + * The numeric amount by which the adjuster will change either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster_value?: number + } + /** + * The URL for an image displayed on the storefront when the modifier value is selected.Limit of 8MB per file. + */ + image_url?: string + purchasing_disabled?: { + /** + * Flag for whether the modifier value disables purchasing when selected on the storefront. This can be used for temporarily disabling a particular modifier value. + */ + status?: boolean + /** + * The message displayed on the storefront when the purchasing disabled status is `true`. + */ + message?: string + } + } + }) & { + /** + * The unique numeric ID of the value; increments sequentially. + */ + id?: number + })[] + } + /** + * Common Product Modifer `option_value` properties. + */ + productModifierOptionValue_Base: { + /** + * The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers. + */ + is_default?: boolean + /** + * The text display identifying the value on the storefront. Required in a /POST. + */ + label: string + /** + * The order in which the value will be displayed on the product page. Required in a /POST. + */ + sort_order: number + /** + * Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state. If no data is available, returns `null`. + */ + value_data?: { [key: string]: any } + adjusters?: definitions['adjusters_Full'] + } + /** + * Product Modifer `option_value`. + */ + productModifierOptionValue_Full: definitions['productModifierOptionValue_Base'] & { + /** + * The unique numeric ID of the value; increments sequentially. + */ + id?: number + option_id?: number + } + /** + * The model for a POST to create a modifier value on a product. + */ + productModifierOptionValue_Post: { + /** + * The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers. + */ + is_default?: boolean + /** + * The text display identifying the value on the storefront. Required in a /POST. + */ + label: string + /** + * The order in which the value will be displayed on the product page. Required in a /POST. + */ + sort_order: number + /** + * Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state. + */ + value_data?: { [key: string]: any } + } & { + adjusters?: { + /** + * Adjuster for Complex Rules. + */ + price?: { + /** + * The type of adjuster for either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster?: 'relative' | 'percentage' + /** + * The numeric amount by which the adjuster will change either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster_value?: number + } + /** + * Adjuster for Complex Rules. + */ + weight?: { + /** + * The type of adjuster for either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster?: 'relative' | 'percentage' + /** + * The numeric amount by which the adjuster will change either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster_value?: number + } + /** + * The URL for an image displayed on the storefront when the modifier value is selected.Limit of 8MB per file. + */ + image_url?: string + purchasing_disabled?: { + /** + * Flag for whether the modifier value disables purchasing when selected on the storefront. This can be used for temporarily disabling a particular modifier value. + */ + status?: boolean + /** + * The message displayed on the storefront when the purchasing disabled status is `true`. + */ + message?: string + } + } + } + /** + * The model for a PUT to update a modifier value on a product. + */ + productModifierOptionValue_Put: ({ + /** + * The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers. + */ + is_default?: boolean + /** + * The text display identifying the value on the storefront. Required in a /POST. + */ + label: string + /** + * The order in which the value will be displayed on the product page. Required in a /POST. + */ + sort_order: number + /** + * Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state. + */ + value_data?: { [key: string]: any } + } & { + adjusters?: { + /** + * Adjuster for Complex Rules. + */ + price?: { + /** + * The type of adjuster for either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster?: 'relative' | 'percentage' + /** + * The numeric amount by which the adjuster will change either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster_value?: number + } + /** + * Adjuster for Complex Rules. + */ + weight?: { + /** + * The type of adjuster for either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster?: 'relative' | 'percentage' + /** + * The numeric amount by which the adjuster will change either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster_value?: number + } + /** + * The URL for an image displayed on the storefront when the modifier value is selected.Limit of 8MB per file. + */ + image_url?: string + purchasing_disabled?: { + /** + * Flag for whether the modifier value disables purchasing when selected on the storefront. This can be used for temporarily disabling a particular modifier value. + */ + status?: boolean + /** + * The message displayed on the storefront when the purchasing disabled status is `true`. + */ + message?: string + } + } + }) & { + /** + * The unique numeric ID of the value; increments sequentially. + */ + id?: number + } + resp_productionOption: { + data?: definitions['productOption_Full'] + /** + * Empty meta object; may be used later. + */ + meta?: { ''?: string } + } + /** + * Common Option properties. + */ + productOption_Base: { + /** + * The unique numerical ID of the option, increments sequentially. + */ + id?: number + /** + * The unique numerical ID of the product to which the option belongs. + */ + product_id?: number + /** + * The name of the option shown on the storefront. + */ + display_name?: string + /** + * The type of option, which determines how it will display on the storefront. Acceptable values: `radio_buttons`, `rectangles`, `dropdown`, `product_list`, `product_list_with_images`, `swatch`. For reference, the former v2 API values are: RB = radio_buttons, RT = rectangles, S = dropdown, P = product_list, PI = product_list_with_images, CS = swatch. + */ + type?: + | 'radio_buttons' + | 'rectangles' + | 'dropdown' + | 'product_list' + | 'product_list_with_images' + | 'swatch' + config?: definitions['productOptionConfig_Full'] + /** + * Order in which the option is displayed on the storefront. + */ + sort_order?: number + option_values?: definitions['productOptionOptionValue_Full'] + } + productOption_Full: definitions['productOption_Base'] & { + /** + * The unique option name, auto-generated from the display name, a timestamp, and the product ID. + */ + name?: string + } + /** + * The model for a POST to create options on a product. + */ + productOption_Post: { + /** + * The unique numerical ID of the option, increments sequentially. + */ + id?: number + /** + * The unique numerical ID of the product to which the option belongs. + */ + product_id?: number + /** + * The name of the option shown on the storefront. + */ + display_name?: string + /** + * The type of option, which determines how it will display on the storefront. Acceptable values: `radio_buttons`, `rectangles`, `dropdown`, `product_list`, `product_list_with_images`, `swatch`. For reference, the former v2 API values are: RB = radio_buttons, RT = rectangles, S = dropdown, P = product_list, PI = product_list_with_images, CS = swatch. + */ + type?: + | 'radio_buttons' + | 'rectangles' + | 'dropdown' + | 'product_list' + | 'product_list_with_images' + | 'swatch' + /** + * The values for option config can vary based on the Modifier created. + */ + config?: { + /** + * (date, text, multi_line_text, numbers_only_text) The default value. Shown on a date option as an ISO-8601–formatted string, or on a text option as a string. + */ + default_value?: string + /** + * (checkbox) Flag for setting the checkbox to be checked by default. + */ + checked_by_default?: boolean + /** + * (checkbox) Label displayed for the checkbox option. + */ + checkbox_label?: string + /** + * (date) Flag to limit the dates allowed to be entered on a date option. + */ + date_limited?: boolean + /** + * (date) The type of limit that is allowed to be entered on a date option. + */ + date_limit_mode?: 'earliest' | 'range' | 'latest' + /** + * (date) The earliest date allowed to be entered on the date option, as an ISO-8601 formatted string. + */ + date_earliest_value?: string + /** + * (date) The latest date allowed to be entered on the date option, as an ISO-8601 formatted string. + */ + date_latest_value?: string + /** + * (file) The kind of restriction on the file types that can be uploaded with a file upload option. Values: `specific` - restricts uploads to particular file types; `all` - allows all file types. + */ + file_types_mode?: 'specific' | 'all' + /** + * (file) The type of files allowed to be uploaded if the `file_type_option` is set to `specific`. Values: + * `images` - Allows upload of image MIME types (`bmp`, `gif`, `jpg`, `jpeg`, `jpe`, `jif`, `jfif`, `jfi`, `png`, `wbmp`, `xbm`, `tiff`). `documents` - Allows upload of document MIME types (`txt`, `pdf`, `rtf`, `doc`, `docx`, `xls`, `xlsx`, `accdb`, `mdb`, `one`, `pps`, `ppsx`, `ppt`, `pptx`, `pub`, `odt`, `ods`, `odp`, `odg`, `odf`). + * `other` - Allows file types defined in the `file_types_other` array. + */ + file_types_supported?: string[] + /** + * (file) A list of other file types allowed with the file upload option. + */ + file_types_other?: string[] + /** + * (file) The maximum size for a file that can be used with the file upload option. This will still be limited by the server. + */ + file_max_size?: number + /** + * (text, multi_line_text) Flag to validate the length of a text or multi-line text input. + */ + text_characters_limited?: boolean + /** + * (text, multi_line_text) The minimum length allowed for a text or multi-line text option. + */ + text_min_length?: number + /** + * (text, multi_line_text) The maximum length allowed for a text or multi line text option. + */ + text_max_length?: number + /** + * (multi_line_text) Flag to validate the maximum number of lines allowed on a multi-line text input. + */ + text_lines_limited?: boolean + /** + * (multi_line_text) The maximum number of lines allowed on a multi-line text input. + */ + text_max_lines?: number + /** + * (numbers_only_text) Flag to limit the value of a number option. + */ + number_limited?: boolean + /** + * (numbers_only_text) The type of limit on values entered for a number option. + */ + number_limit_mode?: 'lowest' | 'highest' | 'range' + /** + * (numbers_only_text) The lowest allowed value for a number option if `number_limited` is true. + */ + number_lowest_value?: number + /** + * (numbers_only_text) The highest allowed value for a number option if `number_limited` is true. + */ + number_highest_value?: number + /** + * (numbers_only_text) Flag to limit the input on a number option to whole numbers only. + */ + number_integers_only?: boolean + /** + * (product_list, product_list_with_images) Flag for automatically adjusting inventory on a product included in the list. + */ + product_list_adjusts_inventory?: boolean + /** + * (product_list, product_list_with_images) Flag to add the optional product's price to the main product's price. + */ + product_list_adjusts_pricing?: boolean + /** + * (product_list, product_list_with_images) How to factor the optional product's weight and package dimensions into the shipping quote. Values: `none` - don't adjust; `weight` - use shipping weight only; `package` - use weight and dimensions. + */ + product_list_shipping_calc?: 'none' | 'weight' | 'package' + } + /** + * Order in which the option is displayed on the storefront. + */ + sort_order?: number + option_values?: ({ + /** + * The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers. + */ + is_default?: boolean + /** + * The text display identifying the value on the storefront. Required in a /POST. + */ + label: string + /** + * The order in which the value will be displayed on the product page. Required in a /POST. + */ + sort_order: number + /** + * Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state. + */ + value_data?: { [key: string]: any } + } & { + /** + * The unique numeric ID of the value; increments sequentially. + */ + id?: number + })[] + /** + * Publicly available image url + */ + image_url?: string + } + /** + * The model for a PUT to update options on a product. + */ + productOption_Put: { + /** + * The unique numerical ID of the option, increments sequentially. + */ + id?: number + /** + * The unique numerical ID of the product to which the option belongs. + */ + product_id?: number + /** + * The name of the option shown on the storefront. + */ + display_name?: string + /** + * The type of option, which determines how it will display on the storefront. Acceptable values: `radio_buttons`, `rectangles`, `dropdown`, `product_list`, `product_list_with_images`, `swatch`. For reference, the former v2 API values are: RB = radio_buttons, RT = rectangles, S = dropdown, P = product_list, PI = product_list_with_images, CS = swatch. + */ + type?: + | 'radio_buttons' + | 'rectangles' + | 'dropdown' + | 'product_list' + | 'product_list_with_images' + | 'swatch' + /** + * The values for option config can vary based on the Modifier created. + */ + config?: { + /** + * (date, text, multi_line_text, numbers_only_text) The default value. Shown on a date option as an ISO-8601–formatted string, or on a text option as a string. + */ + default_value?: string + /** + * (checkbox) Flag for setting the checkbox to be checked by default. + */ + checked_by_default?: boolean + /** + * (checkbox) Label displayed for the checkbox option. + */ + checkbox_label?: string + /** + * (date) Flag to limit the dates allowed to be entered on a date option. + */ + date_limited?: boolean + /** + * (date) The type of limit that is allowed to be entered on a date option. + */ + date_limit_mode?: 'earliest' | 'range' | 'latest' + /** + * (date) The earliest date allowed to be entered on the date option, as an ISO-8601 formatted string. + */ + date_earliest_value?: string + /** + * (date) The latest date allowed to be entered on the date option, as an ISO-8601 formatted string. + */ + date_latest_value?: string + /** + * (file) The kind of restriction on the file types that can be uploaded with a file upload option. Values: `specific` - restricts uploads to particular file types; `all` - allows all file types. + */ + file_types_mode?: 'specific' | 'all' + /** + * (file) The type of files allowed to be uploaded if the `file_type_option` is set to `specific`. Values: + * `images` - Allows upload of image MIME types (`bmp`, `gif`, `jpg`, `jpeg`, `jpe`, `jif`, `jfif`, `jfi`, `png`, `wbmp`, `xbm`, `tiff`). `documents` - Allows upload of document MIME types (`txt`, `pdf`, `rtf`, `doc`, `docx`, `xls`, `xlsx`, `accdb`, `mdb`, `one`, `pps`, `ppsx`, `ppt`, `pptx`, `pub`, `odt`, `ods`, `odp`, `odg`, `odf`). + * `other` - Allows file types defined in the `file_types_other` array. + */ + file_types_supported?: string[] + /** + * (file) A list of other file types allowed with the file upload option. + */ + file_types_other?: string[] + /** + * (file) The maximum size for a file that can be used with the file upload option. This will still be limited by the server. + */ + file_max_size?: number + /** + * (text, multi_line_text) Flag to validate the length of a text or multi-line text input. + */ + text_characters_limited?: boolean + /** + * (text, multi_line_text) The minimum length allowed for a text or multi-line text option. + */ + text_min_length?: number + /** + * (text, multi_line_text) The maximum length allowed for a text or multi line text option. + */ + text_max_length?: number + /** + * (multi_line_text) Flag to validate the maximum number of lines allowed on a multi-line text input. + */ + text_lines_limited?: boolean + /** + * (multi_line_text) The maximum number of lines allowed on a multi-line text input. + */ + text_max_lines?: number + /** + * (numbers_only_text) Flag to limit the value of a number option. + */ + number_limited?: boolean + /** + * (numbers_only_text) The type of limit on values entered for a number option. + */ + number_limit_mode?: 'lowest' | 'highest' | 'range' + /** + * (numbers_only_text) The lowest allowed value for a number option if `number_limited` is true. + */ + number_lowest_value?: number + /** + * (numbers_only_text) The highest allowed value for a number option if `number_limited` is true. + */ + number_highest_value?: number + /** + * (numbers_only_text) Flag to limit the input on a number option to whole numbers only. + */ + number_integers_only?: boolean + /** + * (product_list, product_list_with_images) Flag for automatically adjusting inventory on a product included in the list. + */ + product_list_adjusts_inventory?: boolean + /** + * (product_list, product_list_with_images) Flag to add the optional product's price to the main product's price. + */ + product_list_adjusts_pricing?: boolean + /** + * (product_list, product_list_with_images) How to factor the optional product's weight and package dimensions into the shipping quote. Values: `none` - don't adjust; `weight` - use shipping weight only; `package` - use weight and dimensions. + */ + product_list_shipping_calc?: 'none' | 'weight' | 'package' + } + /** + * Order in which the option is displayed on the storefront. + */ + sort_order?: number + option_values?: ({ + /** + * The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers. + */ + is_default?: boolean + /** + * The text display identifying the value on the storefront. Required in a /POST. + */ + label: string + /** + * The order in which the value will be displayed on the product page. Required in a /POST. + */ + sort_order: number + /** + * Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state. + */ + value_data?: { [key: string]: any } + } & { + /** + * The unique numeric ID of the value; increments sequentially. + */ + id?: number + })[] + /** + * Publicly available image url + */ + image_url?: string + } + /** + * Returns the categories tree, a nested lineage of the categories with parent->child relationship. The Category objects returned are simplified versions of the category objects returned in the rest of this API. + */ + categoriesTree_Resp: { + data?: definitions['categoriesTreeNode_Full'][] + meta?: definitions['metaEmpty_Full'] + } + /** + * Used to reflect parent <> child category relationships. Used by Category Tree. + */ + categoriesTreeNode_Full: { + /** + * The unique numeric ID of the category; increments sequentially. + */ + id?: number + /** + * The unique numeric ID of the category's parent. This field controls where the category sits in the tree of categories that organize the catalog. + */ + parent_id?: number + /** + * The name displayed for the category. Name is unique with respect to the category's siblings. + */ + name?: string + /** + * Flag to determine whether the product should be displayed to customers browsing the store. If `true`, the category will be displayed. If `false`, the category will be hidden from view. + */ + is_visible?: boolean + /** + * The custom URL for the category on the storefront. + */ + url?: string + /** + * The list of children of the category. + */ + children?: definitions['categoriesTreeNode_Full'][] + } + /** + * Common Category object properties. + */ + category_Full: { + /** + * Unique ID of the *Category*. Increments sequentially. + * Read-Only. + */ + id?: number + /** + * The unique numeric ID of the category's parent. This field controls where the category sits in the tree of categories that organize the catalog. + * Required in a POST if creating a child category. + */ + parent_id: number + /** + * The name displayed for the category. Name is unique with respect to the category's siblings. + * Required in a POST. + */ + name: string + /** + * The product description, which can include HTML formatting. + */ + description?: string + /** + * Number of views the category has on the storefront. + */ + views?: number + /** + * Priority this category will be given when included in the menu and category pages. The lower the number, the closer to the top of the results the category will be. + */ + sort_order?: number + /** + * Custom title for the category page. If not defined, the category name will be used as the meta title. + */ + page_title?: string + /** + * A comma-separated list of keywords that can be used to locate the category when searching the store. + */ + search_keywords?: string + /** + * Custom meta keywords for the category page. If not defined, the store's default keywords will be used. Must post as an array like: ["awesome","sauce"]. + */ + meta_keywords?: string[] + /** + * Custom meta description for the category page. If not defined, the store's default meta description will be used. + */ + meta_description?: string + /** + * A valid layout file. (Please refer to [this article](https://support.bigcommerce.com/articles/Public/Creating-Custom-Template-Files/) on creating category files.) This field is writable only for stores with a Blueprint theme applied. + */ + layout_file?: string + /** + * Flag to determine whether the product should be displayed to customers browsing the store. If `true`, the category will be displayed. If `false`, the category will be hidden from view. + */ + is_visible?: boolean + /** + * Determines how the products are sorted on category page load. + */ + default_product_sort?: + | 'use_store_settings' + | 'featured' + | 'newest' + | 'best_selling' + | 'alpha_asc' + | 'alpha_desc' + | 'avg_customer_review' + | 'price_asc' + | 'price_desc' + /** + * Image URL used for this category on the storefront. Images can be uploaded via form file post to `/categories/{categoryId}/image`, or by providing a publicly accessible URL in this field. + */ + image_url?: string + custom_url?: definitions['customUrl_Full'] + } + /** + * Common Brand properties. + */ + brand_Full: { + /** + * Unique ID of the *Brand*. Read-Only. + */ + id?: number + /** + * The name of the brand. Must be unique. + * Required in POST. + */ + name: string + /** + * The title shown in the browser while viewing the brand. + */ + page_title?: string + /** + * Comma-separated list of meta keywords to include in the HTML. + */ + meta_keywords?: string[] + /** + * A meta description to include. + */ + meta_description?: string + /** + * A comma-separated list of keywords that can be used to locate this brand. + */ + search_keywords?: string + /** + * Image URL used for this category on the storefront. Images can be uploaded via form file post to `/brands/{brandId}/image`, or by providing a publicly accessible URL in this field. + */ + image_url?: string + custom_url?: definitions['customUrl_Full'] + } + /** + * Common Variant properties. + */ + productVariant_Base: { + /** + * The cost price of the variant. Not affected by Price List prices. + */ + cost_price?: number + /** + * This variant's base price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is `null`, the product's default price (set in the Product resource's `price` field) will be used as the base price. + */ + price?: number + /** + * This variant's sale price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product's sale price (set in the Product resource's `price` field) will be used as the sale price. + */ + sale_price?: number + /** + * This variant's retail price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product's retail price (set in the Product resource's `price` field) will be used as the retail price. + */ + retail_price?: number + /** + * This variant's base weight on the storefront. If this value is null, the product's default weight (set in the Product resource's weight field) will be used as the base weight. + */ + weight?: number + /** + * Width of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default width (set in the Product resource's `width` field) will be used as the base width. + */ + width?: number + /** + * Height of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default height (set in the Product resource's `height` field) will be used as the base height. + */ + height?: number + /** + * Depth of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default depth (set in the Product resource's `depth` field) will be used as the base depth. + */ + depth?: number + /** + * Flag used to indicate whether the variant has free shipping. If `true`, the shipping cost for the variant will be zero. + */ + is_free_shipping?: boolean + /** + * A fixed shipping cost for the variant. If defined, this value will be used during checkout instead of normal shipping-cost calculation. + */ + fixed_cost_shipping_price?: number + /** + * If `true`, this variant will not be purchasable on the storefront. + */ + purchasing_disabled?: boolean + /** + * If `purchasing_disabled` is `true`, this message should show on the storefront when the variant is selected. + */ + purchasing_disabled_message?: string + /** + * The UPC code used in feeds for shopping comparison sites and external channel integrations. + */ + upc?: string + /** + * Inventory level for the variant, which is used when the product's inventory_tracking is set to `variant`. + */ + inventory_level?: number + /** + * When the variant hits this inventory level, it is considered low stock. + */ + inventory_warning_level?: number + /** + * Identifies where in a warehouse the variant is located. + */ + bin_picking_number?: string + } + productVariant_Full: definitions['productVariant_Base'] & { + id?: number + product_id?: number + sku?: string + /** + * Read-only reference to v2 API's SKU ID. Null if it is a base variant. + */ + sku_id?: number + /** + * Array of option and option values IDs that make up this variant. Will be empty if the variant is the product's base variant. + */ + option_values?: definitions['productVariantOptionValue_Base'][] + /** + * The price of the variant as seen on the storefront. This price takes into account `sale_price` and any price adjustment rules that are applicable to this variant. + */ + calculated_price?: number + } + /** + * The model for a POST to create variants on a product. + */ + productVariant_Post: { + /** + * The cost price of the variant. Not affected by Price List prices. + */ + cost_price?: number + /** + * This variant's base price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is `null`, the product's default price (set in the Product resource's `price` field) will be used as the base price. + */ + price?: number + /** + * This variant's sale price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product's sale price (set in the Product resource's `price` field) will be used as the sale price. + */ + sale_price?: number + /** + * This variant's retail price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product's retail price (set in the Product resource's `price` field) will be used as the retail price. + */ + retail_price?: number + /** + * This variant's base weight on the storefront. If this value is null, the product's default weight (set in the Product resource's weight field) will be used as the base weight. + */ + weight?: number + /** + * Width of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default width (set in the Product resource's `width` field) will be used as the base width. + */ + width?: number + /** + * Height of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default height (set in the Product resource's `height` field) will be used as the base height. + */ + height?: number + /** + * Depth of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default depth (set in the Product resource's `depth` field) will be used as the base depth. + */ + depth?: number + /** + * Flag used to indicate whether the variant has free shipping. If `true`, the shipping cost for the variant will be zero. + */ + is_free_shipping?: boolean + /** + * A fixed shipping cost for the variant. If defined, this value will be used during checkout instead of normal shipping-cost calculation. + */ + fixed_cost_shipping_price?: number + /** + * If `true`, this variant will not be purchasable on the storefront. + */ + purchasing_disabled?: boolean + /** + * If `purchasing_disabled` is `true`, this message should show on the storefront when the variant is selected. + */ + purchasing_disabled_message?: string + /** + * The UPC code used in feeds for shopping comparison sites and external channel integrations. + */ + upc?: string + /** + * Inventory level for the variant, which is used when the product's inventory_tracking is set to `variant`. + */ + inventory_level?: number + /** + * When the variant hits this inventory level, it is considered low stock. + */ + inventory_warning_level?: number + /** + * Identifies where in a warehouse the variant is located. + */ + bin_picking_number?: string + } & { + product_id?: number + sku?: string + /** + * Array of option and option values IDs that make up this variant. Will be empty if the variant is the product's base variant. + */ + option_values?: { id?: number; option_id?: number }[] + } + variantCollection_Put: definitions['productVariant_Full'][] + /** + * The model for a PUT to update variants on a product. + */ + variant_Put: { + /** + * The cost price of the variant. Not affected by Price List prices. + */ + cost_price?: number + /** + * This variant's base price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is `null`, the product's default price (set in the Product resource's `price` field) will be used as the base price. + */ + price?: number + /** + * This variant's sale price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product's sale price (set in the Product resource's `price` field) will be used as the sale price. + */ + sale_price?: number + /** + * This variant's retail price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product's retail price (set in the Product resource's `price` field) will be used as the retail price. + */ + retail_price?: number + /** + * This variant's base weight on the storefront. If this value is null, the product's default weight (set in the Product resource's weight field) will be used as the base weight. + */ + weight?: number + /** + * Width of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default width (set in the Product resource's `width` field) will be used as the base width. + */ + width?: number + /** + * Height of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default height (set in the Product resource's `height` field) will be used as the base height. + */ + height?: number + /** + * Depth of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default depth (set in the Product resource's `depth` field) will be used as the base depth. + */ + depth?: number + /** + * Flag used to indicate whether the variant has free shipping. If `true`, the shipping cost for the variant will be zero. + */ + is_free_shipping?: boolean + /** + * A fixed shipping cost for the variant. If defined, this value will be used during checkout instead of normal shipping-cost calculation. + */ + fixed_cost_shipping_price?: number + /** + * If `true`, this variant will not be purchasable on the storefront. + */ + purchasing_disabled?: boolean + /** + * If `purchasing_disabled` is `true`, this message should show on the storefront when the variant is selected. + */ + purchasing_disabled_message?: string + /** + * The UPC code used in feeds for shopping comparison sites and external channel integrations. + */ + upc?: string + /** + * Inventory level for the variant, which is used when the product's inventory_tracking is set to `variant`. + */ + inventory_level?: number + /** + * When the variant hits this inventory level, it is considered low stock. + */ + inventory_warning_level?: number + /** + * Identifies where in a warehouse the variant is located. + */ + bin_picking_number?: string + } & { id?: number } + /** + * The model for a POST to create variants on a product. + */ + productVariant_Post_Product: definitions['productVariant_Base'] & { + sku?: string + option_values?: { + /** + * The name of the option. + */ + option_display_name?: string + /** + * The label of the option value. + */ + label?: string + }[] + } + /** + * The model for a PUT to update variants on a product. + */ + productVariant_Put_Product: { + /** + * The cost price of the variant. Not affected by Price List prices. + */ + cost_price?: number + /** + * This variant's base price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is `null`, the product's default price (set in the Product resource's `price` field) will be used as the base price. + */ + price?: number + /** + * This variant's sale price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product's sale price (set in the Product resource's `price` field) will be used as the sale price. + */ + sale_price?: number + /** + * This variant's retail price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product's retail price (set in the Product resource's `price` field) will be used as the retail price. + */ + retail_price?: number + /** + * This variant's base weight on the storefront. If this value is null, the product's default weight (set in the Product resource's weight field) will be used as the base weight. + */ + weight?: number + /** + * Width of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default width (set in the Product resource's `width` field) will be used as the base width. + */ + width?: number + /** + * Height of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default height (set in the Product resource's `height` field) will be used as the base height. + */ + height?: number + /** + * Depth of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default depth (set in the Product resource's `depth` field) will be used as the base depth. + */ + depth?: number + /** + * Flag used to indicate whether the variant has free shipping. If `true`, the shipping cost for the variant will be zero. + */ + is_free_shipping?: boolean + /** + * A fixed shipping cost for the variant. If defined, this value will be used during checkout instead of normal shipping-cost calculation. + */ + fixed_cost_shipping_price?: number + /** + * If `true`, this variant will not be purchasable on the storefront. + */ + purchasing_disabled?: boolean + /** + * If `purchasing_disabled` is `true`, this message should show on the storefront when the variant is selected. + */ + purchasing_disabled_message?: string + /** + * The UPC code used in feeds for shopping comparison sites and external channel integrations. + */ + upc?: string + /** + * Inventory level for the variant, which is used when the product's inventory_tracking is set to `variant`. + */ + inventory_level?: number + /** + * When the variant hits this inventory level, it is considered low stock. + */ + inventory_warning_level?: number + /** + * Identifies where in a warehouse the variant is located. + */ + bin_picking_number?: string + product_id?: number + sku?: string + } + productVariantOptionValue_Full: { + /** + * The name of the option. + */ + option_display_name?: string + /** + * The label of the option value. + */ + label?: string + } & definitions['productVariantOptionValue_Base'] + /** + * The model for a POST to create option values on a product. + */ + productOptionValue_Post_Product: { + /** + * The name of the option. + */ + option_display_name?: string + /** + * The label of the option value. + */ + label?: string + } + /** + * Common Product Variant Option properties. + */ + productVariantOptionValue_Base: { id?: number; option_id?: number } + /** + * The model for a POST to create option values on a variant. + */ + productVariantOptionValue_Post: { id?: number; option_id?: number } + resp_productOptionValue: { + data?: definitions['productOptionOptionValue_Full'] + /** + * Empty meta object; may be used later. + */ + meta?: { ''?: string } + } + /** + * Common Product Option `option_value` properties. + */ + productOptionOptionValue_Base: { + /** + * The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers. + */ + is_default?: boolean + /** + * The text display identifying the value on the storefront. Required in a /POST. + */ + label: string + /** + * The order in which the value will be displayed on the product page. Required in a /POST. + */ + sort_order: number + /** + * Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state. If no data is available, returns `null`. + */ + value_data?: { [key: string]: any } + } + /** + * Product Option `option_value`. + */ + productOptionOptionValue_Full: definitions['productOptionOptionValue_Base'] & { + /** + * The unique numeric ID of the value; increments sequentially. + */ + id?: number + } + /** + * The model for a POST to create option values on a product. + */ + productOptionValue_Post: { + /** + * The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers. + */ + is_default?: boolean + /** + * The text display identifying the value on the storefront. Required in a /POST. + */ + label: string + /** + * The order in which the value will be displayed on the product page. Required in a /POST. + */ + sort_order: number + /** + * Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state. + */ + value_data?: { [key: string]: any } + } + /** + * The model for a PUT to update option values on a product. + */ + productOptionValue_Put: { + /** + * The flag for preselecting a value as the default on the storefront. This field is not supported for swatch options/modifiers. + */ + is_default?: boolean + /** + * The text display identifying the value on the storefront. Required in a /POST. + */ + label: string + /** + * The order in which the value will be displayed on the product page. Required in a /POST. + */ + sort_order: number + /** + * Extra data describing the value, based on the type of option or modifier with which the value is associated. The `swatch` type option can accept an array of `colors`, with up to three hexidecimal color keys; or an `image_url`, which is a full image URL path including protocol. The `product list` type option requires a `product_id`. The `checkbox` type option requires a boolean flag, called `checked_value`, to determine which value is considered to be the checked state. + */ + value_data?: { [key: string]: any } + } & { + /** + * The unique numeric ID of the value; increments sequentially. + */ + id?: number + } + /** + * Common ProductImage properties. + */ + productImage_Base: { + /** + * The local path to the original image file uploaded to BigCommerce. + */ + image_file?: string + /** + * Flag for identifying whether the image is used as the product's thumbnail. + */ + is_thumbnail?: boolean + /** + * The order in which the image will be displayed on the product page. Higher integers give the image a lower priority. When updating, if the image is given a lower priority, all images with a `sort_order` the same as or greater than the image's new `sort_order` value will have their `sort_order`s reordered. + */ + sort_order?: number + /** + * The description for the image. + */ + description?: string + /** + * Must be a fully qualified URL path, including protocol. Limit of 8MB per file. + */ + image_url?: string + } + /** + * The model for a POST to create an image on a product. + */ + productImage_Post: { + /** + * The unique numeric ID of the image; increments sequentially. + */ + id?: number + /** + * The unique numeric identifier for the product with which the image is associated. + */ + product_id?: number + /** + * The local path to the original image file uploaded to BigCommerce. + */ + image_file?: string + /** + * The zoom URL for this image. By default, this is used as the zoom image on product pages when zoom images are enabled. + */ + url_zoom?: string + /** + * The standard URL for this image. By default, this is used for product-page images. + */ + url_standard?: string + /** + * The thumbnail URL for this image. By default, this is the image size used on the category page and in side panels. + */ + url_thumbnail?: string + /** + * The tiny URL for this image. By default, this is the image size used for thumbnails beneath the product image on a product page. + */ + url_tiny?: string + /** + * The date on which the product image was modified. + */ + date_modified?: string + /** + * Flag for identifying whether the image is used as the product's thumbnail. + */ + is_thumbnail?: boolean + /** + * The order in which the image will be displayed on the product page. Higher integers give the image a lower priority. When updating, if the image is given a lower priority, all images with a `sort_order` the same as or greater than the image's new `sort_order` value will have their `sort_order`s reordered. + */ + sort_order?: number + /** + * The description for the image. + */ + description?: string + } & { + /** + * Must be a fully qualified URL path, including protocol. Limit of 8MB per file. + */ + image_url?: string + /** + * Must be sent as a multipart/form-data field in the request body. + */ + image_file?: string + } + /** + * The model for a PUT to update applicable Product Image fields. + */ + productImage_Put: { + /** + * The unique numeric ID of the image; increments sequentially. + */ + id?: number + /** + * The unique numeric identifier for the product with which the image is associated. + */ + product_id?: number + /** + * The local path to the original image file uploaded to BigCommerce. + */ + image_file?: string + /** + * The zoom URL for this image. By default, this is used as the zoom image on product pages when zoom images are enabled. + */ + url_zoom?: string + /** + * The standard URL for this image. By default, this is used for product-page images. + */ + url_standard?: string + /** + * The thumbnail URL for this image. By default, this is the image size used on the category page and in side panels. + */ + url_thumbnail?: string + /** + * The tiny URL for this image. By default, this is the image size used for thumbnails beneath the product image on a product page. + */ + url_tiny?: string + /** + * The date on which the product image was modified. + */ + date_modified?: string + /** + * Flag for identifying whether the image is used as the product's thumbnail. + */ + is_thumbnail?: boolean + /** + * The order in which the image will be displayed on the product page. Higher integers give the image a lower priority. When updating, if the image is given a lower priority, all images with a `sort_order` the same as or greater than the image's new `sort_order` value will have their `sort_order`s reordered. + */ + sort_order?: number + /** + * The description for the image. + */ + description?: string + } + /** + * The model for a POST to create a video on a product. + */ + productVideo_Base: { + /** + * The title for the video. If left blank, this will be filled in according to data on a host site. + */ + title?: string + /** + * The description for the video. If left blank, this will be filled in according to data on a host site. + */ + description?: string + /** + * The order in which the video will be displayed on the product page. Higher integers give the video a lower priority. When updating, if the video is given a lower priority, all videos with a `sort_order` the same as or greater than the video's new `sort_order` value will have their `sort_order`s reordered. + */ + sort_order?: number + /** + * The video type (a short name of a host site). + */ + type?: 'youtube' + /** + * The ID of the video on a host site. + */ + video_id?: string + } + /** + * A product video model. + */ + productVideo_Full: definitions['productVideo_Base'] & { + /** + * The unique numeric ID of the product video; increments sequentially. + */ + id?: number + /** + * The unique numeric identifier for the product with which the image is associated. + */ + product_id?: number + /** + * Length of the video. This will be filled in according to data on a host site. + */ + length?: string + } + /** + * The model for a POST to create a video on a product. + */ + productVideo_Post: definitions['productVideo_Base'] + /** + * The model for a PUT to update a video on a product. + */ + productVideo_Put: definitions['productVideo_Base'] & { + /** + * The unique numeric ID of the product video; increments sequentially. + */ + id?: number + } + productReview_Base: { + /** + * The title for the product review. + * Required in /POST. + */ + title: string + /** + * The text for the product review. + */ + text?: string + /** + * The status of the product review. Must be one of `approved`, `disapproved` or `pending`. + */ + status?: string + /** + * The rating of the product review. Must be one of 0, 1, 2, 3, 4, 5. + */ + rating?: number + /** + * The email of the reviewer. Must be a valid email, or an empty string. + */ + email?: string + /** + * The name of the reviewer. + */ + name?: string + /** + * Date the product was reviewed. Required in /POST. + */ + date_reviewed: string + } + /** + * A product review model. + */ + productReview_Full: definitions['productReview_Base'] & { + /** + * The unique numeric ID of the product review; increments sequentially. + */ + id?: number + /** + * The unique numeric identifier for the product with which the review is associated. + */ + product_id?: number + /** + * Date the product review was created. + */ + date_created?: string + /** + * Date the product review was modified. + */ + date_modified?: string + } + /** + * The model for a POST to create a product review. + */ + productReview_Post: { + /** + * The title for the product review. + * Required in /POST. + */ + title: string + /** + * The text for the product review. + */ + text?: string + /** + * The status of the product review. Must be one of `approved`, `disapproved` or `pending`. + */ + status?: string + /** + * The rating of the product review. Must be one of 0, 1, 2, 3, 4, 5. + */ + rating?: number + /** + * The email of the reviewer. Must be a valid email, or an empty string. + */ + email?: string + /** + * The name of the reviewer. + */ + name?: string + /** + * Date the product was reviewed. Required in /POST. + */ + date_reviewed: string + } + /** + * The model for a PUT to update a product review. + */ + productReview_Put: { + /** + * The title for the product review. + * Required in /POST. + */ + title: string + /** + * The text for the product review. + */ + text?: string + /** + * The status of the product review. Must be one of `approved`, `disapproved` or `pending`. + */ + status?: string + /** + * The rating of the product review. Must be one of 0, 1, 2, 3, 4, 5. + */ + rating?: number + /** + * The email of the reviewer. Must be a valid email, or an empty string. + */ + email?: string + /** + * The name of the reviewer. + */ + name?: string + /** + * Date the product was reviewed. Required in /POST. + */ + date_reviewed: string + } + /** + * Image Response returns for: + * * Create Variant Image + * * Create Modifier Image + * * Create Category Image + * * Create Brand Image + */ + resp_productImage: { + data?: definitions['productImage_Full'] + /** + * Empty meta object; may be used later. + */ + meta?: { [key: string]: any } + } + /** + * An object containing a publicly accessible image URL, or a form post that contains an image file. + */ + resourceImage_Full: { + /** + * A public URL for a GIF, JPEG, or PNG image. Limit of 8MB per file. + */ + image_url?: string + } + product_Post: definitions['product_Base'] & { + variants?: definitions['productVariant_Post_Product'] + } + /** + * The model for a PUT to update a product. + */ + product_Put: { + /** + * The unique numerical ID of the product; increments sequentially. + */ + id?: number + } & definitions['product_Base'] & { + variants?: definitions['productVariant_Put_Product'] + } + /** + * Catalog Summary object describes a lightweight summary of the catalog. + */ + catalogSummary_Full: { + /** + * A count of all inventory items in the catalog. + */ + inventory_count?: number + /** + * Total value of store's inventory. + */ + inventory_value?: number + /** + * ID of the category containing the most products. + */ + primary_category_id?: number + /** + * Name of the category containing the most products. + */ + primary_category_name?: string + /** + * Total number of variants + */ + variant_count?: number + /** + * Highest priced variant + */ + highest_variant_price?: number + /** + * Average price of all variants + */ + average_variant_price?: number + /** + * Lowest priced variant in the store + */ + lowest_variant_price?: string + oldest_variant_date?: string + newest_variant_date?: string + } + /** + * Metafield for products, categories, variants, and brands. The max number of metafields allowed on each product, category, variant, or brand is fifty. For more information, see [Platform Limits](https://support.bigcommerce.com/s/article/Platform-Limits) in the Help Center. + */ + metafield_Base: { + /** + * Unique ID of the *Metafield*. Read-Only. + */ + id?: number + /** + * Determines the visibility and writeability of the field by other API consumers. + * + * |Value|Description + * |-|-| + * |`app_only`|Private to the app that owns the field| + * |`read`|Visible to other API consumers| + * |`write`|Open for reading and writing by other API consumers| + * |`read_and_sf_access`|Visible to other API consumers, including on storefront| + * |`write_and_sf_access`|Open for reading and writing by other API consumers, including on storefront| + */ + permission_set: + | 'app_only' + | 'read' + | 'write' + | 'read_and_sf_access' + | 'write_and_sf_access' + /** + * Namespace for the metafield, for organizational purposes. This is set set by the developer. Required for POST. + */ + namespace: string + /** + * The name of the field, for example: `location_id`, `color`. Required for POST. + */ + key: string + /** + * The value of the field, for example: `1`, `blue`. Required for POST. + */ + value: string + /** + * Description for the metafields. + */ + description?: string + /** + * The type of resource with which the metafield is associated. + */ + resource_type?: 'category' | 'brand' | 'product' | 'variant' + /** + * The ID for the resource with which the metafield is associated. + */ + resource_id?: number + /** + * Date and time of the metafield's creation. Read-Only. + */ + date_created?: string + /** + * Date and time when the metafield was last updated. Read-Only. + */ + date_modified?: string + } + /** + * Common ComplexRule properties. + */ + complexRule_Base: { + /** + * The unique numeric ID of the rule; increments sequentially. + * Read-Only + */ + id?: number + /** + * The unique numeric ID of the product with which the rule is associated; increments sequentially. + */ + product_id?: number + /** + * The priority to give this rule when making adjustments to the product properties. + */ + sort_order?: number + /** + * Flag for determining whether the rule is to be used when adjusting a product's price, weight, image, or availabilty. + */ + enabled?: boolean + /** + * Flag for determining whether other rules should not be applied after this rule has been applied. + */ + stop?: boolean + /** + * Flag for determining whether the rule should disable purchasing of a product when the conditions are applied. + */ + purchasing_disabled?: boolean + /** + * Message displayed on the storefront when a rule disables the purchasing of a product. + */ + purchasing_disabled_message?: string + /** + * Flag for determining whether the rule should hide purchasing of a product when the conditions are applied. + */ + purchasing_hidden?: boolean + /** + * The URL for an image displayed on the storefront when the conditions are applied. Limit of 8MB per file. + */ + image_url?: string + price_adjuster?: definitions['adjuster_Full'] + weight_adjuster?: definitions['adjuster_Full'] + conditions?: definitions['complexRuleConditionBase'][] + } + /** + * Gets custom fields associated with a product. These allow you to specify additional information that will appear on the product's page, such as a book's ISBN or a DVD's release date. + */ + productCustomField_Base: { + /** + * The unique numeric ID of the custom field; increments sequentially. + * Read-Only + */ + id?: number + /** + * The name of the field, shown on the storefront, orders, etc. Required for /POST + */ + name: string + /** + * The name of the field, shown on the storefront, orders, etc. Required for /POST + */ + value: string + } + /** + * The model for a POST to create a custom field on a product. + */ + productCustomField_Post: { + /** + * The unique numeric ID of the custom field; increments sequentially. + * Read-Only + */ + id?: number + /** + * The name of the field, shown on the storefront, orders, etc. Required for /POST + */ + name: string + /** + * The name of the field, shown on the storefront, orders, etc. Required for /POST + */ + value: string + } + /** + * The model for a PUT to update a custom field on a product. + */ + productCustomField_Put: { + /** + * The unique numeric ID of the custom field; increments sequentially. + * Read-Only + */ + id?: number + /** + * The name of the field, shown on the storefront, orders, etc. Required for /POST + */ + name: string + /** + * The name of the field, shown on the storefront, orders, etc. Required for /POST + */ + value: string + } + /** + * Complex rules may return with conditions that apply to one or more variants, or with a single modifier value (if the rules were created using the v2 API or the control panel). Complex rules created or updated in the v3 API must have conditions that either reference multiple `modifier_value_id`'s, or else reference a `modifier_value_id` and a `variant_id`. + */ + complexRuleConditionBase: { + /** + * The unique numeric ID of the rule condition; increments sequentially. Read-Only + */ + id?: number + /** + * The unique numeric ID of the rule with which the condition is associated. + * Read-Only + */ + rule_id?: number + /** + * The unique numeric ID of the modifier with which the rule condition is associated. + * Required in /POST. + */ + modifier_id: number + /** + * The unique numeric ID of the modifier value with which the rule condition is associated. + * Required in /POST. + */ + modifier_value_id: number + /** + * The unique numeric ID of the variant with which the rule condition is associated. + * Required in /POST. + */ + variant_id: number + /** + * (READ-ONLY:) The unique numeric ID of the SKU (v2 API), or Combination, with which the rule condition is associated. This is to maintain cross-compatibility between v2 and v3. + */ + combination_id?: number + } + /** + * The custom URL for the category on the storefront. + */ + customUrl_Full: { + /** + * Category URL on the storefront. + */ + url?: string + /** + * Returns `true` if the URL has been changed from its default state (the auto-assigned URL that BigCommerce provides). + */ + is_customized?: boolean + } + /** + * Common Bulk Pricing Rule properties + */ + bulkPricingRule_Full: { + /** + * Unique ID of the *Bulk Pricing Rule*. Read-Only. + */ + id?: number + /** + * The minimum inclusive quantity of a product to satisfy this rule. Must be greater than or equal to zero. + * Required in /POST. + */ + quantity_min: number + /** + * The maximum inclusive quantity of a product to satisfy this rule. Must be greater than the `quantity_min` value – unless this field has a value of 0 (zero), in which case there will be no maximum bound for this rule. + * Required in /POST. + */ + quantity_max: number + /** + * The type of adjustment that is made. Values: `price` - the adjustment amount per product; `percent` - the adjustment as a percentage of the original price; `fixed` - the adjusted absolute price of the product. + * Required in /POST. + */ + type: 'price' | 'percent' | 'fixed' + /** + * The discount can be a fixed dollar amount or a percentage. For a fixed dollar amount enter it as an integer and the response will return as an integer. For percentage enter the amount as the percentage divided by 100 using string format. For example 10% percent would be “.10”. The response will return as an integer. + * Required in /POST. + */ + amount: number + } + /** + * The values for option config can vary based on the Modifier created. + */ + productOptionConfig_Full: { + /** + * (date, text, multi_line_text, numbers_only_text) The default value. Shown on a date option as an ISO-8601–formatted string, or on a text option as a string. + */ + default_value?: string + /** + * (checkbox) Flag for setting the checkbox to be checked by default. + */ + checked_by_default?: boolean + /** + * (checkbox) Label displayed for the checkbox option. + */ + checkbox_label?: string + /** + * (date) Flag to limit the dates allowed to be entered on a date option. + */ + date_limited?: boolean + /** + * (date) The type of limit that is allowed to be entered on a date option. + */ + date_limit_mode?: 'earliest' | 'range' | 'latest' + /** + * (date) The earliest date allowed to be entered on the date option, as an ISO-8601 formatted string. + */ + date_earliest_value?: string + /** + * (date) The latest date allowed to be entered on the date option, as an ISO-8601 formatted string. + */ + date_latest_value?: string + /** + * (file) The kind of restriction on the file types that can be uploaded with a file upload option. Values: `specific` - restricts uploads to particular file types; `all` - allows all file types. + */ + file_types_mode?: 'specific' | 'all' + /** + * (file) The type of files allowed to be uploaded if the `file_type_option` is set to `specific`. Values: + * `images` - Allows upload of image MIME types (`bmp`, `gif`, `jpg`, `jpeg`, `jpe`, `jif`, `jfif`, `jfi`, `png`, `wbmp`, `xbm`, `tiff`). `documents` - Allows upload of document MIME types (`txt`, `pdf`, `rtf`, `doc`, `docx`, `xls`, `xlsx`, `accdb`, `mdb`, `one`, `pps`, `ppsx`, `ppt`, `pptx`, `pub`, `odt`, `ods`, `odp`, `odg`, `odf`). + * `other` - Allows file types defined in the `file_types_other` array. + */ + file_types_supported?: string[] + /** + * (file) A list of other file types allowed with the file upload option. + */ + file_types_other?: string[] + /** + * (file) The maximum size for a file that can be used with the file upload option. This will still be limited by the server. + */ + file_max_size?: number + /** + * (text, multi_line_text) Flag to validate the length of a text or multi-line text input. + */ + text_characters_limited?: boolean + /** + * (text, multi_line_text) The minimum length allowed for a text or multi-line text option. + */ + text_min_length?: number + /** + * (text, multi_line_text) The maximum length allowed for a text or multi line text option. + */ + text_max_length?: number + /** + * (multi_line_text) Flag to validate the maximum number of lines allowed on a multi-line text input. + */ + text_lines_limited?: boolean + /** + * (multi_line_text) The maximum number of lines allowed on a multi-line text input. + */ + text_max_lines?: number + /** + * (numbers_only_text) Flag to limit the value of a number option. + */ + number_limited?: boolean + /** + * (numbers_only_text) The type of limit on values entered for a number option. + */ + number_limit_mode?: 'lowest' | 'highest' | 'range' + /** + * (numbers_only_text) The lowest allowed value for a number option if `number_limited` is true. + */ + number_lowest_value?: number + /** + * (numbers_only_text) The highest allowed value for a number option if `number_limited` is true. + */ + number_highest_value?: number + /** + * (numbers_only_text) Flag to limit the input on a number option to whole numbers only. + */ + number_integers_only?: boolean + /** + * (product_list, product_list_with_images) Flag for automatically adjusting inventory on a product included in the list. + */ + product_list_adjusts_inventory?: boolean + /** + * (product_list, product_list_with_images) Flag to add the optional product's price to the main product's price. + */ + product_list_adjusts_pricing?: boolean + /** + * (product_list, product_list_with_images) How to factor the optional product's weight and package dimensions into the shipping quote. Values: `none` - don't adjust; `weight` - use shipping weight only; `package` - use weight and dimensions. + */ + product_list_shipping_calc?: 'none' | 'weight' | 'package' + } + /** + * Adjuster for Complex Rules. + */ + adjuster_Full: { + /** + * The type of adjuster for either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster?: 'relative' | 'percentage' + /** + * The numeric amount by which the adjuster will change either the price or the weight of the variant, when the modifier value is selected on the storefront. + */ + adjuster_value?: number + } + /** + * Errors during batch usage for the BigCommerce API. + */ + resp_variantBatchError: { + batch_errors?: (definitions['error_Base'] & { + errors?: { additionalProperties?: string } + })[] + } + /** + * Data about the response, including pagination and collection totals. + */ + metaCollection_Full: { pagination?: definitions['pagination_Full'] } + /** + * Data about the response, including pagination and collection totals. + */ + pagination_Full: { + /** + * Total number of items in the result set. + */ + total?: number + /** + * Total number of items in the collection response. + */ + count?: number + /** + * The amount of items returned in the collection per page, controlled by the limit parameter. + */ + per_page?: number + /** + * The page you are currently on within the collection. + */ + current_page?: number + /** + * The total number of pages in the collection. + */ + total_pages?: number + /** + * Pagination links for the previous and next parts of the whole collection. + */ + links?: { + /** + * Link to the previous page returned in the response. + */ + previous?: string + /** + * Link to the current page returned in the response. + */ + current?: string + /** + * Link to the next page returned in the response. + */ + next?: string + } + } + /** + * Empty meta object; may be used later. + */ + metaEmpty_Full: { [key: string]: any } + errorResponse_Full: definitions['error_Base'] & { + errors?: definitions['detailedErrors'] + } + /** + * Error payload for the BigCommerce API. + */ + error_Base: { + /** + * The HTTP status code. + */ + status?: number + /** + * The error title describing the particular error. + */ + title?: string + type?: string + instance?: string + } + /** + * Error payload for the BigCommerce API. + */ + errorNotFound: { + /** + * 404 HTTP status code. + */ + status?: number + /** + * The error title describing the particular error. + */ + title?: string + type?: string + instance?: string + } + /** + * A gift-certificate model. + */ + giftCertificate_Full: { + /** + * The gift-certificate code. + */ + code?: string + /** + * The balance on a gift certificate when it was purchased. + */ + original_balance?: number + /** + * The balance on a gift certificate at the time of this purchase. + */ + starting_balance?: number + /** + * The remaining balance on a gift certificate. + */ + remaining_balance?: number + /** + * The status of a gift certificate: `active` - gift certificate is active; `pending` - gift certificate purchase is pending; `disabled` - gift certificate is disabled; `expired` - gift certificate is expired. + */ + status?: 'active' | 'pending' | 'disabled' | 'expired' + } + /** + * No-content response for the BigCommerce API. + */ + errorNoContent: { + /** + * 204 HTTP status code. + */ + status?: number + /** + * The error title describing the situation. + */ + title?: string + type?: string + instance?: string + } + detailedErrors: { additionalProperties?: string } + product_Full: definitions['product_Base'] & { + /** + * The date on which the product was created. + */ + date_created?: string + /** + * The date on which the product was modified. + */ + date_modified?: string + /** + * ID of the product. Read Only. + */ + id?: number + /** + * The unique identifier of the base variant associated with a simple product. This value is `null` for complex products. + */ + base_variant_id?: number + /** + * The price of the product as seen on the storefront. It will be equal to the `sale_price`, if set, and the `price` if there is not a `sale_price`. + */ + calculated_price?: number + options?: definitions['productOption_Base'][] + modifiers?: definitions['productModifier_Full'][] + /** + * Minimum Advertised Price. + */ + map_price?: number + /** + * Indicates that the product is in an Option Set (legacy V2 concept). + */ + option_set_id?: number + /** + * Legacy template setting which controls if the option set shows up to the side of or below the product image and description. + */ + option_set_display?: string + } & { variants?: definitions['productVariant_Full'] } + /** + * Common ProductImage properties. + */ + productImage_Full: definitions['productImage_Base'] & { + /** + * The unique numeric ID of the image; increments sequentially. + */ + id?: number + /** + * The unique numeric identifier for the product with which the image is associated. + */ + product_id?: number + /** + * The zoom URL for this image. By default, this is used as the zoom image on product pages when zoom images are enabled. + */ + url_zoom?: string + /** + * The standard URL for this image. By default, this is used for product-page images. + */ + url_standard?: string + /** + * The thumbnail URL for this image. By default, this is the image size used on the category page and in side panels. + */ + url_thumbnail?: string + /** + * The tiny URL for this image. By default, this is the image size used for thumbnails beneath the product image on a product page. + */ + url_tiny?: string + /** + * The date on which the product image was modified. + */ + date_modified?: string + } + metafield_Post: definitions['metafield_Base'] + /** + * The model for batch updating products. + */ + product_Put_Collection: ({ + /** + * The unique numerical ID of the product; increments sequentially. Required on batch product `PUT` requests. + */ + id: number + } & definitions['product_Base'])[] + /** + * The values for option config can vary based on the Modifier created. + */ + config_Full: { + /** + * (date, text, multi_line_text, numbers_only_text) The default value. Shown on a date option as an ISO-8601–formatted string, or on a text option as a string. + */ + default_value?: string + /** + * (checkbox) Flag for setting the checkbox to be checked by default. + */ + checked_by_default?: boolean + /** + * (checkbox) Label displayed for the checkbox option. + */ + checkbox_label?: string + /** + * (date) Flag to limit the dates allowed to be entered on a date option. + */ + date_limited?: boolean + /** + * (date) The type of limit that is allowed to be entered on a date option. + */ + date_limit_mode?: 'earliest' | 'range' | 'latest' + /** + * (date) The earliest date allowed to be entered on the date option, as an ISO-8601 formatted string. + */ + date_earliest_value?: string + /** + * (date) The latest date allowed to be entered on the date option, as an ISO-8601 formatted string. + */ + date_latest_value?: string + /** + * (file) The kind of restriction on the file types that can be uploaded with a file upload option. Values: `specific` - restricts uploads to particular file types; `all` - allows all file types. + */ + file_types_mode?: 'specific' | 'all' + /** + * (file) The type of files allowed to be uploaded if the `file_type_option` is set to `specific`. Values: + * `images` - Allows upload of image MIME types (`bmp`, `gif`, `jpg`, `jpeg`, `jpe`, `jif`, `jfif`, `jfi`, `png`, `wbmp`, `xbm`, `tiff`). `documents` - Allows upload of document MIME types (`txt`, `pdf`, `rtf`, `doc`, `docx`, `xls`, `xlsx`, `accdb`, `mdb`, `one`, `pps`, `ppsx`, `ppt`, `pptx`, `pub`, `odt`, `ods`, `odp`, `odg`, `odf`). + * `other` - Allows file types defined in the `file_types_other` array. + */ + file_types_supported?: string[] + /** + * (file) A list of other file types allowed with the file upload option. + */ + file_types_other?: string[] + /** + * (file) The maximum size for a file that can be used with the file upload option. This will still be limited by the server. + */ + file_max_size?: number + /** + * (text, multi_line_text) Flag to validate the length of a text or multi-line text input. + */ + text_characters_limited?: boolean + /** + * (text, multi_line_text) The minimum length allowed for a text or multi-line text option. + */ + text_min_length?: number + /** + * (text, multi_line_text) The maximum length allowed for a text or multi line text option. + */ + text_max_length?: number + /** + * (multi_line_text) Flag to validate the maximum number of lines allowed on a multi-line text input. + */ + text_lines_limited?: boolean + /** + * (multi_line_text) The maximum number of lines allowed on a multi-line text input. + */ + text_max_lines?: number + /** + * (numbers_only_text) Flag to limit the value of a number option. + */ + number_limited?: boolean + /** + * (numbers_only_text) The type of limit on values entered for a number option. + */ + number_limit_mode?: 'lowest' | 'highest' | 'range' + /** + * (numbers_only_text) The lowest allowed value for a number option if `number_limited` is true. + */ + number_lowest_value?: number + /** + * (numbers_only_text) The highest allowed value for a number option if `number_limited` is true. + */ + number_highest_value?: number + /** + * (numbers_only_text) Flag to limit the input on a number option to whole numbers only. + */ + number_integers_only?: boolean + /** + * (product_list, product_list_with_images) Flag for automatically adjusting inventory on a product included in the list. + */ + product_list_adjusts_inventory?: boolean + /** + * (product_list, product_list_with_images) Flag to add the optional product's price to the main product's price. + */ + product_list_adjusts_pricing?: boolean + /** + * (product_list, product_list_with_images) How to factor the optional product's weight and package dimensions into the shipping quote. Values: `none` - don't adjust; `weight` - use shipping weight only; `package` - use weight and dimensions. + */ + product_list_shipping_calc?: 'none' | 'weight' | 'package' + } + adjusters_Full: { + price?: definitions['adjuster_Full'] + weight?: definitions['adjuster_Full'] + /** + * The URL for an image displayed on the storefront when the modifier value is selected.Limit of 8MB per file. + */ + image_url?: string + purchasing_disabled?: { + /** + * Flag for whether the modifier value disables purchasing when selected on the storefront. This can be used for temporarily disabling a particular modifier value. + */ + status?: boolean + /** + * The message displayed on the storefront when the purchasing disabled status is `true`. + */ + message?: string + } + } + /** + * Variant properties used on: + * * `/catalog/products/variants` + * * `/catalog/variants` + */ + variant_Base: { + /** + * The cost price of the variant. Not affected by Price List prices. + */ + cost_price?: number + /** + * This variant's base price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is `null`, the product's default price (set in the Product resource's `price` field) will be used as the base price. + */ + price?: number + /** + * This variant's sale price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product's sale price (set in the Product resource's `price` field) will be used as the sale price. + */ + sale_price?: number + /** + * This variant's retail price on the storefront. If a Price List ID is used, the Price List value will be used. If a Price List ID is not used, and this value is null, the product's retail price (set in the Product resource's `price` field) will be used as the retail price. + */ + retail_price?: number + /** + * This variant's base weight on the storefront. If this value is null, the product's default weight (set in the Product resource's weight field) will be used as the base weight. + */ + weight?: number + /** + * Width of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default width (set in the Product resource's `width` field) will be used as the base width. + */ + width?: number + /** + * Height of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default height (set in the Product resource's `height` field) will be used as the base height. + */ + height?: number + /** + * Depth of the variant, which can be used when calculating shipping costs. If this value is `null`, the product's default depth (set in the Product resource's `depth` field) will be used as the base depth. + */ + depth?: number + /** + * Flag used to indicate whether the variant has free shipping. If `true`, the shipping cost for the variant will be zero. + */ + is_free_shipping?: boolean + /** + * A fixed shipping cost for the variant. If defined, this value will be used during checkout instead of normal shipping-cost calculation. + */ + fixed_cost_shipping_price?: number + /** + * If `true`, this variant will not be purchasable on the storefront. + */ + purchasing_disabled?: boolean + /** + * If `purchasing_disabled` is `true`, this message should show on the storefront when the variant is selected. + */ + purchasing_disabled_message?: string + /** + * The UPC code used in feeds for shopping comparison sites and external channel integrations. + */ + upc?: string + /** + * Inventory level for the variant, which is used when the product's inventory_tracking is set to `variant`. + */ + inventory_level?: number + /** + * When the variant hits this inventory level, it is considered low stock. + */ + inventory_warning_level?: number + /** + * Identifies where in a warehouse the variant is located. + */ + bin_picking_number?: string + } + /** + * Shared `Product` properties used in: + * * `POST` + * * `PUT` + * * `GET` + */ + product_Base: { + /** + * The product name. + */ + name?: string + /** + * The product type. One of: `physical` - a physical stock unit, `digital` - a digital download. + */ + type?: 'physical' | 'digital' + /** + * User defined product code/stock keeping unit (SKU). + */ + sku?: string + /** + * The product description, which can include HTML formatting. + */ + description?: string + /** + * Weight of the product, which can be used when calculating shipping costs. This is based on the unit set on the store + */ + weight?: number + /** + * Width of the product, which can be used when calculating shipping costs. + */ + width?: number + /** + * Depth of the product, which can be used when calculating shipping costs. + */ + depth?: number + /** + * Height of the product, which can be used when calculating shipping costs. + */ + height?: number + /** + * The price of the product. The price should include or exclude tax, based on the store settings. + */ + price?: number + /** + * The cost price of the product. Stored for reference only; it is not used or displayed anywhere on the store. + */ + cost_price?: number + /** + * The retail cost of the product. If entered, the retail cost price will be shown on the product page. + */ + retail_price?: number + /** + * If entered, the sale price will be used instead of value in the price field when calculating the product's cost. + */ + sale_price?: number + /** + * The ID of the tax class applied to the product. (NOTE: Value ignored if automatic tax is enabled.) + */ + tax_class_id?: number + /** + * Accepts AvaTax System Tax Codes, which identify products and services that fall into special sales-tax categories. By using these codes, merchants who subscribe to BigCommerce's Avalara Premium integration can calculate sales taxes more accurately. Stores without Avalara Premium will ignore the code when calculating sales tax. Do not pass more than one code. The codes are case-sensitive. For details, please see Avalara's documentation. + */ + product_tax_code?: string + /** + * An array of IDs for the categories to which this product belongs. When updating a product, if an array of categories is supplied, all product categories will be overwritten. Does not accept more than 1,000 ID values. + */ + categories?: number[] + /** + * A product can be added to an existing brand during a product /PUT or /POST. + */ + brand_id?: number + /** + * Current inventory level of the product. Simple inventory tracking must be enabled (See the `inventory_tracking` field) for this to take any effect. + */ + inventory_level?: number + /** + * Inventory warning level for the product. When the product's inventory level drops below the warning level, the store owner will be informed. Simple inventory tracking must be enabled (see the `inventory_tracking` field) for this to take any effect. + */ + inventory_warning_level?: number + /** + * The type of inventory tracking for the product. Values are: `none` - inventory levels will not be tracked; `product` - inventory levels will be tracked using the `inventory_level` and `inventory_warning_level` fields; `variant` - inventory levels will be tracked based on variants, which maintain their own warning levels and inventory levels. + */ + inventory_tracking?: 'none' | 'product' | 'variant' + /** + * A fixed shipping cost for the product. If defined, this value will be used during checkout instead of normal shipping-cost calculation. + */ + fixed_cost_shipping_price?: number + /** + * Flag used to indicate whether the product has free shipping. If `true`, the shipping cost for the product will be zero. + */ + is_free_shipping?: boolean + /** + * Flag to determine whether the product should be displayed to customers browsing the store. If `true`, the product will be displayed. If `false`, the product will be hidden from view. + */ + is_visible?: boolean + /** + * Flag to determine whether the product should be included in the `featured products` panel when viewing the store. + */ + is_featured?: boolean + /** + * An array of IDs for the related products. + */ + related_products?: number[] + /** + * Warranty information displayed on the product page. Can include HTML formatting. + */ + warranty?: string + /** + * The BIN picking number for the product. + */ + bin_picking_number?: string + /** + * The layout template file used to render this product category. This field is writable only for stores with a Blueprint theme applied. + */ + layout_file?: string + /** + * The product UPC code, which is used in feeds for shopping comparison sites and external channel integrations. + */ + upc?: string + /** + * A comma-separated list of keywords that can be used to locate the product when searching the store. + */ + search_keywords?: string + /** + * Availability of the product. Availability options are: `available` - the product can be purchased on the storefront; `disabled` - the product is listed in the storefront, but cannot be purchased; `preorder` - the product is listed for pre-orders. + */ + availability?: 'available' | 'disabled' | 'preorder' + /** + * Availability text displayed on the checkout page, under the product title. Tells the customer how long it will normally take to ship this product, such as: 'Usually ships in 24 hours.' + */ + availability_description?: string + /** + * Type of gift-wrapping options. Values: `any` - allow any gift-wrapping options in the store; `none` - disallow gift-wrapping on the product; `list` – provide a list of IDs in the `gift_wrapping_options_list` field. + */ + gift_wrapping_options_type?: 'any' | 'none' | 'list' + /** + * A list of gift-wrapping option IDs. + */ + gift_wrapping_options_list?: number[] + /** + * Priority to give this product when included in product lists on category pages and in search results. Lower integers will place the product closer to the top of the results. + */ + sort_order?: number + /** + * The product condition. Will be shown on the product page if the `is_condition_shown` field's value is `true`. Possible values: `New`, `Used`, `Refurbished`. + */ + condition?: 'New' | 'Used' | 'Refurbished' + /** + * Flag used to determine whether the product condition is shown to the customer on the product page. + */ + is_condition_shown?: boolean + /** + * The minimum quantity an order must contain, to be eligible to purchase this product. + */ + order_quantity_minimum?: number + /** + * The maximum quantity an order can contain when purchasing the product. + */ + order_quantity_maximum?: number + /** + * Custom title for the product page. If not defined, the product name will be used as the meta title. + */ + page_title?: string + /** + * Custom meta keywords for the product page. If not defined, the store's default keywords will be used. + */ + meta_keywords?: string[] + /** + * Custom meta description for the product page. If not defined, the store's default meta description will be used. + */ + meta_description?: string + /** + * The number of times the product has been viewed. + */ + view_count?: number + /** + * Pre-order release date. See the `availability` field for details on setting a product's availability to accept pre-orders. + */ + preorder_release_date?: string + /** + * Custom expected-date message to display on the product page. If undefined, the message defaults to the storewide setting. Can contain the `%%DATE%%` placeholder, which will be substituted for the release date. + */ + preorder_message?: string + /** + * If set to true then on the preorder release date the preorder status will automatically be removed. + * If set to false, then on the release date the preorder status **will not** be removed. It will need to be changed manually either in the + * control panel or using the API. Using the API set `availability` to `available`. + */ + is_preorder_only?: boolean + /** + * False by default, indicating that this product's price should be shown on the product page. If set to `true`, the price is hidden. (NOTE: To successfully set `is_price_hidden` to `true`, the `availability` value must be `disabled`.) + */ + is_price_hidden?: boolean + /** + * By default, an empty string. If `is_price_hidden` is `true`, the value of `price_hidden_label` is displayed instead of the price. (NOTE: To successfully set a non-empty string value with `is_price_hidden` set to `true`, the `availability` value must be `disabled`.) + */ + price_hidden_label?: string + custom_url?: definitions['customUrl_Full'] + /** + * Type of product, defaults to `product`. + */ + open_graph_type?: + | 'product' + | 'album' + | 'book' + | 'drink' + | 'food' + | 'game' + | 'movie' + | 'song' + | 'tv_show' + /** + * Title of the product, if not specified the product name will be used instead. + */ + open_graph_title?: string + /** + * Description to use for the product, if not specified then the meta_description will be used instead. + */ + open_graph_description?: string + /** + * Flag to determine if product description or open graph description is used. + */ + open_graph_use_meta_description?: boolean + /** + * Flag to determine if product name or open graph name is used. + */ + open_graph_use_product_name?: boolean + /** + * Flag to determine if product image or open graph image is used. + */ + open_graph_use_image?: boolean + /** + * The brand can be created during a product PUT or POST request. If the brand already exists then the product will be added. If not the brand will be created and the product added. If using `brand_name` it performs a fuzzy match and adds the brand. eg. "Common Good" and "Common good" are the same. Brand name does not return as part of a product response. Only the `brand_id`. + */ + 'brand_name or brand_id'?: string + /** + * Global Trade Item Number + */ + gtin?: string + /** + * Manufacturer Part Number + */ + mpn?: string + /** + * The total rating for the product. + */ + reviews_rating_sum?: number + /** + * The number of times the product has been rated. + */ + reviews_count?: number + /** + * The total quantity of this product sold. + */ + total_sold?: number + custom_fields?: definitions['productCustomField_Put'][] + bulk_pricing_rules?: definitions['bulkPricingRule_Full'][] + images?: definitions['productImage_Full'][] + primary_image?: definitions['productImage_Full'] + videos?: definitions['productVideo_Full'][] + } + /** + * Properties for updating metafields. + */ + metafield_Put: { + /** + * Unique ID of the *Metafield*. Read-Only. + */ + id?: number + } & definitions['metafield_Base'] + metafield_Full: definitions['metafield_Put'] & { + /** + * Date and time of the metafield's creation. Read-Only. + */ + date_created?: string + /** + * Date and time when the metafield was last updated. Read-Only. + */ + date_modified?: string + } + /** + * The model for a PUT to update variants on a product. + */ + productVariant_Put: definitions['productVariant_Base'] & { + product_id?: number + sku?: string + } +} diff --git a/packages/bigcommerce/src/api/definitions/store-content.ts b/packages/bigcommerce/src/api/definitions/store-content.ts new file mode 100644 index 0000000..f00c288 --- /dev/null +++ b/packages/bigcommerce/src/api/definitions/store-content.ts @@ -0,0 +1,329 @@ +/** + * This file was auto-generated by swagger-to-ts. + * Do not make direct changes to the file. + */ + +export interface definitions { + blogPost_Full: { + /** + * ID of this blog post. (READ-ONLY) + */ + id?: number + } & definitions['blogPost_Base'] + addresses: { + /** + * Full URL of where the resource is located. + */ + url?: string + /** + * Resource being accessed. + */ + resource?: string + } + formField: { + /** + * Name of the form field + */ + name?: string + /** + * Value of the form field + */ + value?: string + } + page_Full: { + /** + * ID of the page. + */ + id?: number + } & definitions['page_Base'] + redirect: { + /** + * Numeric ID of the redirect. + */ + id?: number + /** + * The path from which to redirect. + */ + path: string + forward: definitions['forward'] + /** + * URL of the redirect. READ-ONLY + */ + url?: string + } + forward: { + /** + * The type of redirect. If it is a `manual` redirect then type will always be manual. Dynamic redirects will have the type of the page. Such as product or category. + */ + type?: string + /** + * Reference of the redirect. Dynamic redirects will have the category or product number. Manual redirects will have the url that is being directed to. + */ + ref?: number + } + customer_Full: { + /** + * Unique numeric ID of this customer. This is a READ-ONLY field; do not set or modify its value in a POST or PUT request. + */ + id?: number + /** + * Not returned in any responses, but accepts up to two fields allowing you to set the customer’s password. If a password is not supplied, it is generated automatically. For further information about using this object, please see the Customers resource documentation. + */ + _authentication?: { + force_reset?: string + password?: string + password_confirmation?: string + } + /** + * The name of the company for which the customer works. + */ + company?: string + /** + * First name of the customer. + */ + first_name: string + /** + * Last name of the customer. + */ + last_name: string + /** + * Email address of the customer. + */ + email: string + /** + * Phone number of the customer. + */ + phone?: string + /** + * Date on which the customer registered from the storefront or was created in the control panel. This is a READ-ONLY field; do not set or modify its value in a POST or PUT request. + */ + date_created?: string + /** + * Date on which the customer updated their details in the storefront or was updated in the control panel. This is a READ-ONLY field; do not set or modify its value in a POST or PUT request. + */ + date_modified?: string + /** + * The amount of credit the customer has. (Float, Float as String, Integer) + */ + store_credit?: string + /** + * The customer’s IP address when they signed up. + */ + registration_ip_address?: string + /** + * The group to which the customer belongs. + */ + customer_group_id?: number + /** + * Store-owner notes on the customer. + */ + notes?: string + /** + * Used to identify customers who fall into special sales-tax categories – in particular, those who are fully or partially exempt from paying sales tax. Can be blank, or can contain a single AvaTax code. (The codes are case-sensitive.) Stores that subscribe to BigCommerce’s Avalara Premium integration will use this code to determine how/whether to apply sales tax. Does not affect sales-tax calculations for stores that do not subscribe to Avalara Premium. + */ + tax_exempt_category?: string + /** + * Records whether the customer would like to receive marketing content from this store. READ-ONLY.This is a READ-ONLY field; do not set or modify its value in a POST or PUT request. + */ + accepts_marketing?: boolean + addresses?: definitions['addresses'] + /** + * Array of custom fields. This is a READ-ONLY field; do not set or modify its value in a POST or PUT request. + */ + form_fields?: definitions['formField'][] + /** + * Force a password change on next login. + */ + reset_pass_on_login?: boolean + } + categoryAccessLevel: { + /** + * + `all` - Customers can access all categories + * + `specific` - Customers can access a specific list of categories + * + `none` - Customers are prevented from viewing any of the categories in this group. + */ + type?: 'all' | 'specific' | 'none' + /** + * Is an array of category IDs and should be supplied only if `type` is specific. + */ + categories?: string[] + } + timeZone: { + /** + * a string identifying the time zone, in the format: /. + */ + name?: string + /** + * a negative or positive number, identifying the offset from UTC/GMT, in seconds, during winter/standard time. + */ + raw_offset?: number + /** + * "-/+" offset from UTC/GMT, in seconds, during summer/daylight saving time. + */ + dst_offset?: number + /** + * a boolean indicating whether this time zone observes daylight saving time. + */ + dst_correction?: boolean + date_format?: definitions['dateFormat'] + } + count_Response: { count?: number } + dateFormat: { + /** + * string that defines dates’ display format, in the pattern: M jS Y + */ + display?: string + /** + * string that defines the CSV export format for orders, customers, and products, in the pattern: M jS Y + */ + export?: string + /** + * string that defines dates’ extended-display format, in the pattern: M jS Y @ g:i A. + */ + extended_display?: string + } + blogTags: { tag?: string; post_ids?: number[] }[] + blogPost_Base: { + /** + * Title of this blog post. + */ + title: string + /** + * URL for the public blog post. + */ + url?: string + /** + * URL to preview the blog post. (READ-ONLY) + */ + preview_url?: string + /** + * Text body of the blog post. + */ + body: string + /** + * Tags to characterize the blog post. + */ + tags?: string[] + /** + * Summary of the blog post. (READ-ONLY) + */ + summary?: string + /** + * Whether the blog post is published. + */ + is_published?: boolean + published_date?: definitions['publishedDate'] + /** + * Published date in `ISO 8601` format. + */ + published_date_iso8601?: string + /** + * Description text for this blog post’s `` element. + */ + meta_description?: string + /** + * Keywords for this blog post’s `` element. + */ + meta_keywords?: string + /** + * Name of the blog post’s author. + */ + author?: string + /** + * Local path to a thumbnail uploaded to `product_images/` via [WebDav](https://support.bigcommerce.com/s/article/File-Access-WebDAV). + */ + thumbnail_path?: string + } + publishedDate: { timezone_type?: string; date?: string; timezone?: string } + /** + * Not returned in any responses, but accepts up to two fields allowing you to set the customer’s password. If a password is not supplied, it is generated automatically. For further information about using this object, please see the Customers resource documentation. + */ + authentication: { + force_reset?: string + password?: string + password_confirmation?: string + } + customer_Base: { [key: string]: any } + page_Base: { + /** + * ID of any parent Web page. + */ + parent_id?: number + /** + * `page`: free-text page + * `link`: link to another web address + * `rss_feed`: syndicated content from an RSS feed + * `contact_form`: When the store's contact form is used. + */ + type: 'page' | 'rss_feed' | 'contact_form' | 'raw' | 'link' + /** + * Where the page’s type is a contact form: object whose members are the fields enabled (in the control panel) for storefront display. Possible members are:`fullname`: full name of the customer submitting the form; `phone`: customer’s phone number, as submitted on the form; `companyname`: customer’s submitted company name; `orderno`: customer’s submitted order number; `rma`: customer’s submitted RMA (Return Merchandise Authorization) number. + */ + contact_fields?: string + /** + * Where the page’s type is a contact form: email address that receives messages sent via the form. + */ + email?: string + /** + * Page name, as displayed on the storefront. + */ + name: string + /** + * Relative URL on the storefront for this page. + */ + url?: string + /** + * Description contained within this page’s `` element. + */ + meta_description?: string + /** + * HTML or variable that populates this page’s `` element, in default/desktop view. Required in POST if page type is `raw`. + */ + body: string + /** + * HTML to use for this page's body when viewed in the mobile template (deprecated). + */ + mobile_body?: string + /** + * If true, this page has a mobile version. + */ + has_mobile_version?: boolean + /** + * If true, this page appears in the storefront’s navigation menu. + */ + is_visible?: boolean + /** + * If true, this page is the storefront’s home page. + */ + is_homepage?: boolean + /** + * Text specified for this page’s `` element. (If empty, the value of the name property is used.) + */ + meta_title?: string + /** + * Layout template for this page. This field is writable only for stores with a Blueprint theme applied. + */ + layout_file?: string + /** + * Order in which this page should display on the storefront. (Lower integers specify earlier display.) + */ + sort_order?: number + /** + * Comma-separated list of keywords that shoppers can use to locate this page when searching the store. + */ + search_keywords?: string + /** + * Comma-separated list of SEO-relevant keywords to include in the page’s `<meta/>` element. + */ + meta_keywords?: string + /** + * If page type is `rss_feed` the n this field is visisble. Required in POST required for `rss page` type. + */ + feed: string + /** + * If page type is `link` this field is returned. Required in POST to create a `link` page. + */ + link: string + content_type?: 'application/json' | 'text/javascript' | 'text/html' + } +} diff --git a/packages/bigcommerce/src/api/definitions/wishlist.ts b/packages/bigcommerce/src/api/definitions/wishlist.ts new file mode 100644 index 0000000..6ec21c1 --- /dev/null +++ b/packages/bigcommerce/src/api/definitions/wishlist.ts @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by swagger-to-ts. + * Do not make direct changes to the file. + */ + +export interface definitions { + wishlist_Post: { + /** + * The customer id. + */ + customer_id: number + /** + * Whether the wishlist is available to the public. + */ + is_public?: boolean + /** + * The title of the wishlist. + */ + name?: string + /** + * Array of Wishlist items. + */ + items?: { + /** + * The ID of the product. + */ + product_id?: number + /** + * The variant ID of the product. + */ + variant_id?: number + }[] + } + wishlist_Put: { + /** + * The customer id. + */ + customer_id: number + /** + * Whether the wishlist is available to the public. + */ + is_public?: boolean + /** + * The title of the wishlist. + */ + name?: string + /** + * Array of Wishlist items. + */ + items?: { + /** + * The ID of the item + */ + id?: number + /** + * The ID of the product. + */ + product_id?: number + /** + * The variant ID of the item. + */ + variant_id?: number + }[] + } + wishlist_Full: { + /** + * Wishlist ID, provided after creating a wishlist with a POST. + */ + id?: number + /** + * The ID the customer to which the wishlist belongs. + */ + customer_id?: number + /** + * The Wishlist's name. + */ + name?: string + /** + * Whether the Wishlist is available to the public. + */ + is_public?: boolean + /** + * The token of the Wishlist. This is created internally within BigCommerce. The Wishlist ID is to be used for external apps. Read-Only + */ + token?: string + /** + * Array of Wishlist items + */ + items?: definitions['wishlistItem_Full'][] + } + wishlistItem_Full: { + /** + * The ID of the item + */ + id?: number + /** + * The ID of the product. + */ + product_id?: number + /** + * The variant ID of the item. + */ + variant_id?: number + } + wishlistItem_Post: { + /** + * The ID of the product. + */ + product_id?: number + /** + * The variant ID of the product. + */ + variant_id?: number + } + /** + * Data about the response, including pagination and collection totals. + */ + pagination: { + /** + * Total number of items in the result set. + */ + total?: number + /** + * Total number of items in the collection response. + */ + count?: number + /** + * The amount of items returned in the collection per page, controlled by the limit parameter. + */ + per_page?: number + /** + * The page you are currently on within the collection. + */ + current_page?: number + /** + * The total number of pages in the collection. + */ + total_pages?: number + } + error: { status?: number; title?: string; type?: string } + metaCollection: { pagination?: definitions['pagination'] } +} diff --git a/packages/bigcommerce/src/api/endpoints/cart/add-item.ts b/packages/bigcommerce/src/api/endpoints/cart/add-item.ts new file mode 100644 index 0000000..d2bb7ad --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/cart/add-item.ts @@ -0,0 +1,46 @@ +import { normalizeCart } from '../../../lib/normalize' +import { parseCartItem } from '../../utils/parse-item' +import getCartCookie from '../../utils/get-cart-cookie' +import type { CartEndpoint } from '.' + +const addItem: CartEndpoint['handlers']['addItem'] = async ({ + 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 options = { + method: 'POST', + body: JSON.stringify({ + line_items: [parseCartItem(item)], + ...(!cartId && config.storeChannelId + ? { channel_id: config.storeChannelId } + : {}), + }), + } + const { data } = cartId + ? await config.storeApiFetch( + `/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,line_items.digital_items.options', + options + ) + + // Create or update the cart cookie + res.setHeader( + 'Set-Cookie', + getCartCookie(config.cartCookie, data.id, config.cartCookieMaxAge) + ) + res.status(200).json({ data: normalizeCart(data) }) +} + +export default addItem diff --git a/packages/bigcommerce/src/api/endpoints/cart/get-cart.ts b/packages/bigcommerce/src/api/endpoints/cart/get-cart.ts new file mode 100644 index 0000000..b6a7d88 --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/cart/get-cart.ts @@ -0,0 +1,35 @@ +import { normalizeCart } from '../../../lib/normalize' +import { BigcommerceApiError } from '../../utils/errors' +import getCartCookie from '../../utils/get-cart-cookie' +import type { BigcommerceCart } from '../../../types/cart' +import type { CartEndpoint } from '.' + +// Return current cart info +const getCart: CartEndpoint['handlers']['getCart'] = async ({ + res, + body: { cartId }, + config, +}) => { + let result: { data?: BigcommerceCart } = {} + + if (cartId) { + try { + result = await config.storeApiFetch( + `/v3/carts/${cartId}?include=line_items.physical_items.options,line_items.digital_items.options` + ) + } catch (error) { + if (error instanceof BigcommerceApiError && error.status === 404) { + // Remove the cookie if it exists but the cart wasn't found + res.setHeader('Set-Cookie', getCartCookie(config.cartCookie)) + } else { + throw error + } + } + } + + res.status(200).json({ + data: result.data ? normalizeCart(result.data) : null, + }) +} + +export default getCart diff --git a/packages/bigcommerce/src/api/endpoints/cart/index.ts b/packages/bigcommerce/src/api/endpoints/cart/index.ts new file mode 100644 index 0000000..3766511 --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/cart/index.ts @@ -0,0 +1,26 @@ +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' +import addItem from './add-item' +import updateItem from './update-item' +import removeItem from './remove-item' + +export type CartAPI = GetAPISchema<BigcommerceAPI, CartSchema> + +export type CartEndpoint = CartAPI['endpoint'] + +export const handlers: CartEndpoint['handlers'] = { + getCart, + addItem, + updateItem, + removeItem, +} + +const cartApi = createEndpoint<CartAPI>({ + handler: cartEndpoint, + handlers, +}) + +export default cartApi diff --git a/packages/bigcommerce/src/api/endpoints/cart/remove-item.ts b/packages/bigcommerce/src/api/endpoints/cart/remove-item.ts new file mode 100644 index 0000000..baf10c8 --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/cart/remove-item.ts @@ -0,0 +1,34 @@ +import { normalizeCart } from '../../../lib/normalize' +import getCartCookie from '../../utils/get-cart-cookie' +import type { CartEndpoint } from '.' + +const removeItem: CartEndpoint['handlers']['removeItem'] = async ({ + res, + body: { cartId, itemId }, + config, +}) => { + if (!cartId || !itemId) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + + const result = await config.storeApiFetch<{ data: any } | null>( + `/v3/carts/${cartId}/items/${itemId}?include=line_items.physical_items.options`, + { method: 'DELETE' } + ) + const data = result?.data ?? null + + res.setHeader( + 'Set-Cookie', + data + ? // Update the cart cookie + getCartCookie(config.cartCookie, cartId, config.cartCookieMaxAge) + : // Remove the cart cookie if the cart was removed (empty items) + getCartCookie(config.cartCookie) + ) + res.status(200).json({ data: data && normalizeCart(data) }) +} + +export default removeItem diff --git a/packages/bigcommerce/src/api/endpoints/cart/update-item.ts b/packages/bigcommerce/src/api/endpoints/cart/update-item.ts new file mode 100644 index 0000000..113553f --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/cart/update-item.ts @@ -0,0 +1,36 @@ +import { normalizeCart } from '../../../lib/normalize' +import { parseCartItem } from '../../utils/parse-item' +import getCartCookie from '../../utils/get-cart-cookie' +import type { CartEndpoint } from '.' + +const updateItem: CartEndpoint['handlers']['updateItem'] = async ({ + res, + body: { cartId, itemId, item }, + config, +}) => { + if (!cartId || !itemId || !item) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + + const { data } = await config.storeApiFetch( + `/v3/carts/${cartId}/items/${itemId}?include=line_items.physical_items.options`, + { + method: 'PUT', + body: JSON.stringify({ + line_item: parseCartItem(item), + }), + } + ) + + // Update the cart cookie + res.setHeader( + 'Set-Cookie', + getCartCookie(config.cartCookie, cartId, config.cartCookieMaxAge) + ) + res.status(200).json({ data: normalizeCart(data) }) +} + +export default updateItem diff --git a/packages/bigcommerce/src/api/endpoints/catalog/products/get-products.ts b/packages/bigcommerce/src/api/endpoints/catalog/products/get-products.ts new file mode 100644 index 0000000..f88a231 --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/catalog/products/get-products.ts @@ -0,0 +1,79 @@ +import { Product } from '@vercel/commerce/types/product' +import { ProductsEndpoint } from '.' + +const SORT: { [key: string]: string | undefined } = { + latest: 'id', + trending: 'total_sold', + price: 'price', +} + +const LIMIT = 12 + +// Return current cart info +const getProducts: ProductsEndpoint['handlers']['getProducts'] = async ({ + res, + body: { search, categoryId, brandId, sort }, + config, + commerce, +}) => { + // Use a dummy base as we only care about the relative path + const url = new URL('/v3/catalog/products', 'http://a') + + url.searchParams.set('is_visible', 'true') + url.searchParams.set('limit', String(LIMIT)) + + if (search) url.searchParams.set('keyword', search) + + if (categoryId && Number.isInteger(Number(categoryId))) + url.searchParams.set('categories:in', String(categoryId)) + + if (brandId && Number.isInteger(Number(brandId))) + url.searchParams.set('brand_id', String(brandId)) + + if (sort) { + const [_sort, direction] = sort.split('-') + const sortValue = SORT[_sort] + + if (sortValue && direction) { + url.searchParams.set('sort', sortValue) + url.searchParams.set('direction', direction) + } + } + + // We only want the id of each product + url.searchParams.set('include_fields', 'id') + + const { data } = await config.storeApiFetch<{ data: { id: number }[] }>( + url.pathname + url.search + ) + + const ids = data.map((p) => String(p.id)) + const found = ids.length > 0 + + // We want the GraphQL version of each product + const graphqlData = await commerce.getAllProducts({ + variables: { first: LIMIT, ids }, + config, + }) + + // Put the products in an object that we can use to get them by id + const productsById = graphqlData.products.reduce<{ + [k: string]: Product + }>((prods, p) => { + prods[Number(p.id)] = p + return prods + }, {}) + + const products: Product[] = found ? [] : graphqlData.products + + // Populate the products array with the graphql products, in the order + // assigned by the list of entity ids + ids.forEach((id) => { + const product = productsById[id] + if (product) products.push(product) + }) + + res.status(200).json({ data: { products, found } }) +} + +export default getProducts diff --git a/packages/bigcommerce/src/api/endpoints/catalog/products/index.ts b/packages/bigcommerce/src/api/endpoints/catalog/products/index.ts new file mode 100644 index 0000000..2447243 --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/catalog/products/index.ts @@ -0,0 +1,18 @@ +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' + +export type ProductsAPI = GetAPISchema<BigcommerceAPI, ProductsSchema> + +export type ProductsEndpoint = ProductsAPI['endpoint'] + +export const handlers: ProductsEndpoint['handlers'] = { getProducts } + +const productsApi = createEndpoint<ProductsAPI>({ + handler: productsEndpoint, + handlers, +}) + +export default productsApi diff --git a/packages/bigcommerce/src/api/endpoints/checkout/get-checkout.ts b/packages/bigcommerce/src/api/endpoints/checkout/get-checkout.ts new file mode 100644 index 0000000..e98e6ca --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/checkout/get-checkout.ts @@ -0,0 +1,90 @@ +import type { CheckoutEndpoint } from '.' +import getCustomerId from '../../utils/get-customer-id' +import jwt from 'jsonwebtoken' +import { uuid } from 'uuidv4' + +const fullCheckout = true + +const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ + req, + res, + config, +}) => { + const { cookies } = req + const cartId = cookies[config.cartCookie] + const customerToken = cookies[config.customerCookie] + if (!cartId) { + res.redirect('/cart') + return + } + const { data } = await config.storeApiFetch( + `/v3/carts/${cartId}/redirect_urls`, + { + method: 'POST', + } + ) + const customerId = + customerToken && (await getCustomerId({ customerToken, config })) + + //if there is a customer create a jwt token + if (!customerId) { + if (fullCheckout) { + res.redirect(data.checkout_url) + return + } + } else { + const dateCreated = Math.round(new Date().getTime() / 1000) + const payload = { + iss: config.storeApiClientId, + iat: dateCreated, + jti: uuid(), + operation: 'customer_login', + store_hash: config.storeHash, + customer_id: customerId, + channel_id: config.storeChannelId, + redirect_to: data.checkout_url.replace(config.storeUrl, ""), + } + let token = jwt.sign(payload, config.storeApiClientSecret!, { + algorithm: 'HS256', + }) + let checkouturl = `${config.storeUrl}/login/token/${token}` + console.log('checkouturl', checkouturl) + if (fullCheckout) { + res.redirect(checkouturl) + return + } + } + + // TODO: make the embedded checkout work too! + const html = ` + <!DOCTYPE html> + <html lang="en"> + <head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Checkout + + + + +
+ + + ` + + res.status(200) + res.setHeader('Content-Type', 'text/html') + res.write(html) + res.end() +} + +export default getCheckout diff --git a/packages/bigcommerce/src/api/endpoints/checkout/index.ts b/packages/bigcommerce/src/api/endpoints/checkout/index.ts new file mode 100644 index 0000000..83bc4ae --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/checkout/index.ts @@ -0,0 +1,18 @@ +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 getCheckout from './get-checkout' + +export type CheckoutAPI = GetAPISchema + +export type CheckoutEndpoint = CheckoutAPI['endpoint'] + +export const handlers: CheckoutEndpoint['handlers'] = { getCheckout } + +const checkoutApi = createEndpoint({ + handler: checkoutEndpoint, + handlers, +}) + +export default checkoutApi diff --git a/packages/bigcommerce/src/api/endpoints/customer/address.ts b/packages/bigcommerce/src/api/endpoints/customer/address.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/customer/address.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/bigcommerce/src/api/endpoints/customer/card.ts b/packages/bigcommerce/src/api/endpoints/customer/card.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/customer/card.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/bigcommerce/src/api/endpoints/customer/get-logged-in-customer.ts b/packages/bigcommerce/src/api/endpoints/customer/get-logged-in-customer.ts new file mode 100644 index 0000000..4c93730 --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/customer/get-logged-in-customer.ts @@ -0,0 +1,56 @@ +import type { GetLoggedInCustomerQuery } from '../../../../schema' +import type { CustomerEndpoint } from '.' + +export const getLoggedInCustomerQuery = /* GraphQL */ ` + query getLoggedInCustomer { + customer { + entityId + firstName + lastName + email + company + customerGroupId + notes + phone + addressCount + attributeCount + storeCredit { + value + currencyCode + } + } + } +` + +export type Customer = NonNullable + +const getLoggedInCustomer: CustomerEndpoint['handlers']['getLoggedInCustomer'] = + async ({ req, res, config }) => { + const token = req.cookies[config.customerCookie] + + if (token) { + const { data } = await config.fetch( + getLoggedInCustomerQuery, + undefined, + { + headers: { + cookie: `${config.customerCookie}=${token}`, + }, + } + ) + const { customer } = data + + if (!customer) { + 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/bigcommerce/src/api/endpoints/customer/index.ts b/packages/bigcommerce/src/api/endpoints/customer/index.ts new file mode 100644 index 0000000..5efff39 --- /dev/null +++ b/packages/bigcommerce/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 { BigcommerceAPI } from '../..' +import getLoggedInCustomer from './get-logged-in-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/bigcommerce/src/api/endpoints/login/index.ts b/packages/bigcommerce/src/api/endpoints/login/index.ts new file mode 100644 index 0000000..1ad6f71 --- /dev/null +++ b/packages/bigcommerce/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 { BigcommerceAPI } 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/bigcommerce/src/api/endpoints/login/login.ts b/packages/bigcommerce/src/api/endpoints/login/login.ts new file mode 100644 index 0000000..0ebc5b1 --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/login/login.ts @@ -0,0 +1,49 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { LoginEndpoint } from '.' + +const invalidCredentials = /invalid credentials/i + +const login: LoginEndpoint['handlers']['login'] = async ({ + res, + body: { email, password }, + config, + commerce, +}) => { + // TODO: Add proper validations with something like Ajv + if (!(email && password)) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + // TODO: validate the password and email + // Passwords must be at least 7 characters and contain both alphabetic + // and numeric characters. + + try { + await commerce.login({ variables: { email, password }, config, res }) + } 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: null }) +} + +export default login diff --git a/packages/bigcommerce/src/api/endpoints/logout/index.ts b/packages/bigcommerce/src/api/endpoints/logout/index.ts new file mode 100644 index 0000000..94a246f --- /dev/null +++ b/packages/bigcommerce/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 { BigcommerceAPI } 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/bigcommerce/src/api/endpoints/logout/logout.ts b/packages/bigcommerce/src/api/endpoints/logout/logout.ts new file mode 100644 index 0000000..b90a8c3 --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/logout/logout.ts @@ -0,0 +1,23 @@ +import { serialize } from 'cookie' +import type { LogoutEndpoint } from '.' + +const logout: LogoutEndpoint['handlers']['logout'] = async ({ + res, + body: { redirectTo }, + config, +}) => { + // Remove the cookie + res.setHeader( + 'Set-Cookie', + serialize(config.customerCookie, '', { maxAge: -1, path: '/' }) + ) + + // 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/bigcommerce/src/api/endpoints/signup/index.ts b/packages/bigcommerce/src/api/endpoints/signup/index.ts new file mode 100644 index 0000000..64521f9 --- /dev/null +++ b/packages/bigcommerce/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 { BigcommerceAPI } 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/bigcommerce/src/api/endpoints/signup/signup.ts b/packages/bigcommerce/src/api/endpoints/signup/signup.ts new file mode 100644 index 0000000..46c071b --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/signup/signup.ts @@ -0,0 +1,62 @@ +import { BigcommerceApiError } from '../../utils/errors' +import type { SignupEndpoint } from '.' + +const signup: SignupEndpoint['handlers']['signup'] = async ({ + res, + body: { firstName, lastName, email, password }, + config, + commerce, +}) => { + // TODO: Add proper validations with something like Ajv + if (!(firstName && lastName && email && password)) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + // TODO: validate the password and email + // Passwords must be at least 7 characters and contain both alphabetic + // and numeric characters. + + try { + await config.storeApiFetch('/v3/customers', { + method: 'POST', + body: JSON.stringify([ + { + first_name: firstName, + last_name: lastName, + email, + authentication: { + new_password: password, + }, + }, + ]), + }) + } catch (error) { + if (error instanceof BigcommerceApiError && error.status === 422) { + const hasEmailError = '0.email' in error.data?.errors + + // If there's an error with the email, it most likely means it's duplicated + if (hasEmailError) { + return res.status(400).json({ + data: null, + errors: [ + { + message: 'The email is already in use', + code: 'duplicated_email', + }, + ], + }) + } + } + + throw error + } + + // Login the customer right after creating it + await commerce.login({ variables: { email, password }, res, config }) + + res.status(200).json({ data: null }) +} + +export default signup diff --git a/packages/bigcommerce/src/api/endpoints/wishlist/add-item.ts b/packages/bigcommerce/src/api/endpoints/wishlist/add-item.ts new file mode 100644 index 0000000..734a644 --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/wishlist/add-item.ts @@ -0,0 +1,67 @@ +import getCustomerWishlist from '../../operations/get-customer-wishlist' +import { parseWishlistItem } from '../../utils/parse-item' +import getCustomerId from '../../utils/get-customer-id' +import type { WishlistEndpoint } from '.' + +const addItem: WishlistEndpoint['handlers']['addItem'] = async ({ + res, + body: { customerToken, item }, + config, + commerce, +}) => { + if (!item) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Missing item' }], + }) + } + + try { + const customerId = + customerToken && (await getCustomerId({ customerToken, config })) + + if (!customerId) { + throw new Error('Invalid request. No CustomerId') + } + + let { wishlist } = await commerce.getCustomerWishlist({ + variables: { customerId }, + config, + }) + + if (!wishlist) { + // If user has no wishlist, then let's create one with new item + const { data } = await config.storeApiFetch('/v3/wishlists', { + method: 'POST', + body: JSON.stringify({ + name: 'Next.js Commerce Wishlist', + is_public: false, + customer_id: Number(customerId), + items: [parseWishlistItem(item)], + }), + }) + return res.status(200).json(data) + } + + // Existing Wishlist, let's add Item to Wishlist + const { data } = await config.storeApiFetch( + `/v3/wishlists/${wishlist.id}/items`, + { + method: 'POST', + body: JSON.stringify({ + items: [parseWishlistItem(item)], + }), + } + ) + + // Returns Wishlist + return res.status(200).json(data) + } catch (err: any) { + res.status(500).json({ + data: null, + errors: [{ message: err.message }], + }) + } +} + +export default addItem diff --git a/packages/bigcommerce/src/api/endpoints/wishlist/get-wishlist.ts b/packages/bigcommerce/src/api/endpoints/wishlist/get-wishlist.ts new file mode 100644 index 0000000..479a67c --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/wishlist/get-wishlist.ts @@ -0,0 +1,39 @@ +import type { Wishlist } from '../../../types/wishlist' +import type { WishlistEndpoint } from '.' +import getCustomerId from '../../utils/get-customer-id' +import getCustomerWishlist from '../../operations/get-customer-wishlist' + +// Return wishlist info +const getWishlist: WishlistEndpoint['handlers']['getWishlist'] = async ({ + res, + body: { customerToken, includeProducts }, + config, + commerce, +}) => { + let result: { data?: Wishlist } = {} + + if (customerToken) { + const customerId = + customerToken && (await getCustomerId({ customerToken, config })) + + 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 }, + includeProducts, + config, + }) + + result = { data: wishlist } + } + + res.status(200).json({ data: result.data ?? null }) +} + +export default getWishlist diff --git a/packages/bigcommerce/src/api/endpoints/wishlist/index.ts b/packages/bigcommerce/src/api/endpoints/wishlist/index.ts new file mode 100644 index 0000000..8772822 --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/wishlist/index.ts @@ -0,0 +1,24 @@ +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' +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/bigcommerce/src/api/endpoints/wishlist/remove-item.ts b/packages/bigcommerce/src/api/endpoints/wishlist/remove-item.ts new file mode 100644 index 0000000..9b19d9b --- /dev/null +++ b/packages/bigcommerce/src/api/endpoints/wishlist/remove-item.ts @@ -0,0 +1,39 @@ +import type { Wishlist } from '../../../types/wishlist' +import getCustomerWishlist from '../../operations/get-customer-wishlist' +import getCustomerId from '../../utils/get-customer-id' +import type { WishlistEndpoint } from '.' + +// Return wishlist info +const removeItem: WishlistEndpoint['handlers']['removeItem'] = async ({ + res, + body: { customerToken, itemId }, + config, + commerce, +}) => { + const customerId = + customerToken && (await getCustomerId({ customerToken, config })) + const { wishlist } = + (customerId && + (await commerce.getCustomerWishlist({ + variables: { customerId }, + config, + }))) || + {} + + if (!wishlist || !itemId) { + return res.status(400).json({ + data: null, + errors: [{ message: 'Invalid request' }], + }) + } + + const result = await config.storeApiFetch<{ data: Wishlist } | null>( + `/v3/wishlists/${wishlist.id}/items/${itemId}`, + { method: 'DELETE' } + ) + const data = result?.data ?? null + + res.status(200).json({ data }) +} + +export default removeItem diff --git a/packages/bigcommerce/src/api/fragments/category-tree.ts b/packages/bigcommerce/src/api/fragments/category-tree.ts new file mode 100644 index 0000000..e26f171 --- /dev/null +++ b/packages/bigcommerce/src/api/fragments/category-tree.ts @@ -0,0 +1,9 @@ +export const categoryTreeItemFragment = /* GraphQL */ ` + fragment categoryTreeItem on CategoryTreeItem { + entityId + name + path + description + productCount + } +` diff --git a/packages/bigcommerce/src/api/fragments/product.ts b/packages/bigcommerce/src/api/fragments/product.ts new file mode 100644 index 0000000..734e0ab --- /dev/null +++ b/packages/bigcommerce/src/api/fragments/product.ts @@ -0,0 +1,113 @@ +export const productPrices = /* GraphQL */ ` + fragment productPrices on Prices { + price { + value + currencyCode + } + salePrice { + value + currencyCode + } + retailPrice { + value + currencyCode + } + } +` + +export const swatchOptionFragment = /* GraphQL */ ` + fragment swatchOption on SwatchOptionValue { + isDefault + hexColors + } +` + +export const multipleChoiceOptionFragment = /* GraphQL */ ` + fragment multipleChoiceOption on MultipleChoiceOption { + values { + edges { + node { + label + ...swatchOption + } + } + } + } + + ${swatchOptionFragment} +` + +export const productInfoFragment = /* GraphQL */ ` + fragment productInfo on Product { + entityId + name + path + brand { + entityId + } + description + prices { + ...productPrices + } + images { + edges { + node { + urlOriginal + altText + isDefault + } + } + } + variants(first: 250) { + edges { + node { + entityId + defaultImage { + urlOriginal + altText + isDefault + } + } + } + } + productOptions { + edges { + node { + __typename + entityId + displayName + ...multipleChoiceOption + } + } + } + localeMeta: metafields(namespace: $locale, keys: ["name", "description"]) + @include(if: $hasLocale) { + edges { + node { + key + value + } + } + } + } + + ${productPrices} + ${multipleChoiceOptionFragment} +` + +export const productConnectionFragment = /* GraphQL */ ` + fragment productConnnection on ProductConnection { + pageInfo { + startCursor + endCursor + } + edges { + cursor + node { + ...productInfo + } + } + } + + ${productInfoFragment} +` diff --git a/packages/bigcommerce/src/api/index.ts b/packages/bigcommerce/src/api/index.ts new file mode 100644 index 0000000..bd5fcb3 --- /dev/null +++ b/packages/bigcommerce/src/api/index.ts @@ -0,0 +1,120 @@ +import type { RequestInit } from '@vercel/fetch' +import { + CommerceAPI, + CommerceAPIConfig, + getCommerceApi as commerceApi, +} from '@vercel/commerce/api' +import createFetchGraphqlApi from './utils/fetch-graphql-api' +import createFetchStoreApi from './utils/fetch-store-api' + +import type { CartAPI } from './endpoints/cart' +import type { CustomerAPI } from './endpoints/customer' +import type { LoginAPI } from './endpoints/login' +import type { LogoutAPI } from './endpoints/logout' +import type { SignupAPI } from './endpoints/signup' +import type { ProductsAPI } from './endpoints/catalog/products' +import type { WishlistAPI } from './endpoints/wishlist' + +import login from './operations/login' +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 BigcommerceConfig extends CommerceAPIConfig { + // Indicates if the returned metadata with translations should be applied to the + // data or returned as it is + applyLocale?: boolean + storeApiUrl: string + storeApiToken: string + storeApiClientId: string + storeChannelId?: string + storeUrl?: string + storeApiClientSecret?: string + storeHash?: string + storeApiFetch(endpoint: string, options?: RequestInit): Promise +} + +const API_URL = process.env.BIGCOMMERCE_STOREFRONT_API_URL // GraphAPI +const API_TOKEN = process.env.BIGCOMMERCE_STOREFRONT_API_TOKEN +const STORE_API_URL = process.env.BIGCOMMERCE_STORE_API_URL // REST API +const STORE_API_TOKEN = process.env.BIGCOMMERCE_STORE_API_TOKEN +const STORE_API_CLIENT_ID = process.env.BIGCOMMERCE_STORE_API_CLIENT_ID +const STORE_CHANNEL_ID = process.env.BIGCOMMERCE_CHANNEL_ID +const STORE_URL = process.env.BIGCOMMERCE_STORE_URL +const CLIENT_SECRET = process.env.BIGCOMMERCE_STORE_API_CLIENT_SECRET +const STOREFRONT_HASH = process.env.BIGCOMMERCE_STORE_API_STORE_HASH + +if (!API_URL) { + throw new Error( + `The environment variable BIGCOMMERCE_STOREFRONT_API_URL is missing and it's required to access your store` + ) +} + +if (!API_TOKEN) { + throw new Error( + `The environment variable BIGCOMMERCE_STOREFRONT_API_TOKEN is missing and it's required to access your store` + ) +} + +if (!(STORE_API_URL && STORE_API_TOKEN && STORE_API_CLIENT_ID)) { + throw new Error( + `The environment variables BIGCOMMERCE_STORE_API_URL, BIGCOMMERCE_STORE_API_TOKEN, BIGCOMMERCE_STORE_API_CLIENT_ID have to be set in order to access the REST API of your store` + ) +} + +const ONE_DAY = 60 * 60 * 24 + +const config: BigcommerceConfig = { + commerceUrl: API_URL, + apiToken: API_TOKEN, + customerCookie: 'SHOP_TOKEN', + cartCookie: process.env.BIGCOMMERCE_CART_COOKIE ?? 'bc_cartId', + cartCookieMaxAge: ONE_DAY * 30, + fetch: createFetchGraphqlApi(() => getCommerceApi().getConfig()), + applyLocale: true, + // REST API only + storeApiUrl: STORE_API_URL, + storeApiToken: STORE_API_TOKEN, + storeApiClientId: STORE_API_CLIENT_ID, + storeChannelId: STORE_CHANNEL_ID, + storeUrl: STORE_URL, + storeApiClientSecret: CLIENT_SECRET, + storeHash: STOREFRONT_HASH, + storeApiFetch: createFetchStoreApi(() => getCommerceApi().getConfig()), +} + +const operations = { + login, + getAllPages, + getPage, + getSiteInfo, + getCustomerWishlist, + getAllProductPaths, + getAllProducts, + getProduct, +} + +export const provider = { config, operations } + +export type Provider = typeof provider + +export type APIs = + | CartAPI + | CustomerAPI + | LoginAPI + | LogoutAPI + | SignupAPI + | ProductsAPI + | WishlistAPI + +export type BigcommerceAPI

= CommerceAPI

+ +export function getCommerceApi

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

{ + return commerceApi(customProvider) +} diff --git a/packages/bigcommerce/src/api/operations/get-all-pages.ts b/packages/bigcommerce/src/api/operations/get-all-pages.ts new file mode 100644 index 0000000..3117b73 --- /dev/null +++ b/packages/bigcommerce/src/api/operations/get-all-pages.ts @@ -0,0 +1,46 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { Page, GetAllPagesOperation } from '../../types/page' +import type { RecursivePartial, RecursiveRequired } from '../utils/types' +import { BigcommerceConfig, Provider } from '..' + +export default function getAllPagesOperation({ + commerce, +}: OperationContext) { + async function getAllPages(opts?: { + config?: Partial + preview?: boolean + }): Promise + + async function getAllPages( + opts: { + config?: Partial + preview?: boolean + } & OperationOptions + ): Promise + + async function getAllPages({ + config, + preview, + }: { + url?: string + config?: Partial + preview?: boolean + } = {}): Promise { + const cfg = commerce.getConfig(config) + // RecursivePartial forces the method to check for every prop in the data, which is + // required in case there's a custom `url` + const { data } = await cfg.storeApiFetch< + RecursivePartial<{ data: Page[] }> + >('/v3/content/pages') + const pages = (data as RecursiveRequired) ?? [] + + return { + pages: preview ? pages : pages.filter((p) => p.is_visible), + } + } + + return getAllPages +} diff --git a/packages/bigcommerce/src/api/operations/get-all-product-paths.ts b/packages/bigcommerce/src/api/operations/get-all-product-paths.ts new file mode 100644 index 0000000..90cdab6 --- /dev/null +++ b/packages/bigcommerce/src/api/operations/get-all-product-paths.ts @@ -0,0 +1,66 @@ +import type { + OperationContext, + OperationOptions, +} 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' +import { BigcommerceConfig, Provider } from '..' + +export const getAllProductPathsQuery = /* GraphQL */ ` + query getAllProductPaths($first: Int = 100) { + site { + products(first: $first) { + edges { + node { + path + } + } + } + } + } +` + +export default function getAllProductPathsOperation({ + commerce, +}: OperationContext) { + async function getAllProductPaths< + T extends GetAllProductPathsOperation + >(opts?: { + variables?: T['variables'] + config?: BigcommerceConfig + }): Promise + + async function getAllProductPaths( + opts: { + variables?: T['variables'] + config?: BigcommerceConfig + } & OperationOptions + ): Promise + + async function getAllProductPaths({ + query = getAllProductPathsQuery, + variables, + config, + }: { + query?: string + variables?: T['variables'] + config?: BigcommerceConfig + } = {}): Promise { + config = commerce.getConfig(config) + // RecursivePartial forces the method to check for every prop in the data, which is + // required in case there's a custom `query` + const { data } = await config.fetch< + RecursivePartial + >(query, { variables }) + const products = data.site?.products?.edges + + return { + products: filterEdges(products as RecursiveRequired).map( + ({ node }) => node + ), + } + } + return getAllProductPaths +} diff --git a/packages/bigcommerce/src/api/operations/get-all-products.ts b/packages/bigcommerce/src/api/operations/get-all-products.ts new file mode 100644 index 0000000..2833ffc --- /dev/null +++ b/packages/bigcommerce/src/api/operations/get-all-products.ts @@ -0,0 +1,135 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { + GetAllProductsQuery, + GetAllProductsQueryVariables, +} from '../../../schema' +import type { GetAllProductsOperation } from '../../types/product' +import type { RecursivePartial, RecursiveRequired } from '../utils/types' +import filterEdges from '../utils/filter-edges' +import setProductLocaleMeta from '../utils/set-product-locale-meta' +import { productConnectionFragment } from '../fragments/product' +import { BigcommerceConfig, Provider } from '..' +import { normalizeProduct } from '../../lib/normalize' + +export const getAllProductsQuery = /* GraphQL */ ` + query getAllProducts( + $hasLocale: Boolean = false + $locale: String = "null" + $entityIds: [Int!] + $first: Int = 10 + $products: Boolean = false + $featuredProducts: Boolean = false + $bestSellingProducts: Boolean = false + $newestProducts: Boolean = false + ) { + site { + products(first: $first, entityIds: $entityIds) @include(if: $products) { + ...productConnnection + } + featuredProducts(first: $first) @include(if: $featuredProducts) { + ...productConnnection + } + bestSellingProducts(first: $first) @include(if: $bestSellingProducts) { + ...productConnnection + } + newestProducts(first: $first) @include(if: $newestProducts) { + ...productConnnection + } + } + } + + ${productConnectionFragment} +` + +export type ProductEdge = NonNullable< + NonNullable[0] +> + +export type ProductNode = ProductEdge['node'] + +export type GetAllProductsResult< + T extends Record = { + products: ProductEdge[] + } +> = T + +function getProductsType( + relevance?: GetAllProductsOperation['variables']['relevance'] +) { + switch (relevance) { + case 'featured': + return 'featuredProducts' + case 'best_selling': + return 'bestSellingProducts' + case 'newest': + return 'newestProducts' + default: + return 'products' + } +} + +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({ + query = getAllProductsQuery, + variables: vars = {}, + config: cfg, + }: { + query?: string + variables?: T['variables'] + config?: Partial + preview?: boolean + } = {}): Promise { + const config = commerce.getConfig(cfg) + const { locale } = config + const field = getProductsType(vars.relevance) + const variables: GetAllProductsQueryVariables = { + locale, + hasLocale: !!locale, + } + + variables[field] = true + + if (vars.first) variables.first = vars.first + if (vars.ids) variables.entityIds = vars.ids.map((id) => Number(id)) + + // RecursivePartial forces the method to check for every prop in the data, which is + // required in case there's a custom `query` + const { data } = await config.fetch>( + query, + { variables } + ) + const edges = data.site?.[field]?.edges + const products = filterEdges(edges as RecursiveRequired) + + if (locale && config.applyLocale) { + products.forEach((product: RecursivePartial) => { + if (product.node) setProductLocaleMeta(product.node) + }) + } + + return { + products: products.map(({ node }) => normalizeProduct(node as any)), + } + } + + return getAllProducts +} diff --git a/packages/bigcommerce/src/api/operations/get-customer-wishlist.ts b/packages/bigcommerce/src/api/operations/get-customer-wishlist.ts new file mode 100644 index 0000000..25e2157 --- /dev/null +++ b/packages/bigcommerce/src/api/operations/get-customer-wishlist.ts @@ -0,0 +1,82 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { + GetCustomerWishlistOperation, + Wishlist, +} from '../../types/wishlist' +import type { RecursivePartial, RecursiveRequired } from '../utils/types' +import { BigcommerceConfig, Provider } from '..' +import getAllProducts, { ProductEdge } from './get-all-products' + +export default function getCustomerWishlistOperation({ + commerce, +}: OperationContext) { + async function getCustomerWishlist< + T extends GetCustomerWishlistOperation + >(opts: { + variables: T['variables'] + config?: BigcommerceConfig + includeProducts?: boolean + }): Promise + + async function getCustomerWishlist( + opts: { + variables: T['variables'] + config?: BigcommerceConfig + includeProducts?: boolean + } & OperationOptions + ): Promise + + async function getCustomerWishlist({ + config, + variables, + includeProducts, + }: { + url?: string + variables: T['variables'] + config?: BigcommerceConfig + includeProducts?: boolean + }): Promise { + config = commerce.getConfig(config) + + const { data = [] } = await config.storeApiFetch< + RecursivePartial<{ data: Wishlist[] }> + >(`/v3/wishlists?customer_id=${variables.customerId}`) + + const wishlist = data[0] + + if (includeProducts && wishlist?.items?.length) { + const ids = wishlist.items + ?.map((item) => (item?.product_id ? String(item?.product_id) : null)) + .filter((id): id is string => !!id) + + if (ids?.length) { + const graphqlData = await commerce.getAllProducts({ + variables: { first: 50, ids }, + config, + }) + // Put the products in an object that we can use to get them by id + const productsById = graphqlData.products.reduce<{ + [k: number]: ProductEdge + }>((prods, p) => { + prods[Number(p.id)] = p as any + return prods + }, {}) + // Populate the wishlist items with the graphql products + wishlist.items.forEach((item) => { + const product = item && productsById[item.product_id!] + if (item && product) { + // @ts-ignore Fix this type when the wishlist type is properly defined + item.product = product + } + }) + } + } + + return { wishlist: wishlist as RecursiveRequired } + } + + return getCustomerWishlist +} diff --git a/packages/bigcommerce/src/api/operations/get-page.ts b/packages/bigcommerce/src/api/operations/get-page.ts new file mode 100644 index 0000000..dc38e50 --- /dev/null +++ b/packages/bigcommerce/src/api/operations/get-page.ts @@ -0,0 +1,54 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { GetPageOperation, Page } from '../../types/page' +import type { RecursivePartial, RecursiveRequired } from '../utils/types' +import type { BigcommerceConfig, Provider } from '..' +import { normalizePage } from '../../lib/normalize' + +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, + variables, + config, + preview, + }: { + url?: string + variables: T['variables'] + config?: Partial + preview?: boolean + }): Promise { + const cfg = commerce.getConfig(config) + // RecursivePartial forces the method to check for every prop in the data, which is + // required in case there's a custom `url` + const { data } = await cfg.storeApiFetch< + RecursivePartial<{ data: Page[] }> + >(url || `/v3/content/pages?id=${variables.id}&include=body`) + const firstPage = data?.[0] + const page = firstPage as RecursiveRequired + + if (preview || page?.is_visible) { + return { page: normalizePage(page as any) } + } + return {} + } + + return getPage +} diff --git a/packages/bigcommerce/src/api/operations/get-product.ts b/packages/bigcommerce/src/api/operations/get-product.ts new file mode 100644 index 0000000..c7457de --- /dev/null +++ b/packages/bigcommerce/src/api/operations/get-product.ts @@ -0,0 +1,119 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { GetProductOperation } from '../../types/product' +import type { GetProductQuery, GetProductQueryVariables } from '../../../schema' +import setProductLocaleMeta from '../utils/set-product-locale-meta' +import { productInfoFragment } from '../fragments/product' +import { BigcommerceConfig, Provider } from '..' +import { normalizeProduct } from '../../lib/normalize' + +export const getProductQuery = /* GraphQL */ ` + query getProduct( + $hasLocale: Boolean = false + $locale: String = "null" + $path: String! + ) { + site { + route(path: $path) { + node { + __typename + ... on Product { + ...productInfo + variants(first: 250) { + edges { + node { + entityId + defaultImage { + urlOriginal + altText + isDefault + } + prices { + ...productPrices + } + inventory { + aggregated { + availableToSell + warningLevel + } + isInStock + } + productOptions { + edges { + node { + __typename + entityId + displayName + ...multipleChoiceOption + } + } + } + } + } + } + } + } + } + } + } + + ${productInfoFragment} +` + +// TODO: See if this type is useful for defining the Product type +// export type ProductNode = Extract< +// GetProductQuery['site']['route']['node'], +// { __typename: 'Product' } +// > + +export default function getAllProductPathsOperation({ + 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 = getProductQuery, + variables: { slug, ...vars }, + config: cfg, + }: { + query?: string + variables: T['variables'] + config?: Partial + preview?: boolean + }): Promise { + const config = commerce.getConfig(cfg) + const { locale } = config + const variables: GetProductQueryVariables = { + locale, + hasLocale: !!locale, + path: slug ? `/${slug}/` : vars.path!, + } + const { data } = await config.fetch(query, { variables }) + const product = data.site?.route?.node + + if (product?.__typename === 'Product') { + if (locale && config.applyLocale) { + setProductLocaleMeta(product) + } + + return { product: normalizeProduct(product as any) } + } + + return {} + } + return getProduct +} diff --git a/packages/bigcommerce/src/api/operations/get-site-info.ts b/packages/bigcommerce/src/api/operations/get-site-info.ts new file mode 100644 index 0000000..ad0dd5e --- /dev/null +++ b/packages/bigcommerce/src/api/operations/get-site-info.ts @@ -0,0 +1,87 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { GetSiteInfoOperation } from '../../types/site' +import type { GetSiteInfoQuery } from '../../../schema' +import filterEdges from '../utils/filter-edges' +import type { BigcommerceConfig, Provider } from '..' +import { categoryTreeItemFragment } from '../fragments/category-tree' +import { normalizeCategory } from '../../lib/normalize' + +// Get 3 levels of categories +export const getSiteInfoQuery = /* GraphQL */ ` + query getSiteInfo { + site { + categoryTree { + ...categoryTreeItem + children { + ...categoryTreeItem + children { + ...categoryTreeItem + } + } + } + brands { + pageInfo { + startCursor + endCursor + } + edges { + cursor + node { + entityId + name + defaultImage { + urlOriginal + altText + } + pageTitle + metaDesc + metaKeywords + searchKeywords + path + } + } + } + } + } + ${categoryTreeItemFragment} +` + +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 = getSiteInfoQuery, + config, + }: { + query?: string + config?: Partial + preview?: boolean + } = {}): Promise { + const cfg = commerce.getConfig(config) + const { data } = await cfg.fetch(query) + const categories = data.site.categoryTree.map(normalizeCategory) + const brands = data.site?.brands?.edges + + return { + categories: categories ?? [], + brands: filterEdges(brands), + } + } + + return getSiteInfo +} diff --git a/packages/bigcommerce/src/api/operations/login.ts b/packages/bigcommerce/src/api/operations/login.ts new file mode 100644 index 0000000..f534999 --- /dev/null +++ b/packages/bigcommerce/src/api/operations/login.ts @@ -0,0 +1,79 @@ +import type { ServerResponse } from 'http' +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { LoginOperation } from '../../types/login' +import type { LoginMutation } from '../../../schema' +import type { RecursivePartial } from '../utils/types' +import concatHeader from '../utils/concat-cookie' +import type { BigcommerceConfig, Provider } from '..' + +export const loginMutation = /* GraphQL */ ` + mutation login($email: String!, $password: String!) { + login(email: $email, password: $password) { + result + } + } +` + +export default function loginOperation({ + commerce, +}: OperationContext) { + async function login(opts: { + variables: T['variables'] + config?: BigcommerceConfig + res: ServerResponse + }): Promise + + async function login( + opts: { + variables: T['variables'] + config?: BigcommerceConfig + res: ServerResponse + } & OperationOptions + ): Promise + + async function login({ + query = loginMutation, + variables, + res: response, + config, + }: { + query?: string + variables: T['variables'] + res: ServerResponse + config?: BigcommerceConfig + }): Promise { + config = commerce.getConfig(config) + + const { data, res } = await config.fetch>( + query, + { variables } + ) + // Bigcommerce returns a Set-Cookie header with the auth cookie + let cookie = res.headers.get('Set-Cookie') + + if (cookie && typeof cookie === 'string') { + // In development, don't set a secure cookie or the browser will ignore it + if (process.env.NODE_ENV !== 'production') { + cookie = cookie.replace('; Secure', '') + // SameSite=none can't be set unless the cookie is Secure + // bc seems to sometimes send back SameSite=None rather than none so make + // this case insensitive + cookie = cookie.replace(/; SameSite=none/gi, '; SameSite=lax') + } + + response.setHeader( + 'Set-Cookie', + concatHeader(response.getHeader('Set-Cookie'), cookie)! + ) + } + + return { + result: data.login?.result, + } + } + + return login +} diff --git a/packages/bigcommerce/src/api/utils/concat-cookie.ts b/packages/bigcommerce/src/api/utils/concat-cookie.ts new file mode 100644 index 0000000..362e12e --- /dev/null +++ b/packages/bigcommerce/src/api/utils/concat-cookie.ts @@ -0,0 +1,14 @@ +type Header = string | number | string[] | undefined + +export default function concatHeader(prev: Header, val: Header) { + if (!val) return prev + if (!prev) return val + + if (Array.isArray(prev)) return prev.concat(String(val)) + + prev = String(prev) + + if (Array.isArray(val)) return [prev].concat(val) + + return [prev, String(val)] +} diff --git a/packages/bigcommerce/src/api/utils/errors.ts b/packages/bigcommerce/src/api/utils/errors.ts new file mode 100644 index 0000000..77e2007 --- /dev/null +++ b/packages/bigcommerce/src/api/utils/errors.ts @@ -0,0 +1,25 @@ +import type { Response } from '@vercel/fetch' + +// Used for GraphQL errors +export class BigcommerceGraphQLError extends Error {} + +export class BigcommerceApiError extends Error { + status: number + res: Response + data: any + + constructor(msg: string, res: Response, data?: any) { + super(msg) + this.name = 'BigcommerceApiError' + this.status = res.status + this.res = res + this.data = data + } +} + +export class BigcommerceNetworkError extends Error { + constructor(msg: string) { + super(msg) + this.name = 'BigcommerceNetworkError' + } +} diff --git a/packages/bigcommerce/src/api/utils/fetch-graphql-api.ts b/packages/bigcommerce/src/api/utils/fetch-graphql-api.ts new file mode 100644 index 0000000..ad385fe --- /dev/null +++ b/packages/bigcommerce/src/api/utils/fetch-graphql-api.ts @@ -0,0 +1,36 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { GraphQLFetcher } from '@vercel/commerce/api' +import type { BigcommerceConfig } from '../index' +import fetch from './fetch' + +const fetchGraphqlApi: (getConfig: () => BigcommerceConfig) => GraphQLFetcher = + (getConfig) => + async (query: string, { variables, preview } = {}, fetchOptions) => { + // log.warn(query) + const config = getConfig() + 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 Bigcommerce API' }], + status: res.status, + }) + } + + return { data: json.data, res } + } + +export default fetchGraphqlApi diff --git a/packages/bigcommerce/src/api/utils/fetch-store-api.ts b/packages/bigcommerce/src/api/utils/fetch-store-api.ts new file mode 100644 index 0000000..a44e895 --- /dev/null +++ b/packages/bigcommerce/src/api/utils/fetch-store-api.ts @@ -0,0 +1,71 @@ +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?: FetchOptions): Promise => { + const config = getConfig() + let res: Response + + try { + res = await fetch(config.storeApiUrl + endpoint, { + ...options, + headers: { + ...options?.headers, + 'Content-Type': 'application/json', + 'X-Auth-Token': config.storeApiToken, + 'X-Auth-Client': config.storeApiClientId, + }, + }) + } catch (error: any) { + throw new BigcommerceNetworkError( + `Fetch to Bigcommerce failed: ${error.message}` + ) + } + + const contentType = res.headers.get('Content-Type') + const isJSON = contentType?.includes('application/json') + + if (!res.ok) { + const data = isJSON ? await res.json() : await getTextOrNull(res) + const headers = getRawHeaders(res) + const msg = `Big Commerce API error (${ + res.status + }) \nHeaders: ${JSON.stringify(headers, null, 2)}\n${ + typeof data === 'string' ? data : JSON.stringify(data, null, 2) + }` + + throw new BigcommerceApiError(msg, res, data) + } + + if (res.status !== 204 && !isJSON) { + throw new BigcommerceApiError( + `Fetch to Bigcommerce API failed, expected JSON content but found: ${contentType}`, + res + ) + } + + // If something was removed, the response will be empty + return res.status === 204 ? null : await res.json() + } +export default fetchStoreApi + +function getRawHeaders(res: Response) { + const headers: { [key: string]: string } = {} + + res.headers.forEach((value, key) => { + headers[key] = value + }) + + return headers +} + +function getTextOrNull(res: Response) { + try { + return res.text() + } catch (err) { + return null + } +} diff --git a/packages/bigcommerce/src/api/utils/fetch.ts b/packages/bigcommerce/src/api/utils/fetch.ts new file mode 100644 index 0000000..26f9ab6 --- /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/packages/bigcommerce/src/api/utils/filter-edges.ts b/packages/bigcommerce/src/api/utils/filter-edges.ts new file mode 100644 index 0000000..09cd206 --- /dev/null +++ b/packages/bigcommerce/src/api/utils/filter-edges.ts @@ -0,0 +1,5 @@ +export default function filterEdges( + edges: (T | null | undefined)[] | null | undefined +) { + return edges?.filter((edge): edge is T => !!edge) ?? [] +} diff --git a/packages/bigcommerce/src/api/utils/get-cart-cookie.ts b/packages/bigcommerce/src/api/utils/get-cart-cookie.ts new file mode 100644 index 0000000..7ca6cd5 --- /dev/null +++ b/packages/bigcommerce/src/api/utils/get-cart-cookie.ts @@ -0,0 +1,20 @@ +import { serialize, CookieSerializeOptions } from 'cookie' + +export default function getCartCookie( + name: string, + cartId?: string, + maxAge?: number +) { + const options: CookieSerializeOptions = + cartId && maxAge + ? { + maxAge, + expires: new Date(Date.now() + maxAge * 1000), + secure: process.env.NODE_ENV === 'production', + path: '/', + sameSite: 'lax', + } + : { maxAge: -1, path: '/' } // Removes the cookie + + return serialize(name, cartId || '', options) +} diff --git a/packages/bigcommerce/src/api/utils/get-customer-id.ts b/packages/bigcommerce/src/api/utils/get-customer-id.ts new file mode 100644 index 0000000..7344e01 --- /dev/null +++ b/packages/bigcommerce/src/api/utils/get-customer-id.ts @@ -0,0 +1,32 @@ +import type { GetCustomerIdQuery } from '../../../schema' +import type { BigcommerceConfig } from '../' + +export const getCustomerIdQuery = /* GraphQL */ ` + query getCustomerId { + customer { + entityId + } + } +` + +async function getCustomerId({ + customerToken, + config, +}: { + customerToken: string + config: BigcommerceConfig +}): Promise { + const { data } = await config.fetch( + getCustomerIdQuery, + undefined, + { + headers: { + cookie: `${config.customerCookie}=${customerToken}`, + }, + } + ) + + return String(data?.customer?.entityId) +} + +export default getCustomerId diff --git a/packages/bigcommerce/src/api/utils/parse-item.ts b/packages/bigcommerce/src/api/utils/parse-item.ts new file mode 100644 index 0000000..bb59a6e --- /dev/null +++ b/packages/bigcommerce/src/api/utils/parse-item.ts @@ -0,0 +1,28 @@ +import type { WishlistItemBody } from '../../types/wishlist' +import type { CartItemBody, OptionSelections } from '../../types/cart' + +type BCWishlistItemBody = { + product_id: number + variant_id: number +} + +type BCCartItemBody = { + product_id: number + variant_id: number + quantity?: number + option_selections?: OptionSelections[] +} + +export const parseWishlistItem = ( + item: WishlistItemBody +): BCWishlistItemBody => ({ + product_id: Number(item.productId), + variant_id: Number(item.variantId), +}) + +export const parseCartItem = (item: CartItemBody): BCCartItemBody => ({ + quantity: item.quantity, + product_id: Number(item.productId), + variant_id: Number(item.variantId), + option_selections: item.optionSelections, +}) diff --git a/packages/bigcommerce/src/api/utils/set-product-locale-meta.ts b/packages/bigcommerce/src/api/utils/set-product-locale-meta.ts new file mode 100644 index 0000000..7672864 --- /dev/null +++ b/packages/bigcommerce/src/api/utils/set-product-locale-meta.ts @@ -0,0 +1,21 @@ +import type { ProductNode } from '../operations/get-all-products' +import type { RecursivePartial } from './types' + +export default function setProductLocaleMeta( + node: RecursivePartial +) { + if (node.localeMeta?.edges) { + node.localeMeta.edges = node.localeMeta.edges.filter((edge) => { + const { key, value } = edge?.node ?? {} + if (key && key in node) { + ;(node as any)[key] = value + return false + } + return true + }) + + if (!node.localeMeta.edges.length) { + delete node.localeMeta + } + } +} diff --git a/packages/bigcommerce/src/api/utils/types.ts b/packages/bigcommerce/src/api/utils/types.ts new file mode 100644 index 0000000..56f9c17 --- /dev/null +++ b/packages/bigcommerce/src/api/utils/types.ts @@ -0,0 +1,7 @@ +export type RecursivePartial = { + [P in keyof T]?: RecursivePartial +} + +export type RecursiveRequired = { + [P in keyof T]-?: RecursiveRequired +} diff --git a/packages/bigcommerce/src/auth/index.ts b/packages/bigcommerce/src/auth/index.ts new file mode 100644 index 0000000..36e757a --- /dev/null +++ b/packages/bigcommerce/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/bigcommerce/src/auth/use-login.tsx b/packages/bigcommerce/src/auth/use-login.tsx new file mode 100644 index 0000000..a71f159 --- /dev/null +++ b/packages/bigcommerce/src/auth/use-login.tsx @@ -0,0 +1,41 @@ +import { useCallback } from 'react' +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' + +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() + + return useCallback( + async function login(input) { + const data = await fetch({ input }) + await mutate() + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/bigcommerce/src/auth/use-logout.tsx b/packages/bigcommerce/src/auth/use-logout.tsx new file mode 100644 index 0000000..bc5c3a4 --- /dev/null +++ b/packages/bigcommerce/src/auth/use-logout.tsx @@ -0,0 +1,28 @@ +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' + +export default useLogout as UseLogout + +export const handler: MutationHook = { + fetchOptions: { + url: '/api/logout', + method: 'GET', + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCustomer() + + return useCallback( + async function logout() { + const data = await fetch() + await mutate(null, false) + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/bigcommerce/src/auth/use-signup.tsx b/packages/bigcommerce/src/auth/use-signup.tsx new file mode 100644 index 0000000..b06126d --- /dev/null +++ b/packages/bigcommerce/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/packages/bigcommerce/src/cart/index.ts b/packages/bigcommerce/src/cart/index.ts new file mode 100644 index 0000000..3b8ba99 --- /dev/null +++ b/packages/bigcommerce/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/bigcommerce/src/cart/use-add-item.tsx b/packages/bigcommerce/src/cart/use-add-item.tsx new file mode 100644 index 0000000..f65e82b --- /dev/null +++ b/packages/bigcommerce/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/bigcommerce/src/cart/use-cart.tsx b/packages/bigcommerce/src/cart/use-cart.tsx new file mode 100644 index 0000000..f8c4691 --- /dev/null +++ b/packages/bigcommerce/src/cart/use-cart.tsx @@ -0,0 +1,33 @@ +import { useMemo } from 'react' +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 = { + fetchOptions: { + url: '/api/cart', + method: 'GET', + }, + 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/bigcommerce/src/cart/use-remove-item.tsx b/packages/bigcommerce/src/cart/use-remove-item.tsx new file mode 100644 index 0000000..8bea34f --- /dev/null +++ b/packages/bigcommerce/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/bigcommerce/src/cart/use-update-item.tsx b/packages/bigcommerce/src/cart/use-update-item.tsx new file mode 100644 index 0000000..b15690e --- /dev/null +++ b/packages/bigcommerce/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/bigcommerce/src/checkout/use-checkout.tsx b/packages/bigcommerce/src/checkout/use-checkout.tsx new file mode 100644 index 0000000..cab52bb --- /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/packages/bigcommerce/src/commerce.config.json b/packages/bigcommerce/src/commerce.config.json new file mode 100644 index 0000000..89ce562 --- /dev/null +++ b/packages/bigcommerce/src/commerce.config.json @@ -0,0 +1,7 @@ +{ + "provider": "bigcommerce", + "features": { + "wishlist": true, + "customerAuth": true + } +} 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 0000000..fabd11b --- /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 0000000..938e6cd --- /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/packages/bigcommerce/src/customer/index.ts b/packages/bigcommerce/src/customer/index.ts new file mode 100644 index 0000000..6c903ec --- /dev/null +++ b/packages/bigcommerce/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/packages/bigcommerce/src/customer/use-customer.tsx b/packages/bigcommerce/src/customer/use-customer.tsx new file mode 100644 index 0000000..36bf886 --- /dev/null +++ b/packages/bigcommerce/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/bigcommerce/src/fetcher.ts b/packages/bigcommerce/src/fetcher.ts new file mode 100644 index 0000000..bc8a6b9 --- /dev/null +++ b/packages/bigcommerce/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/bigcommerce/src/index.tsx b/packages/bigcommerce/src/index.tsx new file mode 100644 index 0000000..a7de609 --- /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/packages/bigcommerce/src/lib/get-slug.ts b/packages/bigcommerce/src/lib/get-slug.ts new file mode 100644 index 0000000..329c5a2 --- /dev/null +++ b/packages/bigcommerce/src/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/packages/bigcommerce/src/lib/immutability.ts b/packages/bigcommerce/src/lib/immutability.ts new file mode 100644 index 0000000..488d357 --- /dev/null +++ b/packages/bigcommerce/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/bigcommerce/src/lib/normalize.ts b/packages/bigcommerce/src/lib/normalize.ts new file mode 100644 index 0000000..059e3f8 --- /dev/null +++ b/packages/bigcommerce/src/lib/normalize.ts @@ -0,0 +1,136 @@ +import type { Product } from '../types/product' +import type { Cart, BigcommerceCart, LineItem } from '../types/cart' +import type { Page } from '../types/page' +import type { BCCategory, Category } from '../types/site' +import { definitions } from '../api/definitions/store-content' +import update from './immutability' +import getSlug from './get-slug' + +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): Product { + const { + entityId: id, + productOptions, + prices, + path, + id: _, + options: _0, + } = productNode + + return update(productNode, { + id: { $set: String(id) }, + images: { + $apply: ({ edges }: any) => + edges?.map(({ node: { urlOriginal, altText, ...rest } }: any) => ({ + url: urlOriginal, + alt: altText, + ...rest, + })), + }, + variants: { + $apply: ({ edges }: any) => + edges?.map(({ node: { entityId, productOptions, ...rest } }: any) => ({ + id: entityId, + options: productOptions?.edges + ? productOptions.edges.map(normalizeProductOption) + : [], + ...rest, + })), + }, + options: { + $set: productOptions.edges + ? productOptions?.edges.map(normalizeProductOption) + : [], + }, + brand: { + $apply: (brand: any) => (brand?.entityId ? brand?.entityId : null), + }, + slug: { + $set: path?.replace(/^\/+|\/+$/g, ''), + }, + price: { + $set: { + value: prices?.price.value, + currencyCode: prices?.price.currencyCode, + }, + }, + $unset: ['entityId'], + }) +} + +export function normalizePage(page: definitions['page_Full']): Page { + return { + id: String(page.id), + name: page.name, + is_visible: page.is_visible, + sort_order: page.sort_order, + body: page.body, + } +} + +export function normalizeCart(data: BigcommerceCart): Cart { + return { + id: data.id, + customerId: String(data.customer_id), + email: data.email, + createdAt: data.created_time, + currency: data.currency, + taxesIncluded: data.tax_included, + 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, + discounts: data.discounts?.map((discount) => ({ + value: discount.discounted_amount, + })), + } +} + +function normalizeLineItem(item: any): LineItem { + return { + id: item.id, + variantId: String(item.variant_id), + productId: String(item.product_id), + name: item.name, + quantity: item.quantity, + variant: { + id: String(item.variant_id), + sku: item.sku, + name: item.name, + image: { + url: item.image_url, + }, + requiresShipping: item.is_require_shipping, + 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, + })), + } +} + +export function normalizeCategory(category: BCCategory): Category { + return { + id: `${category.entityId}`, + name: category.name, + slug: getSlug(category.path), + path: category.path, + } +} diff --git a/packages/bigcommerce/src/next.config.cjs b/packages/bigcommerce/src/next.config.cjs new file mode 100644 index 0000000..f33b166 --- /dev/null +++ b/packages/bigcommerce/src/next.config.cjs @@ -0,0 +1,8 @@ +const commerce = require('./commerce.config.json') + +module.exports = { + commerce, + images: { + domains: ['cdn11.bigcommerce.com'], + }, +} diff --git a/packages/bigcommerce/src/product/index.ts b/packages/bigcommerce/src/product/index.ts new file mode 100644 index 0000000..426a3ed --- /dev/null +++ b/packages/bigcommerce/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/bigcommerce/src/product/use-price.tsx b/packages/bigcommerce/src/product/use-price.tsx new file mode 100644 index 0000000..fd42d70 --- /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/packages/bigcommerce/src/product/use-search.tsx b/packages/bigcommerce/src/product/use-search.tsx new file mode 100644 index 0000000..fd918e3 --- /dev/null +++ b/packages/bigcommerce/src/product/use-search.tsx @@ -0,0 +1,52 @@ +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 + +export type SearchProductsInput = { + search?: string + categoryId?: number | string + brandId?: number + sort?: string + locale?: string +} + +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', 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/bigcommerce/src/provider.ts b/packages/bigcommerce/src/provider.ts new file mode 100644 index 0000000..1968554 --- /dev/null +++ b/packages/bigcommerce/src/provider.ts @@ -0,0 +1,34 @@ +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 useWishlist } from './wishlist/use-wishlist' +import { handler as useWishlistAddItem } from './wishlist/use-add-item' +import { handler as useWishlistRemoveItem } from './wishlist/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 fetcher from './fetcher' + +export const bigcommerceProvider = { + locale: 'en-us', + cartCookie: 'bc_cartId', + fetcher, + cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, + wishlist: { + useWishlist, + useAddItem: useWishlistAddItem, + useRemoveItem: useWishlistRemoveItem, + }, + customer: { useCustomer }, + products: { useSearch }, + auth: { useLogin, useLogout, useSignup }, +} + +export type BigcommerceProvider = typeof bigcommerceProvider diff --git a/packages/bigcommerce/src/types/cart.ts b/packages/bigcommerce/src/types/cart.ts new file mode 100644 index 0000000..3b5d828 --- /dev/null +++ b/packages/bigcommerce/src/types/cart.ts @@ -0,0 +1,66 @@ +import * as Core from '@vercel/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 +export type BigcommerceCart = { + id: string + parent_id?: string + customer_id: number + email: string + currency: { code: string } + tax_included: boolean + base_amount: number + discount_amount: number + cart_amount: number + line_items: { + custom_items: any[] + digital_items: any[] + gift_certificates: any[] + physical_items: any[] + } + created_time: string + discounts?: { id: number; discounted_amount: number }[] + // TODO: add missing fields +} + +/** + * Extend core cart types + */ + +export type Cart = Core.Cart & { + lineItems: Core.LineItem[] +} + +export type OptionSelections = { + option_id: number + option_value: number | string +} + +export type CartItemBody = Core.CartItemBody & { + productId: string // The product id is always required for BC + optionSelections?: OptionSelections[] +} + +export type CartTypes = { + cart: Cart + item: Core.LineItem + itemBody: CartItemBody +} + +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/bigcommerce/src/types/checkout.ts b/packages/bigcommerce/src/types/checkout.ts new file mode 100644 index 0000000..d139db6 --- /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 0000000..23b8daa --- /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 0000000..6e66366 --- /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/packages/bigcommerce/src/types/index.ts b/packages/bigcommerce/src/types/index.ts new file mode 100644 index 0000000..7ab0b7f --- /dev/null +++ b/packages/bigcommerce/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/bigcommerce/src/types/login.ts b/packages/bigcommerce/src/types/login.ts new file mode 100644 index 0000000..eff27ca --- /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 0000000..1de06f8 --- /dev/null +++ b/packages/bigcommerce/src/types/logout.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/logout' diff --git a/packages/bigcommerce/src/types/page.ts b/packages/bigcommerce/src/types/page.ts new file mode 100644 index 0000000..ccbc29f --- /dev/null +++ b/packages/bigcommerce/src/types/page.ts @@ -0,0 +1,11 @@ +import * as Core from '@vercel/commerce/types/page' +export * from '@vercel/commerce/types/page' + +export type Page = Core.Page + +export type PageTypes = { + page: Page +} + +export type GetAllPagesOperation = Core.GetAllPagesOperation +export type GetPageOperation = Core.GetPageOperation diff --git a/packages/bigcommerce/src/types/product.ts b/packages/bigcommerce/src/types/product.ts new file mode 100644 index 0000000..72ca02f --- /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 0000000..3f0d1af --- /dev/null +++ b/packages/bigcommerce/src/types/signup.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/signup' diff --git a/packages/bigcommerce/src/types/site.ts b/packages/bigcommerce/src/types/site.ts new file mode 100644 index 0000000..5c3074c --- /dev/null +++ b/packages/bigcommerce/src/types/site.ts @@ -0,0 +1,19 @@ +import * as Core from '@vercel/commerce/types/site' +import type { GetSiteInfoQuery, GetSiteInfoQueryVariables } from '../../schema' + +export * from '@vercel/commerce/types/site' + +export type BCCategory = NonNullable< + GetSiteInfoQuery['site']['categoryTree'] +>[0] + +export type Brand = NonNullable< + NonNullable[0] +> + +export type SiteTypes = { + category: Core.Category + brand: Brand +} + +export type GetSiteInfoOperation = Core.GetSiteInfoOperation diff --git a/packages/bigcommerce/src/types/wishlist.ts b/packages/bigcommerce/src/types/wishlist.ts new file mode 100644 index 0000000..67cf58c --- /dev/null +++ b/packages/bigcommerce/src/types/wishlist.ts @@ -0,0 +1,24 @@ +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 '@vercel/commerce/types/wishlist' + +export type WishlistItem = NonNullable< + definitions['wishlist_Full']['items'] +>[0] & { + product?: ProductEdge['node'] +} + +export type Wishlist = Omit & { + items?: WishlistItem[] +} + +export type WishlistTypes = { + wishlist: Wishlist + itemBody: Core.WishlistItemBody +} + +export type WishlistSchema = Core.WishlistSchema +export type GetCustomerWishlistOperation = + Core.GetCustomerWishlistOperation diff --git a/packages/bigcommerce/src/wishlist/index.ts b/packages/bigcommerce/src/wishlist/index.ts new file mode 100644 index 0000000..241af3c --- /dev/null +++ b/packages/bigcommerce/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/bigcommerce/src/wishlist/use-add-item.tsx b/packages/bigcommerce/src/wishlist/use-add-item.tsx new file mode 100644 index 0000000..c9e237b --- /dev/null +++ b/packages/bigcommerce/src/wishlist/use-add-item.tsx @@ -0,0 +1,39 @@ +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 '../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/bigcommerce/src/wishlist/use-remove-item.tsx b/packages/bigcommerce/src/wishlist/use-remove-item.tsx new file mode 100644 index 0000000..40ca0da --- /dev/null +++ b/packages/bigcommerce/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 '../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/bigcommerce/src/wishlist/use-wishlist.tsx b/packages/bigcommerce/src/wishlist/use-wishlist.tsx new file mode 100644 index 0000000..7882233 --- /dev/null +++ b/packages/bigcommerce/src/wishlist/use-wishlist.tsx @@ -0,0 +1,57 @@ +import { useMemo } from 'react' +import { SWRHook } from '@vercel/commerce/utils/types' +import useWishlist, { + UseWishlist, +} from '@vercel/commerce/wishlist/use-wishlist' +import useCustomer from '../customer/use-customer' + +import type { GetWishlistHook } from '../types/wishlist' + +export default useWishlist as UseWishlist +export const handler: SWRHook = { + fetchOptions: { + url: '/api/wishlist', + method: 'GET', + }, + async 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') + + return fetch({ + url: url.pathname + url.search, + method: options.method, + }) + }, + useHook: + ({ useData }) => + (input) => { + const { data: customer } = useCustomer() + const response = useData({ + input: [ + ['customerId', customer?.entityId], + ['includeProducts', input?.includeProducts], + ], + swrOptions: { + revalidateOnFocus: false, + ...input?.swrOptions, + }, + }) + + return useMemo( + () => + Object.create(response, { + isEmpty: { + get() { + return (response.data?.items?.length || 0) <= 0 + }, + enumerable: true, + }, + }), + [response] + ) + }, +} diff --git a/packages/bigcommerce/taskfile.js b/packages/bigcommerce/taskfile.js new file mode 100644 index 0000000..39b1b2a --- /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 0000000..cd04ab2 --- /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 0000000..f06235c --- /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 0000000..e1076ed --- /dev/null +++ b/packages/commerce/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/commerce/README.md b/packages/commerce/README.md new file mode 100644 index 0000000..ecdebb8 --- /dev/null +++ b/packages/commerce/README.md @@ -0,0 +1,334 @@ +# Commerce Framework + +- [Commerce Framework](#commerce-framework) + - [Commerce Hooks](#commerce-hooks) + - [CommerceProvider](#commerceprovider) + - [Authentication Hooks](#authentication-hooks) + - [useSignup](#usesignup) + - [useLogin](#uselogin) + - [useLogout](#uselogout) + - [Customer Hooks](#customer-hooks) + - [useCustomer](#usecustomer) + - [Product Hooks](#product-hooks) + - [usePrice](#useprice) + - [useSearch](#usesearch) + - [Cart Hooks](#cart-hooks) + - [useCart](#usecart) + - [useAddItem](#useadditem) + - [useUpdateItem](#useupdateitem) + - [useRemoveItem](#useremoveitem) + - [Wishlist Hooks](#wishlist-hooks) + - [Commerce API](#commerce-api) + - [More](#more) + +The commerce framework ships multiple hooks and a Node.js API, both using an underlying headless e-commerce platform, which we call commerce providers. + +The core features are: + +- Code splitted hooks for data fetching using [SWR](https://swr.vercel.app/), and to handle common user actions +- A Node.js API for initial data population, static generation of content and for creating the API endpoints that connect to the hooks, if required. + +> 👩‍🔬 If you would like to contribute a new provider, check the docs for [Adding a new Commerce Provider](./new-provider.md). + +> 🚧 The core commerce framework is under active development, new features and updates will be continuously added over time. Breaking changes are expected while we finish the API. + +## Commerce Hooks + +A commerce hook is a [React hook](https://reactjs.org/docs/hooks-intro.html) that's connected to a commerce provider. They focus on user actions and data fetching of data that wasn't statically generated. + +Data fetching hooks use [SWR](https://swr.vercel.app/) underneath and you're welcome to use any of its [return values](https://swr.vercel.app/docs/options#return-values) and [options](https://swr.vercel.app/docs/options#options). For example, using the `useCustomer` hook: + +```jsx +const { data, isLoading, error } = useCustomer({ + swrOptions: { + revalidateOnFocus: true, + }, +}) +``` + +### CommerceProvider + +This component adds the provider config and handlers to the context of your React tree for it's children. You can optionally pass the `locale` to it: + +```jsx +import { CommerceProvider } from '@framework' + +const App = ({ locale = 'en-US', children }) => { + return {children} +} +``` + +## Authentication Hooks + +### useSignup + +Returns a _signup_ function that can be used to sign up the current visitor: + +```jsx +import useSignup from '@framework/auth/use-signup' + +const SignupView = () => { + const signup = useSignup() + + const handleSignup = async () => { + await signup({ + email, + firstName, + lastName, + password, + }) + } + + return

{children}
+} +``` + +### useLogin + +Returns a _login_ function that can be used to sign in the current visitor into an existing customer: + +```jsx +import useLogin from '@framework/auth/use-login' + +const LoginView = () => { + const login = useLogin() + const handleLogin = async () => { + await login({ + email, + password, + }) + } + + return
{children}
+} +``` + +### useLogout + +Returns a _logout_ function that signs out the current customer when called. + +```jsx +import useLogout from '@framework/auth/use-logout' + +const LogoutButton = () => { + const logout = useLogout() + return ( + + ) +} +``` + +## Customer Hooks + +### useCustomer + +Fetches and returns the data of the signed in customer: + +```jsx +import useCustomer from '@framework/customer/use-customer' + +const Profile = () => { + const { data, isLoading, error } = useCustomer() + + if (isLoading) return

Loading...

+ if (error) return

{error.message}

+ if (!data) return null + + return
Hello, {data.firstName}
+} +``` + +## Product Hooks + +### usePrice + +Helper hook to format price according to the commerce locale and currency code. It also handles discounts: + +```jsx +import useCart from '@framework/cart/use-cart' +import usePrice from '@framework/product/use-price' + +// ... +const { data } = useCart() +const { price, discount, basePrice } = usePrice( + data && { + amount: data.subtotalPrice, + currencyCode: data.currency.code, + // If `baseAmount` is used, a discount will be calculated + // baseAmount: number, + } +) +// ... +``` + +### useSearch + +Fetches and returns the products that match a set of filters: + +```jsx +import useSearch from '@framework/product/use-search' + +const SearchPage = ({ searchString, category, brand, sortStr }) => { + const { data } = useSearch({ + search: searchString || '', + categoryId: category?.entityId, + brandId: brand?.entityId, + sort: sortStr, + }) + + return ( + + {data.products.map((product) => ( + + ))} + + ) +} +``` + +## Cart Hooks + +### useCart + +Fetches and returns the data of the current cart: + +```jsx +import useCart from '@framework/cart/use-cart' + +const CartTotal = () => { + const { data, isLoading, isEmpty, error } = useCart() + + if (isLoading) return

Loading...

+ if (error) return

{error.message}

+ if (isEmpty) return

The cart is empty

+ + return

The cart total is {data.totalPrice}

+} +``` + +### useAddItem + +Returns a function that adds a new item to the cart when called, if this is the first item it will create the cart: + +```jsx +import { useAddItem } from '@framework/cart' + +const AddToCartButton = ({ productId, variantId }) => { + const addItem = useAddItem() + + const addToCart = async () => { + await addItem({ + productId, + variantId, + }) + } + + return +} +``` + +### useUpdateItem + +Returns a function that updates a current item in the cart when called, usually the quantity. + +```jsx +import { useUpdateItem } from '@framework/cart' + +const CartItemQuantity = ({ item }) => { + const [quantity, setQuantity] = useState(item.quantity) + const updateItem = useUpdateItem({ item }) + + const updateQuantity = async (e) => { + const val = e.target.value + + setQuantity(val) + await updateItem({ quantity: val }) + } + + return ( + + ) +} +``` + +If the `quantity` is lower than 1 the item will be removed from the cart. + +### useRemoveItem + +Returns a function that removes an item in the cart when called: + +```jsx +import { useRemoveItem } from '@framework/cart' + +const RemoveButton = ({ item }) => { + const removeItem = useRemoveItem() + const handleRemove = async () => { + await removeItem(item) + } + + return +} +``` + +## Wishlist Hooks + +Wishlist hooks work just like [cart hooks](#cart-hooks). Feel free to check how those work first. + +The example below shows how to use the `useWishlist`, `useAddItem` and `useRemoveItem` hooks: + +```jsx +import { useWishlist, useAddItem, useRemoveItem } from '@framework/wishlist' + +const WishlistButton = ({ productId, variant }) => { + const addItem = useAddItem() + const removeItem = useRemoveItem() + const { data, isLoading, isEmpty, error } = useWishlist() + + if (isLoading) return

Loading...

+ if (error) return

{error.message}

+ if (isEmpty) return

The wihslist is empty

+ + const { data: customer } = useCustomer() + const itemInWishlist = data?.items?.find( + (item) => item.product_id === productId && item.variant_id === variant.id + ) + + const handleWishlistChange = async (e) => { + e.preventDefault() + if (!customer) return + + if (itemInWishlist) { + await removeItem({ id: itemInWishlist.id }) + } else { + await addItem({ + productId, + variantId: variant.id, + }) + } + } + + return ( + + ) +} +``` + +## Commerce API + +While commerce hooks focus on client side data fetching and interactions, the commerce API focuses on static content generation for pages and API endpoints in a Node.js context. + +> 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. + +## More + +Feel free to read through the source for more usage, and check the commerce vercel demo and commerce repo for usage examples: ([demo.vercel.store](https://demo.vercel.store/)) ([repo](https://github.com/vercel/commerce)) diff --git a/packages/commerce/fixup.mjs b/packages/commerce/fixup.mjs new file mode 100644 index 0000000..b276f5c --- /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/packages/commerce/new-provider.md b/packages/commerce/new-provider.md new file mode 100644 index 0000000..c750761 --- /dev/null +++ b/packages/commerce/new-provider.md @@ -0,0 +1,237 @@ +# 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: + +- 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)) +- SFCC - SalesForce Cloud Commerce ([packages/sfcc](../sfcc)) + +Adding a commerce provider means adding a new folder in `packages` with a folder structure like the next one: + +- `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` +- `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 (`packages/commerce`), but all providers are interchangeable and to achieve it every provider always has to implement the core types and helpers. + +## 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 { 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() +``` + +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: + +```tsx +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 useWishlist } from './wishlist/use-wishlist' +import { handler as useWishlistAddItem } from './wishlist/use-add-item' +import { handler as useWishlistRemoveItem } from './wishlist/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 fetcher from './fetcher' + +export const bigcommerceProvider = { + locale: 'en-us', + cartCookie: 'bc_cartId', + fetcher, + cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, + wishlist: { + useWishlist, + useAddItem: useWishlistAddItem, + useRemoveItem: useWishlistRemoveItem, + }, + customer: { useCustomer }, + products: { useSearch }, + auth: { useLogin, useLogout, useSignup }, +} + +export type BigcommerceProvider = typeof bigcommerceProvider +``` + +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 '@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 = { + fetchOptions: { + url: '/api/cart', + method: 'GET', + }, + 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] + ) + }, +} +``` + +In the case of data fetching hooks like `useCart` each handler has to implement the `SWRHook` type that's defined in the core types. For mutations it's the `MutationHook`, e.g for `useAddItem`: + +```tsx +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] + ) + }, +} +``` + +## 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. + +**Status** + +* [ ] 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 0000000..17343a8 --- /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/packages/commerce/src/api/endpoints/cart.ts b/packages/commerce/src/api/endpoints/cart.ts new file mode 100644 index 0000000..abd5df4 --- /dev/null +++ b/packages/commerce/src/api/endpoints/cart.ts @@ -0,0 +1,60 @@ +import type { CartSchema } from '../../types/cart' +import { CommerceAPIError } from '../utils/errors' +import isAllowedOperation from '../utils/is-allowed-operation' +import type { GetAPISchema } from '..' + +const cartEndpoint: GetAPISchema>['endpoint']['handler'] = + async (ctx) => { + const { req, res, handlers, config } = ctx + + if ( + !isAllowedOperation(req, res, { + GET: handlers['getCart'], + POST: handlers['addItem'], + PUT: handlers['updateItem'], + DELETE: handlers['removeItem'], + }) + ) { + return + } + + const { cookies } = req + const cartId = cookies[config.cartCookie] + + try { + // Return current cart info + if (req.method === 'GET') { + const body = { cartId } + return await handlers['getCart']({ ...ctx, body }) + } + + // Create or add an item to the cart + if (req.method === 'POST') { + const body = { ...req.body, cartId } + return await handlers['addItem']({ ...ctx, body }) + } + + // Update item in cart + if (req.method === 'PUT') { + const body = { ...req.body, cartId } + return await handlers['updateItem']({ ...ctx, body }) + } + + // Remove an item from the cart + 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 cartEndpoint diff --git a/packages/commerce/src/api/endpoints/catalog/products.ts b/packages/commerce/src/api/endpoints/catalog/products.ts new file mode 100644 index 0000000..d2a4794 --- /dev/null +++ b/packages/commerce/src/api/endpoints/catalog/products.ts @@ -0,0 +1,31 @@ +import type { ProductsSchema } from '../../../types/product' +import { CommerceAPIError } from '../../utils/errors' +import isAllowedOperation from '../../utils/is-allowed-operation' +import type { GetAPISchema } from '../..' + +const productsEndpoint: GetAPISchema< + any, + ProductsSchema +>['endpoint']['handler'] = async (ctx) => { + const { req, res, handlers } = ctx + + if (!isAllowedOperation(req, res, { GET: handlers['getProducts'] })) { + return + } + + try { + const body = req.query + return await handlers['getProducts']({ ...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 productsEndpoint diff --git a/packages/commerce/src/api/endpoints/checkout.ts b/packages/commerce/src/api/endpoints/checkout.ts new file mode 100644 index 0000000..0168e70 --- /dev/null +++ b/packages/commerce/src/api/endpoints/checkout.ts @@ -0,0 +1,49 @@ +import type { CheckoutSchema } from '../../types/checkout' +import type { GetAPISchema } from '..' + +import { CommerceAPIError } from '../utils/errors' +import isAllowedOperation from '../utils/is-allowed-operation' + +const checkoutEndpoint: GetAPISchema< + any, + CheckoutSchema +>['endpoint']['handler'] = async (ctx) => { + const { req, res, handlers, config } = ctx + + if ( + !isAllowedOperation(req, res, { + GET: handlers['getCheckout'], + POST: handlers['submitCheckout'], + }) + ) { + return + } + + const { cookies } = req + const cartId = cookies[config.cartCookie] + + try { + // 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) + + 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 checkoutEndpoint 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 0000000..d5ede69 --- /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 0000000..ad268cb --- /dev/null +++ b/packages/commerce/src/api/endpoints/customer/card.ts @@ -0,0 +1,65 @@ +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/packages/commerce/src/api/endpoints/customer/index.ts b/packages/commerce/src/api/endpoints/customer/index.ts new file mode 100644 index 0000000..eb2a048 --- /dev/null +++ b/packages/commerce/src/api/endpoints/customer/index.ts @@ -0,0 +1,36 @@ +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, + CustomerSchema +>['endpoint']['handler'] = async (ctx) => { + const { req, res, handlers } = ctx + + if ( + !isAllowedOperation(req, res, { + GET: handlers['getLoggedInCustomer'], + }) + ) { + return + } + + try { + const body = null + return await handlers['getLoggedInCustomer']({ ...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 customerEndpoint diff --git a/packages/commerce/src/api/endpoints/login.ts b/packages/commerce/src/api/endpoints/login.ts new file mode 100644 index 0000000..6f69629 --- /dev/null +++ b/packages/commerce/src/api/endpoints/login.ts @@ -0,0 +1,36 @@ +import type { LoginSchema } from '../../types/login' +import { CommerceAPIError } from '../utils/errors' +import isAllowedOperation from '../utils/is-allowed-operation' +import type { GetAPISchema } from '..' + +const loginEndpoint: GetAPISchema< + any, + LoginSchema +>['endpoint']['handler'] = async (ctx) => { + const { req, res, handlers } = ctx + + if ( + !isAllowedOperation(req, res, { + POST: handlers['login'], + GET: handlers['login'], + }) + ) { + return + } + + try { + const body = req.body ?? {} + return await handlers['login']({ ...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 loginEndpoint diff --git a/packages/commerce/src/api/endpoints/logout.ts b/packages/commerce/src/api/endpoints/logout.ts new file mode 100644 index 0000000..c2640ea --- /dev/null +++ b/packages/commerce/src/api/endpoints/logout.ts @@ -0,0 +1,35 @@ +import type { LogoutSchema } from '../../types/logout' +import { CommerceAPIError } from '../utils/errors' +import isAllowedOperation from '../utils/is-allowed-operation' +import type { GetAPISchema } from '..' + +const logoutEndpoint: GetAPISchema['endpoint']['handler'] = + async (ctx) => { + const { req, res, handlers } = ctx + + if ( + !isAllowedOperation(req, res, { + GET: handlers['logout'], + }) + ) { + return + } + + try { + const redirectTo = req.query.redirect_to + const body = typeof redirectTo === 'string' ? { redirectTo } : {} + + return await handlers['logout']({ ...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 logoutEndpoint diff --git a/packages/commerce/src/api/endpoints/signup.ts b/packages/commerce/src/api/endpoints/signup.ts new file mode 100644 index 0000000..78c4cf5 --- /dev/null +++ b/packages/commerce/src/api/endpoints/signup.ts @@ -0,0 +1,36 @@ +import type { SignupSchema } from '../../types/signup' +import { CommerceAPIError } from '../utils/errors' +import isAllowedOperation from '../utils/is-allowed-operation' +import type { GetAPISchema } from '..' + +const signupEndpoint: GetAPISchema['endpoint']['handler'] = + async (ctx) => { + const { req, res, handlers, config } = ctx + + if ( + !isAllowedOperation(req, res, { + POST: handlers['signup'], + }) + ) { + return + } + + const { cookies } = req + const cartId = cookies[config.cartCookie] + + try { + const body = { ...req.body, cartId } + return await handlers['signup']({ ...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 signupEndpoint diff --git a/packages/commerce/src/api/endpoints/wishlist.ts b/packages/commerce/src/api/endpoints/wishlist.ts new file mode 100644 index 0000000..233ac52 --- /dev/null +++ b/packages/commerce/src/api/endpoints/wishlist.ts @@ -0,0 +1,58 @@ +import type { WishlistSchema } from '../../types/wishlist' +import { CommerceAPIError } from '../utils/errors' +import isAllowedOperation from '../utils/is-allowed-operation' +import type { GetAPISchema } from '..' + +const wishlistEndpoint: GetAPISchema< + any, + WishlistSchema +>['endpoint']['handler'] = async (ctx) => { + const { req, res, handlers, config } = ctx + + if ( + !isAllowedOperation(req, res, { + GET: handlers['getWishlist'], + POST: handlers['addItem'], + DELETE: handlers['removeItem'], + }) + ) { + return + } + + const { cookies } = req + const customerToken = cookies[config.customerCookie] + + try { + // Return current wishlist info + if (req.method === 'GET') { + const body = { + customerToken, + includeProducts: req.query.products === '1', + } + return await handlers['getWishlist']({ ...ctx, body }) + } + + // Add an item to the wishlist + if (req.method === 'POST') { + const body = { ...req.body, customerToken } + return await handlers['addItem']({ ...ctx, body }) + } + + // Remove an item from the wishlist + if (req.method === 'DELETE') { + const body = { ...req.body, customerToken } + 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 wishlistEndpoint diff --git a/packages/commerce/src/api/index.ts b/packages/commerce/src/api/index.ts new file mode 100644 index 0000000..6914b93 --- /dev/null +++ b/packages/commerce/src/api/index.ts @@ -0,0 +1,184 @@ +import type { NextApiHandler } from 'next' +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' +import type { LoginSchema } from '../types/login' +import type { LogoutSchema } from '../types/logout' +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, + AllOperations, + APIOperations, +} from './operations' + +export type APISchemas = + | CartSchema + | CustomerSchema + | LoginSchema + | LogoutSchema + | SignupSchema + | ProductsSchema + | WishlistSchema + | CheckoutSchema + | CustomerCardSchema + | CustomerAddressSchema + +export type GetAPISchema< + C extends CommerceAPI, + S extends APISchemas = APISchemas +> = { + schema: S + endpoint: EndpointContext +} + +export type EndpointContext< + C extends CommerceAPI, + E extends EndpointSchemaBase +> = { + handler: Endpoint + handlers: EndpointHandlers +} + +export type EndpointSchemaBase = { + options: {} + handlers: { + [k: string]: { data?: any; body?: any } + } +} + +export type Endpoint< + C extends CommerceAPI, + E extends EndpointSchemaBase +> = APIEndpoint, any, E['options']> + +export type EndpointHandlers< + C extends CommerceAPI, + E extends EndpointSchemaBase +> = { + [H in keyof E['handlers']]: APIHandler< + C, + EndpointHandlers, + NonNullable['data'], + NonNullable['body'], + E['options'] + > +} + +export type APIProvider = { + config: CommerceAPIConfig + operations: APIOperations +} + +export type CommerceAPI

= + CommerceAPICore

& AllOperations

+ +export class CommerceAPICore

{ + constructor(readonly provider: P) {} + + getConfig(userConfig: Partial = {}): P['config'] { + return Object.entries(userConfig).reduce( + (cfg, [key, value]) => Object.assign(cfg, { [key]: value }), + { ...this.provider.config } + ) + } + + setConfig(newConfig: Partial) { + Object.assign(this.provider.config, newConfig) + } +} + +export function getCommerceApi

( + customProvider: P +): CommerceAPI

{ + const commerce = Object.assign( + new CommerceAPICore(customProvider), + defaultOperations as AllOperations

+ ) + const ops = customProvider.operations + + OPERATIONS.forEach((k) => { + const op = ops[k] + if (op) { + commerce[k] = op({ commerce }) as AllOperations

[typeof k] + } + }) + + return commerce +} + +export function getEndpoint< + P extends APIProvider, + T extends GetAPISchema +>( + commerce: CommerceAPI

, + context: T['endpoint'] & { + config?: P['config'] + options?: T['schema']['endpoint']['options'] + } +): NextApiHandler { + const cfg = commerce.getConfig(context.config) + + return function apiHandler(req, res) { + return context.handler({ + req, + res, + commerce, + config: cfg, + handlers: context.handlers, + options: context.options ?? {}, + }) + } +} + +export const createEndpoint = + >(endpoint: API['endpoint']) => +

( + commerce: CommerceAPI

, + context?: Partial & { + config?: P['config'] + options?: API['schema']['endpoint']['options'] + } + ): NextApiHandler => { + return getEndpoint(commerce, { ...endpoint, ...context }) + } + +export interface CommerceAPIConfig { + locale?: string + locales?: string[] + commerceUrl: string + apiToken: string + cartCookie: string + cartCookieMaxAge: number + customerCookie: string + fetch( + query: string, + queryData?: CommerceAPIFetchOptions, + fetchOptions?: FetchOptions + ): Promise> +} + +export type GraphQLFetcher< + Data extends GraphQLFetcherResult = GraphQLFetcherResult, + Variables = any +> = ( + query: string, + queryData?: CommerceAPIFetchOptions, + fetchOptions?: FetchOptions +) => Promise + +export interface GraphQLFetcherResult { + data: Data + res: Response +} + +export interface CommerceAPIFetchOptions { + variables?: Variables + preview?: boolean +} diff --git a/packages/commerce/src/api/operations.ts b/packages/commerce/src/api/operations.ts new file mode 100644 index 0000000..2910a2d --- /dev/null +++ b/packages/commerce/src/api/operations.ts @@ -0,0 +1,177 @@ +import type { ServerResponse } from 'http' +import type { LoginOperation } from '../types/login' +import type { GetAllPagesOperation, GetPageOperation } from '../types/page' +import type { GetSiteInfoOperation } from '../types/site' +import type { GetCustomerWishlistOperation } from '../types/wishlist' +import type { + GetAllProductPathsOperation, + GetAllProductsOperation, + GetProductOperation, +} from '../types/product' +import type { APIProvider, CommerceAPI } from '.' + +const noop = () => { + throw new Error('Not implemented') +} + +export const OPERATIONS = [ + 'login', + 'getAllPages', + 'getPage', + 'getSiteInfo', + 'getCustomerWishlist', + 'getAllProductPaths', + 'getAllProducts', + 'getProduct', +] as const + +export const defaultOperations = OPERATIONS.reduce((ops, k) => { + ops[k] = noop + return ops +}, {} as { [K in AllowedOperations]: typeof noop }) + +export type AllowedOperations = typeof OPERATIONS[number] + +export type Operations

= { + login: { + (opts: { + variables: T['variables'] + config?: P['config'] + res: ServerResponse + }): Promise + + ( + opts: { + variables: T['variables'] + config?: P['config'] + res: ServerResponse + } & OperationOptions + ): Promise + } + + getAllPages: { + (opts?: { + config?: P['config'] + preview?: boolean + }): Promise + + ( + opts: { + config?: P['config'] + preview?: boolean + } & OperationOptions + ): Promise + } + + getPage: { + (opts: { + variables: T['variables'] + config?: P['config'] + preview?: boolean + }): Promise + + ( + opts: { + variables: T['variables'] + config?: P['config'] + preview?: boolean + } & OperationOptions + ): Promise + } + + getSiteInfo: { + (opts: { + config?: P['config'] + preview?: boolean + }): Promise + + ( + opts: { + config?: P['config'] + preview?: boolean + } & OperationOptions + ): Promise + } + + getCustomerWishlist: { + (opts: { + variables: T['variables'] + config?: P['config'] + includeProducts?: boolean + }): Promise + + ( + opts: { + variables: T['variables'] + config?: P['config'] + includeProducts?: boolean + } & OperationOptions + ): Promise + } + + getAllProductPaths: { + (opts: { + variables?: T['variables'] + config?: P['config'] + }): Promise + + ( + opts: { + variables?: T['variables'] + config?: P['config'] + } & OperationOptions + ): Promise + } + + getAllProducts: { + (opts: { + variables?: T['variables'] + config?: P['config'] + preview?: boolean + }): Promise + + ( + opts: { + variables?: T['variables'] + config?: P['config'] + preview?: boolean + } & OperationOptions + ): Promise + } + + getProduct: { + (opts: { + variables: T['variables'] + config?: P['config'] + preview?: boolean + }): Promise + + ( + opts: { + variables: T['variables'] + config?: P['config'] + preview?: boolean + } & OperationOptions + ): Promise + } +} + +export type APIOperations

= { + [K in keyof Operations

]?: (ctx: OperationContext

) => Operations

[K] +} + +export type AllOperations

= { + [K in keyof APIOperations

]-?: P['operations'][K] extends ( + ...args: any + ) => any + ? ReturnType + : typeof noop +} + +export type OperationContext

= { + commerce: CommerceAPI

+} + +export type OperationOptions = + | { query: string; url?: never } + | { query?: never; url: string } diff --git a/packages/commerce/src/api/utils/errors.ts b/packages/commerce/src/api/utils/errors.ts new file mode 100644 index 0000000..6f9ecce --- /dev/null +++ b/packages/commerce/src/api/utils/errors.ts @@ -0,0 +1,22 @@ +import type { Response } from '@vercel/fetch' + +export class CommerceAPIError extends Error { + status: number + res: Response + data: any + + constructor(msg: string, res: Response, data?: any) { + super(msg) + this.name = 'CommerceApiError' + this.status = res.status + this.res = res + this.data = data + } +} + +export class CommerceNetworkError extends Error { + constructor(msg: string) { + super(msg) + this.name = 'CommerceNetworkError' + } +} diff --git a/packages/commerce/src/api/utils/is-allowed-method.ts b/packages/commerce/src/api/utils/is-allowed-method.ts new file mode 100644 index 0000000..51c37e2 --- /dev/null +++ b/packages/commerce/src/api/utils/is-allowed-method.ts @@ -0,0 +1,30 @@ +import type { NextApiRequest, NextApiResponse } from 'next' + +export type HTTP_METHODS = 'OPTIONS' | 'GET' | 'POST' | 'PUT' | 'DELETE' + +export default function isAllowedMethod( + req: NextApiRequest, + res: NextApiResponse, + allowedMethods: HTTP_METHODS[] +) { + const methods = allowedMethods.includes('OPTIONS') + ? allowedMethods + : [...allowedMethods, 'OPTIONS'] + + if (!req.method || !methods.includes(req.method)) { + res.status(405) + res.setHeader('Allow', methods.join(', ')) + res.end() + return false + } + + if (req.method === 'OPTIONS') { + res.status(200) + res.setHeader('Allow', methods.join(', ')) + res.setHeader('Content-Length', '0') + res.end() + return false + } + + return true +} diff --git a/packages/commerce/src/api/utils/is-allowed-operation.ts b/packages/commerce/src/api/utils/is-allowed-operation.ts new file mode 100644 index 0000000..f507781 --- /dev/null +++ b/packages/commerce/src/api/utils/is-allowed-operation.ts @@ -0,0 +1,19 @@ +import type { NextApiRequest, NextApiResponse } from 'next' +import isAllowedMethod, { HTTP_METHODS } from './is-allowed-method' +import { APIHandler } from './types' + +export default function isAllowedOperation( + req: NextApiRequest, + res: NextApiResponse, + allowedOperations: { [k in HTTP_METHODS]?: APIHandler } +) { + const methods = Object.keys(allowedOperations) as HTTP_METHODS[] + const allowedMethods = methods.reduce((arr, method) => { + if (allowedOperations[method]) { + arr.push(method) + } + return arr + }, []) + + return isAllowedMethod(req, res, allowedMethods) +} diff --git a/packages/commerce/src/api/utils/types.ts b/packages/commerce/src/api/utils/types.ts new file mode 100644 index 0000000..27a95df --- /dev/null +++ b/packages/commerce/src/api/utils/types.ts @@ -0,0 +1,49 @@ +import type { NextApiRequest, NextApiResponse } from 'next' +import type { CommerceAPI } from '..' + +export type ErrorData = { message: string; code?: string } + +export type APIResponse = + | { data: Data; errors?: ErrorData[] } + // If `data` doesn't include `null`, then `null` is only allowed on errors + | (Data extends null + ? { data: null; errors?: ErrorData[] } + : { data: null; errors: ErrorData[] }) + +export type APIHandlerContext< + C extends CommerceAPI, + H extends APIHandlers = {}, + Data = any, + Options extends {} = {} +> = { + req: NextApiRequest + res: NextApiResponse> + commerce: C + config: C['provider']['config'] + handlers: H + /** + * Custom configs that may be used by a particular handler + */ + options: Options +} + +export type APIHandler< + C extends CommerceAPI, + H extends APIHandlers = {}, + Data = any, + Body = any, + Options extends {} = {} +> = ( + context: APIHandlerContext & { body: Body } +) => void | Promise + +export type APIHandlers = { + [k: string]: APIHandler +} + +export type APIEndpoint< + C extends CommerceAPI = CommerceAPI, + H extends APIHandlers = {}, + Data = any, + Options extends {} = {} +> = (context: APIHandlerContext) => void | Promise diff --git a/packages/commerce/src/auth/use-login.tsx b/packages/commerce/src/auth/use-login.tsx new file mode 100644 index 0000000..67fb429 --- /dev/null +++ b/packages/commerce/src/auth/use-login.tsx @@ -0,0 +1,20 @@ +import { useHook, useMutationHook } from '../utils/use-hook' +import { mutationFetcher } from '../utils/default-fetcher' +import type { MutationHook, HookFetcherFn } from '../utils/types' +import type { LoginHook } from '../types/login' +import type { Provider } from '..' + +export type UseLogin< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.auth?.useLogin! + +const useLogin: UseLogin = (...args) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(...args) +} + +export default useLogin diff --git a/packages/commerce/src/auth/use-logout.tsx b/packages/commerce/src/auth/use-logout.tsx new file mode 100644 index 0000000..6ca16de --- /dev/null +++ b/packages/commerce/src/auth/use-logout.tsx @@ -0,0 +1,20 @@ +import { useHook, useMutationHook } from '../utils/use-hook' +import { mutationFetcher } from '../utils/default-fetcher' +import type { HookFetcherFn, MutationHook } from '../utils/types' +import type { LogoutHook } from '../types/logout' +import type { Provider } from '..' + +export type UseLogout< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.auth?.useLogout! + +const useLogout: UseLogout = (...args) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(...args) +} + +export default useLogout diff --git a/packages/commerce/src/auth/use-signup.tsx b/packages/commerce/src/auth/use-signup.tsx new file mode 100644 index 0000000..2f846fa --- /dev/null +++ b/packages/commerce/src/auth/use-signup.tsx @@ -0,0 +1,20 @@ +import { useHook, useMutationHook } from '../utils/use-hook' +import { mutationFetcher } from '../utils/default-fetcher' +import type { HookFetcherFn, MutationHook } from '../utils/types' +import type { SignupHook } from '../types/signup' +import type { Provider } from '..' + +export type UseSignup< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.auth?.useSignup! + +const useSignup: UseSignup = (...args) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(...args) +} + +export default useSignup diff --git a/packages/commerce/src/cart/use-add-item.tsx b/packages/commerce/src/cart/use-add-item.tsx new file mode 100644 index 0000000..f4072c7 --- /dev/null +++ b/packages/commerce/src/cart/use-add-item.tsx @@ -0,0 +1,20 @@ +import { useHook, useMutationHook } from '../utils/use-hook' +import { mutationFetcher } from '../utils/default-fetcher' +import type { HookFetcherFn, MutationHook } from '../utils/types' +import type { AddItemHook } from '../types/cart' +import type { Provider } from '..' + +export type UseAddItem< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.cart?.useAddItem! + +const useAddItem: UseAddItem = (...args) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(...args) +} + +export default useAddItem diff --git a/packages/commerce/src/cart/use-cart.tsx b/packages/commerce/src/cart/use-cart.tsx new file mode 100644 index 0000000..cfce59e --- /dev/null +++ b/packages/commerce/src/cart/use-cart.tsx @@ -0,0 +1,32 @@ +import Cookies from 'js-cookie' +import { useHook, useSWRHook } from '../utils/use-hook' +import type { SWRHook, HookFetcherFn } from '../utils/types' +import type { GetCartHook } from '../types/cart' +import { Provider, useCommerce } from '..' + +export type UseCart< + 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.cart?.useCart! + +const useCart: UseCart = (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 useCart diff --git a/packages/commerce/src/cart/use-remove-item.tsx b/packages/commerce/src/cart/use-remove-item.tsx new file mode 100644 index 0000000..f2bb43f --- /dev/null +++ b/packages/commerce/src/cart/use-remove-item.tsx @@ -0,0 +1,20 @@ +import { useHook, useMutationHook } from '../utils/use-hook' +import { mutationFetcher } from '../utils/default-fetcher' +import type { HookFetcherFn, MutationHook } from '../utils/types' +import type { RemoveItemHook } from '../types/cart' +import type { Provider } from '..' + +export type UseRemoveItem< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.cart?.useRemoveItem! + +const useRemoveItem: UseRemoveItem = (input) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(input) +} + +export default useRemoveItem diff --git a/packages/commerce/src/cart/use-update-item.tsx b/packages/commerce/src/cart/use-update-item.tsx new file mode 100644 index 0000000..2527732 --- /dev/null +++ b/packages/commerce/src/cart/use-update-item.tsx @@ -0,0 +1,20 @@ +import { useHook, useMutationHook } from '../utils/use-hook' +import { mutationFetcher } from '../utils/default-fetcher' +import type { HookFetcherFn, MutationHook } from '../utils/types' +import type { UpdateItemHook } from '../types/cart' +import type { Provider } from '..' + +export type UseUpdateItem< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.cart?.useUpdateItem! + +const useUpdateItem: UseUpdateItem = (input) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(input) +} + +export default useUpdateItem diff --git a/packages/commerce/src/checkout/use-checkout.ts b/packages/commerce/src/checkout/use-checkout.ts new file mode 100644 index 0000000..0fe74cb --- /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 0000000..a5d8650 --- /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 0000000..3f1ac9f --- /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.posix.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 0000000..94c4514 --- /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 0000000..7fc1292 --- /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 0000000..820a65d --- /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 0000000..d058822 --- /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 0000000..7b4ffdb --- /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 0000000..5709950 --- /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 0000000..1d85fa6 --- /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 0000000..cd8837d --- /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/packages/commerce/src/customer/use-customer.tsx b/packages/commerce/src/customer/use-customer.tsx new file mode 100644 index 0000000..bbeeb32 --- /dev/null +++ b/packages/commerce/src/customer/use-customer.tsx @@ -0,0 +1,20 @@ +import { useHook, useSWRHook } from '../utils/use-hook' +import { SWRFetcher } from '../utils/default-fetcher' +import type { CustomerHook } from '../types/customer' +import type { HookFetcherFn, SWRHook } from '../utils/types' +import type { Provider } from '..' + +export type UseCustomer< + H extends SWRHook> = SWRHook +> = ReturnType + +export const fetcher: HookFetcherFn = SWRFetcher + +const fn = (provider: Provider) => provider.customer?.useCustomer! + +const useCustomer: UseCustomer = (input) => { + const hook = useHook(fn) + return useSWRHook({ fetcher, ...hook })(input) +} + +export default useCustomer diff --git a/packages/commerce/src/index.tsx b/packages/commerce/src/index.tsx new file mode 100644 index 0000000..8450f1e --- /dev/null +++ b/packages/commerce/src/index.tsx @@ -0,0 +1,123 @@ +import { + ReactNode, + MutableRefObject, + createContext, + useContext, + useMemo, + useRef, +} from 'react' + +import type { + Customer, + Wishlist, + Cart, + Product, + Signup, + Login, + Logout, + Checkout, +} from './types' + +import type { Fetcher, SWRHook, MutationHook } from './utils/types' + +const Commerce = createContext | {}>({}) + +export type Provider = CommerceConfig & { + fetcher: Fetcher + cart?: { + useCart?: SWRHook + useAddItem?: MutationHook + useUpdateItem?: MutationHook + useRemoveItem?: MutationHook + } + checkout?: { + useCheckout?: SWRHook + useSubmitCheckout?: MutationHook + } + wishlist?: { + useWishlist?: SWRHook + useAddItem?: MutationHook + useRemoveItem?: MutationHook + } + customer?: { + useCustomer?: SWRHook + card?: { + useCards?: SWRHook + useAddItem?: MutationHook + useUpdateItem?: MutationHook + useRemoveItem?: MutationHook + } + address?: { + useAddresses?: SWRHook + useAddItem?: MutationHook + useUpdateItem?: MutationHook + useRemoveItem?: MutationHook + } + } + products?: { + useSearch?: SWRHook + } + auth?: { + useSignup?: MutationHook + useLogin?: MutationHook + useLogout?: MutationHook + } +} + +export type CommerceConfig = { + locale: string + cartCookie: string +} + +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, +}: CommerceProps

) { + const providerRef = useRef(provider) + // TODO: Remove the fetcherRef + const fetcherRef = useRef(provider.fetcher) + // 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, 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/packages/commerce/src/product/use-price.tsx b/packages/commerce/src/product/use-price.tsx new file mode 100644 index 0000000..9c09e34 --- /dev/null +++ b/packages/commerce/src/product/use-price.tsx @@ -0,0 +1,64 @@ +import { useMemo } from 'react' +import { useCommerce } from '..' + +export function formatPrice({ + amount, + currencyCode, + locale, +}: { + amount: number + currencyCode: string + locale: string +}) { + const formatCurrency = new Intl.NumberFormat(locale, { + style: 'currency', + currency: currencyCode, + }) + + return formatCurrency.format(amount) +} + +export function formatVariantPrice({ + amount, + baseAmount, + currencyCode, + locale, +}: { + baseAmount: number + amount: number + currencyCode: string + locale: string +}) { + const hasDiscount = baseAmount > amount + const formatDiscount = new Intl.NumberFormat(locale, { style: 'percent' }) + const discount = hasDiscount + ? formatDiscount.format((baseAmount - amount) / baseAmount) + : null + + const price = formatPrice({ amount, currencyCode, locale }) + const basePrice = hasDiscount + ? formatPrice({ amount: baseAmount, currencyCode, locale }) + : null + + return { price, basePrice, discount } +} + +export default function usePrice( + data?: { + amount: number + baseAmount?: number + currencyCode: string + } | null +) { + const { amount, baseAmount, currencyCode } = data ?? {} + const { locale } = useCommerce() + const value = useMemo(() => { + if (typeof amount !== 'number' || !currencyCode) return '' + + return baseAmount + ? formatVariantPrice({ amount, baseAmount, currencyCode, locale }) + : formatPrice({ amount, currencyCode, locale }) + }, [amount, baseAmount, currencyCode]) + + return typeof value === 'string' ? { price: value } : value +} diff --git a/packages/commerce/src/product/use-search.tsx b/packages/commerce/src/product/use-search.tsx new file mode 100644 index 0000000..342b49e --- /dev/null +++ b/packages/commerce/src/product/use-search.tsx @@ -0,0 +1,20 @@ +import { useHook, useSWRHook } from '../utils/use-hook' +import { SWRFetcher } from '../utils/default-fetcher' +import type { HookFetcherFn, SWRHook } from '../utils/types' +import type { SearchProductsHook } from '../types/product' +import type { Provider } from '..' + +export type UseSearch< + H extends SWRHook> = SWRHook +> = ReturnType + +export const fetcher: HookFetcherFn = SWRFetcher + +const fn = (provider: Provider) => provider.products?.useSearch! + +const useSearch: UseSearch = (input) => { + const hook = useHook(fn) + return useSWRHook({ fetcher, ...hook })(input) +} + +export default useSearch diff --git a/packages/commerce/src/types/cart.ts b/packages/commerce/src/types/cart.ts new file mode 100644 index 0000000..e4af878 --- /dev/null +++ b/packages/commerce/src/types/cart.ts @@ -0,0 +1,177 @@ +import type { Discount, Measurement, Image } from './common' + +export type SelectedOption = { + // The option's id. + id?: string + // The product option’s name. + name: string + /// The product option’s value. + value: string +} + +export type LineItem = { + id: string + variantId: string + productId: string + name: string + quantity: number + discounts: Discount[] + // A human-friendly unique string automatically generated from the product’s name + path: string + variant: ProductVariant + options?: SelectedOption[] +} + +export type ProductVariant = { + id: string + // The SKU (stock keeping unit) associated with the product variant. + sku: string + // The product variant’s title, or the product's name. + name: string + // Whether a customer needs to provide a shipping address when placing + // an order for the product variant. + requiresShipping: boolean + // The product variant’s price after all discounts are applied. + price: number + // Product variant’s price, as quoted by the manufacturer/distributor. + listPrice: number + // Image associated with the product variant. Falls back to the product image + // if no image is available. + image?: Image + // Indicates whether this product variant is in stock. + isInStock?: boolean + // Indicates if the product variant is available for sale. + availableForSale?: boolean + // The variant's weight. If a weight was not explicitly specified on the + // variant this will be the product's weight. + weight?: Measurement + // The variant's height. If a height was not explicitly specified on the + // variant, this will be the product's height. + height?: Measurement + // The variant's width. If a width was not explicitly specified on the + // variant, this will be the product's width. + width?: Measurement + // The variant's depth. If a depth was not explicitly specified on the + // variant, this will be the product's depth. + depth?: Measurement +} + +// Shopping cart, a.k.a Checkout +export type Cart = { + id: string + // ID of the customer to which the cart belongs. + customerId?: string + // The email assigned to this cart + email?: string + // The date and time when the cart was created. + createdAt: string + // The currency used for this cart + currency: { code: string } + // Specifies if taxes are included in the line items. + taxesIncluded: boolean + lineItems: LineItem[] + // The sum of all the prices of all the items in the cart. + // Duties, taxes, shipping and discounts excluded. + lineItemsSubtotalPrice: number + // Price of the cart before duties, shipping and taxes. + subtotalPrice: number + // The sum of all the prices of all the items in the cart. + // Duties, taxes and discounts included. + totalPrice: number + // Discounts that have been applied on the cart. + discounts?: Discount[] +} + +/** + * Base cart item body used for cart mutations + */ +export type CartItemBody = { + variantId: string + productId?: string + quantity?: number +} + +/** + * Hooks schema + */ + +export type CartTypes = { + cart?: Cart + item: LineItem + itemBody: CartItemBody +} + +export type CartHooks = { + getCart: GetCartHook + addItem: AddItemHook + updateItem: UpdateItemHook + removeItem: RemoveItemHook +} + +export type GetCartHook = { + data: T['cart'] | null + input: {} + fetcherInput: { cartId?: string } + swrState: { isEmpty: boolean } +} + +export type AddItemHook = { + data: T['cart'] + input?: T['itemBody'] + fetcherInput: T['itemBody'] + body: { item: T['itemBody'] } + actionInput: T['itemBody'] +} + +export type UpdateItemHook = { + data: T['cart'] | null + input: { item?: T['item']; wait?: number } + fetcherInput: { itemId: string; item: T['itemBody'] } + body: { itemId: string; item: T['itemBody'] } + actionInput: T['itemBody'] & { id: string } +} + +export type RemoveItemHook = { + data: T['cart'] | null + input: { item?: T['item'] } + fetcherInput: { itemId: string } + body: { itemId: string } + actionInput: { id: string } +} + +/** + * API Schema + */ + +export type CartSchema = { + endpoint: { + options: {} + handlers: CartHandlers + } +} + +export type CartHandlers = { + getCart: GetCartHandler + addItem: AddItemHandler + updateItem: UpdateItemHandler + removeItem: RemoveItemHandler +} + +export type GetCartHandler = GetCartHook & { + body: { cartId?: string } +} + +export type AddItemHandler = AddItemHook & { + body: { cartId: string } +} + +export type UpdateItemHandler = + UpdateItemHook & { + data: T['cart'] + body: { cartId: string } + } + +export type RemoveItemHandler = + RemoveItemHook & { + body: { cartId: string } + } diff --git a/packages/commerce/src/types/checkout.ts b/packages/commerce/src/types/checkout.ts new file mode 100644 index 0000000..417604f --- /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/packages/commerce/src/types/common.ts b/packages/commerce/src/types/common.ts new file mode 100644 index 0000000..06908c4 --- /dev/null +++ b/packages/commerce/src/types/common.ts @@ -0,0 +1,16 @@ +export type Discount = { + // The value of the discount, can be an amount or percentage + value: number +} + +export type Measurement = { + value: number + unit: 'KILOGRAMS' | 'GRAMS' | 'POUNDS' | 'OUNCES' +} + +export type Image = { + url: string + altText?: string + width?: number + height?: number +} diff --git a/packages/commerce/src/types/customer/address.ts b/packages/commerce/src/types/customer/address.ts new file mode 100644 index 0000000..8dc6ffc --- /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 0000000..e9b220d --- /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/packages/commerce/src/types/customer/index.ts b/packages/commerce/src/types/customer/index.ts new file mode 100644 index 0000000..f0b210f --- /dev/null +++ b/packages/commerce/src/types/customer/index.ts @@ -0,0 +1,25 @@ +export * as Card from './card' +export * as Address from './address' + +// TODO: define this type +export type Customer = any + +export type CustomerTypes = { + customer: Customer +} + +export type CustomerHook = { + data: T['customer'] | null + fetchData: { customer: T['customer'] } | null +} + +export type CustomerSchema = { + endpoint: { + options: {} + handlers: { + getLoggedInCustomer: { + data: { customer: T['customer'] } | null + } + } + } +} diff --git a/packages/commerce/src/types/index.ts b/packages/commerce/src/types/index.ts new file mode 100644 index 0000000..7ab0b7f --- /dev/null +++ b/packages/commerce/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/commerce/src/types/login.ts b/packages/commerce/src/types/login.ts new file mode 100644 index 0000000..b6ef228 --- /dev/null +++ b/packages/commerce/src/types/login.ts @@ -0,0 +1,29 @@ +export type LoginBody = { + email: string + password: string +} + +export type LoginTypes = { + body: LoginBody +} + +export type LoginHook = { + data: null + actionInput: LoginBody + fetcherInput: LoginBody + body: T['body'] +} + +export type LoginSchema = { + endpoint: { + options: {} + handlers: { + login: LoginHook + } + } +} + +export type LoginOperation = { + data: { result?: string } + variables: unknown +} diff --git a/packages/commerce/src/types/logout.ts b/packages/commerce/src/types/logout.ts new file mode 100644 index 0000000..a724005 --- /dev/null +++ b/packages/commerce/src/types/logout.ts @@ -0,0 +1,17 @@ +export type LogoutTypes = { + body: { redirectTo?: string } +} + +export type LogoutHook = { + data: null + body: T['body'] +} + +export type LogoutSchema = { + endpoint: { + options: {} + handlers: { + logout: LogoutHook + } + } +} diff --git a/packages/commerce/src/types/page.ts b/packages/commerce/src/types/page.ts new file mode 100644 index 0000000..89f82c1 --- /dev/null +++ b/packages/commerce/src/types/page.ts @@ -0,0 +1,28 @@ +// TODO: define this type +export type Page = { + // ID of the Web page. + id: string + // Page name, as displayed on the storefront. + name: string + // Relative URL on the storefront for this page. + url?: string + // HTML or variable that populates this page’s `` element, in default/desktop view. Required in POST if page type is `raw`. + body: string + // If true, this page appears in the storefront’s navigation menu. + is_visible?: boolean + // Order in which this page should display on the storefront. (Lower integers specify earlier display.) + sort_order?: number +} + +export type PageTypes = { + page: Page +} + +export type GetAllPagesOperation = { + data: { pages: T['page'][] } +} + +export type GetPageOperation = { + data: { page?: T['page'] } + variables: { id: string } +} diff --git a/packages/commerce/src/types/product.ts b/packages/commerce/src/types/product.ts new file mode 100644 index 0000000..fb48ba0 --- /dev/null +++ b/packages/commerce/src/types/product.ts @@ -0,0 +1,99 @@ +export type ProductImage = { + url: string + alt?: string +} + +export type ProductPrice = { + value: number + currencyCode?: 'USD' | 'EUR' | 'ARS' | 'GBP' | string + retailPrice?: number + salePrice?: number + listPrice?: number + extendedSalePrice?: number + extendedListPrice?: number +} + +export type ProductOption = { + __typename?: 'MultipleChoiceOption' + id: string + displayName: string + values: ProductOptionValues[] +} + +export type ProductOptionValues = { + label: string + hexColors?: string[] +} + +export type ProductVariant = { + id: string | number + options: ProductOption[] + availableForSale?: boolean +} + +export type Product = { + id: string + name: string + description: string + descriptionHtml?: string + sku?: string + slug?: string + path?: string + images: ProductImage[] + variants: ProductVariant[] + price: ProductPrice + options: ProductOption[] + vendor?: string +} + +export type SearchProductsBody = { + search?: string + categoryId?: string | number + brandId?: string | number + sort?: string + locale?: string +} + +export type ProductTypes = { + product: Product + searchBody: SearchProductsBody +} + +export type SearchProductsHook = { + data: { + products: T['product'][] + found: boolean + } + body: T['searchBody'] + input: T['searchBody'] + fetcherInput: T['searchBody'] +} + +export type ProductsSchema = { + endpoint: { + options: {} + handlers: { + getProducts: SearchProductsHook + } + } +} + +export type GetAllProductPathsOperation = + { + data: { products: Pick[] } + variables: { first?: number } + } + +export type GetAllProductsOperation = { + data: { products: T['product'][] } + variables: { + relevance?: 'featured' | 'best_selling' | 'newest' + ids?: string[] + first?: number + } +} + +export type GetProductOperation = { + data: { product?: T['product'] } + variables: { path: string; slug?: never } | { path?: never; slug: string } +} diff --git a/packages/commerce/src/types/signup.ts b/packages/commerce/src/types/signup.ts new file mode 100644 index 0000000..4e23da6 --- /dev/null +++ b/packages/commerce/src/types/signup.ts @@ -0,0 +1,26 @@ +export type SignupBody = { + firstName: string + lastName: string + email: string + password: string +} + +export type SignupTypes = { + body: SignupBody +} + +export type SignupHook = { + data: null + body: T['body'] + actionInput: T['body'] + fetcherInput: T['body'] +} + +export type SignupSchema = { + endpoint: { + options: {} + handlers: { + signup: SignupHook + } + } +} diff --git a/packages/commerce/src/types/site.ts b/packages/commerce/src/types/site.ts new file mode 100644 index 0000000..73c7ddd --- /dev/null +++ b/packages/commerce/src/types/site.ts @@ -0,0 +1,20 @@ +export type Category = { + id: string + name: string + slug: string + path: string +} + +export type Brand = any + +export type SiteTypes = { + category: Category + brand: Brand +} + +export type GetSiteInfoOperation = { + data: { + categories: T['category'][] + brands: T['brand'][] + } +} diff --git a/packages/commerce/src/types/wishlist.ts b/packages/commerce/src/types/wishlist.ts new file mode 100644 index 0000000..b375984 --- /dev/null +++ b/packages/commerce/src/types/wishlist.ts @@ -0,0 +1,60 @@ +// TODO: define this type +export type Wishlist = any + +export type WishlistItemBody = { + variantId: string | number + productId: string +} + +export type WishlistTypes = { + wishlist: Wishlist + itemBody: WishlistItemBody +} + +export type GetWishlistHook = { + data: T['wishlist'] | null + body: { includeProducts?: boolean } + input: { includeProducts?: boolean } + fetcherInput: { customerId: string; includeProducts?: boolean } + swrState: { isEmpty: boolean } +} + +export type AddItemHook = { + data: T['wishlist'] + body: { item: T['itemBody'] } + fetcherInput: { item: T['itemBody'] } + actionInput: T['itemBody'] +} + +export type RemoveItemHook = { + data: T['wishlist'] | null + body: { itemId: string } + fetcherInput: { itemId: string } + actionInput: { id: string } + input: { wishlist?: { includeProducts?: boolean } } +} + +export type WishlistSchema = { + endpoint: { + options: {} + handlers: { + getWishlist: GetWishlistHook & { + data: T['wishlist'] | null + body: { customerToken?: string } + } + addItem: AddItemHook & { + body: { customerToken?: string } + } + removeItem: RemoveItemHook & { + body: { customerToken?: string } + } + } + } +} + +export type GetCustomerWishlistOperation< + T extends WishlistTypes = WishlistTypes +> = { + data: { wishlist?: T['wishlist'] } + variables: { customerId: string } +} diff --git a/packages/commerce/src/utils/default-fetcher.ts b/packages/commerce/src/utils/default-fetcher.ts new file mode 100644 index 0000000..53312fc --- /dev/null +++ b/packages/commerce/src/utils/default-fetcher.ts @@ -0,0 +1,12 @@ +import type { HookFetcherFn } from './types' + +export const SWRFetcher: HookFetcherFn = ({ options, fetch }) => + fetch(options) + +export const mutationFetcher: HookFetcherFn = ({ + input, + options, + fetch, +}) => fetch({ ...options, body: input }) + +export default SWRFetcher diff --git a/packages/commerce/src/utils/define-property.ts b/packages/commerce/src/utils/define-property.ts new file mode 100644 index 0000000..e897352 --- /dev/null +++ b/packages/commerce/src/utils/define-property.ts @@ -0,0 +1,37 @@ +// Taken from https://fettblog.eu/typescript-assertion-signatures/ + +type InferValue = Desc extends { + get(): any + value: any +} + ? never + : Desc extends { value: infer T } + ? Record + : Desc extends { get(): infer T } + ? Record + : never + +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, + Key extends PropertyKey, + PDesc extends PropertyDescriptor +>( + obj: Obj, + prop: Key, + val: PDesc +): asserts obj is Obj & DefineProperty { + Object.defineProperty(obj, prop, val) +} diff --git a/packages/commerce/src/utils/errors.ts b/packages/commerce/src/utils/errors.ts new file mode 100644 index 0000000..f4ab9fb --- /dev/null +++ b/packages/commerce/src/utils/errors.ts @@ -0,0 +1,48 @@ +export type ErrorData = { + message: string + code?: string +} + +export type ErrorProps = { + code?: string +} & ( + | { message: string; errors?: never } + | { message?: never; errors: ErrorData[] } +) + +export class CommerceError extends Error { + code?: string + errors: ErrorData[] + + constructor({ message, code, errors }: ErrorProps) { + const error: ErrorData = message + ? { message, ...(code ? { code } : {}) } + : errors![0] + + super(error.message) + this.errors = message ? [error] : errors! + + if (error.code) this.code = error.code + } +} + +// Used for errors that come from a bad implementation of the hooks +export class ValidationError extends CommerceError { + constructor(options: ErrorProps) { + super(options) + this.code = 'validation_error' + } +} + +export class FetcherError extends CommerceError { + status: number + + constructor( + options: { + status: number + } & ErrorProps + ) { + super(options) + this.status = options.status + } +} diff --git a/packages/commerce/src/utils/types.ts b/packages/commerce/src/utils/types.ts new file mode 100644 index 0000000..317fea1 --- /dev/null +++ b/packages/commerce/src/utils/types.ts @@ -0,0 +1,147 @@ +import type { SWRConfiguration } from 'swr' +import type { CommerceError } from './errors' +import type { ResponseState } from './use-data' + +/** + * Returns the properties in T with the properties in type K, overriding properties defined in T + */ +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 +} + +/** + * Core fetcher added by CommerceProvider + */ +export type Fetcher = ( + options: FetcherOptions +) => T | Promise + +export type FetcherOptions = { + url?: string + query?: string + method?: string + variables?: any + body?: Body +} + +export type HookFetcher = ( + options: HookFetcherOptions | null, + input: Input, + fetch: (options: FetcherOptions) => Promise +) => Data | Promise + +export type HookFetcherFn = ( + context: HookFetcherContext +) => H['data'] | Promise + +export type HookFetcherContext = { + options: HookFetcherOptions + input: H['fetcherInput'] + fetch: < + T = H['fetchData'] extends {} | null ? H['fetchData'] : any, + B = H['body'] + >( + options: FetcherOptions + ) => Promise +} + +export type HookFetcherOptions = { method?: string } & ( + | { query: string; url?: string } + | { query?: string; url: string } +) + +export type HookInputValue = string | number | boolean | undefined + +export type HookSWRInput = [string, HookInputValue][] + +export type HookFetchInput = { [k: string]: HookInputValue } + +export type HookFunction< + Input extends { [k: string]: unknown } | undefined, + T +> = keyof Input extends never + ? () => T + : Partial extends Input + ? (input?: Input) => T + : (input: Input) => T + +export type HookSchemaBase = { + // Data obj returned by the hook + data: any + // Input expected by the hook + input?: {} + // Input expected before doing a fetch operation (aka fetch handler) + fetcherInput?: {} + // Body object expected by the fetch operation + body?: {} + // Data returned by the fetch operation + fetchData?: any +} + +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 & { + // Input expected by the action returned by the hook + actionInput?: {} +} + +/** + * Generates a SWR hook handler based on the schema of a hook + */ +export type SWRHook = { + useHook( + context: SWRHookContext + ): HookFunction< + H['input'] & { swrOptions?: SwrOptions }, + ResponseState & H['swrState'] & H['mutations'] + > + fetchOptions: HookFetcherOptions + fetcher?: HookFetcherFn +} + +export type SWRHookContext = { + useData(context?: { + input?: HookFetchInput | HookSWRInput + swrOptions?: SwrOptions + }): ResponseState +} + +/** + * Generates a mutation hook handler based on the schema of a hook + */ +export type MutationHook = { + useHook( + context: MutationHookContext + ): HookFunction< + H['input'], + HookFunction> + > + fetchOptions: HookFetcherOptions + fetcher?: HookFetcherFn +} + +export type MutationHookContext = { + fetch: keyof H['fetcherInput'] extends never + ? () => H['data'] | Promise + : Partial extends H['fetcherInput'] + ? (context?: { + input?: H['fetcherInput'] + }) => H['data'] | Promise + : (context: { input: H['fetcherInput'] }) => H['data'] | Promise +} + +export type SwrOptions = SWRConfiguration< + Data, + CommerceError, + HookFetcher +> diff --git a/packages/commerce/src/utils/use-data.tsx b/packages/commerce/src/utils/use-data.tsx new file mode 100644 index 0000000..fedd14e --- /dev/null +++ b/packages/commerce/src/utils/use-data.tsx @@ -0,0 +1,78 @@ +import useSWR, { SWRResponse } from 'swr' +import type { + HookSWRInput, + HookFetchInput, + HookFetcherOptions, + HookFetcherFn, + Fetcher, + SwrOptions, + SWRHookSchemaBase, +} from './types' +import defineProperty from './define-property' +import { CommerceError } from './errors' + +export type ResponseState = SWRResponse & { + isLoading: boolean +} + +export type UseData = ( + options: { + fetchOptions: HookFetcherOptions + fetcher: HookFetcherFn + }, + input: HookFetchInput | HookSWRInput, + fetcherFn: Fetcher, + swrOptions?: SwrOptions +) => ResponseState + +const useData: UseData = (options, input, fetcherFn, swrOptions) => { + const hookInput = Array.isArray(input) ? input : Object.entries(input) + const fetcher = async ( + url: string, + query?: string, + method?: string, + ...args: any[] + ) => { + try { + return await options.fetcher({ + options: { url, query, method }, + // Transform the input array into an object + input: args.reduce((obj, val, i) => { + obj[hookInput[i][0]!] = val + return obj + }, {}), + fetch: fetcherFn, + }) + } catch (error) { + // SWR will not log errors, but any error that's not an instance + // of CommerceError is not welcomed by this hook + if (!(error instanceof CommerceError)) { + console.error(error) + } + throw error + } + } + const response = useSWR( + () => { + const opts = options.fetchOptions + return opts + ? [opts.url, opts.query, opts.method, ...hookInput.map((e) => e[1])] + : null + }, + fetcher, + swrOptions + ) + + if (!('isLoading' in response)) { + defineProperty(response, 'isLoading', { + get() { + return response.data === undefined + }, + enumerable: true, + }) + } + + return response as typeof response & { isLoading: boolean } +} + +export default useData diff --git a/packages/commerce/src/utils/use-hook.ts b/packages/commerce/src/utils/use-hook.ts new file mode 100644 index 0000000..1bf0779 --- /dev/null +++ b/packages/commerce/src/utils/use-hook.ts @@ -0,0 +1,50 @@ +import { useCallback } from 'react' +import { Provider, useCommerce } from '..' +import type { MutationHook, PickRequired, SWRHook } from './types' +import useData from './use-data' + +export function useFetcher() { + const { providerRef, fetcherRef } = useCommerce() + return providerRef.current.fetcher ?? fetcherRef.current +} + +export function useHook< + P extends Provider, + H extends MutationHook | SWRHook +>(fn: (provider: P) => H) { + const { providerRef } = useCommerce

() + const provider = providerRef.current + return fn(provider) +} + +export function useSWRHook>( + hook: PickRequired +) { + const fetcher = useFetcher() + + return hook.useHook({ + useData(ctx) { + const response = useData(hook, ctx?.input ?? [], fetcher, ctx?.swrOptions) + return response + }, + }) +} + +export function useMutationHook>( + hook: PickRequired +) { + const fetcher = useFetcher() + + return hook.useHook({ + fetch: useCallback( + ({ input } = {}) => { + return hook.fetcher({ + input, + options: hook.fetchOptions, + fetch: fetcher, + }) + }, + [fetcher, hook.fetchOptions] + ), + }) +} diff --git a/packages/commerce/src/wishlist/index.ts b/packages/commerce/src/wishlist/index.ts new file mode 100644 index 0000000..241af3c --- /dev/null +++ b/packages/commerce/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/commerce/src/wishlist/use-add-item.tsx b/packages/commerce/src/wishlist/use-add-item.tsx new file mode 100644 index 0000000..f464be1 --- /dev/null +++ b/packages/commerce/src/wishlist/use-add-item.tsx @@ -0,0 +1,20 @@ +import { useHook, useMutationHook } from '../utils/use-hook' +import { mutationFetcher } from '../utils/default-fetcher' +import type { MutationHook } from '../utils/types' +import type { AddItemHook } from '../types/wishlist' +import type { Provider } from '..' + +export type UseAddItem< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher = mutationFetcher + +const fn = (provider: Provider) => provider.wishlist?.useAddItem! + +const useAddItem: UseAddItem = (...args) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(...args) +} + +export default useAddItem diff --git a/packages/commerce/src/wishlist/use-remove-item.tsx b/packages/commerce/src/wishlist/use-remove-item.tsx new file mode 100644 index 0000000..4419c17 --- /dev/null +++ b/packages/commerce/src/wishlist/use-remove-item.tsx @@ -0,0 +1,20 @@ +import { useHook, useMutationHook } from '../utils/use-hook' +import { mutationFetcher } from '../utils/default-fetcher' +import type { HookFetcherFn, MutationHook } from '../utils/types' +import type { RemoveItemHook } from '../types/wishlist' +import type { Provider } from '..' + +export type UseRemoveItem< + H extends MutationHook> = MutationHook +> = ReturnType + +export const fetcher: HookFetcherFn = mutationFetcher + +const fn = (provider: Provider) => provider.wishlist?.useRemoveItem! + +const useRemoveItem: UseRemoveItem = (...args) => { + const hook = useHook(fn) + return useMutationHook({ fetcher, ...hook })(...args) +} + +export default useRemoveItem diff --git a/packages/commerce/src/wishlist/use-wishlist.tsx b/packages/commerce/src/wishlist/use-wishlist.tsx new file mode 100644 index 0000000..672203f --- /dev/null +++ b/packages/commerce/src/wishlist/use-wishlist.tsx @@ -0,0 +1,20 @@ +import { useHook, useSWRHook } from '../utils/use-hook' +import { SWRFetcher } from '../utils/default-fetcher' +import type { HookFetcherFn, SWRHook } from '../utils/types' +import type { GetWishlistHook } from '../types/wishlist' +import type { Provider } from '..' + +export type UseWishlist< + H extends SWRHook> = SWRHook +> = ReturnType + +export const fetcher: HookFetcherFn = SWRFetcher + +const fn = (provider: Provider) => provider.wishlist?.useWishlist! + +const useWishlist: UseWishlist = (...args) => { + const hook = useHook(fn) + return useSWRHook({ fetcher, ...hook })(...args) +} + +export default useWishlist diff --git a/packages/commerce/taskfile.js b/packages/commerce/taskfile.js new file mode 100644 index 0000000..39b1b2a --- /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 0000000..cd04ab2 --- /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 0000000..3e8ba8f --- /dev/null +++ b/packages/commercejs/.env.template @@ -0,0 +1,7 @@ +COMMERCE_PROVIDER=@vercel/commerce-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 0000000..f06235c --- /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 0000000..e1076ed --- /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 0000000..20aaf70 --- /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 0000000..3fc3787 --- /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 0000000..9887a70 --- /dev/null +++ b/packages/commercejs/package.json @@ -0,0 +1,82 @@ +{ + "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", + "lodash.debounce": "^4.0.8" + }, + "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/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/packages/commercejs/src/api/endpoints/cart/index.ts b/packages/commercejs/src/api/endpoints/cart/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/commercejs/src/api/endpoints/cart/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/commercejs/src/api/endpoints/catalog/index.ts b/packages/commercejs/src/api/endpoints/catalog/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/commercejs/src/api/endpoints/catalog/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/commercejs/src/api/endpoints/catalog/products/index.ts b/packages/commercejs/src/api/endpoints/catalog/products/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/commercejs/src/api/endpoints/catalog/products/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/commercejs/src/api/endpoints/checkout/get-checkout.ts b/packages/commercejs/src/api/endpoints/checkout/get-checkout.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/commercejs/src/api/endpoints/checkout/get-checkout.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} 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 0000000..1072902 --- /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 0000000..e0f3012 --- /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/packages/commercejs/src/api/endpoints/customer/address/index.ts b/packages/commercejs/src/api/endpoints/customer/address/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/commercejs/src/api/endpoints/customer/address/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/commercejs/src/api/endpoints/customer/card/index.ts b/packages/commercejs/src/api/endpoints/customer/card/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/commercejs/src/api/endpoints/customer/card/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/commercejs/src/api/endpoints/customer/index.ts b/packages/commercejs/src/api/endpoints/customer/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/commercejs/src/api/endpoints/customer/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} 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 0000000..a6dbb44 --- /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 0000000..b9088ad --- /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/packages/commercejs/src/api/endpoints/logout/index.ts b/packages/commercejs/src/api/endpoints/logout/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/commercejs/src/api/endpoints/logout/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/commercejs/src/api/endpoints/signup/index.ts b/packages/commercejs/src/api/endpoints/signup/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/commercejs/src/api/endpoints/signup/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/commercejs/src/api/endpoints/wishlist/index.tsx b/packages/commercejs/src/api/endpoints/wishlist/index.tsx new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/commercejs/src/api/endpoints/wishlist/index.tsx @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/commercejs/src/api/index.ts b/packages/commercejs/src/api/index.ts new file mode 100644 index 0000000..1bc8218 --- /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 0000000..c8c9e41 --- /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 0000000..03b7eee --- /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 0000000..485ea22 --- /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 0000000..f4b69c9 --- /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 0000000..c8fa590 --- /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 0000000..0b4046d --- /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 0000000..84b04a9 --- /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 0000000..64ebf4d --- /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 0000000..d080c54 --- /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/packages/commercejs/src/auth/index.ts b/packages/commercejs/src/auth/index.ts new file mode 100644 index 0000000..36e757a --- /dev/null +++ b/packages/commercejs/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/commercejs/src/auth/use-login.tsx b/packages/commercejs/src/auth/use-login.tsx new file mode 100644 index 0000000..4287d39 --- /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 0000000..7c60f34 --- /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 0000000..1cc9538 --- /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/packages/commercejs/src/cart/index.ts b/packages/commercejs/src/cart/index.ts new file mode 100644 index 0000000..3b8ba99 --- /dev/null +++ b/packages/commercejs/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/commercejs/src/cart/use-add-item.tsx b/packages/commercejs/src/cart/use-add-item.tsx new file mode 100644 index 0000000..3bbad11 --- /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 0000000..57592ec --- /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 0000000..c9e5787 --- /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 0000000..1546be0 --- /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 0000000..3066210 --- /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 0000000..52a19a7 --- /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 0000000..2cb7232 --- /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 0000000..ba52b04 --- /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 0000000..33a7677 --- /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 0000000..1fb07c0 --- /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 0000000..0f02059 --- /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 0000000..a56255d --- /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 0000000..4048ca2 --- /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 0000000..d4c179b --- /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 0000000..7c956a6 --- /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/packages/commercejs/src/customer/index.ts b/packages/commercejs/src/customer/index.ts new file mode 100644 index 0000000..6c903ec --- /dev/null +++ b/packages/commercejs/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/packages/commercejs/src/customer/use-customer.tsx b/packages/commercejs/src/customer/use-customer.tsx new file mode 100644 index 0000000..4906223 --- /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 0000000..ab47ae9 --- /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 0000000..9da7c11 --- /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 0000000..8acea54 --- /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 0000000..0c9e96b --- /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/packages/commercejs/src/product/index.ts b/packages/commercejs/src/product/index.ts new file mode 100644 index 0000000..426a3ed --- /dev/null +++ b/packages/commercejs/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/commercejs/src/product/use-price.tsx b/packages/commercejs/src/product/use-price.tsx new file mode 100644 index 0000000..fd42d70 --- /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 0000000..ec8ad61 --- /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 0000000..d596fa9 --- /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 0000000..9de6839 --- /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 0000000..970d5cf --- /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 0000000..23b8daa --- /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 0000000..c637055 --- /dev/null +++ b/packages/commercejs/src/types/customer.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/customer' diff --git a/packages/commercejs/src/types/index.ts b/packages/commercejs/src/types/index.ts new file mode 100644 index 0000000..7ab0b7f --- /dev/null +++ b/packages/commercejs/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/commercejs/src/types/login.ts b/packages/commercejs/src/types/login.ts new file mode 100644 index 0000000..0706a2f --- /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 0000000..1de06f8 --- /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 0000000..12f6b02 --- /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 0000000..7cdab70 --- /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 0000000..3f0d1af --- /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 0000000..346278b --- /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 0000000..af92d9f --- /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 0000000..b0926ab --- /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 0000000..c01ea6d --- /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 0000000..4190092 --- /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 0000000..db136e0 --- /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 0000000..86c42d9 --- /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 0000000..9a4d429 --- /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/packages/commercejs/src/wishlist/use-add-item.tsx b/packages/commercejs/src/wishlist/use-add-item.tsx new file mode 100644 index 0000000..75f067c --- /dev/null +++ b/packages/commercejs/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/commercejs/src/wishlist/use-remove-item.tsx b/packages/commercejs/src/wishlist/use-remove-item.tsx new file mode 100644 index 0000000..a2d3a8a --- /dev/null +++ b/packages/commercejs/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/packages/commercejs/src/wishlist/use-wishlist.tsx b/packages/commercejs/src/wishlist/use-wishlist.tsx new file mode 100644 index 0000000..7816143 --- /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 0000000..39b1b2a --- /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 0000000..8f98f04 --- /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 0000000..2636d4d --- /dev/null +++ b/packages/kibocommerce/.env.template @@ -0,0 +1,7 @@ +COMMERCE_PROVIDER=@vercel/commerce-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 0000000..f06235c --- /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 0000000..e1076ed --- /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 0000000..13fa331 --- /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 0000000..ede2d2f --- /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 0000000..6a29128 --- /dev/null +++ b/packages/kibocommerce/package.json @@ -0,0 +1,87 @@ +{ + "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", + "lodash.debounce": "^4.0.8" + }, + "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/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/packages/kibocommerce/schema.d.ts b/packages/kibocommerce/schema.d.ts new file mode 100644 index 0000000..cf52dde --- /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 0000000..8d02ae5 --- /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 0000000..6dfea1e --- /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 0000000..6a6ec3a --- /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 0000000..d4e8118 --- /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 0000000..62f6afd --- /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 0000000..b42ff34 --- /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 0000000..a838eb5 --- /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 0000000..189922d --- /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/packages/kibocommerce/src/api/endpoints/checkout/index.ts b/packages/kibocommerce/src/api/endpoints/checkout/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/checkout/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/kibocommerce/src/api/endpoints/customer/address.ts b/packages/kibocommerce/src/api/endpoints/customer/address.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/customer/address.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/kibocommerce/src/api/endpoints/customer/card.ts b/packages/kibocommerce/src/api/endpoints/customer/card.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/kibocommerce/src/api/endpoints/customer/card.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} 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 0000000..c2e6db7 --- /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 0000000..20bd44d --- /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 0000000..679a92d --- /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 0000000..7a08069 --- /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 0000000..00804af --- /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 0000000..1b0835e --- /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 0000000..8b2fec0 --- /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 0000000..b3d9884 --- /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 0000000..49cfc37 --- /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 0000000..be4c403 --- /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 0000000..58344be --- /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 0000000..ae6a8d8 --- /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 0000000..9518130 --- /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 0000000..e6be159 --- /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 0000000..b69d008 --- /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 0000000..e29ffa7 --- /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 0000000..dee242a --- /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 0000000..aa6d960 --- /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 0000000..f9088b0 --- /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 0000000..7cbf688 --- /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 0000000..66ad883 --- /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 0000000..730aded --- /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 0000000..3cf5c5a --- /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 0000000..ce3d994 --- /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 0000000..bb25534 --- /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 0000000..7b2cd5c --- /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 0000000..7607e19 --- /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 0000000..3067b67 --- /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 0000000..bddafbf --- /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 0000000..c2792ad --- /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 0000000..69289cb --- /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 0000000..c41b1bf --- /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 0000000..6b72d3b --- /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/packages/kibocommerce/src/api/operations/index.ts b/packages/kibocommerce/src/api/operations/index.ts new file mode 100644 index 0000000..086fdf8 --- /dev/null +++ b/packages/kibocommerce/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/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 0000000..6926914 --- /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 0000000..3c6599e --- /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 0000000..031ffc0 --- /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 0000000..5bbf5bb --- /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 0000000..9848336 --- /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 0000000..9528b84 --- /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 0000000..d2ae3ed --- /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 0000000..69371d0 --- /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 0000000..47db311 --- /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 0000000..d22f0ef --- /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 0000000..20cfc74 --- /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 0000000..b4c950f --- /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 0000000..cf84f5e --- /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 0000000..fa3a214 --- /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/packages/kibocommerce/src/api/utils/fetch.ts b/packages/kibocommerce/src/api/utils/fetch.ts new file mode 100644 index 0000000..9d9fff3 --- /dev/null +++ b/packages/kibocommerce/src/api/utils/fetch.ts @@ -0,0 +1,3 @@ +import zeitFetch from '@vercel/fetch' + +export default zeitFetch() 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 0000000..9325a4e --- /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 0000000..5ba3d77 --- /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/packages/kibocommerce/src/auth/index.ts b/packages/kibocommerce/src/auth/index.ts new file mode 100644 index 0000000..36e757a --- /dev/null +++ b/packages/kibocommerce/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/kibocommerce/src/auth/use-login.tsx b/packages/kibocommerce/src/auth/use-login.tsx new file mode 100644 index 0000000..c9d1fac --- /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 0000000..83e5a4b --- /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 0000000..b06126d --- /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/packages/kibocommerce/src/cart/index.ts b/packages/kibocommerce/src/cart/index.ts new file mode 100644 index 0000000..3b8ba99 --- /dev/null +++ b/packages/kibocommerce/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/kibocommerce/src/cart/use-add-item.tsx b/packages/kibocommerce/src/cart/use-add-item.tsx new file mode 100644 index 0000000..bb7b8be --- /dev/null +++ b/packages/kibocommerce/src/cart/use-add-item.tsx @@ -0,0 +1,44 @@ +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 0000000..0af0738 --- /dev/null +++ b/packages/kibocommerce/src/cart/use-cart.tsx @@ -0,0 +1,33 @@ +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 0000000..3fa883c --- /dev/null +++ b/packages/kibocommerce/src/cart/use-remove-item.tsx @@ -0,0 +1,56 @@ +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) => < + T extends LineItem | undefined = undefined + >( + 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 0000000..931782c --- /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) => < + T extends LineItem | undefined = undefined + >( + 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 0000000..cab52bb --- /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 0000000..cd58f1e --- /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 0000000..fabd11b --- /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 0000000..938e6cd --- /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/packages/kibocommerce/src/customer/index.ts b/packages/kibocommerce/src/customer/index.ts new file mode 100644 index 0000000..6c903ec --- /dev/null +++ b/packages/kibocommerce/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/packages/kibocommerce/src/customer/use-customer.tsx b/packages/kibocommerce/src/customer/use-customer.tsx new file mode 100644 index 0000000..73e804a --- /dev/null +++ b/packages/kibocommerce/src/customer/use-customer.tsx @@ -0,0 +1,24 @@ +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 0000000..bc8a6b9 --- /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 0000000..43077a5 --- /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 0000000..89fd245 --- /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/packages/kibocommerce/src/lib/get-slug.ts b/packages/kibocommerce/src/lib/get-slug.ts new file mode 100644 index 0000000..329c5a2 --- /dev/null +++ b/packages/kibocommerce/src/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/packages/kibocommerce/src/lib/normalize.ts b/packages/kibocommerce/src/lib/normalize.ts new file mode 100644 index 0000000..363589f --- /dev/null +++ b/packages/kibocommerce/src/lib/normalize.ts @@ -0,0 +1,180 @@ +import type { PrCategory, CustomerAccountInput, Document } from '../../schema' +import { Page } from '../types/page'; +import { Customer } from '../types/customer' + +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 0000000..c1aeb1c --- /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 0000000..37c4d81 --- /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 0000000..2c194c9 --- /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 0000000..79a348c --- /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/packages/kibocommerce/src/product/index.ts b/packages/kibocommerce/src/product/index.ts new file mode 100644 index 0000000..426a3ed --- /dev/null +++ b/packages/kibocommerce/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/kibocommerce/src/product/use-price.tsx b/packages/kibocommerce/src/product/use-price.tsx new file mode 100644 index 0000000..fd42d70 --- /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 0000000..4a9107b --- /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 0000000..8ca1ddf --- /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 0000000..29f68fe --- /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 0000000..2e7b198 --- /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 0000000..1de06f8 --- /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 0000000..f311eb8 --- /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 0000000..3f0d1af --- /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 0000000..241af3c --- /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 0000000..3f634e3 --- /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 0000000..490154a --- /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 0000000..a91eb41 --- /dev/null +++ b/packages/kibocommerce/src/wishlist/use-wishlist.tsx @@ -0,0 +1,52 @@ +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 + }, + enumerable: true, + }, + }), + [response] + ) + }, +} diff --git a/packages/kibocommerce/taskfile.js b/packages/kibocommerce/taskfile.js new file mode 100644 index 0000000..39b1b2a --- /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 0000000..cd04ab2 --- /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/packages/local/.env.template b/packages/local/.env.template new file mode 100644 index 0000000..a6272a1 --- /dev/null +++ b/packages/local/.env.template @@ -0,0 +1 @@ +COMMERCE_PROVIDER=@vercel/commerce-local \ No newline at end of file diff --git a/packages/local/.prettierignore b/packages/local/.prettierignore new file mode 100644 index 0000000..f06235c --- /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 0000000..e1076ed --- /dev/null +++ b/packages/local/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/local/README.md b/packages/local/README.md new file mode 100644 index 0000000..a3bc1db --- /dev/null +++ b/packages/local/README.md @@ -0,0 +1 @@ +# Next.js Local Provider diff --git a/packages/local/package.json b/packages/local/package.json new file mode 100644 index 0000000..3ec3e69 --- /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/packages/local/src/api/endpoints/cart/index.ts b/packages/local/src/api/endpoints/cart/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/local/src/api/endpoints/cart/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/local/src/api/endpoints/catalog/index.ts b/packages/local/src/api/endpoints/catalog/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/local/src/api/endpoints/catalog/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/local/src/api/endpoints/catalog/products.ts b/packages/local/src/api/endpoints/catalog/products.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/local/src/api/endpoints/catalog/products.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/local/src/api/endpoints/checkout/index.ts b/packages/local/src/api/endpoints/checkout/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/local/src/api/endpoints/checkout/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/local/src/api/endpoints/customer/address.ts b/packages/local/src/api/endpoints/customer/address.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/local/src/api/endpoints/customer/address.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/local/src/api/endpoints/customer/card.ts b/packages/local/src/api/endpoints/customer/card.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/local/src/api/endpoints/customer/card.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/local/src/api/endpoints/customer/index.ts b/packages/local/src/api/endpoints/customer/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/local/src/api/endpoints/customer/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} 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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /dev/null +++ b/packages/local/src/api/endpoints/wishlist/index.tsx @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/local/src/api/index.ts b/packages/local/src/api/index.ts new file mode 100644 index 0000000..3b24a30 --- /dev/null +++ b/packages/local/src/api/index.ts @@ -0,0 +1,42 @@ +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' +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 LocalConfig extends CommerceAPIConfig {} +const config: LocalConfig = { + commerceUrl: '', + apiToken: '', + cartCookie: '', + customerCookie: '', + cartCookieMaxAge: 2592000, + fetch: createFetcher(() => getCommerceApi().getConfig()), +} + +const operations = { + getAllPages, + getPage, + getSiteInfo, + getCustomerWishlist, + getAllProductPaths, + getAllProducts, + getProduct, +} + +export const provider = { config, operations } + +export type Provider = typeof provider +export type LocalAPI

= CommerceAPI

+ +export function getCommerceApi

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

{ + return commerceApi(customProvider as any) +} diff --git a/packages/local/src/api/operations/get-all-pages.ts b/packages/local/src/api/operations/get-all-pages.ts new file mode 100644 index 0000000..b258fe7 --- /dev/null +++ b/packages/local/src/api/operations/get-all-pages.ts @@ -0,0 +1,19 @@ +export type Page = { url: string } +export type GetAllPagesResult = { pages: Page[] } +import type { LocalConfig } from '../index' + +export default function getAllPagesOperation() { + function getAllPages({ + config, + preview, + }: { + url?: string + config?: Partial + preview?: boolean + }): Promise { + return Promise.resolve({ + pages: [], + }) + } + return getAllPages +} diff --git a/packages/local/src/api/operations/get-all-product-paths.ts b/packages/local/src/api/operations/get-all-product-paths.ts new file mode 100644 index 0000000..fff24e7 --- /dev/null +++ b/packages/local/src/api/operations/get-all-product-paths.ts @@ -0,0 +1,15 @@ +import data from '../../data.json' + +export type GetAllProductPathsResult = { + products: Array<{ path: string }> +} + +export default function getAllProductPathsOperation() { + function getAllProductPaths(): Promise { + return Promise.resolve({ + products: data.products.map(({ path }) => ({ path })), + }) + } + + return getAllProductPaths +} diff --git a/packages/local/src/api/operations/get-all-products.ts b/packages/local/src/api/operations/get-all-products.ts new file mode 100644 index 0000000..2d11950 --- /dev/null +++ b/packages/local/src/api/operations/get-all-products.ts @@ -0,0 +1,25 @@ +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' + +export default function getAllProductsOperation({ + commerce, +}: OperationContext) { + async function getAllProducts({ + query = '', + variables, + config, + }: { + query?: string + variables?: T['variables'] + config?: Partial + preview?: boolean + } = {}): Promise<{ products: Product[] | any[] }> { + return { + products: data.products, + } + } + return getAllProducts +} diff --git a/packages/local/src/api/operations/get-customer-wishlist.ts b/packages/local/src/api/operations/get-customer-wishlist.ts new file mode 100644 index 0000000..8c34b9e --- /dev/null +++ b/packages/local/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/local/src/api/operations/get-page.ts b/packages/local/src/api/operations/get-page.ts new file mode 100644 index 0000000..b0cfdf5 --- /dev/null +++ b/packages/local/src/api/operations/get-page.ts @@ -0,0 +1,13 @@ +export type Page = any +export type GetPageResult = { page?: Page } + +export type PageVariables = { + id: number +} + +export default function getPageOperation() { + function getPage(): Promise { + return Promise.resolve({}) + } + return getPage +} diff --git a/packages/local/src/api/operations/get-product.ts b/packages/local/src/api/operations/get-product.ts new file mode 100644 index 0000000..b77be3a --- /dev/null +++ b/packages/local/src/api/operations/get-product.ts @@ -0,0 +1,26 @@ +import type { LocalConfig } from '../index' +import { Product } from '@vercel/commerce/types/product' +import { GetProductOperation } from '@vercel/commerce/types/product' +import data from '../../data.json' +import type { OperationContext } from '@vercel/commerce/api/operations' + +export default function getProductOperation({ + commerce, +}: OperationContext) { + async function getProduct({ + query = '', + variables, + config, + }: { + query?: string + variables?: T['variables'] + config?: Partial + preview?: boolean + } = {}): Promise { + return { + product: data.products.find(({ slug }) => slug === variables!.slug), + } + } + + return getProduct +} diff --git a/packages/local/src/api/operations/get-site-info.ts b/packages/local/src/api/operations/get-site-info.ts new file mode 100644 index 0000000..c07a479 --- /dev/null +++ b/packages/local/src/api/operations/get-site-info.ts @@ -0,0 +1,43 @@ +import { OperationContext } from '@vercel/commerce/api/operations' +import { Category } from '@vercel/commerce/types/site' +import { LocalConfig } from '../index' + +export type GetSiteInfoResult< + T extends { categories: any[]; brands: any[] } = { + categories: Category[] + brands: any[] + } +> = T + +export default function getSiteInfoOperation({}: OperationContext) { + function getSiteInfo({ + query, + variables, + config: cfg, + }: { + query?: string + variables?: any + config?: Partial + preview?: boolean + } = {}): Promise { + return Promise.resolve({ + categories: [ + { + id: 'new-arrivals', + name: 'New Arrivals', + slug: 'new-arrivals', + path: '/new-arrivals', + }, + { + id: 'featured', + name: 'Featured', + slug: 'featured', + path: '/featured', + }, + ], + brands: [], + }) + } + + return getSiteInfo +} diff --git a/packages/local/src/api/operations/index.ts b/packages/local/src/api/operations/index.ts new file mode 100644 index 0000000..086fdf8 --- /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/packages/local/src/api/utils/fetch-local.ts b/packages/local/src/api/utils/fetch-local.ts new file mode 100644 index 0000000..ae84fff --- /dev/null +++ b/packages/local/src/api/utils/fetch-local.ts @@ -0,0 +1,34 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { GraphQLFetcher } from '@vercel/commerce/api' +import type { LocalConfig } from '../index' +import fetch from './fetch' + +const fetchGraphqlApi: (getConfig: () => LocalConfig) => GraphQLFetcher = + (getConfig) => + async (query: string, { variables, preview } = {}, fetchOptions) => { + const config = getConfig() + const res = await fetch(config.commerceUrl, { + ...fetchOptions, + method: 'POST', + headers: { + ...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 for API' }], + status: res.status, + }) + } + + return { data: json.data, res } + } + +export default fetchGraphqlApi diff --git a/packages/local/src/api/utils/fetch.ts b/packages/local/src/api/utils/fetch.ts new file mode 100644 index 0000000..9d9fff3 --- /dev/null +++ b/packages/local/src/api/utils/fetch.ts @@ -0,0 +1,3 @@ +import zeitFetch from '@vercel/fetch' + +export default zeitFetch() diff --git a/packages/local/src/auth/index.ts b/packages/local/src/auth/index.ts new file mode 100644 index 0000000..36e757a --- /dev/null +++ b/packages/local/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/local/src/auth/use-login.tsx b/packages/local/src/auth/use-login.tsx new file mode 100644 index 0000000..20e3ed2 --- /dev/null +++ b/packages/local/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/local/src/auth/use-logout.tsx b/packages/local/src/auth/use-logout.tsx new file mode 100644 index 0000000..4e74908 --- /dev/null +++ b/packages/local/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/local/src/auth/use-signup.tsx b/packages/local/src/auth/use-signup.tsx new file mode 100644 index 0000000..e488114 --- /dev/null +++ b/packages/local/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/local/src/cart/index.ts b/packages/local/src/cart/index.ts new file mode 100644 index 0000000..3b8ba99 --- /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/packages/local/src/cart/use-add-item.tsx b/packages/local/src/cart/use-add-item.tsx new file mode 100644 index 0000000..2be6e0a --- /dev/null +++ b/packages/local/src/cart/use-add-item.tsx @@ -0,0 +1,17 @@ +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 = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => { + return async function addItem() { + return {} + } + }, +} diff --git a/packages/local/src/cart/use-cart.tsx b/packages/local/src/cart/use-cart.tsx new file mode 100644 index 0000000..8f92de3 --- /dev/null +++ b/packages/local/src/cart/use-cart.tsx @@ -0,0 +1,42 @@ +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: { + query: '', + }, + async fetcher() { + return { + id: '', + createdAt: '', + currency: { code: '' }, + taxesIncluded: '', + lineItems: [], + lineItemsSubtotalPrice: '', + subtotalPrice: 0, + totalPrice: 0, + } + }, + useHook: + ({ useData }) => + (input) => { + return useMemo( + () => + Object.create( + {}, + { + isEmpty: { + get() { + return true + }, + enumerable: true, + }, + } + ), + [] + ) + }, +} diff --git a/packages/local/src/cart/use-remove-item.tsx b/packages/local/src/cart/use-remove-item.tsx new file mode 100644 index 0000000..92d52c9 --- /dev/null +++ b/packages/local/src/cart/use-remove-item.tsx @@ -0,0 +1,20 @@ +import { MutationHook } from '@vercel/commerce/utils/types' +import useRemoveItem, { + UseRemoveItem, +} from '@vercel/commerce/cart/use-remove-item' + +export default useRemoveItem as UseRemoveItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => { + return async function removeItem(input) { + return {} + } + }, +} diff --git a/packages/local/src/cart/use-update-item.tsx b/packages/local/src/cart/use-update-item.tsx new file mode 100644 index 0000000..950f422 --- /dev/null +++ b/packages/local/src/cart/use-update-item.tsx @@ -0,0 +1,20 @@ +import { MutationHook } from '@vercel/commerce/utils/types' +import useUpdateItem, { + UseUpdateItem, +} from '@vercel/commerce/cart/use-update-item' + +export default useUpdateItem as UseUpdateItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => { + return async function addItem() { + return {} + } + }, +} diff --git a/packages/local/src/checkout/use-checkout.tsx b/packages/local/src/checkout/use-checkout.tsx new file mode 100644 index 0000000..76997be --- /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/packages/local/src/commerce.config.json b/packages/local/src/commerce.config.json new file mode 100644 index 0000000..0e77dd1 --- /dev/null +++ b/packages/local/src/commerce.config.json @@ -0,0 +1,10 @@ +{ + "provider": "local", + "features": { + "wishlist": false, + "cart": false, + "search": 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 0000000..4f85c84 --- /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 0000000..77d149e --- /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/packages/local/src/customer/index.ts b/packages/local/src/customer/index.ts new file mode 100644 index 0000000..6c903ec --- /dev/null +++ b/packages/local/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/packages/local/src/customer/use-customer.tsx b/packages/local/src/customer/use-customer.tsx new file mode 100644 index 0000000..04c4894 --- /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/packages/local/src/data.json b/packages/local/src/data.json new file mode 100644 index 0000000..18c8ee7 --- /dev/null +++ b/packages/local/src/data.json @@ -0,0 +1,235 @@ +{ + "products": [ + { + "id": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjA=", + "name": "New Short Sleeve T-Shirt", + "vendor": "Next.js", + "path": "/new-short-sleeve-t-shirt", + "slug": "new-short-sleeve-t-shirt", + "price": { "value": 25, "currencyCode": "USD" }, + "descriptionHtml": "

Show off your love for Next.js and Vercel with this unique, limited edition t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! All proceeds will be donated to charity.

", + "images": [ + { + "url": "/assets/drop-shirt-0.png", + "altText": "Shirt", + "width": 1000, + "height": 1000 + }, + { + "url": "/assets/drop-shirt-1.png", + "altText": "Shirt", + "width": 1000, + "height": 1000 + }, + { + "url": "/assets/drop-shirt-2.png", + "altText": "Shirt", + "width": 1000, + "height": 1000 + } + ], + "variants": [ + { + "id": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjAss=", + "options": [ + { + "__typename": "MultipleChoiceOption", + "id": "asd", + "displayName": "Size", + "values": [ + { + "label": "XL" + } + ] + } + ] + } + ], + "options": [ + { + "id": "option-color", + "displayName": "Color", + "values": [ + { + "label": "color", + "hexColors": ["#222"] + } + ] + }, + { + "id": "option-size", + "displayName": "Size", + "values": [ + { + "label": "S" + }, + { + "label": "M" + }, + { + "label": "L" + } + ] + } + ] + }, + { + "id": "Z2lkOi8vc2hvcGlmeS9Qcm9ksdWN0LzU0NDczMjUwMjQ0MjA=", + "name": "Lightweight Jacket", + "vendor": "Next.js", + "path": "/lightweight-jacket", + "slug": "lightweight-jacket", + "price": { "value": 249.99, "currencyCode": "USD" }, + "descriptionHtml": "

Show off your love for Next.js and Vercel with this unique, limited edition t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! All proceeds will be donated to charity.

", + "images": [ + { + "url": "/assets/lightweight-jacket-0.png", + "altText": "Lightweight Jacket", + "width": 1000, + "height": 1000 + }, + { + "url": "/assets/lightweight-jacket-1.png", + "altText": "Lightweight Jacket", + "width": 1000, + "height": 1000 + }, + { + "url": "/assets/lightweight-jacket-2.png", + "altText": "Lightweight Jacket", + "width": 1000, + "height": 1000 + } + ], + "variants": [ + { + "id": "Z2lkOid8vc2hvcGlmeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjAss=", + "options": [ + { + "__typename": "MultipleChoiceOption", + "id": "asd", + "displayName": "Size", + "values": [ + { + "label": "XL" + } + ] + } + ] + } + ], + "options": [ + { + "id": "option-color", + "displayName": "Color", + "values": [ + { + "label": "color", + "hexColors": ["#222"] + } + ] + }, + { + "id": "option-size", + "displayName": "Size", + "values": [ + { + "label": "S" + }, + { + "label": "M" + }, + { + "label": "L" + } + ] + } + ] + }, + { + "id": "Z2lkOis8vc2hvcGlmsddeS9Qcm9kdWN0LzU0NDczMjUwMjQ0MjA=", + "name": "Shirt", + "vendor": "Next.js", + "path": "/shirt", + "slug": "shirt", + "price": { "value": 25, "currencyCode": "USD" }, + "descriptionHtml": "

Show off your love for Next.js and Vercel with this unique, limited edition t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! All proceeds will be donated to charity.

", + "images": [ + { + "url": "/assets/t-shirt-0.png", + "altText": "Shirt", + "width": 1000, + "height": 1000 + }, + { + "url": "/assets/t-shirt-1.png", + "altText": "Shirt", + "width": 1000, + "height": 1000 + }, + { + "url": "/assets/t-shirt-2.png", + "altText": "Shirt", + "width": 1000, + "height": 1000 + }, + { + "url": "/assets/t-shirt-3.png", + "altText": "Shirt", + "width": 1000, + "height": 1000 + }, + { + "url": "/assets/t-shirt-4.png", + "altText": "Shirt", + "width": 1000, + "height": 1000 + } + ], + "variants": [ + { + "id": "Z2lkOi8vc2hvcGlmeS9Qcms9kdWN0LzU0NDczMjUwMjQ0MjAss=", + "options": [ + { + "__typename": "MultipleChoiceOption", + "id": "asd", + "displayName": "Size", + "values": [ + { + "label": "XL" + } + ] + } + ] + } + ], + "options": [ + { + "id": "option-color", + "displayName": "Color", + "values": [ + { + "label": "color", + "hexColors": ["#222"] + } + ] + }, + { + "id": "option-size", + "displayName": "Size", + "values": [ + { + "label": "S" + }, + { + "label": "M" + }, + { + "label": "L" + } + ] + } + ] + } + ] +} diff --git a/packages/local/src/fetcher.ts b/packages/local/src/fetcher.ts new file mode 100644 index 0000000..27f3ceb --- /dev/null +++ b/packages/local/src/fetcher.ts @@ -0,0 +1,11 @@ +import { Fetcher } from '@vercel/commerce/utils/types' + +export const fetcher: Fetcher = async () => { + console.log('FETCHER') + const res = await fetch('./data.json') + if (res.ok) { + const { data } = await res.json() + return data + } + throw res +} diff --git a/packages/local/src/index.tsx b/packages/local/src/index.tsx new file mode 100644 index 0000000..ae3df81 --- /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/packages/local/src/next.config.cjs b/packages/local/src/next.config.cjs new file mode 100644 index 0000000..ce46b70 --- /dev/null +++ b/packages/local/src/next.config.cjs @@ -0,0 +1,8 @@ +const commerce = require('./commerce.config.json') + +module.exports = { + commerce, + images: { + domains: ['localhost'], + }, +} diff --git a/packages/local/src/product/index.ts b/packages/local/src/product/index.ts new file mode 100644 index 0000000..426a3ed --- /dev/null +++ b/packages/local/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/local/src/product/use-price.tsx b/packages/local/src/product/use-price.tsx new file mode 100644 index 0000000..fd42d70 --- /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/packages/local/src/product/use-search.tsx b/packages/local/src/product/use-search.tsx new file mode 100644 index 0000000..b84889c --- /dev/null +++ b/packages/local/src/product/use-search.tsx @@ -0,0 +1,17 @@ +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: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: () => () => { + return { + data: { + products: [], + }, + } + }, +} diff --git a/packages/local/src/provider.ts b/packages/local/src/provider.ts new file mode 100644 index 0000000..53dc7f5 --- /dev/null +++ b/packages/local/src/provider.ts @@ -0,0 +1,22 @@ +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' + +export const localProvider = { + locale: 'en-us', + cartCookie: 'session', + fetcher: fetcher, + cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, + customer: { useCustomer }, + products: { useSearch }, + auth: { useLogin, useLogout, useSignup }, +} + +export type LocalProvider = typeof localProvider diff --git a/packages/local/src/wishlist/use-add-item.tsx b/packages/local/src/wishlist/use-add-item.tsx new file mode 100644 index 0000000..75f067c --- /dev/null +++ b/packages/local/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/local/src/wishlist/use-remove-item.tsx b/packages/local/src/wishlist/use-remove-item.tsx new file mode 100644 index 0000000..a2d3a8a --- /dev/null +++ b/packages/local/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/packages/local/src/wishlist/use-wishlist.tsx b/packages/local/src/wishlist/use-wishlist.tsx new file mode 100644 index 0000000..b2785d4 --- /dev/null +++ b/packages/local/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/local/taskfile.js b/packages/local/taskfile.js new file mode 100644 index 0000000..39b1b2a --- /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 0000000..cd04ab2 --- /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 0000000..1423065 --- /dev/null +++ b/packages/ordercloud/.env.template @@ -0,0 +1,6 @@ +COMMERCE_PROVIDER=@vercel/commerce-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 0000000..f06235c --- /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 0000000..e1076ed --- /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 0000000..ca1438e --- /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 0000000..43eeac9 --- /dev/null +++ b/packages/ordercloud/package.json @@ -0,0 +1,82 @@ +{ + "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", + "lodash.debounce": "^4.0.8" + }, + "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/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/packages/ordercloud/src/api/endpoints/cart/add-item.ts b/packages/ordercloud/src/api/endpoints/cart/add-item.ts new file mode 100644 index 0000000..28d372b --- /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 0000000..7ea077b --- /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 0000000..f36364c --- /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 0000000..ea9c46e --- /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 0000000..20113ba --- /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 0000000..ad8d391 --- /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 0000000..d775d6f --- /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 0000000..c0ab1a4 --- /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 0000000..44a9a69 --- /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 0000000..8cd9be5 --- /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 0000000..434c240 --- /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 0000000..2e27591 --- /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 0000000..f6ab7e3 --- /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 0000000..fba4e11 --- /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 0000000..4c4b4b9 --- /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 0000000..ad7dead --- /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 0000000..e775208 --- /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 0000000..7116e3c --- /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 0000000..1a81d1c --- /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 0000000..9770644 --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..d1a809e --- /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 0000000..2720e52 --- /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 0000000..8a79bee --- /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 0000000..5b4861f --- /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 0000000..e403d16 --- /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 0000000..b63b86c --- /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 0000000..ec0ed5d --- /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 0000000..84b04a9 --- /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 0000000..716f352 --- /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 0000000..3c1058d --- /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 0000000..5b70b9d --- /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 0000000..36e757a --- /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 0000000..20e3ed2 --- /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 0000000..4e74908 --- /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 0000000..e488114 --- /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 0000000..3b8ba99 --- /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 0000000..c9d3153 --- /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 0000000..01c3a1c --- /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 0000000..fba15f8 --- /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 0000000..7a5f6fc --- /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 0000000..3066210 --- /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 0000000..f60ebfd --- /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 0000000..79c4384 --- /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/packages/ordercloud/src/commerce.config.json b/packages/ordercloud/src/commerce.config.json new file mode 100644 index 0000000..e329bd4 --- /dev/null +++ b/packages/ordercloud/src/commerce.config.json @@ -0,0 +1,10 @@ +{ + "provider": "ordercloud", + "features": { + "wishlist": false, + "cart": true, + "search": true, + "customerAuth": false, + "customCheckout": true + } +} diff --git a/packages/ordercloud/src/constants.ts b/packages/ordercloud/src/constants.ts new file mode 100644 index 0000000..d89b13f --- /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 0000000..02c73e5 --- /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 0000000..798f5fe --- /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 0000000..fd6807a --- /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 0000000..ac805db --- /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 0000000..d65956b --- /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 0000000..357d305 --- /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 0000000..8e7d278 --- /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 0000000..6438543 --- /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 0000000..23979bf --- /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 0000000..faa9007 --- /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/packages/ordercloud/src/customer/index.ts b/packages/ordercloud/src/customer/index.ts new file mode 100644 index 0000000..6c903ec --- /dev/null +++ b/packages/ordercloud/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/packages/ordercloud/src/customer/use-customer.tsx b/packages/ordercloud/src/customer/use-customer.tsx new file mode 100644 index 0000000..6eaede1 --- /dev/null +++ b/packages/ordercloud/src/customer/use-customer.tsx @@ -0,0 +1,15 @@ +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/packages/ordercloud/src/fetcher.ts b/packages/ordercloud/src/fetcher.ts new file mode 100644 index 0000000..1da3571 --- /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 0000000..b282942 --- /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/packages/ordercloud/src/next.config.cjs b/packages/ordercloud/src/next.config.cjs new file mode 100644 index 0000000..793a458 --- /dev/null +++ b/packages/ordercloud/src/next.config.cjs @@ -0,0 +1,8 @@ +const commerce = require('./commerce.config.json') + +module.exports = { + commerce, + images: { + 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 0000000..426a3ed --- /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 0000000..fd42d70 --- /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 0000000..0cb54e9 --- /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 0000000..7ae3f1d --- /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 0000000..389a5a6 --- /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 0000000..247844a --- /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 0000000..976d78e --- /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 0000000..3576b67 --- /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 0000000..293d504 --- /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 0000000..ee2452c --- /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 0000000..8ccb778 --- /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 0000000..6da3bf8 --- /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/packages/ordercloud/src/wishlist/use-add-item.tsx b/packages/ordercloud/src/wishlist/use-add-item.tsx new file mode 100644 index 0000000..75f067c --- /dev/null +++ b/packages/ordercloud/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/ordercloud/src/wishlist/use-remove-item.tsx b/packages/ordercloud/src/wishlist/use-remove-item.tsx new file mode 100644 index 0000000..a2d3a8a --- /dev/null +++ b/packages/ordercloud/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/packages/ordercloud/src/wishlist/use-wishlist.tsx b/packages/ordercloud/src/wishlist/use-wishlist.tsx new file mode 100644 index 0000000..b2785d4 --- /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 0000000..39b1b2a --- /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 0000000..cd04ab2 --- /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/packages/saleor/.env.template b/packages/saleor/.env.template new file mode 100644 index 0000000..a3ab112 --- /dev/null +++ b/packages/saleor/.env.template @@ -0,0 +1,4 @@ +COMMERCE_PROVIDER=@vercel/commerce-saleor + +NEXT_SALEOR_API_URL= +NEXT_SALEOR_CHANNEL= diff --git a/packages/saleor/.prettierignore b/packages/saleor/.prettierignore new file mode 100644 index 0000000..f06235c --- /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 0000000..e1076ed --- /dev/null +++ b/packages/saleor/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/saleor/README.md b/packages/saleor/README.md new file mode 100644 index 0000000..2776396 --- /dev/null +++ b/packages/saleor/README.md @@ -0,0 +1,22 @@ +## Saleor Provider + +**Demo:** https://saleor.vercel.store/ + +You need a [Saleor](https://saleor.io/) instance, either in the cloud or self-hosted. + +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 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. + +``` +COMMERCE_PROVIDER=saleor +NEXT_PUBLIC_SALEOR_API_URL=https://vercel.saleor.cloud/graphql/ +NEXT_PUBLIC_SALEOR_CHANNEL=default-channel +COMMERCE_IMAGE_HOST=vercel.saleor.cloud +``` diff --git a/packages/saleor/codegen.json b/packages/saleor/codegen.json new file mode 100644 index 0000000..abbbbf1 --- /dev/null +++ b/packages/saleor/codegen.json @@ -0,0 +1,33 @@ +{ + "schema": { + "https://master.staging.saleor.cloud/graphql/": {} + }, + "documents": [ + { + "./src/utils/queries/get-all-products-query.ts": { + "noRequire": true + } + }, + { + "./src/utils/queries/get-all-products-paths-query.ts": { + "noRequire": true + } + }, + { + "./src/utils/queries/get-products.ts": { + "noRequire": true + } + } + ], + "generates": { + "./schema.d.ts": { + "plugins": ["typescript", "typescript-operations"] + }, + "./schema.graphql": { + "plugins": ["schema-ast"] + } + }, + "hooks": { + "afterAllFileWrite": ["prettier --write"] + } +} diff --git a/packages/saleor/package.json b/packages/saleor/package.json new file mode 100644 index 0000000..16fb0a6 --- /dev/null +++ b/packages/saleor/package.json @@ -0,0 +1,87 @@ +{ + "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", + "lodash.debounce": "^4.0.8" + }, + "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/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/packages/saleor/schema.d.ts b/packages/saleor/schema.d.ts new file mode 100644 index 0000000..339e726 --- /dev/null +++ b/packages/saleor/schema.d.ts @@ -0,0 +1,11488 @@ +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 `Date` scalar type represents a Date + * value as specified by + * [iso8601](https://en.wikipedia.org/wiki/ISO_8601). + */ + Date: any + /** + * The `DateTime` scalar type represents a DateTime + * value as specified by + * [iso8601](https://en.wikipedia.org/wiki/ISO_8601). + */ + DateTime: any + /** + * The `GenericScalar` scalar type represents a generic + * GraphQL scalar value that could be: + * String, Boolean, Int, Float, List or Object. + */ + GenericScalar: any + /** + * Allows use of a JSON String for input / output from the GraphQL schema. + * + * Use of this type is *not recommended* as you lose the benefits of having a defined, static + * schema (one of the key benefits of GraphQL). + */ + JSONString: any + /** + * Positive Decimal scalar implementation. + * + * Should be used in places where value must be positive. + */ + PositiveDecimal: any + UUID: any + /** Variables of this type must be set to null in mutations. They will be replaced with a filename from a following multipart part containing a binary file. See: https://github.com/jaydenseric/graphql-multipart-request-spec. */ + Upload: any + WeightScalar: any + /** Anything */ + _Any: any +} + +/** Create a new address for the customer. */ +export type AccountAddressCreate = { + __typename?: 'AccountAddressCreate' + /** A user instance for which the address was created. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array + address?: Maybe
+} + +/** Delete an address of the logged-in user. */ +export type AccountAddressDelete = { + __typename?: 'AccountAddressDelete' + /** A user instance for which the address was deleted. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array + address?: Maybe
+} + +/** Updates an address of the logged-in user. */ +export type AccountAddressUpdate = { + __typename?: 'AccountAddressUpdate' + /** A user object for which the address was edited. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array + address?: Maybe
+} + +/** Remove user account. */ +export type AccountDelete = { + __typename?: 'AccountDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array + user?: Maybe +} + +export type AccountError = { + __typename?: 'AccountError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: AccountErrorCode + /** A type of address that causes the error. */ + addressType?: Maybe +} + +/** An enumeration. */ +export enum AccountErrorCode { + ActivateOwnAccount = 'ACTIVATE_OWN_ACCOUNT', + ActivateSuperuserAccount = 'ACTIVATE_SUPERUSER_ACCOUNT', + DuplicatedInputItem = 'DUPLICATED_INPUT_ITEM', + DeactivateOwnAccount = 'DEACTIVATE_OWN_ACCOUNT', + DeactivateSuperuserAccount = 'DEACTIVATE_SUPERUSER_ACCOUNT', + DeleteNonStaffUser = 'DELETE_NON_STAFF_USER', + DeleteOwnAccount = 'DELETE_OWN_ACCOUNT', + DeleteStaffAccount = 'DELETE_STAFF_ACCOUNT', + DeleteSuperuserAccount = 'DELETE_SUPERUSER_ACCOUNT', + GraphqlError = 'GRAPHQL_ERROR', + Inactive = 'INACTIVE', + Invalid = 'INVALID', + InvalidPassword = 'INVALID_PASSWORD', + LeftNotManageablePermission = 'LEFT_NOT_MANAGEABLE_PERMISSION', + InvalidCredentials = 'INVALID_CREDENTIALS', + NotFound = 'NOT_FOUND', + OutOfScopeUser = 'OUT_OF_SCOPE_USER', + OutOfScopeGroup = 'OUT_OF_SCOPE_GROUP', + OutOfScopePermission = 'OUT_OF_SCOPE_PERMISSION', + PasswordEntirelyNumeric = 'PASSWORD_ENTIRELY_NUMERIC', + PasswordTooCommon = 'PASSWORD_TOO_COMMON', + PasswordTooShort = 'PASSWORD_TOO_SHORT', + PasswordTooSimilar = 'PASSWORD_TOO_SIMILAR', + Required = 'REQUIRED', + Unique = 'UNIQUE', + JwtSignatureExpired = 'JWT_SIGNATURE_EXPIRED', + JwtInvalidToken = 'JWT_INVALID_TOKEN', + JwtDecodeError = 'JWT_DECODE_ERROR', + JwtMissingToken = 'JWT_MISSING_TOKEN', + JwtInvalidCsrfToken = 'JWT_INVALID_CSRF_TOKEN', + ChannelInactive = 'CHANNEL_INACTIVE', + MissingChannelSlug = 'MISSING_CHANNEL_SLUG', +} + +export type AccountInput = { + /** Given name. */ + firstName?: Maybe + /** Family name. */ + lastName?: Maybe + /** Billing address of the customer. */ + defaultBillingAddress?: Maybe + /** Shipping address of the customer. */ + defaultShippingAddress?: Maybe + /** User language code. */ + languageCode?: Maybe +} + +/** Register a new user. */ +export type AccountRegister = { + __typename?: 'AccountRegister' + /** Informs whether users need to confirm their email address. */ + requiresConfirmation?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array + user?: Maybe +} + +export type AccountRegisterInput = { + /** The email address of the user. */ + email: Scalars['String'] + /** Password. */ + password: Scalars['String'] + /** Base of frontend URL that will be needed to create confirmation URL. */ + redirectUrl?: Maybe + /** User language code. */ + languageCode?: Maybe + /** User public metadata. */ + metadata?: Maybe> + /** Slug of a channel which will be used to notify users. Optional when only one channel exists. */ + channel?: Maybe +} + +/** Sends an email with the account removal link for the logged-in user. */ +export type AccountRequestDeletion = { + __typename?: 'AccountRequestDeletion' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Sets a default address for the authenticated user. */ +export type AccountSetDefaultAddress = { + __typename?: 'AccountSetDefaultAddress' + /** An updated user instance. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Updates the account of the logged-in user. */ +export type AccountUpdate = { + __typename?: 'AccountUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array + user?: Maybe +} + +/** Represents user address data. */ +export type Address = Node & { + __typename?: 'Address' + /** The ID of the object. */ + id: Scalars['ID'] + firstName: Scalars['String'] + lastName: Scalars['String'] + companyName: Scalars['String'] + streetAddress1: Scalars['String'] + streetAddress2: Scalars['String'] + city: Scalars['String'] + cityArea: Scalars['String'] + postalCode: Scalars['String'] + /** Shop's default country. */ + country: CountryDisplay + countryArea: Scalars['String'] + phone?: Maybe + /** Address is user's default shipping address. */ + isDefaultShippingAddress?: Maybe + /** Address is user's default billing address. */ + isDefaultBillingAddress?: Maybe +} + +/** Creates user address. */ +export type AddressCreate = { + __typename?: 'AddressCreate' + /** A user instance for which the address was created. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array + address?: Maybe
+} + +/** Deletes an address. */ +export type AddressDelete = { + __typename?: 'AddressDelete' + /** A user instance for which the address was deleted. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array + address?: Maybe
+} + +export type AddressInput = { + /** Given name. */ + firstName?: Maybe + /** Family name. */ + lastName?: Maybe + /** Company or organization. */ + companyName?: Maybe + /** Address. */ + streetAddress1?: Maybe + /** Address. */ + streetAddress2?: Maybe + /** City. */ + city?: Maybe + /** District. */ + cityArea?: Maybe + /** Postal code. */ + postalCode?: Maybe + /** Country. */ + country?: Maybe + /** State or province. */ + countryArea?: Maybe + /** Phone number. */ + phone?: Maybe +} + +/** Sets a default address for the given user. */ +export type AddressSetDefault = { + __typename?: 'AddressSetDefault' + /** An updated user instance. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** An enumeration. */ +export enum AddressTypeEnum { + Billing = 'BILLING', + Shipping = 'SHIPPING', +} + +/** Updates an address. */ +export type AddressUpdate = { + __typename?: 'AddressUpdate' + /** A user object for which the address was edited. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array + address?: Maybe
+} + +export type AddressValidationData = { + __typename?: 'AddressValidationData' + countryCode?: Maybe + countryName?: Maybe + addressFormat?: Maybe + addressLatinFormat?: Maybe + allowedFields?: Maybe>> + requiredFields?: Maybe>> + upperFields?: Maybe>> + countryAreaType?: Maybe + countryAreaChoices?: Maybe>> + cityType?: Maybe + cityChoices?: Maybe>> + cityAreaType?: Maybe + cityAreaChoices?: Maybe>> + postalCodeType?: Maybe + postalCodeMatchers?: Maybe>> + postalCodeExamples?: Maybe>> + postalCodePrefix?: Maybe +} + +/** Represents allocation. */ +export type Allocation = Node & { + __typename?: 'Allocation' + /** The ID of the object. */ + id: Scalars['ID'] + /** Quantity allocated for orders. */ + quantity: Scalars['Int'] + /** The warehouse were items were allocated. */ + warehouse: Warehouse +} + +/** Represents app data. */ +export type App = Node & + ObjectWithMetadata & { + __typename?: 'App' + /** The ID of the object. */ + id: Scalars['ID'] + /** Name of the app. */ + name?: Maybe + /** The date and time when the app was created. */ + created?: Maybe + /** Determine if app will be set active or not. */ + isActive?: Maybe + /** List of the app's permissions. */ + permissions?: Maybe>> + /** Last 4 characters of the tokens. */ + tokens?: Maybe>> + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** Type of the app. */ + type?: Maybe + /** List of webhooks assigned to this app. */ + webhooks?: Maybe>> + /** Description of this app. */ + aboutApp?: Maybe + /** Description of the data privacy defined for this app. */ + dataPrivacy?: Maybe + /** Url to details about the privacy policy on the app owner page. */ + dataPrivacyUrl?: Maybe + /** Homepage of the app. */ + homepageUrl?: Maybe + /** Support page for the app. */ + supportUrl?: Maybe + /** Url to iframe with the configuration for the app. */ + configurationUrl?: Maybe + /** Url to iframe with the app. */ + appUrl?: Maybe + /** Version number of the app. */ + version?: Maybe + /** JWT token used to authenticate by thridparty app. */ + accessToken?: Maybe + } + +/** Activate the app. */ +export type AppActivate = { + __typename?: 'AppActivate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + appErrors: Array + errors: Array + app?: Maybe +} + +export type AppCountableConnection = { + __typename?: 'AppCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type AppCountableEdge = { + __typename?: 'AppCountableEdge' + /** The item at the end of the edge. */ + node: App + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new app. */ +export type AppCreate = { + __typename?: 'AppCreate' + /** The newly created authentication token. */ + authToken?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + appErrors: Array + errors: Array + app?: Maybe +} + +/** Deactivate the app. */ +export type AppDeactivate = { + __typename?: 'AppDeactivate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + appErrors: Array + errors: Array + app?: Maybe +} + +/** Deletes an app. */ +export type AppDelete = { + __typename?: 'AppDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + appErrors: Array + errors: Array + app?: Maybe +} + +/** Delete failed installation. */ +export type AppDeleteFailedInstallation = { + __typename?: 'AppDeleteFailedInstallation' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + appErrors: Array + errors: Array + appInstallation?: Maybe +} + +export type AppError = { + __typename?: 'AppError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: AppErrorCode + /** List of permissions which causes the error. */ + permissions?: Maybe> +} + +/** An enumeration. */ +export enum AppErrorCode { + Forbidden = 'FORBIDDEN', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + InvalidStatus = 'INVALID_STATUS', + InvalidPermission = 'INVALID_PERMISSION', + InvalidUrlFormat = 'INVALID_URL_FORMAT', + InvalidManifestFormat = 'INVALID_MANIFEST_FORMAT', + ManifestUrlCantConnect = 'MANIFEST_URL_CANT_CONNECT', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', + OutOfScopeApp = 'OUT_OF_SCOPE_APP', + OutOfScopePermission = 'OUT_OF_SCOPE_PERMISSION', +} + +/** Fetch and validate manifest. */ +export type AppFetchManifest = { + __typename?: 'AppFetchManifest' + manifest?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + appErrors: Array + errors: Array +} + +export type AppFilterInput = { + search?: Maybe + isActive?: Maybe + type?: Maybe +} + +export type AppInput = { + /** Name of the app. */ + name?: Maybe + /** List of permission code names to assign to this app. */ + permissions?: Maybe>> +} + +/** Install new app by using app manifest. */ +export type AppInstall = { + __typename?: 'AppInstall' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + appErrors: Array + errors: Array + appInstallation?: Maybe +} + +export type AppInstallInput = { + /** Name of the app to install. */ + appName?: Maybe + /** Url to app's manifest in JSON format. */ + manifestUrl?: Maybe + /** Determine if app will be set active or not. */ + activateAfterInstallation?: Maybe + /** List of permission code names to assign to this app. */ + permissions?: Maybe>> +} + +/** Represents ongoing installation of app. */ +export type AppInstallation = Node & + Job & { + __typename?: 'AppInstallation' + appName: Scalars['String'] + manifestUrl: Scalars['String'] + /** The ID of the object. */ + id: Scalars['ID'] + /** Job status. */ + status: JobStatusEnum + /** Created date time of job in ISO 8601 format. */ + createdAt: Scalars['DateTime'] + /** Date time of job last update in ISO 8601 format. */ + updatedAt: Scalars['DateTime'] + /** Job message. */ + message?: Maybe + } + +/** Retry failed installation of new app. */ +export type AppRetryInstall = { + __typename?: 'AppRetryInstall' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + appErrors: Array + errors: Array + appInstallation?: Maybe +} + +export enum AppSortField { + /** Sort apps by name. */ + Name = 'NAME', + /** Sort apps by creation date. */ + CreationDate = 'CREATION_DATE', +} + +export type AppSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort apps by the selected field. */ + field: AppSortField +} + +/** Represents token data. */ +export type AppToken = Node & { + __typename?: 'AppToken' + /** Name of the authenticated token. */ + name?: Maybe + /** Last 4 characters of the token. */ + authToken?: Maybe + /** The ID of the object. */ + id: Scalars['ID'] +} + +/** Creates a new token. */ +export type AppTokenCreate = { + __typename?: 'AppTokenCreate' + /** The newly created authentication token. */ + authToken?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + appErrors: Array + errors: Array + appToken?: Maybe +} + +/** Deletes an authentication token assigned to app. */ +export type AppTokenDelete = { + __typename?: 'AppTokenDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + appErrors: Array + errors: Array + appToken?: Maybe +} + +export type AppTokenInput = { + /** Name of the token. */ + name?: Maybe + /** ID of app. */ + app: Scalars['ID'] +} + +/** Verify provided app token. */ +export type AppTokenVerify = { + __typename?: 'AppTokenVerify' + /** Determine if token is valid or not. */ + valid: Scalars['Boolean'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + appErrors: Array + errors: Array +} + +/** Enum determining type of your App. */ +export enum AppTypeEnum { + /** Local Saleor App. The app is fully manageable from dashboard. You can change assigned permissions, add webhooks, or authentication token */ + Local = 'LOCAL', + /** Third party external App. Installation is fully automated. Saleor uses a defined App manifest to gather all required information. */ + Thirdparty = 'THIRDPARTY', +} + +/** Updates an existing app. */ +export type AppUpdate = { + __typename?: 'AppUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + appErrors: Array + errors: Array + app?: Maybe +} + +/** An enumeration. */ +export enum AreaUnitsEnum { + SqCm = 'SQ_CM', + SqM = 'SQ_M', + SqKm = 'SQ_KM', + SqFt = 'SQ_FT', + SqYd = 'SQ_YD', + SqInch = 'SQ_INCH', +} + +/** Assigns storefront's navigation menus. */ +export type AssignNavigation = { + __typename?: 'AssignNavigation' + /** Assigned navigation menu. */ + menu?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + menuErrors: Array + errors: Array +} + +/** Custom attribute of a product. Attributes can be assigned to products and variants at the product type level. */ +export type Attribute = Node & + ObjectWithMetadata & { + __typename?: 'Attribute' + /** The ID of the object. */ + id: Scalars['ID'] + productTypes: ProductTypeCountableConnection + productVariantTypes: ProductTypeCountableConnection + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** The input type to use for entering attribute values in the dashboard. */ + inputType?: Maybe + /** The entity type which can be used as a reference. */ + entityType?: Maybe + /** Name of an attribute displayed in the interface. */ + name?: Maybe + /** Internal representation of an attribute name. */ + slug?: Maybe + /** The attribute type. */ + type?: Maybe + /** The unit of attribute values. */ + unit?: Maybe + /** List of attribute's values. */ + values?: Maybe>> + /** Whether the attribute requires values to be passed or not. */ + valueRequired: Scalars['Boolean'] + /** Whether the attribute should be visible or not in storefront. */ + visibleInStorefront: Scalars['Boolean'] + /** Whether the attribute can be filtered in storefront. */ + filterableInStorefront: Scalars['Boolean'] + /** Whether the attribute can be filtered in dashboard. */ + filterableInDashboard: Scalars['Boolean'] + /** Whether the attribute can be displayed in the admin product list. */ + availableInGrid: Scalars['Boolean'] + /** Returns translated attribute fields for the given language code. */ + translation?: Maybe + /** The position of the attribute in the storefront navigation (0 by default). */ + storefrontSearchPosition: Scalars['Int'] + } + +/** Custom attribute of a product. Attributes can be assigned to products and variants at the product type level. */ +export type AttributeProductTypesArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Custom attribute of a product. Attributes can be assigned to products and variants at the product type level. */ +export type AttributeProductVariantTypesArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Custom attribute of a product. Attributes can be assigned to products and variants at the product type level. */ +export type AttributeTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Deletes attributes. */ +export type AttributeBulkDelete = { + __typename?: 'AttributeBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + attributeErrors: Array + errors: Array +} + +export type AttributeCountableConnection = { + __typename?: 'AttributeCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type AttributeCountableEdge = { + __typename?: 'AttributeCountableEdge' + /** The item at the end of the edge. */ + node: Attribute + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates an attribute. */ +export type AttributeCreate = { + __typename?: 'AttributeCreate' + attribute?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + attributeErrors: Array + errors: Array +} + +export type AttributeCreateInput = { + /** The input type to use for entering attribute values in the dashboard. */ + inputType?: Maybe + /** The entity type which can be used as a reference. */ + entityType?: Maybe + /** Name of an attribute displayed in the interface. */ + name: Scalars['String'] + /** Internal representation of an attribute name. */ + slug?: Maybe + /** The attribute type. */ + type: AttributeTypeEnum + /** The unit of attribute values. */ + unit?: Maybe + /** List of attribute's values. */ + values?: Maybe>> + /** Whether the attribute requires values to be passed or not. */ + valueRequired?: Maybe + /** Whether the attribute is for variants only. */ + isVariantOnly?: Maybe + /** Whether the attribute should be visible or not in storefront. */ + visibleInStorefront?: Maybe + /** Whether the attribute can be filtered in storefront. */ + filterableInStorefront?: Maybe + /** Whether the attribute can be filtered in dashboard. */ + filterableInDashboard?: Maybe + /** The position of the attribute in the storefront navigation (0 by default). */ + storefrontSearchPosition?: Maybe + /** Whether the attribute can be displayed in the admin product list. */ + availableInGrid?: Maybe +} + +/** Deletes an attribute. */ +export type AttributeDelete = { + __typename?: 'AttributeDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + attributeErrors: Array + errors: Array + attribute?: Maybe +} + +/** An enumeration. */ +export enum AttributeEntityTypeEnum { + Page = 'PAGE', + Product = 'PRODUCT', +} + +export type AttributeError = { + __typename?: 'AttributeError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: AttributeErrorCode +} + +/** An enumeration. */ +export enum AttributeErrorCode { + AlreadyExists = 'ALREADY_EXISTS', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', +} + +export type AttributeFilterInput = { + valueRequired?: Maybe + isVariantOnly?: Maybe + visibleInStorefront?: Maybe + filterableInStorefront?: Maybe + filterableInDashboard?: Maybe + availableInGrid?: Maybe + metadata?: Maybe>> + search?: Maybe + ids?: Maybe>> + type?: Maybe + inCollection?: Maybe + inCategory?: Maybe + /** Specifies the channel by which the data should be sorted. */ + channel?: Maybe +} + +export type AttributeInput = { + /** Internal representation of an attribute name. */ + slug: Scalars['String'] + /** Internal representation of a value (unique per attribute). */ + values?: Maybe>> + /** The range that the returned values should be in. */ + valuesRange?: Maybe +} + +/** An enumeration. */ +export enum AttributeInputTypeEnum { + Dropdown = 'DROPDOWN', + Multiselect = 'MULTISELECT', + File = 'FILE', + Reference = 'REFERENCE', + Numeric = 'NUMERIC', + RichText = 'RICH_TEXT', +} + +/** Reorder the values of an attribute. */ +export type AttributeReorderValues = { + __typename?: 'AttributeReorderValues' + /** Attribute from which values are reordered. */ + attribute?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + attributeErrors: Array + errors: Array +} + +export enum AttributeSortField { + /** Sort attributes by name */ + Name = 'NAME', + /** Sort attributes by slug */ + Slug = 'SLUG', + /** Sort attributes by the value required flag */ + ValueRequired = 'VALUE_REQUIRED', + /** Sort attributes by the variant only flag */ + IsVariantOnly = 'IS_VARIANT_ONLY', + /** Sort attributes by visibility in the storefront */ + VisibleInStorefront = 'VISIBLE_IN_STOREFRONT', + /** Sort attributes by the filterable in storefront flag */ + FilterableInStorefront = 'FILTERABLE_IN_STOREFRONT', + /** Sort attributes by the filterable in dashboard flag */ + FilterableInDashboard = 'FILTERABLE_IN_DASHBOARD', + /** Sort attributes by their position in storefront */ + StorefrontSearchPosition = 'STOREFRONT_SEARCH_POSITION', + /** Sort attributes based on whether they can be displayed or not in a product grid. */ + AvailableInGrid = 'AVAILABLE_IN_GRID', +} + +export type AttributeSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort attributes by the selected field. */ + field: AttributeSortField +} + +export type AttributeTranslatableContent = Node & { + __typename?: 'AttributeTranslatableContent' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + /** Returns translated attribute fields for the given language code. */ + translation?: Maybe + /** Custom attribute of a product. */ + attribute?: Maybe +} + +export type AttributeTranslatableContentTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Creates/Updates translations for attribute. */ +export type AttributeTranslate = { + __typename?: 'AttributeTranslate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + translationErrors: Array + errors: Array + attribute?: Maybe +} + +export type AttributeTranslation = Node & { + __typename?: 'AttributeTranslation' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + /** Translation language. */ + language: LanguageDisplay +} + +/** An enumeration. */ +export enum AttributeTypeEnum { + ProductType = 'PRODUCT_TYPE', + PageType = 'PAGE_TYPE', +} + +/** Updates attribute. */ +export type AttributeUpdate = { + __typename?: 'AttributeUpdate' + attribute?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + attributeErrors: Array + errors: Array +} + +export type AttributeUpdateInput = { + /** Name of an attribute displayed in the interface. */ + name?: Maybe + /** Internal representation of an attribute name. */ + slug?: Maybe + /** The unit of attribute values. */ + unit?: Maybe + /** IDs of values to be removed from this attribute. */ + removeValues?: Maybe>> + /** New values to be created for this attribute. */ + addValues?: Maybe>> + /** Whether the attribute requires values to be passed or not. */ + valueRequired?: Maybe + /** Whether the attribute is for variants only. */ + isVariantOnly?: Maybe + /** Whether the attribute should be visible or not in storefront. */ + visibleInStorefront?: Maybe + /** Whether the attribute can be filtered in storefront. */ + filterableInStorefront?: Maybe + /** Whether the attribute can be filtered in dashboard. */ + filterableInDashboard?: Maybe + /** The position of the attribute in the storefront navigation (0 by default). */ + storefrontSearchPosition?: Maybe + /** Whether the attribute can be displayed in the admin product list. */ + availableInGrid?: Maybe +} + +/** Represents a value of an attribute. */ +export type AttributeValue = Node & { + __typename?: 'AttributeValue' + /** The ID of the object. */ + id: Scalars['ID'] + /** Name of a value displayed in the interface. */ + name?: Maybe + /** Internal representation of a value (unique per attribute). */ + slug?: Maybe + /** Represents the value of the attribute value. */ + value?: Maybe + /** Returns translated attribute value fields for the given language code. */ + translation?: Maybe + /** The input type to use for entering attribute values in the dashboard. */ + inputType?: Maybe + /** The ID of the attribute reference. */ + reference?: Maybe + /** Represents file URL and content type (if attribute value is a file). */ + file?: Maybe + /** Represents the text (JSON) of the attribute value. */ + richText?: Maybe +} + +/** Represents a value of an attribute. */ +export type AttributeValueTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Deletes values of attributes. */ +export type AttributeValueBulkDelete = { + __typename?: 'AttributeValueBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + attributeErrors: Array + errors: Array +} + +/** Creates a value for an attribute. */ +export type AttributeValueCreate = { + __typename?: 'AttributeValueCreate' + /** The updated attribute. */ + attribute?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + attributeErrors: Array + errors: Array + attributeValue?: Maybe +} + +export type AttributeValueCreateInput = { + /** Name of a value displayed in the interface. */ + name: Scalars['String'] + /** Represents the value of the attribute value. */ + value?: Maybe + /** Represents the text (JSON) of the attribute value. */ + richText?: Maybe +} + +/** Deletes a value of an attribute. */ +export type AttributeValueDelete = { + __typename?: 'AttributeValueDelete' + /** The updated attribute. */ + attribute?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + attributeErrors: Array + errors: Array + attributeValue?: Maybe +} + +export type AttributeValueInput = { + /** ID of the selected attribute. */ + id?: Maybe + /** The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. */ + values?: Maybe>> + /** URL of the file attribute. Every time, a new value is created. */ + file?: Maybe + /** File content type. */ + contentType?: Maybe + /** List of entity IDs that will be used as references. */ + references?: Maybe> + /** Text content in JSON format. */ + richText?: Maybe +} + +export type AttributeValueTranslatableContent = Node & { + __typename?: 'AttributeValueTranslatableContent' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + /** Returns translated attribute value fields for the given language code. */ + translation?: Maybe + /** Represents a value of an attribute. */ + attributeValue?: Maybe +} + +export type AttributeValueTranslatableContentTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Creates/Updates translations for attribute value. */ +export type AttributeValueTranslate = { + __typename?: 'AttributeValueTranslate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + translationErrors: Array + errors: Array + attributeValue?: Maybe +} + +export type AttributeValueTranslation = Node & { + __typename?: 'AttributeValueTranslation' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + richText?: Maybe + /** Translation language. */ + language: LanguageDisplay +} + +export type AttributeValueTranslationInput = { + name?: Maybe + richText?: Maybe +} + +/** Updates value of an attribute. */ +export type AttributeValueUpdate = { + __typename?: 'AttributeValueUpdate' + /** The updated attribute. */ + attribute?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + attributeErrors: Array + errors: Array + attributeValue?: Maybe +} + +export type BulkAttributeValueInput = { + /** ID of the selected attribute. */ + id?: Maybe + /** The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. */ + values: Array> +} + +export type BulkProductError = { + __typename?: 'BulkProductError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: ProductErrorCode + /** List of attributes IDs which causes the error. */ + attributes?: Maybe> + /** List of attribute values IDs which causes the error. */ + values?: Maybe> + /** Index of an input list item that caused the error. */ + index?: Maybe + /** List of warehouse IDs which causes the error. */ + warehouses?: Maybe> + /** List of channel IDs which causes the error. */ + channels?: Maybe> +} + +export type BulkStockError = { + __typename?: 'BulkStockError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: ProductErrorCode + /** List of attributes IDs which causes the error. */ + attributes?: Maybe> + /** List of attribute values IDs which causes the error. */ + values?: Maybe> + /** Index of an input list item that caused the error. */ + index?: Maybe +} + +export type CatalogueInput = { + /** Products related to the discount. */ + products?: Maybe>> + /** Categories related to the discount. */ + categories?: Maybe>> + /** Collections related to the discount. */ + collections?: Maybe>> +} + +/** Represents a single category of products. Categories allow to organize products in a tree-hierarchies which can be used for navigation in the storefront. */ +export type Category = Node & + ObjectWithMetadata & { + __typename?: 'Category' + /** The ID of the object. */ + id: Scalars['ID'] + seoTitle?: Maybe + seoDescription?: Maybe + name: Scalars['String'] + description?: Maybe + slug: Scalars['String'] + parent?: Maybe + level: Scalars['Int'] + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** + * Description of the category (JSON). + * @deprecated Will be removed in Saleor 4.0. Use the `description` field instead. + */ + descriptionJson?: Maybe + /** List of ancestors of the category. */ + ancestors?: Maybe + /** List of products in the category. */ + products?: Maybe + /** List of children of the category. */ + children?: Maybe + backgroundImage?: Maybe + /** Returns translated category fields for the given language code. */ + translation?: Maybe + } + +/** Represents a single category of products. Categories allow to organize products in a tree-hierarchies which can be used for navigation in the storefront. */ +export type CategoryAncestorsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Represents a single category of products. Categories allow to organize products in a tree-hierarchies which can be used for navigation in the storefront. */ +export type CategoryProductsArgs = { + channel?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Represents a single category of products. Categories allow to organize products in a tree-hierarchies which can be used for navigation in the storefront. */ +export type CategoryChildrenArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Represents a single category of products. Categories allow to organize products in a tree-hierarchies which can be used for navigation in the storefront. */ +export type CategoryBackgroundImageArgs = { + size?: Maybe +} + +/** Represents a single category of products. Categories allow to organize products in a tree-hierarchies which can be used for navigation in the storefront. */ +export type CategoryTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Deletes categories. */ +export type CategoryBulkDelete = { + __typename?: 'CategoryBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +export type CategoryCountableConnection = { + __typename?: 'CategoryCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type CategoryCountableEdge = { + __typename?: 'CategoryCountableEdge' + /** The item at the end of the edge. */ + node: Category + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new category. */ +export type CategoryCreate = { + __typename?: 'CategoryCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + category?: Maybe +} + +/** Deletes a category. */ +export type CategoryDelete = { + __typename?: 'CategoryDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + category?: Maybe +} + +export type CategoryFilterInput = { + search?: Maybe + metadata?: Maybe>> + ids?: Maybe>> +} + +export type CategoryInput = { + /** Category description (JSON). */ + description?: Maybe + /** Category name. */ + name?: Maybe + /** Category slug. */ + slug?: Maybe + /** Search engine optimization fields. */ + seo?: Maybe + /** Background image file. */ + backgroundImage?: Maybe + /** Alt text for a product media. */ + backgroundImageAlt?: Maybe +} + +export enum CategorySortField { + /** Sort categories by name. */ + Name = 'NAME', + /** Sort categories by product count. */ + ProductCount = 'PRODUCT_COUNT', + /** Sort categories by subcategory count. */ + SubcategoryCount = 'SUBCATEGORY_COUNT', +} + +export type CategorySortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Specifies the channel in which to sort the data. */ + channel?: Maybe + /** Sort categories by the selected field. */ + field: CategorySortField +} + +export type CategoryTranslatableContent = Node & { + __typename?: 'CategoryTranslatableContent' + /** The ID of the object. */ + id: Scalars['ID'] + seoTitle?: Maybe + seoDescription?: Maybe + name: Scalars['String'] + description?: Maybe + /** + * Description of the category (JSON). + * @deprecated Will be removed in Saleor 4.0. Use the `description` field instead. + */ + descriptionJson?: Maybe + /** Returns translated category fields for the given language code. */ + translation?: Maybe + /** Represents a single category of products. */ + category?: Maybe +} + +export type CategoryTranslatableContentTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Creates/Updates translations for Category. */ +export type CategoryTranslate = { + __typename?: 'CategoryTranslate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + translationErrors: Array + errors: Array + category?: Maybe +} + +export type CategoryTranslation = Node & { + __typename?: 'CategoryTranslation' + /** The ID of the object. */ + id: Scalars['ID'] + seoTitle?: Maybe + seoDescription?: Maybe + name: Scalars['String'] + description?: Maybe + /** Translation language. */ + language: LanguageDisplay + /** + * Translated description of the product (JSON). + * @deprecated Will be removed in Saleor 4.0. Use the `description` field instead. + */ + descriptionJson?: Maybe +} + +/** Updates a category. */ +export type CategoryUpdate = { + __typename?: 'CategoryUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + category?: Maybe +} + +/** Represents channel. */ +export type Channel = Node & { + __typename?: 'Channel' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + isActive: Scalars['Boolean'] + slug: Scalars['String'] + currencyCode: Scalars['String'] + /** Whether a channel has associated orders. */ + hasOrders: Scalars['Boolean'] +} + +/** Activate a channel. */ +export type ChannelActivate = { + __typename?: 'ChannelActivate' + /** Activated channel. */ + channel?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + channelErrors: Array + errors: Array +} + +/** Creates new channel. */ +export type ChannelCreate = { + __typename?: 'ChannelCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + channelErrors: Array + errors: Array + channel?: Maybe +} + +export type ChannelCreateInput = { + /** isActive flag. */ + isActive?: Maybe + /** Name of the channel. */ + name: Scalars['String'] + /** Slug of the channel. */ + slug: Scalars['String'] + /** Currency of the channel. */ + currencyCode: Scalars['String'] + /** List of shipping zones to assign to the channel. */ + addShippingZones?: Maybe> +} + +/** Deactivate a channel. */ +export type ChannelDeactivate = { + __typename?: 'ChannelDeactivate' + /** Deactivated channel. */ + channel?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + channelErrors: Array + errors: Array +} + +/** Delete a channel. Orders associated with the deleted channel will be moved to the target channel. Checkouts, product availability, and pricing will be removed. */ +export type ChannelDelete = { + __typename?: 'ChannelDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + channelErrors: Array + errors: Array + channel?: Maybe +} + +export type ChannelDeleteInput = { + /** ID of channel to migrate orders from origin channel. */ + targetChannel: Scalars['ID'] +} + +export type ChannelError = { + __typename?: 'ChannelError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: ChannelErrorCode + /** List of shipping zone IDs which causes the error. */ + shippingZones?: Maybe> +} + +/** An enumeration. */ +export enum ChannelErrorCode { + AlreadyExists = 'ALREADY_EXISTS', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', + ChannelTargetIdMustBeDifferent = 'CHANNEL_TARGET_ID_MUST_BE_DIFFERENT', + ChannelsCurrencyMustBeTheSame = 'CHANNELS_CURRENCY_MUST_BE_THE_SAME', + ChannelWithOrders = 'CHANNEL_WITH_ORDERS', + DuplicatedInputItem = 'DUPLICATED_INPUT_ITEM', +} + +/** Update a channel. */ +export type ChannelUpdate = { + __typename?: 'ChannelUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + channelErrors: Array + errors: Array + channel?: Maybe +} + +export type ChannelUpdateInput = { + /** isActive flag. */ + isActive?: Maybe + /** Name of the channel. */ + name?: Maybe + /** Slug of the channel. */ + slug?: Maybe + /** List of shipping zones to assign to the channel. */ + addShippingZones?: Maybe> + /** List of shipping zones to unassign from the channel. */ + removeShippingZones?: Maybe> +} + +/** Checkout object. */ +export type Checkout = Node & + ObjectWithMetadata & { + __typename?: 'Checkout' + created: Scalars['DateTime'] + lastChange: Scalars['DateTime'] + user?: Maybe + channel: Channel + billingAddress?: Maybe
+ shippingAddress?: Maybe
+ note: Scalars['String'] + discount?: Maybe + discountName?: Maybe + translatedDiscountName?: Maybe + voucherCode?: Maybe + /** List of gift cards associated with this checkout. */ + giftCards?: Maybe>> + /** The ID of the object. */ + id: Scalars['ID'] + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** Shipping methods that can be used with this order. */ + availableShippingMethods: Array> + /** List of available payment gateways. */ + availablePaymentGateways: Array + /** Email of a customer. */ + email: Scalars['String'] + /** Returns True, if checkout requires shipping. */ + isShippingRequired: Scalars['Boolean'] + /** The number of items purchased. */ + quantity: Scalars['Int'] + /** A list of checkout lines, each containing information about an item in the checkout. */ + lines?: Maybe>> + /** The price of the shipping, with all the taxes included. */ + shippingPrice?: Maybe + /** The shipping method related with checkout. */ + shippingMethod?: Maybe + /** The price of the checkout before shipping, with taxes included. */ + subtotalPrice?: Maybe + /** The checkout's token. */ + token: Scalars['UUID'] + /** The sum of the the checkout line prices, with all the taxes,shipping costs, and discounts included. */ + totalPrice?: Maybe + /** Checkout language code. */ + languageCode: LanguageCodeEnum + } + +/** Adds a gift card or a voucher to a checkout. */ +export type CheckoutAddPromoCode = { + __typename?: 'CheckoutAddPromoCode' + /** The checkout with the added gift card or voucher. */ + checkout?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +/** Update billing address in the existing checkout. */ +export type CheckoutBillingAddressUpdate = { + __typename?: 'CheckoutBillingAddressUpdate' + /** An updated checkout. */ + checkout?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +/** Completes the checkout. As a result a new order is created and a payment charge is made. This action requires a successful payment before it can be performed. In case additional confirmation step as 3D secure is required confirmationNeeded flag will be set to True and no order created until payment is confirmed with second call of this mutation. */ +export type CheckoutComplete = { + __typename?: 'CheckoutComplete' + /** Placed order. */ + order?: Maybe + /** Set to true if payment needs to be confirmed before checkout is complete. */ + confirmationNeeded: Scalars['Boolean'] + /** Confirmation data used to process additional authorization steps. */ + confirmationData?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +export type CheckoutCountableConnection = { + __typename?: 'CheckoutCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type CheckoutCountableEdge = { + __typename?: 'CheckoutCountableEdge' + /** The item at the end of the edge. */ + node: Checkout + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Create a new checkout. */ +export type CheckoutCreate = { + __typename?: 'CheckoutCreate' + /** Whether the checkout was created or the current active one was returned. Refer to checkoutLinesAdd and checkoutLinesUpdate to merge a cart with an active checkout.DEPRECATED: Will be removed in Saleor 4.0. Always returns True. */ + created?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array + checkout?: Maybe +} + +export type CheckoutCreateInput = { + /** Slug of a channel in which to create a checkout. */ + channel?: Maybe + /** A list of checkout lines, each containing information about an item in the checkout. */ + lines: Array> + /** The customer's email address. */ + email?: Maybe + /** The mailing address to where the checkout will be shipped. Note: the address will be ignored if the checkout doesn't contain shippable items. */ + shippingAddress?: Maybe + /** Billing address of the customer. */ + billingAddress?: Maybe + /** Checkout language code. */ + languageCode?: Maybe +} + +/** Sets the customer as the owner of the checkout. */ +export type CheckoutCustomerAttach = { + __typename?: 'CheckoutCustomerAttach' + /** An updated checkout. */ + checkout?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +/** Removes the user assigned as the owner of the checkout. */ +export type CheckoutCustomerDetach = { + __typename?: 'CheckoutCustomerDetach' + /** An updated checkout. */ + checkout?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +/** Updates email address in the existing checkout object. */ +export type CheckoutEmailUpdate = { + __typename?: 'CheckoutEmailUpdate' + /** An updated checkout. */ + checkout?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +export type CheckoutError = { + __typename?: 'CheckoutError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: CheckoutErrorCode + /** List of varint IDs which causes the error. */ + variants?: Maybe> + /** A type of address that causes the error. */ + addressType?: Maybe +} + +/** An enumeration. */ +export enum CheckoutErrorCode { + BillingAddressNotSet = 'BILLING_ADDRESS_NOT_SET', + CheckoutNotFullyPaid = 'CHECKOUT_NOT_FULLY_PAID', + GraphqlError = 'GRAPHQL_ERROR', + ProductNotPublished = 'PRODUCT_NOT_PUBLISHED', + ProductUnavailableForPurchase = 'PRODUCT_UNAVAILABLE_FOR_PURCHASE', + InsufficientStock = 'INSUFFICIENT_STOCK', + Invalid = 'INVALID', + InvalidShippingMethod = 'INVALID_SHIPPING_METHOD', + NotFound = 'NOT_FOUND', + PaymentError = 'PAYMENT_ERROR', + QuantityGreaterThanLimit = 'QUANTITY_GREATER_THAN_LIMIT', + Required = 'REQUIRED', + ShippingAddressNotSet = 'SHIPPING_ADDRESS_NOT_SET', + ShippingMethodNotApplicable = 'SHIPPING_METHOD_NOT_APPLICABLE', + ShippingMethodNotSet = 'SHIPPING_METHOD_NOT_SET', + ShippingNotRequired = 'SHIPPING_NOT_REQUIRED', + TaxError = 'TAX_ERROR', + Unique = 'UNIQUE', + VoucherNotApplicable = 'VOUCHER_NOT_APPLICABLE', + ZeroQuantity = 'ZERO_QUANTITY', + MissingChannelSlug = 'MISSING_CHANNEL_SLUG', + ChannelInactive = 'CHANNEL_INACTIVE', + UnavailableVariantInChannel = 'UNAVAILABLE_VARIANT_IN_CHANNEL', +} + +/** Update language code in the existing checkout. */ +export type CheckoutLanguageCodeUpdate = { + __typename?: 'CheckoutLanguageCodeUpdate' + /** An updated checkout. */ + checkout?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +/** Represents an item in the checkout. */ +export type CheckoutLine = Node & { + __typename?: 'CheckoutLine' + /** The ID of the object. */ + id: Scalars['ID'] + variant: ProductVariant + quantity: Scalars['Int'] + /** The sum of the checkout line price, taxes and discounts. */ + totalPrice?: Maybe + /** Indicates whether the item need to be delivered. */ + requiresShipping?: Maybe +} + +export type CheckoutLineCountableConnection = { + __typename?: 'CheckoutLineCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type CheckoutLineCountableEdge = { + __typename?: 'CheckoutLineCountableEdge' + /** The item at the end of the edge. */ + node: CheckoutLine + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Deletes a CheckoutLine. */ +export type CheckoutLineDelete = { + __typename?: 'CheckoutLineDelete' + /** An updated checkout. */ + checkout?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +export type CheckoutLineInput = { + /** The number of items purchased. */ + quantity: Scalars['Int'] + /** ID of the product variant. */ + variantId: Scalars['ID'] +} + +/** Adds a checkout line to the existing checkout. */ +export type CheckoutLinesAdd = { + __typename?: 'CheckoutLinesAdd' + /** An updated checkout. */ + checkout?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +/** Updates checkout line in the existing checkout. */ +export type CheckoutLinesUpdate = { + __typename?: 'CheckoutLinesUpdate' + /** An updated checkout. */ + checkout?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +/** Create a new payment for given checkout. */ +export type CheckoutPaymentCreate = { + __typename?: 'CheckoutPaymentCreate' + /** Related checkout object. */ + checkout?: Maybe + /** A newly created payment. */ + payment?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + paymentErrors: Array + errors: Array +} + +/** Remove a gift card or a voucher from a checkout. */ +export type CheckoutRemovePromoCode = { + __typename?: 'CheckoutRemovePromoCode' + /** The checkout with the removed gift card or voucher. */ + checkout?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +/** Update shipping address in the existing checkout. */ +export type CheckoutShippingAddressUpdate = { + __typename?: 'CheckoutShippingAddressUpdate' + /** An updated checkout. */ + checkout?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +/** Updates the shipping address of the checkout. */ +export type CheckoutShippingMethodUpdate = { + __typename?: 'CheckoutShippingMethodUpdate' + /** An updated checkout. */ + checkout?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + checkoutErrors: Array + errors: Array +} + +export type ChoiceValue = { + __typename?: 'ChoiceValue' + raw?: Maybe + verbose?: Maybe +} + +/** Represents a collection of products. */ +export type Collection = Node & + ObjectWithMetadata & { + __typename?: 'Collection' + /** The ID of the object. */ + id: Scalars['ID'] + seoTitle?: Maybe + seoDescription?: Maybe + name: Scalars['String'] + description?: Maybe + slug: Scalars['String'] + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** + * Description of the collection (JSON). + * @deprecated Will be removed in Saleor 4.0. Use the `description` field instead. + */ + descriptionJson?: Maybe + /** List of products in this collection. */ + products?: Maybe + backgroundImage?: Maybe + /** Returns translated collection fields for the given language code. */ + translation?: Maybe + /** List of channels in which the collection is available. */ + channelListings?: Maybe> + } + +/** Represents a collection of products. */ +export type CollectionProductsArgs = { + filter?: Maybe + sortBy?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Represents a collection of products. */ +export type CollectionBackgroundImageArgs = { + size?: Maybe +} + +/** Represents a collection of products. */ +export type CollectionTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Adds products to a collection. */ +export type CollectionAddProducts = { + __typename?: 'CollectionAddProducts' + /** Collection to which products will be added. */ + collection?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + collectionErrors: Array + errors: Array +} + +/** Deletes collections. */ +export type CollectionBulkDelete = { + __typename?: 'CollectionBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + collectionErrors: Array + errors: Array +} + +/** Represents collection channel listing. */ +export type CollectionChannelListing = Node & { + __typename?: 'CollectionChannelListing' + /** The ID of the object. */ + id: Scalars['ID'] + publicationDate?: Maybe + isPublished: Scalars['Boolean'] + channel: Channel +} + +export type CollectionChannelListingError = { + __typename?: 'CollectionChannelListingError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: ProductErrorCode + /** List of attributes IDs which causes the error. */ + attributes?: Maybe> + /** List of attribute values IDs which causes the error. */ + values?: Maybe> + /** List of channels IDs which causes the error. */ + channels?: Maybe> +} + +/** Manage collection's availability in channels. */ +export type CollectionChannelListingUpdate = { + __typename?: 'CollectionChannelListingUpdate' + /** An updated collection instance. */ + collection?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + collectionChannelListingErrors: Array + errors: Array +} + +export type CollectionChannelListingUpdateInput = { + /** List of channels to which the collection should be assigned. */ + addChannels?: Maybe> + /** List of channels from which the collection should be unassigned. */ + removeChannels?: Maybe> +} + +export type CollectionCountableConnection = { + __typename?: 'CollectionCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type CollectionCountableEdge = { + __typename?: 'CollectionCountableEdge' + /** The item at the end of the edge. */ + node: Collection + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new collection. */ +export type CollectionCreate = { + __typename?: 'CollectionCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + collectionErrors: Array + errors: Array + collection?: Maybe +} + +export type CollectionCreateInput = { + /** Informs whether a collection is published. */ + isPublished?: Maybe + /** Name of the collection. */ + name?: Maybe + /** Slug of the collection. */ + slug?: Maybe + /** Description of the collection (JSON). */ + description?: Maybe + /** Background image file. */ + backgroundImage?: Maybe + /** Alt text for an image. */ + backgroundImageAlt?: Maybe + /** Search engine optimization fields. */ + seo?: Maybe + /** Publication date. ISO 8601 standard. */ + publicationDate?: Maybe + /** List of products to be added to the collection. */ + products?: Maybe>> +} + +/** Deletes a collection. */ +export type CollectionDelete = { + __typename?: 'CollectionDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + collectionErrors: Array + errors: Array + collection?: Maybe +} + +export type CollectionError = { + __typename?: 'CollectionError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** List of products IDs which causes the error. */ + products?: Maybe> + /** The error code. */ + code: CollectionErrorCode +} + +/** An enumeration. */ +export enum CollectionErrorCode { + DuplicatedInputItem = 'DUPLICATED_INPUT_ITEM', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', + CannotManageProductWithoutVariant = 'CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT', +} + +export type CollectionFilterInput = { + published?: Maybe + search?: Maybe + metadata?: Maybe>> + ids?: Maybe>> + /** Specifies the channel by which the data should be sorted. */ + channel?: Maybe +} + +export type CollectionInput = { + /** Informs whether a collection is published. */ + isPublished?: Maybe + /** Name of the collection. */ + name?: Maybe + /** Slug of the collection. */ + slug?: Maybe + /** Description of the collection (JSON). */ + description?: Maybe + /** Background image file. */ + backgroundImage?: Maybe + /** Alt text for an image. */ + backgroundImageAlt?: Maybe + /** Search engine optimization fields. */ + seo?: Maybe + /** Publication date. ISO 8601 standard. */ + publicationDate?: Maybe +} + +export enum CollectionPublished { + Published = 'PUBLISHED', + Hidden = 'HIDDEN', +} + +/** Remove products from a collection. */ +export type CollectionRemoveProducts = { + __typename?: 'CollectionRemoveProducts' + /** Collection from which products will be removed. */ + collection?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + collectionErrors: Array + errors: Array +} + +/** Reorder the products of a collection. */ +export type CollectionReorderProducts = { + __typename?: 'CollectionReorderProducts' + /** Collection from which products are reordered. */ + collection?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + collectionErrors: Array + errors: Array +} + +export enum CollectionSortField { + /** Sort collections by name. */ + Name = 'NAME', + /** Sort collections by availability. */ + Availability = 'AVAILABILITY', + /** Sort collections by product count. */ + ProductCount = 'PRODUCT_COUNT', + /** Sort collections by publication date. */ + PublicationDate = 'PUBLICATION_DATE', +} + +export type CollectionSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Specifies the channel in which to sort the data. */ + channel?: Maybe + /** Sort collections by the selected field. */ + field: CollectionSortField +} + +export type CollectionTranslatableContent = Node & { + __typename?: 'CollectionTranslatableContent' + /** The ID of the object. */ + id: Scalars['ID'] + seoTitle?: Maybe + seoDescription?: Maybe + name: Scalars['String'] + description?: Maybe + /** + * Description of the collection (JSON). + * @deprecated Will be removed in Saleor 4.0. Use the `description` field instead. + */ + descriptionJson?: Maybe + /** Returns translated collection fields for the given language code. */ + translation?: Maybe + /** Represents a collection of products. */ + collection?: Maybe +} + +export type CollectionTranslatableContentTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Creates/Updates translations for collection. */ +export type CollectionTranslate = { + __typename?: 'CollectionTranslate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + translationErrors: Array + errors: Array + collection?: Maybe +} + +export type CollectionTranslation = Node & { + __typename?: 'CollectionTranslation' + /** The ID of the object. */ + id: Scalars['ID'] + seoTitle?: Maybe + seoDescription?: Maybe + name: Scalars['String'] + description?: Maybe + /** Translation language. */ + language: LanguageDisplay + /** + * Translated description of the product (JSON). + * @deprecated Will be removed in Saleor 4.0. Use the `description` field instead. + */ + descriptionJson?: Maybe +} + +/** Updates a collection. */ +export type CollectionUpdate = { + __typename?: 'CollectionUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + collectionErrors: Array + errors: Array + collection?: Maybe +} + +/** Stores information about a single configuration field. */ +export type ConfigurationItem = { + __typename?: 'ConfigurationItem' + /** Name of the field. */ + name: Scalars['String'] + /** Current value of the field. */ + value?: Maybe + /** Type of the field. */ + type?: Maybe + /** Help text for the field. */ + helpText?: Maybe + /** Label for the field. */ + label?: Maybe +} + +export type ConfigurationItemInput = { + /** Name of the field to update. */ + name: Scalars['String'] + /** Value of the given field to update. */ + value?: Maybe +} + +/** An enumeration. */ +export enum ConfigurationTypeFieldEnum { + String = 'STRING', + Multiline = 'MULTILINE', + Boolean = 'BOOLEAN', + Secret = 'SECRET', + Password = 'PASSWORD', + Secretmultiline = 'SECRETMULTILINE', + Output = 'OUTPUT', +} + +/** Confirm user account with token sent by email during registration. */ +export type ConfirmAccount = { + __typename?: 'ConfirmAccount' + /** An activated user account. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Confirm the email change of the logged-in user. */ +export type ConfirmEmailChange = { + __typename?: 'ConfirmEmailChange' + /** A user instance with a new email. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** An enumeration. */ +export enum CountryCode { + Af = 'AF', + Ax = 'AX', + Al = 'AL', + Dz = 'DZ', + As = 'AS', + Ad = 'AD', + Ao = 'AO', + Ai = 'AI', + Aq = 'AQ', + Ag = 'AG', + Ar = 'AR', + Am = 'AM', + Aw = 'AW', + Au = 'AU', + At = 'AT', + Az = 'AZ', + Bs = 'BS', + Bh = 'BH', + Bd = 'BD', + Bb = 'BB', + By = 'BY', + Be = 'BE', + Bz = 'BZ', + Bj = 'BJ', + Bm = 'BM', + Bt = 'BT', + Bo = 'BO', + Bq = 'BQ', + Ba = 'BA', + Bw = 'BW', + Bv = 'BV', + Br = 'BR', + Io = 'IO', + Bn = 'BN', + Bg = 'BG', + Bf = 'BF', + Bi = 'BI', + Cv = 'CV', + Kh = 'KH', + Cm = 'CM', + Ca = 'CA', + Ky = 'KY', + Cf = 'CF', + Td = 'TD', + Cl = 'CL', + Cn = 'CN', + Cx = 'CX', + Cc = 'CC', + Co = 'CO', + Km = 'KM', + Cg = 'CG', + Cd = 'CD', + Ck = 'CK', + Cr = 'CR', + Ci = 'CI', + Hr = 'HR', + Cu = 'CU', + Cw = 'CW', + Cy = 'CY', + Cz = 'CZ', + Dk = 'DK', + Dj = 'DJ', + Dm = 'DM', + Do = 'DO', + Ec = 'EC', + Eg = 'EG', + Sv = 'SV', + Gq = 'GQ', + Er = 'ER', + Ee = 'EE', + Sz = 'SZ', + Et = 'ET', + Eu = 'EU', + Fk = 'FK', + Fo = 'FO', + Fj = 'FJ', + Fi = 'FI', + Fr = 'FR', + Gf = 'GF', + Pf = 'PF', + Tf = 'TF', + Ga = 'GA', + Gm = 'GM', + Ge = 'GE', + De = 'DE', + Gh = 'GH', + Gi = 'GI', + Gr = 'GR', + Gl = 'GL', + Gd = 'GD', + Gp = 'GP', + Gu = 'GU', + Gt = 'GT', + Gg = 'GG', + Gn = 'GN', + Gw = 'GW', + Gy = 'GY', + Ht = 'HT', + Hm = 'HM', + Va = 'VA', + Hn = 'HN', + Hk = 'HK', + Hu = 'HU', + Is = 'IS', + In = 'IN', + Id = 'ID', + Ir = 'IR', + Iq = 'IQ', + Ie = 'IE', + Im = 'IM', + Il = 'IL', + It = 'IT', + Jm = 'JM', + Jp = 'JP', + Je = 'JE', + Jo = 'JO', + Kz = 'KZ', + Ke = 'KE', + Ki = 'KI', + Kw = 'KW', + Kg = 'KG', + La = 'LA', + Lv = 'LV', + Lb = 'LB', + Ls = 'LS', + Lr = 'LR', + Ly = 'LY', + Li = 'LI', + Lt = 'LT', + Lu = 'LU', + Mo = 'MO', + Mg = 'MG', + Mw = 'MW', + My = 'MY', + Mv = 'MV', + Ml = 'ML', + Mt = 'MT', + Mh = 'MH', + Mq = 'MQ', + Mr = 'MR', + Mu = 'MU', + Yt = 'YT', + Mx = 'MX', + Fm = 'FM', + Md = 'MD', + Mc = 'MC', + Mn = 'MN', + Me = 'ME', + Ms = 'MS', + Ma = 'MA', + Mz = 'MZ', + Mm = 'MM', + Na = 'NA', + Nr = 'NR', + Np = 'NP', + Nl = 'NL', + Nc = 'NC', + Nz = 'NZ', + Ni = 'NI', + Ne = 'NE', + Ng = 'NG', + Nu = 'NU', + Nf = 'NF', + Kp = 'KP', + Mk = 'MK', + Mp = 'MP', + No = 'NO', + Om = 'OM', + Pk = 'PK', + Pw = 'PW', + Ps = 'PS', + Pa = 'PA', + Pg = 'PG', + Py = 'PY', + Pe = 'PE', + Ph = 'PH', + Pn = 'PN', + Pl = 'PL', + Pt = 'PT', + Pr = 'PR', + Qa = 'QA', + Re = 'RE', + Ro = 'RO', + Ru = 'RU', + Rw = 'RW', + Bl = 'BL', + Sh = 'SH', + Kn = 'KN', + Lc = 'LC', + Mf = 'MF', + Pm = 'PM', + Vc = 'VC', + Ws = 'WS', + Sm = 'SM', + St = 'ST', + Sa = 'SA', + Sn = 'SN', + Rs = 'RS', + Sc = 'SC', + Sl = 'SL', + Sg = 'SG', + Sx = 'SX', + Sk = 'SK', + Si = 'SI', + Sb = 'SB', + So = 'SO', + Za = 'ZA', + Gs = 'GS', + Kr = 'KR', + Ss = 'SS', + Es = 'ES', + Lk = 'LK', + Sd = 'SD', + Sr = 'SR', + Sj = 'SJ', + Se = 'SE', + Ch = 'CH', + Sy = 'SY', + Tw = 'TW', + Tj = 'TJ', + Tz = 'TZ', + Th = 'TH', + Tl = 'TL', + Tg = 'TG', + Tk = 'TK', + To = 'TO', + Tt = 'TT', + Tn = 'TN', + Tr = 'TR', + Tm = 'TM', + Tc = 'TC', + Tv = 'TV', + Ug = 'UG', + Ua = 'UA', + Ae = 'AE', + Gb = 'GB', + Um = 'UM', + Us = 'US', + Uy = 'UY', + Uz = 'UZ', + Vu = 'VU', + Ve = 'VE', + Vn = 'VN', + Vg = 'VG', + Vi = 'VI', + Wf = 'WF', + Eh = 'EH', + Ye = 'YE', + Zm = 'ZM', + Zw = 'ZW', +} + +export type CountryDisplay = { + __typename?: 'CountryDisplay' + /** Country code. */ + code: Scalars['String'] + /** Country name. */ + country: Scalars['String'] + /** Country tax. */ + vat?: Maybe +} + +/** Create JWT token. */ +export type CreateToken = { + __typename?: 'CreateToken' + /** JWT token, required to authenticate. */ + token?: Maybe + /** JWT refresh token, required to re-generate access token. */ + refreshToken?: Maybe + /** CSRF token required to re-generate access token. */ + csrfToken?: Maybe + /** A user instance. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +export type CreditCard = { + __typename?: 'CreditCard' + /** Card brand. */ + brand: Scalars['String'] + /** First 4 digits of the card number. */ + firstDigits?: Maybe + /** Last 4 digits of the card number. */ + lastDigits: Scalars['String'] + /** Two-digit number representing the card’s expiration month. */ + expMonth?: Maybe + /** Four-digit number representing the card’s expiration year. */ + expYear?: Maybe +} + +/** Deletes customers. */ +export type CustomerBulkDelete = { + __typename?: 'CustomerBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Creates a new customer. */ +export type CustomerCreate = { + __typename?: 'CustomerCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array + user?: Maybe +} + +/** Deletes a customer. */ +export type CustomerDelete = { + __typename?: 'CustomerDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array + user?: Maybe +} + +/** History log of the customer. */ +export type CustomerEvent = Node & { + __typename?: 'CustomerEvent' + /** The ID of the object. */ + id: Scalars['ID'] + /** Date when event happened at in ISO 8601 format. */ + date?: Maybe + /** Customer event type. */ + type?: Maybe + /** User who performed the action. */ + user?: Maybe + /** Content of the event. */ + message?: Maybe + /** Number of objects concerned by the event. */ + count?: Maybe + /** The concerned order. */ + order?: Maybe + /** The concerned order line. */ + orderLine?: Maybe +} + +/** An enumeration. */ +export enum CustomerEventsEnum { + AccountCreated = 'ACCOUNT_CREATED', + PasswordResetLinkSent = 'PASSWORD_RESET_LINK_SENT', + PasswordReset = 'PASSWORD_RESET', + EmailChangedRequest = 'EMAIL_CHANGED_REQUEST', + PasswordChanged = 'PASSWORD_CHANGED', + EmailChanged = 'EMAIL_CHANGED', + PlacedOrder = 'PLACED_ORDER', + NoteAddedToOrder = 'NOTE_ADDED_TO_ORDER', + DigitalLinkDownloaded = 'DIGITAL_LINK_DOWNLOADED', + CustomerDeleted = 'CUSTOMER_DELETED', + NameAssigned = 'NAME_ASSIGNED', + EmailAssigned = 'EMAIL_ASSIGNED', + NoteAdded = 'NOTE_ADDED', +} + +export type CustomerFilterInput = { + dateJoined?: Maybe + numberOfOrders?: Maybe + placedOrders?: Maybe + search?: Maybe +} + +export type CustomerInput = { + /** Billing address of the customer. */ + defaultBillingAddress?: Maybe + /** Shipping address of the customer. */ + defaultShippingAddress?: Maybe + /** Given name. */ + firstName?: Maybe + /** Family name. */ + lastName?: Maybe + /** The unique email address of the user. */ + email?: Maybe + /** User account is active. */ + isActive?: Maybe + /** A note about the user. */ + note?: Maybe + /** User language code. */ + languageCode?: Maybe +} + +/** Updates an existing customer. */ +export type CustomerUpdate = { + __typename?: 'CustomerUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array + user?: Maybe +} + +export type DateRangeInput = { + /** Start date. */ + gte?: Maybe + /** End date. */ + lte?: Maybe +} + +export type DateTimeRangeInput = { + /** Start date. */ + gte?: Maybe + /** End date. */ + lte?: Maybe +} + +/** Deactivate all JWT tokens of the currently authenticated user. */ +export type DeactivateAllUserTokens = { + __typename?: 'DeactivateAllUserTokens' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Delete metadata of an object. */ +export type DeleteMetadata = { + __typename?: 'DeleteMetadata' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + metadataErrors: Array + errors: Array + item?: Maybe +} + +/** Delete object's private metadata. */ +export type DeletePrivateMetadata = { + __typename?: 'DeletePrivateMetadata' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + metadataErrors: Array + errors: Array + item?: Maybe +} + +export type DigitalContent = Node & + ObjectWithMetadata & { + __typename?: 'DigitalContent' + useDefaultSettings: Scalars['Boolean'] + automaticFulfillment: Scalars['Boolean'] + contentFile: Scalars['String'] + maxDownloads?: Maybe + urlValidDays?: Maybe + /** List of URLs for the digital variant. */ + urls?: Maybe>> + /** The ID of the object. */ + id: Scalars['ID'] + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** Product variant assigned to digital content. */ + productVariant: ProductVariant + } + +export type DigitalContentCountableConnection = { + __typename?: 'DigitalContentCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type DigitalContentCountableEdge = { + __typename?: 'DigitalContentCountableEdge' + /** The item at the end of the edge. */ + node: DigitalContent + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Create new digital content. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec */ +export type DigitalContentCreate = { + __typename?: 'DigitalContentCreate' + variant?: Maybe + content?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +/** Remove digital content assigned to given variant. */ +export type DigitalContentDelete = { + __typename?: 'DigitalContentDelete' + variant?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +export type DigitalContentInput = { + /** Use default digital content settings for this product. */ + useDefaultSettings: Scalars['Boolean'] + /** Determines how many times a download link can be accessed by a customer. */ + maxDownloads?: Maybe + /** Determines for how many days a download link is active since it was generated. */ + urlValidDays?: Maybe + /** Overwrite default automatic_fulfillment setting for variant. */ + automaticFulfillment?: Maybe +} + +/** Update digital content. */ +export type DigitalContentUpdate = { + __typename?: 'DigitalContentUpdate' + variant?: Maybe + content?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +export type DigitalContentUploadInput = { + /** Use default digital content settings for this product. */ + useDefaultSettings: Scalars['Boolean'] + /** Determines how many times a download link can be accessed by a customer. */ + maxDownloads?: Maybe + /** Determines for how many days a download link is active since it was generated. */ + urlValidDays?: Maybe + /** Overwrite default automatic_fulfillment setting for variant. */ + automaticFulfillment?: Maybe + /** Represents an file in a multipart request. */ + contentFile: Scalars['Upload'] +} + +export type DigitalContentUrl = Node & { + __typename?: 'DigitalContentUrl' + content: DigitalContent + created: Scalars['DateTime'] + downloadNum: Scalars['Int'] + /** The ID of the object. */ + id: Scalars['ID'] + /** URL for digital content. */ + url?: Maybe + /** UUID of digital content. */ + token: Scalars['UUID'] +} + +/** Generate new URL to digital content. */ +export type DigitalContentUrlCreate = { + __typename?: 'DigitalContentUrlCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + digitalContentUrl?: Maybe +} + +export type DigitalContentUrlCreateInput = { + /** Digital content ID which URL will belong to. */ + content: Scalars['ID'] +} + +export type DiscountError = { + __typename?: 'DiscountError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** List of products IDs which causes the error. */ + products?: Maybe> + /** The error code. */ + code: DiscountErrorCode + /** List of channels IDs which causes the error. */ + channels?: Maybe> +} + +/** An enumeration. */ +export enum DiscountErrorCode { + AlreadyExists = 'ALREADY_EXISTS', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', + CannotManageProductWithoutVariant = 'CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT', + DuplicatedInputItem = 'DUPLICATED_INPUT_ITEM', +} + +export enum DiscountStatusEnum { + Active = 'ACTIVE', + Expired = 'EXPIRED', + Scheduled = 'SCHEDULED', +} + +export enum DiscountValueTypeEnum { + Fixed = 'FIXED', + Percentage = 'PERCENTAGE', +} + +/** An enumeration. */ +export enum DistanceUnitsEnum { + Cm = 'CM', + M = 'M', + Km = 'KM', + Ft = 'FT', + Yd = 'YD', + Inch = 'INCH', +} + +/** Represents shop's domain. */ +export type Domain = { + __typename?: 'Domain' + /** The host name of the domain. */ + host: Scalars['String'] + /** Inform if SSL is enabled. */ + sslEnabled: Scalars['Boolean'] + /** Shop's absolute URL. */ + url: Scalars['String'] +} + +/** Deletes draft orders. */ +export type DraftOrderBulkDelete = { + __typename?: 'DraftOrderBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** Completes creating an order. */ +export type DraftOrderComplete = { + __typename?: 'DraftOrderComplete' + /** Completed order. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** Creates a new draft order. */ +export type DraftOrderCreate = { + __typename?: 'DraftOrderCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array + order?: Maybe +} + +export type DraftOrderCreateInput = { + /** Billing address of the customer. */ + billingAddress?: Maybe + user?: Maybe + /** Email address of the customer. */ + userEmail?: Maybe + /** Discount amount for the order. */ + discount?: Maybe + /** Shipping address of the customer. */ + shippingAddress?: Maybe + /** ID of a selected shipping method. */ + shippingMethod?: Maybe + /** ID of the voucher associated with the order. */ + voucher?: Maybe + /** A note from a customer. Visible by customers in the order summary. */ + customerNote?: Maybe + /** ID of the channel associated with the order. */ + channel?: Maybe + /** URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. */ + redirectUrl?: Maybe + /** Variant line input consisting of variant ID and quantity of products. */ + lines?: Maybe>> +} + +/** Deletes a draft order. */ +export type DraftOrderDelete = { + __typename?: 'DraftOrderDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array + order?: Maybe +} + +export type DraftOrderInput = { + /** Billing address of the customer. */ + billingAddress?: Maybe + user?: Maybe + /** Email address of the customer. */ + userEmail?: Maybe + /** Discount amount for the order. */ + discount?: Maybe + /** Shipping address of the customer. */ + shippingAddress?: Maybe + /** ID of a selected shipping method. */ + shippingMethod?: Maybe + /** ID of the voucher associated with the order. */ + voucher?: Maybe + /** A note from a customer. Visible by customers in the order summary. */ + customerNote?: Maybe + /** ID of the channel associated with the order. */ + channel?: Maybe + /** URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. */ + redirectUrl?: Maybe +} + +/** Deletes order lines. */ +export type DraftOrderLinesBulkDelete = { + __typename?: 'DraftOrderLinesBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** Updates a draft order. */ +export type DraftOrderUpdate = { + __typename?: 'DraftOrderUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array + order?: Maybe +} + +export type ExportError = { + __typename?: 'ExportError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: ExportErrorCode +} + +/** An enumeration. */ +export enum ExportErrorCode { + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', +} + +/** History log of export file. */ +export type ExportEvent = Node & { + __typename?: 'ExportEvent' + /** The ID of the object. */ + id: Scalars['ID'] + /** Date when event happened at in ISO 8601 format. */ + date: Scalars['DateTime'] + /** Export event type. */ + type: ExportEventsEnum + /** User who performed the action. */ + user?: Maybe + /** App which performed the action. */ + app?: Maybe + /** Content of the event. */ + message: Scalars['String'] +} + +/** An enumeration. */ +export enum ExportEventsEnum { + ExportPending = 'EXPORT_PENDING', + ExportSuccess = 'EXPORT_SUCCESS', + ExportFailed = 'EXPORT_FAILED', + ExportDeleted = 'EXPORT_DELETED', + ExportedFileSent = 'EXPORTED_FILE_SENT', + ExportFailedInfoSent = 'EXPORT_FAILED_INFO_SENT', +} + +/** Represents a job data of exported file. */ +export type ExportFile = Node & + Job & { + __typename?: 'ExportFile' + /** The ID of the object. */ + id: Scalars['ID'] + user?: Maybe + app?: Maybe + /** Job status. */ + status: JobStatusEnum + /** Created date time of job in ISO 8601 format. */ + createdAt: Scalars['DateTime'] + /** Date time of job last update in ISO 8601 format. */ + updatedAt: Scalars['DateTime'] + /** Job message. */ + message?: Maybe + /** The URL of field to download. */ + url?: Maybe + /** List of events associated with the export. */ + events?: Maybe> + } + +export type ExportFileCountableConnection = { + __typename?: 'ExportFileCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type ExportFileCountableEdge = { + __typename?: 'ExportFileCountableEdge' + /** The item at the end of the edge. */ + node: ExportFile + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +export type ExportFileFilterInput = { + createdAt?: Maybe + updatedAt?: Maybe + status?: Maybe + user?: Maybe + app?: Maybe +} + +export enum ExportFileSortField { + /** Sort export file by status. */ + Status = 'STATUS', + /** Sort export file by created at. */ + CreatedAt = 'CREATED_AT', + /** Sort export file by updated at. */ + UpdatedAt = 'UPDATED_AT', +} + +export type ExportFileSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort export file by the selected field. */ + field: ExportFileSortField +} + +export type ExportInfoInput = { + /** List of attribute ids witch should be exported. */ + attributes?: Maybe> + /** List of warehouse ids witch should be exported. */ + warehouses?: Maybe> + /** List of channels ids which should be exported. */ + channels?: Maybe> + /** List of product fields witch should be exported. */ + fields?: Maybe> +} + +/** Export products to csv file. */ +export type ExportProducts = { + __typename?: 'ExportProducts' + /** The newly created export file job which is responsible for export data. */ + exportFile?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + exportErrors: Array + errors: Array +} + +export type ExportProductsInput = { + /** Determine which products should be exported. */ + scope: ExportScope + /** Filtering options for products. */ + filter?: Maybe + /** List of products IDS to export. */ + ids?: Maybe> + /** Input with info about fields which should be exported. */ + exportInfo?: Maybe + /** Type of exported file. */ + fileType: FileTypesEnum +} + +export enum ExportScope { + /** Export all products. */ + All = 'ALL', + /** Export products with given ids. */ + Ids = 'IDS', + /** Export the filtered products. */ + Filter = 'FILTER', +} + +export type ExternalAuthentication = { + __typename?: 'ExternalAuthentication' + /** ID of external authentication plugin. */ + id: Scalars['String'] + /** Name of external authentication plugin. */ + name?: Maybe +} + +/** Prepare external authentication url for user by custom plugin. */ +export type ExternalAuthenticationUrl = { + __typename?: 'ExternalAuthenticationUrl' + /** The data returned by authentication plugin. */ + authenticationData?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Logout user by custom plugin. */ +export type ExternalLogout = { + __typename?: 'ExternalLogout' + /** The data returned by authentication plugin. */ + logoutData?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Obtain external access tokens for user by custom plugin. */ +export type ExternalObtainAccessTokens = { + __typename?: 'ExternalObtainAccessTokens' + /** The token, required to authenticate. */ + token?: Maybe + /** The refresh token, required to re-generate external access token. */ + refreshToken?: Maybe + /** CSRF token required to re-generate external access token. */ + csrfToken?: Maybe + /** A user instance. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Refresh user's access by custom plugin. */ +export type ExternalRefresh = { + __typename?: 'ExternalRefresh' + /** The token, required to authenticate. */ + token?: Maybe + /** The refresh token, required to re-generate external access token. */ + refreshToken?: Maybe + /** CSRF token required to re-generate external access token. */ + csrfToken?: Maybe + /** A user instance. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Verify external authentication data by plugin. */ +export type ExternalVerify = { + __typename?: 'ExternalVerify' + /** User assigned to data. */ + user?: Maybe + /** Determine if authentication data is valid or not. */ + isValid: Scalars['Boolean'] + /** External data. */ + verifyData?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +export type File = { + __typename?: 'File' + /** The URL of the file. */ + url: Scalars['String'] + /** Content type of the file. */ + contentType?: Maybe +} + +/** An enumeration. */ +export enum FileTypesEnum { + Csv = 'CSV', + Xlsx = 'XLSX', +} + +/** Upload a file. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec */ +export type FileUpload = { + __typename?: 'FileUpload' + uploadedFile?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + uploadErrors: Array + errors: Array +} + +/** Represents order fulfillment. */ +export type Fulfillment = Node & + ObjectWithMetadata & { + __typename?: 'Fulfillment' + /** The ID of the object. */ + id: Scalars['ID'] + fulfillmentOrder: Scalars['Int'] + status: FulfillmentStatus + trackingNumber: Scalars['String'] + created: Scalars['DateTime'] + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** List of lines for the fulfillment. */ + lines?: Maybe>> + /** User-friendly fulfillment status. */ + statusDisplay?: Maybe + /** Warehouse from fulfillment was fulfilled. */ + warehouse?: Maybe + } + +/** Cancels existing fulfillment and optionally restocks items. */ +export type FulfillmentCancel = { + __typename?: 'FulfillmentCancel' + /** A canceled fulfillment. */ + fulfillment?: Maybe + /** Order which fulfillment was cancelled. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +export type FulfillmentCancelInput = { + /** ID of warehouse where items will be restock. */ + warehouseId: Scalars['ID'] +} + +/** Represents line of the fulfillment. */ +export type FulfillmentLine = Node & { + __typename?: 'FulfillmentLine' + /** The ID of the object. */ + id: Scalars['ID'] + quantity: Scalars['Int'] + orderLine?: Maybe +} + +/** Refund products. */ +export type FulfillmentRefundProducts = { + __typename?: 'FulfillmentRefundProducts' + /** A refunded fulfillment. */ + fulfillment?: Maybe + /** Order which fulfillment was refunded. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** Return products. */ +export type FulfillmentReturnProducts = { + __typename?: 'FulfillmentReturnProducts' + /** A return fulfillment. */ + returnFulfillment?: Maybe + /** A replace fulfillment. */ + replaceFulfillment?: Maybe + /** Order which fulfillment was returned. */ + order?: Maybe + /** A draft order which was created for products with replace flag. */ + replaceOrder?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** An enumeration. */ +export enum FulfillmentStatus { + /** Fulfilled */ + Fulfilled = 'FULFILLED', + /** Refunded */ + Refunded = 'REFUNDED', + /** Returned */ + Returned = 'RETURNED', + /** Replaced */ + Replaced = 'REPLACED', + /** Refunded and returned */ + RefundedAndReturned = 'REFUNDED_AND_RETURNED', + /** Canceled */ + Canceled = 'CANCELED', +} + +/** Updates a fulfillment for an order. */ +export type FulfillmentUpdateTracking = { + __typename?: 'FulfillmentUpdateTracking' + /** A fulfillment with updated tracking. */ + fulfillment?: Maybe + /** Order for which fulfillment was updated. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +export type FulfillmentUpdateTrackingInput = { + /** Fulfillment tracking number. */ + trackingNumber?: Maybe + /** If true, send an email notification to the customer. */ + notifyCustomer?: Maybe +} + +/** Payment gateway client configuration key and value pair. */ +export type GatewayConfigLine = { + __typename?: 'GatewayConfigLine' + /** Gateway config key. */ + field: Scalars['String'] + /** Gateway config value for key. */ + value?: Maybe +} + +/** A gift card is a prepaid electronic payment card accepted in stores. They can be used during checkout by providing a valid gift card codes. */ +export type GiftCard = Node & { + __typename?: 'GiftCard' + /** Gift card code. */ + code?: Maybe + /** The customer who bought a gift card. */ + user?: Maybe + created: Scalars['DateTime'] + startDate: Scalars['Date'] + endDate?: Maybe + lastUsedOn?: Maybe + isActive: Scalars['Boolean'] + initialBalance?: Maybe + currentBalance?: Maybe + /** The ID of the object. */ + id: Scalars['ID'] + /** Code in format which allows displaying in a user interface. */ + displayCode?: Maybe +} + +/** Activate a gift card. */ +export type GiftCardActivate = { + __typename?: 'GiftCardActivate' + /** A gift card to activate. */ + giftCard?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + giftCardErrors: Array + errors: Array +} + +export type GiftCardCountableConnection = { + __typename?: 'GiftCardCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type GiftCardCountableEdge = { + __typename?: 'GiftCardCountableEdge' + /** The item at the end of the edge. */ + node: GiftCard + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new gift card. */ +export type GiftCardCreate = { + __typename?: 'GiftCardCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + giftCardErrors: Array + errors: Array + giftCard?: Maybe +} + +export type GiftCardCreateInput = { + /** Start date of the gift card in ISO 8601 format. */ + startDate?: Maybe + /** End date of the gift card in ISO 8601 format. */ + endDate?: Maybe + /** Value of the gift card. */ + balance?: Maybe + /** The customer's email of the gift card buyer. */ + userEmail?: Maybe + /** Code to use the gift card. */ + code?: Maybe +} + +/** Deactivate a gift card. */ +export type GiftCardDeactivate = { + __typename?: 'GiftCardDeactivate' + /** A gift card to deactivate. */ + giftCard?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + giftCardErrors: Array + errors: Array +} + +export type GiftCardError = { + __typename?: 'GiftCardError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: GiftCardErrorCode +} + +/** An enumeration. */ +export enum GiftCardErrorCode { + AlreadyExists = 'ALREADY_EXISTS', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', +} + +/** Update a gift card. */ +export type GiftCardUpdate = { + __typename?: 'GiftCardUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + giftCardErrors: Array + errors: Array + giftCard?: Maybe +} + +export type GiftCardUpdateInput = { + /** Start date of the gift card in ISO 8601 format. */ + startDate?: Maybe + /** End date of the gift card in ISO 8601 format. */ + endDate?: Maybe + /** Value of the gift card. */ + balance?: Maybe + /** The customer's email of the gift card buyer. */ + userEmail?: Maybe +} + +/** Represents permission group data. */ +export type Group = Node & { + __typename?: 'Group' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + /** List of group permissions */ + permissions?: Maybe>> + /** List of group users */ + users?: Maybe>> + /** True, if the currently authenticated user has rights to manage a group. */ + userCanManage: Scalars['Boolean'] +} + +export type GroupCountableConnection = { + __typename?: 'GroupCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type GroupCountableEdge = { + __typename?: 'GroupCountableEdge' + /** The item at the end of the edge. */ + node: Group + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Represents an image. */ +export type Image = { + __typename?: 'Image' + /** The URL of the image. */ + url: Scalars['String'] + /** Alt text for an image. */ + alt?: Maybe +} + +export type IntRangeInput = { + /** Value greater than or equal to. */ + gte?: Maybe + /** Value less than or equal to. */ + lte?: Maybe +} + +/** Represents an Invoice. */ +export type Invoice = ObjectWithMetadata & + Job & + Node & { + __typename?: 'Invoice' + /** The ID of the object. */ + id: Scalars['ID'] + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** Job status. */ + status: JobStatusEnum + number?: Maybe + externalUrl?: Maybe + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** Created date time of job in ISO 8601 format. */ + createdAt: Scalars['DateTime'] + /** Date time of job last update in ISO 8601 format. */ + updatedAt: Scalars['DateTime'] + /** Job message. */ + message?: Maybe + /** URL to download an invoice. */ + url?: Maybe + } + +/** Creates a ready to send invoice. */ +export type InvoiceCreate = { + __typename?: 'InvoiceCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + invoiceErrors: Array + errors: Array + invoice?: Maybe +} + +export type InvoiceCreateInput = { + /** Invoice number. */ + number: Scalars['String'] + /** URL of an invoice to download. */ + url: Scalars['String'] +} + +/** Deletes an invoice. */ +export type InvoiceDelete = { + __typename?: 'InvoiceDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + invoiceErrors: Array + errors: Array + invoice?: Maybe +} + +export type InvoiceError = { + __typename?: 'InvoiceError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: InvoiceErrorCode +} + +/** An enumeration. */ +export enum InvoiceErrorCode { + Required = 'REQUIRED', + NotReady = 'NOT_READY', + UrlNotSet = 'URL_NOT_SET', + EmailNotSet = 'EMAIL_NOT_SET', + NumberNotSet = 'NUMBER_NOT_SET', + NotFound = 'NOT_FOUND', + InvalidStatus = 'INVALID_STATUS', +} + +/** Request an invoice for the order using plugin. */ +export type InvoiceRequest = { + __typename?: 'InvoiceRequest' + /** Order related to an invoice. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + invoiceErrors: Array + errors: Array + invoice?: Maybe +} + +/** Requests deletion of an invoice. */ +export type InvoiceRequestDelete = { + __typename?: 'InvoiceRequestDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + invoiceErrors: Array + errors: Array + invoice?: Maybe +} + +/** Send an invoice notification to the customer. */ +export type InvoiceSendNotification = { + __typename?: 'InvoiceSendNotification' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + invoiceErrors: Array + errors: Array + invoice?: Maybe +} + +/** Updates an invoice. */ +export type InvoiceUpdate = { + __typename?: 'InvoiceUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + invoiceErrors: Array + errors: Array + invoice?: Maybe +} + +export type Job = { + /** Job status. */ + status: JobStatusEnum + /** Created date time of job in ISO 8601 format. */ + createdAt: Scalars['DateTime'] + /** Date time of job last update in ISO 8601 format. */ + updatedAt: Scalars['DateTime'] + /** Job message. */ + message?: Maybe +} + +/** An enumeration. */ +export enum JobStatusEnum { + Pending = 'PENDING', + Success = 'SUCCESS', + Failed = 'FAILED', + Deleted = 'DELETED', +} + +/** An enumeration. */ +export enum LanguageCodeEnum { + Ar = 'AR', + Az = 'AZ', + Bg = 'BG', + Bn = 'BN', + Ca = 'CA', + Cs = 'CS', + Da = 'DA', + De = 'DE', + El = 'EL', + En = 'EN', + Es = 'ES', + EsCo = 'ES_CO', + Et = 'ET', + Fa = 'FA', + Fi = 'FI', + Fr = 'FR', + Hi = 'HI', + Hu = 'HU', + Hy = 'HY', + Id = 'ID', + Is = 'IS', + It = 'IT', + Ja = 'JA', + Ka = 'KA', + Km = 'KM', + Ko = 'KO', + Lt = 'LT', + Mn = 'MN', + My = 'MY', + Nb = 'NB', + Nl = 'NL', + Pl = 'PL', + Pt = 'PT', + PtBr = 'PT_BR', + Ro = 'RO', + Ru = 'RU', + Sk = 'SK', + Sl = 'SL', + Sq = 'SQ', + Sr = 'SR', + Sv = 'SV', + Sw = 'SW', + Ta = 'TA', + Th = 'TH', + Tr = 'TR', + Uk = 'UK', + Vi = 'VI', + ZhHans = 'ZH_HANS', + ZhHant = 'ZH_HANT', +} + +export type LanguageDisplay = { + __typename?: 'LanguageDisplay' + /** ISO 639 representation of the language name. */ + code: LanguageCodeEnum + /** Full name of the language. */ + language: Scalars['String'] +} + +export type LimitInfo = { + __typename?: 'LimitInfo' + /** Defines the current resource usage. */ + currentUsage: Limits + /** Defines the allowed maximum resource usage, null means unlimited. */ + allowedUsage: Limits +} + +export type Limits = { + __typename?: 'Limits' + channels?: Maybe + orders?: Maybe + productVariants?: Maybe + staffUsers?: Maybe + warehouses?: Maybe +} + +/** The manifest definition. */ +export type Manifest = { + __typename?: 'Manifest' + identifier: Scalars['String'] + version: Scalars['String'] + name: Scalars['String'] + about?: Maybe + permissions?: Maybe>> + appUrl?: Maybe + configurationUrl?: Maybe + tokenTargetUrl?: Maybe + dataPrivacy?: Maybe + dataPrivacyUrl?: Maybe + homepageUrl?: Maybe + supportUrl?: Maybe +} + +export type Margin = { + __typename?: 'Margin' + start?: Maybe + stop?: Maybe +} + +/** An enumeration. */ +export enum MeasurementUnitsEnum { + Cm = 'CM', + M = 'M', + Km = 'KM', + Ft = 'FT', + Yd = 'YD', + Inch = 'INCH', + SqCm = 'SQ_CM', + SqM = 'SQ_M', + SqKm = 'SQ_KM', + SqFt = 'SQ_FT', + SqYd = 'SQ_YD', + SqInch = 'SQ_INCH', + CubicMillimeter = 'CUBIC_MILLIMETER', + CubicCentimeter = 'CUBIC_CENTIMETER', + CubicDecimeter = 'CUBIC_DECIMETER', + CubicMeter = 'CUBIC_METER', + Liter = 'LITER', + CubicFoot = 'CUBIC_FOOT', + CubicInch = 'CUBIC_INCH', + CubicYard = 'CUBIC_YARD', + Qt = 'QT', + Pint = 'PINT', + FlOz = 'FL_OZ', + AcreIn = 'ACRE_IN', + AcreFt = 'ACRE_FT', + G = 'G', + Lb = 'LB', + Oz = 'OZ', + Kg = 'KG', + Tonne = 'TONNE', +} + +/** Represents a single menu - an object that is used to help navigate through the store. */ +export type Menu = Node & + ObjectWithMetadata & { + __typename?: 'Menu' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + slug: Scalars['String'] + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + items?: Maybe>> + } + +/** Deletes menus. */ +export type MenuBulkDelete = { + __typename?: 'MenuBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + menuErrors: Array + errors: Array +} + +export type MenuCountableConnection = { + __typename?: 'MenuCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type MenuCountableEdge = { + __typename?: 'MenuCountableEdge' + /** The item at the end of the edge. */ + node: Menu + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new Menu. */ +export type MenuCreate = { + __typename?: 'MenuCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + menuErrors: Array + errors: Array + menu?: Maybe +} + +export type MenuCreateInput = { + /** Name of the menu. */ + name: Scalars['String'] + /** Slug of the menu. Will be generated if not provided. */ + slug?: Maybe + /** List of menu items. */ + items?: Maybe>> +} + +/** Deletes a menu. */ +export type MenuDelete = { + __typename?: 'MenuDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + menuErrors: Array + errors: Array + menu?: Maybe +} + +export type MenuError = { + __typename?: 'MenuError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: MenuErrorCode +} + +/** An enumeration. */ +export enum MenuErrorCode { + CannotAssignNode = 'CANNOT_ASSIGN_NODE', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + InvalidMenuItem = 'INVALID_MENU_ITEM', + NoMenuItemProvided = 'NO_MENU_ITEM_PROVIDED', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + TooManyMenuItems = 'TOO_MANY_MENU_ITEMS', + Unique = 'UNIQUE', +} + +export type MenuFilterInput = { + search?: Maybe + slug?: Maybe>> + metadata?: Maybe>> +} + +export type MenuInput = { + /** Name of the menu. */ + name?: Maybe + /** Slug of the menu. */ + slug?: Maybe +} + +/** Represents a single item of the related menu. Can store categories, collection or pages. */ +export type MenuItem = Node & + ObjectWithMetadata & { + __typename?: 'MenuItem' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + menu: Menu + parent?: Maybe + category?: Maybe + collection?: Maybe + page?: Maybe + level: Scalars['Int'] + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + children?: Maybe>> + /** URL to the menu item. */ + url?: Maybe + /** Returns translated menu item fields for the given language code. */ + translation?: Maybe + } + +/** Represents a single item of the related menu. Can store categories, collection or pages. */ +export type MenuItemTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Deletes menu items. */ +export type MenuItemBulkDelete = { + __typename?: 'MenuItemBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + menuErrors: Array + errors: Array +} + +export type MenuItemCountableConnection = { + __typename?: 'MenuItemCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type MenuItemCountableEdge = { + __typename?: 'MenuItemCountableEdge' + /** The item at the end of the edge. */ + node: MenuItem + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new menu item. */ +export type MenuItemCreate = { + __typename?: 'MenuItemCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + menuErrors: Array + errors: Array + menuItem?: Maybe +} + +export type MenuItemCreateInput = { + /** Name of the menu item. */ + name: Scalars['String'] + /** URL of the pointed item. */ + url?: Maybe + /** Category to which item points. */ + category?: Maybe + /** Collection to which item points. */ + collection?: Maybe + /** Page to which item points. */ + page?: Maybe + /** Menu to which item belongs. */ + menu: Scalars['ID'] + /** ID of the parent menu. If empty, menu will be top level menu. */ + parent?: Maybe +} + +/** Deletes a menu item. */ +export type MenuItemDelete = { + __typename?: 'MenuItemDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + menuErrors: Array + errors: Array + menuItem?: Maybe +} + +export type MenuItemFilterInput = { + search?: Maybe + metadata?: Maybe>> +} + +export type MenuItemInput = { + /** Name of the menu item. */ + name?: Maybe + /** URL of the pointed item. */ + url?: Maybe + /** Category to which item points. */ + category?: Maybe + /** Collection to which item points. */ + collection?: Maybe + /** Page to which item points. */ + page?: Maybe +} + +/** Moves items of menus. */ +export type MenuItemMove = { + __typename?: 'MenuItemMove' + /** Assigned menu to move within. */ + menu?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + menuErrors: Array + errors: Array +} + +export type MenuItemMoveInput = { + /** The menu item ID to move. */ + itemId: Scalars['ID'] + /** ID of the parent menu. If empty, menu will be top level menu. */ + parentId?: Maybe + /** The new relative sorting position of the item (from -inf to +inf). 1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. */ + sortOrder?: Maybe +} + +export type MenuItemSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort menu items by the selected field. */ + field: MenuItemsSortField +} + +export type MenuItemTranslatableContent = Node & { + __typename?: 'MenuItemTranslatableContent' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + /** Returns translated menu item fields for the given language code. */ + translation?: Maybe + /** Represents a single item of the related menu. Can store categories, collection or pages. */ + menuItem?: Maybe +} + +export type MenuItemTranslatableContentTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Creates/Updates translations for Menu Item. */ +export type MenuItemTranslate = { + __typename?: 'MenuItemTranslate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + translationErrors: Array + errors: Array + menuItem?: Maybe +} + +export type MenuItemTranslation = Node & { + __typename?: 'MenuItemTranslation' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + /** Translation language. */ + language: LanguageDisplay +} + +/** Updates a menu item. */ +export type MenuItemUpdate = { + __typename?: 'MenuItemUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + menuErrors: Array + errors: Array + menuItem?: Maybe +} + +export enum MenuItemsSortField { + /** Sort menu items by name. */ + Name = 'NAME', +} + +export enum MenuSortField { + /** Sort menus by name. */ + Name = 'NAME', + /** Sort menus by items count. */ + ItemsCount = 'ITEMS_COUNT', +} + +export type MenuSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort menus by the selected field. */ + field: MenuSortField +} + +/** Updates a menu. */ +export type MenuUpdate = { + __typename?: 'MenuUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + menuErrors: Array + errors: Array + menu?: Maybe +} + +export type MetadataError = { + __typename?: 'MetadataError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: MetadataErrorCode +} + +/** An enumeration. */ +export enum MetadataErrorCode { + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', +} + +export type MetadataInput = { + /** Key of a metadata item. */ + key: Scalars['String'] + /** Value of a metadata item. */ + value: Scalars['String'] +} + +export type MetadataItem = { + __typename?: 'MetadataItem' + /** Key of a metadata item. */ + key: Scalars['String'] + /** Value of a metadata item. */ + value: Scalars['String'] +} + +/** Represents amount of money in specific currency. */ +export type Money = { + __typename?: 'Money' + /** Currency code. */ + currency: Scalars['String'] + /** Amount of money. */ + amount: Scalars['Float'] +} + +/** Represents a range of amounts of money. */ +export type MoneyRange = { + __typename?: 'MoneyRange' + /** Lower bound of a price range. */ + start?: Maybe + /** Upper bound of a price range. */ + stop?: Maybe +} + +export type MoveProductInput = { + /** The ID of the product to move. */ + productId: Scalars['ID'] + /** The relative sorting position of the product (from -inf to +inf) starting from the first given product's actual position.1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. */ + sortOrder?: Maybe +} + +export type Mutation = { + __typename?: 'Mutation' + /** Creates a new webhook subscription. */ + webhookCreate?: Maybe + /** Deletes a webhook subscription. */ + webhookDelete?: Maybe + /** Updates a webhook subscription. */ + webhookUpdate?: Maybe + /** Creates new warehouse. */ + createWarehouse?: Maybe + /** Updates given warehouse. */ + updateWarehouse?: Maybe + /** Deletes selected warehouse. */ + deleteWarehouse?: Maybe + /** Add shipping zone to given warehouse. */ + assignWarehouseShippingZone?: Maybe + /** Remove shipping zone from given warehouse. */ + unassignWarehouseShippingZone?: Maybe + /** Creates a new staff notification recipient. */ + staffNotificationRecipientCreate?: Maybe + /** Updates a staff notification recipient. */ + staffNotificationRecipientUpdate?: Maybe + /** Delete staff notification recipient. */ + staffNotificationRecipientDelete?: Maybe + /** Updates site domain of the shop. */ + shopDomainUpdate?: Maybe + /** Updates shop settings. */ + shopSettingsUpdate?: Maybe + /** Fetch tax rates. */ + shopFetchTaxRates?: Maybe + /** Creates/Updates translations for Shop Settings. */ + shopSettingsTranslate?: Maybe + /** Update the shop's address. If the `null` value is passed, the currently selected address will be deleted. */ + shopAddressUpdate?: Maybe + /** Update shop order settings. */ + orderSettingsUpdate?: Maybe + /** Manage shipping method's availability in channels. */ + shippingMethodChannelListingUpdate?: Maybe + /** Creates a new shipping price. */ + shippingPriceCreate?: Maybe + /** Deletes a shipping price. */ + shippingPriceDelete?: Maybe + /** Deletes shipping prices. */ + shippingPriceBulkDelete?: Maybe + /** Updates a new shipping price. */ + shippingPriceUpdate?: Maybe + /** Creates/Updates translations for shipping method. */ + shippingPriceTranslate?: Maybe + /** Exclude products from shipping price. */ + shippingPriceExcludeProducts?: Maybe + /** Remove product from excluded list for shipping price. */ + shippingPriceRemoveProductFromExclude?: Maybe + /** Creates a new shipping zone. */ + shippingZoneCreate?: Maybe + /** Deletes a shipping zone. */ + shippingZoneDelete?: Maybe + /** Deletes shipping zones. */ + shippingZoneBulkDelete?: Maybe + /** Updates a new shipping zone. */ + shippingZoneUpdate?: Maybe + /** Assign attributes to a given product type. */ + productAttributeAssign?: Maybe + /** Un-assign attributes from a given product type. */ + productAttributeUnassign?: Maybe + /** Creates a new category. */ + categoryCreate?: Maybe + /** Deletes a category. */ + categoryDelete?: Maybe + /** Deletes categories. */ + categoryBulkDelete?: Maybe + /** Updates a category. */ + categoryUpdate?: Maybe + /** Creates/Updates translations for Category. */ + categoryTranslate?: Maybe + /** Adds products to a collection. */ + collectionAddProducts?: Maybe + /** Creates a new collection. */ + collectionCreate?: Maybe + /** Deletes a collection. */ + collectionDelete?: Maybe + /** Reorder the products of a collection. */ + collectionReorderProducts?: Maybe + /** Deletes collections. */ + collectionBulkDelete?: Maybe + /** Remove products from a collection. */ + collectionRemoveProducts?: Maybe + /** Updates a collection. */ + collectionUpdate?: Maybe + /** Creates/Updates translations for collection. */ + collectionTranslate?: Maybe + /** Manage collection's availability in channels. */ + collectionChannelListingUpdate?: Maybe + /** Creates a new product. */ + productCreate?: Maybe + /** Deletes a product. */ + productDelete?: Maybe + /** Deletes products. */ + productBulkDelete?: Maybe + /** Updates an existing product. */ + productUpdate?: Maybe + /** Creates/Updates translations for Product. */ + productTranslate?: Maybe + /** Manage product's availability in channels. */ + productChannelListingUpdate?: Maybe + /** Create a media object (image or video URL) associated with product. For image, this mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec */ + productMediaCreate?: Maybe + /** Reorder the variants of a product. Mutation updates updated_at on product and triggers PRODUCT_UPDATED webhook. */ + productVariantReorder?: Maybe + /** Deletes a product media. */ + productMediaDelete?: Maybe + /** Deletes product media. */ + productMediaBulkDelete?: Maybe + /** Changes ordering of the product media. */ + productMediaReorder?: Maybe + /** Updates a product media. */ + productMediaUpdate?: Maybe + /** Creates a new product type. */ + productTypeCreate?: Maybe + /** Deletes a product type. */ + productTypeDelete?: Maybe + /** Deletes product types. */ + productTypeBulkDelete?: Maybe + /** Updates an existing product type. */ + productTypeUpdate?: Maybe + /** Reorder the attributes of a product type. */ + productTypeReorderAttributes?: Maybe + /** Reorder product attribute values. */ + productReorderAttributeValues?: Maybe + /** Create new digital content. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec */ + digitalContentCreate?: Maybe + /** Remove digital content assigned to given variant. */ + digitalContentDelete?: Maybe + /** Update digital content. */ + digitalContentUpdate?: Maybe + /** Generate new URL to digital content. */ + digitalContentUrlCreate?: Maybe + /** Creates a new variant for a product. */ + productVariantCreate?: Maybe + /** Deletes a product variant. */ + productVariantDelete?: Maybe + /** Creates product variants for a given product. */ + productVariantBulkCreate?: Maybe + /** Deletes product variants. */ + productVariantBulkDelete?: Maybe + /** Creates stocks for product variant. */ + productVariantStocksCreate?: Maybe + /** Delete stocks from product variant. */ + productVariantStocksDelete?: Maybe + /** Update stocks for product variant. */ + productVariantStocksUpdate?: Maybe + /** Updates an existing variant for product. */ + productVariantUpdate?: Maybe + /** Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook. */ + productVariantSetDefault?: Maybe + /** Creates/Updates translations for Product Variant. */ + productVariantTranslate?: Maybe + /** Manage product variant prices in channels. */ + productVariantChannelListingUpdate?: Maybe + /** Reorder product variant attribute values. */ + productVariantReorderAttributeValues?: Maybe + /** Assign an media to a product variant. */ + variantMediaAssign?: Maybe + /** Unassign an media from a product variant. */ + variantMediaUnassign?: Maybe + /** Captures the authorized payment amount. */ + paymentCapture?: Maybe + /** Refunds the captured payment amount. */ + paymentRefund?: Maybe + /** Voids the authorized payment. */ + paymentVoid?: Maybe + /** Initializes payment process when it is required by gateway. */ + paymentInitialize?: Maybe + /** Creates a new page. */ + pageCreate?: Maybe + /** Deletes a page. */ + pageDelete?: Maybe + /** Deletes pages. */ + pageBulkDelete?: Maybe + /** Publish pages. */ + pageBulkPublish?: Maybe + /** Updates an existing page. */ + pageUpdate?: Maybe + /** Creates/Updates translations for Page. */ + pageTranslate?: Maybe + /** Create a new page type. */ + pageTypeCreate?: Maybe + /** Update page type. */ + pageTypeUpdate?: Maybe + /** Delete a page type. */ + pageTypeDelete?: Maybe + /** Delete page types. */ + pageTypeBulkDelete?: Maybe + /** Assign attributes to a given page type. */ + pageAttributeAssign?: Maybe + /** Unassign attributes from a given page type. */ + pageAttributeUnassign?: Maybe + /** Reorder the attributes of a page type. */ + pageTypeReorderAttributes?: Maybe + /** Reorder page attribute values. */ + pageReorderAttributeValues?: Maybe + /** Completes creating an order. */ + draftOrderComplete?: Maybe + /** Creates a new draft order. */ + draftOrderCreate?: Maybe + /** Deletes a draft order. */ + draftOrderDelete?: Maybe + /** Deletes draft orders. */ + draftOrderBulkDelete?: Maybe + /** Deletes order lines. */ + draftOrderLinesBulkDelete?: Maybe + /** Updates a draft order. */ + draftOrderUpdate?: Maybe + /** Adds note to the order. */ + orderAddNote?: Maybe + /** Cancel an order. */ + orderCancel?: Maybe + /** Capture an order. */ + orderCapture?: Maybe + /** Confirms an unconfirmed order by changing status to unfulfilled. */ + orderConfirm?: Maybe + /** Creates new fulfillments for an order. */ + orderFulfill?: Maybe + /** Cancels existing fulfillment and optionally restocks items. */ + orderFulfillmentCancel?: Maybe + /** Updates a fulfillment for an order. */ + orderFulfillmentUpdateTracking?: Maybe + /** Refund products. */ + orderFulfillmentRefundProducts?: Maybe + /** Return products. */ + orderFulfillmentReturnProducts?: Maybe + /** Create order lines for an order. */ + orderLinesCreate?: Maybe + /** Deletes an order line from an order. */ + orderLineDelete?: Maybe + /** Updates an order line of an order. */ + orderLineUpdate?: Maybe + /** Adds discount to the order. */ + orderDiscountAdd?: Maybe + /** Update discount for the order. */ + orderDiscountUpdate?: Maybe + /** Remove discount from the order. */ + orderDiscountDelete?: Maybe + /** Update discount for the order line. */ + orderLineDiscountUpdate?: Maybe + /** Remove discount applied to the order line. */ + orderLineDiscountRemove?: Maybe + /** Mark order as manually paid. */ + orderMarkAsPaid?: Maybe + /** Refund an order. */ + orderRefund?: Maybe + /** Updates an order. */ + orderUpdate?: Maybe + /** Updates a shipping method of the order. */ + orderUpdateShipping?: Maybe + /** Void an order. */ + orderVoid?: Maybe + /** Cancels orders. */ + orderBulkCancel?: Maybe + /** Delete metadata of an object. */ + deleteMetadata?: Maybe + /** Delete object's private metadata. */ + deletePrivateMetadata?: Maybe + /** Updates metadata of an object. */ + updateMetadata?: Maybe + /** Updates private metadata of an object. */ + updatePrivateMetadata?: Maybe + /** Assigns storefront's navigation menus. */ + assignNavigation?: Maybe + /** Creates a new Menu. */ + menuCreate?: Maybe + /** Deletes a menu. */ + menuDelete?: Maybe + /** Deletes menus. */ + menuBulkDelete?: Maybe + /** Updates a menu. */ + menuUpdate?: Maybe + /** Creates a new menu item. */ + menuItemCreate?: Maybe + /** Deletes a menu item. */ + menuItemDelete?: Maybe + /** Deletes menu items. */ + menuItemBulkDelete?: Maybe + /** Updates a menu item. */ + menuItemUpdate?: Maybe + /** Creates/Updates translations for Menu Item. */ + menuItemTranslate?: Maybe + /** Moves items of menus. */ + menuItemMove?: Maybe + /** Request an invoice for the order using plugin. */ + invoiceRequest?: Maybe + /** Requests deletion of an invoice. */ + invoiceRequestDelete?: Maybe + /** Creates a ready to send invoice. */ + invoiceCreate?: Maybe + /** Deletes an invoice. */ + invoiceDelete?: Maybe + /** Updates an invoice. */ + invoiceUpdate?: Maybe + /** Send an invoice notification to the customer. */ + invoiceSendNotification?: Maybe + /** Activate a gift card. */ + giftCardActivate?: Maybe + /** Creates a new gift card. */ + giftCardCreate?: Maybe + /** Deactivate a gift card. */ + giftCardDeactivate?: Maybe + /** Update a gift card. */ + giftCardUpdate?: Maybe + /** Update plugin configuration. */ + pluginUpdate?: Maybe + /** Creates a new sale. */ + saleCreate?: Maybe + /** Deletes a sale. */ + saleDelete?: Maybe + /** Deletes sales. */ + saleBulkDelete?: Maybe + /** Updates a sale. */ + saleUpdate?: Maybe + /** Adds products, categories, collections to a voucher. */ + saleCataloguesAdd?: Maybe + /** Removes products, categories, collections from a sale. */ + saleCataloguesRemove?: Maybe + /** Creates/updates translations for a sale. */ + saleTranslate?: Maybe + /** Manage sale's availability in channels. */ + saleChannelListingUpdate?: Maybe + /** Creates a new voucher. */ + voucherCreate?: Maybe + /** Deletes a voucher. */ + voucherDelete?: Maybe + /** Deletes vouchers. */ + voucherBulkDelete?: Maybe + /** Updates a voucher. */ + voucherUpdate?: Maybe + /** Adds products, categories, collections to a voucher. */ + voucherCataloguesAdd?: Maybe + /** Removes products, categories, collections from a voucher. */ + voucherCataloguesRemove?: Maybe + /** Creates/Updates translations for Voucher. */ + voucherTranslate?: Maybe + /** Manage voucher's availability in channels. */ + voucherChannelListingUpdate?: Maybe + /** Export products to csv file. */ + exportProducts?: Maybe + /** Upload a file. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec */ + fileUpload?: Maybe + /** Adds a gift card or a voucher to a checkout. */ + checkoutAddPromoCode?: Maybe + /** Update billing address in the existing checkout. */ + checkoutBillingAddressUpdate?: Maybe + /** Completes the checkout. As a result a new order is created and a payment charge is made. This action requires a successful payment before it can be performed. In case additional confirmation step as 3D secure is required confirmationNeeded flag will be set to True and no order created until payment is confirmed with second call of this mutation. */ + checkoutComplete?: Maybe + /** Create a new checkout. */ + checkoutCreate?: Maybe + /** Sets the customer as the owner of the checkout. */ + checkoutCustomerAttach?: Maybe + /** Removes the user assigned as the owner of the checkout. */ + checkoutCustomerDetach?: Maybe + /** Updates email address in the existing checkout object. */ + checkoutEmailUpdate?: Maybe + /** Deletes a CheckoutLine. */ + checkoutLineDelete?: Maybe + /** Adds a checkout line to the existing checkout. */ + checkoutLinesAdd?: Maybe + /** Updates checkout line in the existing checkout. */ + checkoutLinesUpdate?: Maybe + /** Remove a gift card or a voucher from a checkout. */ + checkoutRemovePromoCode?: Maybe + /** Create a new payment for given checkout. */ + checkoutPaymentCreate?: Maybe + /** Update shipping address in the existing checkout. */ + checkoutShippingAddressUpdate?: Maybe + /** Updates the shipping address of the checkout. */ + checkoutShippingMethodUpdate?: Maybe + /** Update language code in the existing checkout. */ + checkoutLanguageCodeUpdate?: Maybe + /** Creates new channel. */ + channelCreate?: Maybe + /** Update a channel. */ + channelUpdate?: Maybe + /** Delete a channel. Orders associated with the deleted channel will be moved to the target channel. Checkouts, product availability, and pricing will be removed. */ + channelDelete?: Maybe + /** Activate a channel. */ + channelActivate?: Maybe + /** Deactivate a channel. */ + channelDeactivate?: Maybe + /** Creates an attribute. */ + attributeCreate?: Maybe + /** Deletes an attribute. */ + attributeDelete?: Maybe + /** Updates attribute. */ + attributeUpdate?: Maybe + /** Creates/Updates translations for attribute. */ + attributeTranslate?: Maybe + /** Deletes attributes. */ + attributeBulkDelete?: Maybe + /** Deletes values of attributes. */ + attributeValueBulkDelete?: Maybe + /** Creates a value for an attribute. */ + attributeValueCreate?: Maybe + /** Deletes a value of an attribute. */ + attributeValueDelete?: Maybe + /** Updates value of an attribute. */ + attributeValueUpdate?: Maybe + /** Creates/Updates translations for attribute value. */ + attributeValueTranslate?: Maybe + /** Reorder the values of an attribute. */ + attributeReorderValues?: Maybe + /** Creates a new app. */ + appCreate?: Maybe + /** Updates an existing app. */ + appUpdate?: Maybe + /** Deletes an app. */ + appDelete?: Maybe + /** Creates a new token. */ + appTokenCreate?: Maybe + /** Deletes an authentication token assigned to app. */ + appTokenDelete?: Maybe + /** Verify provided app token. */ + appTokenVerify?: Maybe + /** Install new app by using app manifest. */ + appInstall?: Maybe + /** Retry failed installation of new app. */ + appRetryInstall?: Maybe + /** Delete failed installation. */ + appDeleteFailedInstallation?: Maybe + /** Fetch and validate manifest. */ + appFetchManifest?: Maybe + /** Activate the app. */ + appActivate?: Maybe + /** Deactivate the app. */ + appDeactivate?: Maybe + /** Create JWT token. */ + tokenCreate?: Maybe + /** Refresh JWT token. Mutation tries to take refreshToken from the input.If it fails it will try to take refreshToken from the http-only cookie -refreshToken. csrfToken is required when refreshToken is provided as a cookie. */ + tokenRefresh?: Maybe + /** Verify JWT token. */ + tokenVerify?: Maybe + /** Deactivate all JWT tokens of the currently authenticated user. */ + tokensDeactivateAll?: Maybe + /** Prepare external authentication url for user by custom plugin. */ + externalAuthenticationUrl?: Maybe + /** Obtain external access tokens for user by custom plugin. */ + externalObtainAccessTokens?: Maybe + /** Refresh user's access by custom plugin. */ + externalRefresh?: Maybe + /** Logout user by custom plugin. */ + externalLogout?: Maybe + /** Verify external authentication data by plugin. */ + externalVerify?: Maybe + /** Sends an email with the account password modification link. */ + requestPasswordReset?: Maybe + /** Confirm user account with token sent by email during registration. */ + confirmAccount?: Maybe + /** Sets the user's password from the token sent by email using the RequestPasswordReset mutation. */ + setPassword?: Maybe + /** Change the password of the logged in user. */ + passwordChange?: Maybe + /** Request email change of the logged in user. */ + requestEmailChange?: Maybe + /** Confirm the email change of the logged-in user. */ + confirmEmailChange?: Maybe + /** Create a new address for the customer. */ + accountAddressCreate?: Maybe + /** Updates an address of the logged-in user. */ + accountAddressUpdate?: Maybe + /** Delete an address of the logged-in user. */ + accountAddressDelete?: Maybe + /** Sets a default address for the authenticated user. */ + accountSetDefaultAddress?: Maybe + /** Register a new user. */ + accountRegister?: Maybe + /** Updates the account of the logged-in user. */ + accountUpdate?: Maybe + /** Sends an email with the account removal link for the logged-in user. */ + accountRequestDeletion?: Maybe + /** Remove user account. */ + accountDelete?: Maybe + /** Creates user address. */ + addressCreate?: Maybe + /** Updates an address. */ + addressUpdate?: Maybe + /** Deletes an address. */ + addressDelete?: Maybe + /** Sets a default address for the given user. */ + addressSetDefault?: Maybe + /** Creates a new customer. */ + customerCreate?: Maybe + /** Updates an existing customer. */ + customerUpdate?: Maybe + /** Deletes a customer. */ + customerDelete?: Maybe + /** Deletes customers. */ + customerBulkDelete?: Maybe + /** Creates a new staff user. */ + staffCreate?: Maybe + /** Updates an existing staff user. */ + staffUpdate?: Maybe + /** Deletes a staff user. */ + staffDelete?: Maybe + /** Deletes staff users. */ + staffBulkDelete?: Maybe + /** Create a user avatar. Only for staff members. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec */ + userAvatarUpdate?: Maybe + /** Deletes a user avatar. Only for staff members. */ + userAvatarDelete?: Maybe + /** Activate or deactivate users. */ + userBulkSetActive?: Maybe + /** Create new permission group. */ + permissionGroupCreate?: Maybe + /** Update permission group. */ + permissionGroupUpdate?: Maybe + /** Delete permission group. */ + permissionGroupDelete?: Maybe +} + +export type MutationWebhookCreateArgs = { + input: WebhookCreateInput +} + +export type MutationWebhookDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationWebhookUpdateArgs = { + id: Scalars['ID'] + input: WebhookUpdateInput +} + +export type MutationCreateWarehouseArgs = { + input: WarehouseCreateInput +} + +export type MutationUpdateWarehouseArgs = { + id: Scalars['ID'] + input: WarehouseUpdateInput +} + +export type MutationDeleteWarehouseArgs = { + id: Scalars['ID'] +} + +export type MutationAssignWarehouseShippingZoneArgs = { + id: Scalars['ID'] + shippingZoneIds: Array +} + +export type MutationUnassignWarehouseShippingZoneArgs = { + id: Scalars['ID'] + shippingZoneIds: Array +} + +export type MutationStaffNotificationRecipientCreateArgs = { + input: StaffNotificationRecipientInput +} + +export type MutationStaffNotificationRecipientUpdateArgs = { + id: Scalars['ID'] + input: StaffNotificationRecipientInput +} + +export type MutationStaffNotificationRecipientDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationShopDomainUpdateArgs = { + input?: Maybe +} + +export type MutationShopSettingsUpdateArgs = { + input: ShopSettingsInput +} + +export type MutationShopSettingsTranslateArgs = { + input: ShopSettingsTranslationInput + languageCode: LanguageCodeEnum +} + +export type MutationShopAddressUpdateArgs = { + input?: Maybe +} + +export type MutationOrderSettingsUpdateArgs = { + input: OrderSettingsUpdateInput +} + +export type MutationShippingMethodChannelListingUpdateArgs = { + id: Scalars['ID'] + input: ShippingMethodChannelListingInput +} + +export type MutationShippingPriceCreateArgs = { + input: ShippingPriceInput +} + +export type MutationShippingPriceDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationShippingPriceBulkDeleteArgs = { + ids: Array> +} + +export type MutationShippingPriceUpdateArgs = { + id: Scalars['ID'] + input: ShippingPriceInput +} + +export type MutationShippingPriceTranslateArgs = { + id: Scalars['ID'] + input: ShippingPriceTranslationInput + languageCode: LanguageCodeEnum +} + +export type MutationShippingPriceExcludeProductsArgs = { + id: Scalars['ID'] + input: ShippingPriceExcludeProductsInput +} + +export type MutationShippingPriceRemoveProductFromExcludeArgs = { + id: Scalars['ID'] + products: Array> +} + +export type MutationShippingZoneCreateArgs = { + input: ShippingZoneCreateInput +} + +export type MutationShippingZoneDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationShippingZoneBulkDeleteArgs = { + ids: Array> +} + +export type MutationShippingZoneUpdateArgs = { + id: Scalars['ID'] + input: ShippingZoneUpdateInput +} + +export type MutationProductAttributeAssignArgs = { + operations: Array> + productTypeId: Scalars['ID'] +} + +export type MutationProductAttributeUnassignArgs = { + attributeIds: Array> + productTypeId: Scalars['ID'] +} + +export type MutationCategoryCreateArgs = { + input: CategoryInput + parent?: Maybe +} + +export type MutationCategoryDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationCategoryBulkDeleteArgs = { + ids: Array> +} + +export type MutationCategoryUpdateArgs = { + id: Scalars['ID'] + input: CategoryInput +} + +export type MutationCategoryTranslateArgs = { + id: Scalars['ID'] + input: TranslationInput + languageCode: LanguageCodeEnum +} + +export type MutationCollectionAddProductsArgs = { + collectionId: Scalars['ID'] + products: Array> +} + +export type MutationCollectionCreateArgs = { + input: CollectionCreateInput +} + +export type MutationCollectionDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationCollectionReorderProductsArgs = { + collectionId: Scalars['ID'] + moves: Array> +} + +export type MutationCollectionBulkDeleteArgs = { + ids: Array> +} + +export type MutationCollectionRemoveProductsArgs = { + collectionId: Scalars['ID'] + products: Array> +} + +export type MutationCollectionUpdateArgs = { + id: Scalars['ID'] + input: CollectionInput +} + +export type MutationCollectionTranslateArgs = { + id: Scalars['ID'] + input: TranslationInput + languageCode: LanguageCodeEnum +} + +export type MutationCollectionChannelListingUpdateArgs = { + id: Scalars['ID'] + input: CollectionChannelListingUpdateInput +} + +export type MutationProductCreateArgs = { + input: ProductCreateInput +} + +export type MutationProductDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationProductBulkDeleteArgs = { + ids: Array> +} + +export type MutationProductUpdateArgs = { + id: Scalars['ID'] + input: ProductInput +} + +export type MutationProductTranslateArgs = { + id: Scalars['ID'] + input: TranslationInput + languageCode: LanguageCodeEnum +} + +export type MutationProductChannelListingUpdateArgs = { + id: Scalars['ID'] + input: ProductChannelListingUpdateInput +} + +export type MutationProductMediaCreateArgs = { + input: ProductMediaCreateInput +} + +export type MutationProductVariantReorderArgs = { + moves: Array> + productId: Scalars['ID'] +} + +export type MutationProductMediaDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationProductMediaBulkDeleteArgs = { + ids: Array> +} + +export type MutationProductMediaReorderArgs = { + mediaIds: Array> + productId: Scalars['ID'] +} + +export type MutationProductMediaUpdateArgs = { + id: Scalars['ID'] + input: ProductMediaUpdateInput +} + +export type MutationProductTypeCreateArgs = { + input: ProductTypeInput +} + +export type MutationProductTypeDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationProductTypeBulkDeleteArgs = { + ids: Array> +} + +export type MutationProductTypeUpdateArgs = { + id: Scalars['ID'] + input: ProductTypeInput +} + +export type MutationProductTypeReorderAttributesArgs = { + moves: Array> + productTypeId: Scalars['ID'] + type: ProductAttributeType +} + +export type MutationProductReorderAttributeValuesArgs = { + attributeId: Scalars['ID'] + moves: Array> + productId: Scalars['ID'] +} + +export type MutationDigitalContentCreateArgs = { + input: DigitalContentUploadInput + variantId: Scalars['ID'] +} + +export type MutationDigitalContentDeleteArgs = { + variantId: Scalars['ID'] +} + +export type MutationDigitalContentUpdateArgs = { + input: DigitalContentInput + variantId: Scalars['ID'] +} + +export type MutationDigitalContentUrlCreateArgs = { + input: DigitalContentUrlCreateInput +} + +export type MutationProductVariantCreateArgs = { + input: ProductVariantCreateInput +} + +export type MutationProductVariantDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationProductVariantBulkCreateArgs = { + product: Scalars['ID'] + variants: Array> +} + +export type MutationProductVariantBulkDeleteArgs = { + ids: Array> +} + +export type MutationProductVariantStocksCreateArgs = { + stocks: Array + variantId: Scalars['ID'] +} + +export type MutationProductVariantStocksDeleteArgs = { + variantId: Scalars['ID'] + warehouseIds?: Maybe> +} + +export type MutationProductVariantStocksUpdateArgs = { + stocks: Array + variantId: Scalars['ID'] +} + +export type MutationProductVariantUpdateArgs = { + id: Scalars['ID'] + input: ProductVariantInput +} + +export type MutationProductVariantSetDefaultArgs = { + productId: Scalars['ID'] + variantId: Scalars['ID'] +} + +export type MutationProductVariantTranslateArgs = { + id: Scalars['ID'] + input: NameTranslationInput + languageCode: LanguageCodeEnum +} + +export type MutationProductVariantChannelListingUpdateArgs = { + id: Scalars['ID'] + input: Array +} + +export type MutationProductVariantReorderAttributeValuesArgs = { + attributeId: Scalars['ID'] + moves: Array> + variantId: Scalars['ID'] +} + +export type MutationVariantMediaAssignArgs = { + mediaId: Scalars['ID'] + variantId: Scalars['ID'] +} + +export type MutationVariantMediaUnassignArgs = { + mediaId: Scalars['ID'] + variantId: Scalars['ID'] +} + +export type MutationPaymentCaptureArgs = { + amount?: Maybe + paymentId: Scalars['ID'] +} + +export type MutationPaymentRefundArgs = { + amount?: Maybe + paymentId: Scalars['ID'] +} + +export type MutationPaymentVoidArgs = { + paymentId: Scalars['ID'] +} + +export type MutationPaymentInitializeArgs = { + channel?: Maybe + gateway: Scalars['String'] + paymentData?: Maybe +} + +export type MutationPageCreateArgs = { + input: PageCreateInput +} + +export type MutationPageDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationPageBulkDeleteArgs = { + ids: Array> +} + +export type MutationPageBulkPublishArgs = { + ids: Array> + isPublished: Scalars['Boolean'] +} + +export type MutationPageUpdateArgs = { + id: Scalars['ID'] + input: PageInput +} + +export type MutationPageTranslateArgs = { + id: Scalars['ID'] + input: PageTranslationInput + languageCode: LanguageCodeEnum +} + +export type MutationPageTypeCreateArgs = { + input: PageTypeCreateInput +} + +export type MutationPageTypeUpdateArgs = { + id?: Maybe + input: PageTypeUpdateInput +} + +export type MutationPageTypeDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationPageTypeBulkDeleteArgs = { + ids: Array +} + +export type MutationPageAttributeAssignArgs = { + attributeIds: Array + pageTypeId: Scalars['ID'] +} + +export type MutationPageAttributeUnassignArgs = { + attributeIds: Array + pageTypeId: Scalars['ID'] +} + +export type MutationPageTypeReorderAttributesArgs = { + moves: Array + pageTypeId: Scalars['ID'] +} + +export type MutationPageReorderAttributeValuesArgs = { + attributeId: Scalars['ID'] + moves: Array> + pageId: Scalars['ID'] +} + +export type MutationDraftOrderCompleteArgs = { + id: Scalars['ID'] +} + +export type MutationDraftOrderCreateArgs = { + input: DraftOrderCreateInput +} + +export type MutationDraftOrderDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationDraftOrderBulkDeleteArgs = { + ids: Array> +} + +export type MutationDraftOrderLinesBulkDeleteArgs = { + ids: Array> +} + +export type MutationDraftOrderUpdateArgs = { + id: Scalars['ID'] + input: DraftOrderInput +} + +export type MutationOrderAddNoteArgs = { + order: Scalars['ID'] + input: OrderAddNoteInput +} + +export type MutationOrderCancelArgs = { + id: Scalars['ID'] +} + +export type MutationOrderCaptureArgs = { + amount: Scalars['PositiveDecimal'] + id: Scalars['ID'] +} + +export type MutationOrderConfirmArgs = { + id: Scalars['ID'] +} + +export type MutationOrderFulfillArgs = { + input: OrderFulfillInput + order?: Maybe +} + +export type MutationOrderFulfillmentCancelArgs = { + id: Scalars['ID'] + input: FulfillmentCancelInput +} + +export type MutationOrderFulfillmentUpdateTrackingArgs = { + id: Scalars['ID'] + input: FulfillmentUpdateTrackingInput +} + +export type MutationOrderFulfillmentRefundProductsArgs = { + input: OrderRefundProductsInput + order: Scalars['ID'] +} + +export type MutationOrderFulfillmentReturnProductsArgs = { + input: OrderReturnProductsInput + order: Scalars['ID'] +} + +export type MutationOrderLinesCreateArgs = { + id: Scalars['ID'] + input: Array> +} + +export type MutationOrderLineDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationOrderLineUpdateArgs = { + id: Scalars['ID'] + input: OrderLineInput +} + +export type MutationOrderDiscountAddArgs = { + input: OrderDiscountCommonInput + orderId: Scalars['ID'] +} + +export type MutationOrderDiscountUpdateArgs = { + discountId: Scalars['ID'] + input: OrderDiscountCommonInput +} + +export type MutationOrderDiscountDeleteArgs = { + discountId: Scalars['ID'] +} + +export type MutationOrderLineDiscountUpdateArgs = { + input: OrderDiscountCommonInput + orderLineId: Scalars['ID'] +} + +export type MutationOrderLineDiscountRemoveArgs = { + orderLineId: Scalars['ID'] +} + +export type MutationOrderMarkAsPaidArgs = { + id: Scalars['ID'] + transactionReference?: Maybe +} + +export type MutationOrderRefundArgs = { + amount: Scalars['PositiveDecimal'] + id: Scalars['ID'] +} + +export type MutationOrderUpdateArgs = { + id: Scalars['ID'] + input: OrderUpdateInput +} + +export type MutationOrderUpdateShippingArgs = { + order: Scalars['ID'] + input?: Maybe +} + +export type MutationOrderVoidArgs = { + id: Scalars['ID'] +} + +export type MutationOrderBulkCancelArgs = { + ids: Array> +} + +export type MutationDeleteMetadataArgs = { + id: Scalars['ID'] + keys: Array +} + +export type MutationDeletePrivateMetadataArgs = { + id: Scalars['ID'] + keys: Array +} + +export type MutationUpdateMetadataArgs = { + id: Scalars['ID'] + input: Array +} + +export type MutationUpdatePrivateMetadataArgs = { + id: Scalars['ID'] + input: Array +} + +export type MutationAssignNavigationArgs = { + menu?: Maybe + navigationType: NavigationType +} + +export type MutationMenuCreateArgs = { + input: MenuCreateInput +} + +export type MutationMenuDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationMenuBulkDeleteArgs = { + ids: Array> +} + +export type MutationMenuUpdateArgs = { + id: Scalars['ID'] + input: MenuInput +} + +export type MutationMenuItemCreateArgs = { + input: MenuItemCreateInput +} + +export type MutationMenuItemDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationMenuItemBulkDeleteArgs = { + ids: Array> +} + +export type MutationMenuItemUpdateArgs = { + id: Scalars['ID'] + input: MenuItemInput +} + +export type MutationMenuItemTranslateArgs = { + id: Scalars['ID'] + input: NameTranslationInput + languageCode: LanguageCodeEnum +} + +export type MutationMenuItemMoveArgs = { + menu: Scalars['ID'] + moves: Array> +} + +export type MutationInvoiceRequestArgs = { + number?: Maybe + orderId: Scalars['ID'] +} + +export type MutationInvoiceRequestDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationInvoiceCreateArgs = { + input: InvoiceCreateInput + orderId: Scalars['ID'] +} + +export type MutationInvoiceDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationInvoiceUpdateArgs = { + id: Scalars['ID'] + input: UpdateInvoiceInput +} + +export type MutationInvoiceSendNotificationArgs = { + id: Scalars['ID'] +} + +export type MutationGiftCardActivateArgs = { + id: Scalars['ID'] +} + +export type MutationGiftCardCreateArgs = { + input: GiftCardCreateInput +} + +export type MutationGiftCardDeactivateArgs = { + id: Scalars['ID'] +} + +export type MutationGiftCardUpdateArgs = { + id: Scalars['ID'] + input: GiftCardUpdateInput +} + +export type MutationPluginUpdateArgs = { + channel?: Maybe + id: Scalars['ID'] + input: PluginUpdateInput +} + +export type MutationSaleCreateArgs = { + input: SaleInput +} + +export type MutationSaleDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationSaleBulkDeleteArgs = { + ids: Array> +} + +export type MutationSaleUpdateArgs = { + id: Scalars['ID'] + input: SaleInput +} + +export type MutationSaleCataloguesAddArgs = { + id: Scalars['ID'] + input: CatalogueInput +} + +export type MutationSaleCataloguesRemoveArgs = { + id: Scalars['ID'] + input: CatalogueInput +} + +export type MutationSaleTranslateArgs = { + id: Scalars['ID'] + input: NameTranslationInput + languageCode: LanguageCodeEnum +} + +export type MutationSaleChannelListingUpdateArgs = { + id: Scalars['ID'] + input: SaleChannelListingInput +} + +export type MutationVoucherCreateArgs = { + input: VoucherInput +} + +export type MutationVoucherDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationVoucherBulkDeleteArgs = { + ids: Array> +} + +export type MutationVoucherUpdateArgs = { + id: Scalars['ID'] + input: VoucherInput +} + +export type MutationVoucherCataloguesAddArgs = { + id: Scalars['ID'] + input: CatalogueInput +} + +export type MutationVoucherCataloguesRemoveArgs = { + id: Scalars['ID'] + input: CatalogueInput +} + +export type MutationVoucherTranslateArgs = { + id: Scalars['ID'] + input: NameTranslationInput + languageCode: LanguageCodeEnum +} + +export type MutationVoucherChannelListingUpdateArgs = { + id: Scalars['ID'] + input: VoucherChannelListingInput +} + +export type MutationExportProductsArgs = { + input: ExportProductsInput +} + +export type MutationFileUploadArgs = { + file: Scalars['Upload'] +} + +export type MutationCheckoutAddPromoCodeArgs = { + checkoutId: Scalars['ID'] + promoCode: Scalars['String'] +} + +export type MutationCheckoutBillingAddressUpdateArgs = { + billingAddress: AddressInput + checkoutId: Scalars['ID'] +} + +export type MutationCheckoutCompleteArgs = { + checkoutId: Scalars['ID'] + paymentData?: Maybe + redirectUrl?: Maybe + storeSource?: Maybe +} + +export type MutationCheckoutCreateArgs = { + input: CheckoutCreateInput +} + +export type MutationCheckoutCustomerAttachArgs = { + checkoutId: Scalars['ID'] +} + +export type MutationCheckoutCustomerDetachArgs = { + checkoutId: Scalars['ID'] +} + +export type MutationCheckoutEmailUpdateArgs = { + checkoutId?: Maybe + email: Scalars['String'] +} + +export type MutationCheckoutLineDeleteArgs = { + checkoutId: Scalars['ID'] + lineId?: Maybe +} + +export type MutationCheckoutLinesAddArgs = { + checkoutId: Scalars['ID'] + lines: Array> +} + +export type MutationCheckoutLinesUpdateArgs = { + checkoutId: Scalars['ID'] + lines: Array> +} + +export type MutationCheckoutRemovePromoCodeArgs = { + checkoutId: Scalars['ID'] + promoCode: Scalars['String'] +} + +export type MutationCheckoutPaymentCreateArgs = { + checkoutId: Scalars['ID'] + input: PaymentInput +} + +export type MutationCheckoutShippingAddressUpdateArgs = { + checkoutId: Scalars['ID'] + shippingAddress: AddressInput +} + +export type MutationCheckoutShippingMethodUpdateArgs = { + checkoutId?: Maybe + shippingMethodId: Scalars['ID'] +} + +export type MutationCheckoutLanguageCodeUpdateArgs = { + checkoutId: Scalars['ID'] + languageCode: LanguageCodeEnum +} + +export type MutationChannelCreateArgs = { + input: ChannelCreateInput +} + +export type MutationChannelUpdateArgs = { + id: Scalars['ID'] + input: ChannelUpdateInput +} + +export type MutationChannelDeleteArgs = { + id: Scalars['ID'] + input?: Maybe +} + +export type MutationChannelActivateArgs = { + id: Scalars['ID'] +} + +export type MutationChannelDeactivateArgs = { + id: Scalars['ID'] +} + +export type MutationAttributeCreateArgs = { + input: AttributeCreateInput +} + +export type MutationAttributeDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationAttributeUpdateArgs = { + id: Scalars['ID'] + input: AttributeUpdateInput +} + +export type MutationAttributeTranslateArgs = { + id: Scalars['ID'] + input: NameTranslationInput + languageCode: LanguageCodeEnum +} + +export type MutationAttributeBulkDeleteArgs = { + ids: Array> +} + +export type MutationAttributeValueBulkDeleteArgs = { + ids: Array> +} + +export type MutationAttributeValueCreateArgs = { + attribute: Scalars['ID'] + input: AttributeValueCreateInput +} + +export type MutationAttributeValueDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationAttributeValueUpdateArgs = { + id: Scalars['ID'] + input: AttributeValueCreateInput +} + +export type MutationAttributeValueTranslateArgs = { + id: Scalars['ID'] + input: AttributeValueTranslationInput + languageCode: LanguageCodeEnum +} + +export type MutationAttributeReorderValuesArgs = { + attributeId: Scalars['ID'] + moves: Array> +} + +export type MutationAppCreateArgs = { + input: AppInput +} + +export type MutationAppUpdateArgs = { + id: Scalars['ID'] + input: AppInput +} + +export type MutationAppDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationAppTokenCreateArgs = { + input: AppTokenInput +} + +export type MutationAppTokenDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationAppTokenVerifyArgs = { + token: Scalars['String'] +} + +export type MutationAppInstallArgs = { + input: AppInstallInput +} + +export type MutationAppRetryInstallArgs = { + activateAfterInstallation?: Maybe + id: Scalars['ID'] +} + +export type MutationAppDeleteFailedInstallationArgs = { + id: Scalars['ID'] +} + +export type MutationAppFetchManifestArgs = { + manifestUrl: Scalars['String'] +} + +export type MutationAppActivateArgs = { + id: Scalars['ID'] +} + +export type MutationAppDeactivateArgs = { + id: Scalars['ID'] +} + +export type MutationTokenCreateArgs = { + email: Scalars['String'] + password: Scalars['String'] +} + +export type MutationTokenRefreshArgs = { + csrfToken?: Maybe + refreshToken?: Maybe +} + +export type MutationTokenVerifyArgs = { + token: Scalars['String'] +} + +export type MutationExternalAuthenticationUrlArgs = { + input: Scalars['JSONString'] + pluginId: Scalars['String'] +} + +export type MutationExternalObtainAccessTokensArgs = { + input: Scalars['JSONString'] + pluginId: Scalars['String'] +} + +export type MutationExternalRefreshArgs = { + input: Scalars['JSONString'] + pluginId: Scalars['String'] +} + +export type MutationExternalLogoutArgs = { + input: Scalars['JSONString'] + pluginId: Scalars['String'] +} + +export type MutationExternalVerifyArgs = { + input: Scalars['JSONString'] + pluginId: Scalars['String'] +} + +export type MutationRequestPasswordResetArgs = { + channel?: Maybe + email: Scalars['String'] + redirectUrl: Scalars['String'] +} + +export type MutationConfirmAccountArgs = { + email: Scalars['String'] + token: Scalars['String'] +} + +export type MutationSetPasswordArgs = { + email: Scalars['String'] + password: Scalars['String'] + token: Scalars['String'] +} + +export type MutationPasswordChangeArgs = { + newPassword: Scalars['String'] + oldPassword: Scalars['String'] +} + +export type MutationRequestEmailChangeArgs = { + channel?: Maybe + newEmail: Scalars['String'] + password: Scalars['String'] + redirectUrl: Scalars['String'] +} + +export type MutationConfirmEmailChangeArgs = { + channel?: Maybe + token: Scalars['String'] +} + +export type MutationAccountAddressCreateArgs = { + input: AddressInput + type?: Maybe +} + +export type MutationAccountAddressUpdateArgs = { + id: Scalars['ID'] + input: AddressInput +} + +export type MutationAccountAddressDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationAccountSetDefaultAddressArgs = { + id: Scalars['ID'] + type: AddressTypeEnum +} + +export type MutationAccountRegisterArgs = { + input: AccountRegisterInput +} + +export type MutationAccountUpdateArgs = { + input: AccountInput +} + +export type MutationAccountRequestDeletionArgs = { + channel?: Maybe + redirectUrl: Scalars['String'] +} + +export type MutationAccountDeleteArgs = { + token: Scalars['String'] +} + +export type MutationAddressCreateArgs = { + input: AddressInput + userId: Scalars['ID'] +} + +export type MutationAddressUpdateArgs = { + id: Scalars['ID'] + input: AddressInput +} + +export type MutationAddressDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationAddressSetDefaultArgs = { + addressId: Scalars['ID'] + type: AddressTypeEnum + userId: Scalars['ID'] +} + +export type MutationCustomerCreateArgs = { + input: UserCreateInput +} + +export type MutationCustomerUpdateArgs = { + id: Scalars['ID'] + input: CustomerInput +} + +export type MutationCustomerDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationCustomerBulkDeleteArgs = { + ids: Array> +} + +export type MutationStaffCreateArgs = { + input: StaffCreateInput +} + +export type MutationStaffUpdateArgs = { + id: Scalars['ID'] + input: StaffUpdateInput +} + +export type MutationStaffDeleteArgs = { + id: Scalars['ID'] +} + +export type MutationStaffBulkDeleteArgs = { + ids: Array> +} + +export type MutationUserAvatarUpdateArgs = { + image: Scalars['Upload'] +} + +export type MutationUserBulkSetActiveArgs = { + ids: Array> + isActive: Scalars['Boolean'] +} + +export type MutationPermissionGroupCreateArgs = { + input: PermissionGroupCreateInput +} + +export type MutationPermissionGroupUpdateArgs = { + id: Scalars['ID'] + input: PermissionGroupUpdateInput +} + +export type MutationPermissionGroupDeleteArgs = { + id: Scalars['ID'] +} + +export type NameTranslationInput = { + name?: Maybe +} + +export enum NavigationType { + /** Main storefront navigation. */ + Main = 'MAIN', + /** Secondary storefront navigation. */ + Secondary = 'SECONDARY', +} + +/** An object with an ID */ +export type Node = { + /** The ID of the object. */ + id: Scalars['ID'] +} + +export type ObjectWithMetadata = { + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> +} + +/** Represents an order in the shop. */ +export type Order = Node & + ObjectWithMetadata & { + __typename?: 'Order' + /** The ID of the object. */ + id: Scalars['ID'] + created: Scalars['DateTime'] + status: OrderStatus + user?: Maybe + trackingClientId: Scalars['String'] + billingAddress?: Maybe
+ shippingAddress?: Maybe
+ shippingMethod?: Maybe + shippingMethodName?: Maybe + channel: Channel + /** Total price of shipping. */ + shippingPrice: TaxedMoney + shippingTaxRate: Scalars['Float'] + token: Scalars['String'] + voucher?: Maybe + /** List of user gift cards. */ + giftCards?: Maybe>> + displayGrossPrices: Scalars['Boolean'] + customerNote: Scalars['String'] + weight?: Maybe + redirectUrl?: Maybe + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** List of shipments for the order. */ + fulfillments: Array> + /** List of order lines. */ + lines: Array> + /** List of actions that can be performed in the current state of an order. */ + actions: Array> + /** Shipping methods that can be used with this order. */ + availableShippingMethods?: Maybe>> + /** List of order invoices. */ + invoices?: Maybe>> + /** User-friendly number of an order. */ + number?: Maybe + /** The ID of the order that was the base for this order. */ + original?: Maybe + /** The order origin. */ + origin: OrderOriginEnum + /** Informs if an order is fully paid. */ + isPaid: Scalars['Boolean'] + /** Internal payment status. */ + paymentStatus: PaymentChargeStatusEnum + /** User-friendly payment status. */ + paymentStatusDisplay: Scalars['String'] + /** List of payments for the order. */ + payments?: Maybe>> + /** Total amount of the order. */ + total: TaxedMoney + /** Undiscounted total amount of the order. */ + undiscountedTotal: TaxedMoney + /** The sum of line prices not including shipping. */ + subtotal: TaxedMoney + /** User-friendly order status. */ + statusDisplay?: Maybe + /** Informs whether a draft order can be finalized(turned into a regular order). */ + canFinalize: Scalars['Boolean'] + /** Amount authorized for the order. */ + totalAuthorized: Money + /** Amount captured by payment. */ + totalCaptured: Money + /** List of events associated with the order. */ + events?: Maybe>> + /** The difference between the paid and the order total amount. */ + totalBalance: Money + /** Email address of the customer. */ + userEmail?: Maybe + /** Returns True, if order requires shipping. */ + isShippingRequired: Scalars['Boolean'] + /** @deprecated Use the `languageCodeEnum` field to fetch the language code. This field will be removed in Saleor 4.0. */ + languageCode: Scalars['String'] + /** Order language code. */ + languageCodeEnum: LanguageCodeEnum + /** + * Returns applied discount. + * @deprecated Use discounts field. This field will be removed in Saleor 4.0. + */ + discount?: Maybe + /** + * Discount name. + * @deprecated Use discounts field. This field will be removed in Saleor 4.0. + */ + discountName?: Maybe + /** + * Translated discount name. + * @deprecated Use discounts field. This field will be removed in Saleor 4.0. + */ + translatedDiscountName?: Maybe + /** List of all discounts assigned to the order. */ + discounts?: Maybe> + } + +export enum OrderAction { + /** Represents the capture action. */ + Capture = 'CAPTURE', + /** Represents a mark-as-paid action. */ + MarkAsPaid = 'MARK_AS_PAID', + /** Represents a refund action. */ + Refund = 'REFUND', + /** Represents a void action. */ + Void = 'VOID', +} + +/** Adds note to the order. */ +export type OrderAddNote = { + __typename?: 'OrderAddNote' + /** Order with the note added. */ + order?: Maybe + /** Order note created. */ + event?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +export type OrderAddNoteInput = { + /** Note message. */ + message: Scalars['String'] +} + +/** Cancels orders. */ +export type OrderBulkCancel = { + __typename?: 'OrderBulkCancel' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** Cancel an order. */ +export type OrderCancel = { + __typename?: 'OrderCancel' + /** Canceled order. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** Capture an order. */ +export type OrderCapture = { + __typename?: 'OrderCapture' + /** Captured order. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** Confirms an unconfirmed order by changing status to unfulfilled. */ +export type OrderConfirm = { + __typename?: 'OrderConfirm' + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +export type OrderCountableConnection = { + __typename?: 'OrderCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type OrderCountableEdge = { + __typename?: 'OrderCountableEdge' + /** The item at the end of the edge. */ + node: Order + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +export enum OrderDirection { + /** Specifies an ascending sort order. */ + Asc = 'ASC', + /** Specifies a descending sort order. */ + Desc = 'DESC', +} + +/** Contains all details related to the applied discount to the order. */ +export type OrderDiscount = Node & { + __typename?: 'OrderDiscount' + /** The ID of the object. */ + id: Scalars['ID'] + type: OrderDiscountType + /** Type of the discount: fixed or percent */ + valueType: DiscountValueTypeEnum + /** Value of the discount. Can store fixed value or percent value */ + value: Scalars['PositiveDecimal'] + name?: Maybe + translatedName?: Maybe + /** Explanation for the applied discount. */ + reason?: Maybe + /** Returns amount of discount. */ + amount: Money +} + +/** Adds discount to the order. */ +export type OrderDiscountAdd = { + __typename?: 'OrderDiscountAdd' + /** Order which has been discounted. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +export type OrderDiscountCommonInput = { + /** Type of the discount: fixed or percent */ + valueType: DiscountValueTypeEnum + /** Value of the discount. Can store fixed value or percent value */ + value: Scalars['PositiveDecimal'] + /** Explanation for the applied discount. */ + reason?: Maybe +} + +/** Remove discount from the order. */ +export type OrderDiscountDelete = { + __typename?: 'OrderDiscountDelete' + /** Order which has removed discount. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** An enumeration. */ +export enum OrderDiscountType { + /** Voucher */ + Voucher = 'VOUCHER', + /** Manual */ + Manual = 'MANUAL', +} + +/** Update discount for the order. */ +export type OrderDiscountUpdate = { + __typename?: 'OrderDiscountUpdate' + /** Order which has been discounted. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +export type OrderDraftFilterInput = { + customer?: Maybe + created?: Maybe + search?: Maybe + metadata?: Maybe>> + channels?: Maybe>> +} + +export type OrderError = { + __typename?: 'OrderError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: OrderErrorCode + /** Warehouse ID which causes the error. */ + warehouse?: Maybe + /** Order line ID which causes the error. */ + orderLine?: Maybe + /** List of product variants that are associated with the error */ + variants?: Maybe> + /** A type of address that causes the error. */ + addressType?: Maybe +} + +/** An enumeration. */ +export enum OrderErrorCode { + BillingAddressNotSet = 'BILLING_ADDRESS_NOT_SET', + CannotCancelFulfillment = 'CANNOT_CANCEL_FULFILLMENT', + CannotCancelOrder = 'CANNOT_CANCEL_ORDER', + CannotDelete = 'CANNOT_DELETE', + CannotDiscount = 'CANNOT_DISCOUNT', + CannotRefund = 'CANNOT_REFUND', + CaptureInactivePayment = 'CAPTURE_INACTIVE_PAYMENT', + NotEditable = 'NOT_EDITABLE', + FulfillOrderLine = 'FULFILL_ORDER_LINE', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + ProductNotPublished = 'PRODUCT_NOT_PUBLISHED', + ProductUnavailableForPurchase = 'PRODUCT_UNAVAILABLE_FOR_PURCHASE', + NotFound = 'NOT_FOUND', + OrderNoShippingAddress = 'ORDER_NO_SHIPPING_ADDRESS', + PaymentError = 'PAYMENT_ERROR', + PaymentMissing = 'PAYMENT_MISSING', + Required = 'REQUIRED', + ShippingMethodNotApplicable = 'SHIPPING_METHOD_NOT_APPLICABLE', + ShippingMethodRequired = 'SHIPPING_METHOD_REQUIRED', + TaxError = 'TAX_ERROR', + Unique = 'UNIQUE', + VoidInactivePayment = 'VOID_INACTIVE_PAYMENT', + ZeroQuantity = 'ZERO_QUANTITY', + InvalidQuantity = 'INVALID_QUANTITY', + InsufficientStock = 'INSUFFICIENT_STOCK', + DuplicatedInputItem = 'DUPLICATED_INPUT_ITEM', + NotAvailableInChannel = 'NOT_AVAILABLE_IN_CHANNEL', + ChannelInactive = 'CHANNEL_INACTIVE', +} + +/** History log of the order. */ +export type OrderEvent = Node & { + __typename?: 'OrderEvent' + /** The ID of the object. */ + id: Scalars['ID'] + /** Date when event happened at in ISO 8601 format. */ + date?: Maybe + /** Order event type. */ + type?: Maybe + /** User who performed the action. */ + user?: Maybe + /** Content of the event. */ + message?: Maybe + /** Email of the customer. */ + email?: Maybe + /** Type of an email sent to the customer. */ + emailType?: Maybe + /** Amount of money. */ + amount?: Maybe + /** The payment ID from the payment gateway. */ + paymentId?: Maybe + /** The payment gateway of the payment. */ + paymentGateway?: Maybe + /** Number of items. */ + quantity?: Maybe + /** Composed ID of the Fulfillment. */ + composedId?: Maybe + /** User-friendly number of an order. */ + orderNumber?: Maybe + /** Number of an invoice related to the order. */ + invoiceNumber?: Maybe + /** List of oversold lines names. */ + oversoldItems?: Maybe>> + /** The concerned lines. */ + lines?: Maybe>> + /** The lines fulfilled. */ + fulfilledItems?: Maybe>> + /** The warehouse were items were restocked. */ + warehouse?: Maybe + /** The transaction reference of captured payment. */ + transactionReference?: Maybe + /** Define if shipping costs were included to the refund. */ + shippingCostsIncluded?: Maybe + /** The order which is related to this order. */ + relatedOrder?: Maybe + /** The discount applied to the order. */ + discount?: Maybe +} + +export type OrderEventCountableConnection = { + __typename?: 'OrderEventCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type OrderEventCountableEdge = { + __typename?: 'OrderEventCountableEdge' + /** The item at the end of the edge. */ + node: OrderEvent + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +export type OrderEventDiscountObject = { + __typename?: 'OrderEventDiscountObject' + /** Type of the discount: fixed or percent. */ + valueType: DiscountValueTypeEnum + /** Value of the discount. Can store fixed value or percent value. */ + value: Scalars['PositiveDecimal'] + /** Explanation for the applied discount. */ + reason?: Maybe + /** Returns amount of discount. */ + amount?: Maybe + /** Type of the discount: fixed or percent. */ + oldValueType?: Maybe + /** Value of the discount. Can store fixed value or percent value. */ + oldValue?: Maybe + /** Returns amount of discount. */ + oldAmount?: Maybe +} + +export type OrderEventOrderLineObject = { + __typename?: 'OrderEventOrderLineObject' + /** The variant quantity. */ + quantity?: Maybe + /** The order line. */ + orderLine?: Maybe + /** The variant name. */ + itemName?: Maybe + /** The discount applied to the order line. */ + discount?: Maybe +} + +/** An enumeration. */ +export enum OrderEventsEmailsEnum { + PaymentConfirmation = 'PAYMENT_CONFIRMATION', + Confirmed = 'CONFIRMED', + ShippingConfirmation = 'SHIPPING_CONFIRMATION', + TrackingUpdated = 'TRACKING_UPDATED', + OrderConfirmation = 'ORDER_CONFIRMATION', + OrderCancel = 'ORDER_CANCEL', + OrderRefund = 'ORDER_REFUND', + FulfillmentConfirmation = 'FULFILLMENT_CONFIRMATION', + DigitalLinks = 'DIGITAL_LINKS', +} + +/** An enumeration. */ +export enum OrderEventsEnum { + DraftCreated = 'DRAFT_CREATED', + DraftCreatedFromReplace = 'DRAFT_CREATED_FROM_REPLACE', + AddedProducts = 'ADDED_PRODUCTS', + RemovedProducts = 'REMOVED_PRODUCTS', + Placed = 'PLACED', + PlacedFromDraft = 'PLACED_FROM_DRAFT', + OversoldItems = 'OVERSOLD_ITEMS', + Canceled = 'CANCELED', + OrderMarkedAsPaid = 'ORDER_MARKED_AS_PAID', + OrderFullyPaid = 'ORDER_FULLY_PAID', + OrderReplacementCreated = 'ORDER_REPLACEMENT_CREATED', + OrderDiscountAdded = 'ORDER_DISCOUNT_ADDED', + OrderDiscountAutomaticallyUpdated = 'ORDER_DISCOUNT_AUTOMATICALLY_UPDATED', + OrderDiscountUpdated = 'ORDER_DISCOUNT_UPDATED', + OrderDiscountDeleted = 'ORDER_DISCOUNT_DELETED', + OrderLineDiscountUpdated = 'ORDER_LINE_DISCOUNT_UPDATED', + OrderLineDiscountRemoved = 'ORDER_LINE_DISCOUNT_REMOVED', + UpdatedAddress = 'UPDATED_ADDRESS', + EmailSent = 'EMAIL_SENT', + Confirmed = 'CONFIRMED', + PaymentAuthorized = 'PAYMENT_AUTHORIZED', + PaymentCaptured = 'PAYMENT_CAPTURED', + ExternalServiceNotification = 'EXTERNAL_SERVICE_NOTIFICATION', + PaymentRefunded = 'PAYMENT_REFUNDED', + PaymentVoided = 'PAYMENT_VOIDED', + PaymentFailed = 'PAYMENT_FAILED', + InvoiceRequested = 'INVOICE_REQUESTED', + InvoiceGenerated = 'INVOICE_GENERATED', + InvoiceUpdated = 'INVOICE_UPDATED', + InvoiceSent = 'INVOICE_SENT', + FulfillmentCanceled = 'FULFILLMENT_CANCELED', + FulfillmentRestockedItems = 'FULFILLMENT_RESTOCKED_ITEMS', + FulfillmentFulfilledItems = 'FULFILLMENT_FULFILLED_ITEMS', + FulfillmentRefunded = 'FULFILLMENT_REFUNDED', + FulfillmentReturned = 'FULFILLMENT_RETURNED', + FulfillmentReplaced = 'FULFILLMENT_REPLACED', + TrackingUpdated = 'TRACKING_UPDATED', + NoteAdded = 'NOTE_ADDED', + Other = 'OTHER', +} + +export type OrderFilterInput = { + paymentStatus?: Maybe>> + status?: Maybe>> + customer?: Maybe + created?: Maybe + search?: Maybe + metadata?: Maybe>> + channels?: Maybe>> +} + +/** Creates new fulfillments for an order. */ +export type OrderFulfill = { + __typename?: 'OrderFulfill' + /** List of created fulfillments. */ + fulfillments?: Maybe>> + /** Fulfilled order. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +export type OrderFulfillInput = { + /** List of items informing how to fulfill the order. */ + lines: Array + /** If true, send an email notification to the customer. */ + notifyCustomer?: Maybe +} + +export type OrderFulfillLineInput = { + /** The ID of the order line. */ + orderLineId?: Maybe + /** List of stock items to create. */ + stocks: Array +} + +export type OrderFulfillStockInput = { + /** The number of line items to be fulfilled from given warehouse. */ + quantity: Scalars['Int'] + /** ID of the warehouse from which the item will be fulfilled. */ + warehouse: Scalars['ID'] +} + +/** Represents order line of particular order. */ +export type OrderLine = Node & { + __typename?: 'OrderLine' + /** The ID of the object. */ + id: Scalars['ID'] + productName: Scalars['String'] + variantName: Scalars['String'] + productSku: Scalars['String'] + isShippingRequired: Scalars['Boolean'] + quantity: Scalars['Int'] + quantityFulfilled: Scalars['Int'] + unitDiscountReason?: Maybe + taxRate: Scalars['Float'] + digitalContentUrl?: Maybe + /** The main thumbnail for the ordered product. */ + thumbnail?: Maybe + /** Price of the single item in the order line. */ + unitPrice: TaxedMoney + /** Price of the single item in the order line without applied an order line discount. */ + undiscountedUnitPrice: TaxedMoney + /** The discount applied to the single order line. */ + unitDiscount: Money + /** Value of the discount. Can store fixed value or percent value */ + unitDiscountValue: Scalars['PositiveDecimal'] + /** Price of the order line. */ + totalPrice: TaxedMoney + /** A purchased product variant. Note: this field may be null if the variant has been removed from stock at all. */ + variant?: Maybe + /** Product name in the customer's language */ + translatedProductName: Scalars['String'] + /** Variant name in the customer's language */ + translatedVariantName: Scalars['String'] + /** List of allocations across warehouses. */ + allocations?: Maybe> + /** Type of the discount: fixed or percent */ + unitDiscountType?: Maybe +} + +/** Represents order line of particular order. */ +export type OrderLineThumbnailArgs = { + size?: Maybe +} + +export type OrderLineCreateInput = { + /** Number of variant items ordered. */ + quantity: Scalars['Int'] + /** Product variant ID. */ + variantId: Scalars['ID'] +} + +/** Deletes an order line from an order. */ +export type OrderLineDelete = { + __typename?: 'OrderLineDelete' + /** A related order. */ + order?: Maybe + /** An order line that was deleted. */ + orderLine?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** Remove discount applied to the order line. */ +export type OrderLineDiscountRemove = { + __typename?: 'OrderLineDiscountRemove' + /** Order line which has removed discount. */ + orderLine?: Maybe + /** Order which is related to line which has removed discount. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** Update discount for the order line. */ +export type OrderLineDiscountUpdate = { + __typename?: 'OrderLineDiscountUpdate' + /** Order line which has been discounted. */ + orderLine?: Maybe + /** Order which is related to the discounted line. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +export type OrderLineInput = { + /** Number of variant items ordered. */ + quantity: Scalars['Int'] +} + +/** Updates an order line of an order. */ +export type OrderLineUpdate = { + __typename?: 'OrderLineUpdate' + /** Related order. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array + orderLine?: Maybe +} + +/** Create order lines for an order. */ +export type OrderLinesCreate = { + __typename?: 'OrderLinesCreate' + /** Related order. */ + order?: Maybe + /** List of added order lines. */ + orderLines?: Maybe> + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** Mark order as manually paid. */ +export type OrderMarkAsPaid = { + __typename?: 'OrderMarkAsPaid' + /** Order marked as paid. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** An enumeration. */ +export enum OrderOriginEnum { + Checkout = 'CHECKOUT', + Draft = 'DRAFT', + Reissue = 'REISSUE', +} + +/** Refund an order. */ +export type OrderRefund = { + __typename?: 'OrderRefund' + /** A refunded order. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +export type OrderRefundFulfillmentLineInput = { + /** The ID of the fulfillment line to refund. */ + fulfillmentLineId: Scalars['ID'] + /** The number of items to be refunded. */ + quantity: Scalars['Int'] +} + +export type OrderRefundLineInput = { + /** The ID of the order line to refund. */ + orderLineId: Scalars['ID'] + /** The number of items to be refunded. */ + quantity: Scalars['Int'] +} + +export type OrderRefundProductsInput = { + /** List of unfulfilled lines to refund. */ + orderLines?: Maybe> + /** List of fulfilled lines to refund. */ + fulfillmentLines?: Maybe> + /** The total amount of refund when the value is provided manually. */ + amountToRefund?: Maybe + /** If true, Saleor will refund shipping costs. If amountToRefund is providedincludeShippingCosts will be ignored. */ + includeShippingCosts?: Maybe +} + +export type OrderReturnFulfillmentLineInput = { + /** The ID of the fulfillment line to return. */ + fulfillmentLineId: Scalars['ID'] + /** The number of items to be returned. */ + quantity: Scalars['Int'] + /** Determines, if the line should be added to replace order. */ + replace?: Maybe +} + +export type OrderReturnLineInput = { + /** The ID of the order line to return. */ + orderLineId: Scalars['ID'] + /** The number of items to be returned. */ + quantity: Scalars['Int'] + /** Determines, if the line should be added to replace order. */ + replace?: Maybe +} + +export type OrderReturnProductsInput = { + /** List of unfulfilled lines to return. */ + orderLines?: Maybe> + /** List of fulfilled lines to return. */ + fulfillmentLines?: Maybe> + /** The total amount of refund when the value is provided manually. */ + amountToRefund?: Maybe + /** If true, Saleor will refund shipping costs. If amountToRefund is providedincludeShippingCosts will be ignored. */ + includeShippingCosts?: Maybe + /** If true, Saleor will call refund action for all lines. */ + refund?: Maybe +} + +/** Order related settings from site settings. */ +export type OrderSettings = { + __typename?: 'OrderSettings' + automaticallyConfirmAllNewOrders: Scalars['Boolean'] +} + +export type OrderSettingsError = { + __typename?: 'OrderSettingsError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: OrderSettingsErrorCode +} + +/** An enumeration. */ +export enum OrderSettingsErrorCode { + Invalid = 'INVALID', +} + +/** Update shop order settings. */ +export type OrderSettingsUpdate = { + __typename?: 'OrderSettingsUpdate' + /** Order settings. */ + orderSettings?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderSettingsErrors: Array + errors: Array +} + +export type OrderSettingsUpdateInput = { + /** When disabled, all new orders from checkout will be marked as unconfirmed. When enabled orders from checkout will become unfulfilled immediately. */ + automaticallyConfirmAllNewOrders: Scalars['Boolean'] +} + +export enum OrderSortField { + /** Sort orders by number. */ + Number = 'NUMBER', + /** Sort orders by creation date. */ + CreationDate = 'CREATION_DATE', + /** Sort orders by customer. */ + Customer = 'CUSTOMER', + /** Sort orders by payment. */ + Payment = 'PAYMENT', + /** Sort orders by fulfillment status. */ + FulfillmentStatus = 'FULFILLMENT_STATUS', +} + +export type OrderSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort orders by the selected field. */ + field: OrderSortField +} + +/** An enumeration. */ +export enum OrderStatus { + /** Draft */ + Draft = 'DRAFT', + /** Unconfirmed */ + Unconfirmed = 'UNCONFIRMED', + /** Unfulfilled */ + Unfulfilled = 'UNFULFILLED', + /** Partially fulfilled */ + PartiallyFulfilled = 'PARTIALLY_FULFILLED', + /** Partially returned */ + PartiallyReturned = 'PARTIALLY_RETURNED', + /** Returned */ + Returned = 'RETURNED', + /** Fulfilled */ + Fulfilled = 'FULFILLED', + /** Canceled */ + Canceled = 'CANCELED', +} + +export enum OrderStatusFilter { + ReadyToFulfill = 'READY_TO_FULFILL', + ReadyToCapture = 'READY_TO_CAPTURE', + Unfulfilled = 'UNFULFILLED', + Unconfirmed = 'UNCONFIRMED', + PartiallyFulfilled = 'PARTIALLY_FULFILLED', + Fulfilled = 'FULFILLED', + Canceled = 'CANCELED', +} + +/** Updates an order. */ +export type OrderUpdate = { + __typename?: 'OrderUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array + order?: Maybe +} + +export type OrderUpdateInput = { + /** Billing address of the customer. */ + billingAddress?: Maybe + /** Email address of the customer. */ + userEmail?: Maybe + /** Shipping address of the customer. */ + shippingAddress?: Maybe +} + +/** Updates a shipping method of the order. */ +export type OrderUpdateShipping = { + __typename?: 'OrderUpdateShipping' + /** Order with updated shipping method. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +export type OrderUpdateShippingInput = { + /** ID of the selected shipping method. */ + shippingMethod?: Maybe +} + +/** Void an order. */ +export type OrderVoid = { + __typename?: 'OrderVoid' + /** A voided order. */ + order?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + orderErrors: Array + errors: Array +} + +/** A static page that can be manually added by a shop operator through the dashboard. */ +export type Page = Node & + ObjectWithMetadata & { + __typename?: 'Page' + /** The ID of the object. */ + id: Scalars['ID'] + seoTitle?: Maybe + seoDescription?: Maybe + title: Scalars['String'] + content?: Maybe + publicationDate?: Maybe + isPublished: Scalars['Boolean'] + slug: Scalars['String'] + pageType: PageType + created: Scalars['DateTime'] + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** + * Content of the page (JSON). + * @deprecated Will be removed in Saleor 4.0. Use the `content` field instead. + */ + contentJson: Scalars['JSONString'] + /** Returns translated page fields for the given language code. */ + translation?: Maybe + /** List of attributes assigned to this product. */ + attributes: Array + } + +/** A static page that can be manually added by a shop operator through the dashboard. */ +export type PageTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Assign attributes to a given page type. */ +export type PageAttributeAssign = { + __typename?: 'PageAttributeAssign' + /** The updated page type. */ + pageType?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array +} + +/** Unassign attributes from a given page type. */ +export type PageAttributeUnassign = { + __typename?: 'PageAttributeUnassign' + /** The updated page type. */ + pageType?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array +} + +/** Deletes pages. */ +export type PageBulkDelete = { + __typename?: 'PageBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array +} + +/** Publish pages. */ +export type PageBulkPublish = { + __typename?: 'PageBulkPublish' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array +} + +export type PageCountableConnection = { + __typename?: 'PageCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type PageCountableEdge = { + __typename?: 'PageCountableEdge' + /** The item at the end of the edge. */ + node: Page + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new page. */ +export type PageCreate = { + __typename?: 'PageCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array + page?: Maybe +} + +export type PageCreateInput = { + /** Page internal name. */ + slug?: Maybe + /** Page title. */ + title?: Maybe + /** Page content in JSON format. */ + content?: Maybe + /** List of attributes. */ + attributes?: Maybe> + /** Determines if page is visible in the storefront. */ + isPublished?: Maybe + /** Publication date. ISO 8601 standard. */ + publicationDate?: Maybe + /** Search engine optimization fields. */ + seo?: Maybe + /** ID of the page type that page belongs to. */ + pageType: Scalars['ID'] +} + +/** Deletes a page. */ +export type PageDelete = { + __typename?: 'PageDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array + page?: Maybe +} + +export type PageError = { + __typename?: 'PageError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: PageErrorCode + /** List of attributes IDs which causes the error. */ + attributes?: Maybe> + /** List of attribute values IDs which causes the error. */ + values?: Maybe> +} + +/** An enumeration. */ +export enum PageErrorCode { + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', + DuplicatedInputItem = 'DUPLICATED_INPUT_ITEM', + AttributeAlreadyAssigned = 'ATTRIBUTE_ALREADY_ASSIGNED', +} + +export type PageFilterInput = { + search?: Maybe + metadata?: Maybe>> + pageTypes?: Maybe>> +} + +/** The Relay compliant `PageInfo` type, containing data necessary to paginate this connection. */ +export type PageInfo = { + __typename?: 'PageInfo' + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean'] + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean'] + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe +} + +export type PageInput = { + /** Page internal name. */ + slug?: Maybe + /** Page title. */ + title?: Maybe + /** Page content in JSON format. */ + content?: Maybe + /** List of attributes. */ + attributes?: Maybe> + /** Determines if page is visible in the storefront. */ + isPublished?: Maybe + /** Publication date. ISO 8601 standard. */ + publicationDate?: Maybe + /** Search engine optimization fields. */ + seo?: Maybe +} + +/** Reorder page attribute values. */ +export type PageReorderAttributeValues = { + __typename?: 'PageReorderAttributeValues' + /** Page from which attribute values are reordered. */ + page?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array +} + +export enum PageSortField { + /** Sort pages by title. */ + Title = 'TITLE', + /** Sort pages by slug. */ + Slug = 'SLUG', + /** Sort pages by visibility. */ + Visibility = 'VISIBILITY', + /** Sort pages by creation date. */ + CreationDate = 'CREATION_DATE', + /** Sort pages by publication date. */ + PublicationDate = 'PUBLICATION_DATE', +} + +export type PageSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort pages by the selected field. */ + field: PageSortField +} + +export type PageTranslatableContent = Node & { + __typename?: 'PageTranslatableContent' + /** The ID of the object. */ + id: Scalars['ID'] + seoTitle?: Maybe + seoDescription?: Maybe + title: Scalars['String'] + content?: Maybe + /** + * Content of the page (JSON). + * @deprecated Will be removed in Saleor 4.0. Use the `content` field instead. + */ + contentJson?: Maybe + /** Returns translated page fields for the given language code. */ + translation?: Maybe + /** ('A static page that can be manually added by a shop operator ', 'through the dashboard.') */ + page?: Maybe +} + +export type PageTranslatableContentTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Creates/Updates translations for Page. */ +export type PageTranslate = { + __typename?: 'PageTranslate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + translationErrors: Array + errors: Array + page?: Maybe +} + +export type PageTranslation = Node & { + __typename?: 'PageTranslation' + /** The ID of the object. */ + id: Scalars['ID'] + seoTitle?: Maybe + seoDescription?: Maybe + title: Scalars['String'] + content?: Maybe + /** Translation language. */ + language: LanguageDisplay + /** + * Translated description of the page (JSON). + * @deprecated Will be removed in Saleor 4.0. Use the `content` field instead. + */ + contentJson?: Maybe +} + +export type PageTranslationInput = { + seoTitle?: Maybe + seoDescription?: Maybe + title?: Maybe + content?: Maybe +} + +/** Represents a type of page. It defines what attributes are available to pages of this type. */ +export type PageType = Node & + ObjectWithMetadata & { + __typename?: 'PageType' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + slug: Scalars['String'] + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** Page attributes of that page type. */ + attributes?: Maybe>> + /** Attributes that can be assigned to the page type. */ + availableAttributes?: Maybe + /** Whether page type has pages assigned. */ + hasPages?: Maybe + } + +/** Represents a type of page. It defines what attributes are available to pages of this type. */ +export type PageTypeAvailableAttributesArgs = { + filter?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Delete page types. */ +export type PageTypeBulkDelete = { + __typename?: 'PageTypeBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array +} + +export type PageTypeCountableConnection = { + __typename?: 'PageTypeCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type PageTypeCountableEdge = { + __typename?: 'PageTypeCountableEdge' + /** The item at the end of the edge. */ + node: PageType + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Create a new page type. */ +export type PageTypeCreate = { + __typename?: 'PageTypeCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array + pageType?: Maybe +} + +export type PageTypeCreateInput = { + /** Name of the page type. */ + name?: Maybe + /** Page type slug. */ + slug?: Maybe + /** List of attribute IDs to be assigned to the page type. */ + addAttributes?: Maybe> +} + +/** Delete a page type. */ +export type PageTypeDelete = { + __typename?: 'PageTypeDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array + pageType?: Maybe +} + +export type PageTypeFilterInput = { + search?: Maybe +} + +/** Reorder the attributes of a page type. */ +export type PageTypeReorderAttributes = { + __typename?: 'PageTypeReorderAttributes' + /** Page type from which attributes are reordered. */ + pageType?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array +} + +export enum PageTypeSortField { + /** Sort page types by name. */ + Name = 'NAME', + /** Sort page types by slug. */ + Slug = 'SLUG', +} + +export type PageTypeSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort page types by the selected field. */ + field: PageTypeSortField +} + +/** Update page type. */ +export type PageTypeUpdate = { + __typename?: 'PageTypeUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array + pageType?: Maybe +} + +export type PageTypeUpdateInput = { + /** Name of the page type. */ + name?: Maybe + /** Page type slug. */ + slug?: Maybe + /** List of attribute IDs to be assigned to the page type. */ + addAttributes?: Maybe> + /** List of attribute IDs to be assigned to the page type. */ + removeAttributes?: Maybe> +} + +/** Updates an existing page. */ +export type PageUpdate = { + __typename?: 'PageUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pageErrors: Array + errors: Array + page?: Maybe +} + +/** Change the password of the logged in user. */ +export type PasswordChange = { + __typename?: 'PasswordChange' + /** A user instance with a new password. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Represents a payment of a given type. */ +export type Payment = Node & { + __typename?: 'Payment' + /** The ID of the object. */ + id: Scalars['ID'] + gateway: Scalars['String'] + isActive: Scalars['Boolean'] + created: Scalars['DateTime'] + modified: Scalars['DateTime'] + token: Scalars['String'] + checkout?: Maybe + order?: Maybe + paymentMethodType: Scalars['String'] + customerIpAddress?: Maybe + /** Internal payment status. */ + chargeStatus: PaymentChargeStatusEnum + /** List of actions that can be performed in the current state of a payment. */ + actions: Array> + /** Total amount of the payment. */ + total?: Maybe + /** Total amount captured for this payment. */ + capturedAmount?: Maybe + /** List of all transactions within this payment. */ + transactions?: Maybe>> + /** Maximum amount of money that can be captured. */ + availableCaptureAmount?: Maybe + /** Maximum amount of money that can be refunded. */ + availableRefundAmount?: Maybe + /** The details of the card used for this payment. */ + creditCard?: Maybe +} + +/** Captures the authorized payment amount. */ +export type PaymentCapture = { + __typename?: 'PaymentCapture' + /** Updated payment. */ + payment?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + paymentErrors: Array + errors: Array +} + +/** An enumeration. */ +export enum PaymentChargeStatusEnum { + NotCharged = 'NOT_CHARGED', + Pending = 'PENDING', + PartiallyCharged = 'PARTIALLY_CHARGED', + FullyCharged = 'FULLY_CHARGED', + PartiallyRefunded = 'PARTIALLY_REFUNDED', + FullyRefunded = 'FULLY_REFUNDED', + Refused = 'REFUSED', + Cancelled = 'CANCELLED', +} + +export type PaymentCountableConnection = { + __typename?: 'PaymentCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type PaymentCountableEdge = { + __typename?: 'PaymentCountableEdge' + /** The item at the end of the edge. */ + node: Payment + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +export type PaymentError = { + __typename?: 'PaymentError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: PaymentErrorCode +} + +/** An enumeration. */ +export enum PaymentErrorCode { + BillingAddressNotSet = 'BILLING_ADDRESS_NOT_SET', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', + PartialPaymentNotAllowed = 'PARTIAL_PAYMENT_NOT_ALLOWED', + ShippingAddressNotSet = 'SHIPPING_ADDRESS_NOT_SET', + InvalidShippingMethod = 'INVALID_SHIPPING_METHOD', + ShippingMethodNotSet = 'SHIPPING_METHOD_NOT_SET', + PaymentError = 'PAYMENT_ERROR', + NotSupportedGateway = 'NOT_SUPPORTED_GATEWAY', + ChannelInactive = 'CHANNEL_INACTIVE', +} + +export type PaymentFilterInput = { + checkouts?: Maybe>> +} + +/** Available payment gateway backend with configuration necessary to setup client. */ +export type PaymentGateway = { + __typename?: 'PaymentGateway' + /** Payment gateway name. */ + name: Scalars['String'] + /** Payment gateway ID. */ + id: Scalars['ID'] + /** Payment gateway client configuration. */ + config: Array + /** Payment gateway supported currencies. */ + currencies: Array> +} + +/** Initializes payment process when it is required by gateway. */ +export type PaymentInitialize = { + __typename?: 'PaymentInitialize' + initializedPayment?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + paymentErrors: Array + errors: Array +} + +/** Server-side data generated by a payment gateway. Optional step when the payment provider requires an additional action to initialize payment session. */ +export type PaymentInitialized = { + __typename?: 'PaymentInitialized' + /** ID of a payment gateway. */ + gateway: Scalars['String'] + /** Payment gateway name. */ + name: Scalars['String'] + /** Initialized data by gateway. */ + data?: Maybe +} + +export type PaymentInput = { + /** A gateway to use with that payment. */ + gateway: Scalars['String'] + /** Client-side generated payment token, representing customer's billing data in a secure manner. */ + token?: Maybe + /** Total amount of the transaction, including all taxes and discounts. If no amount is provided, the checkout total will be used. */ + amount?: Maybe + /** URL of a storefront view where user should be redirected after requiring additional actions. Payment with additional actions will not be finished if this field is not provided. */ + returnUrl?: Maybe +} + +/** Refunds the captured payment amount. */ +export type PaymentRefund = { + __typename?: 'PaymentRefund' + /** Updated payment. */ + payment?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + paymentErrors: Array + errors: Array +} + +/** Represents a payment source stored for user in payment gateway, such as credit card. */ +export type PaymentSource = { + __typename?: 'PaymentSource' + /** Payment gateway name. */ + gateway: Scalars['String'] + /** Stored credit card details if available. */ + creditCardInfo?: Maybe +} + +/** Voids the authorized payment. */ +export type PaymentVoid = { + __typename?: 'PaymentVoid' + /** Updated payment. */ + payment?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + paymentErrors: Array + errors: Array +} + +/** Represents a permission object in a friendly form. */ +export type Permission = { + __typename?: 'Permission' + /** Internal code for permission. */ + code: PermissionEnum + /** Describe action(s) allowed to do by permission. */ + name: Scalars['String'] +} + +/** An enumeration. */ +export enum PermissionEnum { + ManageUsers = 'MANAGE_USERS', + ManageStaff = 'MANAGE_STAFF', + ManageApps = 'MANAGE_APPS', + ManageChannels = 'MANAGE_CHANNELS', + ManageDiscounts = 'MANAGE_DISCOUNTS', + ManagePlugins = 'MANAGE_PLUGINS', + ManageGiftCard = 'MANAGE_GIFT_CARD', + ManageMenus = 'MANAGE_MENUS', + ManageOrders = 'MANAGE_ORDERS', + ManagePages = 'MANAGE_PAGES', + ManagePageTypesAndAttributes = 'MANAGE_PAGE_TYPES_AND_ATTRIBUTES', + ManageProducts = 'MANAGE_PRODUCTS', + ManageProductTypesAndAttributes = 'MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES', + ManageShipping = 'MANAGE_SHIPPING', + ManageSettings = 'MANAGE_SETTINGS', + ManageTranslations = 'MANAGE_TRANSLATIONS', + ManageCheckouts = 'MANAGE_CHECKOUTS', +} + +/** Create new permission group. */ +export type PermissionGroupCreate = { + __typename?: 'PermissionGroupCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + permissionGroupErrors: Array + errors: Array + group?: Maybe +} + +export type PermissionGroupCreateInput = { + /** List of permission code names to assign to this group. */ + addPermissions?: Maybe> + /** List of users to assign to this group. */ + addUsers?: Maybe> + /** Group name. */ + name: Scalars['String'] +} + +/** Delete permission group. */ +export type PermissionGroupDelete = { + __typename?: 'PermissionGroupDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + permissionGroupErrors: Array + errors: Array + group?: Maybe +} + +export type PermissionGroupError = { + __typename?: 'PermissionGroupError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: PermissionGroupErrorCode + /** List of permissions which causes the error. */ + permissions?: Maybe> + /** List of user IDs which causes the error. */ + users?: Maybe> +} + +/** An enumeration. */ +export enum PermissionGroupErrorCode { + AssignNonStaffMember = 'ASSIGN_NON_STAFF_MEMBER', + DuplicatedInputItem = 'DUPLICATED_INPUT_ITEM', + CannotRemoveFromLastGroup = 'CANNOT_REMOVE_FROM_LAST_GROUP', + LeftNotManageablePermission = 'LEFT_NOT_MANAGEABLE_PERMISSION', + OutOfScopePermission = 'OUT_OF_SCOPE_PERMISSION', + OutOfScopeUser = 'OUT_OF_SCOPE_USER', + Required = 'REQUIRED', + Unique = 'UNIQUE', +} + +export type PermissionGroupFilterInput = { + search?: Maybe +} + +export enum PermissionGroupSortField { + /** Sort permission group accounts by name. */ + Name = 'NAME', +} + +export type PermissionGroupSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort permission group by the selected field. */ + field: PermissionGroupSortField +} + +/** Update permission group. */ +export type PermissionGroupUpdate = { + __typename?: 'PermissionGroupUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + permissionGroupErrors: Array + errors: Array + group?: Maybe +} + +export type PermissionGroupUpdateInput = { + /** List of permission code names to assign to this group. */ + addPermissions?: Maybe> + /** List of users to assign to this group. */ + addUsers?: Maybe> + /** Group name. */ + name?: Maybe + /** List of permission code names to unassign from this group. */ + removePermissions?: Maybe> + /** List of users to unassign from this group. */ + removeUsers?: Maybe> +} + +/** Plugin. */ +export type Plugin = { + __typename?: 'Plugin' + /** Identifier of the plugin. */ + id: Scalars['ID'] + /** Name of the plugin. */ + name: Scalars['String'] + /** Description of the plugin. */ + description: Scalars['String'] + /** Global configuration of the plugin (not channel-specific). */ + globalConfiguration?: Maybe + /** Channel-specific plugin configuration. */ + channelConfigurations: Array +} + +/** Stores information about a configuration of plugin. */ +export type PluginConfiguration = { + __typename?: 'PluginConfiguration' + /** Determines if plugin is active or not. */ + active: Scalars['Boolean'] + /** The channel to which the plugin configuration is assigned to. */ + channel?: Maybe + /** Configuration of the plugin. */ + configuration?: Maybe>> +} + +export enum PluginConfigurationType { + PerChannel = 'PER_CHANNEL', + Global = 'GLOBAL', +} + +export type PluginCountableConnection = { + __typename?: 'PluginCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type PluginCountableEdge = { + __typename?: 'PluginCountableEdge' + /** The item at the end of the edge. */ + node: Plugin + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +export type PluginError = { + __typename?: 'PluginError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: PluginErrorCode +} + +/** An enumeration. */ +export enum PluginErrorCode { + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + PluginMisconfigured = 'PLUGIN_MISCONFIGURED', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', +} + +export type PluginFilterInput = { + statusInChannels?: Maybe + search?: Maybe + type?: Maybe +} + +export enum PluginSortField { + Name = 'NAME', + IsActive = 'IS_ACTIVE', +} + +export type PluginSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort plugins by the selected field. */ + field: PluginSortField +} + +export type PluginStatusInChannelsInput = { + active: Scalars['Boolean'] + channels: Array +} + +/** Update plugin configuration. */ +export type PluginUpdate = { + __typename?: 'PluginUpdate' + plugin?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + pluginsErrors: Array + errors: Array +} + +export type PluginUpdateInput = { + /** Indicates whether the plugin should be enabled. */ + active?: Maybe + /** Configuration of the plugin. */ + configuration?: Maybe>> +} + +/** An enumeration. */ +export enum PostalCodeRuleInclusionTypeEnum { + Include = 'INCLUDE', + Exclude = 'EXCLUDE', +} + +export type PriceRangeInput = { + /** Price greater than or equal to. */ + gte?: Maybe + /** Price less than or equal to. */ + lte?: Maybe +} + +/** Represents an individual item for sale in the storefront. */ +export type Product = Node & + ObjectWithMetadata & { + __typename?: 'Product' + /** The ID of the object. */ + id: Scalars['ID'] + seoTitle?: Maybe + seoDescription?: Maybe + name: Scalars['String'] + description?: Maybe + productType: ProductType + slug: Scalars['String'] + category?: Maybe + updatedAt?: Maybe + chargeTaxes: Scalars['Boolean'] + weight?: Maybe + defaultVariant?: Maybe + rating?: Maybe + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** + * Description of the product (JSON). + * @deprecated Will be removed in Saleor 4.0. Use the `description` field instead. + */ + descriptionJson?: Maybe + /** The main thumbnail for a product. */ + thumbnail?: Maybe + /** Lists the storefront product's pricing, the current price and discounts, only meant for displaying. */ + pricing?: Maybe + /** Whether the product is in stock and visible or not. */ + isAvailable?: Maybe + /** A type of tax. Assigned by enabled tax gateway */ + taxType?: Maybe + /** List of attributes assigned to this product. */ + attributes: Array + /** List of availability in channels for the product. */ + channelListings?: Maybe> + /** Get a single product media by ID. */ + mediaById: ProductMedia + /** + * Get a single product image by ID. + * @deprecated Will be removed in Saleor 4.0. Use the `mediaById` field instead. + */ + imageById?: Maybe + /** List of variants for the product. */ + variants?: Maybe>> + /** List of media for the product. */ + media?: Maybe> + /** + * List of images for the product. + * @deprecated Will be removed in Saleor 4.0. Use the `media` field instead. + */ + images?: Maybe>> + /** List of collections for the product. */ + collections?: Maybe>> + /** Returns translated product fields for the given language code. */ + translation?: Maybe + /** Date when product is available for purchase. */ + availableForPurchase?: Maybe + /** Whether the product is available for purchase. */ + isAvailableForPurchase?: Maybe + } + +/** Represents an individual item for sale in the storefront. */ +export type ProductThumbnailArgs = { + size?: Maybe +} + +/** Represents an individual item for sale in the storefront. */ +export type ProductPricingArgs = { + address?: Maybe +} + +/** Represents an individual item for sale in the storefront. */ +export type ProductIsAvailableArgs = { + address?: Maybe +} + +/** Represents an individual item for sale in the storefront. */ +export type ProductMediaByIdArgs = { + id?: Maybe +} + +/** Represents an individual item for sale in the storefront. */ +export type ProductImageByIdArgs = { + id?: Maybe +} + +/** Represents an individual item for sale in the storefront. */ +export type ProductTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Assign attributes to a given product type. */ +export type ProductAttributeAssign = { + __typename?: 'ProductAttributeAssign' + /** The updated product type. */ + productType?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +export type ProductAttributeAssignInput = { + /** The ID of the attribute to assign. */ + id: Scalars['ID'] + /** The attribute type to be assigned as. */ + type: ProductAttributeType +} + +export enum ProductAttributeType { + Product = 'PRODUCT', + Variant = 'VARIANT', +} + +/** Un-assign attributes from a given product type. */ +export type ProductAttributeUnassign = { + __typename?: 'ProductAttributeUnassign' + /** The updated product type. */ + productType?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +/** Deletes products. */ +export type ProductBulkDelete = { + __typename?: 'ProductBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +/** Represents product channel listing. */ +export type ProductChannelListing = Node & { + __typename?: 'ProductChannelListing' + /** The ID of the object. */ + id: Scalars['ID'] + publicationDate?: Maybe + isPublished: Scalars['Boolean'] + channel: Channel + visibleInListings: Scalars['Boolean'] + availableForPurchase?: Maybe + /** The price of the cheapest variant (including discounts). */ + discountedPrice?: Maybe + /** Purchase cost of product. */ + purchaseCost?: Maybe + /** Range of margin percentage value. */ + margin?: Maybe + /** Whether the product is available for purchase. */ + isAvailableForPurchase?: Maybe + /** Lists the storefront product's pricing, the current price and discounts, only meant for displaying. */ + pricing?: Maybe +} + +/** Represents product channel listing. */ +export type ProductChannelListingPricingArgs = { + address?: Maybe +} + +export type ProductChannelListingAddInput = { + /** ID of a channel. */ + channelId: Scalars['ID'] + /** Determines if object is visible to customers. */ + isPublished?: Maybe + /** Publication date. ISO 8601 standard. */ + publicationDate?: Maybe + /** Determines if product is visible in product listings (doesn't apply to product collections). */ + visibleInListings?: Maybe + /** Determine if product should be available for purchase. */ + isAvailableForPurchase?: Maybe + /** A start date from which a product will be available for purchase. When not set and isAvailable is set to True, the current day is assumed. */ + availableForPurchaseDate?: Maybe + /** List of variants to which the channel should be assigned. */ + addVariants?: Maybe> + /** List of variants from which the channel should be unassigned. */ + removeVariants?: Maybe> +} + +export type ProductChannelListingError = { + __typename?: 'ProductChannelListingError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: ProductErrorCode + /** List of attributes IDs which causes the error. */ + attributes?: Maybe> + /** List of attribute values IDs which causes the error. */ + values?: Maybe> + /** List of channels IDs which causes the error. */ + channels?: Maybe> + /** List of variants IDs which causes the error. */ + variants?: Maybe> +} + +/** Manage product's availability in channels. */ +export type ProductChannelListingUpdate = { + __typename?: 'ProductChannelListingUpdate' + /** An updated product instance. */ + product?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productChannelListingErrors: Array + errors: Array +} + +export type ProductChannelListingUpdateInput = { + /** List of channels to which the product should be assigned or updated. */ + updateChannels?: Maybe> + /** List of channels from which the product should be unassigned. */ + removeChannels?: Maybe> +} + +export type ProductCountableConnection = { + __typename?: 'ProductCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type ProductCountableEdge = { + __typename?: 'ProductCountableEdge' + /** The item at the end of the edge. */ + node: Product + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new product. */ +export type ProductCreate = { + __typename?: 'ProductCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + product?: Maybe +} + +export type ProductCreateInput = { + /** List of attributes. */ + attributes?: Maybe> + /** ID of the product's category. */ + category?: Maybe + /** Determine if taxes are being charged for the product. */ + chargeTaxes?: Maybe + /** List of IDs of collections that the product belongs to. */ + collections?: Maybe> + /** Product description (JSON). */ + description?: Maybe + /** Product name. */ + name?: Maybe + /** Product slug. */ + slug?: Maybe + /** Tax rate for enabled tax gateway. */ + taxCode?: Maybe + /** Search engine optimization fields. */ + seo?: Maybe + /** Weight of the Product. */ + weight?: Maybe + /** Defines the product rating value. */ + rating?: Maybe + /** ID of the type that product belongs to. */ + productType: Scalars['ID'] +} + +/** Deletes a product. */ +export type ProductDelete = { + __typename?: 'ProductDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + product?: Maybe +} + +export type ProductError = { + __typename?: 'ProductError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: ProductErrorCode + /** List of attributes IDs which causes the error. */ + attributes?: Maybe> + /** List of attribute values IDs which causes the error. */ + values?: Maybe> +} + +/** An enumeration. */ +export enum ProductErrorCode { + AlreadyExists = 'ALREADY_EXISTS', + AttributeAlreadyAssigned = 'ATTRIBUTE_ALREADY_ASSIGNED', + AttributeCannotBeAssigned = 'ATTRIBUTE_CANNOT_BE_ASSIGNED', + AttributeVariantsDisabled = 'ATTRIBUTE_VARIANTS_DISABLED', + DuplicatedInputItem = 'DUPLICATED_INPUT_ITEM', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + ProductWithoutCategory = 'PRODUCT_WITHOUT_CATEGORY', + NotProductsImage = 'NOT_PRODUCTS_IMAGE', + NotProductsVariant = 'NOT_PRODUCTS_VARIANT', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', + VariantNoDigitalContent = 'VARIANT_NO_DIGITAL_CONTENT', + CannotManageProductWithoutVariant = 'CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT', + ProductNotAssignedToChannel = 'PRODUCT_NOT_ASSIGNED_TO_CHANNEL', + UnsupportedMediaProvider = 'UNSUPPORTED_MEDIA_PROVIDER', +} + +export enum ProductFieldEnum { + Name = 'NAME', + Description = 'DESCRIPTION', + ProductType = 'PRODUCT_TYPE', + Category = 'CATEGORY', + ProductWeight = 'PRODUCT_WEIGHT', + Collections = 'COLLECTIONS', + ChargeTaxes = 'CHARGE_TAXES', + ProductMedia = 'PRODUCT_MEDIA', + VariantSku = 'VARIANT_SKU', + VariantWeight = 'VARIANT_WEIGHT', + VariantMedia = 'VARIANT_MEDIA', +} + +export type ProductFilterInput = { + isPublished?: Maybe + collections?: Maybe>> + categories?: Maybe>> + hasCategory?: Maybe + attributes?: Maybe>> + stockAvailability?: Maybe + stocks?: Maybe + search?: Maybe + metadata?: Maybe>> + price?: Maybe + minimalPrice?: Maybe + productTypes?: Maybe>> + ids?: Maybe>> + /** Specifies the channel by which the data should be sorted. */ + channel?: Maybe +} + +/** Represents a product image. */ +export type ProductImage = { + __typename?: 'ProductImage' + /** The ID of the image. */ + id: Scalars['ID'] + /** The alt text of the image. */ + alt?: Maybe + /** The new relative sorting position of the item (from -inf to +inf). 1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. */ + sortOrder?: Maybe + /** The URL of the image. */ + url: Scalars['String'] +} + +/** Represents a product image. */ +export type ProductImageUrlArgs = { + size?: Maybe +} + +export type ProductInput = { + /** List of attributes. */ + attributes?: Maybe> + /** ID of the product's category. */ + category?: Maybe + /** Determine if taxes are being charged for the product. */ + chargeTaxes?: Maybe + /** List of IDs of collections that the product belongs to. */ + collections?: Maybe> + /** Product description (JSON). */ + description?: Maybe + /** Product name. */ + name?: Maybe + /** Product slug. */ + slug?: Maybe + /** Tax rate for enabled tax gateway. */ + taxCode?: Maybe + /** Search engine optimization fields. */ + seo?: Maybe + /** Weight of the Product. */ + weight?: Maybe + /** Defines the product rating value. */ + rating?: Maybe +} + +/** Represents a product media. */ +export type ProductMedia = Node & { + __typename?: 'ProductMedia' + /** The ID of the object. */ + id: Scalars['ID'] + sortOrder?: Maybe + alt: Scalars['String'] + type: ProductMediaType + oembedData: Scalars['JSONString'] + /** The URL of the media. */ + url: Scalars['String'] +} + +/** Represents a product media. */ +export type ProductMediaUrlArgs = { + size?: Maybe +} + +/** Deletes product media. */ +export type ProductMediaBulkDelete = { + __typename?: 'ProductMediaBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +/** Create a media object (image or video URL) associated with product. For image, this mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec */ +export type ProductMediaCreate = { + __typename?: 'ProductMediaCreate' + product?: Maybe + media?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +export type ProductMediaCreateInput = { + /** Alt text for a product media. */ + alt?: Maybe + /** Represents an image file in a multipart request. */ + image?: Maybe + /** ID of an product. */ + product: Scalars['ID'] + /** Represents an URL to an external media. */ + mediaUrl?: Maybe +} + +/** Deletes a product media. */ +export type ProductMediaDelete = { + __typename?: 'ProductMediaDelete' + product?: Maybe + media?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +/** Changes ordering of the product media. */ +export type ProductMediaReorder = { + __typename?: 'ProductMediaReorder' + product?: Maybe + media?: Maybe> + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +/** An enumeration. */ +export enum ProductMediaType { + /** An uploaded image or an URL to an image */ + Image = 'IMAGE', + /** A URL to an external video */ + Video = 'VIDEO', +} + +/** Updates a product media. */ +export type ProductMediaUpdate = { + __typename?: 'ProductMediaUpdate' + product?: Maybe + media?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +export type ProductMediaUpdateInput = { + /** Alt text for a product media. */ + alt?: Maybe +} + +export type ProductOrder = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Specifies the channel in which to sort the data. */ + channel?: Maybe + /** + * Sort product by the selected attribute's values. + * Note: this doesn't take translations into account yet. + */ + attributeId?: Maybe + /** Sort products by the selected field. */ + field?: Maybe +} + +export enum ProductOrderField { + /** Sort products by name. */ + Name = 'NAME', + /** Sort products by rank. Note: This option is available only with the `search` filter. */ + Rank = 'RANK', + /** Sort products by price. */ + Price = 'PRICE', + /** Sort products by a minimal price of a product's variant. */ + MinimalPrice = 'MINIMAL_PRICE', + /** Sort products by update date. */ + Date = 'DATE', + /** Sort products by type. */ + Type = 'TYPE', + /** Sort products by publication status. */ + Published = 'PUBLISHED', + /** Sort products by publication date. */ + PublicationDate = 'PUBLICATION_DATE', + /** Sort products by collection. Note: This option is available only for the `Collection.products` query. */ + Collection = 'COLLECTION', + /** Sort products by rating. */ + Rating = 'RATING', +} + +/** Represents availability of a product in the storefront. */ +export type ProductPricingInfo = { + __typename?: 'ProductPricingInfo' + /** Whether it is in sale or not. */ + onSale?: Maybe + /** The discount amount if in sale (null otherwise). */ + discount?: Maybe + /** The discount amount in the local currency. */ + discountLocalCurrency?: Maybe + /** The discounted price range of the product variants. */ + priceRange?: Maybe + /** The undiscounted price range of the product variants. */ + priceRangeUndiscounted?: Maybe + /** The discounted price range of the product variants in the local currency. */ + priceRangeLocalCurrency?: Maybe +} + +/** Reorder product attribute values. */ +export type ProductReorderAttributeValues = { + __typename?: 'ProductReorderAttributeValues' + /** Product from which attribute values are reordered. */ + product?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +export type ProductStockFilterInput = { + warehouseIds?: Maybe> + quantity?: Maybe +} + +export type ProductTranslatableContent = Node & { + __typename?: 'ProductTranslatableContent' + /** The ID of the object. */ + id: Scalars['ID'] + seoTitle?: Maybe + seoDescription?: Maybe + name: Scalars['String'] + description?: Maybe + /** + * Description of the product (JSON). + * @deprecated Will be removed in Saleor 4.0. Use the `description` field instead. + */ + descriptionJson?: Maybe + /** Returns translated product fields for the given language code. */ + translation?: Maybe + /** Represents an individual item for sale in the storefront. */ + product?: Maybe +} + +export type ProductTranslatableContentTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Creates/Updates translations for Product. */ +export type ProductTranslate = { + __typename?: 'ProductTranslate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + translationErrors: Array + errors: Array + product?: Maybe +} + +export type ProductTranslation = Node & { + __typename?: 'ProductTranslation' + /** The ID of the object. */ + id: Scalars['ID'] + seoTitle?: Maybe + seoDescription?: Maybe + name: Scalars['String'] + description?: Maybe + /** Translation language. */ + language: LanguageDisplay + /** + * Translated description of the product (JSON). + * @deprecated Will be removed in Saleor 4.0. Use the `description` field instead. + */ + descriptionJson?: Maybe +} + +/** Represents a type of product. It defines what attributes are available to products of this type. */ +export type ProductType = Node & + ObjectWithMetadata & { + __typename?: 'ProductType' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + slug: Scalars['String'] + hasVariants: Scalars['Boolean'] + isShippingRequired: Scalars['Boolean'] + isDigital: Scalars['Boolean'] + weight?: Maybe + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** + * List of products of this type. + * @deprecated Will be removed in Saleor 4.0. Use the top-level `products` query with the `productTypes` filter. + */ + products?: Maybe + /** A type of tax. Assigned by enabled tax gateway */ + taxType?: Maybe + /** Variant attributes of that product type. */ + variantAttributes?: Maybe>> + /** Product attributes of that product type. */ + productAttributes?: Maybe>> + availableAttributes?: Maybe + } + +/** Represents a type of product. It defines what attributes are available to products of this type. */ +export type ProductTypeProductsArgs = { + channel?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Represents a type of product. It defines what attributes are available to products of this type. */ +export type ProductTypeVariantAttributesArgs = { + variantSelection?: Maybe +} + +/** Represents a type of product. It defines what attributes are available to products of this type. */ +export type ProductTypeAvailableAttributesArgs = { + filter?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Deletes product types. */ +export type ProductTypeBulkDelete = { + __typename?: 'ProductTypeBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +export enum ProductTypeConfigurable { + Configurable = 'CONFIGURABLE', + Simple = 'SIMPLE', +} + +export type ProductTypeCountableConnection = { + __typename?: 'ProductTypeCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type ProductTypeCountableEdge = { + __typename?: 'ProductTypeCountableEdge' + /** The item at the end of the edge. */ + node: ProductType + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new product type. */ +export type ProductTypeCreate = { + __typename?: 'ProductTypeCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + productType?: Maybe +} + +/** Deletes a product type. */ +export type ProductTypeDelete = { + __typename?: 'ProductTypeDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + productType?: Maybe +} + +export enum ProductTypeEnum { + Digital = 'DIGITAL', + Shippable = 'SHIPPABLE', +} + +export type ProductTypeFilterInput = { + search?: Maybe + configurable?: Maybe + productType?: Maybe + metadata?: Maybe>> + ids?: Maybe>> +} + +export type ProductTypeInput = { + /** Name of the product type. */ + name?: Maybe + /** Product type slug. */ + slug?: Maybe + /** Determines if product of this type has multiple variants. This option mainly simplifies product management in the dashboard. There is always at least one variant created under the hood. */ + hasVariants?: Maybe + /** List of attributes shared among all product variants. */ + productAttributes?: Maybe>> + /** List of attributes used to distinguish between different variants of a product. */ + variantAttributes?: Maybe>> + /** Determines if shipping is required for products of this variant. */ + isShippingRequired?: Maybe + /** Determines if products are digital. */ + isDigital?: Maybe + /** Weight of the ProductType items. */ + weight?: Maybe + /** Tax rate for enabled tax gateway. */ + taxCode?: Maybe +} + +/** Reorder the attributes of a product type. */ +export type ProductTypeReorderAttributes = { + __typename?: 'ProductTypeReorderAttributes' + /** Product type from which attributes are reordered. */ + productType?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +export enum ProductTypeSortField { + /** Sort products by name. */ + Name = 'NAME', + /** Sort products by type. */ + Digital = 'DIGITAL', + /** Sort products by shipping. */ + ShippingRequired = 'SHIPPING_REQUIRED', +} + +export type ProductTypeSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort product types by the selected field. */ + field: ProductTypeSortField +} + +/** Updates an existing product type. */ +export type ProductTypeUpdate = { + __typename?: 'ProductTypeUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + productType?: Maybe +} + +/** Updates an existing product. */ +export type ProductUpdate = { + __typename?: 'ProductUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + product?: Maybe +} + +/** Represents a version of a product such as different size or color. */ +export type ProductVariant = Node & + ObjectWithMetadata & { + __typename?: 'ProductVariant' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + sku: Scalars['String'] + product: Product + trackInventory: Scalars['Boolean'] + weight?: Maybe + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** List of price information in channels for the product. */ + channelListings?: Maybe> + /** Lists the storefront variant's pricing, the current price and discounts, only meant for displaying. */ + pricing?: Maybe + /** List of attributes assigned to this variant. */ + attributes: Array + /** Cost price of the variant. */ + costPrice?: Maybe + /** Gross margin percentage value. */ + margin?: Maybe + /** Total quantity ordered. */ + quantityOrdered?: Maybe + /** Total revenue generated by a variant in given period of time. Note: this field should be queried using `reportProductSales` query as it uses optimizations suitable for such calculations. */ + revenue?: Maybe + /** + * List of images for the product variant. + * @deprecated Will be removed in Saleor 4.0. Use the `media` instead. + */ + images?: Maybe>> + /** List of media for the product variant. */ + media?: Maybe> + /** Returns translated product variant fields for the given language code. */ + translation?: Maybe + /** Digital content for the product variant. */ + digitalContent?: Maybe + /** Stocks for the product variant. */ + stocks?: Maybe>> + /** Quantity of a product available for sale in one checkout. */ + quantityAvailable: Scalars['Int'] + } + +/** Represents a version of a product such as different size or color. */ +export type ProductVariantPricingArgs = { + address?: Maybe +} + +/** Represents a version of a product such as different size or color. */ +export type ProductVariantAttributesArgs = { + variantSelection?: Maybe +} + +/** Represents a version of a product such as different size or color. */ +export type ProductVariantRevenueArgs = { + period?: Maybe +} + +/** Represents a version of a product such as different size or color. */ +export type ProductVariantTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Represents a version of a product such as different size or color. */ +export type ProductVariantStocksArgs = { + address?: Maybe + countryCode?: Maybe +} + +/** Represents a version of a product such as different size or color. */ +export type ProductVariantQuantityAvailableArgs = { + address?: Maybe + countryCode?: Maybe +} + +/** Creates product variants for a given product. */ +export type ProductVariantBulkCreate = { + __typename?: 'ProductVariantBulkCreate' + /** Returns how many objects were created. */ + count: Scalars['Int'] + /** List of the created variants. */ + productVariants: Array + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + bulkProductErrors: Array + errors: Array +} + +export type ProductVariantBulkCreateInput = { + /** List of attributes specific to this variant. */ + attributes: Array> + /** Stock keeping unit. */ + sku: Scalars['String'] + /** Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. */ + trackInventory?: Maybe + /** Weight of the Product Variant. */ + weight?: Maybe + /** Stocks of a product available for sale. */ + stocks?: Maybe> + /** List of prices assigned to channels. */ + channelListings?: Maybe> +} + +/** Deletes product variants. */ +export type ProductVariantBulkDelete = { + __typename?: 'ProductVariantBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +/** Represents product varaint channel listing. */ +export type ProductVariantChannelListing = Node & { + __typename?: 'ProductVariantChannelListing' + /** The ID of the object. */ + id: Scalars['ID'] + channel: Channel + price?: Maybe + /** Cost price of the variant. */ + costPrice?: Maybe + /** Gross margin percentage value. */ + margin?: Maybe +} + +export type ProductVariantChannelListingAddInput = { + /** ID of a channel. */ + channelId: Scalars['ID'] + /** Price of the particular variant in channel. */ + price: Scalars['PositiveDecimal'] + /** Cost price of the variant in channel. */ + costPrice?: Maybe +} + +/** Manage product variant prices in channels. */ +export type ProductVariantChannelListingUpdate = { + __typename?: 'ProductVariantChannelListingUpdate' + /** An updated product variant instance. */ + variant?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productChannelListingErrors: Array + errors: Array +} + +export type ProductVariantCountableConnection = { + __typename?: 'ProductVariantCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type ProductVariantCountableEdge = { + __typename?: 'ProductVariantCountableEdge' + /** The item at the end of the edge. */ + node: ProductVariant + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new variant for a product. */ +export type ProductVariantCreate = { + __typename?: 'ProductVariantCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + productVariant?: Maybe +} + +export type ProductVariantCreateInput = { + /** List of attributes specific to this variant. */ + attributes: Array> + /** Stock keeping unit. */ + sku?: Maybe + /** Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. */ + trackInventory?: Maybe + /** Weight of the Product Variant. */ + weight?: Maybe + /** Product ID of which type is the variant. */ + product: Scalars['ID'] + /** Stocks of a product available for sale. */ + stocks?: Maybe> +} + +/** Deletes a product variant. */ +export type ProductVariantDelete = { + __typename?: 'ProductVariantDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + productVariant?: Maybe +} + +export type ProductVariantFilterInput = { + search?: Maybe + sku?: Maybe>> + metadata?: Maybe>> +} + +export type ProductVariantInput = { + /** List of attributes specific to this variant. */ + attributes?: Maybe>> + /** Stock keeping unit. */ + sku?: Maybe + /** Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. */ + trackInventory?: Maybe + /** Weight of the Product Variant. */ + weight?: Maybe +} + +/** Reorder the variants of a product. Mutation updates updated_at on product and triggers PRODUCT_UPDATED webhook. */ +export type ProductVariantReorder = { + __typename?: 'ProductVariantReorder' + product?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +/** Reorder product variant attribute values. */ +export type ProductVariantReorderAttributeValues = { + __typename?: 'ProductVariantReorderAttributeValues' + /** Product variant from which attribute values are reordered. */ + productVariant?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +/** Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook. */ +export type ProductVariantSetDefault = { + __typename?: 'ProductVariantSetDefault' + product?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +/** Creates stocks for product variant. */ +export type ProductVariantStocksCreate = { + __typename?: 'ProductVariantStocksCreate' + /** Updated product variant. */ + productVariant?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + bulkStockErrors: Array + errors: Array +} + +/** Delete stocks from product variant. */ +export type ProductVariantStocksDelete = { + __typename?: 'ProductVariantStocksDelete' + /** Updated product variant. */ + productVariant?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + stockErrors: Array + errors: Array +} + +/** Update stocks for product variant. */ +export type ProductVariantStocksUpdate = { + __typename?: 'ProductVariantStocksUpdate' + /** Updated product variant. */ + productVariant?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + bulkStockErrors: Array + errors: Array +} + +export type ProductVariantTranslatableContent = Node & { + __typename?: 'ProductVariantTranslatableContent' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + /** Returns translated product variant fields for the given language code. */ + translation?: Maybe + /** Represents a version of a product such as different size or color. */ + productVariant?: Maybe +} + +export type ProductVariantTranslatableContentTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Creates/Updates translations for Product Variant. */ +export type ProductVariantTranslate = { + __typename?: 'ProductVariantTranslate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + translationErrors: Array + errors: Array + productVariant?: Maybe +} + +export type ProductVariantTranslation = Node & { + __typename?: 'ProductVariantTranslation' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + /** Translation language. */ + language: LanguageDisplay +} + +/** Updates an existing variant for product. */ +export type ProductVariantUpdate = { + __typename?: 'ProductVariantUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array + productVariant?: Maybe +} + +export type PublishableChannelListingInput = { + /** ID of a channel. */ + channelId: Scalars['ID'] + /** Determines if object is visible to customers. */ + isPublished?: Maybe + /** Publication date. ISO 8601 standard. */ + publicationDate?: Maybe +} + +export type Query = { + __typename?: 'Query' + /** Look up a webhook by ID. */ + webhook?: Maybe + /** List of all available webhook events. */ + webhookEvents?: Maybe>> + /** Retrieve a sample payload for a given webhook event based on real data. It can be useful for some integrations where sample payload is required. */ + webhookSamplePayload?: Maybe + /** Look up a warehouse by ID. */ + warehouse?: Maybe + /** List of warehouses. */ + warehouses?: Maybe + /** Returns a list of all translatable items of a given kind. */ + translations?: Maybe + translation?: Maybe + /** Look up a stock by ID */ + stock?: Maybe + /** List of stocks. */ + stocks?: Maybe + /** Return information about the shop. */ + shop: Shop + /** Order related settings from site settings. */ + orderSettings?: Maybe + /** Look up a shipping zone by ID. */ + shippingZone?: Maybe + /** List of the shop's shipping zones. */ + shippingZones?: Maybe + /** Look up digital content by ID. */ + digitalContent?: Maybe + /** List of digital content. */ + digitalContents?: Maybe + /** List of the shop's categories. */ + categories?: Maybe + /** Look up a category by ID or slug. */ + category?: Maybe + /** Look up a collection by ID. */ + collection?: Maybe + /** List of the shop's collections. */ + collections?: Maybe + /** Look up a product by ID. */ + product?: Maybe + /** List of the shop's products. */ + products?: Maybe + /** Look up a product type by ID. */ + productType?: Maybe + /** List of the shop's product types. */ + productTypes?: Maybe + /** Look up a product variant by ID or SKU. */ + productVariant?: Maybe + /** List of product variants. */ + productVariants?: Maybe + /** List of top selling products. */ + reportProductSales?: Maybe + /** Look up a payment by ID. */ + payment?: Maybe + /** List of payments. */ + payments?: Maybe + /** Look up a page by ID or slug. */ + page?: Maybe + /** List of the shop's pages. */ + pages?: Maybe + /** Look up a page type by ID. */ + pageType?: Maybe + /** List of the page types. */ + pageTypes?: Maybe + /** List of activity events to display on homepage (at the moment it only contains order-events). */ + homepageEvents?: Maybe + /** Look up an order by ID. */ + order?: Maybe + /** List of orders. */ + orders?: Maybe + /** List of draft orders. */ + draftOrders?: Maybe + /** Return the total sales amount from a specific period. */ + ordersTotal?: Maybe + /** Look up an order by token. */ + orderByToken?: Maybe + /** Look up a navigation menu by ID or name. */ + menu?: Maybe + /** List of the storefront's menus. */ + menus?: Maybe + /** Look up a menu item by ID. */ + menuItem?: Maybe + /** List of the storefronts's menu items. */ + menuItems?: Maybe + /** Look up a gift card by ID. */ + giftCard?: Maybe + /** List of gift cards. */ + giftCards?: Maybe + /** Look up a plugin by ID. */ + plugin?: Maybe + /** List of plugins. */ + plugins?: Maybe + /** Look up a sale by ID. */ + sale?: Maybe + /** List of the shop's sales. */ + sales?: Maybe + /** Look up a voucher by ID. */ + voucher?: Maybe + /** List of the shop's vouchers. */ + vouchers?: Maybe + /** Look up a export file by ID. */ + exportFile?: Maybe + /** List of export files. */ + exportFiles?: Maybe + /** List of all tax rates available from tax gateway. */ + taxTypes?: Maybe>> + /** Look up a checkout by token and slug of channel. */ + checkout?: Maybe + /** List of checkouts. */ + checkouts?: Maybe + /** Look up a checkout line by ID. */ + checkoutLine?: Maybe + /** List of checkout lines. */ + checkoutLines?: Maybe + /** Look up a channel by ID. */ + channel?: Maybe + /** List of all channels. */ + channels?: Maybe> + /** List of the shop's attributes. */ + attributes?: Maybe + /** Look up an attribute by ID. */ + attribute?: Maybe + /** List of all apps installations */ + appsInstallations: Array + /** List of the apps. */ + apps?: Maybe + /** Look up an app by ID. If ID is not provided, return the currently authenticated app. */ + app?: Maybe + /** Returns address validation rules. */ + addressValidationRules?: Maybe + /** Look up an address by ID. */ + address?: Maybe
+ /** List of the shop's customers. */ + customers?: Maybe + /** List of permission groups. */ + permissionGroups?: Maybe + /** Look up permission group by ID. */ + permissionGroup?: Maybe + /** Return the currently authenticated user. */ + me?: Maybe + /** List of the shop's staff users. */ + staffUsers?: Maybe + /** Look up a user by ID or email address. */ + user?: Maybe + _entities?: Maybe>> + _service?: Maybe<_Service> +} + +export type QueryWebhookArgs = { + id: Scalars['ID'] +} + +export type QueryWebhookSamplePayloadArgs = { + eventType: WebhookSampleEventTypeEnum +} + +export type QueryWarehouseArgs = { + id: Scalars['ID'] +} + +export type QueryWarehousesArgs = { + filter?: Maybe + sortBy?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryTranslationsArgs = { + kind: TranslatableKinds + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryTranslationArgs = { + id: Scalars['ID'] + kind: TranslatableKinds +} + +export type QueryStockArgs = { + id: Scalars['ID'] +} + +export type QueryStocksArgs = { + filter?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryShippingZoneArgs = { + id: Scalars['ID'] + channel?: Maybe +} + +export type QueryShippingZonesArgs = { + filter?: Maybe + channel?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryDigitalContentArgs = { + id: Scalars['ID'] +} + +export type QueryDigitalContentsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryCategoriesArgs = { + filter?: Maybe + sortBy?: Maybe + level?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryCategoryArgs = { + id?: Maybe + slug?: Maybe +} + +export type QueryCollectionArgs = { + id?: Maybe + slug?: Maybe + channel?: Maybe +} + +export type QueryCollectionsArgs = { + filter?: Maybe + sortBy?: Maybe + channel?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryProductArgs = { + id?: Maybe + slug?: Maybe + channel?: Maybe +} + +export type QueryProductsArgs = { + filter?: Maybe + sortBy?: Maybe + channel?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryProductTypeArgs = { + id: Scalars['ID'] +} + +export type QueryProductTypesArgs = { + filter?: Maybe + sortBy?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryProductVariantArgs = { + id?: Maybe + sku?: Maybe + channel?: Maybe +} + +export type QueryProductVariantsArgs = { + ids?: Maybe>> + channel?: Maybe + filter?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryReportProductSalesArgs = { + period: ReportingPeriod + channel: Scalars['String'] + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryPaymentArgs = { + id: Scalars['ID'] +} + +export type QueryPaymentsArgs = { + filter?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryPageArgs = { + id?: Maybe + slug?: Maybe +} + +export type QueryPagesArgs = { + sortBy?: Maybe + filter?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryPageTypeArgs = { + id: Scalars['ID'] +} + +export type QueryPageTypesArgs = { + sortBy?: Maybe + filter?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryHomepageEventsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryOrderArgs = { + id: Scalars['ID'] +} + +export type QueryOrdersArgs = { + sortBy?: Maybe + filter?: Maybe + channel?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryDraftOrdersArgs = { + sortBy?: Maybe + filter?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryOrdersTotalArgs = { + period?: Maybe + channel?: Maybe +} + +export type QueryOrderByTokenArgs = { + token: Scalars['UUID'] +} + +export type QueryMenuArgs = { + channel?: Maybe + id?: Maybe + name?: Maybe + slug?: Maybe +} + +export type QueryMenusArgs = { + channel?: Maybe + sortBy?: Maybe + filter?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryMenuItemArgs = { + id: Scalars['ID'] + channel?: Maybe +} + +export type QueryMenuItemsArgs = { + channel?: Maybe + sortBy?: Maybe + filter?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryGiftCardArgs = { + id: Scalars['ID'] +} + +export type QueryGiftCardsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryPluginArgs = { + id: Scalars['ID'] +} + +export type QueryPluginsArgs = { + filter?: Maybe + sortBy?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QuerySaleArgs = { + id: Scalars['ID'] + channel?: Maybe +} + +export type QuerySalesArgs = { + filter?: Maybe + sortBy?: Maybe + query?: Maybe + channel?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryVoucherArgs = { + id: Scalars['ID'] + channel?: Maybe +} + +export type QueryVouchersArgs = { + filter?: Maybe + sortBy?: Maybe + query?: Maybe + channel?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryExportFileArgs = { + id: Scalars['ID'] +} + +export type QueryExportFilesArgs = { + filter?: Maybe + sortBy?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryCheckoutArgs = { + token?: Maybe +} + +export type QueryCheckoutsArgs = { + channel?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryCheckoutLineArgs = { + id?: Maybe +} + +export type QueryCheckoutLinesArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryChannelArgs = { + id?: Maybe +} + +export type QueryAttributesArgs = { + filter?: Maybe + sortBy?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryAttributeArgs = { + id?: Maybe + slug?: Maybe +} + +export type QueryAppsArgs = { + filter?: Maybe + sortBy?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryAppArgs = { + id?: Maybe +} + +export type QueryAddressValidationRulesArgs = { + countryCode: CountryCode + countryArea?: Maybe + city?: Maybe + cityArea?: Maybe +} + +export type QueryAddressArgs = { + id: Scalars['ID'] +} + +export type QueryCustomersArgs = { + filter?: Maybe + sortBy?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryPermissionGroupsArgs = { + filter?: Maybe + sortBy?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryPermissionGroupArgs = { + id: Scalars['ID'] +} + +export type QueryStaffUsersArgs = { + filter?: Maybe + sortBy?: Maybe + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type QueryUserArgs = { + id?: Maybe + email?: Maybe +} + +export type Query_EntitiesArgs = { + representations?: Maybe>> +} + +/** Represents a reduced VAT rate for a particular type of goods. */ +export type ReducedRate = { + __typename?: 'ReducedRate' + /** Reduced VAT rate in percent. */ + rate: Scalars['Float'] + /** A type of goods. */ + rateType: TaxRateType +} + +/** Refresh JWT token. Mutation tries to take refreshToken from the input.If it fails it will try to take refreshToken from the http-only cookie -refreshToken. csrfToken is required when refreshToken is provided as a cookie. */ +export type RefreshToken = { + __typename?: 'RefreshToken' + /** JWT token, required to authenticate. */ + token?: Maybe + /** A user instance. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +export type ReorderInput = { + /** The ID of the item to move. */ + id: Scalars['ID'] + /** The new relative sorting position of the item (from -inf to +inf). 1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. */ + sortOrder?: Maybe +} + +export enum ReportingPeriod { + Today = 'TODAY', + ThisMonth = 'THIS_MONTH', +} + +/** Request email change of the logged in user. */ +export type RequestEmailChange = { + __typename?: 'RequestEmailChange' + /** A user instance. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Sends an email with the account password modification link. */ +export type RequestPasswordReset = { + __typename?: 'RequestPasswordReset' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Sales allow creating discounts for categories, collections or products and are visible to all the customers. */ +export type Sale = Node & { + __typename?: 'Sale' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + type: SaleType + startDate: Scalars['DateTime'] + endDate?: Maybe + /** List of categories this sale applies to. */ + categories?: Maybe + /** List of collections this sale applies to. */ + collections?: Maybe + /** List of products this sale applies to. */ + products?: Maybe + /** Returns translated sale fields for the given language code. */ + translation?: Maybe + /** List of channels available for the sale. */ + channelListings?: Maybe> + /** Sale value. */ + discountValue?: Maybe + /** Currency code for sale. */ + currency?: Maybe +} + +/** Sales allow creating discounts for categories, collections or products and are visible to all the customers. */ +export type SaleCategoriesArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Sales allow creating discounts for categories, collections or products and are visible to all the customers. */ +export type SaleCollectionsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Sales allow creating discounts for categories, collections or products and are visible to all the customers. */ +export type SaleProductsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Sales allow creating discounts for categories, collections or products and are visible to all the customers. */ +export type SaleTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Adds products, categories, collections to a voucher. */ +export type SaleAddCatalogues = { + __typename?: 'SaleAddCatalogues' + /** Sale of which catalogue IDs will be modified. */ + sale?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array +} + +/** Deletes sales. */ +export type SaleBulkDelete = { + __typename?: 'SaleBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array +} + +/** Represents sale channel listing. */ +export type SaleChannelListing = Node & { + __typename?: 'SaleChannelListing' + /** The ID of the object. */ + id: Scalars['ID'] + channel: Channel + discountValue: Scalars['Float'] + currency: Scalars['String'] +} + +export type SaleChannelListingAddInput = { + /** ID of a channel. */ + channelId: Scalars['ID'] + /** The value of the discount. */ + discountValue: Scalars['PositiveDecimal'] +} + +export type SaleChannelListingInput = { + /** List of channels to which the sale should be assigned. */ + addChannels?: Maybe> + /** List of channels from which the sale should be unassigned. */ + removeChannels?: Maybe> +} + +/** Manage sale's availability in channels. */ +export type SaleChannelListingUpdate = { + __typename?: 'SaleChannelListingUpdate' + /** An updated sale instance. */ + sale?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array +} + +export type SaleCountableConnection = { + __typename?: 'SaleCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type SaleCountableEdge = { + __typename?: 'SaleCountableEdge' + /** The item at the end of the edge. */ + node: Sale + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new sale. */ +export type SaleCreate = { + __typename?: 'SaleCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array + sale?: Maybe +} + +/** Deletes a sale. */ +export type SaleDelete = { + __typename?: 'SaleDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array + sale?: Maybe +} + +export type SaleFilterInput = { + status?: Maybe>> + saleType?: Maybe + started?: Maybe + search?: Maybe +} + +export type SaleInput = { + /** Voucher name. */ + name?: Maybe + /** Fixed or percentage. */ + type?: Maybe + /** Value of the voucher. */ + value?: Maybe + /** Products related to the discount. */ + products?: Maybe>> + /** Categories related to the discount. */ + categories?: Maybe>> + /** Collections related to the discount. */ + collections?: Maybe>> + /** Start date of the voucher in ISO 8601 format. */ + startDate?: Maybe + /** End date of the voucher in ISO 8601 format. */ + endDate?: Maybe +} + +/** Removes products, categories, collections from a sale. */ +export type SaleRemoveCatalogues = { + __typename?: 'SaleRemoveCatalogues' + /** Sale of which catalogue IDs will be modified. */ + sale?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array +} + +export enum SaleSortField { + /** Sort sales by name. */ + Name = 'NAME', + /** Sort sales by start date. */ + StartDate = 'START_DATE', + /** Sort sales by end date. */ + EndDate = 'END_DATE', + /** Sort sales by value. */ + Value = 'VALUE', + /** Sort sales by type. */ + Type = 'TYPE', +} + +export type SaleSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Specifies the channel in which to sort the data. */ + channel?: Maybe + /** Sort sales by the selected field. */ + field: SaleSortField +} + +export type SaleTranslatableContent = Node & { + __typename?: 'SaleTranslatableContent' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + /** Returns translated sale fields for the given language code. */ + translation?: Maybe + /** Sales allow creating discounts for categories, collections or products and are visible to all the customers. */ + sale?: Maybe +} + +export type SaleTranslatableContentTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Creates/updates translations for a sale. */ +export type SaleTranslate = { + __typename?: 'SaleTranslate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + translationErrors: Array + errors: Array + sale?: Maybe +} + +export type SaleTranslation = Node & { + __typename?: 'SaleTranslation' + /** The ID of the object. */ + id: Scalars['ID'] + name?: Maybe + /** Translation language. */ + language: LanguageDisplay +} + +/** An enumeration. */ +export enum SaleType { + /** fixed */ + Fixed = 'FIXED', + /** % */ + Percentage = 'PERCENTAGE', +} + +/** Updates a sale. */ +export type SaleUpdate = { + __typename?: 'SaleUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array + sale?: Maybe +} + +/** Represents a custom attribute. */ +export type SelectedAttribute = { + __typename?: 'SelectedAttribute' + /** Name of an attribute displayed in the interface. */ + attribute: Attribute + /** Values of an attribute. */ + values: Array> +} + +export type SeoInput = { + /** SEO title. */ + title?: Maybe + /** SEO description. */ + description?: Maybe +} + +/** Sets the user's password from the token sent by email using the RequestPasswordReset mutation. */ +export type SetPassword = { + __typename?: 'SetPassword' + /** JWT token, required to authenticate. */ + token?: Maybe + /** JWT refresh token, required to re-generate access token. */ + refreshToken?: Maybe + /** CSRF token required to re-generate access token. */ + csrfToken?: Maybe + /** A user instance. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +export type ShippingError = { + __typename?: 'ShippingError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: ShippingErrorCode + /** List of warehouse IDs which causes the error. */ + warehouses?: Maybe> + /** List of channels IDs which causes the error. */ + channels?: Maybe> +} + +/** An enumeration. */ +export enum ShippingErrorCode { + AlreadyExists = 'ALREADY_EXISTS', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + MaxLessThanMin = 'MAX_LESS_THAN_MIN', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', + DuplicatedInputItem = 'DUPLICATED_INPUT_ITEM', +} + +/** Shipping method are the methods you'll use to get customer's orders to them. They are directly exposed to the customers. */ +export type ShippingMethod = Node & + ObjectWithMetadata & { + __typename?: 'ShippingMethod' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + description?: Maybe + minimumOrderWeight?: Maybe + maximumOrderWeight?: Maybe + maximumDeliveryDays?: Maybe + minimumDeliveryDays?: Maybe + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** Type of the shipping method. */ + type?: Maybe + /** Returns translated shipping method fields for the given language code. */ + translation?: Maybe + /** List of channels available for the method. */ + channelListings?: Maybe> + /** The price of the cheapest variant (including discounts). */ + price?: Maybe + /** The price of the cheapest variant (including discounts). */ + maximumOrderPrice?: Maybe + /** The price of the cheapest variant (including discounts). */ + minimumOrderPrice?: Maybe + /** Postal code ranges rule of exclusion or inclusion of the shipping method. */ + postalCodeRules?: Maybe>> + /** List of excluded products for the shipping method. */ + excludedProducts?: Maybe + } + +/** Shipping method are the methods you'll use to get customer's orders to them. They are directly exposed to the customers. */ +export type ShippingMethodTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Shipping method are the methods you'll use to get customer's orders to them. They are directly exposed to the customers. */ +export type ShippingMethodExcludedProductsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Represents shipping method channel listing. */ +export type ShippingMethodChannelListing = Node & { + __typename?: 'ShippingMethodChannelListing' + /** The ID of the object. */ + id: Scalars['ID'] + channel: Channel + minimumOrderPrice?: Maybe + maximumOrderPrice?: Maybe + price?: Maybe +} + +export type ShippingMethodChannelListingAddInput = { + /** ID of a channel. */ + channelId: Scalars['ID'] + /** Shipping price of the shipping method in this channel. */ + price?: Maybe + /** Minimum order price to use this shipping method. */ + minimumOrderPrice?: Maybe + /** Maximum order price to use this shipping method. */ + maximumOrderPrice?: Maybe +} + +export type ShippingMethodChannelListingInput = { + /** List of channels to which the shipping method should be assigned. */ + addChannels?: Maybe> + /** List of channels from which the shipping method should be unassigned. */ + removeChannels?: Maybe> +} + +/** Manage shipping method's availability in channels. */ +export type ShippingMethodChannelListingUpdate = { + __typename?: 'ShippingMethodChannelListingUpdate' + /** An updated shipping method instance. */ + shippingMethod?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shippingErrors: Array + errors: Array +} + +/** Represents shipping method postal code rule. */ +export type ShippingMethodPostalCodeRule = Node & { + __typename?: 'ShippingMethodPostalCodeRule' + /** Start address range. */ + start?: Maybe + /** End address range. */ + end?: Maybe + /** Inclusion type of the postal code rule. */ + inclusionType?: Maybe + /** The ID of the object. */ + id: Scalars['ID'] +} + +export type ShippingMethodTranslatableContent = Node & { + __typename?: 'ShippingMethodTranslatableContent' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + description?: Maybe + /** Returns translated shipping method fields for the given language code. */ + translation?: Maybe + /** Shipping method are the methods you'll use to get customer's orders to them. They are directly exposed to the customers. */ + shippingMethod?: Maybe +} + +export type ShippingMethodTranslatableContentTranslationArgs = { + languageCode: LanguageCodeEnum +} + +export type ShippingMethodTranslation = Node & { + __typename?: 'ShippingMethodTranslation' + /** The ID of the object. */ + id: Scalars['ID'] + name?: Maybe + description?: Maybe + /** Translation language. */ + language: LanguageDisplay +} + +/** An enumeration. */ +export enum ShippingMethodTypeEnum { + Price = 'PRICE', + Weight = 'WEIGHT', +} + +export type ShippingPostalCodeRulesCreateInputRange = { + /** Start range of the postal code. */ + start: Scalars['String'] + /** End range of the postal code. */ + end?: Maybe +} + +/** Deletes shipping prices. */ +export type ShippingPriceBulkDelete = { + __typename?: 'ShippingPriceBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shippingErrors: Array + errors: Array +} + +/** Creates a new shipping price. */ +export type ShippingPriceCreate = { + __typename?: 'ShippingPriceCreate' + /** A shipping zone to which the shipping method belongs. */ + shippingZone?: Maybe + shippingMethod?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shippingErrors: Array + errors: Array +} + +/** Deletes a shipping price. */ +export type ShippingPriceDelete = { + __typename?: 'ShippingPriceDelete' + /** A shipping method to delete. */ + shippingMethod?: Maybe + /** A shipping zone to which the shipping method belongs. */ + shippingZone?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shippingErrors: Array + errors: Array +} + +/** Exclude products from shipping price. */ +export type ShippingPriceExcludeProducts = { + __typename?: 'ShippingPriceExcludeProducts' + /** A shipping method with new list of excluded products. */ + shippingMethod?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shippingErrors: Array + errors: Array +} + +export type ShippingPriceExcludeProductsInput = { + /** List of products which will be excluded. */ + products: Array> +} + +export type ShippingPriceInput = { + /** Name of the shipping method. */ + name?: Maybe + /** Shipping method description (JSON). */ + description?: Maybe + /** Minimum order weight to use this shipping method. */ + minimumOrderWeight?: Maybe + /** Maximum order weight to use this shipping method. */ + maximumOrderWeight?: Maybe + /** Maximum number of days for delivery. */ + maximumDeliveryDays?: Maybe + /** Minimal number of days for delivery. */ + minimumDeliveryDays?: Maybe + /** Shipping type: price or weight based. */ + type?: Maybe + /** Shipping zone this method belongs to. */ + shippingZone?: Maybe + /** Postal code rules to add. */ + addPostalCodeRules?: Maybe> + /** Postal code rules to delete. */ + deletePostalCodeRules?: Maybe> + /** Inclusion type for currently assigned postal code rules. */ + inclusionType?: Maybe +} + +/** Remove product from excluded list for shipping price. */ +export type ShippingPriceRemoveProductFromExclude = { + __typename?: 'ShippingPriceRemoveProductFromExclude' + /** A shipping method with new list of excluded products. */ + shippingMethod?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shippingErrors: Array + errors: Array +} + +/** Creates/Updates translations for shipping method. */ +export type ShippingPriceTranslate = { + __typename?: 'ShippingPriceTranslate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + translationErrors: Array + errors: Array + shippingMethod?: Maybe +} + +export type ShippingPriceTranslationInput = { + name?: Maybe + /** Translated shipping method description (JSON). */ + description?: Maybe +} + +/** Updates a new shipping price. */ +export type ShippingPriceUpdate = { + __typename?: 'ShippingPriceUpdate' + /** A shipping zone to which the shipping method belongs. */ + shippingZone?: Maybe + shippingMethod?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shippingErrors: Array + errors: Array +} + +/** Represents a shipping zone in the shop. Zones are the concept used only for grouping shipping methods in the dashboard, and are never exposed to the customers directly. */ +export type ShippingZone = Node & + ObjectWithMetadata & { + __typename?: 'ShippingZone' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + default: Scalars['Boolean'] + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** Lowest and highest prices for the shipping. */ + priceRange?: Maybe + /** List of countries available for the method. */ + countries?: Maybe>> + /** List of shipping methods available for orders shipped to countries within this shipping zone. */ + shippingMethods?: Maybe>> + /** List of warehouses for shipping zone. */ + warehouses: Array + /** List of channels for shipping zone. */ + channels: Array + /** Description of a shipping zone. */ + description?: Maybe + } + +/** Deletes shipping zones. */ +export type ShippingZoneBulkDelete = { + __typename?: 'ShippingZoneBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shippingErrors: Array + errors: Array +} + +export type ShippingZoneCountableConnection = { + __typename?: 'ShippingZoneCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type ShippingZoneCountableEdge = { + __typename?: 'ShippingZoneCountableEdge' + /** The item at the end of the edge. */ + node: ShippingZone + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new shipping zone. */ +export type ShippingZoneCreate = { + __typename?: 'ShippingZoneCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shippingErrors: Array + errors: Array + shippingZone?: Maybe +} + +export type ShippingZoneCreateInput = { + /** Shipping zone's name. Visible only to the staff. */ + name?: Maybe + /** Description of the shipping zone. */ + description?: Maybe + /** List of countries in this shipping zone. */ + countries?: Maybe>> + /** Default shipping zone will be used for countries not covered by other zones. */ + default?: Maybe + /** List of warehouses to assign to a shipping zone */ + addWarehouses?: Maybe>> + /** List of channels to assign to the shipping zone. */ + addChannels?: Maybe> +} + +/** Deletes a shipping zone. */ +export type ShippingZoneDelete = { + __typename?: 'ShippingZoneDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shippingErrors: Array + errors: Array + shippingZone?: Maybe +} + +export type ShippingZoneFilterInput = { + search?: Maybe + channels?: Maybe>> +} + +/** Updates a new shipping zone. */ +export type ShippingZoneUpdate = { + __typename?: 'ShippingZoneUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shippingErrors: Array + errors: Array + shippingZone?: Maybe +} + +export type ShippingZoneUpdateInput = { + /** Shipping zone's name. Visible only to the staff. */ + name?: Maybe + /** Description of the shipping zone. */ + description?: Maybe + /** List of countries in this shipping zone. */ + countries?: Maybe>> + /** Default shipping zone will be used for countries not covered by other zones. */ + default?: Maybe + /** List of warehouses to assign to a shipping zone */ + addWarehouses?: Maybe>> + /** List of channels to assign to the shipping zone. */ + addChannels?: Maybe> + /** List of warehouses to unassign from a shipping zone */ + removeWarehouses?: Maybe>> + /** List of channels to unassign from the shipping zone. */ + removeChannels?: Maybe> +} + +/** Represents a shop resource containing general shop data and configuration. */ +export type Shop = { + __typename?: 'Shop' + /** List of available payment gateways. */ + availablePaymentGateways: Array + /** List of available external authentications. */ + availableExternalAuthentications: Array + /** Shipping methods that are available for the shop. */ + availableShippingMethods?: Maybe>> + /** List of countries available in the shop. */ + countries: Array + /** Shop's default country. */ + defaultCountry?: Maybe + /** Default shop's email sender's name. */ + defaultMailSenderName?: Maybe + /** Default shop's email sender's address. */ + defaultMailSenderAddress?: Maybe + /** Shop's description. */ + description?: Maybe + /** Shop's domain data. */ + domain: Domain + /** List of the shops's supported languages. */ + languages: Array> + /** Shop's name. */ + name: Scalars['String'] + /** List of available permissions. */ + permissions: Array> + /** List of possible phone prefixes. */ + phonePrefixes: Array> + /** Header text. */ + headerText?: Maybe + /** Include taxes in prices. */ + includeTaxesInPrices: Scalars['Boolean'] + /** Display prices with tax in store. */ + displayGrossPrices: Scalars['Boolean'] + /** Charge taxes on shipping. */ + chargeTaxesOnShipping: Scalars['Boolean'] + /** Enable inventory tracking. */ + trackInventoryByDefault?: Maybe + /** Default weight unit. */ + defaultWeightUnit?: Maybe + /** Returns translated shop fields for the given language code. */ + translation?: Maybe + /** Enable automatic fulfillment for all digital products. */ + automaticFulfillmentDigitalProducts?: Maybe + /** Default number of max downloads per digital content URL. */ + defaultDigitalMaxDownloads?: Maybe + /** Default number of days which digital content URL will be valid. */ + defaultDigitalUrlValidDays?: Maybe + /** Company address. */ + companyAddress?: Maybe
+ /** URL of a view where customers can set their password. */ + customerSetPasswordUrl?: Maybe + /** List of staff notification recipients. */ + staffNotificationRecipients?: Maybe>> + /** Resource limitations and current usage if any set for a shop */ + limits: LimitInfo + /** Saleor API version. */ + version: Scalars['String'] +} + +/** Represents a shop resource containing general shop data and configuration. */ +export type ShopAvailablePaymentGatewaysArgs = { + currency?: Maybe + channel?: Maybe +} + +/** Represents a shop resource containing general shop data and configuration. */ +export type ShopAvailableShippingMethodsArgs = { + channel: Scalars['String'] + address?: Maybe +} + +/** Represents a shop resource containing general shop data and configuration. */ +export type ShopCountriesArgs = { + languageCode?: Maybe +} + +/** Represents a shop resource containing general shop data and configuration. */ +export type ShopTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Update the shop's address. If the `null` value is passed, the currently selected address will be deleted. */ +export type ShopAddressUpdate = { + __typename?: 'ShopAddressUpdate' + /** Updated shop. */ + shop?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shopErrors: Array + errors: Array +} + +/** Updates site domain of the shop. */ +export type ShopDomainUpdate = { + __typename?: 'ShopDomainUpdate' + /** Updated shop. */ + shop?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shopErrors: Array + errors: Array +} + +export type ShopError = { + __typename?: 'ShopError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: ShopErrorCode +} + +/** An enumeration. */ +export enum ShopErrorCode { + AlreadyExists = 'ALREADY_EXISTS', + CannotFetchTaxRates = 'CANNOT_FETCH_TAX_RATES', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', +} + +/** Fetch tax rates. */ +export type ShopFetchTaxRates = { + __typename?: 'ShopFetchTaxRates' + /** Updated shop. */ + shop?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shopErrors: Array + errors: Array +} + +export type ShopSettingsInput = { + /** Header text. */ + headerText?: Maybe + /** SEO description. */ + description?: Maybe + /** Include taxes in prices. */ + includeTaxesInPrices?: Maybe + /** Display prices with tax in store. */ + displayGrossPrices?: Maybe + /** Charge taxes on shipping. */ + chargeTaxesOnShipping?: Maybe + /** Enable inventory tracking. */ + trackInventoryByDefault?: Maybe + /** Default weight unit. */ + defaultWeightUnit?: Maybe + /** Enable automatic fulfillment for all digital products. */ + automaticFulfillmentDigitalProducts?: Maybe + /** Default number of max downloads per digital content URL. */ + defaultDigitalMaxDownloads?: Maybe + /** Default number of days which digital content URL will be valid. */ + defaultDigitalUrlValidDays?: Maybe + /** Default email sender's name. */ + defaultMailSenderName?: Maybe + /** Default email sender's address. */ + defaultMailSenderAddress?: Maybe + /** URL of a view where customers can set their password. */ + customerSetPasswordUrl?: Maybe +} + +/** Creates/Updates translations for Shop Settings. */ +export type ShopSettingsTranslate = { + __typename?: 'ShopSettingsTranslate' + /** Updated shop. */ + shop?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + translationErrors: Array + errors: Array +} + +export type ShopSettingsTranslationInput = { + headerText?: Maybe + description?: Maybe +} + +/** Updates shop settings. */ +export type ShopSettingsUpdate = { + __typename?: 'ShopSettingsUpdate' + /** Updated shop. */ + shop?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shopErrors: Array + errors: Array +} + +export type ShopTranslation = Node & { + __typename?: 'ShopTranslation' + /** The ID of the object. */ + id: Scalars['ID'] + headerText: Scalars['String'] + description: Scalars['String'] + /** Translation language. */ + language: LanguageDisplay +} + +export type SiteDomainInput = { + /** Domain name for shop. */ + domain?: Maybe + /** Shop site name. */ + name?: Maybe +} + +/** Deletes staff users. */ +export type StaffBulkDelete = { + __typename?: 'StaffBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + staffErrors: Array + errors: Array +} + +/** Creates a new staff user. */ +export type StaffCreate = { + __typename?: 'StaffCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + staffErrors: Array + errors: Array + user?: Maybe +} + +export type StaffCreateInput = { + /** Given name. */ + firstName?: Maybe + /** Family name. */ + lastName?: Maybe + /** The unique email address of the user. */ + email?: Maybe + /** User account is active. */ + isActive?: Maybe + /** A note about the user. */ + note?: Maybe + /** List of permission group IDs to which user should be assigned. */ + addGroups?: Maybe> + /** URL of a view where users should be redirected to set the password. URL in RFC 1808 format. */ + redirectUrl?: Maybe +} + +/** Deletes a staff user. */ +export type StaffDelete = { + __typename?: 'StaffDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + staffErrors: Array + errors: Array + user?: Maybe +} + +export type StaffError = { + __typename?: 'StaffError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: AccountErrorCode + /** A type of address that causes the error. */ + addressType?: Maybe + /** List of permissions which causes the error. */ + permissions?: Maybe> + /** List of permission group IDs which cause the error. */ + groups?: Maybe> + /** List of user IDs which causes the error. */ + users?: Maybe> +} + +export enum StaffMemberStatus { + /** User account has been activated. */ + Active = 'ACTIVE', + /** User account has not been activated yet. */ + Deactivated = 'DEACTIVATED', +} + +/** Represents a recipient of email notifications send by Saleor, such as notifications about new orders. Notifications can be assigned to staff users or arbitrary email addresses. */ +export type StaffNotificationRecipient = Node & { + __typename?: 'StaffNotificationRecipient' + /** Returns a user subscribed to email notifications. */ + user?: Maybe + /** Determines if a notification active. */ + active?: Maybe + /** The ID of the object. */ + id: Scalars['ID'] + /** Returns email address of a user subscribed to email notifications. */ + email?: Maybe +} + +/** Creates a new staff notification recipient. */ +export type StaffNotificationRecipientCreate = { + __typename?: 'StaffNotificationRecipientCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shopErrors: Array + errors: Array + staffNotificationRecipient?: Maybe +} + +/** Delete staff notification recipient. */ +export type StaffNotificationRecipientDelete = { + __typename?: 'StaffNotificationRecipientDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shopErrors: Array + errors: Array + staffNotificationRecipient?: Maybe +} + +export type StaffNotificationRecipientInput = { + /** The ID of the user subscribed to email notifications.. */ + user?: Maybe + /** Email address of a user subscribed to email notifications. */ + email?: Maybe + /** Determines if a notification active. */ + active?: Maybe +} + +/** Updates a staff notification recipient. */ +export type StaffNotificationRecipientUpdate = { + __typename?: 'StaffNotificationRecipientUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + shopErrors: Array + errors: Array + staffNotificationRecipient?: Maybe +} + +/** Updates an existing staff user. */ +export type StaffUpdate = { + __typename?: 'StaffUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + staffErrors: Array + errors: Array + user?: Maybe +} + +export type StaffUpdateInput = { + /** Given name. */ + firstName?: Maybe + /** Family name. */ + lastName?: Maybe + /** The unique email address of the user. */ + email?: Maybe + /** User account is active. */ + isActive?: Maybe + /** A note about the user. */ + note?: Maybe + /** List of permission group IDs to which user should be assigned. */ + addGroups?: Maybe> + /** List of permission group IDs from which user should be unassigned. */ + removeGroups?: Maybe> +} + +export type StaffUserInput = { + status?: Maybe + search?: Maybe +} + +/** Represents stock. */ +export type Stock = Node & { + __typename?: 'Stock' + warehouse: Warehouse + productVariant: ProductVariant + /** Quantity of a product in the warehouse's possession, including the allocated stock that is waiting for shipment. */ + quantity: Scalars['Int'] + /** The ID of the object. */ + id: Scalars['ID'] + /** Quantity allocated for orders */ + quantityAllocated: Scalars['Int'] +} + +export enum StockAvailability { + InStock = 'IN_STOCK', + OutOfStock = 'OUT_OF_STOCK', +} + +export type StockCountableConnection = { + __typename?: 'StockCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type StockCountableEdge = { + __typename?: 'StockCountableEdge' + /** The item at the end of the edge. */ + node: Stock + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +export type StockError = { + __typename?: 'StockError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: StockErrorCode +} + +/** An enumeration. */ +export enum StockErrorCode { + AlreadyExists = 'ALREADY_EXISTS', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', +} + +export type StockFilterInput = { + quantity?: Maybe + search?: Maybe +} + +export type StockInput = { + /** Warehouse in which stock is located. */ + warehouse: Scalars['ID'] + /** Quantity of items available for sell. */ + quantity: Scalars['Int'] +} + +/** An enumeration. */ +export enum TaxRateType { + Accommodation = 'ACCOMMODATION', + AdmissionToCulturalEvents = 'ADMISSION_TO_CULTURAL_EVENTS', + AdmissionToEntertainmentEvents = 'ADMISSION_TO_ENTERTAINMENT_EVENTS', + AdmissionToSportingEvents = 'ADMISSION_TO_SPORTING_EVENTS', + Advertising = 'ADVERTISING', + AgriculturalSupplies = 'AGRICULTURAL_SUPPLIES', + BabyFoodstuffs = 'BABY_FOODSTUFFS', + Bikes = 'BIKES', + Books = 'BOOKS', + ChildrensClothing = 'CHILDRENS_CLOTHING', + DomesticFuel = 'DOMESTIC_FUEL', + DomesticServices = 'DOMESTIC_SERVICES', + EBooks = 'E_BOOKS', + Foodstuffs = 'FOODSTUFFS', + Hotels = 'HOTELS', + Medical = 'MEDICAL', + Newspapers = 'NEWSPAPERS', + PassengerTransport = 'PASSENGER_TRANSPORT', + Pharmaceuticals = 'PHARMACEUTICALS', + PropertyRenovations = 'PROPERTY_RENOVATIONS', + Restaurants = 'RESTAURANTS', + SocialHousing = 'SOCIAL_HOUSING', + Standard = 'STANDARD', + Water = 'WATER', + Wine = 'WINE', +} + +/** Representation of tax types fetched from tax gateway. */ +export type TaxType = { + __typename?: 'TaxType' + /** Description of the tax type. */ + description?: Maybe + /** External tax code used to identify given tax group. */ + taxCode?: Maybe +} + +/** Represents a monetary value with taxes. In cases where taxes were not applied, net and gross values will be equal. */ +export type TaxedMoney = { + __typename?: 'TaxedMoney' + /** Currency code. */ + currency: Scalars['String'] + /** Amount of money including taxes. */ + gross: Money + /** Amount of money without taxes. */ + net: Money + /** Amount of taxes. */ + tax: Money +} + +/** Represents a range of monetary values. */ +export type TaxedMoneyRange = { + __typename?: 'TaxedMoneyRange' + /** Lower bound of a price range. */ + start?: Maybe + /** Upper bound of a price range. */ + stop?: Maybe +} + +/** An object representing a single payment. */ +export type Transaction = Node & { + __typename?: 'Transaction' + /** The ID of the object. */ + id: Scalars['ID'] + created: Scalars['DateTime'] + payment: Payment + token: Scalars['String'] + kind: TransactionKind + isSuccess: Scalars['Boolean'] + error?: Maybe + gatewayResponse: Scalars['JSONString'] + /** Total amount of the transaction. */ + amount?: Maybe +} + +/** An enumeration. */ +export enum TransactionKind { + /** External reference */ + External = 'EXTERNAL', + /** Authorization */ + Auth = 'AUTH', + /** Pending */ + Pending = 'PENDING', + /** Action to confirm */ + ActionToConfirm = 'ACTION_TO_CONFIRM', + /** Refund */ + Refund = 'REFUND', + /** Refund in progress */ + RefundOngoing = 'REFUND_ONGOING', + /** Capture */ + Capture = 'CAPTURE', + /** Void */ + Void = 'VOID', + /** Confirm */ + Confirm = 'CONFIRM', + /** Cancel */ + Cancel = 'CANCEL', +} + +export type TranslatableItem = + | ProductTranslatableContent + | CollectionTranslatableContent + | CategoryTranslatableContent + | AttributeTranslatableContent + | AttributeValueTranslatableContent + | ProductVariantTranslatableContent + | PageTranslatableContent + | ShippingMethodTranslatableContent + | SaleTranslatableContent + | VoucherTranslatableContent + | MenuItemTranslatableContent + +export type TranslatableItemConnection = { + __typename?: 'TranslatableItemConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type TranslatableItemEdge = { + __typename?: 'TranslatableItemEdge' + /** The item at the end of the edge. */ + node: TranslatableItem + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +export enum TranslatableKinds { + Attribute = 'ATTRIBUTE', + AttributeValue = 'ATTRIBUTE_VALUE', + Category = 'CATEGORY', + Collection = 'COLLECTION', + MenuItem = 'MENU_ITEM', + Page = 'PAGE', + Product = 'PRODUCT', + Sale = 'SALE', + ShippingMethod = 'SHIPPING_METHOD', + Variant = 'VARIANT', + Voucher = 'VOUCHER', +} + +export type TranslationError = { + __typename?: 'TranslationError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: TranslationErrorCode +} + +/** An enumeration. */ +export enum TranslationErrorCode { + GraphqlError = 'GRAPHQL_ERROR', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', +} + +export type TranslationInput = { + seoTitle?: Maybe + seoDescription?: Maybe + name?: Maybe + description?: Maybe +} + +export type UpdateInvoiceInput = { + /** Invoice number */ + number?: Maybe + /** URL of an invoice to download. */ + url?: Maybe +} + +/** Updates metadata of an object. */ +export type UpdateMetadata = { + __typename?: 'UpdateMetadata' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + metadataErrors: Array + errors: Array + item?: Maybe +} + +/** Updates private metadata of an object. */ +export type UpdatePrivateMetadata = { + __typename?: 'UpdatePrivateMetadata' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + metadataErrors: Array + errors: Array + item?: Maybe +} + +export type UploadError = { + __typename?: 'UploadError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: UploadErrorCode +} + +/** An enumeration. */ +export enum UploadErrorCode { + GraphqlError = 'GRAPHQL_ERROR', +} + +/** Represents user data. */ +export type User = Node & + ObjectWithMetadata & { + __typename?: 'User' + /** The ID of the object. */ + id: Scalars['ID'] + lastLogin?: Maybe + email: Scalars['String'] + firstName: Scalars['String'] + lastName: Scalars['String'] + isStaff: Scalars['Boolean'] + isActive: Scalars['Boolean'] + /** A note about the customer. */ + note?: Maybe + dateJoined: Scalars['DateTime'] + defaultShippingAddress?: Maybe
+ defaultBillingAddress?: Maybe
+ /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + /** List of all user's addresses. */ + addresses?: Maybe>> + /** + * Returns the last open checkout of this user. + * @deprecated Will be removed in Saleor 4.0. Use the `checkout_tokens` field to fetch the user checkouts. + */ + checkout?: Maybe + /** Returns the checkout UUID's assigned to this user. */ + checkoutTokens?: Maybe> + /** List of the user gift cards. */ + giftCards?: Maybe + /** List of user's orders. */ + orders?: Maybe + /** List of user's permissions. */ + userPermissions?: Maybe>> + /** List of user's permission groups. */ + permissionGroups?: Maybe>> + /** List of user's permission groups which user can manage. */ + editableGroups?: Maybe>> + avatar?: Maybe + /** List of events associated with the user. */ + events?: Maybe>> + /** List of stored payment sources. */ + storedPaymentSources?: Maybe>> + /** User language code. */ + languageCode: LanguageCodeEnum + } + +/** Represents user data. */ +export type UserCheckoutTokensArgs = { + channel?: Maybe +} + +/** Represents user data. */ +export type UserGiftCardsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Represents user data. */ +export type UserOrdersArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Represents user data. */ +export type UserAvatarArgs = { + size?: Maybe +} + +/** Represents user data. */ +export type UserStoredPaymentSourcesArgs = { + channel?: Maybe +} + +/** Deletes a user avatar. Only for staff members. */ +export type UserAvatarDelete = { + __typename?: 'UserAvatarDelete' + /** An updated user instance. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Create a user avatar. Only for staff members. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec */ +export type UserAvatarUpdate = { + __typename?: 'UserAvatarUpdate' + /** An updated user instance. */ + user?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** Activate or deactivate users. */ +export type UserBulkSetActive = { + __typename?: 'UserBulkSetActive' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +export type UserCountableConnection = { + __typename?: 'UserCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type UserCountableEdge = { + __typename?: 'UserCountableEdge' + /** The item at the end of the edge. */ + node: User + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +export type UserCreateInput = { + /** Billing address of the customer. */ + defaultBillingAddress?: Maybe + /** Shipping address of the customer. */ + defaultShippingAddress?: Maybe + /** Given name. */ + firstName?: Maybe + /** Family name. */ + lastName?: Maybe + /** The unique email address of the user. */ + email?: Maybe + /** User account is active. */ + isActive?: Maybe + /** A note about the user. */ + note?: Maybe + /** User language code. */ + languageCode?: Maybe + /** URL of a view where users should be redirected to set the password. URL in RFC 1808 format. */ + redirectUrl?: Maybe + /** Slug of a channel which will be used for notify user. Optional when only one channel exists. */ + channel?: Maybe +} + +export type UserPermission = { + __typename?: 'UserPermission' + /** Internal code for permission. */ + code: PermissionEnum + /** Describe action(s) allowed to do by permission. */ + name: Scalars['String'] + /** List of user permission groups which contains this permission. */ + sourcePermissionGroups?: Maybe> +} + +export type UserPermissionSourcePermissionGroupsArgs = { + userId: Scalars['ID'] +} + +export enum UserSortField { + /** Sort users by first name. */ + FirstName = 'FIRST_NAME', + /** Sort users by last name. */ + LastName = 'LAST_NAME', + /** Sort users by email. */ + Email = 'EMAIL', + /** Sort users by order count. */ + OrderCount = 'ORDER_COUNT', +} + +export type UserSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort users by the selected field. */ + field: UserSortField +} + +/** Represents a VAT rate for a country. */ +export type Vat = { + __typename?: 'VAT' + /** Country code. */ + countryCode: Scalars['String'] + /** Standard VAT rate in percent. */ + standardRate?: Maybe + /** Country's VAT rate exceptions for specific types of goods. */ + reducedRates: Array> +} + +export enum VariantAttributeScope { + All = 'ALL', + VariantSelection = 'VARIANT_SELECTION', + NotVariantSelection = 'NOT_VARIANT_SELECTION', +} + +/** Assign an media to a product variant. */ +export type VariantMediaAssign = { + __typename?: 'VariantMediaAssign' + productVariant?: Maybe + media?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +/** Unassign an media from a product variant. */ +export type VariantMediaUnassign = { + __typename?: 'VariantMediaUnassign' + productVariant?: Maybe + media?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + productErrors: Array + errors: Array +} + +/** Represents availability of a variant in the storefront. */ +export type VariantPricingInfo = { + __typename?: 'VariantPricingInfo' + /** Whether it is in sale or not. */ + onSale?: Maybe + /** The discount amount if in sale (null otherwise). */ + discount?: Maybe + /** The discount amount in the local currency. */ + discountLocalCurrency?: Maybe + /** The price, with any discount subtracted. */ + price?: Maybe + /** The price without any discount. */ + priceUndiscounted?: Maybe + /** The discounted price in the local currency. */ + priceLocalCurrency?: Maybe +} + +/** Verify JWT token. */ +export type VerifyToken = { + __typename?: 'VerifyToken' + /** User assigned to token. */ + user?: Maybe + /** Determine if token is valid or not. */ + isValid: Scalars['Boolean'] + /** JWT payload. */ + payload?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + accountErrors: Array + errors: Array +} + +/** An enumeration. */ +export enum VolumeUnitsEnum { + CubicMillimeter = 'CUBIC_MILLIMETER', + CubicCentimeter = 'CUBIC_CENTIMETER', + CubicDecimeter = 'CUBIC_DECIMETER', + CubicMeter = 'CUBIC_METER', + Liter = 'LITER', + CubicFoot = 'CUBIC_FOOT', + CubicInch = 'CUBIC_INCH', + CubicYard = 'CUBIC_YARD', + Qt = 'QT', + Pint = 'PINT', + FlOz = 'FL_OZ', + AcreIn = 'ACRE_IN', + AcreFt = 'ACRE_FT', +} + +/** Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes. */ +export type Voucher = Node & { + __typename?: 'Voucher' + /** The ID of the object. */ + id: Scalars['ID'] + name?: Maybe + /** Determines a type of voucher. */ + type: VoucherTypeEnum + code: Scalars['String'] + usageLimit?: Maybe + used: Scalars['Int'] + startDate: Scalars['DateTime'] + endDate?: Maybe + applyOncePerOrder: Scalars['Boolean'] + applyOncePerCustomer: Scalars['Boolean'] + /** Determines a type of discount for voucher - value or percentage */ + discountValueType: DiscountValueTypeEnum + minCheckoutItemsQuantity?: Maybe + /** List of categories this voucher applies to. */ + categories?: Maybe + /** List of collections this voucher applies to. */ + collections?: Maybe + /** List of products this voucher applies to. */ + products?: Maybe + /** List of countries available for the shipping voucher. */ + countries?: Maybe>> + /** Returns translated voucher fields for the given language code. */ + translation?: Maybe + /** Voucher value. */ + discountValue?: Maybe + /** Currency code for voucher. */ + currency?: Maybe + /** Minimum order value to apply voucher. */ + minSpent?: Maybe + /** List of availability in channels for the voucher. */ + channelListings?: Maybe> +} + +/** Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes. */ +export type VoucherCategoriesArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes. */ +export type VoucherCollectionsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes. */ +export type VoucherProductsArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +/** Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes. */ +export type VoucherTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Adds products, categories, collections to a voucher. */ +export type VoucherAddCatalogues = { + __typename?: 'VoucherAddCatalogues' + /** Voucher of which catalogue IDs will be modified. */ + voucher?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array +} + +/** Deletes vouchers. */ +export type VoucherBulkDelete = { + __typename?: 'VoucherBulkDelete' + /** Returns how many objects were affected. */ + count: Scalars['Int'] + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array +} + +/** Represents voucher channel listing. */ +export type VoucherChannelListing = Node & { + __typename?: 'VoucherChannelListing' + /** The ID of the object. */ + id: Scalars['ID'] + channel: Channel + discountValue: Scalars['Float'] + currency: Scalars['String'] + minSpent?: Maybe +} + +export type VoucherChannelListingAddInput = { + /** ID of a channel. */ + channelId: Scalars['ID'] + /** Value of the voucher. */ + discountValue?: Maybe + /** Min purchase amount required to apply the voucher. */ + minAmountSpent?: Maybe +} + +export type VoucherChannelListingInput = { + /** List of channels to which the voucher should be assigned. */ + addChannels?: Maybe> + /** List of channels from which the voucher should be unassigned. */ + removeChannels?: Maybe> +} + +/** Manage voucher's availability in channels. */ +export type VoucherChannelListingUpdate = { + __typename?: 'VoucherChannelListingUpdate' + /** An updated voucher instance. */ + voucher?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array +} + +export type VoucherCountableConnection = { + __typename?: 'VoucherCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type VoucherCountableEdge = { + __typename?: 'VoucherCountableEdge' + /** The item at the end of the edge. */ + node: Voucher + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates a new voucher. */ +export type VoucherCreate = { + __typename?: 'VoucherCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array + voucher?: Maybe +} + +/** Deletes a voucher. */ +export type VoucherDelete = { + __typename?: 'VoucherDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array + voucher?: Maybe +} + +export enum VoucherDiscountType { + Fixed = 'FIXED', + Percentage = 'PERCENTAGE', + Shipping = 'SHIPPING', +} + +export type VoucherFilterInput = { + status?: Maybe>> + timesUsed?: Maybe + discountType?: Maybe>> + started?: Maybe + search?: Maybe +} + +export type VoucherInput = { + /** Voucher type: PRODUCT, CATEGORY SHIPPING or ENTIRE_ORDER. */ + type?: Maybe + /** Voucher name. */ + name?: Maybe + /** Code to use the voucher. */ + code?: Maybe + /** Start date of the voucher in ISO 8601 format. */ + startDate?: Maybe + /** End date of the voucher in ISO 8601 format. */ + endDate?: Maybe + /** Choices: fixed or percentage. */ + discountValueType?: Maybe + /** Products discounted by the voucher. */ + products?: Maybe>> + /** Collections discounted by the voucher. */ + collections?: Maybe>> + /** Categories discounted by the voucher. */ + categories?: Maybe>> + /** Minimal quantity of checkout items required to apply the voucher. */ + minCheckoutItemsQuantity?: Maybe + /** Country codes that can be used with the shipping voucher. */ + countries?: Maybe>> + /** Voucher should be applied to the cheapest item or entire order. */ + applyOncePerOrder?: Maybe + /** Voucher should be applied once per customer. */ + applyOncePerCustomer?: Maybe + /** Limit number of times this voucher can be used in total. */ + usageLimit?: Maybe +} + +/** Removes products, categories, collections from a voucher. */ +export type VoucherRemoveCatalogues = { + __typename?: 'VoucherRemoveCatalogues' + /** Voucher of which catalogue IDs will be modified. */ + voucher?: Maybe + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array +} + +export enum VoucherSortField { + /** Sort vouchers by code. */ + Code = 'CODE', + /** Sort vouchers by start date. */ + StartDate = 'START_DATE', + /** Sort vouchers by end date. */ + EndDate = 'END_DATE', + /** Sort vouchers by value. */ + Value = 'VALUE', + /** Sort vouchers by type. */ + Type = 'TYPE', + /** Sort vouchers by usage limit. */ + UsageLimit = 'USAGE_LIMIT', + /** Sort vouchers by minimum spent amount. */ + MinimumSpentAmount = 'MINIMUM_SPENT_AMOUNT', +} + +export type VoucherSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Specifies the channel in which to sort the data. */ + channel?: Maybe + /** Sort vouchers by the selected field. */ + field: VoucherSortField +} + +export type VoucherTranslatableContent = Node & { + __typename?: 'VoucherTranslatableContent' + /** The ID of the object. */ + id: Scalars['ID'] + name?: Maybe + /** Returns translated voucher fields for the given language code. */ + translation?: Maybe + /** Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes. */ + voucher?: Maybe +} + +export type VoucherTranslatableContentTranslationArgs = { + languageCode: LanguageCodeEnum +} + +/** Creates/Updates translations for Voucher. */ +export type VoucherTranslate = { + __typename?: 'VoucherTranslate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + translationErrors: Array + errors: Array + voucher?: Maybe +} + +export type VoucherTranslation = Node & { + __typename?: 'VoucherTranslation' + /** The ID of the object. */ + id: Scalars['ID'] + name?: Maybe + /** Translation language. */ + language: LanguageDisplay +} + +export enum VoucherTypeEnum { + Shipping = 'SHIPPING', + EntireOrder = 'ENTIRE_ORDER', + SpecificProduct = 'SPECIFIC_PRODUCT', +} + +/** Updates a voucher. */ +export type VoucherUpdate = { + __typename?: 'VoucherUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + discountErrors: Array + errors: Array + voucher?: Maybe +} + +/** Represents warehouse. */ +export type Warehouse = Node & + ObjectWithMetadata & { + __typename?: 'Warehouse' + /** The ID of the object. */ + id: Scalars['ID'] + name: Scalars['String'] + slug: Scalars['String'] + companyName: Scalars['String'] + shippingZones: ShippingZoneCountableConnection + address: Address + email: Scalars['String'] + /** List of private metadata items.Requires proper staff permissions to access. */ + privateMetadata: Array> + /** List of public metadata items. Can be accessed without permissions. */ + metadata: Array> + } + +/** Represents warehouse. */ +export type WarehouseShippingZonesArgs = { + before?: Maybe + after?: Maybe + first?: Maybe + last?: Maybe +} + +export type WarehouseAddressInput = { + /** Address. */ + streetAddress1: Scalars['String'] + /** Address. */ + streetAddress2?: Maybe + /** City. */ + city: Scalars['String'] + /** District. */ + cityArea?: Maybe + /** Postal code. */ + postalCode?: Maybe + /** Country. */ + country: CountryCode + /** State or province. */ + countryArea?: Maybe + /** Phone number. */ + phone?: Maybe +} + +export type WarehouseCountableConnection = { + __typename?: 'WarehouseCountableConnection' + /** Pagination data for this connection. */ + pageInfo: PageInfo + edges: Array + /** A total count of items in the collection. */ + totalCount?: Maybe +} + +export type WarehouseCountableEdge = { + __typename?: 'WarehouseCountableEdge' + /** The item at the end of the edge. */ + node: Warehouse + /** A cursor for use in pagination. */ + cursor: Scalars['String'] +} + +/** Creates new warehouse. */ +export type WarehouseCreate = { + __typename?: 'WarehouseCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + warehouseErrors: Array + errors: Array + warehouse?: Maybe +} + +export type WarehouseCreateInput = { + /** Warehouse slug. */ + slug?: Maybe + /** Company name. */ + companyName?: Maybe + /** The email address of the warehouse. */ + email?: Maybe + /** Warehouse name. */ + name: Scalars['String'] + /** Address of the warehouse. */ + address: WarehouseAddressInput + /** Shipping zones supported by the warehouse. */ + shippingZones?: Maybe>> +} + +/** Deletes selected warehouse. */ +export type WarehouseDelete = { + __typename?: 'WarehouseDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + warehouseErrors: Array + errors: Array + warehouse?: Maybe +} + +export type WarehouseError = { + __typename?: 'WarehouseError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: WarehouseErrorCode +} + +/** An enumeration. */ +export enum WarehouseErrorCode { + AlreadyExists = 'ALREADY_EXISTS', + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', +} + +export type WarehouseFilterInput = { + search?: Maybe + ids?: Maybe>> +} + +/** Add shipping zone to given warehouse. */ +export type WarehouseShippingZoneAssign = { + __typename?: 'WarehouseShippingZoneAssign' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + warehouseErrors: Array + errors: Array + warehouse?: Maybe +} + +/** Remove shipping zone from given warehouse. */ +export type WarehouseShippingZoneUnassign = { + __typename?: 'WarehouseShippingZoneUnassign' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + warehouseErrors: Array + errors: Array + warehouse?: Maybe +} + +export enum WarehouseSortField { + /** Sort warehouses by name. */ + Name = 'NAME', +} + +export type WarehouseSortingInput = { + /** Specifies the direction in which to sort products. */ + direction: OrderDirection + /** Sort warehouses by the selected field. */ + field: WarehouseSortField +} + +/** Updates given warehouse. */ +export type WarehouseUpdate = { + __typename?: 'WarehouseUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + warehouseErrors: Array + errors: Array + warehouse?: Maybe +} + +export type WarehouseUpdateInput = { + /** Warehouse slug. */ + slug?: Maybe + /** Company name. */ + companyName?: Maybe + /** The email address of the warehouse. */ + email?: Maybe + /** Warehouse name. */ + name?: Maybe + /** Address of the warehouse. */ + address?: Maybe +} + +/** Webhook. */ +export type Webhook = Node & { + __typename?: 'Webhook' + name: Scalars['String'] + targetUrl: Scalars['String'] + isActive: Scalars['Boolean'] + secretKey?: Maybe + /** The ID of the object. */ + id: Scalars['ID'] + /** List of webhook events. */ + events: Array + app: App +} + +/** Creates a new webhook subscription. */ +export type WebhookCreate = { + __typename?: 'WebhookCreate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + webhookErrors: Array + errors: Array + webhook?: Maybe +} + +export type WebhookCreateInput = { + /** The name of the webhook. */ + name?: Maybe + /** The url to receive the payload. */ + targetUrl?: Maybe + /** The events that webhook wants to subscribe. */ + events?: Maybe>> + /** ID of the app to which webhook belongs. */ + app?: Maybe + /** Determine if webhook will be set active or not. */ + isActive?: Maybe + /** The secret key used to create a hash signature with each payload. */ + secretKey?: Maybe +} + +/** Deletes a webhook subscription. */ +export type WebhookDelete = { + __typename?: 'WebhookDelete' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + webhookErrors: Array + errors: Array + webhook?: Maybe +} + +export type WebhookError = { + __typename?: 'WebhookError' + /** Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. */ + field?: Maybe + /** The error message. */ + message?: Maybe + /** The error code. */ + code: WebhookErrorCode +} + +/** An enumeration. */ +export enum WebhookErrorCode { + GraphqlError = 'GRAPHQL_ERROR', + Invalid = 'INVALID', + NotFound = 'NOT_FOUND', + Required = 'REQUIRED', + Unique = 'UNIQUE', +} + +/** Webhook event. */ +export type WebhookEvent = { + __typename?: 'WebhookEvent' + /** Internal name of the event type. */ + eventType: WebhookEventTypeEnum + /** Display name of the event. */ + name: Scalars['String'] +} + +/** Enum determining type of webhook. */ +export enum WebhookEventTypeEnum { + /** All the events. */ + AnyEvents = 'ANY_EVENTS', + /** A new order is placed. */ + OrderCreated = 'ORDER_CREATED', + /** An order is confirmed (status change unconfirmed -> unfulfilled) by a staff user using the OrderConfirm mutation. It also triggers when the user completes the checkout and the shop setting `automatically_confirm_all_new_orders` is enabled. */ + OrderConfirmed = 'ORDER_CONFIRMED', + /** Payment is made and an order is fully paid. */ + OrderFullyPaid = 'ORDER_FULLY_PAID', + /** An order is updated; triggered for all changes related to an order; covers all other order webhooks, except for ORDER_CREATED. */ + OrderUpdated = 'ORDER_UPDATED', + /** An order is cancelled. */ + OrderCancelled = 'ORDER_CANCELLED', + /** An order is fulfilled. */ + OrderFulfilled = 'ORDER_FULFILLED', + /** An invoice for order requested. */ + InvoiceRequested = 'INVOICE_REQUESTED', + /** An invoice is deleted. */ + InvoiceDeleted = 'INVOICE_DELETED', + /** Invoice has been sent. */ + InvoiceSent = 'INVOICE_SENT', + /** A new customer account is created. */ + CustomerCreated = 'CUSTOMER_CREATED', + /** A customer account is updated. */ + CustomerUpdated = 'CUSTOMER_UPDATED', + /** A new product is created. */ + ProductCreated = 'PRODUCT_CREATED', + /** A product is updated. */ + ProductUpdated = 'PRODUCT_UPDATED', + /** A product is deleted. */ + ProductDeleted = 'PRODUCT_DELETED', + /** A new product variant is created. */ + ProductVariantCreated = 'PRODUCT_VARIANT_CREATED', + /** A product variant is updated. */ + ProductVariantUpdated = 'PRODUCT_VARIANT_UPDATED', + /** A product variant is deleted. */ + ProductVariantDeleted = 'PRODUCT_VARIANT_DELETED', + /** A new checkout is created. */ + CheckoutCreated = 'CHECKOUT_CREATED', + /** A checkout is updated. It also triggers all updates related to the checkout. */ + CheckoutUpdated = 'CHECKOUT_UPDATED', + /** A new fulfillment is created. */ + FulfillmentCreated = 'FULFILLMENT_CREATED', + /** User notification triggered. */ + NotifyUser = 'NOTIFY_USER', + /** A new page is created. */ + PageCreated = 'PAGE_CREATED', + /** A page is updated. */ + PageUpdated = 'PAGE_UPDATED', + /** A page is deleted. */ + PageDeleted = 'PAGE_DELETED', +} + +/** An enumeration. */ +export enum WebhookSampleEventTypeEnum { + OrderCreated = 'ORDER_CREATED', + OrderConfirmed = 'ORDER_CONFIRMED', + OrderFullyPaid = 'ORDER_FULLY_PAID', + OrderUpdated = 'ORDER_UPDATED', + OrderCancelled = 'ORDER_CANCELLED', + OrderFulfilled = 'ORDER_FULFILLED', + InvoiceRequested = 'INVOICE_REQUESTED', + InvoiceDeleted = 'INVOICE_DELETED', + InvoiceSent = 'INVOICE_SENT', + CustomerCreated = 'CUSTOMER_CREATED', + CustomerUpdated = 'CUSTOMER_UPDATED', + ProductCreated = 'PRODUCT_CREATED', + ProductUpdated = 'PRODUCT_UPDATED', + ProductDeleted = 'PRODUCT_DELETED', + ProductVariantCreated = 'PRODUCT_VARIANT_CREATED', + ProductVariantUpdated = 'PRODUCT_VARIANT_UPDATED', + ProductVariantDeleted = 'PRODUCT_VARIANT_DELETED', + CheckoutCreated = 'CHECKOUT_CREATED', + CheckoutUpdated = 'CHECKOUT_UPDATED', + FulfillmentCreated = 'FULFILLMENT_CREATED', + NotifyUser = 'NOTIFY_USER', + PageCreated = 'PAGE_CREATED', + PageUpdated = 'PAGE_UPDATED', + PageDeleted = 'PAGE_DELETED', +} + +/** Updates a webhook subscription. */ +export type WebhookUpdate = { + __typename?: 'WebhookUpdate' + /** @deprecated Use errors field instead. This field will be removed in Saleor 4.0. */ + webhookErrors: Array + errors: Array + webhook?: Maybe +} + +export type WebhookUpdateInput = { + /** The new name of the webhook. */ + name?: Maybe + /** The url to receive the payload. */ + targetUrl?: Maybe + /** The events that webhook wants to subscribe. */ + events?: Maybe>> + /** ID of the app to which webhook belongs. */ + app?: Maybe + /** Determine if webhook will be set active or not. */ + isActive?: Maybe + /** Use to create a hash signature with each payload. */ + secretKey?: Maybe +} + +/** Represents weight value in a specific weight unit. */ +export type Weight = { + __typename?: 'Weight' + /** Weight unit. */ + unit: WeightUnitsEnum + /** Weight value. */ + value: Scalars['Float'] +} + +/** An enumeration. */ +export enum WeightUnitsEnum { + G = 'G', + Lb = 'LB', + Oz = 'OZ', + Kg = 'KG', + Tonne = 'TONNE', +} + +export type _Entity = + | Address + | User + | Group + | App + | ProductVariant + | Product + | ProductType + | Collection + | Category + | ProductMedia + | ProductImage + | PageType + +export type _Service = { + __typename?: '_Service' + sdl?: Maybe +} + +export type GetAllProductPathsQueryVariables = Exact<{ + first?: Maybe + cursor?: Maybe + channel?: Maybe +}> + +export type GetAllProductPathsQuery = { __typename?: 'Query' } & { + products?: Maybe< + { __typename?: 'ProductCountableConnection' } & { + pageInfo: { __typename?: 'PageInfo' } & Pick + edges: Array< + { __typename?: 'ProductCountableEdge' } & Pick & { + node: { __typename?: 'Product' } & Pick + } + > + } + > +} + +export type ProductConnectionFragment = { + __typename?: 'ProductCountableConnection' +} & { + pageInfo: { __typename?: 'PageInfo' } & Pick + edges: Array< + { __typename?: 'ProductCountableEdge' } & { + node: { __typename?: 'Product' } & Pick & { + pricing?: Maybe< + { __typename?: 'ProductPricingInfo' } & { + priceRange?: Maybe< + { __typename?: 'TaxedMoneyRange' } & { + start?: Maybe< + { __typename?: 'TaxedMoney' } & { + net: { __typename?: 'Money' } & Pick + } + > + } + > + } + > + media?: Maybe>> + } + } + > +} + +export type GetAllProductsQueryVariables = Exact<{ + first?: Maybe + filter?: Maybe + sortBy?: Maybe + channel?: Maybe +}> + +export type GetAllProductsQuery = { __typename?: 'Query' } & { + products?: Maybe<{ __typename?: 'ProductCountableConnection' } & ProductConnectionFragment> +} diff --git a/packages/saleor/schema.graphql b/packages/saleor/schema.graphql new file mode 100644 index 0000000..de28586 --- /dev/null +++ b/packages/saleor/schema.graphql @@ -0,0 +1,18973 @@ +""" +Create a new address for the customer. +""" +type AccountAddressCreate { + """ + A user instance for which the address was created. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! + address: Address +} + +""" +Delete an address of the logged-in user. +""" +type AccountAddressDelete { + """ + A user instance for which the address was deleted. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! + address: Address +} + +""" +Updates an address of the logged-in user. +""" +type AccountAddressUpdate { + """ + A user object for which the address was edited. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! + address: Address +} + +""" +Remove user account. +""" +type AccountDelete { + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! + user: User +} + +type AccountError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: AccountErrorCode! + + """ + A type of address that causes the error. + """ + addressType: AddressTypeEnum +} + +""" +An enumeration. +""" +enum AccountErrorCode { + ACTIVATE_OWN_ACCOUNT + ACTIVATE_SUPERUSER_ACCOUNT + DUPLICATED_INPUT_ITEM + DEACTIVATE_OWN_ACCOUNT + DEACTIVATE_SUPERUSER_ACCOUNT + DELETE_NON_STAFF_USER + DELETE_OWN_ACCOUNT + DELETE_STAFF_ACCOUNT + DELETE_SUPERUSER_ACCOUNT + GRAPHQL_ERROR + INACTIVE + INVALID + INVALID_PASSWORD + LEFT_NOT_MANAGEABLE_PERMISSION + INVALID_CREDENTIALS + NOT_FOUND + OUT_OF_SCOPE_USER + OUT_OF_SCOPE_GROUP + OUT_OF_SCOPE_PERMISSION + PASSWORD_ENTIRELY_NUMERIC + PASSWORD_TOO_COMMON + PASSWORD_TOO_SHORT + PASSWORD_TOO_SIMILAR + REQUIRED + UNIQUE + JWT_SIGNATURE_EXPIRED + JWT_INVALID_TOKEN + JWT_DECODE_ERROR + JWT_MISSING_TOKEN + JWT_INVALID_CSRF_TOKEN + CHANNEL_INACTIVE + MISSING_CHANNEL_SLUG +} + +input AccountInput { + """ + Given name. + """ + firstName: String + + """ + Family name. + """ + lastName: String + + """ + Billing address of the customer. + """ + defaultBillingAddress: AddressInput + + """ + Shipping address of the customer. + """ + defaultShippingAddress: AddressInput + + """ + User language code. + """ + languageCode: LanguageCodeEnum +} + +""" +Register a new user. +""" +type AccountRegister { + """ + Informs whether users need to confirm their email address. + """ + requiresConfirmation: Boolean + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! + user: User +} + +input AccountRegisterInput { + """ + The email address of the user. + """ + email: String! + + """ + Password. + """ + password: String! + + """ + Base of frontend URL that will be needed to create confirmation URL. + """ + redirectUrl: String + + """ + User language code. + """ + languageCode: LanguageCodeEnum + + """ + User public metadata. + """ + metadata: [MetadataInput!] + + """ + Slug of a channel which will be used to notify users. Optional when only one channel exists. + """ + channel: String +} + +""" +Sends an email with the account removal link for the logged-in user. +""" +type AccountRequestDeletion { + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Sets a default address for the authenticated user. +""" +type AccountSetDefaultAddress { + """ + An updated user instance. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Updates the account of the logged-in user. +""" +type AccountUpdate { + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! + user: User +} + +""" +Represents user address data. +""" +type Address implements Node { + """ + The ID of the object. + """ + id: ID! + firstName: String! + lastName: String! + companyName: String! + streetAddress1: String! + streetAddress2: String! + city: String! + cityArea: String! + postalCode: String! + + """ + Shop's default country. + """ + country: CountryDisplay! + countryArea: String! + phone: String + + """ + Address is user's default shipping address. + """ + isDefaultShippingAddress: Boolean + + """ + Address is user's default billing address. + """ + isDefaultBillingAddress: Boolean +} + +""" +Creates user address. +""" +type AddressCreate { + """ + A user instance for which the address was created. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! + address: Address +} + +""" +Deletes an address. +""" +type AddressDelete { + """ + A user instance for which the address was deleted. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! + address: Address +} + +input AddressInput { + """ + Given name. + """ + firstName: String + + """ + Family name. + """ + lastName: String + + """ + Company or organization. + """ + companyName: String + + """ + Address. + """ + streetAddress1: String + + """ + Address. + """ + streetAddress2: String + + """ + City. + """ + city: String + + """ + District. + """ + cityArea: String + + """ + Postal code. + """ + postalCode: String + + """ + Country. + """ + country: CountryCode + + """ + State or province. + """ + countryArea: String + + """ + Phone number. + """ + phone: String +} + +""" +Sets a default address for the given user. +""" +type AddressSetDefault { + """ + An updated user instance. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +An enumeration. +""" +enum AddressTypeEnum { + BILLING + SHIPPING +} + +""" +Updates an address. +""" +type AddressUpdate { + """ + A user object for which the address was edited. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! + address: Address +} + +type AddressValidationData { + countryCode: String + countryName: String + addressFormat: String + addressLatinFormat: String + allowedFields: [String] + requiredFields: [String] + upperFields: [String] + countryAreaType: String + countryAreaChoices: [ChoiceValue] + cityType: String + cityChoices: [ChoiceValue] + cityAreaType: String + cityAreaChoices: [ChoiceValue] + postalCodeType: String + postalCodeMatchers: [String] + postalCodeExamples: [String] + postalCodePrefix: String +} + +""" +Represents allocation. +""" +type Allocation implements Node { + """ + The ID of the object. + """ + id: ID! + + """ + Quantity allocated for orders. + """ + quantity: Int! + + """ + The warehouse were items were allocated. + """ + warehouse: Warehouse! +} + +""" +Represents app data. +""" +type App implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + + """ + Name of the app. + """ + name: String + + """ + The date and time when the app was created. + """ + created: DateTime + + """ + Determine if app will be set active or not. + """ + isActive: Boolean + + """ + List of the app's permissions. + """ + permissions: [Permission] + + """ + Last 4 characters of the tokens. + """ + tokens: [AppToken] + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + Type of the app. + """ + type: AppTypeEnum + + """ + List of webhooks assigned to this app. + """ + webhooks: [Webhook] + + """ + Description of this app. + """ + aboutApp: String + + """ + Description of the data privacy defined for this app. + """ + dataPrivacy: String + + """ + Url to details about the privacy policy on the app owner page. + """ + dataPrivacyUrl: String + + """ + Homepage of the app. + """ + homepageUrl: String + + """ + Support page for the app. + """ + supportUrl: String + + """ + Url to iframe with the configuration for the app. + """ + configurationUrl: String + + """ + Url to iframe with the app. + """ + appUrl: String + + """ + Version number of the app. + """ + version: String + + """ + JWT token used to authenticate by thridparty app. + """ + accessToken: String +} + +""" +Activate the app. +""" +type AppActivate { + appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AppError!]! + app: App +} + +type AppCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [AppCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type AppCountableEdge { + """ + The item at the end of the edge. + """ + node: App! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new app. +""" +type AppCreate { + """ + The newly created authentication token. + """ + authToken: String + appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AppError!]! + app: App +} + +""" +Deactivate the app. +""" +type AppDeactivate { + appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AppError!]! + app: App +} + +""" +Deletes an app. +""" +type AppDelete { + appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AppError!]! + app: App +} + +""" +Delete failed installation. +""" +type AppDeleteFailedInstallation { + appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AppError!]! + appInstallation: AppInstallation +} + +type AppError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: AppErrorCode! + + """ + List of permissions which causes the error. + """ + permissions: [PermissionEnum!] +} + +""" +An enumeration. +""" +enum AppErrorCode { + FORBIDDEN + GRAPHQL_ERROR + INVALID + INVALID_STATUS + INVALID_PERMISSION + INVALID_URL_FORMAT + INVALID_MANIFEST_FORMAT + MANIFEST_URL_CANT_CONNECT + NOT_FOUND + REQUIRED + UNIQUE + OUT_OF_SCOPE_APP + OUT_OF_SCOPE_PERMISSION +} + +""" +Fetch and validate manifest. +""" +type AppFetchManifest { + manifest: Manifest + appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AppError!]! +} + +input AppFilterInput { + search: String + isActive: Boolean + type: AppTypeEnum +} + +input AppInput { + """ + Name of the app. + """ + name: String + + """ + List of permission code names to assign to this app. + """ + permissions: [PermissionEnum] +} + +""" +Install new app by using app manifest. +""" +type AppInstall { + appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AppError!]! + appInstallation: AppInstallation +} + +input AppInstallInput { + """ + Name of the app to install. + """ + appName: String + + """ + Url to app's manifest in JSON format. + """ + manifestUrl: String + + """ + Determine if app will be set active or not. + """ + activateAfterInstallation: Boolean = true + + """ + List of permission code names to assign to this app. + """ + permissions: [PermissionEnum] +} + +""" +Represents ongoing installation of app. +""" +type AppInstallation implements Node & Job { + appName: String! + manifestUrl: String! + + """ + The ID of the object. + """ + id: ID! + + """ + Job status. + """ + status: JobStatusEnum! + + """ + Created date time of job in ISO 8601 format. + """ + createdAt: DateTime! + + """ + Date time of job last update in ISO 8601 format. + """ + updatedAt: DateTime! + + """ + Job message. + """ + message: String +} + +""" +Retry failed installation of new app. +""" +type AppRetryInstall { + appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AppError!]! + appInstallation: AppInstallation +} + +enum AppSortField { + """ + Sort apps by name. + """ + NAME + + """ + Sort apps by creation date. + """ + CREATION_DATE +} + +input AppSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort apps by the selected field. + """ + field: AppSortField! +} + +""" +Represents token data. +""" +type AppToken implements Node { + """ + Name of the authenticated token. + """ + name: String + + """ + Last 4 characters of the token. + """ + authToken: String + + """ + The ID of the object. + """ + id: ID! +} + +""" +Creates a new token. +""" +type AppTokenCreate { + """ + The newly created authentication token. + """ + authToken: String + appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AppError!]! + appToken: AppToken +} + +""" +Deletes an authentication token assigned to app. +""" +type AppTokenDelete { + appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AppError!]! + appToken: AppToken +} + +input AppTokenInput { + """ + Name of the token. + """ + name: String + + """ + ID of app. + """ + app: ID! +} + +""" +Verify provided app token. +""" +type AppTokenVerify { + """ + Determine if token is valid or not. + """ + valid: Boolean! + appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AppError!]! +} + +""" +Enum determining type of your App. +""" +enum AppTypeEnum { + """ + Local Saleor App. The app is fully manageable from dashboard. You can change assigned permissions, add webhooks, or authentication token + """ + LOCAL + + """ + Third party external App. Installation is fully automated. Saleor uses a defined App manifest to gather all required information. + """ + THIRDPARTY +} + +""" +Updates an existing app. +""" +type AppUpdate { + appErrors: [AppError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AppError!]! + app: App +} + +""" +An enumeration. +""" +enum AreaUnitsEnum { + SQ_CM + SQ_M + SQ_KM + SQ_FT + SQ_YD + SQ_INCH +} + +""" +Assigns storefront's navigation menus. +""" +type AssignNavigation { + """ + Assigned navigation menu. + """ + menu: Menu + menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MenuError!]! +} + +""" +Custom attribute of a product. Attributes can be assigned to products and variants at the product type level. +""" +type Attribute implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + productTypes(before: String, after: String, first: Int, last: Int): ProductTypeCountableConnection! + productVariantTypes(before: String, after: String, first: Int, last: Int): ProductTypeCountableConnection! + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + The input type to use for entering attribute values in the dashboard. + """ + inputType: AttributeInputTypeEnum + + """ + The entity type which can be used as a reference. + """ + entityType: AttributeEntityTypeEnum + + """ + Name of an attribute displayed in the interface. + """ + name: String + + """ + Internal representation of an attribute name. + """ + slug: String + + """ + The attribute type. + """ + type: AttributeTypeEnum + + """ + The unit of attribute values. + """ + unit: MeasurementUnitsEnum + + """ + List of attribute's values. + """ + values: [AttributeValue] + + """ + Whether the attribute requires values to be passed or not. + """ + valueRequired: Boolean! + + """ + Whether the attribute should be visible or not in storefront. + """ + visibleInStorefront: Boolean! + + """ + Whether the attribute can be filtered in storefront. + """ + filterableInStorefront: Boolean! + + """ + Whether the attribute can be filtered in dashboard. + """ + filterableInDashboard: Boolean! + + """ + Whether the attribute can be displayed in the admin product list. + """ + availableInGrid: Boolean! + + """ + Returns translated attribute fields for the given language code. + """ + translation( + """ + A language code to return the translation for attribute. + """ + languageCode: LanguageCodeEnum! + ): AttributeTranslation + + """ + The position of the attribute in the storefront navigation (0 by default). + """ + storefrontSearchPosition: Int! +} + +""" +Deletes attributes. +""" +type AttributeBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + attributeErrors: [AttributeError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AttributeError!]! +} + +type AttributeCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [AttributeCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type AttributeCountableEdge { + """ + The item at the end of the edge. + """ + node: Attribute! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates an attribute. +""" +type AttributeCreate { + attribute: Attribute + attributeErrors: [AttributeError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AttributeError!]! +} + +input AttributeCreateInput { + """ + The input type to use for entering attribute values in the dashboard. + """ + inputType: AttributeInputTypeEnum + + """ + The entity type which can be used as a reference. + """ + entityType: AttributeEntityTypeEnum + + """ + Name of an attribute displayed in the interface. + """ + name: String! + + """ + Internal representation of an attribute name. + """ + slug: String + + """ + The attribute type. + """ + type: AttributeTypeEnum! + + """ + The unit of attribute values. + """ + unit: MeasurementUnitsEnum + + """ + List of attribute's values. + """ + values: [AttributeValueCreateInput] + + """ + Whether the attribute requires values to be passed or not. + """ + valueRequired: Boolean + + """ + Whether the attribute is for variants only. + """ + isVariantOnly: Boolean + + """ + Whether the attribute should be visible or not in storefront. + """ + visibleInStorefront: Boolean + + """ + Whether the attribute can be filtered in storefront. + """ + filterableInStorefront: Boolean + + """ + Whether the attribute can be filtered in dashboard. + """ + filterableInDashboard: Boolean + + """ + The position of the attribute in the storefront navigation (0 by default). + """ + storefrontSearchPosition: Int + + """ + Whether the attribute can be displayed in the admin product list. + """ + availableInGrid: Boolean +} + +""" +Deletes an attribute. +""" +type AttributeDelete { + attributeErrors: [AttributeError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AttributeError!]! + attribute: Attribute +} + +""" +An enumeration. +""" +enum AttributeEntityTypeEnum { + PAGE + PRODUCT +} + +type AttributeError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: AttributeErrorCode! +} + +""" +An enumeration. +""" +enum AttributeErrorCode { + ALREADY_EXISTS + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE +} + +input AttributeFilterInput { + valueRequired: Boolean + isVariantOnly: Boolean + visibleInStorefront: Boolean + filterableInStorefront: Boolean + filterableInDashboard: Boolean + availableInGrid: Boolean + metadata: [MetadataInput] + search: String + ids: [ID] + type: AttributeTypeEnum + inCollection: ID + inCategory: ID + + """ + Specifies the channel by which the data should be sorted. + """ + channel: String +} + +input AttributeInput { + """ + Internal representation of an attribute name. + """ + slug: String! + + """ + Internal representation of a value (unique per attribute). + """ + values: [String] + + """ + The range that the returned values should be in. + """ + valuesRange: IntRangeInput +} + +""" +An enumeration. +""" +enum AttributeInputTypeEnum { + DROPDOWN + MULTISELECT + FILE + REFERENCE + NUMERIC + RICH_TEXT +} + +""" +Reorder the values of an attribute. +""" +type AttributeReorderValues { + """ + Attribute from which values are reordered. + """ + attribute: Attribute + attributeErrors: [AttributeError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AttributeError!]! +} + +enum AttributeSortField { + """ + Sort attributes by name + """ + NAME + + """ + Sort attributes by slug + """ + SLUG + + """ + Sort attributes by the value required flag + """ + VALUE_REQUIRED + + """ + Sort attributes by the variant only flag + """ + IS_VARIANT_ONLY + + """ + Sort attributes by visibility in the storefront + """ + VISIBLE_IN_STOREFRONT + + """ + Sort attributes by the filterable in storefront flag + """ + FILTERABLE_IN_STOREFRONT + + """ + Sort attributes by the filterable in dashboard flag + """ + FILTERABLE_IN_DASHBOARD + + """ + Sort attributes by their position in storefront + """ + STOREFRONT_SEARCH_POSITION + + """ + Sort attributes based on whether they can be displayed or not in a product grid. + """ + AVAILABLE_IN_GRID +} + +input AttributeSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort attributes by the selected field. + """ + field: AttributeSortField! +} + +type AttributeTranslatableContent implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + + """ + Returns translated attribute fields for the given language code. + """ + translation( + """ + A language code to return the translation for attribute. + """ + languageCode: LanguageCodeEnum! + ): AttributeTranslation + + """ + Custom attribute of a product. + """ + attribute: Attribute +} + +""" +Creates/Updates translations for attribute. +""" +type AttributeTranslate { + translationErrors: [TranslationError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [TranslationError!]! + attribute: Attribute +} + +type AttributeTranslation implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + + """ + Translation language. + """ + language: LanguageDisplay! +} + +""" +An enumeration. +""" +enum AttributeTypeEnum { + PRODUCT_TYPE + PAGE_TYPE +} + +""" +Updates attribute. +""" +type AttributeUpdate { + attribute: Attribute + attributeErrors: [AttributeError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AttributeError!]! +} + +input AttributeUpdateInput { + """ + Name of an attribute displayed in the interface. + """ + name: String + + """ + Internal representation of an attribute name. + """ + slug: String + + """ + The unit of attribute values. + """ + unit: MeasurementUnitsEnum + + """ + IDs of values to be removed from this attribute. + """ + removeValues: [ID] + + """ + New values to be created for this attribute. + """ + addValues: [AttributeValueCreateInput] + + """ + Whether the attribute requires values to be passed or not. + """ + valueRequired: Boolean + + """ + Whether the attribute is for variants only. + """ + isVariantOnly: Boolean + + """ + Whether the attribute should be visible or not in storefront. + """ + visibleInStorefront: Boolean + + """ + Whether the attribute can be filtered in storefront. + """ + filterableInStorefront: Boolean + + """ + Whether the attribute can be filtered in dashboard. + """ + filterableInDashboard: Boolean + + """ + The position of the attribute in the storefront navigation (0 by default). + """ + storefrontSearchPosition: Int + + """ + Whether the attribute can be displayed in the admin product list. + """ + availableInGrid: Boolean +} + +""" +Represents a value of an attribute. +""" +type AttributeValue implements Node { + """ + The ID of the object. + """ + id: ID! + + """ + Name of a value displayed in the interface. + """ + name: String + + """ + Internal representation of a value (unique per attribute). + """ + slug: String + + """ + Represents the value of the attribute value. + """ + value: String + + """ + Returns translated attribute value fields for the given language code. + """ + translation( + """ + A language code to return the translation for attribute value. + """ + languageCode: LanguageCodeEnum! + ): AttributeValueTranslation + + """ + The input type to use for entering attribute values in the dashboard. + """ + inputType: AttributeInputTypeEnum + + """ + The ID of the attribute reference. + """ + reference: ID + + """ + Represents file URL and content type (if attribute value is a file). + """ + file: File + + """ + Represents the text (JSON) of the attribute value. + """ + richText: JSONString +} + +""" +Deletes values of attributes. +""" +type AttributeValueBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + attributeErrors: [AttributeError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AttributeError!]! +} + +""" +Creates a value for an attribute. +""" +type AttributeValueCreate { + """ + The updated attribute. + """ + attribute: Attribute + attributeErrors: [AttributeError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AttributeError!]! + attributeValue: AttributeValue +} + +input AttributeValueCreateInput { + """ + Name of a value displayed in the interface. + """ + name: String! + + """ + Represents the value of the attribute value. + """ + value: String + + """ + Represents the text (JSON) of the attribute value. + """ + richText: JSONString +} + +""" +Deletes a value of an attribute. +""" +type AttributeValueDelete { + """ + The updated attribute. + """ + attribute: Attribute + attributeErrors: [AttributeError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AttributeError!]! + attributeValue: AttributeValue +} + +input AttributeValueInput { + """ + ID of the selected attribute. + """ + id: ID + + """ + The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. + """ + values: [String] + + """ + URL of the file attribute. Every time, a new value is created. + """ + file: String + + """ + File content type. + """ + contentType: String + + """ + List of entity IDs that will be used as references. + """ + references: [ID!] + + """ + Text content in JSON format. + """ + richText: JSONString +} + +type AttributeValueTranslatableContent implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + + """ + Returns translated attribute value fields for the given language code. + """ + translation( + """ + A language code to return the translation for attribute value. + """ + languageCode: LanguageCodeEnum! + ): AttributeValueTranslation + + """ + Represents a value of an attribute. + """ + attributeValue: AttributeValue +} + +""" +Creates/Updates translations for attribute value. +""" +type AttributeValueTranslate { + translationErrors: [TranslationError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [TranslationError!]! + attributeValue: AttributeValue +} + +type AttributeValueTranslation implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + richText: JSONString + + """ + Translation language. + """ + language: LanguageDisplay! +} + +input AttributeValueTranslationInput { + name: String + richText: JSONString +} + +""" +Updates value of an attribute. +""" +type AttributeValueUpdate { + """ + The updated attribute. + """ + attribute: Attribute + attributeErrors: [AttributeError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AttributeError!]! + attributeValue: AttributeValue +} + +input BulkAttributeValueInput { + """ + ID of the selected attribute. + """ + id: ID + + """ + The value or slug of an attribute to resolve. If the passed value is non-existent, it will be created. + """ + values: [String]! +} + +type BulkProductError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: ProductErrorCode! + + """ + List of attributes IDs which causes the error. + """ + attributes: [ID!] + + """ + List of attribute values IDs which causes the error. + """ + values: [ID!] + + """ + Index of an input list item that caused the error. + """ + index: Int + + """ + List of warehouse IDs which causes the error. + """ + warehouses: [ID!] + + """ + List of channel IDs which causes the error. + """ + channels: [ID!] +} + +type BulkStockError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: ProductErrorCode! + + """ + List of attributes IDs which causes the error. + """ + attributes: [ID!] + + """ + List of attribute values IDs which causes the error. + """ + values: [ID!] + + """ + Index of an input list item that caused the error. + """ + index: Int +} + +input CatalogueInput { + """ + Products related to the discount. + """ + products: [ID] + + """ + Categories related to the discount. + """ + categories: [ID] + + """ + Collections related to the discount. + """ + collections: [ID] +} + +""" +Represents a single category of products. Categories allow to organize products in a tree-hierarchies which can be used for navigation in the storefront. +""" +type Category implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + seoTitle: String + seoDescription: String + name: String! + description: JSONString + slug: String! + parent: Category + level: Int! + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + Description of the category (JSON). + """ + descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.") + + """ + List of ancestors of the category. + """ + ancestors( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): CategoryCountableConnection + + """ + List of products in the category. + """ + products( + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): ProductCountableConnection + + """ + List of children of the category. + """ + children( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): CategoryCountableConnection + backgroundImage( + """ + Size of the image. + """ + size: Int + ): Image + + """ + Returns translated category fields for the given language code. + """ + translation( + """ + A language code to return the translation for category. + """ + languageCode: LanguageCodeEnum! + ): CategoryTranslation +} + +""" +Deletes categories. +""" +type CategoryBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +type CategoryCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [CategoryCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type CategoryCountableEdge { + """ + The item at the end of the edge. + """ + node: Category! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new category. +""" +type CategoryCreate { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + category: Category +} + +""" +Deletes a category. +""" +type CategoryDelete { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + category: Category +} + +input CategoryFilterInput { + search: String + metadata: [MetadataInput] + ids: [ID] +} + +input CategoryInput { + """ + Category description (JSON). + """ + description: JSONString + + """ + Category name. + """ + name: String + + """ + Category slug. + """ + slug: String + + """ + Search engine optimization fields. + """ + seo: SeoInput + + """ + Background image file. + """ + backgroundImage: Upload + + """ + Alt text for a product media. + """ + backgroundImageAlt: String +} + +enum CategorySortField { + """ + Sort categories by name. + """ + NAME + + """ + Sort categories by product count. + """ + PRODUCT_COUNT + + """ + Sort categories by subcategory count. + """ + SUBCATEGORY_COUNT +} + +input CategorySortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Specifies the channel in which to sort the data. + """ + channel: String + + """ + Sort categories by the selected field. + """ + field: CategorySortField! +} + +type CategoryTranslatableContent implements Node { + """ + The ID of the object. + """ + id: ID! + seoTitle: String + seoDescription: String + name: String! + description: JSONString + + """ + Description of the category (JSON). + """ + descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.") + + """ + Returns translated category fields for the given language code. + """ + translation( + """ + A language code to return the translation for category. + """ + languageCode: LanguageCodeEnum! + ): CategoryTranslation + + """ + Represents a single category of products. + """ + category: Category +} + +""" +Creates/Updates translations for Category. +""" +type CategoryTranslate { + translationErrors: [TranslationError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [TranslationError!]! + category: Category +} + +type CategoryTranslation implements Node { + """ + The ID of the object. + """ + id: ID! + seoTitle: String + seoDescription: String + name: String! + description: JSONString + + """ + Translation language. + """ + language: LanguageDisplay! + + """ + Translated description of the product (JSON). + """ + descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.") +} + +""" +Updates a category. +""" +type CategoryUpdate { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + category: Category +} + +""" +Represents channel. +""" +type Channel implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + isActive: Boolean! + slug: String! + currencyCode: String! + + """ + Whether a channel has associated orders. + """ + hasOrders: Boolean! +} + +""" +Activate a channel. +""" +type ChannelActivate { + """ + Activated channel. + """ + channel: Channel + channelErrors: [ChannelError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ChannelError!]! +} + +""" +Creates new channel. +""" +type ChannelCreate { + channelErrors: [ChannelError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ChannelError!]! + channel: Channel +} + +input ChannelCreateInput { + """ + isActive flag. + """ + isActive: Boolean + + """ + Name of the channel. + """ + name: String! + + """ + Slug of the channel. + """ + slug: String! + + """ + Currency of the channel. + """ + currencyCode: String! + + """ + List of shipping zones to assign to the channel. + """ + addShippingZones: [ID!] +} + +""" +Deactivate a channel. +""" +type ChannelDeactivate { + """ + Deactivated channel. + """ + channel: Channel + channelErrors: [ChannelError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ChannelError!]! +} + +""" +Delete a channel. Orders associated with the deleted channel will be moved to the target channel. Checkouts, product availability, and pricing will be removed. +""" +type ChannelDelete { + channelErrors: [ChannelError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ChannelError!]! + channel: Channel +} + +input ChannelDeleteInput { + """ + ID of channel to migrate orders from origin channel. + """ + targetChannel: ID! +} + +type ChannelError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: ChannelErrorCode! + + """ + List of shipping zone IDs which causes the error. + """ + shippingZones: [ID!] +} + +""" +An enumeration. +""" +enum ChannelErrorCode { + ALREADY_EXISTS + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE + CHANNEL_TARGET_ID_MUST_BE_DIFFERENT + CHANNELS_CURRENCY_MUST_BE_THE_SAME + CHANNEL_WITH_ORDERS + DUPLICATED_INPUT_ITEM +} + +""" +Update a channel. +""" +type ChannelUpdate { + channelErrors: [ChannelError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ChannelError!]! + channel: Channel +} + +input ChannelUpdateInput { + """ + isActive flag. + """ + isActive: Boolean + + """ + Name of the channel. + """ + name: String + + """ + Slug of the channel. + """ + slug: String + + """ + List of shipping zones to assign to the channel. + """ + addShippingZones: [ID!] + + """ + List of shipping zones to unassign from the channel. + """ + removeShippingZones: [ID!] +} + +""" +Checkout object. +""" +type Checkout implements Node & ObjectWithMetadata { + created: DateTime! + lastChange: DateTime! + user: User + channel: Channel! + billingAddress: Address + shippingAddress: Address + note: String! + discount: Money + discountName: String + translatedDiscountName: String + voucherCode: String + + """ + List of gift cards associated with this checkout. + """ + giftCards: [GiftCard] + + """ + The ID of the object. + """ + id: ID! + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + Shipping methods that can be used with this order. + """ + availableShippingMethods: [ShippingMethod]! + + """ + List of available payment gateways. + """ + availablePaymentGateways: [PaymentGateway!]! + + """ + Email of a customer. + """ + email: String! + + """ + Returns True, if checkout requires shipping. + """ + isShippingRequired: Boolean! + + """ + The number of items purchased. + """ + quantity: Int! + + """ + A list of checkout lines, each containing information about an item in the checkout. + """ + lines: [CheckoutLine] + + """ + The price of the shipping, with all the taxes included. + """ + shippingPrice: TaxedMoney + + """ + The shipping method related with checkout. + """ + shippingMethod: ShippingMethod + + """ + The price of the checkout before shipping, with taxes included. + """ + subtotalPrice: TaxedMoney + + """ + The checkout's token. + """ + token: UUID! + + """ + The sum of the the checkout line prices, with all the taxes,shipping costs, and discounts included. + """ + totalPrice: TaxedMoney + + """ + Checkout language code. + """ + languageCode: LanguageCodeEnum! +} + +""" +Adds a gift card or a voucher to a checkout. +""" +type CheckoutAddPromoCode { + """ + The checkout with the added gift card or voucher. + """ + checkout: Checkout + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +""" +Update billing address in the existing checkout. +""" +type CheckoutBillingAddressUpdate { + """ + An updated checkout. + """ + checkout: Checkout + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +""" +Completes the checkout. As a result a new order is created and a payment charge is made. This action requires a successful payment before it can be performed. In case additional confirmation step as 3D secure is required confirmationNeeded flag will be set to True and no order created until payment is confirmed with second call of this mutation. +""" +type CheckoutComplete { + """ + Placed order. + """ + order: Order + + """ + Set to true if payment needs to be confirmed before checkout is complete. + """ + confirmationNeeded: Boolean! + + """ + Confirmation data used to process additional authorization steps. + """ + confirmationData: JSONString + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +type CheckoutCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [CheckoutCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type CheckoutCountableEdge { + """ + The item at the end of the edge. + """ + node: Checkout! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Create a new checkout. +""" +type CheckoutCreate { + """ + Whether the checkout was created or the current active one was returned. Refer to checkoutLinesAdd and checkoutLinesUpdate to merge a cart with an active checkout.DEPRECATED: Will be removed in Saleor 4.0. Always returns True. + """ + created: Boolean + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! + checkout: Checkout +} + +input CheckoutCreateInput { + """ + Slug of a channel in which to create a checkout. + """ + channel: String + + """ + A list of checkout lines, each containing information about an item in the checkout. + """ + lines: [CheckoutLineInput]! + + """ + The customer's email address. + """ + email: String + + """ + The mailing address to where the checkout will be shipped. Note: the address will be ignored if the checkout doesn't contain shippable items. + """ + shippingAddress: AddressInput + + """ + Billing address of the customer. + """ + billingAddress: AddressInput + + """ + Checkout language code. + """ + languageCode: LanguageCodeEnum +} + +""" +Sets the customer as the owner of the checkout. +""" +type CheckoutCustomerAttach { + """ + An updated checkout. + """ + checkout: Checkout + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +""" +Removes the user assigned as the owner of the checkout. +""" +type CheckoutCustomerDetach { + """ + An updated checkout. + """ + checkout: Checkout + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +""" +Updates email address in the existing checkout object. +""" +type CheckoutEmailUpdate { + """ + An updated checkout. + """ + checkout: Checkout + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +type CheckoutError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: CheckoutErrorCode! + + """ + List of varint IDs which causes the error. + """ + variants: [ID!] + + """ + A type of address that causes the error. + """ + addressType: AddressTypeEnum +} + +""" +An enumeration. +""" +enum CheckoutErrorCode { + BILLING_ADDRESS_NOT_SET + CHECKOUT_NOT_FULLY_PAID + GRAPHQL_ERROR + PRODUCT_NOT_PUBLISHED + PRODUCT_UNAVAILABLE_FOR_PURCHASE + INSUFFICIENT_STOCK + INVALID + INVALID_SHIPPING_METHOD + NOT_FOUND + PAYMENT_ERROR + QUANTITY_GREATER_THAN_LIMIT + REQUIRED + SHIPPING_ADDRESS_NOT_SET + SHIPPING_METHOD_NOT_APPLICABLE + SHIPPING_METHOD_NOT_SET + SHIPPING_NOT_REQUIRED + TAX_ERROR + UNIQUE + VOUCHER_NOT_APPLICABLE + ZERO_QUANTITY + MISSING_CHANNEL_SLUG + CHANNEL_INACTIVE + UNAVAILABLE_VARIANT_IN_CHANNEL +} + +""" +Update language code in the existing checkout. +""" +type CheckoutLanguageCodeUpdate { + """ + An updated checkout. + """ + checkout: Checkout + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +""" +Represents an item in the checkout. +""" +type CheckoutLine implements Node { + """ + The ID of the object. + """ + id: ID! + variant: ProductVariant! + quantity: Int! + + """ + The sum of the checkout line price, taxes and discounts. + """ + totalPrice: TaxedMoney + + """ + Indicates whether the item need to be delivered. + """ + requiresShipping: Boolean +} + +type CheckoutLineCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [CheckoutLineCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type CheckoutLineCountableEdge { + """ + The item at the end of the edge. + """ + node: CheckoutLine! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Deletes a CheckoutLine. +""" +type CheckoutLineDelete { + """ + An updated checkout. + """ + checkout: Checkout + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +input CheckoutLineInput { + """ + The number of items purchased. + """ + quantity: Int! + + """ + ID of the product variant. + """ + variantId: ID! +} + +""" +Adds a checkout line to the existing checkout. +""" +type CheckoutLinesAdd { + """ + An updated checkout. + """ + checkout: Checkout + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +""" +Updates checkout line in the existing checkout. +""" +type CheckoutLinesUpdate { + """ + An updated checkout. + """ + checkout: Checkout + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +""" +Create a new payment for given checkout. +""" +type CheckoutPaymentCreate { + """ + Related checkout object. + """ + checkout: Checkout + + """ + A newly created payment. + """ + payment: Payment + paymentErrors: [PaymentError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PaymentError!]! +} + +""" +Remove a gift card or a voucher from a checkout. +""" +type CheckoutRemovePromoCode { + """ + The checkout with the removed gift card or voucher. + """ + checkout: Checkout + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +""" +Update shipping address in the existing checkout. +""" +type CheckoutShippingAddressUpdate { + """ + An updated checkout. + """ + checkout: Checkout + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +""" +Updates the shipping address of the checkout. +""" +type CheckoutShippingMethodUpdate { + """ + An updated checkout. + """ + checkout: Checkout + checkoutErrors: [CheckoutError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CheckoutError!]! +} + +type ChoiceValue { + raw: String + verbose: String +} + +""" +Represents a collection of products. +""" +type Collection implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + seoTitle: String + seoDescription: String + name: String! + description: JSONString + slug: String! + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + Description of the collection (JSON). + """ + descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.") + + """ + List of products in this collection. + """ + products( + """ + Filtering options for products. + """ + filter: ProductFilterInput + + """ + Sort products. + """ + sortBy: ProductOrder + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): ProductCountableConnection + backgroundImage( + """ + Size of the image. + """ + size: Int + ): Image + + """ + Returns translated collection fields for the given language code. + """ + translation( + """ + A language code to return the translation for collection. + """ + languageCode: LanguageCodeEnum! + ): CollectionTranslation + + """ + List of channels in which the collection is available. + """ + channelListings: [CollectionChannelListing!] +} + +""" +Adds products to a collection. +""" +type CollectionAddProducts { + """ + Collection to which products will be added. + """ + collection: Collection + collectionErrors: [CollectionError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CollectionError!]! +} + +""" +Deletes collections. +""" +type CollectionBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + collectionErrors: [CollectionError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CollectionError!]! +} + +""" +Represents collection channel listing. +""" +type CollectionChannelListing implements Node { + """ + The ID of the object. + """ + id: ID! + publicationDate: Date + isPublished: Boolean! + channel: Channel! +} + +type CollectionChannelListingError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: ProductErrorCode! + + """ + List of attributes IDs which causes the error. + """ + attributes: [ID!] + + """ + List of attribute values IDs which causes the error. + """ + values: [ID!] + + """ + List of channels IDs which causes the error. + """ + channels: [ID!] +} + +""" +Manage collection's availability in channels. +""" +type CollectionChannelListingUpdate { + """ + An updated collection instance. + """ + collection: Collection + collectionChannelListingErrors: [CollectionChannelListingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CollectionChannelListingError!]! +} + +input CollectionChannelListingUpdateInput { + """ + List of channels to which the collection should be assigned. + """ + addChannels: [PublishableChannelListingInput!] + + """ + List of channels from which the collection should be unassigned. + """ + removeChannels: [ID!] +} + +type CollectionCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [CollectionCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type CollectionCountableEdge { + """ + The item at the end of the edge. + """ + node: Collection! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new collection. +""" +type CollectionCreate { + collectionErrors: [CollectionError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CollectionError!]! + collection: Collection +} + +input CollectionCreateInput { + """ + Informs whether a collection is published. + """ + isPublished: Boolean + + """ + Name of the collection. + """ + name: String + + """ + Slug of the collection. + """ + slug: String + + """ + Description of the collection (JSON). + """ + description: JSONString + + """ + Background image file. + """ + backgroundImage: Upload + + """ + Alt text for an image. + """ + backgroundImageAlt: String + + """ + Search engine optimization fields. + """ + seo: SeoInput + + """ + Publication date. ISO 8601 standard. + """ + publicationDate: Date + + """ + List of products to be added to the collection. + """ + products: [ID] +} + +""" +Deletes a collection. +""" +type CollectionDelete { + collectionErrors: [CollectionError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CollectionError!]! + collection: Collection +} + +type CollectionError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + List of products IDs which causes the error. + """ + products: [ID!] + + """ + The error code. + """ + code: CollectionErrorCode! +} + +""" +An enumeration. +""" +enum CollectionErrorCode { + DUPLICATED_INPUT_ITEM + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE + CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT +} + +input CollectionFilterInput { + published: CollectionPublished + search: String + metadata: [MetadataInput] + ids: [ID] + + """ + Specifies the channel by which the data should be sorted. + """ + channel: String +} + +input CollectionInput { + """ + Informs whether a collection is published. + """ + isPublished: Boolean + + """ + Name of the collection. + """ + name: String + + """ + Slug of the collection. + """ + slug: String + + """ + Description of the collection (JSON). + """ + description: JSONString + + """ + Background image file. + """ + backgroundImage: Upload + + """ + Alt text for an image. + """ + backgroundImageAlt: String + + """ + Search engine optimization fields. + """ + seo: SeoInput + + """ + Publication date. ISO 8601 standard. + """ + publicationDate: Date +} + +enum CollectionPublished { + PUBLISHED + HIDDEN +} + +""" +Remove products from a collection. +""" +type CollectionRemoveProducts { + """ + Collection from which products will be removed. + """ + collection: Collection + collectionErrors: [CollectionError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CollectionError!]! +} + +""" +Reorder the products of a collection. +""" +type CollectionReorderProducts { + """ + Collection from which products are reordered. + """ + collection: Collection + collectionErrors: [CollectionError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CollectionError!]! +} + +enum CollectionSortField { + """ + Sort collections by name. + """ + NAME + + """ + Sort collections by availability. + """ + AVAILABILITY + + """ + Sort collections by product count. + """ + PRODUCT_COUNT + + """ + Sort collections by publication date. + """ + PUBLICATION_DATE +} + +input CollectionSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Specifies the channel in which to sort the data. + """ + channel: String + + """ + Sort collections by the selected field. + """ + field: CollectionSortField! +} + +type CollectionTranslatableContent implements Node { + """ + The ID of the object. + """ + id: ID! + seoTitle: String + seoDescription: String + name: String! + description: JSONString + + """ + Description of the collection (JSON). + """ + descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.") + + """ + Returns translated collection fields for the given language code. + """ + translation( + """ + A language code to return the translation for collection. + """ + languageCode: LanguageCodeEnum! + ): CollectionTranslation + + """ + Represents a collection of products. + """ + collection: Collection +} + +""" +Creates/Updates translations for collection. +""" +type CollectionTranslate { + translationErrors: [TranslationError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [TranslationError!]! + collection: Collection +} + +type CollectionTranslation implements Node { + """ + The ID of the object. + """ + id: ID! + seoTitle: String + seoDescription: String + name: String! + description: JSONString + + """ + Translation language. + """ + language: LanguageDisplay! + + """ + Translated description of the product (JSON). + """ + descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.") +} + +""" +Updates a collection. +""" +type CollectionUpdate { + collectionErrors: [CollectionError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [CollectionError!]! + collection: Collection +} + +""" +Stores information about a single configuration field. +""" +type ConfigurationItem { + """ + Name of the field. + """ + name: String! + + """ + Current value of the field. + """ + value: String + + """ + Type of the field. + """ + type: ConfigurationTypeFieldEnum + + """ + Help text for the field. + """ + helpText: String + + """ + Label for the field. + """ + label: String +} + +input ConfigurationItemInput { + """ + Name of the field to update. + """ + name: String! + + """ + Value of the given field to update. + """ + value: String +} + +""" +An enumeration. +""" +enum ConfigurationTypeFieldEnum { + STRING + MULTILINE + BOOLEAN + SECRET + PASSWORD + SECRETMULTILINE + OUTPUT +} + +""" +Confirm user account with token sent by email during registration. +""" +type ConfirmAccount { + """ + An activated user account. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Confirm the email change of the logged-in user. +""" +type ConfirmEmailChange { + """ + A user instance with a new email. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +An enumeration. +""" +enum CountryCode { + AF + AX + AL + DZ + AS + AD + AO + AI + AQ + AG + AR + AM + AW + AU + AT + AZ + BS + BH + BD + BB + BY + BE + BZ + BJ + BM + BT + BO + BQ + BA + BW + BV + BR + IO + BN + BG + BF + BI + CV + KH + CM + CA + KY + CF + TD + CL + CN + CX + CC + CO + KM + CG + CD + CK + CR + CI + HR + CU + CW + CY + CZ + DK + DJ + DM + DO + EC + EG + SV + GQ + ER + EE + SZ + ET + EU + FK + FO + FJ + FI + FR + GF + PF + TF + GA + GM + GE + DE + GH + GI + GR + GL + GD + GP + GU + GT + GG + GN + GW + GY + HT + HM + VA + HN + HK + HU + IS + IN + ID + IR + IQ + IE + IM + IL + IT + JM + JP + JE + JO + KZ + KE + KI + KW + KG + LA + LV + LB + LS + LR + LY + LI + LT + LU + MO + MG + MW + MY + MV + ML + MT + MH + MQ + MR + MU + YT + MX + FM + MD + MC + MN + ME + MS + MA + MZ + MM + NA + NR + NP + NL + NC + NZ + NI + NE + NG + NU + NF + KP + MK + MP + NO + OM + PK + PW + PS + PA + PG + PY + PE + PH + PN + PL + PT + PR + QA + RE + RO + RU + RW + BL + SH + KN + LC + MF + PM + VC + WS + SM + ST + SA + SN + RS + SC + SL + SG + SX + SK + SI + SB + SO + ZA + GS + KR + SS + ES + LK + SD + SR + SJ + SE + CH + SY + TW + TJ + TZ + TH + TL + TG + TK + TO + TT + TN + TR + TM + TC + TV + UG + UA + AE + GB + UM + US + UY + UZ + VU + VE + VN + VG + VI + WF + EH + YE + ZM + ZW +} + +type CountryDisplay { + """ + Country code. + """ + code: String! + + """ + Country name. + """ + country: String! + + """ + Country tax. + """ + vat: VAT +} + +""" +Create JWT token. +""" +type CreateToken { + """ + JWT token, required to authenticate. + """ + token: String + + """ + JWT refresh token, required to re-generate access token. + """ + refreshToken: String + + """ + CSRF token required to re-generate access token. + """ + csrfToken: String + + """ + A user instance. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +type CreditCard { + """ + Card brand. + """ + brand: String! + + """ + First 4 digits of the card number. + """ + firstDigits: String + + """ + Last 4 digits of the card number. + """ + lastDigits: String! + + """ + Two-digit number representing the card’s expiration month. + """ + expMonth: Int + + """ + Four-digit number representing the card’s expiration year. + """ + expYear: Int +} + +""" +Deletes customers. +""" +type CustomerBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Creates a new customer. +""" +type CustomerCreate { + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! + user: User +} + +""" +Deletes a customer. +""" +type CustomerDelete { + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! + user: User +} + +""" +History log of the customer. +""" +type CustomerEvent implements Node { + """ + The ID of the object. + """ + id: ID! + + """ + Date when event happened at in ISO 8601 format. + """ + date: DateTime + + """ + Customer event type. + """ + type: CustomerEventsEnum + + """ + User who performed the action. + """ + user: User + + """ + Content of the event. + """ + message: String + + """ + Number of objects concerned by the event. + """ + count: Int + + """ + The concerned order. + """ + order: Order + + """ + The concerned order line. + """ + orderLine: OrderLine +} + +""" +An enumeration. +""" +enum CustomerEventsEnum { + ACCOUNT_CREATED + PASSWORD_RESET_LINK_SENT + PASSWORD_RESET + EMAIL_CHANGED_REQUEST + PASSWORD_CHANGED + EMAIL_CHANGED + PLACED_ORDER + NOTE_ADDED_TO_ORDER + DIGITAL_LINK_DOWNLOADED + CUSTOMER_DELETED + NAME_ASSIGNED + EMAIL_ASSIGNED + NOTE_ADDED +} + +input CustomerFilterInput { + dateJoined: DateRangeInput + numberOfOrders: IntRangeInput + placedOrders: DateRangeInput + search: String +} + +input CustomerInput { + """ + Billing address of the customer. + """ + defaultBillingAddress: AddressInput + + """ + Shipping address of the customer. + """ + defaultShippingAddress: AddressInput + + """ + Given name. + """ + firstName: String + + """ + Family name. + """ + lastName: String + + """ + The unique email address of the user. + """ + email: String + + """ + User account is active. + """ + isActive: Boolean + + """ + A note about the user. + """ + note: String + + """ + User language code. + """ + languageCode: LanguageCodeEnum +} + +""" +Updates an existing customer. +""" +type CustomerUpdate { + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! + user: User +} + +""" +The `Date` scalar type represents a Date +value as specified by +[iso8601](https://en.wikipedia.org/wiki/ISO_8601). +""" +scalar Date + +input DateRangeInput { + """ + Start date. + """ + gte: Date + + """ + End date. + """ + lte: Date +} + +""" +The `DateTime` scalar type represents a DateTime +value as specified by +[iso8601](https://en.wikipedia.org/wiki/ISO_8601). +""" +scalar DateTime + +input DateTimeRangeInput { + """ + Start date. + """ + gte: DateTime + + """ + End date. + """ + lte: DateTime +} + +""" +Deactivate all JWT tokens of the currently authenticated user. +""" +type DeactivateAllUserTokens { + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Delete metadata of an object. +""" +type DeleteMetadata { + metadataErrors: [MetadataError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MetadataError!]! + item: ObjectWithMetadata +} + +""" +Delete object's private metadata. +""" +type DeletePrivateMetadata { + metadataErrors: [MetadataError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MetadataError!]! + item: ObjectWithMetadata +} + +type DigitalContent implements Node & ObjectWithMetadata { + useDefaultSettings: Boolean! + automaticFulfillment: Boolean! + contentFile: String! + maxDownloads: Int + urlValidDays: Int + + """ + List of URLs for the digital variant. + """ + urls: [DigitalContentUrl] + + """ + The ID of the object. + """ + id: ID! + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + Product variant assigned to digital content. + """ + productVariant: ProductVariant! +} + +type DigitalContentCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [DigitalContentCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type DigitalContentCountableEdge { + """ + The item at the end of the edge. + """ + node: DigitalContent! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Create new digital content. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec +""" +type DigitalContentCreate { + variant: ProductVariant + content: DigitalContent + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +""" +Remove digital content assigned to given variant. +""" +type DigitalContentDelete { + variant: ProductVariant + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +input DigitalContentInput { + """ + Use default digital content settings for this product. + """ + useDefaultSettings: Boolean! + + """ + Determines how many times a download link can be accessed by a customer. + """ + maxDownloads: Int + + """ + Determines for how many days a download link is active since it was generated. + """ + urlValidDays: Int + + """ + Overwrite default automatic_fulfillment setting for variant. + """ + automaticFulfillment: Boolean +} + +""" +Update digital content. +""" +type DigitalContentUpdate { + variant: ProductVariant + content: DigitalContent + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +input DigitalContentUploadInput { + """ + Use default digital content settings for this product. + """ + useDefaultSettings: Boolean! + + """ + Determines how many times a download link can be accessed by a customer. + """ + maxDownloads: Int + + """ + Determines for how many days a download link is active since it was generated. + """ + urlValidDays: Int + + """ + Overwrite default automatic_fulfillment setting for variant. + """ + automaticFulfillment: Boolean + + """ + Represents an file in a multipart request. + """ + contentFile: Upload! +} + +type DigitalContentUrl implements Node { + content: DigitalContent! + created: DateTime! + downloadNum: Int! + + """ + The ID of the object. + """ + id: ID! + + """ + URL for digital content. + """ + url: String + + """ + UUID of digital content. + """ + token: UUID! +} + +""" +Generate new URL to digital content. +""" +type DigitalContentUrlCreate { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + digitalContentUrl: DigitalContentUrl +} + +input DigitalContentUrlCreateInput { + """ + Digital content ID which URL will belong to. + """ + content: ID! +} + +type DiscountError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + List of products IDs which causes the error. + """ + products: [ID!] + + """ + The error code. + """ + code: DiscountErrorCode! + + """ + List of channels IDs which causes the error. + """ + channels: [ID!] +} + +""" +An enumeration. +""" +enum DiscountErrorCode { + ALREADY_EXISTS + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE + CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT + DUPLICATED_INPUT_ITEM +} + +enum DiscountStatusEnum { + ACTIVE + EXPIRED + SCHEDULED +} + +enum DiscountValueTypeEnum { + FIXED + PERCENTAGE +} + +""" +An enumeration. +""" +enum DistanceUnitsEnum { + CM + M + KM + FT + YD + INCH +} + +""" +Represents shop's domain. +""" +type Domain { + """ + The host name of the domain. + """ + host: String! + + """ + Inform if SSL is enabled. + """ + sslEnabled: Boolean! + + """ + Shop's absolute URL. + """ + url: String! +} + +""" +Deletes draft orders. +""" +type DraftOrderBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +Completes creating an order. +""" +type DraftOrderComplete { + """ + Completed order. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +Creates a new draft order. +""" +type DraftOrderCreate { + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! + order: Order +} + +input DraftOrderCreateInput { + """ + Billing address of the customer. + """ + billingAddress: AddressInput + user: ID + + """ + Email address of the customer. + """ + userEmail: String + + """ + Discount amount for the order. + """ + discount: PositiveDecimal + + """ + Shipping address of the customer. + """ + shippingAddress: AddressInput + + """ + ID of a selected shipping method. + """ + shippingMethod: ID + + """ + ID of the voucher associated with the order. + """ + voucher: ID + + """ + A note from a customer. Visible by customers in the order summary. + """ + customerNote: String + + """ + ID of the channel associated with the order. + """ + channel: ID + + """ + URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. + """ + redirectUrl: String + + """ + Variant line input consisting of variant ID and quantity of products. + """ + lines: [OrderLineCreateInput] +} + +""" +Deletes a draft order. +""" +type DraftOrderDelete { + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! + order: Order +} + +input DraftOrderInput { + """ + Billing address of the customer. + """ + billingAddress: AddressInput + user: ID + + """ + Email address of the customer. + """ + userEmail: String + + """ + Discount amount for the order. + """ + discount: PositiveDecimal + + """ + Shipping address of the customer. + """ + shippingAddress: AddressInput + + """ + ID of a selected shipping method. + """ + shippingMethod: ID + + """ + ID of the voucher associated with the order. + """ + voucher: ID + + """ + A note from a customer. Visible by customers in the order summary. + """ + customerNote: String + + """ + ID of the channel associated with the order. + """ + channel: ID + + """ + URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. + """ + redirectUrl: String +} + +""" +Deletes order lines. +""" +type DraftOrderLinesBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +Updates a draft order. +""" +type DraftOrderUpdate { + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! + order: Order +} + +type ExportError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: ExportErrorCode! +} + +""" +An enumeration. +""" +enum ExportErrorCode { + INVALID + NOT_FOUND + REQUIRED +} + +""" +History log of export file. +""" +type ExportEvent implements Node { + """ + The ID of the object. + """ + id: ID! + + """ + Date when event happened at in ISO 8601 format. + """ + date: DateTime! + + """ + Export event type. + """ + type: ExportEventsEnum! + + """ + User who performed the action. + """ + user: User + + """ + App which performed the action. + """ + app: App + + """ + Content of the event. + """ + message: String! +} + +""" +An enumeration. +""" +enum ExportEventsEnum { + EXPORT_PENDING + EXPORT_SUCCESS + EXPORT_FAILED + EXPORT_DELETED + EXPORTED_FILE_SENT + EXPORT_FAILED_INFO_SENT +} + +""" +Represents a job data of exported file. +""" +type ExportFile implements Node & Job { + """ + The ID of the object. + """ + id: ID! + user: User + app: App + + """ + Job status. + """ + status: JobStatusEnum! + + """ + Created date time of job in ISO 8601 format. + """ + createdAt: DateTime! + + """ + Date time of job last update in ISO 8601 format. + """ + updatedAt: DateTime! + + """ + Job message. + """ + message: String + + """ + The URL of field to download. + """ + url: String + + """ + List of events associated with the export. + """ + events: [ExportEvent!] +} + +type ExportFileCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [ExportFileCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type ExportFileCountableEdge { + """ + The item at the end of the edge. + """ + node: ExportFile! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +input ExportFileFilterInput { + createdAt: DateTimeRangeInput + updatedAt: DateTimeRangeInput + status: JobStatusEnum + user: String + app: String +} + +enum ExportFileSortField { + """ + Sort export file by status. + """ + STATUS + + """ + Sort export file by created at. + """ + CREATED_AT + + """ + Sort export file by updated at. + """ + UPDATED_AT +} + +input ExportFileSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort export file by the selected field. + """ + field: ExportFileSortField! +} + +input ExportInfoInput { + """ + List of attribute ids witch should be exported. + """ + attributes: [ID!] + + """ + List of warehouse ids witch should be exported. + """ + warehouses: [ID!] + + """ + List of channels ids which should be exported. + """ + channels: [ID!] + + """ + List of product fields witch should be exported. + """ + fields: [ProductFieldEnum!] +} + +""" +Export products to csv file. +""" +type ExportProducts { + """ + The newly created export file job which is responsible for export data. + """ + exportFile: ExportFile + exportErrors: [ExportError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ExportError!]! +} + +input ExportProductsInput { + """ + Determine which products should be exported. + """ + scope: ExportScope! + + """ + Filtering options for products. + """ + filter: ProductFilterInput + + """ + List of products IDS to export. + """ + ids: [ID!] + + """ + Input with info about fields which should be exported. + """ + exportInfo: ExportInfoInput + + """ + Type of exported file. + """ + fileType: FileTypesEnum! +} + +enum ExportScope { + """ + Export all products. + """ + ALL + + """ + Export products with given ids. + """ + IDS + + """ + Export the filtered products. + """ + FILTER +} + +type ExternalAuthentication { + """ + ID of external authentication plugin. + """ + id: String! + + """ + Name of external authentication plugin. + """ + name: String +} + +""" +Prepare external authentication url for user by custom plugin. +""" +type ExternalAuthenticationUrl { + """ + The data returned by authentication plugin. + """ + authenticationData: JSONString + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Logout user by custom plugin. +""" +type ExternalLogout { + """ + The data returned by authentication plugin. + """ + logoutData: JSONString + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Obtain external access tokens for user by custom plugin. +""" +type ExternalObtainAccessTokens { + """ + The token, required to authenticate. + """ + token: String + + """ + The refresh token, required to re-generate external access token. + """ + refreshToken: String + + """ + CSRF token required to re-generate external access token. + """ + csrfToken: String + + """ + A user instance. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Refresh user's access by custom plugin. +""" +type ExternalRefresh { + """ + The token, required to authenticate. + """ + token: String + + """ + The refresh token, required to re-generate external access token. + """ + refreshToken: String + + """ + CSRF token required to re-generate external access token. + """ + csrfToken: String + + """ + A user instance. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Verify external authentication data by plugin. +""" +type ExternalVerify { + """ + User assigned to data. + """ + user: User + + """ + Determine if authentication data is valid or not. + """ + isValid: Boolean! + + """ + External data. + """ + verifyData: JSONString + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +type File { + """ + The URL of the file. + """ + url: String! + + """ + Content type of the file. + """ + contentType: String +} + +""" +An enumeration. +""" +enum FileTypesEnum { + CSV + XLSX +} + +""" +Upload a file. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec +""" +type FileUpload { + uploadedFile: File + uploadErrors: [UploadError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [UploadError!]! +} + +""" +Represents order fulfillment. +""" +type Fulfillment implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + fulfillmentOrder: Int! + status: FulfillmentStatus! + trackingNumber: String! + created: DateTime! + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + List of lines for the fulfillment. + """ + lines: [FulfillmentLine] + + """ + User-friendly fulfillment status. + """ + statusDisplay: String + + """ + Warehouse from fulfillment was fulfilled. + """ + warehouse: Warehouse +} + +""" +Cancels existing fulfillment and optionally restocks items. +""" +type FulfillmentCancel { + """ + A canceled fulfillment. + """ + fulfillment: Fulfillment + + """ + Order which fulfillment was cancelled. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +input FulfillmentCancelInput { + """ + ID of warehouse where items will be restock. + """ + warehouseId: ID! +} + +""" +Represents line of the fulfillment. +""" +type FulfillmentLine implements Node { + """ + The ID of the object. + """ + id: ID! + quantity: Int! + orderLine: OrderLine +} + +""" +Refund products. +""" +type FulfillmentRefundProducts { + """ + A refunded fulfillment. + """ + fulfillment: Fulfillment + + """ + Order which fulfillment was refunded. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +Return products. +""" +type FulfillmentReturnProducts { + """ + A return fulfillment. + """ + returnFulfillment: Fulfillment + + """ + A replace fulfillment. + """ + replaceFulfillment: Fulfillment + + """ + Order which fulfillment was returned. + """ + order: Order + + """ + A draft order which was created for products with replace flag. + """ + replaceOrder: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +An enumeration. +""" +enum FulfillmentStatus { + """ + Fulfilled + """ + FULFILLED + + """ + Refunded + """ + REFUNDED + + """ + Returned + """ + RETURNED + + """ + Replaced + """ + REPLACED + + """ + Refunded and returned + """ + REFUNDED_AND_RETURNED + + """ + Canceled + """ + CANCELED +} + +""" +Updates a fulfillment for an order. +""" +type FulfillmentUpdateTracking { + """ + A fulfillment with updated tracking. + """ + fulfillment: Fulfillment + + """ + Order for which fulfillment was updated. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +input FulfillmentUpdateTrackingInput { + """ + Fulfillment tracking number. + """ + trackingNumber: String + + """ + If true, send an email notification to the customer. + """ + notifyCustomer: Boolean = false +} + +""" +Payment gateway client configuration key and value pair. +""" +type GatewayConfigLine { + """ + Gateway config key. + """ + field: String! + + """ + Gateway config value for key. + """ + value: String +} + +""" +The `GenericScalar` scalar type represents a generic +GraphQL scalar value that could be: +String, Boolean, Int, Float, List or Object. +""" +scalar GenericScalar + +""" +A gift card is a prepaid electronic payment card accepted in stores. They can be used during checkout by providing a valid gift card codes. +""" +type GiftCard implements Node { + """ + Gift card code. + """ + code: String + + """ + The customer who bought a gift card. + """ + user: User + created: DateTime! + startDate: Date! + endDate: Date + lastUsedOn: DateTime + isActive: Boolean! + initialBalance: Money + currentBalance: Money + + """ + The ID of the object. + """ + id: ID! + + """ + Code in format which allows displaying in a user interface. + """ + displayCode: String +} + +""" +Activate a gift card. +""" +type GiftCardActivate { + """ + A gift card to activate. + """ + giftCard: GiftCard + giftCardErrors: [GiftCardError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [GiftCardError!]! +} + +type GiftCardCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [GiftCardCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type GiftCardCountableEdge { + """ + The item at the end of the edge. + """ + node: GiftCard! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new gift card. +""" +type GiftCardCreate { + giftCardErrors: [GiftCardError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [GiftCardError!]! + giftCard: GiftCard +} + +input GiftCardCreateInput { + """ + Start date of the gift card in ISO 8601 format. + """ + startDate: Date + + """ + End date of the gift card in ISO 8601 format. + """ + endDate: Date + + """ + Value of the gift card. + """ + balance: PositiveDecimal + + """ + The customer's email of the gift card buyer. + """ + userEmail: String + + """ + Code to use the gift card. + """ + code: String +} + +""" +Deactivate a gift card. +""" +type GiftCardDeactivate { + """ + A gift card to deactivate. + """ + giftCard: GiftCard + giftCardErrors: [GiftCardError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [GiftCardError!]! +} + +type GiftCardError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: GiftCardErrorCode! +} + +""" +An enumeration. +""" +enum GiftCardErrorCode { + ALREADY_EXISTS + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE +} + +""" +Update a gift card. +""" +type GiftCardUpdate { + giftCardErrors: [GiftCardError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [GiftCardError!]! + giftCard: GiftCard +} + +input GiftCardUpdateInput { + """ + Start date of the gift card in ISO 8601 format. + """ + startDate: Date + + """ + End date of the gift card in ISO 8601 format. + """ + endDate: Date + + """ + Value of the gift card. + """ + balance: PositiveDecimal + + """ + The customer's email of the gift card buyer. + """ + userEmail: String +} + +""" +Represents permission group data. +""" +type Group implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + + """ + List of group permissions + """ + permissions: [Permission] + + """ + List of group users + """ + users: [User] + + """ + True, if the currently authenticated user has rights to manage a group. + """ + userCanManage: Boolean! +} + +type GroupCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [GroupCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type GroupCountableEdge { + """ + The item at the end of the edge. + """ + node: Group! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Represents an image. +""" +type Image { + """ + The URL of the image. + """ + url: String! + + """ + Alt text for an image. + """ + alt: String +} + +input IntRangeInput { + """ + Value greater than or equal to. + """ + gte: Int + + """ + Value less than or equal to. + """ + lte: Int +} + +""" +Represents an Invoice. +""" +type Invoice implements ObjectWithMetadata & Job & Node { + """ + The ID of the object. + """ + id: ID! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + Job status. + """ + status: JobStatusEnum! + number: String + externalUrl: String + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + Created date time of job in ISO 8601 format. + """ + createdAt: DateTime! + + """ + Date time of job last update in ISO 8601 format. + """ + updatedAt: DateTime! + + """ + Job message. + """ + message: String + + """ + URL to download an invoice. + """ + url: String +} + +""" +Creates a ready to send invoice. +""" +type InvoiceCreate { + invoiceErrors: [InvoiceError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [InvoiceError!]! + invoice: Invoice +} + +input InvoiceCreateInput { + """ + Invoice number. + """ + number: String! + + """ + URL of an invoice to download. + """ + url: String! +} + +""" +Deletes an invoice. +""" +type InvoiceDelete { + invoiceErrors: [InvoiceError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [InvoiceError!]! + invoice: Invoice +} + +type InvoiceError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: InvoiceErrorCode! +} + +""" +An enumeration. +""" +enum InvoiceErrorCode { + REQUIRED + NOT_READY + URL_NOT_SET + EMAIL_NOT_SET + NUMBER_NOT_SET + NOT_FOUND + INVALID_STATUS +} + +""" +Request an invoice for the order using plugin. +""" +type InvoiceRequest { + """ + Order related to an invoice. + """ + order: Order + invoiceErrors: [InvoiceError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [InvoiceError!]! + invoice: Invoice +} + +""" +Requests deletion of an invoice. +""" +type InvoiceRequestDelete { + invoiceErrors: [InvoiceError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [InvoiceError!]! + invoice: Invoice +} + +""" +Send an invoice notification to the customer. +""" +type InvoiceSendNotification { + invoiceErrors: [InvoiceError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [InvoiceError!]! + invoice: Invoice +} + +""" +Updates an invoice. +""" +type InvoiceUpdate { + invoiceErrors: [InvoiceError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [InvoiceError!]! + invoice: Invoice +} + +""" +Allows use of a JSON String for input / output from the GraphQL schema. + +Use of this type is *not recommended* as you lose the benefits of having a defined, static +schema (one of the key benefits of GraphQL). +""" +scalar JSONString + +interface Job { + """ + Job status. + """ + status: JobStatusEnum! + + """ + Created date time of job in ISO 8601 format. + """ + createdAt: DateTime! + + """ + Date time of job last update in ISO 8601 format. + """ + updatedAt: DateTime! + + """ + Job message. + """ + message: String +} + +""" +An enumeration. +""" +enum JobStatusEnum { + PENDING + SUCCESS + FAILED + DELETED +} + +""" +An enumeration. +""" +enum LanguageCodeEnum { + AR + AZ + BG + BN + CA + CS + DA + DE + EL + EN + ES + ES_CO + ET + FA + FI + FR + HI + HU + HY + ID + IS + IT + JA + KA + KM + KO + LT + MN + MY + NB + NL + PL + PT + PT_BR + RO + RU + SK + SL + SQ + SR + SV + SW + TA + TH + TR + UK + VI + ZH_HANS + ZH_HANT +} + +type LanguageDisplay { + """ + ISO 639 representation of the language name. + """ + code: LanguageCodeEnum! + + """ + Full name of the language. + """ + language: String! +} + +type LimitInfo { + """ + Defines the current resource usage. + """ + currentUsage: Limits! + + """ + Defines the allowed maximum resource usage, null means unlimited. + """ + allowedUsage: Limits! +} + +type Limits { + channels: Int + orders: Int + productVariants: Int + staffUsers: Int + warehouses: Int +} + +""" +The manifest definition. +""" +type Manifest { + identifier: String! + version: String! + name: String! + about: String + permissions: [Permission] + appUrl: String + configurationUrl: String + tokenTargetUrl: String + dataPrivacy: String + dataPrivacyUrl: String + homepageUrl: String + supportUrl: String +} + +type Margin { + start: Int + stop: Int +} + +""" +An enumeration. +""" +enum MeasurementUnitsEnum { + CM + M + KM + FT + YD + INCH + SQ_CM + SQ_M + SQ_KM + SQ_FT + SQ_YD + SQ_INCH + CUBIC_MILLIMETER + CUBIC_CENTIMETER + CUBIC_DECIMETER + CUBIC_METER + LITER + CUBIC_FOOT + CUBIC_INCH + CUBIC_YARD + QT + PINT + FL_OZ + ACRE_IN + ACRE_FT + G + LB + OZ + KG + TONNE +} + +""" +Represents a single menu - an object that is used to help navigate through the store. +""" +type Menu implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + name: String! + slug: String! + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + items: [MenuItem] +} + +""" +Deletes menus. +""" +type MenuBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MenuError!]! +} + +type MenuCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [MenuCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type MenuCountableEdge { + """ + The item at the end of the edge. + """ + node: Menu! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new Menu. +""" +type MenuCreate { + menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MenuError!]! + menu: Menu +} + +input MenuCreateInput { + """ + Name of the menu. + """ + name: String! + + """ + Slug of the menu. Will be generated if not provided. + """ + slug: String + + """ + List of menu items. + """ + items: [MenuItemInput] +} + +""" +Deletes a menu. +""" +type MenuDelete { + menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MenuError!]! + menu: Menu +} + +type MenuError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: MenuErrorCode! +} + +""" +An enumeration. +""" +enum MenuErrorCode { + CANNOT_ASSIGN_NODE + GRAPHQL_ERROR + INVALID + INVALID_MENU_ITEM + NO_MENU_ITEM_PROVIDED + NOT_FOUND + REQUIRED + TOO_MANY_MENU_ITEMS + UNIQUE +} + +input MenuFilterInput { + search: String + slug: [String] + metadata: [MetadataInput] +} + +input MenuInput { + """ + Name of the menu. + """ + name: String + + """ + Slug of the menu. + """ + slug: String +} + +""" +Represents a single item of the related menu. Can store categories, collection or pages. +""" +type MenuItem implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + name: String! + menu: Menu! + parent: MenuItem + category: Category + collection: Collection + page: Page + level: Int! + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + children: [MenuItem] + + """ + URL to the menu item. + """ + url: String + + """ + Returns translated menu item fields for the given language code. + """ + translation( + """ + A language code to return the translation for menu item. + """ + languageCode: LanguageCodeEnum! + ): MenuItemTranslation +} + +""" +Deletes menu items. +""" +type MenuItemBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MenuError!]! +} + +type MenuItemCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [MenuItemCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type MenuItemCountableEdge { + """ + The item at the end of the edge. + """ + node: MenuItem! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new menu item. +""" +type MenuItemCreate { + menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MenuError!]! + menuItem: MenuItem +} + +input MenuItemCreateInput { + """ + Name of the menu item. + """ + name: String! + + """ + URL of the pointed item. + """ + url: String + + """ + Category to which item points. + """ + category: ID + + """ + Collection to which item points. + """ + collection: ID + + """ + Page to which item points. + """ + page: ID + + """ + Menu to which item belongs. + """ + menu: ID! + + """ + ID of the parent menu. If empty, menu will be top level menu. + """ + parent: ID +} + +""" +Deletes a menu item. +""" +type MenuItemDelete { + menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MenuError!]! + menuItem: MenuItem +} + +input MenuItemFilterInput { + search: String + metadata: [MetadataInput] +} + +input MenuItemInput { + """ + Name of the menu item. + """ + name: String + + """ + URL of the pointed item. + """ + url: String + + """ + Category to which item points. + """ + category: ID + + """ + Collection to which item points. + """ + collection: ID + + """ + Page to which item points. + """ + page: ID +} + +""" +Moves items of menus. +""" +type MenuItemMove { + """ + Assigned menu to move within. + """ + menu: Menu + menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MenuError!]! +} + +input MenuItemMoveInput { + """ + The menu item ID to move. + """ + itemId: ID! + + """ + ID of the parent menu. If empty, menu will be top level menu. + """ + parentId: ID + + """ + The new relative sorting position of the item (from -inf to +inf). 1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. + """ + sortOrder: Int +} + +input MenuItemSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort menu items by the selected field. + """ + field: MenuItemsSortField! +} + +type MenuItemTranslatableContent implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + + """ + Returns translated menu item fields for the given language code. + """ + translation( + """ + A language code to return the translation for menu item. + """ + languageCode: LanguageCodeEnum! + ): MenuItemTranslation + + """ + Represents a single item of the related menu. Can store categories, collection or pages. + """ + menuItem: MenuItem +} + +""" +Creates/Updates translations for Menu Item. +""" +type MenuItemTranslate { + translationErrors: [TranslationError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [TranslationError!]! + menuItem: MenuItem +} + +type MenuItemTranslation implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + + """ + Translation language. + """ + language: LanguageDisplay! +} + +""" +Updates a menu item. +""" +type MenuItemUpdate { + menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MenuError!]! + menuItem: MenuItem +} + +enum MenuItemsSortField { + """ + Sort menu items by name. + """ + NAME +} + +enum MenuSortField { + """ + Sort menus by name. + """ + NAME + + """ + Sort menus by items count. + """ + ITEMS_COUNT +} + +input MenuSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort menus by the selected field. + """ + field: MenuSortField! +} + +""" +Updates a menu. +""" +type MenuUpdate { + menuErrors: [MenuError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MenuError!]! + menu: Menu +} + +type MetadataError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: MetadataErrorCode! +} + +""" +An enumeration. +""" +enum MetadataErrorCode { + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED +} + +input MetadataInput { + """ + Key of a metadata item. + """ + key: String! + + """ + Value of a metadata item. + """ + value: String! +} + +type MetadataItem { + """ + Key of a metadata item. + """ + key: String! + + """ + Value of a metadata item. + """ + value: String! +} + +""" +Represents amount of money in specific currency. +""" +type Money { + """ + Currency code. + """ + currency: String! + + """ + Amount of money. + """ + amount: Float! +} + +""" +Represents a range of amounts of money. +""" +type MoneyRange { + """ + Lower bound of a price range. + """ + start: Money + + """ + Upper bound of a price range. + """ + stop: Money +} + +input MoveProductInput { + """ + The ID of the product to move. + """ + productId: ID! + + """ + The relative sorting position of the product (from -inf to +inf) starting from the first given product's actual position.1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. + """ + sortOrder: Int +} + +type Mutation { + """ + Creates a new webhook subscription. + """ + webhookCreate( + """ + Fields required to create a webhook. + """ + input: WebhookCreateInput! + ): WebhookCreate + + """ + Deletes a webhook subscription. + """ + webhookDelete( + """ + ID of a webhook to delete. + """ + id: ID! + ): WebhookDelete + + """ + Updates a webhook subscription. + """ + webhookUpdate( + """ + ID of a webhook to update. + """ + id: ID! + + """ + Fields required to update a webhook. + """ + input: WebhookUpdateInput! + ): WebhookUpdate + + """ + Creates new warehouse. + """ + createWarehouse( + """ + Fields required to create warehouse. + """ + input: WarehouseCreateInput! + ): WarehouseCreate + + """ + Updates given warehouse. + """ + updateWarehouse( + """ + ID of a warehouse to update. + """ + id: ID! + + """ + Fields required to update warehouse. + """ + input: WarehouseUpdateInput! + ): WarehouseUpdate + + """ + Deletes selected warehouse. + """ + deleteWarehouse( + """ + ID of a warehouse to delete. + """ + id: ID! + ): WarehouseDelete + + """ + Add shipping zone to given warehouse. + """ + assignWarehouseShippingZone( + """ + ID of a warehouse to update. + """ + id: ID! + + """ + List of shipping zone IDs. + """ + shippingZoneIds: [ID!]! + ): WarehouseShippingZoneAssign + + """ + Remove shipping zone from given warehouse. + """ + unassignWarehouseShippingZone( + """ + ID of a warehouse to update. + """ + id: ID! + + """ + List of shipping zone IDs. + """ + shippingZoneIds: [ID!]! + ): WarehouseShippingZoneUnassign + + """ + Creates a new staff notification recipient. + """ + staffNotificationRecipientCreate( + """ + Fields required to create a staff notification recipient. + """ + input: StaffNotificationRecipientInput! + ): StaffNotificationRecipientCreate + + """ + Updates a staff notification recipient. + """ + staffNotificationRecipientUpdate( + """ + ID of a staff notification recipient to update. + """ + id: ID! + + """ + Fields required to update a staff notification recipient. + """ + input: StaffNotificationRecipientInput! + ): StaffNotificationRecipientUpdate + + """ + Delete staff notification recipient. + """ + staffNotificationRecipientDelete( + """ + ID of a staff notification recipient to delete. + """ + id: ID! + ): StaffNotificationRecipientDelete + + """ + Updates site domain of the shop. + """ + shopDomainUpdate( + """ + Fields required to update site. + """ + input: SiteDomainInput + ): ShopDomainUpdate + + """ + Updates shop settings. + """ + shopSettingsUpdate( + """ + Fields required to update shop settings. + """ + input: ShopSettingsInput! + ): ShopSettingsUpdate + + """ + Fetch tax rates. + """ + shopFetchTaxRates: ShopFetchTaxRates + + """ + Creates/Updates translations for Shop Settings. + """ + shopSettingsTranslate( + """ + Fields required to update shop settings translations. + """ + input: ShopSettingsTranslationInput! + + """ + Translation language code. + """ + languageCode: LanguageCodeEnum! + ): ShopSettingsTranslate + + """ + Update the shop's address. If the `null` value is passed, the currently selected address will be deleted. + """ + shopAddressUpdate( + """ + Fields required to update shop address. + """ + input: AddressInput + ): ShopAddressUpdate + + """ + Update shop order settings. + """ + orderSettingsUpdate( + """ + Fields required to update shop order settings. + """ + input: OrderSettingsUpdateInput! + ): OrderSettingsUpdate + + """ + Manage shipping method's availability in channels. + """ + shippingMethodChannelListingUpdate( + """ + ID of a shipping method to update. + """ + id: ID! + + """ + Fields required to update shipping method channel listings. + """ + input: ShippingMethodChannelListingInput! + ): ShippingMethodChannelListingUpdate + + """ + Creates a new shipping price. + """ + shippingPriceCreate( + """ + Fields required to create a shipping price. + """ + input: ShippingPriceInput! + ): ShippingPriceCreate + + """ + Deletes a shipping price. + """ + shippingPriceDelete( + """ + ID of a shipping price to delete. + """ + id: ID! + ): ShippingPriceDelete + + """ + Deletes shipping prices. + """ + shippingPriceBulkDelete( + """ + List of shipping price IDs to delete. + """ + ids: [ID]! + ): ShippingPriceBulkDelete + + """ + Updates a new shipping price. + """ + shippingPriceUpdate( + """ + ID of a shipping price to update. + """ + id: ID! + + """ + Fields required to update a shipping price. + """ + input: ShippingPriceInput! + ): ShippingPriceUpdate + + """ + Creates/Updates translations for shipping method. + """ + shippingPriceTranslate( + """ + Shipping method ID. + """ + id: ID! + input: ShippingPriceTranslationInput! + + """ + Translation language code. + """ + languageCode: LanguageCodeEnum! + ): ShippingPriceTranslate + + """ + Exclude products from shipping price. + """ + shippingPriceExcludeProducts( + """ + ID of a shipping price. + """ + id: ID! + + """ + Exclude products input. + """ + input: ShippingPriceExcludeProductsInput! + ): ShippingPriceExcludeProducts + + """ + Remove product from excluded list for shipping price. + """ + shippingPriceRemoveProductFromExclude( + """ + ID of a shipping price. + """ + id: ID! + + """ + List of products which will be removed from excluded list. + """ + products: [ID]! + ): ShippingPriceRemoveProductFromExclude + + """ + Creates a new shipping zone. + """ + shippingZoneCreate( + """ + Fields required to create a shipping zone. + """ + input: ShippingZoneCreateInput! + ): ShippingZoneCreate + + """ + Deletes a shipping zone. + """ + shippingZoneDelete( + """ + ID of a shipping zone to delete. + """ + id: ID! + ): ShippingZoneDelete + + """ + Deletes shipping zones. + """ + shippingZoneBulkDelete( + """ + List of shipping zone IDs to delete. + """ + ids: [ID]! + ): ShippingZoneBulkDelete + + """ + Updates a new shipping zone. + """ + shippingZoneUpdate( + """ + ID of a shipping zone to update. + """ + id: ID! + + """ + Fields required to update a shipping zone. + """ + input: ShippingZoneUpdateInput! + ): ShippingZoneUpdate + + """ + Assign attributes to a given product type. + """ + productAttributeAssign( + """ + The operations to perform. + """ + operations: [ProductAttributeAssignInput]! + + """ + ID of the product type to assign the attributes into. + """ + productTypeId: ID! + ): ProductAttributeAssign + + """ + Un-assign attributes from a given product type. + """ + productAttributeUnassign( + """ + The IDs of the attributes to unassign. + """ + attributeIds: [ID]! + + """ + ID of the product type from which the attributes should be unassigned. + """ + productTypeId: ID! + ): ProductAttributeUnassign + + """ + Creates a new category. + """ + categoryCreate( + """ + Fields required to create a category. + """ + input: CategoryInput! + + """ + ID of the parent category. If empty, category will be top level category. + """ + parent: ID + ): CategoryCreate + + """ + Deletes a category. + """ + categoryDelete( + """ + ID of a category to delete. + """ + id: ID! + ): CategoryDelete + + """ + Deletes categories. + """ + categoryBulkDelete( + """ + List of category IDs to delete. + """ + ids: [ID]! + ): CategoryBulkDelete + + """ + Updates a category. + """ + categoryUpdate( + """ + ID of a category to update. + """ + id: ID! + + """ + Fields required to update a category. + """ + input: CategoryInput! + ): CategoryUpdate + + """ + Creates/Updates translations for Category. + """ + categoryTranslate( + """ + Category ID. + """ + id: ID! + input: TranslationInput! + + """ + Translation language code. + """ + languageCode: LanguageCodeEnum! + ): CategoryTranslate + + """ + Adds products to a collection. + """ + collectionAddProducts( + """ + ID of a collection. + """ + collectionId: ID! + + """ + List of product IDs. + """ + products: [ID]! + ): CollectionAddProducts + + """ + Creates a new collection. + """ + collectionCreate( + """ + Fields required to create a collection. + """ + input: CollectionCreateInput! + ): CollectionCreate + + """ + Deletes a collection. + """ + collectionDelete( + """ + ID of a collection to delete. + """ + id: ID! + ): CollectionDelete + + """ + Reorder the products of a collection. + """ + collectionReorderProducts( + """ + ID of a collection. + """ + collectionId: ID! + + """ + The collection products position operations. + """ + moves: [MoveProductInput]! + ): CollectionReorderProducts + + """ + Deletes collections. + """ + collectionBulkDelete( + """ + List of collection IDs to delete. + """ + ids: [ID]! + ): CollectionBulkDelete + + """ + Remove products from a collection. + """ + collectionRemoveProducts( + """ + ID of a collection. + """ + collectionId: ID! + + """ + List of product IDs. + """ + products: [ID]! + ): CollectionRemoveProducts + + """ + Updates a collection. + """ + collectionUpdate( + """ + ID of a collection to update. + """ + id: ID! + + """ + Fields required to update a collection. + """ + input: CollectionInput! + ): CollectionUpdate + + """ + Creates/Updates translations for collection. + """ + collectionTranslate( + """ + Collection ID. + """ + id: ID! + input: TranslationInput! + + """ + Translation language code. + """ + languageCode: LanguageCodeEnum! + ): CollectionTranslate + + """ + Manage collection's availability in channels. + """ + collectionChannelListingUpdate( + """ + ID of a collection to update. + """ + id: ID! + + """ + Fields required to create or update collection channel listings. + """ + input: CollectionChannelListingUpdateInput! + ): CollectionChannelListingUpdate + + """ + Creates a new product. + """ + productCreate( + """ + Fields required to create a product. + """ + input: ProductCreateInput! + ): ProductCreate + + """ + Deletes a product. + """ + productDelete( + """ + ID of a product to delete. + """ + id: ID! + ): ProductDelete + + """ + Deletes products. + """ + productBulkDelete( + """ + List of product IDs to delete. + """ + ids: [ID]! + ): ProductBulkDelete + + """ + Updates an existing product. + """ + productUpdate( + """ + ID of a product to update. + """ + id: ID! + + """ + Fields required to update a product. + """ + input: ProductInput! + ): ProductUpdate + + """ + Creates/Updates translations for Product. + """ + productTranslate( + """ + Product ID. + """ + id: ID! + input: TranslationInput! + + """ + Translation language code. + """ + languageCode: LanguageCodeEnum! + ): ProductTranslate + + """ + Manage product's availability in channels. + """ + productChannelListingUpdate( + """ + ID of a product to update. + """ + id: ID! + + """ + Fields required to create or update product channel listings. + """ + input: ProductChannelListingUpdateInput! + ): ProductChannelListingUpdate + + """ + Create a media object (image or video URL) associated with product. For image, this mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec + """ + productMediaCreate( + """ + Fields required to create a product media. + """ + input: ProductMediaCreateInput! + ): ProductMediaCreate + + """ + Reorder the variants of a product. Mutation updates updated_at on product and triggers PRODUCT_UPDATED webhook. + """ + productVariantReorder( + """ + The list of variant reordering operations. + """ + moves: [ReorderInput]! + + """ + Id of product that variants order will be altered. + """ + productId: ID! + ): ProductVariantReorder + + """ + Deletes a product media. + """ + productMediaDelete( + """ + ID of a product media to delete. + """ + id: ID! + ): ProductMediaDelete + + """ + Deletes product media. + """ + productMediaBulkDelete( + """ + List of product media IDs to delete. + """ + ids: [ID]! + ): ProductMediaBulkDelete + + """ + Changes ordering of the product media. + """ + productMediaReorder( + """ + IDs of a product media in the desired order. + """ + mediaIds: [ID]! + + """ + ID of product that media order will be altered. + """ + productId: ID! + ): ProductMediaReorder + + """ + Updates a product media. + """ + productMediaUpdate( + """ + ID of a product media to update. + """ + id: ID! + + """ + Fields required to update a product media. + """ + input: ProductMediaUpdateInput! + ): ProductMediaUpdate + + """ + Creates a new product type. + """ + productTypeCreate( + """ + Fields required to create a product type. + """ + input: ProductTypeInput! + ): ProductTypeCreate + + """ + Deletes a product type. + """ + productTypeDelete( + """ + ID of a product type to delete. + """ + id: ID! + ): ProductTypeDelete + + """ + Deletes product types. + """ + productTypeBulkDelete( + """ + List of product type IDs to delete. + """ + ids: [ID]! + ): ProductTypeBulkDelete + + """ + Updates an existing product type. + """ + productTypeUpdate( + """ + ID of a product type to update. + """ + id: ID! + + """ + Fields required to update a product type. + """ + input: ProductTypeInput! + ): ProductTypeUpdate + + """ + Reorder the attributes of a product type. + """ + productTypeReorderAttributes( + """ + The list of attribute reordering operations. + """ + moves: [ReorderInput]! + + """ + ID of a product type. + """ + productTypeId: ID! + + """ + The attribute type to reorder. + """ + type: ProductAttributeType! + ): ProductTypeReorderAttributes + + """ + Reorder product attribute values. + """ + productReorderAttributeValues( + """ + ID of an attribute. + """ + attributeId: ID! + + """ + The list of reordering operations for given attribute values. + """ + moves: [ReorderInput]! + + """ + ID of a product. + """ + productId: ID! + ): ProductReorderAttributeValues + + """ + Create new digital content. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec + """ + digitalContentCreate( + """ + Fields required to create a digital content. + """ + input: DigitalContentUploadInput! + + """ + ID of a product variant to upload digital content. + """ + variantId: ID! + ): DigitalContentCreate + + """ + Remove digital content assigned to given variant. + """ + digitalContentDelete( + """ + ID of a product variant with digital content to remove. + """ + variantId: ID! + ): DigitalContentDelete + + """ + Update digital content. + """ + digitalContentUpdate( + """ + Fields required to update a digital content. + """ + input: DigitalContentInput! + + """ + ID of a product variant with digital content to update. + """ + variantId: ID! + ): DigitalContentUpdate + + """ + Generate new URL to digital content. + """ + digitalContentUrlCreate( + """ + Fields required to create a new url. + """ + input: DigitalContentUrlCreateInput! + ): DigitalContentUrlCreate + + """ + Creates a new variant for a product. + """ + productVariantCreate( + """ + Fields required to create a product variant. + """ + input: ProductVariantCreateInput! + ): ProductVariantCreate + + """ + Deletes a product variant. + """ + productVariantDelete( + """ + ID of a product variant to delete. + """ + id: ID! + ): ProductVariantDelete + + """ + Creates product variants for a given product. + """ + productVariantBulkCreate( + """ + ID of the product to create the variants for. + """ + product: ID! + + """ + Input list of product variants to create. + """ + variants: [ProductVariantBulkCreateInput]! + ): ProductVariantBulkCreate + + """ + Deletes product variants. + """ + productVariantBulkDelete( + """ + List of product variant IDs to delete. + """ + ids: [ID]! + ): ProductVariantBulkDelete + + """ + Creates stocks for product variant. + """ + productVariantStocksCreate( + """ + Input list of stocks to create. + """ + stocks: [StockInput!]! + + """ + ID of a product variant for which stocks will be created. + """ + variantId: ID! + ): ProductVariantStocksCreate + + """ + Delete stocks from product variant. + """ + productVariantStocksDelete( + """ + ID of product variant for which stocks will be deleted. + """ + variantId: ID! + warehouseIds: [ID!] + ): ProductVariantStocksDelete + + """ + Update stocks for product variant. + """ + productVariantStocksUpdate( + """ + Input list of stocks to create. + """ + stocks: [StockInput!]! + + """ + ID of a product variant for which stocks will be created. + """ + variantId: ID! + ): ProductVariantStocksUpdate + + """ + Updates an existing variant for product. + """ + productVariantUpdate( + """ + ID of a product variant to update. + """ + id: ID! + + """ + Fields required to update a product variant. + """ + input: ProductVariantInput! + ): ProductVariantUpdate + + """ + Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook. + """ + productVariantSetDefault( + """ + Id of a product that will have the default variant set. + """ + productId: ID! + + """ + Id of a variant that will be set as default. + """ + variantId: ID! + ): ProductVariantSetDefault + + """ + Creates/Updates translations for Product Variant. + """ + productVariantTranslate( + """ + Product Variant ID. + """ + id: ID! + input: NameTranslationInput! + + """ + Translation language code. + """ + languageCode: LanguageCodeEnum! + ): ProductVariantTranslate + + """ + Manage product variant prices in channels. + """ + productVariantChannelListingUpdate( + """ + ID of a product variant to update. + """ + id: ID! + + """ + ('List of fields required to create or upgrade product variant ', 'channel listings.') + """ + input: [ProductVariantChannelListingAddInput!]! + ): ProductVariantChannelListingUpdate + + """ + Reorder product variant attribute values. + """ + productVariantReorderAttributeValues( + """ + ID of an attribute. + """ + attributeId: ID! + + """ + The list of reordering operations for given attribute values. + """ + moves: [ReorderInput]! + + """ + ID of a product variant. + """ + variantId: ID! + ): ProductVariantReorderAttributeValues + + """ + Assign an media to a product variant. + """ + variantMediaAssign( + """ + ID of a product media to assign to a variant. + """ + mediaId: ID! + + """ + ID of a product variant. + """ + variantId: ID! + ): VariantMediaAssign + + """ + Unassign an media from a product variant. + """ + variantMediaUnassign( + """ + ID of a product media to unassign from a variant. + """ + mediaId: ID! + + """ + ID of a product variant. + """ + variantId: ID! + ): VariantMediaUnassign + + """ + Captures the authorized payment amount. + """ + paymentCapture( + """ + Transaction amount. + """ + amount: PositiveDecimal + + """ + Payment ID. + """ + paymentId: ID! + ): PaymentCapture + + """ + Refunds the captured payment amount. + """ + paymentRefund( + """ + Transaction amount. + """ + amount: PositiveDecimal + + """ + Payment ID. + """ + paymentId: ID! + ): PaymentRefund + + """ + Voids the authorized payment. + """ + paymentVoid( + """ + Payment ID. + """ + paymentId: ID! + ): PaymentVoid + + """ + Initializes payment process when it is required by gateway. + """ + paymentInitialize( + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + A gateway name used to initialize the payment. + """ + gateway: String! + + """ + Client-side generated data required to initialize the payment. + """ + paymentData: JSONString + ): PaymentInitialize + + """ + Creates a new page. + """ + pageCreate( + """ + Fields required to create a page. + """ + input: PageCreateInput! + ): PageCreate + + """ + Deletes a page. + """ + pageDelete( + """ + ID of a page to delete. + """ + id: ID! + ): PageDelete + + """ + Deletes pages. + """ + pageBulkDelete( + """ + List of page IDs to delete. + """ + ids: [ID]! + ): PageBulkDelete + + """ + Publish pages. + """ + pageBulkPublish( + """ + List of page IDs to (un)publish. + """ + ids: [ID]! + + """ + Determine if pages will be published or not. + """ + isPublished: Boolean! + ): PageBulkPublish + + """ + Updates an existing page. + """ + pageUpdate( + """ + ID of a page to update. + """ + id: ID! + + """ + Fields required to update a page. + """ + input: PageInput! + ): PageUpdate + + """ + Creates/Updates translations for Page. + """ + pageTranslate( + """ + Page ID. + """ + id: ID! + input: PageTranslationInput! + + """ + Translation language code. + """ + languageCode: LanguageCodeEnum! + ): PageTranslate + + """ + Create a new page type. + """ + pageTypeCreate( + """ + Fields required to create page type. + """ + input: PageTypeCreateInput! + ): PageTypeCreate + + """ + Update page type. + """ + pageTypeUpdate( + """ + ID of the page type to update. + """ + id: ID + + """ + Fields required to update page type. + """ + input: PageTypeUpdateInput! + ): PageTypeUpdate + + """ + Delete a page type. + """ + pageTypeDelete( + """ + ID of the page type to delete. + """ + id: ID! + ): PageTypeDelete + + """ + Delete page types. + """ + pageTypeBulkDelete( + """ + List of page type IDs to delete + """ + ids: [ID!]! + ): PageTypeBulkDelete + + """ + Assign attributes to a given page type. + """ + pageAttributeAssign( + """ + The IDs of the attributes to assign. + """ + attributeIds: [ID!]! + + """ + ID of the page type to assign the attributes into. + """ + pageTypeId: ID! + ): PageAttributeAssign + + """ + Unassign attributes from a given page type. + """ + pageAttributeUnassign( + """ + The IDs of the attributes to unassign. + """ + attributeIds: [ID!]! + + """ + ID of the page type from which the attributes should be unassign. + """ + pageTypeId: ID! + ): PageAttributeUnassign + + """ + Reorder the attributes of a page type. + """ + pageTypeReorderAttributes( + """ + The list of attribute reordering operations. + """ + moves: [ReorderInput!]! + + """ + ID of a page type. + """ + pageTypeId: ID! + ): PageTypeReorderAttributes + + """ + Reorder page attribute values. + """ + pageReorderAttributeValues( + """ + ID of an attribute. + """ + attributeId: ID! + + """ + The list of reordering operations for given attribute values. + """ + moves: [ReorderInput]! + + """ + ID of a page. + """ + pageId: ID! + ): PageReorderAttributeValues + + """ + Completes creating an order. + """ + draftOrderComplete( + """ + ID of the order that will be completed. + """ + id: ID! + ): DraftOrderComplete + + """ + Creates a new draft order. + """ + draftOrderCreate( + """ + Fields required to create an order. + """ + input: DraftOrderCreateInput! + ): DraftOrderCreate + + """ + Deletes a draft order. + """ + draftOrderDelete( + """ + ID of a draft order to delete. + """ + id: ID! + ): DraftOrderDelete + + """ + Deletes draft orders. + """ + draftOrderBulkDelete( + """ + List of draft order IDs to delete. + """ + ids: [ID]! + ): DraftOrderBulkDelete + + """ + Deletes order lines. + """ + draftOrderLinesBulkDelete( + """ + List of order lines IDs to delete. + """ + ids: [ID]! + ): DraftOrderLinesBulkDelete + + """ + Updates a draft order. + """ + draftOrderUpdate( + """ + ID of a draft order to update. + """ + id: ID! + + """ + Fields required to update an order. + """ + input: DraftOrderInput! + ): DraftOrderUpdate + + """ + Adds note to the order. + """ + orderAddNote( + """ + ID of the order to add a note for. + """ + order: ID! + + """ + Fields required to create a note for the order. + """ + input: OrderAddNoteInput! + ): OrderAddNote + + """ + Cancel an order. + """ + orderCancel( + """ + ID of the order to cancel. + """ + id: ID! + ): OrderCancel + + """ + Capture an order. + """ + orderCapture( + """ + Amount of money to capture. + """ + amount: PositiveDecimal! + + """ + ID of the order to capture. + """ + id: ID! + ): OrderCapture + + """ + Confirms an unconfirmed order by changing status to unfulfilled. + """ + orderConfirm( + """ + ID of an order to confirm. + """ + id: ID! + ): OrderConfirm + + """ + Creates new fulfillments for an order. + """ + orderFulfill( + """ + Fields required to create an fulfillment. + """ + input: OrderFulfillInput! + + """ + ID of the order to be fulfilled. + """ + order: ID + ): OrderFulfill + + """ + Cancels existing fulfillment and optionally restocks items. + """ + orderFulfillmentCancel( + """ + ID of an fulfillment to cancel. + """ + id: ID! + + """ + Fields required to cancel an fulfillment. + """ + input: FulfillmentCancelInput! + ): FulfillmentCancel + + """ + Updates a fulfillment for an order. + """ + orderFulfillmentUpdateTracking( + """ + ID of an fulfillment to update. + """ + id: ID! + + """ + Fields required to update an fulfillment. + """ + input: FulfillmentUpdateTrackingInput! + ): FulfillmentUpdateTracking + + """ + Refund products. + """ + orderFulfillmentRefundProducts( + """ + Fields required to create an refund fulfillment. + """ + input: OrderRefundProductsInput! + + """ + ID of the order to be refunded. + """ + order: ID! + ): FulfillmentRefundProducts + + """ + Return products. + """ + orderFulfillmentReturnProducts( + """ + Fields required to return products. + """ + input: OrderReturnProductsInput! + + """ + ID of the order to be returned. + """ + order: ID! + ): FulfillmentReturnProducts + + """ + Create order lines for an order. + """ + orderLinesCreate( + """ + ID of the order to add the lines to. + """ + id: ID! + + """ + Fields required to add order lines. + """ + input: [OrderLineCreateInput]! + ): OrderLinesCreate + + """ + Deletes an order line from an order. + """ + orderLineDelete( + """ + ID of the order line to delete. + """ + id: ID! + ): OrderLineDelete + + """ + Updates an order line of an order. + """ + orderLineUpdate( + """ + ID of the order line to update. + """ + id: ID! + + """ + Fields required to update an order line. + """ + input: OrderLineInput! + ): OrderLineUpdate + + """ + Adds discount to the order. + """ + orderDiscountAdd( + """ + Fields required to create a discount for the order. + """ + input: OrderDiscountCommonInput! + + """ + ID of an order to discount. + """ + orderId: ID! + ): OrderDiscountAdd + + """ + Update discount for the order. + """ + orderDiscountUpdate( + """ + ID of a discount to update. + """ + discountId: ID! + + """ + Fields required to update a discount for the order. + """ + input: OrderDiscountCommonInput! + ): OrderDiscountUpdate + + """ + Remove discount from the order. + """ + orderDiscountDelete( + """ + ID of a discount to remove. + """ + discountId: ID! + ): OrderDiscountDelete + + """ + Update discount for the order line. + """ + orderLineDiscountUpdate( + """ + Fields required to update price for the order line. + """ + input: OrderDiscountCommonInput! + + """ + ID of a order line to update price + """ + orderLineId: ID! + ): OrderLineDiscountUpdate + + """ + Remove discount applied to the order line. + """ + orderLineDiscountRemove( + """ + ID of a order line to remove its discount + """ + orderLineId: ID! + ): OrderLineDiscountRemove + + """ + Mark order as manually paid. + """ + orderMarkAsPaid( + """ + ID of the order to mark paid. + """ + id: ID! + + """ + The external transaction reference. + """ + transactionReference: String + ): OrderMarkAsPaid + + """ + Refund an order. + """ + orderRefund( + """ + Amount of money to refund. + """ + amount: PositiveDecimal! + + """ + ID of the order to refund. + """ + id: ID! + ): OrderRefund + + """ + Updates an order. + """ + orderUpdate( + """ + ID of an order to update. + """ + id: ID! + + """ + Fields required to update an order. + """ + input: OrderUpdateInput! + ): OrderUpdate + + """ + Updates a shipping method of the order. + """ + orderUpdateShipping( + """ + ID of the order to update a shipping method. + """ + order: ID! + + """ + Fields required to change shipping method of the order. + """ + input: OrderUpdateShippingInput + ): OrderUpdateShipping + + """ + Void an order. + """ + orderVoid( + """ + ID of the order to void. + """ + id: ID! + ): OrderVoid + + """ + Cancels orders. + """ + orderBulkCancel( + """ + List of orders IDs to cancel. + """ + ids: [ID]! + ): OrderBulkCancel + + """ + Delete metadata of an object. + """ + deleteMetadata( + """ + ID of an object to update. + """ + id: ID! + + """ + Metadata keys to delete. + """ + keys: [String!]! + ): DeleteMetadata + + """ + Delete object's private metadata. + """ + deletePrivateMetadata( + """ + ID of an object to update. + """ + id: ID! + + """ + Metadata keys to delete. + """ + keys: [String!]! + ): DeletePrivateMetadata + + """ + Updates metadata of an object. + """ + updateMetadata( + """ + ID of an object to update. + """ + id: ID! + + """ + Fields required to update the object's metadata. + """ + input: [MetadataInput!]! + ): UpdateMetadata + + """ + Updates private metadata of an object. + """ + updatePrivateMetadata( + """ + ID of an object to update. + """ + id: ID! + + """ + Fields required to update the object's metadata. + """ + input: [MetadataInput!]! + ): UpdatePrivateMetadata + + """ + Assigns storefront's navigation menus. + """ + assignNavigation( + """ + ID of the menu. + """ + menu: ID + + """ + Type of the navigation bar to assign the menu to. + """ + navigationType: NavigationType! + ): AssignNavigation + + """ + Creates a new Menu. + """ + menuCreate( + """ + Fields required to create a menu. + """ + input: MenuCreateInput! + ): MenuCreate + + """ + Deletes a menu. + """ + menuDelete( + """ + ID of a menu to delete. + """ + id: ID! + ): MenuDelete + + """ + Deletes menus. + """ + menuBulkDelete( + """ + List of menu IDs to delete. + """ + ids: [ID]! + ): MenuBulkDelete + + """ + Updates a menu. + """ + menuUpdate( + """ + ID of a menu to update. + """ + id: ID! + + """ + Fields required to update a menu. + """ + input: MenuInput! + ): MenuUpdate + + """ + Creates a new menu item. + """ + menuItemCreate( + """ + Fields required to update a menu item. Only one of `url`, `category`, `page`, `collection` is allowed per item. + """ + input: MenuItemCreateInput! + ): MenuItemCreate + + """ + Deletes a menu item. + """ + menuItemDelete( + """ + ID of a menu item to delete. + """ + id: ID! + ): MenuItemDelete + + """ + Deletes menu items. + """ + menuItemBulkDelete( + """ + List of menu item IDs to delete. + """ + ids: [ID]! + ): MenuItemBulkDelete + + """ + Updates a menu item. + """ + menuItemUpdate( + """ + ID of a menu item to update. + """ + id: ID! + + """ + Fields required to update a menu item. Only one of `url`, `category`, `page`, `collection` is allowed per item. + """ + input: MenuItemInput! + ): MenuItemUpdate + + """ + Creates/Updates translations for Menu Item. + """ + menuItemTranslate( + """ + Menu Item ID. + """ + id: ID! + input: NameTranslationInput! + + """ + Translation language code. + """ + languageCode: LanguageCodeEnum! + ): MenuItemTranslate + + """ + Moves items of menus. + """ + menuItemMove( + """ + ID of the menu. + """ + menu: ID! + + """ + The menu position data. + """ + moves: [MenuItemMoveInput]! + ): MenuItemMove + + """ + Request an invoice for the order using plugin. + """ + invoiceRequest( + """ + Invoice number, if not provided it will be generated. + """ + number: String + + """ + ID of the order related to invoice. + """ + orderId: ID! + ): InvoiceRequest + + """ + Requests deletion of an invoice. + """ + invoiceRequestDelete( + """ + ID of an invoice to request the deletion. + """ + id: ID! + ): InvoiceRequestDelete + + """ + Creates a ready to send invoice. + """ + invoiceCreate( + """ + Fields required when creating an invoice. + """ + input: InvoiceCreateInput! + + """ + ID of the order related to invoice. + """ + orderId: ID! + ): InvoiceCreate + + """ + Deletes an invoice. + """ + invoiceDelete( + """ + ID of an invoice to delete. + """ + id: ID! + ): InvoiceDelete + + """ + Updates an invoice. + """ + invoiceUpdate( + """ + ID of an invoice to update. + """ + id: ID! + + """ + Fields to use when updating an invoice. + """ + input: UpdateInvoiceInput! + ): InvoiceUpdate + + """ + Send an invoice notification to the customer. + """ + invoiceSendNotification( + """ + ID of an invoice to be sent. + """ + id: ID! + ): InvoiceSendNotification + + """ + Activate a gift card. + """ + giftCardActivate( + """ + ID of a gift card to activate. + """ + id: ID! + ): GiftCardActivate + + """ + Creates a new gift card. + """ + giftCardCreate( + """ + Fields required to create a gift card. + """ + input: GiftCardCreateInput! + ): GiftCardCreate + + """ + Deactivate a gift card. + """ + giftCardDeactivate( + """ + ID of a gift card to deactivate. + """ + id: ID! + ): GiftCardDeactivate + + """ + Update a gift card. + """ + giftCardUpdate( + """ + ID of a gift card to update. + """ + id: ID! + + """ + Fields required to update a gift card. + """ + input: GiftCardUpdateInput! + ): GiftCardUpdate + + """ + Update plugin configuration. + """ + pluginUpdate( + """ + ID of a channel for which the data should be modified. + """ + channel: ID + + """ + ID of plugin to update. + """ + id: ID! + + """ + Fields required to update a plugin configuration. + """ + input: PluginUpdateInput! + ): PluginUpdate + + """ + Creates a new sale. + """ + saleCreate( + """ + Fields required to create a sale. + """ + input: SaleInput! + ): SaleCreate + + """ + Deletes a sale. + """ + saleDelete( + """ + ID of a sale to delete. + """ + id: ID! + ): SaleDelete + + """ + Deletes sales. + """ + saleBulkDelete( + """ + List of sale IDs to delete. + """ + ids: [ID]! + ): SaleBulkDelete + + """ + Updates a sale. + """ + saleUpdate( + """ + ID of a sale to update. + """ + id: ID! + + """ + Fields required to update a sale. + """ + input: SaleInput! + ): SaleUpdate + + """ + Adds products, categories, collections to a voucher. + """ + saleCataloguesAdd( + """ + ID of a sale. + """ + id: ID! + + """ + Fields required to modify catalogue IDs of sale. + """ + input: CatalogueInput! + ): SaleAddCatalogues + + """ + Removes products, categories, collections from a sale. + """ + saleCataloguesRemove( + """ + ID of a sale. + """ + id: ID! + + """ + Fields required to modify catalogue IDs of sale. + """ + input: CatalogueInput! + ): SaleRemoveCatalogues + + """ + Creates/updates translations for a sale. + """ + saleTranslate( + """ + Voucher ID. + """ + id: ID! + input: NameTranslationInput! + + """ + Translation language code. + """ + languageCode: LanguageCodeEnum! + ): SaleTranslate + + """ + Manage sale's availability in channels. + """ + saleChannelListingUpdate( + """ + ID of a sale to update. + """ + id: ID! + + """ + Fields required to update sale channel listings. + """ + input: SaleChannelListingInput! + ): SaleChannelListingUpdate + + """ + Creates a new voucher. + """ + voucherCreate( + """ + Fields required to create a voucher. + """ + input: VoucherInput! + ): VoucherCreate + + """ + Deletes a voucher. + """ + voucherDelete( + """ + ID of a voucher to delete. + """ + id: ID! + ): VoucherDelete + + """ + Deletes vouchers. + """ + voucherBulkDelete( + """ + List of voucher IDs to delete. + """ + ids: [ID]! + ): VoucherBulkDelete + + """ + Updates a voucher. + """ + voucherUpdate( + """ + ID of a voucher to update. + """ + id: ID! + + """ + Fields required to update a voucher. + """ + input: VoucherInput! + ): VoucherUpdate + + """ + Adds products, categories, collections to a voucher. + """ + voucherCataloguesAdd( + """ + ID of a voucher. + """ + id: ID! + + """ + Fields required to modify catalogue IDs of voucher. + """ + input: CatalogueInput! + ): VoucherAddCatalogues + + """ + Removes products, categories, collections from a voucher. + """ + voucherCataloguesRemove( + """ + ID of a voucher. + """ + id: ID! + + """ + Fields required to modify catalogue IDs of voucher. + """ + input: CatalogueInput! + ): VoucherRemoveCatalogues + + """ + Creates/Updates translations for Voucher. + """ + voucherTranslate( + """ + Voucher ID. + """ + id: ID! + input: NameTranslationInput! + + """ + Translation language code. + """ + languageCode: LanguageCodeEnum! + ): VoucherTranslate + + """ + Manage voucher's availability in channels. + """ + voucherChannelListingUpdate( + """ + ID of a voucher to update. + """ + id: ID! + + """ + Fields required to update voucher channel listings. + """ + input: VoucherChannelListingInput! + ): VoucherChannelListingUpdate + + """ + Export products to csv file. + """ + exportProducts( + """ + Fields required to export product data + """ + input: ExportProductsInput! + ): ExportProducts + + """ + Upload a file. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec + """ + fileUpload( + """ + Represents a file in a multipart request. + """ + file: Upload! + ): FileUpload + + """ + Adds a gift card or a voucher to a checkout. + """ + checkoutAddPromoCode( + """ + Checkout ID. + """ + checkoutId: ID! + + """ + Gift card code or voucher code. + """ + promoCode: String! + ): CheckoutAddPromoCode + + """ + Update billing address in the existing checkout. + """ + checkoutBillingAddressUpdate( + """ + The billing address of the checkout. + """ + billingAddress: AddressInput! + + """ + ID of the checkout. + """ + checkoutId: ID! + ): CheckoutBillingAddressUpdate + + """ + Completes the checkout. As a result a new order is created and a payment charge is made. This action requires a successful payment before it can be performed. In case additional confirmation step as 3D secure is required confirmationNeeded flag will be set to True and no order created until payment is confirmed with second call of this mutation. + """ + checkoutComplete( + """ + Checkout ID. + """ + checkoutId: ID! + + """ + Client-side generated data required to finalize the payment. + """ + paymentData: JSONString + + """ + URL of a view where users should be redirected to see the order details. URL in RFC 1808 format. + """ + redirectUrl: String + + """ + Determines whether to store the payment source for future usage. + """ + storeSource: Boolean = false + ): CheckoutComplete + + """ + Create a new checkout. + """ + checkoutCreate( + """ + Fields required to create checkout. + """ + input: CheckoutCreateInput! + ): CheckoutCreate + + """ + Sets the customer as the owner of the checkout. + """ + checkoutCustomerAttach( + """ + ID of the checkout. + """ + checkoutId: ID! + ): CheckoutCustomerAttach + + """ + Removes the user assigned as the owner of the checkout. + """ + checkoutCustomerDetach( + """ + Checkout ID. + """ + checkoutId: ID! + ): CheckoutCustomerDetach + + """ + Updates email address in the existing checkout object. + """ + checkoutEmailUpdate( + """ + Checkout ID. + """ + checkoutId: ID + + """ + email. + """ + email: String! + ): CheckoutEmailUpdate + + """ + Deletes a CheckoutLine. + """ + checkoutLineDelete( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + ID of the checkout line to delete. + """ + lineId: ID + ): CheckoutLineDelete + + """ + Adds a checkout line to the existing checkout. + """ + checkoutLinesAdd( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + A list of checkout lines, each containing information about an item in the checkout. + """ + lines: [CheckoutLineInput]! + ): CheckoutLinesAdd + + """ + Updates checkout line in the existing checkout. + """ + checkoutLinesUpdate( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + A list of checkout lines, each containing information about an item in the checkout. + """ + lines: [CheckoutLineInput]! + ): CheckoutLinesUpdate + + """ + Remove a gift card or a voucher from a checkout. + """ + checkoutRemovePromoCode( + """ + Checkout ID. + """ + checkoutId: ID! + + """ + Gift card code or voucher code. + """ + promoCode: String! + ): CheckoutRemovePromoCode + + """ + Create a new payment for given checkout. + """ + checkoutPaymentCreate( + """ + Checkout ID. + """ + checkoutId: ID! + + """ + Data required to create a new payment. + """ + input: PaymentInput! + ): CheckoutPaymentCreate + + """ + Update shipping address in the existing checkout. + """ + checkoutShippingAddressUpdate( + """ + ID of the checkout. + """ + checkoutId: ID! + + """ + The mailing address to where the checkout will be shipped. + """ + shippingAddress: AddressInput! + ): CheckoutShippingAddressUpdate + + """ + Updates the shipping address of the checkout. + """ + checkoutShippingMethodUpdate( + """ + Checkout ID. + """ + checkoutId: ID + + """ + Shipping method. + """ + shippingMethodId: ID! + ): CheckoutShippingMethodUpdate + + """ + Update language code in the existing checkout. + """ + checkoutLanguageCodeUpdate( + """ + ID of the checkout. + """ + checkoutId: ID! + + """ + New language code. + """ + languageCode: LanguageCodeEnum! + ): CheckoutLanguageCodeUpdate + + """ + Creates new channel. + """ + channelCreate( + """ + Fields required to create channel. + """ + input: ChannelCreateInput! + ): ChannelCreate + + """ + Update a channel. + """ + channelUpdate( + """ + ID of a channel to update. + """ + id: ID! + + """ + Fields required to update a channel. + """ + input: ChannelUpdateInput! + ): ChannelUpdate + + """ + Delete a channel. Orders associated with the deleted channel will be moved to the target channel. Checkouts, product availability, and pricing will be removed. + """ + channelDelete( + """ + ID of a channel to delete. + """ + id: ID! + + """ + Fields required to delete a channel. + """ + input: ChannelDeleteInput + ): ChannelDelete + + """ + Activate a channel. + """ + channelActivate( + """ + ID of the channel to activate. + """ + id: ID! + ): ChannelActivate + + """ + Deactivate a channel. + """ + channelDeactivate( + """ + ID of the channel to deactivate. + """ + id: ID! + ): ChannelDeactivate + + """ + Creates an attribute. + """ + attributeCreate( + """ + Fields required to create an attribute. + """ + input: AttributeCreateInput! + ): AttributeCreate + + """ + Deletes an attribute. + """ + attributeDelete( + """ + ID of an attribute to delete. + """ + id: ID! + ): AttributeDelete + + """ + Updates attribute. + """ + attributeUpdate( + """ + ID of an attribute to update. + """ + id: ID! + + """ + Fields required to update an attribute. + """ + input: AttributeUpdateInput! + ): AttributeUpdate + + """ + Creates/Updates translations for attribute. + """ + attributeTranslate( + """ + Attribute ID. + """ + id: ID! + input: NameTranslationInput! + + """ + Translation language code. + """ + languageCode: LanguageCodeEnum! + ): AttributeTranslate + + """ + Deletes attributes. + """ + attributeBulkDelete( + """ + List of attribute IDs to delete. + """ + ids: [ID]! + ): AttributeBulkDelete + + """ + Deletes values of attributes. + """ + attributeValueBulkDelete( + """ + List of attribute value IDs to delete. + """ + ids: [ID]! + ): AttributeValueBulkDelete + + """ + Creates a value for an attribute. + """ + attributeValueCreate( + """ + Attribute to which value will be assigned. + """ + attribute: ID! + + """ + Fields required to create an AttributeValue. + """ + input: AttributeValueCreateInput! + ): AttributeValueCreate + + """ + Deletes a value of an attribute. + """ + attributeValueDelete( + """ + ID of a value to delete. + """ + id: ID! + ): AttributeValueDelete + + """ + Updates value of an attribute. + """ + attributeValueUpdate( + """ + ID of an AttributeValue to update. + """ + id: ID! + + """ + Fields required to update an AttributeValue. + """ + input: AttributeValueCreateInput! + ): AttributeValueUpdate + + """ + Creates/Updates translations for attribute value. + """ + attributeValueTranslate( + """ + Attribute Value ID. + """ + id: ID! + input: AttributeValueTranslationInput! + + """ + Translation language code. + """ + languageCode: LanguageCodeEnum! + ): AttributeValueTranslate + + """ + Reorder the values of an attribute. + """ + attributeReorderValues( + """ + ID of an attribute. + """ + attributeId: ID! + + """ + The list of reordering operations for given attribute values. + """ + moves: [ReorderInput]! + ): AttributeReorderValues + + """ + Creates a new app. + """ + appCreate( + """ + Fields required to create a new app. + """ + input: AppInput! + ): AppCreate + + """ + Updates an existing app. + """ + appUpdate( + """ + ID of an app to update. + """ + id: ID! + + """ + Fields required to update an existing app. + """ + input: AppInput! + ): AppUpdate + + """ + Deletes an app. + """ + appDelete( + """ + ID of an app to delete. + """ + id: ID! + ): AppDelete + + """ + Creates a new token. + """ + appTokenCreate( + """ + Fields required to create a new auth token. + """ + input: AppTokenInput! + ): AppTokenCreate + + """ + Deletes an authentication token assigned to app. + """ + appTokenDelete( + """ + ID of an auth token to delete. + """ + id: ID! + ): AppTokenDelete + + """ + Verify provided app token. + """ + appTokenVerify( + """ + App token to verify. + """ + token: String! + ): AppTokenVerify + + """ + Install new app by using app manifest. + """ + appInstall( + """ + Fields required to install a new app. + """ + input: AppInstallInput! + ): AppInstall + + """ + Retry failed installation of new app. + """ + appRetryInstall( + """ + Determine if app will be set active or not. + """ + activateAfterInstallation: Boolean = true + + """ + ID of failed installation. + """ + id: ID! + ): AppRetryInstall + + """ + Delete failed installation. + """ + appDeleteFailedInstallation( + """ + ID of failed installation to delete. + """ + id: ID! + ): AppDeleteFailedInstallation + + """ + Fetch and validate manifest. + """ + appFetchManifest(manifestUrl: String!): AppFetchManifest + + """ + Activate the app. + """ + appActivate( + """ + ID of app to activate. + """ + id: ID! + ): AppActivate + + """ + Deactivate the app. + """ + appDeactivate( + """ + ID of app to deactivate. + """ + id: ID! + ): AppDeactivate + + """ + Create JWT token. + """ + tokenCreate( + """ + Email of a user. + """ + email: String! + + """ + Password of a user. + """ + password: String! + ): CreateToken + + """ + Refresh JWT token. Mutation tries to take refreshToken from the input.If it fails it will try to take refreshToken from the http-only cookie -refreshToken. csrfToken is required when refreshToken is provided as a cookie. + """ + tokenRefresh( + """ + CSRF token required to refresh token. This argument is required when refreshToken is provided as a cookie. + """ + csrfToken: String + + """ + Refresh token. + """ + refreshToken: String + ): RefreshToken + + """ + Verify JWT token. + """ + tokenVerify( + """ + JWT token to validate. + """ + token: String! + ): VerifyToken + + """ + Deactivate all JWT tokens of the currently authenticated user. + """ + tokensDeactivateAll: DeactivateAllUserTokens + + """ + Prepare external authentication url for user by custom plugin. + """ + externalAuthenticationUrl( + """ + The data required by plugin to create external authentication url. + """ + input: JSONString! + + """ + The ID of the authentication plugin. + """ + pluginId: String! + ): ExternalAuthenticationUrl + + """ + Obtain external access tokens for user by custom plugin. + """ + externalObtainAccessTokens( + """ + The data required by plugin to create authentication data. + """ + input: JSONString! + + """ + The ID of the authentication plugin. + """ + pluginId: String! + ): ExternalObtainAccessTokens + + """ + Refresh user's access by custom plugin. + """ + externalRefresh( + """ + The data required by plugin to proceed the refresh process. + """ + input: JSONString! + + """ + The ID of the authentication plugin. + """ + pluginId: String! + ): ExternalRefresh + + """ + Logout user by custom plugin. + """ + externalLogout( + """ + The data required by plugin to proceed the logout process. + """ + input: JSONString! + + """ + The ID of the authentication plugin. + """ + pluginId: String! + ): ExternalLogout + + """ + Verify external authentication data by plugin. + """ + externalVerify( + """ + The data required by plugin to proceed the verification. + """ + input: JSONString! + + """ + The ID of the authentication plugin. + """ + pluginId: String! + ): ExternalVerify + + """ + Sends an email with the account password modification link. + """ + requestPasswordReset( + """ + Slug of a channel which will be used for notify user. Optional when only one channel exists. + """ + channel: String + + """ + Email of the user that will be used for password recovery. + """ + email: String! + + """ + URL of a view where users should be redirected to reset the password. URL in RFC 1808 format. + """ + redirectUrl: String! + ): RequestPasswordReset + + """ + Confirm user account with token sent by email during registration. + """ + confirmAccount( + """ + E-mail of the user performing account confirmation. + """ + email: String! + + """ + A one-time token required to confirm the account. + """ + token: String! + ): ConfirmAccount + + """ + Sets the user's password from the token sent by email using the RequestPasswordReset mutation. + """ + setPassword( + """ + Email of a user. + """ + email: String! + + """ + Password of a user. + """ + password: String! + + """ + A one-time token required to set the password. + """ + token: String! + ): SetPassword + + """ + Change the password of the logged in user. + """ + passwordChange( + """ + New user password. + """ + newPassword: String! + + """ + Current user password. + """ + oldPassword: String! + ): PasswordChange + + """ + Request email change of the logged in user. + """ + requestEmailChange( + """ + Slug of a channel which will be used to notify users. Optional when only one channel exists. + """ + channel: String + + """ + New user email. + """ + newEmail: String! + + """ + User password. + """ + password: String! + + """ + URL of a view where users should be redirected to update the email address. URL in RFC 1808 format. + """ + redirectUrl: String! + ): RequestEmailChange + + """ + Confirm the email change of the logged-in user. + """ + confirmEmailChange( + """ + Slug of a channel which will be used to notify users. Optional when only one channel exists. + """ + channel: String + + """ + A one-time token required to change the email. + """ + token: String! + ): ConfirmEmailChange + + """ + Create a new address for the customer. + """ + accountAddressCreate( + """ + Fields required to create address. + """ + input: AddressInput! + + """ + A type of address. If provided, the new address will be automatically assigned as the customer's default address of that type. + """ + type: AddressTypeEnum + ): AccountAddressCreate + + """ + Updates an address of the logged-in user. + """ + accountAddressUpdate( + """ + ID of the address to update. + """ + id: ID! + + """ + Fields required to update the address. + """ + input: AddressInput! + ): AccountAddressUpdate + + """ + Delete an address of the logged-in user. + """ + accountAddressDelete( + """ + ID of the address to delete. + """ + id: ID! + ): AccountAddressDelete + + """ + Sets a default address for the authenticated user. + """ + accountSetDefaultAddress( + """ + ID of the address to set as default. + """ + id: ID! + + """ + The type of address. + """ + type: AddressTypeEnum! + ): AccountSetDefaultAddress + + """ + Register a new user. + """ + accountRegister( + """ + Fields required to create a user. + """ + input: AccountRegisterInput! + ): AccountRegister + + """ + Updates the account of the logged-in user. + """ + accountUpdate( + """ + Fields required to update the account of the logged-in user. + """ + input: AccountInput! + ): AccountUpdate + + """ + Sends an email with the account removal link for the logged-in user. + """ + accountRequestDeletion( + """ + Slug of a channel which will be used to notify users. Optional when only one channel exists. + """ + channel: String + + """ + URL of a view where users should be redirected to delete their account. URL in RFC 1808 format. + """ + redirectUrl: String! + ): AccountRequestDeletion + + """ + Remove user account. + """ + accountDelete( + """ + A one-time token required to remove account. Sent by email using AccountRequestDeletion mutation. + """ + token: String! + ): AccountDelete + + """ + Creates user address. + """ + addressCreate( + """ + Fields required to create address. + """ + input: AddressInput! + + """ + ID of a user to create address for. + """ + userId: ID! + ): AddressCreate + + """ + Updates an address. + """ + addressUpdate( + """ + ID of the address to update. + """ + id: ID! + + """ + Fields required to update the address. + """ + input: AddressInput! + ): AddressUpdate + + """ + Deletes an address. + """ + addressDelete( + """ + ID of the address to delete. + """ + id: ID! + ): AddressDelete + + """ + Sets a default address for the given user. + """ + addressSetDefault( + """ + ID of the address. + """ + addressId: ID! + + """ + The type of address. + """ + type: AddressTypeEnum! + + """ + ID of the user to change the address for. + """ + userId: ID! + ): AddressSetDefault + + """ + Creates a new customer. + """ + customerCreate( + """ + Fields required to create a customer. + """ + input: UserCreateInput! + ): CustomerCreate + + """ + Updates an existing customer. + """ + customerUpdate( + """ + ID of a customer to update. + """ + id: ID! + + """ + Fields required to update a customer. + """ + input: CustomerInput! + ): CustomerUpdate + + """ + Deletes a customer. + """ + customerDelete( + """ + ID of a customer to delete. + """ + id: ID! + ): CustomerDelete + + """ + Deletes customers. + """ + customerBulkDelete( + """ + List of user IDs to delete. + """ + ids: [ID]! + ): CustomerBulkDelete + + """ + Creates a new staff user. + """ + staffCreate( + """ + Fields required to create a staff user. + """ + input: StaffCreateInput! + ): StaffCreate + + """ + Updates an existing staff user. + """ + staffUpdate( + """ + ID of a staff user to update. + """ + id: ID! + + """ + Fields required to update a staff user. + """ + input: StaffUpdateInput! + ): StaffUpdate + + """ + Deletes a staff user. + """ + staffDelete( + """ + ID of a staff user to delete. + """ + id: ID! + ): StaffDelete + + """ + Deletes staff users. + """ + staffBulkDelete( + """ + List of user IDs to delete. + """ + ids: [ID]! + ): StaffBulkDelete + + """ + Create a user avatar. Only for staff members. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec + """ + userAvatarUpdate( + """ + Represents an image file in a multipart request. + """ + image: Upload! + ): UserAvatarUpdate + + """ + Deletes a user avatar. Only for staff members. + """ + userAvatarDelete: UserAvatarDelete + + """ + Activate or deactivate users. + """ + userBulkSetActive( + """ + List of user IDs to (de)activate). + """ + ids: [ID]! + + """ + Determine if users will be set active or not. + """ + isActive: Boolean! + ): UserBulkSetActive + + """ + Create new permission group. + """ + permissionGroupCreate( + """ + Input fields to create permission group. + """ + input: PermissionGroupCreateInput! + ): PermissionGroupCreate + + """ + Update permission group. + """ + permissionGroupUpdate( + """ + ID of the group to update. + """ + id: ID! + + """ + Input fields to create permission group. + """ + input: PermissionGroupUpdateInput! + ): PermissionGroupUpdate + + """ + Delete permission group. + """ + permissionGroupDelete( + """ + ID of the group to delete. + """ + id: ID! + ): PermissionGroupDelete +} + +input NameTranslationInput { + name: String +} + +enum NavigationType { + """ + Main storefront navigation. + """ + MAIN + + """ + Secondary storefront navigation. + """ + SECONDARY +} + +""" +An object with an ID +""" +interface Node { + """ + The ID of the object. + """ + id: ID! +} + +interface ObjectWithMetadata { + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! +} + +""" +Represents an order in the shop. +""" +type Order implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + created: DateTime! + status: OrderStatus! + user: User + trackingClientId: String! + billingAddress: Address + shippingAddress: Address + shippingMethod: ShippingMethod + shippingMethodName: String + channel: Channel! + + """ + Total price of shipping. + """ + shippingPrice: TaxedMoney! + shippingTaxRate: Float! + token: String! + voucher: Voucher + + """ + List of user gift cards. + """ + giftCards: [GiftCard] + displayGrossPrices: Boolean! + customerNote: String! + weight: Weight + redirectUrl: String + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + List of shipments for the order. + """ + fulfillments: [Fulfillment]! + + """ + List of order lines. + """ + lines: [OrderLine]! + + """ + List of actions that can be performed in the current state of an order. + """ + actions: [OrderAction]! + + """ + Shipping methods that can be used with this order. + """ + availableShippingMethods: [ShippingMethod] + + """ + List of order invoices. + """ + invoices: [Invoice] + + """ + User-friendly number of an order. + """ + number: String + + """ + The ID of the order that was the base for this order. + """ + original: ID + + """ + The order origin. + """ + origin: OrderOriginEnum! + + """ + Informs if an order is fully paid. + """ + isPaid: Boolean! + + """ + Internal payment status. + """ + paymentStatus: PaymentChargeStatusEnum! + + """ + User-friendly payment status. + """ + paymentStatusDisplay: String! + + """ + List of payments for the order. + """ + payments: [Payment] + + """ + Total amount of the order. + """ + total: TaxedMoney! + + """ + Undiscounted total amount of the order. + """ + undiscountedTotal: TaxedMoney! + + """ + The sum of line prices not including shipping. + """ + subtotal: TaxedMoney! + + """ + User-friendly order status. + """ + statusDisplay: String + + """ + Informs whether a draft order can be finalized(turned into a regular order). + """ + canFinalize: Boolean! + + """ + Amount authorized for the order. + """ + totalAuthorized: Money! + + """ + Amount captured by payment. + """ + totalCaptured: Money! + + """ + List of events associated with the order. + """ + events: [OrderEvent] + + """ + The difference between the paid and the order total amount. + """ + totalBalance: Money! + + """ + Email address of the customer. + """ + userEmail: String + + """ + Returns True, if order requires shipping. + """ + isShippingRequired: Boolean! + languageCode: String! + @deprecated( + reason: "Use the `languageCodeEnum` field to fetch the language code. This field will be removed in Saleor 4.0." + ) + + """ + Order language code. + """ + languageCodeEnum: LanguageCodeEnum! + + """ + Returns applied discount. + """ + discount: Money @deprecated(reason: "Use discounts field. This field will be removed in Saleor 4.0.") + + """ + Discount name. + """ + discountName: String @deprecated(reason: "Use discounts field. This field will be removed in Saleor 4.0.") + + """ + Translated discount name. + """ + translatedDiscountName: String @deprecated(reason: "Use discounts field. This field will be removed in Saleor 4.0.") + + """ + List of all discounts assigned to the order. + """ + discounts: [OrderDiscount!] +} + +enum OrderAction { + """ + Represents the capture action. + """ + CAPTURE + + """ + Represents a mark-as-paid action. + """ + MARK_AS_PAID + + """ + Represents a refund action. + """ + REFUND + + """ + Represents a void action. + """ + VOID +} + +""" +Adds note to the order. +""" +type OrderAddNote { + """ + Order with the note added. + """ + order: Order + + """ + Order note created. + """ + event: OrderEvent + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +input OrderAddNoteInput { + """ + Note message. + """ + message: String! +} + +""" +Cancels orders. +""" +type OrderBulkCancel { + """ + Returns how many objects were affected. + """ + count: Int! + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +Cancel an order. +""" +type OrderCancel { + """ + Canceled order. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +Capture an order. +""" +type OrderCapture { + """ + Captured order. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +Confirms an unconfirmed order by changing status to unfulfilled. +""" +type OrderConfirm { + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +type OrderCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [OrderCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type OrderCountableEdge { + """ + The item at the end of the edge. + """ + node: Order! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +enum OrderDirection { + """ + Specifies an ascending sort order. + """ + ASC + + """ + Specifies a descending sort order. + """ + DESC +} + +""" +Contains all details related to the applied discount to the order. +""" +type OrderDiscount implements Node { + """ + The ID of the object. + """ + id: ID! + type: OrderDiscountType! + + """ + Type of the discount: fixed or percent + """ + valueType: DiscountValueTypeEnum! + + """ + Value of the discount. Can store fixed value or percent value + """ + value: PositiveDecimal! + name: String + translatedName: String + + """ + Explanation for the applied discount. + """ + reason: String + + """ + Returns amount of discount. + """ + amount: Money! +} + +""" +Adds discount to the order. +""" +type OrderDiscountAdd { + """ + Order which has been discounted. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +input OrderDiscountCommonInput { + """ + Type of the discount: fixed or percent + """ + valueType: DiscountValueTypeEnum! + + """ + Value of the discount. Can store fixed value or percent value + """ + value: PositiveDecimal! + + """ + Explanation for the applied discount. + """ + reason: String +} + +""" +Remove discount from the order. +""" +type OrderDiscountDelete { + """ + Order which has removed discount. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +An enumeration. +""" +enum OrderDiscountType { + """ + Voucher + """ + VOUCHER + + """ + Manual + """ + MANUAL +} + +""" +Update discount for the order. +""" +type OrderDiscountUpdate { + """ + Order which has been discounted. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +input OrderDraftFilterInput { + customer: String + created: DateRangeInput + search: String + metadata: [MetadataInput] + channels: [ID] +} + +type OrderError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: OrderErrorCode! + + """ + Warehouse ID which causes the error. + """ + warehouse: ID + + """ + Order line ID which causes the error. + """ + orderLine: ID + + """ + List of product variants that are associated with the error + """ + variants: [ID!] + + """ + A type of address that causes the error. + """ + addressType: AddressTypeEnum +} + +""" +An enumeration. +""" +enum OrderErrorCode { + BILLING_ADDRESS_NOT_SET + CANNOT_CANCEL_FULFILLMENT + CANNOT_CANCEL_ORDER + CANNOT_DELETE + CANNOT_DISCOUNT + CANNOT_REFUND + CAPTURE_INACTIVE_PAYMENT + NOT_EDITABLE + FULFILL_ORDER_LINE + GRAPHQL_ERROR + INVALID + PRODUCT_NOT_PUBLISHED + PRODUCT_UNAVAILABLE_FOR_PURCHASE + NOT_FOUND + ORDER_NO_SHIPPING_ADDRESS + PAYMENT_ERROR + PAYMENT_MISSING + REQUIRED + SHIPPING_METHOD_NOT_APPLICABLE + SHIPPING_METHOD_REQUIRED + TAX_ERROR + UNIQUE + VOID_INACTIVE_PAYMENT + ZERO_QUANTITY + INVALID_QUANTITY + INSUFFICIENT_STOCK + DUPLICATED_INPUT_ITEM + NOT_AVAILABLE_IN_CHANNEL + CHANNEL_INACTIVE +} + +""" +History log of the order. +""" +type OrderEvent implements Node { + """ + The ID of the object. + """ + id: ID! + + """ + Date when event happened at in ISO 8601 format. + """ + date: DateTime + + """ + Order event type. + """ + type: OrderEventsEnum + + """ + User who performed the action. + """ + user: User + + """ + Content of the event. + """ + message: String + + """ + Email of the customer. + """ + email: String + + """ + Type of an email sent to the customer. + """ + emailType: OrderEventsEmailsEnum + + """ + Amount of money. + """ + amount: Float + + """ + The payment ID from the payment gateway. + """ + paymentId: String + + """ + The payment gateway of the payment. + """ + paymentGateway: String + + """ + Number of items. + """ + quantity: Int + + """ + Composed ID of the Fulfillment. + """ + composedId: String + + """ + User-friendly number of an order. + """ + orderNumber: String + + """ + Number of an invoice related to the order. + """ + invoiceNumber: String + + """ + List of oversold lines names. + """ + oversoldItems: [String] + + """ + The concerned lines. + """ + lines: [OrderEventOrderLineObject] + + """ + The lines fulfilled. + """ + fulfilledItems: [FulfillmentLine] + + """ + The warehouse were items were restocked. + """ + warehouse: Warehouse + + """ + The transaction reference of captured payment. + """ + transactionReference: String + + """ + Define if shipping costs were included to the refund. + """ + shippingCostsIncluded: Boolean + + """ + The order which is related to this order. + """ + relatedOrder: Order + + """ + The discount applied to the order. + """ + discount: OrderEventDiscountObject +} + +type OrderEventCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [OrderEventCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type OrderEventCountableEdge { + """ + The item at the end of the edge. + """ + node: OrderEvent! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +type OrderEventDiscountObject { + """ + Type of the discount: fixed or percent. + """ + valueType: DiscountValueTypeEnum! + + """ + Value of the discount. Can store fixed value or percent value. + """ + value: PositiveDecimal! + + """ + Explanation for the applied discount. + """ + reason: String + + """ + Returns amount of discount. + """ + amount: Money + + """ + Type of the discount: fixed or percent. + """ + oldValueType: DiscountValueTypeEnum + + """ + Value of the discount. Can store fixed value or percent value. + """ + oldValue: PositiveDecimal + + """ + Returns amount of discount. + """ + oldAmount: Money +} + +type OrderEventOrderLineObject { + """ + The variant quantity. + """ + quantity: Int + + """ + The order line. + """ + orderLine: OrderLine + + """ + The variant name. + """ + itemName: String + + """ + The discount applied to the order line. + """ + discount: OrderEventDiscountObject +} + +""" +An enumeration. +""" +enum OrderEventsEmailsEnum { + PAYMENT_CONFIRMATION + CONFIRMED + SHIPPING_CONFIRMATION + TRACKING_UPDATED + ORDER_CONFIRMATION + ORDER_CANCEL + ORDER_REFUND + FULFILLMENT_CONFIRMATION + DIGITAL_LINKS +} + +""" +An enumeration. +""" +enum OrderEventsEnum { + DRAFT_CREATED + DRAFT_CREATED_FROM_REPLACE + ADDED_PRODUCTS + REMOVED_PRODUCTS + PLACED + PLACED_FROM_DRAFT + OVERSOLD_ITEMS + CANCELED + ORDER_MARKED_AS_PAID + ORDER_FULLY_PAID + ORDER_REPLACEMENT_CREATED + ORDER_DISCOUNT_ADDED + ORDER_DISCOUNT_AUTOMATICALLY_UPDATED + ORDER_DISCOUNT_UPDATED + ORDER_DISCOUNT_DELETED + ORDER_LINE_DISCOUNT_UPDATED + ORDER_LINE_DISCOUNT_REMOVED + UPDATED_ADDRESS + EMAIL_SENT + CONFIRMED + PAYMENT_AUTHORIZED + PAYMENT_CAPTURED + EXTERNAL_SERVICE_NOTIFICATION + PAYMENT_REFUNDED + PAYMENT_VOIDED + PAYMENT_FAILED + INVOICE_REQUESTED + INVOICE_GENERATED + INVOICE_UPDATED + INVOICE_SENT + FULFILLMENT_CANCELED + FULFILLMENT_RESTOCKED_ITEMS + FULFILLMENT_FULFILLED_ITEMS + FULFILLMENT_REFUNDED + FULFILLMENT_RETURNED + FULFILLMENT_REPLACED + TRACKING_UPDATED + NOTE_ADDED + OTHER +} + +input OrderFilterInput { + paymentStatus: [PaymentChargeStatusEnum] + status: [OrderStatusFilter] + customer: String + created: DateRangeInput + search: String + metadata: [MetadataInput] + channels: [ID] +} + +""" +Creates new fulfillments for an order. +""" +type OrderFulfill { + """ + List of created fulfillments. + """ + fulfillments: [Fulfillment] + + """ + Fulfilled order. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +input OrderFulfillInput { + """ + List of items informing how to fulfill the order. + """ + lines: [OrderFulfillLineInput!]! + + """ + If true, send an email notification to the customer. + """ + notifyCustomer: Boolean +} + +input OrderFulfillLineInput { + """ + The ID of the order line. + """ + orderLineId: ID + + """ + List of stock items to create. + """ + stocks: [OrderFulfillStockInput!]! +} + +input OrderFulfillStockInput { + """ + The number of line items to be fulfilled from given warehouse. + """ + quantity: Int! + + """ + ID of the warehouse from which the item will be fulfilled. + """ + warehouse: ID! +} + +""" +Represents order line of particular order. +""" +type OrderLine implements Node { + """ + The ID of the object. + """ + id: ID! + productName: String! + variantName: String! + productSku: String! + isShippingRequired: Boolean! + quantity: Int! + quantityFulfilled: Int! + unitDiscountReason: String + taxRate: Float! + digitalContentUrl: DigitalContentUrl + + """ + The main thumbnail for the ordered product. + """ + thumbnail( + """ + Size of thumbnail. + """ + size: Int + ): Image + + """ + Price of the single item in the order line. + """ + unitPrice: TaxedMoney! + + """ + Price of the single item in the order line without applied an order line discount. + """ + undiscountedUnitPrice: TaxedMoney! + + """ + The discount applied to the single order line. + """ + unitDiscount: Money! + + """ + Value of the discount. Can store fixed value or percent value + """ + unitDiscountValue: PositiveDecimal! + + """ + Price of the order line. + """ + totalPrice: TaxedMoney! + + """ + A purchased product variant. Note: this field may be null if the variant has been removed from stock at all. + """ + variant: ProductVariant + + """ + Product name in the customer's language + """ + translatedProductName: String! + + """ + Variant name in the customer's language + """ + translatedVariantName: String! + + """ + List of allocations across warehouses. + """ + allocations: [Allocation!] + + """ + Type of the discount: fixed or percent + """ + unitDiscountType: DiscountValueTypeEnum +} + +input OrderLineCreateInput { + """ + Number of variant items ordered. + """ + quantity: Int! + + """ + Product variant ID. + """ + variantId: ID! +} + +""" +Deletes an order line from an order. +""" +type OrderLineDelete { + """ + A related order. + """ + order: Order + + """ + An order line that was deleted. + """ + orderLine: OrderLine + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +Remove discount applied to the order line. +""" +type OrderLineDiscountRemove { + """ + Order line which has removed discount. + """ + orderLine: OrderLine + + """ + Order which is related to line which has removed discount. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +Update discount for the order line. +""" +type OrderLineDiscountUpdate { + """ + Order line which has been discounted. + """ + orderLine: OrderLine + + """ + Order which is related to the discounted line. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +input OrderLineInput { + """ + Number of variant items ordered. + """ + quantity: Int! +} + +""" +Updates an order line of an order. +""" +type OrderLineUpdate { + """ + Related order. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! + orderLine: OrderLine +} + +""" +Create order lines for an order. +""" +type OrderLinesCreate { + """ + Related order. + """ + order: Order + + """ + List of added order lines. + """ + orderLines: [OrderLine!] + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +Mark order as manually paid. +""" +type OrderMarkAsPaid { + """ + Order marked as paid. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +An enumeration. +""" +enum OrderOriginEnum { + CHECKOUT + DRAFT + REISSUE +} + +""" +Refund an order. +""" +type OrderRefund { + """ + A refunded order. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +input OrderRefundFulfillmentLineInput { + """ + The ID of the fulfillment line to refund. + """ + fulfillmentLineId: ID! + + """ + The number of items to be refunded. + """ + quantity: Int! +} + +input OrderRefundLineInput { + """ + The ID of the order line to refund. + """ + orderLineId: ID! + + """ + The number of items to be refunded. + """ + quantity: Int! +} + +input OrderRefundProductsInput { + """ + List of unfulfilled lines to refund. + """ + orderLines: [OrderRefundLineInput!] + + """ + List of fulfilled lines to refund. + """ + fulfillmentLines: [OrderRefundFulfillmentLineInput!] + + """ + The total amount of refund when the value is provided manually. + """ + amountToRefund: PositiveDecimal + + """ + If true, Saleor will refund shipping costs. If amountToRefund is providedincludeShippingCosts will be ignored. + """ + includeShippingCosts: Boolean = false +} + +input OrderReturnFulfillmentLineInput { + """ + The ID of the fulfillment line to return. + """ + fulfillmentLineId: ID! + + """ + The number of items to be returned. + """ + quantity: Int! + + """ + Determines, if the line should be added to replace order. + """ + replace: Boolean = false +} + +input OrderReturnLineInput { + """ + The ID of the order line to return. + """ + orderLineId: ID! + + """ + The number of items to be returned. + """ + quantity: Int! + + """ + Determines, if the line should be added to replace order. + """ + replace: Boolean = false +} + +input OrderReturnProductsInput { + """ + List of unfulfilled lines to return. + """ + orderLines: [OrderReturnLineInput!] + + """ + List of fulfilled lines to return. + """ + fulfillmentLines: [OrderReturnFulfillmentLineInput!] + + """ + The total amount of refund when the value is provided manually. + """ + amountToRefund: PositiveDecimal + + """ + If true, Saleor will refund shipping costs. If amountToRefund is providedincludeShippingCosts will be ignored. + """ + includeShippingCosts: Boolean = false + + """ + If true, Saleor will call refund action for all lines. + """ + refund: Boolean = false +} + +""" +Order related settings from site settings. +""" +type OrderSettings { + automaticallyConfirmAllNewOrders: Boolean! +} + +type OrderSettingsError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: OrderSettingsErrorCode! +} + +""" +An enumeration. +""" +enum OrderSettingsErrorCode { + INVALID +} + +""" +Update shop order settings. +""" +type OrderSettingsUpdate { + """ + Order settings. + """ + orderSettings: OrderSettings + orderSettingsErrors: [OrderSettingsError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderSettingsError!]! +} + +input OrderSettingsUpdateInput { + """ + When disabled, all new orders from checkout will be marked as unconfirmed. When enabled orders from checkout will become unfulfilled immediately. + """ + automaticallyConfirmAllNewOrders: Boolean! +} + +enum OrderSortField { + """ + Sort orders by number. + """ + NUMBER + + """ + Sort orders by creation date. + """ + CREATION_DATE + + """ + Sort orders by customer. + """ + CUSTOMER + + """ + Sort orders by payment. + """ + PAYMENT + + """ + Sort orders by fulfillment status. + """ + FULFILLMENT_STATUS +} + +input OrderSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort orders by the selected field. + """ + field: OrderSortField! +} + +""" +An enumeration. +""" +enum OrderStatus { + """ + Draft + """ + DRAFT + + """ + Unconfirmed + """ + UNCONFIRMED + + """ + Unfulfilled + """ + UNFULFILLED + + """ + Partially fulfilled + """ + PARTIALLY_FULFILLED + + """ + Partially returned + """ + PARTIALLY_RETURNED + + """ + Returned + """ + RETURNED + + """ + Fulfilled + """ + FULFILLED + + """ + Canceled + """ + CANCELED +} + +enum OrderStatusFilter { + READY_TO_FULFILL + READY_TO_CAPTURE + UNFULFILLED + UNCONFIRMED + PARTIALLY_FULFILLED + FULFILLED + CANCELED +} + +""" +Updates an order. +""" +type OrderUpdate { + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! + order: Order +} + +input OrderUpdateInput { + """ + Billing address of the customer. + """ + billingAddress: AddressInput + + """ + Email address of the customer. + """ + userEmail: String + + """ + Shipping address of the customer. + """ + shippingAddress: AddressInput +} + +""" +Updates a shipping method of the order. +""" +type OrderUpdateShipping { + """ + Order with updated shipping method. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +input OrderUpdateShippingInput { + """ + ID of the selected shipping method. + """ + shippingMethod: ID +} + +""" +Void an order. +""" +type OrderVoid { + """ + A voided order. + """ + order: Order + orderErrors: [OrderError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [OrderError!]! +} + +""" +A static page that can be manually added by a shop operator through the dashboard. +""" +type Page implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + seoTitle: String + seoDescription: String + title: String! + content: JSONString + publicationDate: Date + isPublished: Boolean! + slug: String! + pageType: PageType! + created: DateTime! + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + Content of the page (JSON). + """ + contentJson: JSONString! @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.") + + """ + Returns translated page fields for the given language code. + """ + translation( + """ + A language code to return the translation for page. + """ + languageCode: LanguageCodeEnum! + ): PageTranslation + + """ + List of attributes assigned to this product. + """ + attributes: [SelectedAttribute!]! +} + +""" +Assign attributes to a given page type. +""" +type PageAttributeAssign { + """ + The updated page type. + """ + pageType: PageType + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! +} + +""" +Unassign attributes from a given page type. +""" +type PageAttributeUnassign { + """ + The updated page type. + """ + pageType: PageType + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! +} + +""" +Deletes pages. +""" +type PageBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! +} + +""" +Publish pages. +""" +type PageBulkPublish { + """ + Returns how many objects were affected. + """ + count: Int! + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! +} + +type PageCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [PageCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type PageCountableEdge { + """ + The item at the end of the edge. + """ + node: Page! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new page. +""" +type PageCreate { + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! + page: Page +} + +input PageCreateInput { + """ + Page internal name. + """ + slug: String + + """ + Page title. + """ + title: String + + """ + Page content in JSON format. + """ + content: JSONString + + """ + List of attributes. + """ + attributes: [AttributeValueInput!] + + """ + Determines if page is visible in the storefront. + """ + isPublished: Boolean + + """ + Publication date. ISO 8601 standard. + """ + publicationDate: String + + """ + Search engine optimization fields. + """ + seo: SeoInput + + """ + ID of the page type that page belongs to. + """ + pageType: ID! +} + +""" +Deletes a page. +""" +type PageDelete { + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! + page: Page +} + +type PageError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: PageErrorCode! + + """ + List of attributes IDs which causes the error. + """ + attributes: [ID!] + + """ + List of attribute values IDs which causes the error. + """ + values: [ID!] +} + +""" +An enumeration. +""" +enum PageErrorCode { + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE + DUPLICATED_INPUT_ITEM + ATTRIBUTE_ALREADY_ASSIGNED +} + +input PageFilterInput { + search: String + metadata: [MetadataInput] + pageTypes: [ID] +} + +""" +The Relay compliant `PageInfo` type, containing data necessary to paginate this connection. +""" +type PageInfo { + """ + When paginating forwards, are there more items? + """ + hasNextPage: Boolean! + + """ + When paginating backwards, are there more items? + """ + hasPreviousPage: Boolean! + + """ + When paginating backwards, the cursor to continue. + """ + startCursor: String + + """ + When paginating forwards, the cursor to continue. + """ + endCursor: String +} + +input PageInput { + """ + Page internal name. + """ + slug: String + + """ + Page title. + """ + title: String + + """ + Page content in JSON format. + """ + content: JSONString + + """ + List of attributes. + """ + attributes: [AttributeValueInput!] + + """ + Determines if page is visible in the storefront. + """ + isPublished: Boolean + + """ + Publication date. ISO 8601 standard. + """ + publicationDate: String + + """ + Search engine optimization fields. + """ + seo: SeoInput +} + +""" +Reorder page attribute values. +""" +type PageReorderAttributeValues { + """ + Page from which attribute values are reordered. + """ + page: Page + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! +} + +enum PageSortField { + """ + Sort pages by title. + """ + TITLE + + """ + Sort pages by slug. + """ + SLUG + + """ + Sort pages by visibility. + """ + VISIBILITY + + """ + Sort pages by creation date. + """ + CREATION_DATE + + """ + Sort pages by publication date. + """ + PUBLICATION_DATE +} + +input PageSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort pages by the selected field. + """ + field: PageSortField! +} + +type PageTranslatableContent implements Node { + """ + The ID of the object. + """ + id: ID! + seoTitle: String + seoDescription: String + title: String! + content: JSONString + + """ + Content of the page (JSON). + """ + contentJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.") + + """ + Returns translated page fields for the given language code. + """ + translation( + """ + A language code to return the translation for page. + """ + languageCode: LanguageCodeEnum! + ): PageTranslation + + """ + ('A static page that can be manually added by a shop operator ', 'through the dashboard.') + """ + page: Page +} + +""" +Creates/Updates translations for Page. +""" +type PageTranslate { + translationErrors: [TranslationError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [TranslationError!]! + page: PageTranslatableContent +} + +type PageTranslation implements Node { + """ + The ID of the object. + """ + id: ID! + seoTitle: String + seoDescription: String + title: String! + content: JSONString + + """ + Translation language. + """ + language: LanguageDisplay! + + """ + Translated description of the page (JSON). + """ + contentJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `content` field instead.") +} + +input PageTranslationInput { + seoTitle: String + seoDescription: String + title: String + content: JSONString +} + +""" +Represents a type of page. It defines what attributes are available to pages of this type. +""" +type PageType implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + name: String! + slug: String! + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + Page attributes of that page type. + """ + attributes: [Attribute] + + """ + Attributes that can be assigned to the page type. + """ + availableAttributes( + filter: AttributeFilterInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): AttributeCountableConnection + + """ + Whether page type has pages assigned. + """ + hasPages: Boolean +} + +""" +Delete page types. +""" +type PageTypeBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! +} + +type PageTypeCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [PageTypeCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type PageTypeCountableEdge { + """ + The item at the end of the edge. + """ + node: PageType! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Create a new page type. +""" +type PageTypeCreate { + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! + pageType: PageType +} + +input PageTypeCreateInput { + """ + Name of the page type. + """ + name: String + + """ + Page type slug. + """ + slug: String + + """ + List of attribute IDs to be assigned to the page type. + """ + addAttributes: [ID!] +} + +""" +Delete a page type. +""" +type PageTypeDelete { + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! + pageType: PageType +} + +input PageTypeFilterInput { + search: String +} + +""" +Reorder the attributes of a page type. +""" +type PageTypeReorderAttributes { + """ + Page type from which attributes are reordered. + """ + pageType: PageType + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! +} + +enum PageTypeSortField { + """ + Sort page types by name. + """ + NAME + + """ + Sort page types by slug. + """ + SLUG +} + +input PageTypeSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort page types by the selected field. + """ + field: PageTypeSortField! +} + +""" +Update page type. +""" +type PageTypeUpdate { + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! + pageType: PageType +} + +input PageTypeUpdateInput { + """ + Name of the page type. + """ + name: String + + """ + Page type slug. + """ + slug: String + + """ + List of attribute IDs to be assigned to the page type. + """ + addAttributes: [ID!] + + """ + List of attribute IDs to be assigned to the page type. + """ + removeAttributes: [ID!] +} + +""" +Updates an existing page. +""" +type PageUpdate { + pageErrors: [PageError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PageError!]! + page: Page +} + +""" +Change the password of the logged in user. +""" +type PasswordChange { + """ + A user instance with a new password. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Represents a payment of a given type. +""" +type Payment implements Node { + """ + The ID of the object. + """ + id: ID! + gateway: String! + isActive: Boolean! + created: DateTime! + modified: DateTime! + token: String! + checkout: Checkout + order: Order + paymentMethodType: String! + customerIpAddress: String + + """ + Internal payment status. + """ + chargeStatus: PaymentChargeStatusEnum! + + """ + List of actions that can be performed in the current state of a payment. + """ + actions: [OrderAction]! + + """ + Total amount of the payment. + """ + total: Money + + """ + Total amount captured for this payment. + """ + capturedAmount: Money + + """ + List of all transactions within this payment. + """ + transactions: [Transaction] + + """ + Maximum amount of money that can be captured. + """ + availableCaptureAmount: Money + + """ + Maximum amount of money that can be refunded. + """ + availableRefundAmount: Money + + """ + The details of the card used for this payment. + """ + creditCard: CreditCard +} + +""" +Captures the authorized payment amount. +""" +type PaymentCapture { + """ + Updated payment. + """ + payment: Payment + paymentErrors: [PaymentError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PaymentError!]! +} + +""" +An enumeration. +""" +enum PaymentChargeStatusEnum { + NOT_CHARGED + PENDING + PARTIALLY_CHARGED + FULLY_CHARGED + PARTIALLY_REFUNDED + FULLY_REFUNDED + REFUSED + CANCELLED +} + +type PaymentCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [PaymentCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type PaymentCountableEdge { + """ + The item at the end of the edge. + """ + node: Payment! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +type PaymentError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: PaymentErrorCode! +} + +""" +An enumeration. +""" +enum PaymentErrorCode { + BILLING_ADDRESS_NOT_SET + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE + PARTIAL_PAYMENT_NOT_ALLOWED + SHIPPING_ADDRESS_NOT_SET + INVALID_SHIPPING_METHOD + SHIPPING_METHOD_NOT_SET + PAYMENT_ERROR + NOT_SUPPORTED_GATEWAY + CHANNEL_INACTIVE +} + +input PaymentFilterInput { + checkouts: [ID] +} + +""" +Available payment gateway backend with configuration necessary to setup client. +""" +type PaymentGateway { + """ + Payment gateway name. + """ + name: String! + + """ + Payment gateway ID. + """ + id: ID! + + """ + Payment gateway client configuration. + """ + config: [GatewayConfigLine!]! + + """ + Payment gateway supported currencies. + """ + currencies: [String]! +} + +""" +Initializes payment process when it is required by gateway. +""" +type PaymentInitialize { + initializedPayment: PaymentInitialized + paymentErrors: [PaymentError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PaymentError!]! +} + +""" +Server-side data generated by a payment gateway. Optional step when the payment provider requires an additional action to initialize payment session. +""" +type PaymentInitialized { + """ + ID of a payment gateway. + """ + gateway: String! + + """ + Payment gateway name. + """ + name: String! + + """ + Initialized data by gateway. + """ + data: JSONString +} + +input PaymentInput { + """ + A gateway to use with that payment. + """ + gateway: String! + + """ + Client-side generated payment token, representing customer's billing data in a secure manner. + """ + token: String + + """ + Total amount of the transaction, including all taxes and discounts. If no amount is provided, the checkout total will be used. + """ + amount: PositiveDecimal + + """ + URL of a storefront view where user should be redirected after requiring additional actions. Payment with additional actions will not be finished if this field is not provided. + """ + returnUrl: String +} + +""" +Refunds the captured payment amount. +""" +type PaymentRefund { + """ + Updated payment. + """ + payment: Payment + paymentErrors: [PaymentError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PaymentError!]! +} + +""" +Represents a payment source stored for user in payment gateway, such as credit card. +""" +type PaymentSource { + """ + Payment gateway name. + """ + gateway: String! + + """ + Stored credit card details if available. + """ + creditCardInfo: CreditCard +} + +""" +Voids the authorized payment. +""" +type PaymentVoid { + """ + Updated payment. + """ + payment: Payment + paymentErrors: [PaymentError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PaymentError!]! +} + +""" +Represents a permission object in a friendly form. +""" +type Permission { + """ + Internal code for permission. + """ + code: PermissionEnum! + + """ + Describe action(s) allowed to do by permission. + """ + name: String! +} + +""" +An enumeration. +""" +enum PermissionEnum { + MANAGE_USERS + MANAGE_STAFF + MANAGE_APPS + MANAGE_CHANNELS + MANAGE_DISCOUNTS + MANAGE_PLUGINS + MANAGE_GIFT_CARD + MANAGE_MENUS + MANAGE_ORDERS + MANAGE_PAGES + MANAGE_PAGE_TYPES_AND_ATTRIBUTES + MANAGE_PRODUCTS + MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES + MANAGE_SHIPPING + MANAGE_SETTINGS + MANAGE_TRANSLATIONS + MANAGE_CHECKOUTS +} + +""" +Create new permission group. +""" +type PermissionGroupCreate { + permissionGroupErrors: [PermissionGroupError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PermissionGroupError!]! + group: Group +} + +input PermissionGroupCreateInput { + """ + List of permission code names to assign to this group. + """ + addPermissions: [PermissionEnum!] + + """ + List of users to assign to this group. + """ + addUsers: [ID!] + + """ + Group name. + """ + name: String! +} + +""" +Delete permission group. +""" +type PermissionGroupDelete { + permissionGroupErrors: [PermissionGroupError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PermissionGroupError!]! + group: Group +} + +type PermissionGroupError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: PermissionGroupErrorCode! + + """ + List of permissions which causes the error. + """ + permissions: [PermissionEnum!] + + """ + List of user IDs which causes the error. + """ + users: [ID!] +} + +""" +An enumeration. +""" +enum PermissionGroupErrorCode { + ASSIGN_NON_STAFF_MEMBER + DUPLICATED_INPUT_ITEM + CANNOT_REMOVE_FROM_LAST_GROUP + LEFT_NOT_MANAGEABLE_PERMISSION + OUT_OF_SCOPE_PERMISSION + OUT_OF_SCOPE_USER + REQUIRED + UNIQUE +} + +input PermissionGroupFilterInput { + search: String +} + +enum PermissionGroupSortField { + """ + Sort permission group accounts by name. + """ + NAME +} + +input PermissionGroupSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort permission group by the selected field. + """ + field: PermissionGroupSortField! +} + +""" +Update permission group. +""" +type PermissionGroupUpdate { + permissionGroupErrors: [PermissionGroupError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PermissionGroupError!]! + group: Group +} + +input PermissionGroupUpdateInput { + """ + List of permission code names to assign to this group. + """ + addPermissions: [PermissionEnum!] + + """ + List of users to assign to this group. + """ + addUsers: [ID!] + + """ + Group name. + """ + name: String + + """ + List of permission code names to unassign from this group. + """ + removePermissions: [PermissionEnum!] + + """ + List of users to unassign from this group. + """ + removeUsers: [ID!] +} + +""" +Plugin. +""" +type Plugin { + """ + Identifier of the plugin. + """ + id: ID! + + """ + Name of the plugin. + """ + name: String! + + """ + Description of the plugin. + """ + description: String! + + """ + Global configuration of the plugin (not channel-specific). + """ + globalConfiguration: PluginConfiguration + + """ + Channel-specific plugin configuration. + """ + channelConfigurations: [PluginConfiguration!]! +} + +""" +Stores information about a configuration of plugin. +""" +type PluginConfiguration { + """ + Determines if plugin is active or not. + """ + active: Boolean! + + """ + The channel to which the plugin configuration is assigned to. + """ + channel: Channel + + """ + Configuration of the plugin. + """ + configuration: [ConfigurationItem] +} + +enum PluginConfigurationType { + PER_CHANNEL + GLOBAL +} + +type PluginCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [PluginCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type PluginCountableEdge { + """ + The item at the end of the edge. + """ + node: Plugin! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +type PluginError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: PluginErrorCode! +} + +""" +An enumeration. +""" +enum PluginErrorCode { + GRAPHQL_ERROR + INVALID + PLUGIN_MISCONFIGURED + NOT_FOUND + REQUIRED + UNIQUE +} + +input PluginFilterInput { + statusInChannels: PluginStatusInChannelsInput + search: String + type: PluginConfigurationType +} + +enum PluginSortField { + NAME + IS_ACTIVE +} + +input PluginSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort plugins by the selected field. + """ + field: PluginSortField! +} + +input PluginStatusInChannelsInput { + active: Boolean! + channels: [ID!]! +} + +""" +Update plugin configuration. +""" +type PluginUpdate { + plugin: Plugin + pluginsErrors: [PluginError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [PluginError!]! +} + +input PluginUpdateInput { + """ + Indicates whether the plugin should be enabled. + """ + active: Boolean + + """ + Configuration of the plugin. + """ + configuration: [ConfigurationItemInput] +} + +""" +Positive Decimal scalar implementation. + +Should be used in places where value must be positive. +""" +scalar PositiveDecimal + +""" +An enumeration. +""" +enum PostalCodeRuleInclusionTypeEnum { + INCLUDE + EXCLUDE +} + +input PriceRangeInput { + """ + Price greater than or equal to. + """ + gte: Float + + """ + Price less than or equal to. + """ + lte: Float +} + +""" +Represents an individual item for sale in the storefront. +""" +type Product implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + seoTitle: String + seoDescription: String + name: String! + description: JSONString + productType: ProductType! + slug: String! + category: Category + updatedAt: DateTime + chargeTaxes: Boolean! + weight: Weight + defaultVariant: ProductVariant + rating: Float + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + Description of the product (JSON). + """ + descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.") + + """ + The main thumbnail for a product. + """ + thumbnail( + """ + Size of thumbnail. + """ + size: Int + ): Image + + """ + Lists the storefront product's pricing, the current price and discounts, only meant for displaying. + """ + pricing( + """ + Destination address used to find warehouses where stock availability for this product is checked. If address is empty, uses `Shop.companyAddress` or fallbacks to server's `settings.DEFAULT_COUNTRY` configuration. + """ + address: AddressInput + ): ProductPricingInfo + + """ + Whether the product is in stock and visible or not. + """ + isAvailable( + """ + Destination address used to find warehouses where stock availability for this product is checked. If address is empty, uses `Shop.companyAddress` or fallbacks to server's `settings.DEFAULT_COUNTRY` configuration. + """ + address: AddressInput + ): Boolean + + """ + A type of tax. Assigned by enabled tax gateway + """ + taxType: TaxType + + """ + List of attributes assigned to this product. + """ + attributes: [SelectedAttribute!]! + + """ + List of availability in channels for the product. + """ + channelListings: [ProductChannelListing!] + + """ + Get a single product media by ID. + """ + mediaById( + """ + ID of a product media. + """ + id: ID + ): ProductMedia! + + """ + Get a single product image by ID. + """ + imageById( + """ + ID of a product image. + """ + id: ID + ): ProductImage @deprecated(reason: "Will be removed in Saleor 4.0. Use the `mediaById` field instead.") + + """ + List of variants for the product. + """ + variants: [ProductVariant] + + """ + List of media for the product. + """ + media: [ProductMedia!] + + """ + List of images for the product. + """ + images: [ProductImage] @deprecated(reason: "Will be removed in Saleor 4.0. Use the `media` field instead.") + + """ + List of collections for the product. + """ + collections: [Collection] + + """ + Returns translated product fields for the given language code. + """ + translation( + """ + A language code to return the translation for product. + """ + languageCode: LanguageCodeEnum! + ): ProductTranslation + + """ + Date when product is available for purchase. + """ + availableForPurchase: Date + + """ + Whether the product is available for purchase. + """ + isAvailableForPurchase: Boolean +} + +""" +Assign attributes to a given product type. +""" +type ProductAttributeAssign { + """ + The updated product type. + """ + productType: ProductType + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +input ProductAttributeAssignInput { + """ + The ID of the attribute to assign. + """ + id: ID! + + """ + The attribute type to be assigned as. + """ + type: ProductAttributeType! +} + +enum ProductAttributeType { + PRODUCT + VARIANT +} + +""" +Un-assign attributes from a given product type. +""" +type ProductAttributeUnassign { + """ + The updated product type. + """ + productType: ProductType + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +""" +Deletes products. +""" +type ProductBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +""" +Represents product channel listing. +""" +type ProductChannelListing implements Node { + """ + The ID of the object. + """ + id: ID! + publicationDate: Date + isPublished: Boolean! + channel: Channel! + visibleInListings: Boolean! + availableForPurchase: Date + + """ + The price of the cheapest variant (including discounts). + """ + discountedPrice: Money + + """ + Purchase cost of product. + """ + purchaseCost: MoneyRange + + """ + Range of margin percentage value. + """ + margin: Margin + + """ + Whether the product is available for purchase. + """ + isAvailableForPurchase: Boolean + + """ + Lists the storefront product's pricing, the current price and discounts, only meant for displaying. + """ + pricing( + """ + Destination address used to find warehouses where stock availability for this product is checked. If address is empty, uses `Shop.companyAddress` or fallbacks to server's `settings.DEFAULT_COUNTRY` configuration. + """ + address: AddressInput + ): ProductPricingInfo +} + +input ProductChannelListingAddInput { + """ + ID of a channel. + """ + channelId: ID! + + """ + Determines if object is visible to customers. + """ + isPublished: Boolean + + """ + Publication date. ISO 8601 standard. + """ + publicationDate: Date + + """ + Determines if product is visible in product listings (doesn't apply to product collections). + """ + visibleInListings: Boolean + + """ + Determine if product should be available for purchase. + """ + isAvailableForPurchase: Boolean + + """ + A start date from which a product will be available for purchase. When not set and isAvailable is set to True, the current day is assumed. + """ + availableForPurchaseDate: Date + + """ + List of variants to which the channel should be assigned. + """ + addVariants: [ID!] + + """ + List of variants from which the channel should be unassigned. + """ + removeVariants: [ID!] +} + +type ProductChannelListingError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: ProductErrorCode! + + """ + List of attributes IDs which causes the error. + """ + attributes: [ID!] + + """ + List of attribute values IDs which causes the error. + """ + values: [ID!] + + """ + List of channels IDs which causes the error. + """ + channels: [ID!] + + """ + List of variants IDs which causes the error. + """ + variants: [ID!] +} + +""" +Manage product's availability in channels. +""" +type ProductChannelListingUpdate { + """ + An updated product instance. + """ + product: Product + productChannelListingErrors: [ProductChannelListingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductChannelListingError!]! +} + +input ProductChannelListingUpdateInput { + """ + List of channels to which the product should be assigned or updated. + """ + updateChannels: [ProductChannelListingAddInput!] + + """ + List of channels from which the product should be unassigned. + """ + removeChannels: [ID!] +} + +type ProductCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [ProductCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type ProductCountableEdge { + """ + The item at the end of the edge. + """ + node: Product! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new product. +""" +type ProductCreate { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + product: Product +} + +input ProductCreateInput { + """ + List of attributes. + """ + attributes: [AttributeValueInput!] + + """ + ID of the product's category. + """ + category: ID + + """ + Determine if taxes are being charged for the product. + """ + chargeTaxes: Boolean + + """ + List of IDs of collections that the product belongs to. + """ + collections: [ID!] + + """ + Product description (JSON). + """ + description: JSONString + + """ + Product name. + """ + name: String + + """ + Product slug. + """ + slug: String + + """ + Tax rate for enabled tax gateway. + """ + taxCode: String + + """ + Search engine optimization fields. + """ + seo: SeoInput + + """ + Weight of the Product. + """ + weight: WeightScalar + + """ + Defines the product rating value. + """ + rating: Float + + """ + ID of the type that product belongs to. + """ + productType: ID! +} + +""" +Deletes a product. +""" +type ProductDelete { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + product: Product +} + +type ProductError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: ProductErrorCode! + + """ + List of attributes IDs which causes the error. + """ + attributes: [ID!] + + """ + List of attribute values IDs which causes the error. + """ + values: [ID!] +} + +""" +An enumeration. +""" +enum ProductErrorCode { + ALREADY_EXISTS + ATTRIBUTE_ALREADY_ASSIGNED + ATTRIBUTE_CANNOT_BE_ASSIGNED + ATTRIBUTE_VARIANTS_DISABLED + DUPLICATED_INPUT_ITEM + GRAPHQL_ERROR + INVALID + PRODUCT_WITHOUT_CATEGORY + NOT_PRODUCTS_IMAGE + NOT_PRODUCTS_VARIANT + NOT_FOUND + REQUIRED + UNIQUE + VARIANT_NO_DIGITAL_CONTENT + CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT + PRODUCT_NOT_ASSIGNED_TO_CHANNEL + UNSUPPORTED_MEDIA_PROVIDER +} + +enum ProductFieldEnum { + NAME + DESCRIPTION + PRODUCT_TYPE + CATEGORY + PRODUCT_WEIGHT + COLLECTIONS + CHARGE_TAXES + PRODUCT_MEDIA + VARIANT_SKU + VARIANT_WEIGHT + VARIANT_MEDIA +} + +input ProductFilterInput { + isPublished: Boolean + collections: [ID] + categories: [ID] + hasCategory: Boolean + attributes: [AttributeInput] + stockAvailability: StockAvailability + stocks: ProductStockFilterInput + search: String + metadata: [MetadataInput] + price: PriceRangeInput + minimalPrice: PriceRangeInput + productTypes: [ID] + ids: [ID] + + """ + Specifies the channel by which the data should be sorted. + """ + channel: String +} + +""" +Represents a product image. +""" +type ProductImage { + """ + The ID of the image. + """ + id: ID! + + """ + The alt text of the image. + """ + alt: String + + """ + The new relative sorting position of the item (from -inf to +inf). 1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. + """ + sortOrder: Int + + """ + The URL of the image. + """ + url( + """ + Size of the image. + """ + size: Int + ): String! +} + +input ProductInput { + """ + List of attributes. + """ + attributes: [AttributeValueInput!] + + """ + ID of the product's category. + """ + category: ID + + """ + Determine if taxes are being charged for the product. + """ + chargeTaxes: Boolean + + """ + List of IDs of collections that the product belongs to. + """ + collections: [ID!] + + """ + Product description (JSON). + """ + description: JSONString + + """ + Product name. + """ + name: String + + """ + Product slug. + """ + slug: String + + """ + Tax rate for enabled tax gateway. + """ + taxCode: String + + """ + Search engine optimization fields. + """ + seo: SeoInput + + """ + Weight of the Product. + """ + weight: WeightScalar + + """ + Defines the product rating value. + """ + rating: Float +} + +""" +Represents a product media. +""" +type ProductMedia implements Node { + """ + The ID of the object. + """ + id: ID! + sortOrder: Int + alt: String! + type: ProductMediaType! + oembedData: JSONString! + + """ + The URL of the media. + """ + url( + """ + Size of the image. + """ + size: Int + ): String! +} + +""" +Deletes product media. +""" +type ProductMediaBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +""" +Create a media object (image or video URL) associated with product. For image, this mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec +""" +type ProductMediaCreate { + product: Product + media: ProductMedia + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +input ProductMediaCreateInput { + """ + Alt text for a product media. + """ + alt: String + + """ + Represents an image file in a multipart request. + """ + image: Upload + + """ + ID of an product. + """ + product: ID! + + """ + Represents an URL to an external media. + """ + mediaUrl: String +} + +""" +Deletes a product media. +""" +type ProductMediaDelete { + product: Product + media: ProductMedia + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +""" +Changes ordering of the product media. +""" +type ProductMediaReorder { + product: Product + media: [ProductMedia!] + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +""" +An enumeration. +""" +enum ProductMediaType { + """ + An uploaded image or an URL to an image + """ + IMAGE + + """ + A URL to an external video + """ + VIDEO +} + +""" +Updates a product media. +""" +type ProductMediaUpdate { + product: Product + media: ProductMedia + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +input ProductMediaUpdateInput { + """ + Alt text for a product media. + """ + alt: String +} + +input ProductOrder { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Specifies the channel in which to sort the data. + """ + channel: String + + """ + Sort product by the selected attribute's values. + Note: this doesn't take translations into account yet. + """ + attributeId: ID + + """ + Sort products by the selected field. + """ + field: ProductOrderField +} + +enum ProductOrderField { + """ + Sort products by name. + """ + NAME + + """ + Sort products by rank. Note: This option is available only with the `search` filter. + """ + RANK + + """ + Sort products by price. + """ + PRICE + + """ + Sort products by a minimal price of a product's variant. + """ + MINIMAL_PRICE + + """ + Sort products by update date. + """ + DATE + + """ + Sort products by type. + """ + TYPE + + """ + Sort products by publication status. + """ + PUBLISHED + + """ + Sort products by publication date. + """ + PUBLICATION_DATE + + """ + Sort products by collection. Note: This option is available only for the `Collection.products` query. + """ + COLLECTION + + """ + Sort products by rating. + """ + RATING +} + +""" +Represents availability of a product in the storefront. +""" +type ProductPricingInfo { + """ + Whether it is in sale or not. + """ + onSale: Boolean + + """ + The discount amount if in sale (null otherwise). + """ + discount: TaxedMoney + + """ + The discount amount in the local currency. + """ + discountLocalCurrency: TaxedMoney + + """ + The discounted price range of the product variants. + """ + priceRange: TaxedMoneyRange + + """ + The undiscounted price range of the product variants. + """ + priceRangeUndiscounted: TaxedMoneyRange + + """ + The discounted price range of the product variants in the local currency. + """ + priceRangeLocalCurrency: TaxedMoneyRange +} + +""" +Reorder product attribute values. +""" +type ProductReorderAttributeValues { + """ + Product from which attribute values are reordered. + """ + product: Product + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +input ProductStockFilterInput { + warehouseIds: [ID!] + quantity: IntRangeInput +} + +type ProductTranslatableContent implements Node { + """ + The ID of the object. + """ + id: ID! + seoTitle: String + seoDescription: String + name: String! + description: JSONString + + """ + Description of the product (JSON). + """ + descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.") + + """ + Returns translated product fields for the given language code. + """ + translation( + """ + A language code to return the translation for product. + """ + languageCode: LanguageCodeEnum! + ): ProductTranslation + + """ + Represents an individual item for sale in the storefront. + """ + product: Product +} + +""" +Creates/Updates translations for Product. +""" +type ProductTranslate { + translationErrors: [TranslationError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [TranslationError!]! + product: Product +} + +type ProductTranslation implements Node { + """ + The ID of the object. + """ + id: ID! + seoTitle: String + seoDescription: String + name: String! + description: JSONString + + """ + Translation language. + """ + language: LanguageDisplay! + + """ + Translated description of the product (JSON). + """ + descriptionJson: JSONString @deprecated(reason: "Will be removed in Saleor 4.0. Use the `description` field instead.") +} + +""" +Represents a type of product. It defines what attributes are available to products of this type. +""" +type ProductType implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + name: String! + slug: String! + hasVariants: Boolean! + isShippingRequired: Boolean! + isDigital: Boolean! + weight: Weight + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + List of products of this type. + """ + products( + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): ProductCountableConnection + @deprecated( + reason: "Will be removed in Saleor 4.0. Use the top-level `products` query with the `productTypes` filter." + ) + + """ + A type of tax. Assigned by enabled tax gateway + """ + taxType: TaxType + + """ + Variant attributes of that product type. + """ + variantAttributes( + """ + Define scope of returned attributes. + """ + variantSelection: VariantAttributeScope + ): [Attribute] + + """ + Product attributes of that product type. + """ + productAttributes: [Attribute] + availableAttributes( + filter: AttributeFilterInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): AttributeCountableConnection +} + +""" +Deletes product types. +""" +type ProductTypeBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +enum ProductTypeConfigurable { + CONFIGURABLE + SIMPLE +} + +type ProductTypeCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [ProductTypeCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type ProductTypeCountableEdge { + """ + The item at the end of the edge. + """ + node: ProductType! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new product type. +""" +type ProductTypeCreate { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + productType: ProductType +} + +""" +Deletes a product type. +""" +type ProductTypeDelete { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + productType: ProductType +} + +enum ProductTypeEnum { + DIGITAL + SHIPPABLE +} + +input ProductTypeFilterInput { + search: String + configurable: ProductTypeConfigurable + productType: ProductTypeEnum + metadata: [MetadataInput] + ids: [ID] +} + +input ProductTypeInput { + """ + Name of the product type. + """ + name: String + + """ + Product type slug. + """ + slug: String + + """ + Determines if product of this type has multiple variants. This option mainly simplifies product management in the dashboard. There is always at least one variant created under the hood. + """ + hasVariants: Boolean + + """ + List of attributes shared among all product variants. + """ + productAttributes: [ID] + + """ + List of attributes used to distinguish between different variants of a product. + """ + variantAttributes: [ID] + + """ + Determines if shipping is required for products of this variant. + """ + isShippingRequired: Boolean + + """ + Determines if products are digital. + """ + isDigital: Boolean + + """ + Weight of the ProductType items. + """ + weight: WeightScalar + + """ + Tax rate for enabled tax gateway. + """ + taxCode: String +} + +""" +Reorder the attributes of a product type. +""" +type ProductTypeReorderAttributes { + """ + Product type from which attributes are reordered. + """ + productType: ProductType + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +enum ProductTypeSortField { + """ + Sort products by name. + """ + NAME + + """ + Sort products by type. + """ + DIGITAL + + """ + Sort products by shipping. + """ + SHIPPING_REQUIRED +} + +input ProductTypeSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort product types by the selected field. + """ + field: ProductTypeSortField! +} + +""" +Updates an existing product type. +""" +type ProductTypeUpdate { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + productType: ProductType +} + +""" +Updates an existing product. +""" +type ProductUpdate { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + product: Product +} + +""" +Represents a version of a product such as different size or color. +""" +type ProductVariant implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + name: String! + sku: String! + product: Product! + trackInventory: Boolean! + weight: Weight + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + List of price information in channels for the product. + """ + channelListings: [ProductVariantChannelListing!] + + """ + Lists the storefront variant's pricing, the current price and discounts, only meant for displaying. + """ + pricing( + """ + Destination address used to find warehouses where stock availability for this product is checked. If address is empty, uses `Shop.companyAddress` or fallbacks to server's `settings.DEFAULT_COUNTRY` configuration. + """ + address: AddressInput + ): VariantPricingInfo + + """ + List of attributes assigned to this variant. + """ + attributes( + """ + Define scope of returned attributes. + """ + variantSelection: VariantAttributeScope + ): [SelectedAttribute!]! + + """ + Cost price of the variant. + """ + costPrice: Money + + """ + Gross margin percentage value. + """ + margin: Int + + """ + Total quantity ordered. + """ + quantityOrdered: Int + + """ + Total revenue generated by a variant in given period of time. Note: this field should be queried using `reportProductSales` query as it uses optimizations suitable for such calculations. + """ + revenue(period: ReportingPeriod): TaxedMoney + + """ + List of images for the product variant. + """ + images: [ProductImage] @deprecated(reason: "Will be removed in Saleor 4.0. Use the `media` instead.") + + """ + List of media for the product variant. + """ + media: [ProductMedia!] + + """ + Returns translated product variant fields for the given language code. + """ + translation( + """ + A language code to return the translation for product variant. + """ + languageCode: LanguageCodeEnum! + ): ProductVariantTranslation + + """ + Digital content for the product variant. + """ + digitalContent: DigitalContent + + """ + Stocks for the product variant. + """ + stocks( + """ + Destination address used to find warehouses where stock availability for this product is checked. If address is empty, uses `Shop.companyAddress` or fallbacks to server's `settings.DEFAULT_COUNTRY` configuration. + """ + address: AddressInput + + """ + DEPRECATED: use `address` argument instead. This argument will be removed in Saleor 4.0. Two-letter ISO 3166-1 country code. + """ + countryCode: CountryCode + ): [Stock] + + """ + Quantity of a product available for sale in one checkout. + """ + quantityAvailable( + """ + Destination address used to find warehouses where stock availability for this product is checked. If address is empty, uses `Shop.companyAddress` or fallbacks to server's `settings.DEFAULT_COUNTRY` configuration. + """ + address: AddressInput + + """ + DEPRECATED: use `address` argument instead. This argument will be removed in Saleor 4.0.Two-letter ISO 3166-1 country code. When provided, the exact quantity from a warehouse operating in shipping zones that contain this country will be returned. Otherwise, it will return the maximum quantity from all shipping zones. + """ + countryCode: CountryCode + ): Int! +} + +""" +Creates product variants for a given product. +""" +type ProductVariantBulkCreate { + """ + Returns how many objects were created. + """ + count: Int! + + """ + List of the created variants. + """ + productVariants: [ProductVariant!]! + bulkProductErrors: [BulkProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [BulkProductError!]! +} + +input ProductVariantBulkCreateInput { + """ + List of attributes specific to this variant. + """ + attributes: [BulkAttributeValueInput]! + + """ + Stock keeping unit. + """ + sku: String! + + """ + Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. + """ + trackInventory: Boolean + + """ + Weight of the Product Variant. + """ + weight: WeightScalar + + """ + Stocks of a product available for sale. + """ + stocks: [StockInput!] + + """ + List of prices assigned to channels. + """ + channelListings: [ProductVariantChannelListingAddInput!] +} + +""" +Deletes product variants. +""" +type ProductVariantBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +""" +Represents product varaint channel listing. +""" +type ProductVariantChannelListing implements Node { + """ + The ID of the object. + """ + id: ID! + channel: Channel! + price: Money + + """ + Cost price of the variant. + """ + costPrice: Money + + """ + Gross margin percentage value. + """ + margin: Int +} + +input ProductVariantChannelListingAddInput { + """ + ID of a channel. + """ + channelId: ID! + + """ + Price of the particular variant in channel. + """ + price: PositiveDecimal! + + """ + Cost price of the variant in channel. + """ + costPrice: PositiveDecimal +} + +""" +Manage product variant prices in channels. +""" +type ProductVariantChannelListingUpdate { + """ + An updated product variant instance. + """ + variant: ProductVariant + productChannelListingErrors: [ProductChannelListingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductChannelListingError!]! +} + +type ProductVariantCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [ProductVariantCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type ProductVariantCountableEdge { + """ + The item at the end of the edge. + """ + node: ProductVariant! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new variant for a product. +""" +type ProductVariantCreate { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + productVariant: ProductVariant +} + +input ProductVariantCreateInput { + """ + List of attributes specific to this variant. + """ + attributes: [AttributeValueInput]! + + """ + Stock keeping unit. + """ + sku: String + + """ + Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. + """ + trackInventory: Boolean + + """ + Weight of the Product Variant. + """ + weight: WeightScalar + + """ + Product ID of which type is the variant. + """ + product: ID! + + """ + Stocks of a product available for sale. + """ + stocks: [StockInput!] +} + +""" +Deletes a product variant. +""" +type ProductVariantDelete { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + productVariant: ProductVariant +} + +input ProductVariantFilterInput { + search: String + sku: [String] + metadata: [MetadataInput] +} + +input ProductVariantInput { + """ + List of attributes specific to this variant. + """ + attributes: [AttributeValueInput] + + """ + Stock keeping unit. + """ + sku: String + + """ + Determines if the inventory of this variant should be tracked. If false, the quantity won't change when customers buy this item. + """ + trackInventory: Boolean + + """ + Weight of the Product Variant. + """ + weight: WeightScalar +} + +""" +Reorder the variants of a product. Mutation updates updated_at on product and triggers PRODUCT_UPDATED webhook. +""" +type ProductVariantReorder { + product: Product + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +""" +Reorder product variant attribute values. +""" +type ProductVariantReorderAttributeValues { + """ + Product variant from which attribute values are reordered. + """ + productVariant: ProductVariant + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +""" +Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook. +""" +type ProductVariantSetDefault { + product: Product + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +""" +Creates stocks for product variant. +""" +type ProductVariantStocksCreate { + """ + Updated product variant. + """ + productVariant: ProductVariant + bulkStockErrors: [BulkStockError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [BulkStockError!]! +} + +""" +Delete stocks from product variant. +""" +type ProductVariantStocksDelete { + """ + Updated product variant. + """ + productVariant: ProductVariant + stockErrors: [StockError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [StockError!]! +} + +""" +Update stocks for product variant. +""" +type ProductVariantStocksUpdate { + """ + Updated product variant. + """ + productVariant: ProductVariant + bulkStockErrors: [BulkStockError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [BulkStockError!]! +} + +type ProductVariantTranslatableContent implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + + """ + Returns translated product variant fields for the given language code. + """ + translation( + """ + A language code to return the translation for product variant. + """ + languageCode: LanguageCodeEnum! + ): ProductVariantTranslation + + """ + Represents a version of a product such as different size or color. + """ + productVariant: ProductVariant +} + +""" +Creates/Updates translations for Product Variant. +""" +type ProductVariantTranslate { + translationErrors: [TranslationError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [TranslationError!]! + productVariant: ProductVariant +} + +type ProductVariantTranslation implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + + """ + Translation language. + """ + language: LanguageDisplay! +} + +""" +Updates an existing variant for product. +""" +type ProductVariantUpdate { + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! + productVariant: ProductVariant +} + +input PublishableChannelListingInput { + """ + ID of a channel. + """ + channelId: ID! + + """ + Determines if object is visible to customers. + """ + isPublished: Boolean + + """ + Publication date. ISO 8601 standard. + """ + publicationDate: Date +} + +type Query { + """ + Look up a webhook by ID. + """ + webhook( + """ + ID of the webhook. + """ + id: ID! + ): Webhook + + """ + List of all available webhook events. + """ + webhookEvents: [WebhookEvent] + + """ + Retrieve a sample payload for a given webhook event based on real data. It can be useful for some integrations where sample payload is required. + """ + webhookSamplePayload( + """ + Name of the requested event type. + """ + eventType: WebhookSampleEventTypeEnum! + ): JSONString + + """ + Look up a warehouse by ID. + """ + warehouse( + """ + ID of an warehouse + """ + id: ID! + ): Warehouse + + """ + List of warehouses. + """ + warehouses( + filter: WarehouseFilterInput + sortBy: WarehouseSortingInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): WarehouseCountableConnection + + """ + Returns a list of all translatable items of a given kind. + """ + translations( + """ + Kind of objects to retrieve. + """ + kind: TranslatableKinds! + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): TranslatableItemConnection + translation( + """ + ID of the object to retrieve. + """ + id: ID! + + """ + Kind of the object to retrieve. + """ + kind: TranslatableKinds! + ): TranslatableItem + + """ + Look up a stock by ID + """ + stock( + """ + ID of an warehouse + """ + id: ID! + ): Stock + + """ + List of stocks. + """ + stocks( + filter: StockFilterInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): StockCountableConnection + + """ + Return information about the shop. + """ + shop: Shop! + + """ + Order related settings from site settings. + """ + orderSettings: OrderSettings + + """ + Look up a shipping zone by ID. + """ + shippingZone( + """ + ID of the shipping zone. + """ + id: ID! + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + ): ShippingZone + + """ + List of the shop's shipping zones. + """ + shippingZones( + """ + Filtering options for shipping zones. + """ + filter: ShippingZoneFilterInput + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): ShippingZoneCountableConnection + + """ + Look up digital content by ID. + """ + digitalContent( + """ + ID of the digital content. + """ + id: ID! + ): DigitalContent + + """ + List of digital content. + """ + digitalContents( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): DigitalContentCountableConnection + + """ + List of the shop's categories. + """ + categories( + """ + Filtering options for categories. + """ + filter: CategoryFilterInput + + """ + Sort categories. + """ + sortBy: CategorySortingInput + + """ + Filter categories by the nesting level in the category tree. + """ + level: Int + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): CategoryCountableConnection + + """ + Look up a category by ID or slug. + """ + category( + """ + ID of the category. + """ + id: ID + + """ + Slug of the category + """ + slug: String + ): Category + + """ + Look up a collection by ID. + """ + collection( + """ + ID of the collection. + """ + id: ID + + """ + Slug of the category + """ + slug: String + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + ): Collection + + """ + List of the shop's collections. + """ + collections( + """ + Filtering options for collections. + """ + filter: CollectionFilterInput + + """ + Sort collections. + """ + sortBy: CollectionSortingInput + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): CollectionCountableConnection + + """ + Look up a product by ID. + """ + product( + """ + ID of the product. + """ + id: ID + + """ + Slug of the product. + """ + slug: String + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + ): Product + + """ + List of the shop's products. + """ + products( + """ + Filtering options for products. + """ + filter: ProductFilterInput + + """ + Sort products. + """ + sortBy: ProductOrder + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): ProductCountableConnection + + """ + Look up a product type by ID. + """ + productType( + """ + ID of the product type. + """ + id: ID! + ): ProductType + + """ + List of the shop's product types. + """ + productTypes( + """ + Filtering options for product types. + """ + filter: ProductTypeFilterInput + + """ + Sort product types. + """ + sortBy: ProductTypeSortingInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): ProductTypeCountableConnection + + """ + Look up a product variant by ID or SKU. + """ + productVariant( + """ + ID of the product variant. + """ + id: ID + + """ + Sku of the product variant. + """ + sku: String + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + ): ProductVariant + + """ + List of product variants. + """ + productVariants( + """ + Filter product variants by given IDs. + """ + ids: [ID] + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + Filtering options for product variant. + """ + filter: ProductVariantFilterInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): ProductVariantCountableConnection + + """ + List of top selling products. + """ + reportProductSales( + """ + Span of time. + """ + period: ReportingPeriod! + + """ + Slug of a channel for which the data should be returned. + """ + channel: String! + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): ProductVariantCountableConnection + + """ + Look up a payment by ID. + """ + payment( + """ + ID of the payment. + """ + id: ID! + ): Payment + + """ + List of payments. + """ + payments( + """ + Filtering options for payments. + """ + filter: PaymentFilterInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): PaymentCountableConnection + + """ + Look up a page by ID or slug. + """ + page( + """ + ID of the page. + """ + id: ID + + """ + The slug of the page. + """ + slug: String + ): Page + + """ + List of the shop's pages. + """ + pages( + """ + Sort pages. + """ + sortBy: PageSortingInput + + """ + Filtering options for pages. + """ + filter: PageFilterInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): PageCountableConnection + + """ + Look up a page type by ID. + """ + pageType( + """ + ID of the page type. + """ + id: ID! + ): PageType + + """ + List of the page types. + """ + pageTypes( + """ + Sort page types. + """ + sortBy: PageTypeSortingInput + + """ + Filtering options for page types. + """ + filter: PageTypeFilterInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): PageTypeCountableConnection + + """ + List of activity events to display on homepage (at the moment it only contains order-events). + """ + homepageEvents( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): OrderEventCountableConnection + + """ + Look up an order by ID. + """ + order( + """ + ID of an order. + """ + id: ID! + ): Order + + """ + List of orders. + """ + orders( + """ + Sort orders. + """ + sortBy: OrderSortingInput + + """ + Filtering options for orders. + """ + filter: OrderFilterInput + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): OrderCountableConnection + + """ + List of draft orders. + """ + draftOrders( + """ + Sort draft orders. + """ + sortBy: OrderSortingInput + + """ + Filtering options for draft orders. + """ + filter: OrderDraftFilterInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): OrderCountableConnection + + """ + Return the total sales amount from a specific period. + """ + ordersTotal( + """ + A period of time. + """ + period: ReportingPeriod + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + ): TaxedMoney + + """ + Look up an order by token. + """ + orderByToken( + """ + The order's token. + """ + token: UUID! + ): Order + + """ + Look up a navigation menu by ID or name. + """ + menu( + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + ID of the menu. + """ + id: ID + + """ + The menu's name. + """ + name: String + + """ + The menu's slug. + """ + slug: String + ): Menu + + """ + List of the storefront's menus. + """ + menus( + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + Sort menus. + """ + sortBy: MenuSortingInput + + """ + Filtering options for menus. + """ + filter: MenuFilterInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): MenuCountableConnection + + """ + Look up a menu item by ID. + """ + menuItem( + """ + ID of the menu item. + """ + id: ID! + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + ): MenuItem + + """ + List of the storefronts's menu items. + """ + menuItems( + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + Sort menus items. + """ + sortBy: MenuItemSortingInput + + """ + Filtering options for menu items. + """ + filter: MenuItemFilterInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): MenuItemCountableConnection + + """ + Look up a gift card by ID. + """ + giftCard( + """ + ID of the gift card. + """ + id: ID! + ): GiftCard + + """ + List of gift cards. + """ + giftCards( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): GiftCardCountableConnection + + """ + Look up a plugin by ID. + """ + plugin( + """ + ID of the plugin. + """ + id: ID! + ): Plugin + + """ + List of plugins. + """ + plugins( + """ + Filtering options for plugins. + """ + filter: PluginFilterInput + + """ + Sort plugins. + """ + sortBy: PluginSortingInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): PluginCountableConnection + + """ + Look up a sale by ID. + """ + sale( + """ + ID of the sale. + """ + id: ID! + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + ): Sale + + """ + List of the shop's sales. + """ + sales( + """ + Filtering options for sales. + """ + filter: SaleFilterInput + + """ + Sort sales. + """ + sortBy: SaleSortingInput + + """ + Search sales by name, value or type. + """ + query: String + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): SaleCountableConnection + + """ + Look up a voucher by ID. + """ + voucher( + """ + ID of the voucher. + """ + id: ID! + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + ): Voucher + + """ + List of the shop's vouchers. + """ + vouchers( + """ + Filtering options for vouchers. + """ + filter: VoucherFilterInput + + """ + Sort voucher. + """ + sortBy: VoucherSortingInput + + """ + Search vouchers by name or code. + """ + query: String + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): VoucherCountableConnection + + """ + Look up a export file by ID. + """ + exportFile( + """ + ID of the export file job. + """ + id: ID! + ): ExportFile + + """ + List of export files. + """ + exportFiles( + """ + Filtering options for export files. + """ + filter: ExportFileFilterInput + + """ + Sort export files. + """ + sortBy: ExportFileSortingInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): ExportFileCountableConnection + + """ + List of all tax rates available from tax gateway. + """ + taxTypes: [TaxType] + + """ + Look up a checkout by token and slug of channel. + """ + checkout( + """ + The checkout's token. + """ + token: UUID + ): Checkout + + """ + List of checkouts. + """ + checkouts( + """ + Slug of a channel for which the data should be returned. + """ + channel: String + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): CheckoutCountableConnection + + """ + Look up a checkout line by ID. + """ + checkoutLine( + """ + ID of the checkout line. + """ + id: ID + ): CheckoutLine + + """ + List of checkout lines. + """ + checkoutLines( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): CheckoutLineCountableConnection + + """ + Look up a channel by ID. + """ + channel( + """ + ID of the channel. + """ + id: ID + ): Channel + + """ + List of all channels. + """ + channels: [Channel!] + + """ + List of the shop's attributes. + """ + attributes( + """ + Filtering options for attributes. + """ + filter: AttributeFilterInput + + """ + Sorting options for attributes. + """ + sortBy: AttributeSortingInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): AttributeCountableConnection + + """ + Look up an attribute by ID. + """ + attribute( + """ + ID of the attribute. + """ + id: ID + + """ + Slug of the attribute. + """ + slug: String + ): Attribute + + """ + List of all apps installations + """ + appsInstallations: [AppInstallation!]! + + """ + List of the apps. + """ + apps( + """ + Filtering options for apps. + """ + filter: AppFilterInput + + """ + Sort apps. + """ + sortBy: AppSortingInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): AppCountableConnection + + """ + Look up an app by ID. If ID is not provided, return the currently authenticated app. + """ + app( + """ + ID of the app. + """ + id: ID + ): App + + """ + Returns address validation rules. + """ + addressValidationRules( + """ + Two-letter ISO 3166-1 country code. + """ + countryCode: CountryCode! + + """ + Designation of a region, province or state. + """ + countryArea: String + + """ + City or a town name. + """ + city: String + + """ + Sublocality like a district. + """ + cityArea: String + ): AddressValidationData + + """ + Look up an address by ID. + """ + address( + """ + ID of an address. + """ + id: ID! + ): Address + + """ + List of the shop's customers. + """ + customers( + """ + Filtering options for customers. + """ + filter: CustomerFilterInput + + """ + Sort customers. + """ + sortBy: UserSortingInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): UserCountableConnection + + """ + List of permission groups. + """ + permissionGroups( + """ + Filtering options for permission groups. + """ + filter: PermissionGroupFilterInput + + """ + Sort permission groups. + """ + sortBy: PermissionGroupSortingInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): GroupCountableConnection + + """ + Look up permission group by ID. + """ + permissionGroup( + """ + ID of the group. + """ + id: ID! + ): Group + + """ + Return the currently authenticated user. + """ + me: User + + """ + List of the shop's staff users. + """ + staffUsers( + """ + Filtering options for staff users. + """ + filter: StaffUserInput + + """ + Sort staff users. + """ + sortBy: UserSortingInput + + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): UserCountableConnection + + """ + Look up a user by ID or email address. + """ + user( + """ + ID of the user. + """ + id: ID + + """ + Email address of the user. + """ + email: String + ): User + _entities(representations: [_Any]): [_Entity] + _service: _Service +} + +""" +Represents a reduced VAT rate for a particular type of goods. +""" +type ReducedRate { + """ + Reduced VAT rate in percent. + """ + rate: Float! + + """ + A type of goods. + """ + rateType: TaxRateType! +} + +""" +Refresh JWT token. Mutation tries to take refreshToken from the input.If it fails it will try to take refreshToken from the http-only cookie -refreshToken. csrfToken is required when refreshToken is provided as a cookie. +""" +type RefreshToken { + """ + JWT token, required to authenticate. + """ + token: String + + """ + A user instance. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +input ReorderInput { + """ + The ID of the item to move. + """ + id: ID! + + """ + The new relative sorting position of the item (from -inf to +inf). 1 moves the item one position forward, -1 moves the item one position backward, 0 leaves the item unchanged. + """ + sortOrder: Int +} + +enum ReportingPeriod { + TODAY + THIS_MONTH +} + +""" +Request email change of the logged in user. +""" +type RequestEmailChange { + """ + A user instance. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Sends an email with the account password modification link. +""" +type RequestPasswordReset { + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Sales allow creating discounts for categories, collections or products and are visible to all the customers. +""" +type Sale implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + type: SaleType! + startDate: DateTime! + endDate: DateTime + + """ + List of categories this sale applies to. + """ + categories( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): CategoryCountableConnection + + """ + List of collections this sale applies to. + """ + collections( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): CollectionCountableConnection + + """ + List of products this sale applies to. + """ + products( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): ProductCountableConnection + + """ + Returns translated sale fields for the given language code. + """ + translation( + """ + A language code to return the translation for sale. + """ + languageCode: LanguageCodeEnum! + ): SaleTranslation + + """ + List of channels available for the sale. + """ + channelListings: [SaleChannelListing!] + + """ + Sale value. + """ + discountValue: Float + + """ + Currency code for sale. + """ + currency: String +} + +""" +Adds products, categories, collections to a voucher. +""" +type SaleAddCatalogues { + """ + Sale of which catalogue IDs will be modified. + """ + sale: Sale + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! +} + +""" +Deletes sales. +""" +type SaleBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! +} + +""" +Represents sale channel listing. +""" +type SaleChannelListing implements Node { + """ + The ID of the object. + """ + id: ID! + channel: Channel! + discountValue: Float! + currency: String! +} + +input SaleChannelListingAddInput { + """ + ID of a channel. + """ + channelId: ID! + + """ + The value of the discount. + """ + discountValue: PositiveDecimal! +} + +input SaleChannelListingInput { + """ + List of channels to which the sale should be assigned. + """ + addChannels: [SaleChannelListingAddInput!] + + """ + List of channels from which the sale should be unassigned. + """ + removeChannels: [ID!] +} + +""" +Manage sale's availability in channels. +""" +type SaleChannelListingUpdate { + """ + An updated sale instance. + """ + sale: Sale + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! +} + +type SaleCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [SaleCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type SaleCountableEdge { + """ + The item at the end of the edge. + """ + node: Sale! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new sale. +""" +type SaleCreate { + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! + sale: Sale +} + +""" +Deletes a sale. +""" +type SaleDelete { + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! + sale: Sale +} + +input SaleFilterInput { + status: [DiscountStatusEnum] + saleType: DiscountValueTypeEnum + started: DateTimeRangeInput + search: String +} + +input SaleInput { + """ + Voucher name. + """ + name: String + + """ + Fixed or percentage. + """ + type: DiscountValueTypeEnum + + """ + Value of the voucher. + """ + value: PositiveDecimal + + """ + Products related to the discount. + """ + products: [ID] + + """ + Categories related to the discount. + """ + categories: [ID] + + """ + Collections related to the discount. + """ + collections: [ID] + + """ + Start date of the voucher in ISO 8601 format. + """ + startDate: DateTime + + """ + End date of the voucher in ISO 8601 format. + """ + endDate: DateTime +} + +""" +Removes products, categories, collections from a sale. +""" +type SaleRemoveCatalogues { + """ + Sale of which catalogue IDs will be modified. + """ + sale: Sale + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! +} + +enum SaleSortField { + """ + Sort sales by name. + """ + NAME + + """ + Sort sales by start date. + """ + START_DATE + + """ + Sort sales by end date. + """ + END_DATE + + """ + Sort sales by value. + """ + VALUE + + """ + Sort sales by type. + """ + TYPE +} + +input SaleSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Specifies the channel in which to sort the data. + """ + channel: String + + """ + Sort sales by the selected field. + """ + field: SaleSortField! +} + +type SaleTranslatableContent implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + + """ + Returns translated sale fields for the given language code. + """ + translation( + """ + A language code to return the translation for sale. + """ + languageCode: LanguageCodeEnum! + ): SaleTranslation + + """ + Sales allow creating discounts for categories, collections or products and are visible to all the customers. + """ + sale: Sale +} + +""" +Creates/updates translations for a sale. +""" +type SaleTranslate { + translationErrors: [TranslationError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [TranslationError!]! + sale: Sale +} + +type SaleTranslation implements Node { + """ + The ID of the object. + """ + id: ID! + name: String + + """ + Translation language. + """ + language: LanguageDisplay! +} + +""" +An enumeration. +""" +enum SaleType { + """ + fixed + """ + FIXED + + """ + % + """ + PERCENTAGE +} + +""" +Updates a sale. +""" +type SaleUpdate { + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! + sale: Sale +} + +""" +Represents a custom attribute. +""" +type SelectedAttribute { + """ + Name of an attribute displayed in the interface. + """ + attribute: Attribute! + + """ + Values of an attribute. + """ + values: [AttributeValue]! +} + +input SeoInput { + """ + SEO title. + """ + title: String + + """ + SEO description. + """ + description: String +} + +""" +Sets the user's password from the token sent by email using the RequestPasswordReset mutation. +""" +type SetPassword { + """ + JWT token, required to authenticate. + """ + token: String + + """ + JWT refresh token, required to re-generate access token. + """ + refreshToken: String + + """ + CSRF token required to re-generate access token. + """ + csrfToken: String + + """ + A user instance. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +type ShippingError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: ShippingErrorCode! + + """ + List of warehouse IDs which causes the error. + """ + warehouses: [ID!] + + """ + List of channels IDs which causes the error. + """ + channels: [ID!] +} + +""" +An enumeration. +""" +enum ShippingErrorCode { + ALREADY_EXISTS + GRAPHQL_ERROR + INVALID + MAX_LESS_THAN_MIN + NOT_FOUND + REQUIRED + UNIQUE + DUPLICATED_INPUT_ITEM +} + +""" +Shipping method are the methods you'll use to get customer's orders to them. They are directly exposed to the customers. +""" +type ShippingMethod implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + name: String! + description: JSONString + minimumOrderWeight: Weight + maximumOrderWeight: Weight + maximumDeliveryDays: Int + minimumDeliveryDays: Int + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + Type of the shipping method. + """ + type: ShippingMethodTypeEnum + + """ + Returns translated shipping method fields for the given language code. + """ + translation( + """ + A language code to return the translation for shipping method. + """ + languageCode: LanguageCodeEnum! + ): ShippingMethodTranslation + + """ + List of channels available for the method. + """ + channelListings: [ShippingMethodChannelListing!] + + """ + The price of the cheapest variant (including discounts). + """ + price: Money + + """ + The price of the cheapest variant (including discounts). + """ + maximumOrderPrice: Money + + """ + The price of the cheapest variant (including discounts). + """ + minimumOrderPrice: Money + + """ + Postal code ranges rule of exclusion or inclusion of the shipping method. + """ + postalCodeRules: [ShippingMethodPostalCodeRule] + + """ + List of excluded products for the shipping method. + """ + excludedProducts( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): ProductCountableConnection +} + +""" +Represents shipping method channel listing. +""" +type ShippingMethodChannelListing implements Node { + """ + The ID of the object. + """ + id: ID! + channel: Channel! + minimumOrderPrice: Money + maximumOrderPrice: Money + price: Money +} + +input ShippingMethodChannelListingAddInput { + """ + ID of a channel. + """ + channelId: ID! + + """ + Shipping price of the shipping method in this channel. + """ + price: PositiveDecimal + + """ + Minimum order price to use this shipping method. + """ + minimumOrderPrice: PositiveDecimal + + """ + Maximum order price to use this shipping method. + """ + maximumOrderPrice: PositiveDecimal +} + +input ShippingMethodChannelListingInput { + """ + List of channels to which the shipping method should be assigned. + """ + addChannels: [ShippingMethodChannelListingAddInput!] + + """ + List of channels from which the shipping method should be unassigned. + """ + removeChannels: [ID!] +} + +""" +Manage shipping method's availability in channels. +""" +type ShippingMethodChannelListingUpdate { + """ + An updated shipping method instance. + """ + shippingMethod: ShippingMethod + shippingErrors: [ShippingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShippingError!]! +} + +""" +Represents shipping method postal code rule. +""" +type ShippingMethodPostalCodeRule implements Node { + """ + Start address range. + """ + start: String + + """ + End address range. + """ + end: String + + """ + Inclusion type of the postal code rule. + """ + inclusionType: PostalCodeRuleInclusionTypeEnum + + """ + The ID of the object. + """ + id: ID! +} + +type ShippingMethodTranslatableContent implements Node { + """ + The ID of the object. + """ + id: ID! + name: String! + description: JSONString + + """ + Returns translated shipping method fields for the given language code. + """ + translation( + """ + A language code to return the translation for shipping method. + """ + languageCode: LanguageCodeEnum! + ): ShippingMethodTranslation + + """ + Shipping method are the methods you'll use to get customer's orders to them. They are directly exposed to the customers. + """ + shippingMethod: ShippingMethod +} + +type ShippingMethodTranslation implements Node { + """ + The ID of the object. + """ + id: ID! + name: String + description: JSONString + + """ + Translation language. + """ + language: LanguageDisplay! +} + +""" +An enumeration. +""" +enum ShippingMethodTypeEnum { + PRICE + WEIGHT +} + +input ShippingPostalCodeRulesCreateInputRange { + """ + Start range of the postal code. + """ + start: String! + + """ + End range of the postal code. + """ + end: String +} + +""" +Deletes shipping prices. +""" +type ShippingPriceBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + shippingErrors: [ShippingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShippingError!]! +} + +""" +Creates a new shipping price. +""" +type ShippingPriceCreate { + """ + A shipping zone to which the shipping method belongs. + """ + shippingZone: ShippingZone + shippingMethod: ShippingMethod + shippingErrors: [ShippingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShippingError!]! +} + +""" +Deletes a shipping price. +""" +type ShippingPriceDelete { + """ + A shipping method to delete. + """ + shippingMethod: ShippingMethod + + """ + A shipping zone to which the shipping method belongs. + """ + shippingZone: ShippingZone + shippingErrors: [ShippingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShippingError!]! +} + +""" +Exclude products from shipping price. +""" +type ShippingPriceExcludeProducts { + """ + A shipping method with new list of excluded products. + """ + shippingMethod: ShippingMethod + shippingErrors: [ShippingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShippingError!]! +} + +input ShippingPriceExcludeProductsInput { + """ + List of products which will be excluded. + """ + products: [ID]! +} + +input ShippingPriceInput { + """ + Name of the shipping method. + """ + name: String + + """ + Shipping method description (JSON). + """ + description: JSONString + + """ + Minimum order weight to use this shipping method. + """ + minimumOrderWeight: WeightScalar + + """ + Maximum order weight to use this shipping method. + """ + maximumOrderWeight: WeightScalar + + """ + Maximum number of days for delivery. + """ + maximumDeliveryDays: Int + + """ + Minimal number of days for delivery. + """ + minimumDeliveryDays: Int + + """ + Shipping type: price or weight based. + """ + type: ShippingMethodTypeEnum + + """ + Shipping zone this method belongs to. + """ + shippingZone: ID + + """ + Postal code rules to add. + """ + addPostalCodeRules: [ShippingPostalCodeRulesCreateInputRange!] + + """ + Postal code rules to delete. + """ + deletePostalCodeRules: [ID!] + + """ + Inclusion type for currently assigned postal code rules. + """ + inclusionType: PostalCodeRuleInclusionTypeEnum +} + +""" +Remove product from excluded list for shipping price. +""" +type ShippingPriceRemoveProductFromExclude { + """ + A shipping method with new list of excluded products. + """ + shippingMethod: ShippingMethod + shippingErrors: [ShippingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShippingError!]! +} + +""" +Creates/Updates translations for shipping method. +""" +type ShippingPriceTranslate { + translationErrors: [TranslationError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [TranslationError!]! + shippingMethod: ShippingMethod +} + +input ShippingPriceTranslationInput { + name: String + + """ + Translated shipping method description (JSON). + """ + description: JSONString +} + +""" +Updates a new shipping price. +""" +type ShippingPriceUpdate { + """ + A shipping zone to which the shipping method belongs. + """ + shippingZone: ShippingZone + shippingMethod: ShippingMethod + shippingErrors: [ShippingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShippingError!]! +} + +""" +Represents a shipping zone in the shop. Zones are the concept used only for grouping shipping methods in the dashboard, and are never exposed to the customers directly. +""" +type ShippingZone implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + name: String! + default: Boolean! + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + Lowest and highest prices for the shipping. + """ + priceRange: MoneyRange + + """ + List of countries available for the method. + """ + countries: [CountryDisplay] + + """ + List of shipping methods available for orders shipped to countries within this shipping zone. + """ + shippingMethods: [ShippingMethod] + + """ + List of warehouses for shipping zone. + """ + warehouses: [Warehouse!]! + + """ + List of channels for shipping zone. + """ + channels: [Channel!]! + + """ + Description of a shipping zone. + """ + description: String +} + +""" +Deletes shipping zones. +""" +type ShippingZoneBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + shippingErrors: [ShippingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShippingError!]! +} + +type ShippingZoneCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [ShippingZoneCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type ShippingZoneCountableEdge { + """ + The item at the end of the edge. + """ + node: ShippingZone! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new shipping zone. +""" +type ShippingZoneCreate { + shippingErrors: [ShippingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShippingError!]! + shippingZone: ShippingZone +} + +input ShippingZoneCreateInput { + """ + Shipping zone's name. Visible only to the staff. + """ + name: String + + """ + Description of the shipping zone. + """ + description: String + + """ + List of countries in this shipping zone. + """ + countries: [String] + + """ + Default shipping zone will be used for countries not covered by other zones. + """ + default: Boolean + + """ + List of warehouses to assign to a shipping zone + """ + addWarehouses: [ID] + + """ + List of channels to assign to the shipping zone. + """ + addChannels: [ID!] +} + +""" +Deletes a shipping zone. +""" +type ShippingZoneDelete { + shippingErrors: [ShippingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShippingError!]! + shippingZone: ShippingZone +} + +input ShippingZoneFilterInput { + search: String + channels: [ID] +} + +""" +Updates a new shipping zone. +""" +type ShippingZoneUpdate { + shippingErrors: [ShippingError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShippingError!]! + shippingZone: ShippingZone +} + +input ShippingZoneUpdateInput { + """ + Shipping zone's name. Visible only to the staff. + """ + name: String + + """ + Description of the shipping zone. + """ + description: String + + """ + List of countries in this shipping zone. + """ + countries: [String] + + """ + Default shipping zone will be used for countries not covered by other zones. + """ + default: Boolean + + """ + List of warehouses to assign to a shipping zone + """ + addWarehouses: [ID] + + """ + List of channels to assign to the shipping zone. + """ + addChannels: [ID!] + + """ + List of warehouses to unassign from a shipping zone + """ + removeWarehouses: [ID] + + """ + List of channels to unassign from the shipping zone. + """ + removeChannels: [ID!] +} + +""" +Represents a shop resource containing general shop data and configuration. +""" +type Shop { + """ + List of available payment gateways. + """ + availablePaymentGateways( + """ + DEPRECATED: use `channel` argument instead. This argument will be removed in Saleor 4.0.A currency for which gateways will be returned. + """ + currency: String + + """ + Slug of a channel for which the data should be returned. + """ + channel: String + ): [PaymentGateway!]! + + """ + List of available external authentications. + """ + availableExternalAuthentications: [ExternalAuthentication!]! + + """ + Shipping methods that are available for the shop. + """ + availableShippingMethods( + """ + Slug of a channel for which the data should be returned. + """ + channel: String! + + """ + Address for which available shipping methods should be returned. + """ + address: AddressInput + ): [ShippingMethod] + + """ + List of countries available in the shop. + """ + countries( + """ + A language code to return the translation for. + """ + languageCode: LanguageCodeEnum + ): [CountryDisplay!]! + + """ + Shop's default country. + """ + defaultCountry: CountryDisplay + + """ + Default shop's email sender's name. + """ + defaultMailSenderName: String + + """ + Default shop's email sender's address. + """ + defaultMailSenderAddress: String + + """ + Shop's description. + """ + description: String + + """ + Shop's domain data. + """ + domain: Domain! + + """ + List of the shops's supported languages. + """ + languages: [LanguageDisplay]! + + """ + Shop's name. + """ + name: String! + + """ + List of available permissions. + """ + permissions: [Permission]! + + """ + List of possible phone prefixes. + """ + phonePrefixes: [String]! + + """ + Header text. + """ + headerText: String + + """ + Include taxes in prices. + """ + includeTaxesInPrices: Boolean! + + """ + Display prices with tax in store. + """ + displayGrossPrices: Boolean! + + """ + Charge taxes on shipping. + """ + chargeTaxesOnShipping: Boolean! + + """ + Enable inventory tracking. + """ + trackInventoryByDefault: Boolean + + """ + Default weight unit. + """ + defaultWeightUnit: WeightUnitsEnum + + """ + Returns translated shop fields for the given language code. + """ + translation( + """ + A language code to return the translation for shop. + """ + languageCode: LanguageCodeEnum! + ): ShopTranslation + + """ + Enable automatic fulfillment for all digital products. + """ + automaticFulfillmentDigitalProducts: Boolean + + """ + Default number of max downloads per digital content URL. + """ + defaultDigitalMaxDownloads: Int + + """ + Default number of days which digital content URL will be valid. + """ + defaultDigitalUrlValidDays: Int + + """ + Company address. + """ + companyAddress: Address + + """ + URL of a view where customers can set their password. + """ + customerSetPasswordUrl: String + + """ + List of staff notification recipients. + """ + staffNotificationRecipients: [StaffNotificationRecipient] + + """ + Resource limitations and current usage if any set for a shop + """ + limits: LimitInfo! + + """ + Saleor API version. + """ + version: String! +} + +""" +Update the shop's address. If the `null` value is passed, the currently selected address will be deleted. +""" +type ShopAddressUpdate { + """ + Updated shop. + """ + shop: Shop + shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShopError!]! +} + +""" +Updates site domain of the shop. +""" +type ShopDomainUpdate { + """ + Updated shop. + """ + shop: Shop + shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShopError!]! +} + +type ShopError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: ShopErrorCode! +} + +""" +An enumeration. +""" +enum ShopErrorCode { + ALREADY_EXISTS + CANNOT_FETCH_TAX_RATES + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE +} + +""" +Fetch tax rates. +""" +type ShopFetchTaxRates { + """ + Updated shop. + """ + shop: Shop + shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShopError!]! +} + +input ShopSettingsInput { + """ + Header text. + """ + headerText: String + + """ + SEO description. + """ + description: String + + """ + Include taxes in prices. + """ + includeTaxesInPrices: Boolean + + """ + Display prices with tax in store. + """ + displayGrossPrices: Boolean + + """ + Charge taxes on shipping. + """ + chargeTaxesOnShipping: Boolean + + """ + Enable inventory tracking. + """ + trackInventoryByDefault: Boolean + + """ + Default weight unit. + """ + defaultWeightUnit: WeightUnitsEnum + + """ + Enable automatic fulfillment for all digital products. + """ + automaticFulfillmentDigitalProducts: Boolean + + """ + Default number of max downloads per digital content URL. + """ + defaultDigitalMaxDownloads: Int + + """ + Default number of days which digital content URL will be valid. + """ + defaultDigitalUrlValidDays: Int + + """ + Default email sender's name. + """ + defaultMailSenderName: String + + """ + Default email sender's address. + """ + defaultMailSenderAddress: String + + """ + URL of a view where customers can set their password. + """ + customerSetPasswordUrl: String +} + +""" +Creates/Updates translations for Shop Settings. +""" +type ShopSettingsTranslate { + """ + Updated shop. + """ + shop: Shop + translationErrors: [TranslationError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [TranslationError!]! +} + +input ShopSettingsTranslationInput { + headerText: String + description: String +} + +""" +Updates shop settings. +""" +type ShopSettingsUpdate { + """ + Updated shop. + """ + shop: Shop + shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShopError!]! +} + +type ShopTranslation implements Node { + """ + The ID of the object. + """ + id: ID! + headerText: String! + description: String! + + """ + Translation language. + """ + language: LanguageDisplay! +} + +input SiteDomainInput { + """ + Domain name for shop. + """ + domain: String + + """ + Shop site name. + """ + name: String +} + +""" +Deletes staff users. +""" +type StaffBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + staffErrors: [StaffError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [StaffError!]! +} + +""" +Creates a new staff user. +""" +type StaffCreate { + staffErrors: [StaffError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [StaffError!]! + user: User +} + +input StaffCreateInput { + """ + Given name. + """ + firstName: String + + """ + Family name. + """ + lastName: String + + """ + The unique email address of the user. + """ + email: String + + """ + User account is active. + """ + isActive: Boolean + + """ + A note about the user. + """ + note: String + + """ + List of permission group IDs to which user should be assigned. + """ + addGroups: [ID!] + + """ + URL of a view where users should be redirected to set the password. URL in RFC 1808 format. + """ + redirectUrl: String +} + +""" +Deletes a staff user. +""" +type StaffDelete { + staffErrors: [StaffError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [StaffError!]! + user: User +} + +type StaffError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: AccountErrorCode! + + """ + A type of address that causes the error. + """ + addressType: AddressTypeEnum + + """ + List of permissions which causes the error. + """ + permissions: [PermissionEnum!] + + """ + List of permission group IDs which cause the error. + """ + groups: [ID!] + + """ + List of user IDs which causes the error. + """ + users: [ID!] +} + +enum StaffMemberStatus { + """ + User account has been activated. + """ + ACTIVE + + """ + User account has not been activated yet. + """ + DEACTIVATED +} + +""" +Represents a recipient of email notifications send by Saleor, such as notifications about new orders. Notifications can be assigned to staff users or arbitrary email addresses. +""" +type StaffNotificationRecipient implements Node { + """ + Returns a user subscribed to email notifications. + """ + user: User + + """ + Determines if a notification active. + """ + active: Boolean + + """ + The ID of the object. + """ + id: ID! + + """ + Returns email address of a user subscribed to email notifications. + """ + email: String +} + +""" +Creates a new staff notification recipient. +""" +type StaffNotificationRecipientCreate { + shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShopError!]! + staffNotificationRecipient: StaffNotificationRecipient +} + +""" +Delete staff notification recipient. +""" +type StaffNotificationRecipientDelete { + shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShopError!]! + staffNotificationRecipient: StaffNotificationRecipient +} + +input StaffNotificationRecipientInput { + """ + The ID of the user subscribed to email notifications.. + """ + user: ID + + """ + Email address of a user subscribed to email notifications. + """ + email: String + + """ + Determines if a notification active. + """ + active: Boolean +} + +""" +Updates a staff notification recipient. +""" +type StaffNotificationRecipientUpdate { + shopErrors: [ShopError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ShopError!]! + staffNotificationRecipient: StaffNotificationRecipient +} + +""" +Updates an existing staff user. +""" +type StaffUpdate { + staffErrors: [StaffError!]! @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [StaffError!]! + user: User +} + +input StaffUpdateInput { + """ + Given name. + """ + firstName: String + + """ + Family name. + """ + lastName: String + + """ + The unique email address of the user. + """ + email: String + + """ + User account is active. + """ + isActive: Boolean + + """ + A note about the user. + """ + note: String + + """ + List of permission group IDs to which user should be assigned. + """ + addGroups: [ID!] + + """ + List of permission group IDs from which user should be unassigned. + """ + removeGroups: [ID!] +} + +input StaffUserInput { + status: StaffMemberStatus + search: String +} + +""" +Represents stock. +""" +type Stock implements Node { + warehouse: Warehouse! + productVariant: ProductVariant! + + """ + Quantity of a product in the warehouse's possession, including the allocated stock that is waiting for shipment. + """ + quantity: Int! + + """ + The ID of the object. + """ + id: ID! + + """ + Quantity allocated for orders + """ + quantityAllocated: Int! +} + +enum StockAvailability { + IN_STOCK + OUT_OF_STOCK +} + +type StockCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [StockCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type StockCountableEdge { + """ + The item at the end of the edge. + """ + node: Stock! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +type StockError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: StockErrorCode! +} + +""" +An enumeration. +""" +enum StockErrorCode { + ALREADY_EXISTS + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE +} + +input StockFilterInput { + quantity: Float + search: String +} + +input StockInput { + """ + Warehouse in which stock is located. + """ + warehouse: ID! + + """ + Quantity of items available for sell. + """ + quantity: Int! +} + +""" +An enumeration. +""" +enum TaxRateType { + ACCOMMODATION + ADMISSION_TO_CULTURAL_EVENTS + ADMISSION_TO_ENTERTAINMENT_EVENTS + ADMISSION_TO_SPORTING_EVENTS + ADVERTISING + AGRICULTURAL_SUPPLIES + BABY_FOODSTUFFS + BIKES + BOOKS + CHILDRENS_CLOTHING + DOMESTIC_FUEL + DOMESTIC_SERVICES + E_BOOKS + FOODSTUFFS + HOTELS + MEDICAL + NEWSPAPERS + PASSENGER_TRANSPORT + PHARMACEUTICALS + PROPERTY_RENOVATIONS + RESTAURANTS + SOCIAL_HOUSING + STANDARD + WATER + WINE +} + +""" +Representation of tax types fetched from tax gateway. +""" +type TaxType { + """ + Description of the tax type. + """ + description: String + + """ + External tax code used to identify given tax group. + """ + taxCode: String +} + +""" +Represents a monetary value with taxes. In cases where taxes were not applied, net and gross values will be equal. +""" +type TaxedMoney { + """ + Currency code. + """ + currency: String! + + """ + Amount of money including taxes. + """ + gross: Money! + + """ + Amount of money without taxes. + """ + net: Money! + + """ + Amount of taxes. + """ + tax: Money! +} + +""" +Represents a range of monetary values. +""" +type TaxedMoneyRange { + """ + Lower bound of a price range. + """ + start: TaxedMoney + + """ + Upper bound of a price range. + """ + stop: TaxedMoney +} + +""" +An object representing a single payment. +""" +type Transaction implements Node { + """ + The ID of the object. + """ + id: ID! + created: DateTime! + payment: Payment! + token: String! + kind: TransactionKind! + isSuccess: Boolean! + error: String + gatewayResponse: JSONString! + + """ + Total amount of the transaction. + """ + amount: Money +} + +""" +An enumeration. +""" +enum TransactionKind { + """ + External reference + """ + EXTERNAL + + """ + Authorization + """ + AUTH + + """ + Pending + """ + PENDING + + """ + Action to confirm + """ + ACTION_TO_CONFIRM + + """ + Refund + """ + REFUND + + """ + Refund in progress + """ + REFUND_ONGOING + + """ + Capture + """ + CAPTURE + + """ + Void + """ + VOID + + """ + Confirm + """ + CONFIRM + + """ + Cancel + """ + CANCEL +} + +union TranslatableItem = + ProductTranslatableContent + | CollectionTranslatableContent + | CategoryTranslatableContent + | AttributeTranslatableContent + | AttributeValueTranslatableContent + | ProductVariantTranslatableContent + | PageTranslatableContent + | ShippingMethodTranslatableContent + | SaleTranslatableContent + | VoucherTranslatableContent + | MenuItemTranslatableContent + +type TranslatableItemConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [TranslatableItemEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type TranslatableItemEdge { + """ + The item at the end of the edge. + """ + node: TranslatableItem! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +enum TranslatableKinds { + ATTRIBUTE + ATTRIBUTE_VALUE + CATEGORY + COLLECTION + MENU_ITEM + PAGE + PRODUCT + SALE + SHIPPING_METHOD + VARIANT + VOUCHER +} + +type TranslationError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: TranslationErrorCode! +} + +""" +An enumeration. +""" +enum TranslationErrorCode { + GRAPHQL_ERROR + NOT_FOUND + REQUIRED +} + +input TranslationInput { + seoTitle: String + seoDescription: String + name: String + description: JSONString +} + +scalar UUID + +input UpdateInvoiceInput { + """ + Invoice number + """ + number: String + + """ + URL of an invoice to download. + """ + url: String +} + +""" +Updates metadata of an object. +""" +type UpdateMetadata { + metadataErrors: [MetadataError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MetadataError!]! + item: ObjectWithMetadata +} + +""" +Updates private metadata of an object. +""" +type UpdatePrivateMetadata { + metadataErrors: [MetadataError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [MetadataError!]! + item: ObjectWithMetadata +} + +""" +Variables of this type must be set to null in mutations. They will be replaced with a filename from a following multipart part containing a binary file. See: https://github.com/jaydenseric/graphql-multipart-request-spec. +""" +scalar Upload + +type UploadError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: UploadErrorCode! +} + +""" +An enumeration. +""" +enum UploadErrorCode { + GRAPHQL_ERROR +} + +""" +Represents user data. +""" +type User implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + lastLogin: DateTime + email: String! + firstName: String! + lastName: String! + isStaff: Boolean! + isActive: Boolean! + + """ + A note about the customer. + """ + note: String + dateJoined: DateTime! + defaultShippingAddress: Address + defaultBillingAddress: Address + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! + + """ + List of all user's addresses. + """ + addresses: [Address] + + """ + Returns the last open checkout of this user. + """ + checkout: Checkout + @deprecated(reason: "Will be removed in Saleor 4.0. Use the `checkout_tokens` field to fetch the user checkouts.") + + """ + Returns the checkout UUID's assigned to this user. + """ + checkoutTokens( + """ + Slug of a channel for which the data should be returned. + """ + channel: String + ): [UUID!] + + """ + List of the user gift cards. + """ + giftCards( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): GiftCardCountableConnection + + """ + List of user's orders. + """ + orders( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): OrderCountableConnection + + """ + List of user's permissions. + """ + userPermissions: [UserPermission] + + """ + List of user's permission groups. + """ + permissionGroups: [Group] + + """ + List of user's permission groups which user can manage. + """ + editableGroups: [Group] + avatar( + """ + Size of the avatar. + """ + size: Int + ): Image + + """ + List of events associated with the user. + """ + events: [CustomerEvent] + + """ + List of stored payment sources. + """ + storedPaymentSources( + """ + Slug of a channel for which the data should be returned. + """ + channel: String + ): [PaymentSource] + + """ + User language code. + """ + languageCode: LanguageCodeEnum! +} + +""" +Deletes a user avatar. Only for staff members. +""" +type UserAvatarDelete { + """ + An updated user instance. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Create a user avatar. Only for staff members. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec +""" +type UserAvatarUpdate { + """ + An updated user instance. + """ + user: User + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +Activate or deactivate users. +""" +type UserBulkSetActive { + """ + Returns how many objects were affected. + """ + count: Int! + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +type UserCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [UserCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type UserCountableEdge { + """ + The item at the end of the edge. + """ + node: User! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +input UserCreateInput { + """ + Billing address of the customer. + """ + defaultBillingAddress: AddressInput + + """ + Shipping address of the customer. + """ + defaultShippingAddress: AddressInput + + """ + Given name. + """ + firstName: String + + """ + Family name. + """ + lastName: String + + """ + The unique email address of the user. + """ + email: String + + """ + User account is active. + """ + isActive: Boolean + + """ + A note about the user. + """ + note: String + + """ + User language code. + """ + languageCode: LanguageCodeEnum + + """ + URL of a view where users should be redirected to set the password. URL in RFC 1808 format. + """ + redirectUrl: String + + """ + Slug of a channel which will be used for notify user. Optional when only one channel exists. + """ + channel: String +} + +type UserPermission { + """ + Internal code for permission. + """ + code: PermissionEnum! + + """ + Describe action(s) allowed to do by permission. + """ + name: String! + + """ + List of user permission groups which contains this permission. + """ + sourcePermissionGroups( + """ + ID of user whose groups should be returned. + """ + userId: ID! + ): [Group!] +} + +enum UserSortField { + """ + Sort users by first name. + """ + FIRST_NAME + + """ + Sort users by last name. + """ + LAST_NAME + + """ + Sort users by email. + """ + EMAIL + + """ + Sort users by order count. + """ + ORDER_COUNT +} + +input UserSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort users by the selected field. + """ + field: UserSortField! +} + +""" +Represents a VAT rate for a country. +""" +type VAT { + """ + Country code. + """ + countryCode: String! + + """ + Standard VAT rate in percent. + """ + standardRate: Float + + """ + Country's VAT rate exceptions for specific types of goods. + """ + reducedRates: [ReducedRate]! +} + +enum VariantAttributeScope { + ALL + VARIANT_SELECTION + NOT_VARIANT_SELECTION +} + +""" +Assign an media to a product variant. +""" +type VariantMediaAssign { + productVariant: ProductVariant + media: ProductMedia + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +""" +Unassign an media from a product variant. +""" +type VariantMediaUnassign { + productVariant: ProductVariant + media: ProductMedia + productErrors: [ProductError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [ProductError!]! +} + +""" +Represents availability of a variant in the storefront. +""" +type VariantPricingInfo { + """ + Whether it is in sale or not. + """ + onSale: Boolean + + """ + The discount amount if in sale (null otherwise). + """ + discount: TaxedMoney + + """ + The discount amount in the local currency. + """ + discountLocalCurrency: TaxedMoney + + """ + The price, with any discount subtracted. + """ + price: TaxedMoney + + """ + The price without any discount. + """ + priceUndiscounted: TaxedMoney + + """ + The discounted price in the local currency. + """ + priceLocalCurrency: TaxedMoney +} + +""" +Verify JWT token. +""" +type VerifyToken { + """ + User assigned to token. + """ + user: User + + """ + Determine if token is valid or not. + """ + isValid: Boolean! + + """ + JWT payload. + """ + payload: GenericScalar + accountErrors: [AccountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [AccountError!]! +} + +""" +An enumeration. +""" +enum VolumeUnitsEnum { + CUBIC_MILLIMETER + CUBIC_CENTIMETER + CUBIC_DECIMETER + CUBIC_METER + LITER + CUBIC_FOOT + CUBIC_INCH + CUBIC_YARD + QT + PINT + FL_OZ + ACRE_IN + ACRE_FT +} + +""" +Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes. +""" +type Voucher implements Node { + """ + The ID of the object. + """ + id: ID! + name: String + + """ + Determines a type of voucher. + """ + type: VoucherTypeEnum! + code: String! + usageLimit: Int + used: Int! + startDate: DateTime! + endDate: DateTime + applyOncePerOrder: Boolean! + applyOncePerCustomer: Boolean! + + """ + Determines a type of discount for voucher - value or percentage + """ + discountValueType: DiscountValueTypeEnum! + minCheckoutItemsQuantity: Int + + """ + List of categories this voucher applies to. + """ + categories( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): CategoryCountableConnection + + """ + List of collections this voucher applies to. + """ + collections( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): CollectionCountableConnection + + """ + List of products this voucher applies to. + """ + products( + """ + Return the elements in the list that come before the specified cursor. + """ + before: String + + """ + Return the elements in the list that come after the specified cursor. + """ + after: String + + """ + Return the first n elements from the list. + """ + first: Int + + """ + Return the last n elements from the list. + """ + last: Int + ): ProductCountableConnection + + """ + List of countries available for the shipping voucher. + """ + countries: [CountryDisplay] + + """ + Returns translated voucher fields for the given language code. + """ + translation( + """ + A language code to return the translation for voucher. + """ + languageCode: LanguageCodeEnum! + ): VoucherTranslation + + """ + Voucher value. + """ + discountValue: Float + + """ + Currency code for voucher. + """ + currency: String + + """ + Minimum order value to apply voucher. + """ + minSpent: Money + + """ + List of availability in channels for the voucher. + """ + channelListings: [VoucherChannelListing!] +} + +""" +Adds products, categories, collections to a voucher. +""" +type VoucherAddCatalogues { + """ + Voucher of which catalogue IDs will be modified. + """ + voucher: Voucher + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! +} + +""" +Deletes vouchers. +""" +type VoucherBulkDelete { + """ + Returns how many objects were affected. + """ + count: Int! + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! +} + +""" +Represents voucher channel listing. +""" +type VoucherChannelListing implements Node { + """ + The ID of the object. + """ + id: ID! + channel: Channel! + discountValue: Float! + currency: String! + minSpent: Money +} + +input VoucherChannelListingAddInput { + """ + ID of a channel. + """ + channelId: ID! + + """ + Value of the voucher. + """ + discountValue: PositiveDecimal + + """ + Min purchase amount required to apply the voucher. + """ + minAmountSpent: PositiveDecimal +} + +input VoucherChannelListingInput { + """ + List of channels to which the voucher should be assigned. + """ + addChannels: [VoucherChannelListingAddInput!] + + """ + List of channels from which the voucher should be unassigned. + """ + removeChannels: [ID!] +} + +""" +Manage voucher's availability in channels. +""" +type VoucherChannelListingUpdate { + """ + An updated voucher instance. + """ + voucher: Voucher + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! +} + +type VoucherCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [VoucherCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type VoucherCountableEdge { + """ + The item at the end of the edge. + """ + node: Voucher! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates a new voucher. +""" +type VoucherCreate { + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! + voucher: Voucher +} + +""" +Deletes a voucher. +""" +type VoucherDelete { + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! + voucher: Voucher +} + +enum VoucherDiscountType { + FIXED + PERCENTAGE + SHIPPING +} + +input VoucherFilterInput { + status: [DiscountStatusEnum] + timesUsed: IntRangeInput + discountType: [VoucherDiscountType] + started: DateTimeRangeInput + search: String +} + +input VoucherInput { + """ + Voucher type: PRODUCT, CATEGORY SHIPPING or ENTIRE_ORDER. + """ + type: VoucherTypeEnum + + """ + Voucher name. + """ + name: String + + """ + Code to use the voucher. + """ + code: String + + """ + Start date of the voucher in ISO 8601 format. + """ + startDate: DateTime + + """ + End date of the voucher in ISO 8601 format. + """ + endDate: DateTime + + """ + Choices: fixed or percentage. + """ + discountValueType: DiscountValueTypeEnum + + """ + Products discounted by the voucher. + """ + products: [ID] + + """ + Collections discounted by the voucher. + """ + collections: [ID] + + """ + Categories discounted by the voucher. + """ + categories: [ID] + + """ + Minimal quantity of checkout items required to apply the voucher. + """ + minCheckoutItemsQuantity: Int + + """ + Country codes that can be used with the shipping voucher. + """ + countries: [String] + + """ + Voucher should be applied to the cheapest item or entire order. + """ + applyOncePerOrder: Boolean + + """ + Voucher should be applied once per customer. + """ + applyOncePerCustomer: Boolean + + """ + Limit number of times this voucher can be used in total. + """ + usageLimit: Int +} + +""" +Removes products, categories, collections from a voucher. +""" +type VoucherRemoveCatalogues { + """ + Voucher of which catalogue IDs will be modified. + """ + voucher: Voucher + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! +} + +enum VoucherSortField { + """ + Sort vouchers by code. + """ + CODE + + """ + Sort vouchers by start date. + """ + START_DATE + + """ + Sort vouchers by end date. + """ + END_DATE + + """ + Sort vouchers by value. + """ + VALUE + + """ + Sort vouchers by type. + """ + TYPE + + """ + Sort vouchers by usage limit. + """ + USAGE_LIMIT + + """ + Sort vouchers by minimum spent amount. + """ + MINIMUM_SPENT_AMOUNT +} + +input VoucherSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Specifies the channel in which to sort the data. + """ + channel: String + + """ + Sort vouchers by the selected field. + """ + field: VoucherSortField! +} + +type VoucherTranslatableContent implements Node { + """ + The ID of the object. + """ + id: ID! + name: String + + """ + Returns translated voucher fields for the given language code. + """ + translation( + """ + A language code to return the translation for voucher. + """ + languageCode: LanguageCodeEnum! + ): VoucherTranslation + + """ + Vouchers allow giving discounts to particular customers on categories, collections or specific products. They can be used during checkout by providing valid voucher codes. + """ + voucher: Voucher +} + +""" +Creates/Updates translations for Voucher. +""" +type VoucherTranslate { + translationErrors: [TranslationError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [TranslationError!]! + voucher: Voucher +} + +type VoucherTranslation implements Node { + """ + The ID of the object. + """ + id: ID! + name: String + + """ + Translation language. + """ + language: LanguageDisplay! +} + +enum VoucherTypeEnum { + SHIPPING + ENTIRE_ORDER + SPECIFIC_PRODUCT +} + +""" +Updates a voucher. +""" +type VoucherUpdate { + discountErrors: [DiscountError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [DiscountError!]! + voucher: Voucher +} + +""" +Represents warehouse. +""" +type Warehouse implements Node & ObjectWithMetadata { + """ + The ID of the object. + """ + id: ID! + name: String! + slug: String! + companyName: String! + shippingZones(before: String, after: String, first: Int, last: Int): ShippingZoneCountableConnection! + address: Address! + email: String! + + """ + List of private metadata items.Requires proper staff permissions to access. + """ + privateMetadata: [MetadataItem]! + + """ + List of public metadata items. Can be accessed without permissions. + """ + metadata: [MetadataItem]! +} + +input WarehouseAddressInput { + """ + Address. + """ + streetAddress1: String! + + """ + Address. + """ + streetAddress2: String + + """ + City. + """ + city: String! + + """ + District. + """ + cityArea: String + + """ + Postal code. + """ + postalCode: String + + """ + Country. + """ + country: CountryCode! + + """ + State or province. + """ + countryArea: String + + """ + Phone number. + """ + phone: String +} + +type WarehouseCountableConnection { + """ + Pagination data for this connection. + """ + pageInfo: PageInfo! + edges: [WarehouseCountableEdge!]! + + """ + A total count of items in the collection. + """ + totalCount: Int +} + +type WarehouseCountableEdge { + """ + The item at the end of the edge. + """ + node: Warehouse! + + """ + A cursor for use in pagination. + """ + cursor: String! +} + +""" +Creates new warehouse. +""" +type WarehouseCreate { + warehouseErrors: [WarehouseError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [WarehouseError!]! + warehouse: Warehouse +} + +input WarehouseCreateInput { + """ + Warehouse slug. + """ + slug: String + + """ + Company name. + """ + companyName: String + + """ + The email address of the warehouse. + """ + email: String + + """ + Warehouse name. + """ + name: String! + + """ + Address of the warehouse. + """ + address: WarehouseAddressInput! + + """ + Shipping zones supported by the warehouse. + """ + shippingZones: [ID] +} + +""" +Deletes selected warehouse. +""" +type WarehouseDelete { + warehouseErrors: [WarehouseError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [WarehouseError!]! + warehouse: Warehouse +} + +type WarehouseError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: WarehouseErrorCode! +} + +""" +An enumeration. +""" +enum WarehouseErrorCode { + ALREADY_EXISTS + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE +} + +input WarehouseFilterInput { + search: String + ids: [ID] +} + +""" +Add shipping zone to given warehouse. +""" +type WarehouseShippingZoneAssign { + warehouseErrors: [WarehouseError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [WarehouseError!]! + warehouse: Warehouse +} + +""" +Remove shipping zone from given warehouse. +""" +type WarehouseShippingZoneUnassign { + warehouseErrors: [WarehouseError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [WarehouseError!]! + warehouse: Warehouse +} + +enum WarehouseSortField { + """ + Sort warehouses by name. + """ + NAME +} + +input WarehouseSortingInput { + """ + Specifies the direction in which to sort products. + """ + direction: OrderDirection! + + """ + Sort warehouses by the selected field. + """ + field: WarehouseSortField! +} + +""" +Updates given warehouse. +""" +type WarehouseUpdate { + warehouseErrors: [WarehouseError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [WarehouseError!]! + warehouse: Warehouse +} + +input WarehouseUpdateInput { + """ + Warehouse slug. + """ + slug: String + + """ + Company name. + """ + companyName: String + + """ + The email address of the warehouse. + """ + email: String + + """ + Warehouse name. + """ + name: String + + """ + Address of the warehouse. + """ + address: WarehouseAddressInput +} + +""" +Webhook. +""" +type Webhook implements Node { + name: String! + targetUrl: String! + isActive: Boolean! + secretKey: String + + """ + The ID of the object. + """ + id: ID! + + """ + List of webhook events. + """ + events: [WebhookEvent!]! + app: App! +} + +""" +Creates a new webhook subscription. +""" +type WebhookCreate { + webhookErrors: [WebhookError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [WebhookError!]! + webhook: Webhook +} + +input WebhookCreateInput { + """ + The name of the webhook. + """ + name: String + + """ + The url to receive the payload. + """ + targetUrl: String + + """ + The events that webhook wants to subscribe. + """ + events: [WebhookEventTypeEnum] + + """ + ID of the app to which webhook belongs. + """ + app: ID + + """ + Determine if webhook will be set active or not. + """ + isActive: Boolean + + """ + The secret key used to create a hash signature with each payload. + """ + secretKey: String +} + +""" +Deletes a webhook subscription. +""" +type WebhookDelete { + webhookErrors: [WebhookError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [WebhookError!]! + webhook: Webhook +} + +type WebhookError { + """ + Name of a field that caused the error. A value of `null` indicates that the error isn't associated with a particular field. + """ + field: String + + """ + The error message. + """ + message: String + + """ + The error code. + """ + code: WebhookErrorCode! +} + +""" +An enumeration. +""" +enum WebhookErrorCode { + GRAPHQL_ERROR + INVALID + NOT_FOUND + REQUIRED + UNIQUE +} + +""" +Webhook event. +""" +type WebhookEvent { + """ + Internal name of the event type. + """ + eventType: WebhookEventTypeEnum! + + """ + Display name of the event. + """ + name: String! +} + +""" +Enum determining type of webhook. +""" +enum WebhookEventTypeEnum { + """ + All the events. + """ + ANY_EVENTS + + """ + A new order is placed. + """ + ORDER_CREATED + + """ + An order is confirmed (status change unconfirmed -> unfulfilled) by a staff user using the OrderConfirm mutation. It also triggers when the user completes the checkout and the shop setting `automatically_confirm_all_new_orders` is enabled. + """ + ORDER_CONFIRMED + + """ + Payment is made and an order is fully paid. + """ + ORDER_FULLY_PAID + + """ + An order is updated; triggered for all changes related to an order; covers all other order webhooks, except for ORDER_CREATED. + """ + ORDER_UPDATED + + """ + An order is cancelled. + """ + ORDER_CANCELLED + + """ + An order is fulfilled. + """ + ORDER_FULFILLED + + """ + An invoice for order requested. + """ + INVOICE_REQUESTED + + """ + An invoice is deleted. + """ + INVOICE_DELETED + + """ + Invoice has been sent. + """ + INVOICE_SENT + + """ + A new customer account is created. + """ + CUSTOMER_CREATED + + """ + A customer account is updated. + """ + CUSTOMER_UPDATED + + """ + A new product is created. + """ + PRODUCT_CREATED + + """ + A product is updated. + """ + PRODUCT_UPDATED + + """ + A product is deleted. + """ + PRODUCT_DELETED + + """ + A new product variant is created. + """ + PRODUCT_VARIANT_CREATED + + """ + A product variant is updated. + """ + PRODUCT_VARIANT_UPDATED + + """ + A product variant is deleted. + """ + PRODUCT_VARIANT_DELETED + + """ + A new checkout is created. + """ + CHECKOUT_CREATED + + """ + A checkout is updated. It also triggers all updates related to the checkout. + """ + CHECKOUT_UPDATED + + """ + A new fulfillment is created. + """ + FULFILLMENT_CREATED + + """ + User notification triggered. + """ + NOTIFY_USER + + """ + A new page is created. + """ + PAGE_CREATED + + """ + A page is updated. + """ + PAGE_UPDATED + + """ + A page is deleted. + """ + PAGE_DELETED +} + +""" +An enumeration. +""" +enum WebhookSampleEventTypeEnum { + ORDER_CREATED + ORDER_CONFIRMED + ORDER_FULLY_PAID + ORDER_UPDATED + ORDER_CANCELLED + ORDER_FULFILLED + INVOICE_REQUESTED + INVOICE_DELETED + INVOICE_SENT + CUSTOMER_CREATED + CUSTOMER_UPDATED + PRODUCT_CREATED + PRODUCT_UPDATED + PRODUCT_DELETED + PRODUCT_VARIANT_CREATED + PRODUCT_VARIANT_UPDATED + PRODUCT_VARIANT_DELETED + CHECKOUT_CREATED + CHECKOUT_UPDATED + FULFILLMENT_CREATED + NOTIFY_USER + PAGE_CREATED + PAGE_UPDATED + PAGE_DELETED +} + +""" +Updates a webhook subscription. +""" +type WebhookUpdate { + webhookErrors: [WebhookError!]! + @deprecated(reason: "Use errors field instead. This field will be removed in Saleor 4.0.") + errors: [WebhookError!]! + webhook: Webhook +} + +input WebhookUpdateInput { + """ + The new name of the webhook. + """ + name: String + + """ + The url to receive the payload. + """ + targetUrl: String + + """ + The events that webhook wants to subscribe. + """ + events: [WebhookEventTypeEnum] + + """ + ID of the app to which webhook belongs. + """ + app: ID + + """ + Determine if webhook will be set active or not. + """ + isActive: Boolean + + """ + Use to create a hash signature with each payload. + """ + secretKey: String +} + +""" +Represents weight value in a specific weight unit. +""" +type Weight { + """ + Weight unit. + """ + unit: WeightUnitsEnum! + + """ + Weight value. + """ + value: Float! +} + +scalar WeightScalar + +""" +An enumeration. +""" +enum WeightUnitsEnum { + G + LB + OZ + KG + TONNE +} + +""" +Anything +""" +scalar _Any + +union _Entity = + Address + | User + | Group + | App + | ProductVariant + | Product + | ProductType + | Collection + | Category + | ProductMedia + | ProductImage + | PageType + +type _Service { + sdl: String +} diff --git a/packages/saleor/src/api/cart.ts b/packages/saleor/src/api/cart.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/saleor/src/api/cart.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/saleor/src/api/catalog/products.ts b/packages/saleor/src/api/catalog/products.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/saleor/src/api/catalog/products.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/saleor/src/api/checkout.ts b/packages/saleor/src/api/checkout.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/saleor/src/api/checkout.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/saleor/src/api/customers/index.ts b/packages/saleor/src/api/customers/index.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/saleor/src/api/customers/index.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/saleor/src/api/customers/login.ts b/packages/saleor/src/api/customers/login.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/saleor/src/api/customers/login.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/saleor/src/api/customers/logout.ts b/packages/saleor/src/api/customers/logout.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/saleor/src/api/customers/logout.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/saleor/src/api/customers/signup.ts b/packages/saleor/src/api/customers/signup.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/saleor/src/api/customers/signup.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/saleor/src/api/endpoints/cart.ts b/packages/saleor/src/api/endpoints/cart.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/saleor/src/api/endpoints/cart.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/saleor/src/api/endpoints/catalog/products.ts b/packages/saleor/src/api/endpoints/catalog/products.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/saleor/src/api/endpoints/catalog/products.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/saleor/src/api/endpoints/checkout/index.ts b/packages/saleor/src/api/endpoints/checkout/index.ts new file mode 100644 index 0000000..2468c8d --- /dev/null +++ b/packages/saleor/src/api/endpoints/checkout/index.ts @@ -0,0 +1,53 @@ +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 getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ req, res, config }) => { + try { + const html = ` + + + + + + Checkout + + +
+ + + +

Checkout not yet implemented :(

+

+ See #64 +

+
+ + + ` + + res.status(200) + res.setHeader('Content-Type', 'text/html') + res.write(html) + res.end() + } catch (error) { + console.error(error) + + const message = 'An unexpected error ocurred' + + res.status(500).json({ data: null, errors: [{ message }] }) + } +} + +export const handlers: CheckoutEndpoint['handlers'] = { getCheckout } + +const checkoutApi = createEndpoint({ + handler: checkoutEndpoint, + handlers, +}) + +export default checkoutApi 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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /dev/null +++ b/packages/saleor/src/api/endpoints/customer/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/saleor/src/api/endpoints/login.ts b/packages/saleor/src/api/endpoints/login.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/saleor/src/api/endpoints/login.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/saleor/src/api/endpoints/logout.ts b/packages/saleor/src/api/endpoints/logout.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/saleor/src/api/endpoints/logout.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/saleor/src/api/endpoints/signup.ts b/packages/saleor/src/api/endpoints/signup.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/saleor/src/api/endpoints/signup.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/saleor/src/api/endpoints/wishlist.ts b/packages/saleor/src/api/endpoints/wishlist.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/saleor/src/api/endpoints/wishlist.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/saleor/src/api/index.ts b/packages/saleor/src/api/index.ts new file mode 100644 index 0000000..7ee17f6 --- /dev/null +++ b/packages/saleor/src/api/index.ts @@ -0,0 +1,38 @@ +import { CommerceAPI, CommerceAPIConfig, getCommerceApi as commerceApi } from '@vercel/commerce/api' +import * as operations from './operations' +import * as Const from '../const' + +if (!Const.API_URL) { + throw new Error(`The environment variable NEXT_SALEOR_API_URL is missing and it's required to access your store`) +} + +if (!Const.API_CHANNEL) { + throw new Error(`The environment variable NEXT_SALEOR_CHANNEL is missing and it's required to access your store`) +} + +import fetchGraphqlApi from './utils/fetch-graphql-api' + +export interface SaleorConfig extends CommerceAPIConfig { + storeChannel: string +} + +const config: SaleorConfig = { + locale: 'en-US', + commerceUrl: Const.API_URL, + apiToken: Const.SALEOR_TOKEN, + cartCookie: Const.CHECKOUT_ID_COOKIE, + cartCookieMaxAge: 60 * 60 * 24 * 30, + fetch: fetchGraphqlApi, + customerCookie: '', + storeChannel: Const.API_CHANNEL, +} + +export const provider = { config, operations } + +export type Provider = typeof provider + +export type SaleorAPI

= CommerceAPI

+ +export function getCommerceApi

(customProvider: P = provider as any): SaleorAPI

{ + return commerceApi(customProvider) +} diff --git a/packages/saleor/src/api/operations/get-all-pages.ts b/packages/saleor/src/api/operations/get-all-pages.ts new file mode 100644 index 0000000..37f2e3a --- /dev/null +++ b/packages/saleor/src/api/operations/get-all-pages.ts @@ -0,0 +1,47 @@ +import type { OperationContext } from '@vercel/commerce/api/operations' + +import { QueryPagesArgs, PageCountableEdge } from '../../../schema' +import type { SaleorConfig, Provider } from '..' +import * as Query from '../../utils/queries' + +export type Page = any + +export type GetAllPagesResult = T + +export default function getAllPagesOperation({ commerce }: OperationContext) { + async function getAllPages({ + query = Query.PageMany, + config, + variables, + }: { + url?: string + config?: Partial + variables?: QueryPagesArgs + preview?: boolean + query?: string + } = {}): Promise { + const { fetch, locale, locales = ['en-US'] } = commerce.getConfig(config) + + const { data } = await fetch( + query, + { variables }, + { + ...(locale && { + headers: { + 'Accept-Language': locale, + }, + }), + } + ) + + const pages = data.pages?.edges?.map(({ node: { title: name, slug, ...node } }: PageCountableEdge) => ({ + ...node, + url: `/${locale}/${slug}`, + name, + })) + + return { pages } + } + + return getAllPages +} diff --git a/packages/saleor/src/api/operations/get-all-product-paths.ts b/packages/saleor/src/api/operations/get-all-product-paths.ts new file mode 100644 index 0000000..66e8f95 --- /dev/null +++ b/packages/saleor/src/api/operations/get-all-product-paths.ts @@ -0,0 +1,38 @@ +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' + +export type GetAllProductPathsResult = { + products: Array<{ path: string }> +} + +export default function getAllProductPathsOperation({ commerce }: OperationContext) { + async function getAllProductPaths({ + query, + config, + variables, + }: { + query?: string + config?: SaleorConfig + variables?: any + } = {}): Promise { + config = commerce.getConfig(config) + + const products = await fetchAllProducts({ + config, + query: getAllProductsPathsQuery, + variables, + }) + + return { + products: products?.map(({ node: { slug } }: ProductCountableEdge) => ({ + path: `/${slug}`, + })), + } + } + + return getAllProductPaths +} diff --git a/packages/saleor/src/api/operations/get-all-products.ts b/packages/saleor/src/api/operations/get-all-products.ts new file mode 100644 index 0000000..f7982ad --- /dev/null +++ b/packages/saleor/src/api/operations/get-all-products.ts @@ -0,0 +1,64 @@ +import type { OperationContext } from '@vercel/commerce/api/operations' +import { Product } from '@vercel/commerce/types/product' + +import { ProductCountableEdge } from '../../../schema' +import type { Provider, SaleorConfig } from '..' +import { normalizeProduct } from '../../utils' + +import * as Query from '../../utils/queries' +import { GraphQLFetcherResult } from '@vercel/commerce/api' + +type ReturnType = { + products: Product[] +} + +export default function getAllProductsOperation({ commerce }: OperationContext) { + async function getAllProducts({ + query = Query.ProductMany, + variables, + config, + featured, + }: { + query?: string + variables?: any + config?: Partial + preview?: boolean + featured?: boolean + } = {}): Promise { + const { fetch, locale } = commerce.getConfig(config) + + if (featured) { + variables = { ...variables, categoryId: 'Q29sbGVjdGlvbjo0' } + query = Query.CollectionOne + } + + const { data }: GraphQLFetcherResult = await fetch( + query, + { variables }, + { + ...(locale && { + headers: { + 'Accept-Language': locale, + }, + }), + } + ) + + if (featured) { + const products = + data.collection.products?.edges?.map(({ node: p }: ProductCountableEdge) => normalizeProduct(p)) ?? [] + + return { + products, + } + } else { + const products = data.products?.edges?.map(({ node: p }: ProductCountableEdge) => normalizeProduct(p)) ?? [] + + return { + products, + } + } + } + + return getAllProducts +} diff --git a/packages/saleor/src/api/operations/get-page.ts b/packages/saleor/src/api/operations/get-page.ts new file mode 100644 index 0000000..bab9d92 --- /dev/null +++ b/packages/saleor/src/api/operations/get-page.ts @@ -0,0 +1,50 @@ +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { Provider, SaleorConfig } from '..' +import { QueryPageArgs } from '../../../schema' + +import * as Query from '../../utils/queries' + +export type Page = any + +export type GetPageResult = T + +export default function getPageOperation({ commerce }: OperationContext) { + async function getPage({ + query = Query.PageOne, + variables, + config, + }: { + query?: string + variables: QueryPageArgs + config?: Partial + preview?: boolean + }): Promise { + const { fetch, locale = 'en-US' } = commerce.getConfig(config) + + const { + data: { page }, + } = await fetch( + query, + { variables }, + { + ...(locale && { + headers: { + 'Accept-Language': locale, + }, + }), + } + ) + + return { + page: page + ? { + ...page, + name: page.title, + url: `/${locale}/${page.slug}`, + } + : null, + } + } + + return getPage +} diff --git a/packages/saleor/src/api/operations/get-product.ts b/packages/saleor/src/api/operations/get-product.ts new file mode 100644 index 0000000..5a33dec --- /dev/null +++ b/packages/saleor/src/api/operations/get-product.ts @@ -0,0 +1,46 @@ +import type { OperationContext } from '@vercel/commerce/api/operations' +import { normalizeProduct } from '../../utils' +import type { Provider, SaleorConfig } from '..' + +import * as Query from '../../utils/queries' + +type Variables = { + slug: string +} + +type ReturnType = { + product: any +} + +export default function getProductOperation({ commerce }: OperationContext) { + async function getProduct({ + query = Query.ProductOneBySlug, + variables, + config: cfg, + }: { + query?: string + variables: Variables + config?: Partial + preview?: boolean + }): Promise { + const { fetch, locale } = commerce.getConfig(cfg) + + const { data } = await fetch( + query, + { variables }, + { + ...(locale && { + headers: { + 'Accept-Language': locale, + }, + }), + } + ) + + return { + product: data?.product ? normalizeProduct(data.product) : null, + } + } + + return getProduct +} diff --git a/packages/saleor/src/api/operations/get-site-info.ts b/packages/saleor/src/api/operations/get-site-info.ts new file mode 100644 index 0000000..6ce7408 --- /dev/null +++ b/packages/saleor/src/api/operations/get-site-info.ts @@ -0,0 +1,35 @@ +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' + +interface GetSiteInfoResult { + categories: Category[] + brands: any[] +} + +export default function getSiteInfoOperation({ commerce }: OperationContext) { + async function getSiteInfo({ + query, + config, + variables, + }: { + query?: string + config?: Partial + preview?: boolean + variables?: any + } = {}): Promise { + const cfg = commerce.getConfig(config) + + const categories = await getCategories(cfg) + const brands = await getVendors(cfg) + + return { + categories, + brands, + } + } + + return getSiteInfo +} diff --git a/packages/saleor/src/api/operations/index.ts b/packages/saleor/src/api/operations/index.ts new file mode 100644 index 0000000..7872a20 --- /dev/null +++ b/packages/saleor/src/api/operations/index.ts @@ -0,0 +1,7 @@ +export { default as getAllPages } from './get-all-pages' +export { default as getPage } from './get-page' +export { default as getAllProducts } from './get-all-products' +export { default as getAllProductPaths } from './get-all-product-paths' +export { default as getProduct } from './get-product' +export { default as getSiteInfo } from './get-site-info' +export { default as login } from './login' diff --git a/packages/saleor/src/api/operations/login.ts b/packages/saleor/src/api/operations/login.ts new file mode 100644 index 0000000..76d1e78 --- /dev/null +++ b/packages/saleor/src/api/operations/login.ts @@ -0,0 +1,40 @@ +import type { ServerResponse } from 'http' +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { Provider, SaleorConfig } from '..' +import { throwUserErrors } from '../../utils' + +import * as Mutation from '../../utils/mutations' + +export default function loginOperation({ commerce }: OperationContext) { + async function login({ + query = Mutation.SessionCreate, + variables, + config, + }: { + query?: string + variables: any + res: ServerResponse + config?: SaleorConfig + }): Promise { + config = commerce.getConfig(config) + + const { + data: { customerAccessTokenCreate }, + } = await config.fetch(query, { variables }) + + throwUserErrors(customerAccessTokenCreate?.customerUserErrors) + + const customerAccessToken = customerAccessTokenCreate?.customerAccessToken + const accessToken = customerAccessToken?.accessToken + + // if (accessToken) { + // setCustomerToken(accessToken) + // } + + return { + result: customerAccessToken?.accessToken, + } + } + + return login +} diff --git a/packages/saleor/src/api/utils/fetch-all-products.ts b/packages/saleor/src/api/utils/fetch-all-products.ts new file mode 100644 index 0000000..761e127 --- /dev/null +++ b/packages/saleor/src/api/utils/fetch-all-products.ts @@ -0,0 +1,41 @@ +import { ProductCountableEdge } from '../../../schema' +import { SaleorConfig } from '..' + +const fetchAllProducts = async ({ + config, + query, + variables, + acc = [], + cursor, +}: { + config: SaleorConfig + query: string + acc?: ProductCountableEdge[] + variables?: any + cursor?: string +}): Promise => { + const { data } = await config.fetch(query, { + variables: { ...variables, cursor }, + }) + + const edges: ProductCountableEdge[] = data.products?.edges ?? [] + const hasNextPage = data.products?.pageInfo?.hasNextPage + acc = acc.concat(edges) + + if (hasNextPage) { + const cursor = edges.pop()?.cursor + if (cursor) { + return fetchAllProducts({ + config, + query, + variables, + acc, + cursor, + }) + } + } + + return acc +} + +export default fetchAllProducts diff --git a/packages/saleor/src/api/utils/fetch-graphql-api.ts b/packages/saleor/src/api/utils/fetch-graphql-api.ts new file mode 100644 index 0000000..de4d45a --- /dev/null +++ b/packages/saleor/src/api/utils/fetch-graphql-api.ts @@ -0,0 +1,37 @@ +import type { GraphQLFetcher } from '@vercel/commerce/api' +import fetch from './fetch' + +import { API_URL } from '../../const' +import { getError } from '../../utils/handle-fetch-response' +import { getCommerceApi } from '..' +import { getToken } from '../../utils/index' + +const fetchGraphqlApi: GraphQLFetcher = async (query: string, { variables } = {}, fetchOptions) => { + const config = getCommerceApi().getConfig() + const token = getToken() + + const res = await fetch(API_URL!, { + ...fetchOptions, + method: 'POST', + headers: { + ...(token && { + Authorization: `Bearer ${token}`, + }), + ...fetchOptions?.headers, + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + query, + variables, + }), + }) + + const { data, errors, status } = await res.json() + + if (errors) { + throw getError(errors, status) + } + + return { data, res } +} +export default fetchGraphqlApi diff --git a/packages/saleor/src/api/utils/fetch.ts b/packages/saleor/src/api/utils/fetch.ts new file mode 100644 index 0000000..0b83671 --- /dev/null +++ b/packages/saleor/src/api/utils/fetch.ts @@ -0,0 +1,2 @@ +import zeitFetch from '@vercel/fetch' +export default zeitFetch() diff --git a/packages/saleor/src/api/utils/is-allowed-method.ts b/packages/saleor/src/api/utils/is-allowed-method.ts new file mode 100644 index 0000000..cbaab22 --- /dev/null +++ b/packages/saleor/src/api/utils/is-allowed-method.ts @@ -0,0 +1,22 @@ +import type { NextApiRequest, NextApiResponse } from 'next' + +export default function isAllowedMethod(req: NextApiRequest, res: NextApiResponse, allowedMethods: string[]) { + const methods = allowedMethods.includes('OPTIONS') ? allowedMethods : [...allowedMethods, 'OPTIONS'] + + if (!req.method || !methods.includes(req.method)) { + res.status(405) + res.setHeader('Allow', methods.join(', ')) + res.end() + return false + } + + if (req.method === 'OPTIONS') { + res.status(200) + res.setHeader('Allow', methods.join(', ')) + res.setHeader('Content-Length', '0') + res.end() + return false + } + + return true +} diff --git a/packages/saleor/src/api/wishlist.ts b/packages/saleor/src/api/wishlist.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/saleor/src/api/wishlist.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/saleor/src/auth/use-login.tsx b/packages/saleor/src/auth/use-login.tsx new file mode 100644 index 0000000..33f95da --- /dev/null +++ b/packages/saleor/src/auth/use-login.tsx @@ -0,0 +1,63 @@ +import { useCallback } from 'react' + +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 '@vercel/commerce/auth/use-login' +import { setCSRFToken, setToken, throwUserErrors, checkoutAttach, getCheckoutId } from '../utils' +import { LoginHook } from '@vercel/commerce/types/login' + +export default useLogin as UseLogin + +export const handler: MutationHook = { + fetchOptions: { + query: mutation.SessionCreate, + }, + async fetcher({ input: { email, password }, options, fetch }) { + if (!(email && password)) { + throw new CommerceError({ + message: 'A first name, last name, email and password are required to login', + }) + } + + const { tokenCreate } = await fetch({ + ...options, + variables: { email, password }, + }) + + throwUserErrors(tokenCreate?.errors) + + const { token, csrfToken } = tokenCreate! + + if (token && csrfToken) { + setToken(token) + setCSRFToken(csrfToken) + + const { checkoutId } = getCheckoutId() + checkoutAttach(fetch, { + variables: { checkoutId }, + headers: { + Authorization: `JWT ${token}`, + }, + }) + } + + return null + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCustomer() + + return useCallback( + async function login(input) { + const data = await fetch({ input }) + await mutate() + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/saleor/src/auth/use-logout.tsx b/packages/saleor/src/auth/use-logout.tsx new file mode 100644 index 0000000..396cb47 --- /dev/null +++ b/packages/saleor/src/auth/use-logout.tsx @@ -0,0 +1,41 @@ +import { useCallback } from 'react' +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 '@vercel/commerce/types/logout' + +export default useLogout as UseLogout + +export const handler: MutationHook = { + fetchOptions: { + query: mutation.SessionDestroy, + }, + async fetcher({ options, fetch }) { + await fetch({ + ...options, + variables: {}, + }) + + setToken() + setCSRFToken() + setCheckoutToken() + + return null + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCustomer() + + return useCallback( + async function logout() { + const data = await fetch() + await mutate(null, false) + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/saleor/src/auth/use-signup.tsx b/packages/saleor/src/auth/use-signup.tsx new file mode 100644 index 0000000..e29ee3b --- /dev/null +++ b/packages/saleor/src/auth/use-signup.tsx @@ -0,0 +1,56 @@ +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 useCustomer from '../customer/use-customer' +import { AccountRegisterInput, Mutation, MutationAccountRegisterArgs } from '../../schema' + +import * as mutation from '../utils/mutations' +import { handleAutomaticLogin, throwUserErrors } from '../utils' +import { SignupHook } from '@vercel/commerce/types/signup' + +export default useSignup as UseSignup + +export const handler: MutationHook = { + fetchOptions: { + query: mutation.AccountCreate, + }, + async fetcher({ input: { email, password }, options, fetch }) { + if (!(email && password)) { + throw new CommerceError({ + message: 'A first name, last name, email and password are required to signup', + }) + } + + const { customerCreate } = await fetch({ + ...options, + variables: { + input: { + email, + password, + redirectUrl: 'https://localhost.com', + channel: 'default-channel', + }, + }, + }) + + throwUserErrors(customerCreate?.errors) + await handleAutomaticLogin(fetch, { email, password }) + + return null + }, + 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/packages/saleor/src/cart/index.ts b/packages/saleor/src/cart/index.ts new file mode 100644 index 0000000..f6d36b4 --- /dev/null +++ b/packages/saleor/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 useUpdateItem } from './use-update-item' +export { default as useRemoveItem } from './use-remove-item' diff --git a/packages/saleor/src/cart/use-add-item.tsx b/packages/saleor/src/cart/use-add-item.tsx new file mode 100644 index 0000000..2db0702 --- /dev/null +++ b/packages/saleor/src/cart/use-add-item.tsx @@ -0,0 +1,54 @@ +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 useCart from './use-cart' + +import * as mutation from '../utils/mutations' + +import { getCheckoutId, checkoutToCart } from '../utils' + +import { Mutation, MutationCheckoutLinesAddArgs } from '../../schema' +import { AddItemHook } from '@vercel/commerce/types/cart' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { query: mutation.CheckoutLineAdd }, + 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 { checkoutLinesAdd } = await fetch({ + ...options, + variables: { + checkoutId: getCheckoutId().checkoutId, + lineItems: [ + { + variantId: item.variantId, + quantity: item.quantity ?? 1, + }, + ], + }, + }) + + return checkoutToCart(checkoutLinesAdd) + }, + 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/saleor/src/cart/use-cart.tsx b/packages/saleor/src/cart/use-cart.tsx new file mode 100644 index 0000000..9360875 --- /dev/null +++ b/packages/saleor/src/cart/use-cart.tsx @@ -0,0 +1,53 @@ +import { useMemo } from 'react' +import useCommerceCart, { UseCart } from '@vercel/commerce/cart/use-cart' + +import { SWRHook } from '@vercel/commerce/utils/types' +import { checkoutCreate, checkoutToCart, getCheckoutId } from '../utils' +import * as query from '../utils/queries' +import { GetCartHook } from '@vercel/commerce/types/cart' + +export default useCommerceCart as UseCart + +export const handler: SWRHook = { + fetchOptions: { + query: query.CheckoutOne, + }, + async fetcher({ input: { cartId: checkoutId }, options, fetch }) { + let checkout + + if (checkoutId) { + const checkoutId = getCheckoutId().checkoutToken + const data = await fetch({ + ...options, + variables: { checkoutId }, + }) + + checkout = data + } + + if (checkout?.completedAt || !checkoutId) { + checkout = await checkoutCreate(fetch) + } + + return checkoutToCart(checkout) + }, + 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/saleor/src/cart/use-remove-item.tsx b/packages/saleor/src/cart/use-remove-item.tsx new file mode 100644 index 0000000..09d1aca --- /dev/null +++ b/packages/saleor/src/cart/use-remove-item.tsx @@ -0,0 +1,39 @@ +import { useCallback } from 'react' +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 { LineItem, RemoveItemHook } from '../types/cart' + +export default useRemoveItem as UseRemoveItem + +export const handler = { + fetchOptions: { query: mutation.CheckoutLineDelete }, + async fetcher({ input: { itemId }, options, fetch }: HookFetcherContext) { + const data = await fetch({ + ...options, + variables: { + checkoutId: getCheckoutId().checkoutId, + lineId: itemId, + }, + }) + return checkoutToCart(data.checkoutLineDelete) + }, + useHook: + ({ fetch }: MutationHookContext) => + () => { + const { mutate } = useCart() + + return useCallback( + async function removeItem(input) { + const data = await fetch({ input: { itemId: input.id } }) + await mutate(data, false) + + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/saleor/src/cart/use-update-item.tsx b/packages/saleor/src/cart/use-update-item.tsx new file mode 100644 index 0000000..ffca9b2 --- /dev/null +++ b/packages/saleor/src/cart/use-update-item.tsx @@ -0,0 +1,96 @@ +import { useCallback } from 'react' +import debounce from 'lodash.debounce' +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 * as mutation from '../utils/mutations' + +import type { UpdateItemHook } from '../types/cart' + +export type UpdateItemActionInput = T extends LineItem + ? Partial + : UpdateItemHook['actionInput'] + +export default useUpdateItem as UseUpdateItem + +export const handler = { + fetchOptions: { query: mutation.CheckoutLineUpdate }, + 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', + }) + } + + const checkoutId = getCheckoutId().checkoutId + const { checkoutLinesUpdate } = await fetch({ + ...options, + variables: { + checkoutId, + lineItems: [ + { + variantId: item.variantId, + quantity: item.quantity, + }, + ], + }, + }) + + return checkoutToCart(checkoutLinesUpdate) + }, + 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: { + item: { + productId, + variantId, + quantity: input.quantity, + }, + itemId, + }, + }) + await mutate(data, false) + return data + }, ctx.wait ?? 500), + [fetch, mutate] + ) + }, +} diff --git a/packages/saleor/src/checkout/use-checkout.tsx b/packages/saleor/src/checkout/use-checkout.tsx new file mode 100644 index 0000000..cab52bb --- /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/packages/saleor/src/commerce.config.json b/packages/saleor/src/commerce.config.json new file mode 100644 index 0000000..eddd306 --- /dev/null +++ b/packages/saleor/src/commerce.config.json @@ -0,0 +1,6 @@ +{ + "provider": "saleor", + "features": { + "wishlist": false + } +} diff --git a/packages/saleor/src/const.ts b/packages/saleor/src/const.ts new file mode 100644 index 0000000..df34877 --- /dev/null +++ b/packages/saleor/src/const.ts @@ -0,0 +1,5 @@ +export const API_URL = process.env.NEXT_PUBLIC_SALEOR_API_URL +export const API_CHANNEL = process.env.NEXT_PUBLIC_SALEOR_CHANNEL +export const CHECKOUT_ID_COOKIE = 'saleor.CheckoutID' +export const SALEOR_TOKEN = 'saleor.Token' +export const SALEOR_CRSF_TOKEN = 'saleor.CSRFToken' 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 0000000..fabd11b --- /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 0000000..938e6cd --- /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/packages/saleor/src/customer/index.ts b/packages/saleor/src/customer/index.ts new file mode 100644 index 0000000..6c903ec --- /dev/null +++ b/packages/saleor/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/packages/saleor/src/customer/use-customer.tsx b/packages/saleor/src/customer/use-customer.tsx new file mode 100644 index 0000000..8417938 --- /dev/null +++ b/packages/saleor/src/customer/use-customer.tsx @@ -0,0 +1,30 @@ +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' + +export default useCustomer as UseCustomer + +export const handler: SWRHook = { + fetchOptions: { + query: query.CustomerCurrent, + }, + async fetcher({ options, fetch }) { + const data = await fetch({ + ...options, + variables: {}, + }) + return data.me ?? null + }, + useHook: + ({ useData }) => + (input) => { + return useData({ + swrOptions: { + revalidateOnFocus: false, + ...input?.swrOptions, + }, + }) + }, +} diff --git a/packages/saleor/src/fetcher.ts b/packages/saleor/src/fetcher.ts new file mode 100644 index 0000000..c1be921 --- /dev/null +++ b/packages/saleor/src/fetcher.ts @@ -0,0 +1,20 @@ +import { Fetcher } from '@vercel/commerce/utils/types' +import { API_URL } from './const' +import { getToken, handleFetchResponse } from './utils' + +const fetcher: Fetcher = async ({ url = API_URL, method = 'POST', variables, query }) => { + const token = getToken() + + return handleFetchResponse( + await fetch(url!, { + method, + body: JSON.stringify({ query, variables }), + headers: { + Authorization: `JWT ${token}`, + 'Content-Type': 'application/json', + }, + }) + ) +} + +export default fetcher diff --git a/packages/saleor/src/index.tsx b/packages/saleor/src/index.tsx new file mode 100644 index 0000000..cf9aaf6 --- /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/packages/saleor/src/next.config.cjs b/packages/saleor/src/next.config.cjs new file mode 100644 index 0000000..397a37b --- /dev/null +++ b/packages/saleor/src/next.config.cjs @@ -0,0 +1,8 @@ +const commerce = require('./commerce.config.json') + +module.exports = { + commerce, + images: { + domains: [process.env.COMMERCE_IMAGE_HOST], + }, +} diff --git a/packages/saleor/src/product/use-price.tsx b/packages/saleor/src/product/use-price.tsx new file mode 100644 index 0000000..fd42d70 --- /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/packages/saleor/src/product/use-search.tsx b/packages/saleor/src/product/use-search.tsx new file mode 100644 index 0000000..69212cb --- /dev/null +++ b/packages/saleor/src/product/use-search.tsx @@ -0,0 +1,74 @@ +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 { getSearchVariables, normalizeProduct } from '../utils' + +import * as query from '../utils/queries' +import { SearchProductsHook } from '@vercel/commerce/types/product' + +export default useSearch as UseSearch + +export type SearchProductsInput = { + search?: string + categoryId?: string | number + brandId?: string | number + sort?: string +} + +export type SearchProductsData = { + products: Product[] + found: boolean +} + +export const handler: SWRHook = { + fetchOptions: { + query: query.ProductMany, + }, + async fetcher({ input, options, fetch }) { + const { categoryId, brandId } = input + + const data = await fetch({ + query: categoryId ? query.CollectionOne : options.query, + method: options?.method, + variables: getSearchVariables(input), + }) + + let edges + + if (categoryId) { + edges = data.collection?.products?.edges ?? [] + // FIXME @zaiste, no `vendor` in Saleor + // if (brandId) { + // edges = edges.filter( + // ({ node: { vendor } }: ProductCountableEdge) => + // vendor.replace(/\s+/g, '-').toLowerCase() === brandId + // ) + // } + } else { + edges = data.products?.edges ?? [] + } + + return { + products: edges.map(({ node }: ProductCountableEdge) => normalizeProduct(node)), + found: !!edges.length, + } + }, + 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/saleor/src/provider.ts b/packages/saleor/src/provider.ts new file mode 100644 index 0000000..becf299 --- /dev/null +++ b/packages/saleor/src/provider.ts @@ -0,0 +1,26 @@ +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' +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 fetcher from './fetcher' + +export const saleorProvider = { + locale: 'en-us', + cartCookie: CHECKOUT_ID_COOKIE, + fetcher, + cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, + customer: { useCustomer }, + products: { useSearch }, + auth: { useLogin, useLogout, useSignup }, +} + +export type SaleorProvider = typeof saleorProvider diff --git a/packages/saleor/src/types.ts b/packages/saleor/src/types.ts new file mode 100644 index 0000000..1bbf94c --- /dev/null +++ b/packages/saleor/src/types.ts @@ -0,0 +1,43 @@ +import type { Cart as CoreCart } from '@vercel/commerce/types' +import { CheckoutLine } from '../schema' + +export type SaleorCheckout = { + id: string + webUrl: string + lineItems: CheckoutLine[] +} + +export type Cart = CoreCart.Cart & { + lineItems: LineItem[] +} +export interface LineItem extends CoreCart.LineItem { + options?: any[] +} + +/** + * Cart mutations + */ + +export type OptionSelections = { + option_id: number + option_value: number | string +} + +export type CartItemBody = CoreCart.CartItemBody & { + productId: string // The product id is always required for BC + optionSelections?: OptionSelections +} + +// export type GetCartHandlerBody = CoreCart.GetCartHandlerBody + +// export type AddCartItemBody = Core.AddCartItemBody + +// export type AddCartItemHandlerBody = Core.AddCartItemHandlerBody + +// export type UpdateCartItemBody = Core.UpdateCartItemBody + +// export type UpdateCartItemHandlerBody = Core.UpdateCartItemHandlerBody + +// export type RemoveCartItemBody = Core.RemoveCartItemBody + +// export type RemoveCartItemHandlerBody = Core.RemoveCartItemHandlerBody diff --git a/packages/saleor/src/types/cart.ts b/packages/saleor/src/types/cart.ts new file mode 100644 index 0000000..9a4d293 --- /dev/null +++ b/packages/saleor/src/types/cart.ts @@ -0,0 +1,32 @@ +import * as Core from '@vercel/commerce/types/cart' + +export * from '@vercel/commerce/types/cart' + +export type SaleorCart = {} + +/** + * 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/saleor/src/utils/checkout-attach.ts b/packages/saleor/src/utils/checkout-attach.ts new file mode 100644 index 0000000..c7ab44a --- /dev/null +++ b/packages/saleor/src/utils/checkout-attach.ts @@ -0,0 +1,12 @@ +import * as mutation from './mutations' +import { CheckoutCustomerAttach } from '../../schema' + +export const checkoutAttach = async (fetch: any, { variables, headers }: any): Promise => { + const data = await fetch({ + query: mutation.CheckoutAttach, + variables, + headers, + }) + + return data +} diff --git a/packages/saleor/src/utils/checkout-create.ts b/packages/saleor/src/utils/checkout-create.ts new file mode 100644 index 0000000..0e86c13 --- /dev/null +++ b/packages/saleor/src/utils/checkout-create.ts @@ -0,0 +1,25 @@ +import Cookies from 'js-cookie' + +import * as mutation from './mutations' +import { CheckoutCreate } from '../../schema' +import { CHECKOUT_ID_COOKIE } from '../const' + +export const checkoutCreate = async (fetch: any): Promise => { + const data = await fetch({ query: mutation.CheckoutCreate }) + const checkout = data.checkoutCreate?.checkout + const checkoutId = checkout?.id + const checkoutToken = checkout?.token + + const value = `${checkoutId}:${checkoutToken}` + + if (checkoutId) { + const options = { + expires: 60 * 60 * 24 * 30, + } + Cookies.set(CHECKOUT_ID_COOKIE, value, options) + } + + return checkout +} + +export default checkoutCreate diff --git a/packages/saleor/src/utils/checkout-to-cart.ts b/packages/saleor/src/utils/checkout-to-cart.ts new file mode 100644 index 0000000..4c228ad --- /dev/null +++ b/packages/saleor/src/utils/checkout-to-cart.ts @@ -0,0 +1,48 @@ +import { Cart } from '../types' +import { CommerceError } from '@vercel/commerce/utils/errors' + +import { + CheckoutLinesAdd, + CheckoutLinesUpdate, + CheckoutCreate, + CheckoutError, + Checkout, + Maybe, + CheckoutLineDelete, +} from '../../schema' + +import { normalizeCart } from './normalize' +import throwUserErrors from './throw-user-errors' + +export type CheckoutQuery = { + checkout: Checkout + errors?: Array +} + +export type CheckoutPayload = + | CheckoutLinesAdd + | CheckoutLinesUpdate + | CheckoutCreate + | CheckoutQuery + | CheckoutLineDelete + +const checkoutToCart = (checkoutPayload?: Maybe): Cart => { + if (!checkoutPayload) { + throw new CommerceError({ + message: 'Missing checkout payload from response', + }) + } + + const checkout = checkoutPayload?.checkout + throwUserErrors(checkoutPayload?.errors) + + if (!checkout) { + throw new CommerceError({ + message: 'Missing checkout object from response', + }) + } + + return normalizeCart(checkout) +} + +export default checkoutToCart diff --git a/packages/saleor/src/utils/customer-token.ts b/packages/saleor/src/utils/customer-token.ts new file mode 100644 index 0000000..dd15fbe --- /dev/null +++ b/packages/saleor/src/utils/customer-token.ts @@ -0,0 +1,25 @@ +import Cookies, { CookieAttributes } from 'js-cookie' +import * as Const from '../const' + +export const getToken = () => Cookies.get(Const.SALEOR_TOKEN) +export const setToken = (token?: string, options?: CookieAttributes) => { + setCookie(Const.SALEOR_TOKEN, token, options) +} + +export const getCSRFToken = () => Cookies.get(Const.SALEOR_CRSF_TOKEN) +export const setCSRFToken = (token?: string, options?: CookieAttributes) => { + setCookie(Const.SALEOR_CRSF_TOKEN, token, options) +} + +export const getCheckoutToken = () => Cookies.get(Const.CHECKOUT_ID_COOKIE) +export const setCheckoutToken = (token?: string, options?: CookieAttributes) => { + setCookie(Const.CHECKOUT_ID_COOKIE, token, options) +} + +const setCookie = (name: string, token?: string, options?: CookieAttributes) => { + if (!token) { + Cookies.remove(name) + } else { + Cookies.set(name, token, options ?? { expires: 60 * 60 * 24 * 30 }) + } +} diff --git a/packages/saleor/src/utils/fragments/checkout-details.ts b/packages/saleor/src/utils/fragments/checkout-details.ts new file mode 100644 index 0000000..437c247 --- /dev/null +++ b/packages/saleor/src/utils/fragments/checkout-details.ts @@ -0,0 +1,49 @@ +export const CheckoutDetails = /* GraphQL */ ` + fragment CheckoutDetails on Checkout { + id + token + created + totalPrice { + currency + gross { + amount + } + } + subtotalPrice { + currency + gross { + amount + } + } + + lines { + id + variant { + id + name + sku + product { + name + slug + } + media { + url + } + pricing { + price { + gross { + amount + } + } + } + } + quantity + totalPrice { + currency + gross { + amount + } + } + } + } +` diff --git a/packages/saleor/src/utils/fragments/index.ts b/packages/saleor/src/utils/fragments/index.ts new file mode 100644 index 0000000..6c0c889 --- /dev/null +++ b/packages/saleor/src/utils/fragments/index.ts @@ -0,0 +1,2 @@ +export { ProductConnection } from './product' +export { CheckoutDetails } from './checkout-details' diff --git a/packages/saleor/src/utils/fragments/product.ts b/packages/saleor/src/utils/fragments/product.ts new file mode 100644 index 0000000..1ea59c0 --- /dev/null +++ b/packages/saleor/src/utils/fragments/product.ts @@ -0,0 +1,29 @@ +export const ProductConnection = /* GraphQL */ ` + fragment ProductConnection on ProductCountableConnection { + pageInfo { + hasNextPage + hasPreviousPage + } + edges { + node { + id + name + description + slug + pricing { + priceRange { + start { + net { + amount + } + } + } + } + media { + url + alt + } + } + } + } +` diff --git a/packages/saleor/src/utils/get-categories.ts b/packages/saleor/src/utils/get-categories.ts new file mode 100644 index 0000000..e2cc725 --- /dev/null +++ b/packages/saleor/src/utils/get-categories.ts @@ -0,0 +1,23 @@ +import { Category } from '@vercel/commerce/types/site' +import { SaleorConfig } from '../api' +import { CollectionCountableEdge } from '../../schema' +import * as query from './queries' + +const getCategories = async (config: SaleorConfig): Promise => { + const { data } = await config.fetch(query.CollectionMany, { + variables: { + first: 100, + }, + }) + + return ( + data.collections?.edges?.map(({ node: { id, name, slug } }: CollectionCountableEdge) => ({ + id, + name, + slug, + path: `/${slug}`, + })) ?? [] + ) +} + +export default getCategories diff --git a/packages/saleor/src/utils/get-checkout-id.ts b/packages/saleor/src/utils/get-checkout-id.ts new file mode 100644 index 0000000..de495a9 --- /dev/null +++ b/packages/saleor/src/utils/get-checkout-id.ts @@ -0,0 +1,9 @@ +import Cookies from 'js-cookie' +import { CHECKOUT_ID_COOKIE } from '../const' + +const getCheckoutId = (id?: string) => { + const r = Cookies.get(CHECKOUT_ID_COOKIE)?.split(':') || [] + return { checkoutId: r[0], checkoutToken: r[1] } +} + +export default getCheckoutId diff --git a/packages/saleor/src/utils/get-search-variables.ts b/packages/saleor/src/utils/get-search-variables.ts new file mode 100644 index 0000000..5adf938 --- /dev/null +++ b/packages/saleor/src/utils/get-search-variables.ts @@ -0,0 +1,18 @@ +import { getSortVariables } from './get-sort-variables' +import type { SearchProductsInput } from '../product/use-search' + +export const getSearchVariables = ({ brandId, search, categoryId, sort }: SearchProductsInput) => { + const sortBy = { + field: 'NAME', + direction: 'ASC', + ...getSortVariables(sort, !!categoryId), + channel: 'default-channel', + } + return { + categoryId, + filter: { search }, + sortBy, + } +} + +export default getSearchVariables diff --git a/packages/saleor/src/utils/get-sort-variables.ts b/packages/saleor/src/utils/get-sort-variables.ts new file mode 100644 index 0000000..fe040a0 --- /dev/null +++ b/packages/saleor/src/utils/get-sort-variables.ts @@ -0,0 +1,30 @@ +export const getSortVariables = (sort?: string, isCategory: boolean = false) => { + let output = {} + switch (sort) { + case 'price-asc': + output = { + field: 'PRICE', + direction: 'ASC', + } + break + case 'price-desc': + output = { + field: 'PRICE', + direction: 'DESC', + } + break + case 'trending-desc': + output = { + field: 'RANK', + direction: 'DESC', + } + break + case 'latest-desc': + output = { + field: 'DATE', + direction: 'DESC', + } + break + } + return output +} diff --git a/packages/saleor/src/utils/get-vendors.ts b/packages/saleor/src/utils/get-vendors.ts new file mode 100644 index 0000000..caae555 --- /dev/null +++ b/packages/saleor/src/utils/get-vendors.ts @@ -0,0 +1,41 @@ +import { SaleorConfig } from '../api' + +export type Brand = { + entityId: string + name: string + path: string +} + +export type BrandEdge = { + node: Brand +} + +export type Brands = BrandEdge[] + +// TODO: Find a way to get vendors from meta +const getVendors = async (config: SaleorConfig): Promise => { + // const vendors = await fetchAllProducts({ + // config, + // query: getAllProductVendors, + // variables: { + // first: 100, + // }, + // }) + + // let vendorsStrings = vendors.map(({ node: { vendor } }) => vendor) + + // return [...new Set(vendorsStrings)].map((v) => { + // const id = v.replace(/\s+/g, '-').toLowerCase() + // return { + // node: { + // entityId: id, + // name: v, + // path: `brands/${id}`, + // }, + // } + // }) + + return [] +} + +export default getVendors diff --git a/packages/saleor/src/utils/handle-fetch-response.ts b/packages/saleor/src/utils/handle-fetch-response.ts new file mode 100644 index 0000000..33fe15c --- /dev/null +++ b/packages/saleor/src/utils/handle-fetch-response.ts @@ -0,0 +1,27 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' + +export function getError(errors: any[], status: number) { + errors = errors ?? [{ message: 'Failed to fetch Saleor API' }] + return new FetcherError({ errors, status }) +} + +export async function getAsyncError(res: Response) { + const data = await res.json() + return getError(data.errors, res.status) +} + +const handleFetchResponse = async (res: Response) => { + if (res.ok) { + const { data, errors } = await res.json() + + if (errors && errors.length) { + throw getError(errors, res.status) + } + + return data + } + + throw await getAsyncError(res) +} + +export default handleFetchResponse diff --git a/packages/saleor/src/utils/handle-login.ts b/packages/saleor/src/utils/handle-login.ts new file mode 100644 index 0000000..b1beaed --- /dev/null +++ b/packages/saleor/src/utils/handle-login.ts @@ -0,0 +1,35 @@ +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' + +const handleLogin = (data: CreateToken) => { + throwUserErrors(data?.errors) + + const token = data?.token + + if (token) { + setToken(token) + setCSRFToken(token) + } + + return token +} + +export const handleAutomaticLogin = async ( + fetch: (options: FetcherOptions) => Promise, + input: MutationTokenCreateArgs +) => { + try { + const { tokenCreate } = await fetch({ + query: mutation.SessionCreate, + variables: { ...input }, + }) + handleLogin(tokenCreate!) + } catch (error) { + // + } +} + +export default handleLogin diff --git a/packages/saleor/src/utils/index.ts b/packages/saleor/src/utils/index.ts new file mode 100644 index 0000000..de81eea --- /dev/null +++ b/packages/saleor/src/utils/index.ts @@ -0,0 +1,19 @@ +export { getSortVariables } from './get-sort-variables' + +export { default as handleFetchResponse } from './handle-fetch-response' +export { default as getSearchVariables } from './get-search-variables' +export { default as getVendors } from './get-vendors' +export { default as getCategories } from './get-categories' +export { default as getCheckoutId } from './get-checkout-id' + +export { default as checkoutCreate } from './checkout-create' +export { checkoutAttach } from './checkout-attach' + +export { default as checkoutToCart } from './checkout-to-cart' +export { default as handleLogin, handleAutomaticLogin } from './handle-login' +export { default as throwUserErrors } from './throw-user-errors' + +export * from './queries' +export * from './mutations' +export * from './normalize' +export * from './customer-token' diff --git a/packages/saleor/src/utils/mutations/account-create.ts b/packages/saleor/src/utils/mutations/account-create.ts new file mode 100644 index 0000000..f50fe6d --- /dev/null +++ b/packages/saleor/src/utils/mutations/account-create.ts @@ -0,0 +1,15 @@ +export const AccountCreate = /* GraphQL */ ` + mutation AccountCreate($input: AccountRegisterInput!) { + accountRegister(input: $input) { + errors { + code + field + message + } + user { + email + isActive + } + } + } +` diff --git a/packages/saleor/src/utils/mutations/checkout-attach.ts b/packages/saleor/src/utils/mutations/checkout-attach.ts new file mode 100644 index 0000000..435be05 --- /dev/null +++ b/packages/saleor/src/utils/mutations/checkout-attach.ts @@ -0,0 +1,12 @@ +export const CheckoutAttach = /* GraphQl */ ` + mutation CheckoutAttach($checkoutId: ID!) { + checkoutCustomerAttach(checkoutId: $checkoutId) { + errors { + message + } + checkout { + id + } + } + } +` diff --git a/packages/saleor/src/utils/mutations/checkout-create.ts b/packages/saleor/src/utils/mutations/checkout-create.ts new file mode 100644 index 0000000..3cfe9d4 --- /dev/null +++ b/packages/saleor/src/utils/mutations/checkout-create.ts @@ -0,0 +1,17 @@ +import * as fragment from '../fragments' + +export const CheckoutCreate = /* GraphQL */ ` + mutation CheckoutCreate { + checkoutCreate(input: { email: "customer@example.com", lines: [], channel: "default-channel" }) { + errors { + code + field + message + } + checkout { + ...CheckoutDetails + } + } + } + ${fragment.CheckoutDetails} +` diff --git a/packages/saleor/src/utils/mutations/checkout-line-add.ts b/packages/saleor/src/utils/mutations/checkout-line-add.ts new file mode 100644 index 0000000..e7b8e0a --- /dev/null +++ b/packages/saleor/src/utils/mutations/checkout-line-add.ts @@ -0,0 +1,17 @@ +import * as fragment from '../fragments' + +export const CheckoutLineAdd = /* GraphQL */ ` + mutation CheckoutLineAdd($checkoutId: ID!, $lineItems: [CheckoutLineInput!]!) { + checkoutLinesAdd(checkoutId: $checkoutId, lines: $lineItems) { + errors { + code + field + message + } + checkout { + ...CheckoutDetails + } + } + } + ${fragment.CheckoutDetails} +` diff --git a/packages/saleor/src/utils/mutations/checkout-line-remove.ts b/packages/saleor/src/utils/mutations/checkout-line-remove.ts new file mode 100644 index 0000000..191ef54 --- /dev/null +++ b/packages/saleor/src/utils/mutations/checkout-line-remove.ts @@ -0,0 +1,17 @@ +import * as fragment from '../fragments' + +export const CheckoutLineDelete = /* GraphQL */ ` + mutation CheckoutLineDelete($checkoutId: ID!, $lineId: ID!) { + checkoutLineDelete(checkoutId: $checkoutId, lineId: $lineId) { + errors { + code + field + message + } + checkout { + ...CheckoutDetails + } + } + } + ${fragment.CheckoutDetails} +` diff --git a/packages/saleor/src/utils/mutations/checkout-line-update.ts b/packages/saleor/src/utils/mutations/checkout-line-update.ts new file mode 100644 index 0000000..50019d6 --- /dev/null +++ b/packages/saleor/src/utils/mutations/checkout-line-update.ts @@ -0,0 +1,17 @@ +import * as fragment from '../fragments' + +export const CheckoutLineUpdate = /* GraphQL */ ` + mutation CheckoutLineUpdate($checkoutId: ID!, $lineItems: [CheckoutLineInput!]!) { + checkoutLinesUpdate(checkoutId: $checkoutId, lines: $lineItems) { + errors { + code + field + message + } + checkout { + ...CheckoutDetails + } + } + } + ${fragment.CheckoutDetails} +` diff --git a/packages/saleor/src/utils/mutations/index.ts b/packages/saleor/src/utils/mutations/index.ts new file mode 100644 index 0000000..a1f3d60 --- /dev/null +++ b/packages/saleor/src/utils/mutations/index.ts @@ -0,0 +1,8 @@ +export { AccountCreate } from './account-create' +export { CheckoutCreate } from './checkout-create' +export { CheckoutLineAdd } from './checkout-line-add' +export { CheckoutLineUpdate } from './checkout-line-update' +export { CheckoutLineDelete } from './checkout-line-remove' +export { SessionCreate } from './session-create' +export { SessionDestroy } from './session-destroy' +export { CheckoutAttach } from './checkout-attach' diff --git a/packages/saleor/src/utils/mutations/session-create.ts b/packages/saleor/src/utils/mutations/session-create.ts new file mode 100644 index 0000000..d3c5a51 --- /dev/null +++ b/packages/saleor/src/utils/mutations/session-create.ts @@ -0,0 +1,14 @@ +export const SessionCreate = /* GraphQL */ ` + mutation SessionCreate($email: String!, $password: String!) { + tokenCreate(email: $email, password: $password) { + token + refreshToken + csrfToken + errors { + code + field + message + } + } + } +` diff --git a/packages/saleor/src/utils/mutations/session-destroy.ts b/packages/saleor/src/utils/mutations/session-destroy.ts new file mode 100644 index 0000000..def3a04 --- /dev/null +++ b/packages/saleor/src/utils/mutations/session-destroy.ts @@ -0,0 +1,10 @@ +export const SessionDestroy = /* GraphQL */ ` + mutation SessionDestroy { + tokensDeactivateAll { + errors { + field + message + } + } + } +` diff --git a/packages/saleor/src/utils/normalize.ts b/packages/saleor/src/utils/normalize.ts new file mode 100644 index 0000000..a4ff4b5 --- /dev/null +++ b/packages/saleor/src/utils/normalize.ts @@ -0,0 +1,133 @@ +import { Product } from '@vercel/commerce/types/product' + +import { Product as SaleorProduct, Checkout, CheckoutLine, Money, ProductVariant } from '../../schema' + +import type { Cart, LineItem } from '../types' + +// TODO: Check nextjs-commerce bug if no images are added for a product +const placeholderImg = '/product-img-placeholder.svg' + +const money = ({ amount, currency }: Money) => { + return { + value: +amount, + currencyCode: currency || 'USD', + } +} + +const normalizeProductOptions = (options: ProductVariant[]) => { + return options + ?.map((option) => option?.attributes) + .flat(1) + .reduce((acc, x) => { + if (acc.find(({ displayName }: any) => displayName === x.attribute.name)) { + return acc.map((opt: any) => { + return opt.displayName === x.attribute.name + ? { + ...opt, + values: [ + ...opt.values, + ...x.values.map((value: any) => ({ + label: value?.name, + })), + ], + } + : opt + }) + } + + return acc.concat({ + __typename: 'MultipleChoiceOption', + displayName: x.attribute.name, + variant: 'size', + values: x.values.map((value: any) => ({ + label: value?.name, + })), + }) + }, []) +} + +const normalizeProductVariants = (variants: ProductVariant[]) => { + return variants?.map((variant) => { + const { id, sku, name, pricing } = variant + const price = pricing?.price?.net && money(pricing.price.net)?.value + + return { + id, + name, + sku: sku ?? id, + price, + listPrice: price, + requiresShipping: true, + options: normalizeProductOptions([variant]), + } + }) +} + +export function normalizeProduct(productNode: SaleorProduct): Product { + const { id, name, media = [], variants, description, slug, pricing, ...rest } = productNode + + const product = { + id, + name, + vendor: '', + description: description ? JSON.parse(description)?.blocks[0]?.data.text : '', + path: `/${slug}`, + slug: slug?.replace(/^\/+|\/+$/g, ''), + price: (pricing?.priceRange?.start?.net && money(pricing.priceRange.start.net)) || { + value: 0, + currencyCode: 'USD', + }, + // TODO: Check nextjs-commerce bug if no images are added for a product + images: media?.length ? media : [{ url: placeholderImg }], + variants: variants && variants.length > 0 ? normalizeProductVariants(variants as ProductVariant[]) : [], + options: variants && variants.length > 0 ? normalizeProductOptions(variants as ProductVariant[]) : [], + ...rest, + } + + return product as Product +} + +export function normalizeCart(checkout: Checkout): Cart { + const lines = checkout.lines as CheckoutLine[] + const lineItems: LineItem[] = lines.length > 0 ? lines?.map(normalizeLineItem) : [] + + return { + id: checkout.id, + customerId: '', + email: '', + createdAt: checkout.created, + currency: { + code: checkout.totalPrice?.currency!, + }, + taxesIncluded: false, + lineItems, + lineItemsSubtotalPrice: checkout.subtotalPrice?.gross?.amount!, + subtotalPrice: checkout.subtotalPrice?.gross?.amount!, + totalPrice: checkout.totalPrice?.gross.amount!, + discounts: [], + } +} + +function normalizeLineItem({ id, variant, quantity }: CheckoutLine): LineItem { + return { + id, + variantId: String(variant?.id), + productId: String(variant?.id), + name: `${variant.product.name}`, + quantity, + variant: { + id: String(variant?.id), + sku: variant?.sku ?? '', + name: variant?.name!, + image: { + url: variant?.media![0] ? variant?.media![0].url : placeholderImg, + }, + requiresShipping: false, + price: variant?.pricing?.price?.gross.amount!, + listPrice: 0, + }, + path: String(variant?.product?.slug), + discounts: [], + options: [], + } +} diff --git a/packages/saleor/src/utils/queries/checkout-one.ts b/packages/saleor/src/utils/queries/checkout-one.ts new file mode 100644 index 0000000..ce48236 --- /dev/null +++ b/packages/saleor/src/utils/queries/checkout-one.ts @@ -0,0 +1,12 @@ +import * as fragment from '../fragments' + +export const CheckoutOne = /* GraphQL */ ` + query CheckoutOne($checkoutId: UUID!) { + checkout(token: $checkoutId) { + ... on Checkout { + ...CheckoutDetails + } + } + } + ${fragment.CheckoutDetails} +` diff --git a/packages/saleor/src/utils/queries/collection-many.ts b/packages/saleor/src/utils/queries/collection-many.ts new file mode 100644 index 0000000..b556e3f --- /dev/null +++ b/packages/saleor/src/utils/queries/collection-many.ts @@ -0,0 +1,13 @@ +export const CollectionMany = /* GraphQL */ ` + query CollectionMany($first: Int!, $channel: String = "default-channel") { + collections(first: $first, channel: $channel) { + edges { + node { + id + name + slug + } + } + } + } +` diff --git a/packages/saleor/src/utils/queries/collection-one.ts b/packages/saleor/src/utils/queries/collection-one.ts new file mode 100644 index 0000000..c2e593f --- /dev/null +++ b/packages/saleor/src/utils/queries/collection-one.ts @@ -0,0 +1,13 @@ +import * as fragment from '../fragments' + +export const CollectionOne = /* GraphQL */ ` + query getProductsFromCollection($categoryId: ID!, $first: Int = 100, $channel: String = "default-channel") { + collection(id: $categoryId, channel: $channel) { + id + products(first: $first) { + ...ProductConnection + } + } + } + ${fragment.ProductConnection} +` diff --git a/packages/saleor/src/utils/queries/customer-current.ts b/packages/saleor/src/utils/queries/customer-current.ts new file mode 100644 index 0000000..7965451 --- /dev/null +++ b/packages/saleor/src/utils/queries/customer-current.ts @@ -0,0 +1,11 @@ +export const CustomerCurrent = /* GraphQL */ ` + query CustomerCurrent { + me { + id + email + firstName + lastName + dateJoined + } + } +` diff --git a/packages/saleor/src/utils/queries/customer-one.ts b/packages/saleor/src/utils/queries/customer-one.ts new file mode 100644 index 0000000..d35b3f5 --- /dev/null +++ b/packages/saleor/src/utils/queries/customer-one.ts @@ -0,0 +1,7 @@ +export const CustomerOne = /* GraphQL */ ` + query CustomerOne($customerAccessToken: String!) { + customer(customerAccessToken: $customerAccessToken) { + id + } + } +` diff --git a/packages/saleor/src/utils/queries/get-all-product-vendors-query.ts b/packages/saleor/src/utils/queries/get-all-product-vendors-query.ts new file mode 100644 index 0000000..7d0f016 --- /dev/null +++ b/packages/saleor/src/utils/queries/get-all-product-vendors-query.ts @@ -0,0 +1,16 @@ +export const getAllProductVendors = /* GraphQL */ ` + query getAllProductVendors($first: Int = 250, $cursor: String) { + products(first: $first, after: $cursor) { + pageInfo { + hasNextPage + hasPreviousPage + } + edges { + node { + vendor + } + cursor + } + } + } +` diff --git a/packages/saleor/src/utils/queries/get-all-products-paths-query.ts b/packages/saleor/src/utils/queries/get-all-products-paths-query.ts new file mode 100644 index 0000000..d9acb82 --- /dev/null +++ b/packages/saleor/src/utils/queries/get-all-products-paths-query.ts @@ -0,0 +1,16 @@ +export const getAllProductsPathsQuery = /* GraphQL */ ` + query getAllProductPaths($first: Int = 100, $cursor: String, $channel: String = "default-channel") { + products(first: $first, after: $cursor, channel: $channel) { + pageInfo { + hasNextPage + hasPreviousPage + } + edges { + node { + slug + } + cursor + } + } + } +` diff --git a/packages/saleor/src/utils/queries/index.ts b/packages/saleor/src/utils/queries/index.ts new file mode 100644 index 0000000..542c46f --- /dev/null +++ b/packages/saleor/src/utils/queries/index.ts @@ -0,0 +1,14 @@ +export { CollectionMany } from './collection-many' +export { ProductOneBySlug } from './product-one-by-slug' +export { ProductMany } from './product-many' +export { CollectionOne } from './collection-one' +export { CheckoutOne } from './checkout-one' +export { PageMany } from './page-many' +export { PageOne } from './page-one' +export { CustomerCurrent } from './customer-current' + +// getCustomerIdQuery +export { CustomerOne } from './customer-one' + +export { getAllProductsPathsQuery } from './get-all-products-paths-query' +export { getAllProductVendors } from './get-all-product-vendors-query' diff --git a/packages/saleor/src/utils/queries/page-many.ts b/packages/saleor/src/utils/queries/page-many.ts new file mode 100644 index 0000000..94bba69 --- /dev/null +++ b/packages/saleor/src/utils/queries/page-many.ts @@ -0,0 +1,13 @@ +export const PageMany = /* GraphQL */ ` + query PageMany($first: Int = 100) { + pages(first: $first) { + edges { + node { + id + title + slug + } + } + } + } +` diff --git a/packages/saleor/src/utils/queries/page-one.ts b/packages/saleor/src/utils/queries/page-one.ts new file mode 100644 index 0000000..6d9789a --- /dev/null +++ b/packages/saleor/src/utils/queries/page-one.ts @@ -0,0 +1,9 @@ +export const PageOne = /* GraphQL */ ` + query PageOne($id: ID!) { + page(id: $id) { + id + title + slug + } + } +` diff --git a/packages/saleor/src/utils/queries/product-many.ts b/packages/saleor/src/utils/queries/product-many.ts new file mode 100644 index 0000000..7e0aa9a --- /dev/null +++ b/packages/saleor/src/utils/queries/product-many.ts @@ -0,0 +1,15 @@ +import * as fragment from '../fragments' + +export const ProductMany = /* GraphQL */ ` + query ProductMany( + $first: Int = 100 + $filter: ProductFilterInput + $sortBy: ProductOrder + $channel: String = "default-channel" + ) { + products(first: $first, channel: $channel, filter: $filter, sortBy: $sortBy) { + ...ProductConnection + } + } + ${fragment.ProductConnection} +` diff --git a/packages/saleor/src/utils/queries/product-one-by-slug.ts b/packages/saleor/src/utils/queries/product-one-by-slug.ts new file mode 100644 index 0000000..e9169f0 --- /dev/null +++ b/packages/saleor/src/utils/queries/product-one-by-slug.ts @@ -0,0 +1,43 @@ +export const ProductOneBySlug = /* GraphQL */ ` + query ProductOneBySlug($slug: String!, $channel: String = "default-channel") { + product(slug: $slug, channel: $channel) { + id + slug + name + description + pricing { + priceRange { + start { + net { + amount + } + } + } + } + variants { + id + name + attributes { + attribute { + name + } + values { + name + } + } + pricing { + price { + net { + amount + currency + } + } + } + } + media { + url + alt + } + } + } +` diff --git a/packages/saleor/src/utils/throw-user-errors.ts b/packages/saleor/src/utils/throw-user-errors.ts new file mode 100644 index 0000000..59345e7 --- /dev/null +++ b/packages/saleor/src/utils/throw-user-errors.ts @@ -0,0 +1,20 @@ +import { ValidationError } from '@vercel/commerce/utils/errors' + +import { CheckoutError, CheckoutErrorCode, AppError, AccountError, AccountErrorCode } from '../../schema' + +export type UserErrors = Array + +export type UserErrorCode = CheckoutErrorCode | AccountErrorCode | null | undefined + +export const throwUserErrors = (errors?: UserErrors) => { + if (errors && errors.length) { + throw new ValidationError({ + errors: errors.map(({ code, message }) => ({ + code: code ?? 'validation_error', + message: message || '', + })), + }) + } +} + +export default throwUserErrors diff --git a/packages/saleor/src/wishlist/use-add-item.tsx b/packages/saleor/src/wishlist/use-add-item.tsx new file mode 100644 index 0000000..75f067c --- /dev/null +++ b/packages/saleor/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/saleor/src/wishlist/use-remove-item.tsx b/packages/saleor/src/wishlist/use-remove-item.tsx new file mode 100644 index 0000000..a2d3a8a --- /dev/null +++ b/packages/saleor/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/packages/saleor/src/wishlist/use-wishlist.tsx b/packages/saleor/src/wishlist/use-wishlist.tsx new file mode 100644 index 0000000..56e7ea0 --- /dev/null +++ b/packages/saleor/src/wishlist/use-wishlist.tsx @@ -0,0 +1,46 @@ +// TODO: replace this hook and other wishlist hooks with a handler, or remove them if +// Saleor doesn't have a wishlist + +import { HookFetcher } from '@vercel/commerce/utils/types' +import { Product } from '../../schema' + +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/saleor/taskfile.js b/packages/saleor/taskfile.js new file mode 100644 index 0000000..39b1b2a --- /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 0000000..cd04ab2 --- /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/packages/sfcc/.env.template b/packages/sfcc/.env.template new file mode 100644 index 0000000..a649427 --- /dev/null +++ b/packages/sfcc/.env.template @@ -0,0 +1,7 @@ +COMMERCE_PROVIDER=@vercel/commerce-sfcc + +SFCC_CLIENT_ID= +SFCC_CLIENT_SECRET= +SFCC_ORG_ID= +SFCC_SHORT_CODE= +SFCC_SITE_ID= \ No newline at end of file diff --git a/packages/sfcc/.prettierignore b/packages/sfcc/.prettierignore new file mode 100644 index 0000000..f06235c --- /dev/null +++ b/packages/sfcc/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/packages/sfcc/.prettierrc b/packages/sfcc/.prettierrc new file mode 100644 index 0000000..e1076ed --- /dev/null +++ b/packages/sfcc/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/sfcc/README.md b/packages/sfcc/README.md new file mode 100644 index 0000000..feaa76f --- /dev/null +++ b/packages/sfcc/README.md @@ -0,0 +1,40 @@ +# Next.js SalesForce Cloud Commerce Provider + +SalesForce Cloud Commerce Demo: https://salesforce-cloud-commerce.vercel.store/ + +## Installation + +1. Copy the `.env.template` file in this directory to `/site/.env.local` in the main directory +2. Run `yarn` and then `yarn dev` in root folder + +## Features: + +```json +{ + "provider": "sfcc", + "features": { + "wishlist": false, + "cart": false, + "search": true, + "customerAuth": false, + "customCheckout": false + } +} +``` + +## References + +- SDK: https://github.com/SalesforceCommerceCloud/commerce-sdk +- isomorphic SDK (currently not used atm): https://github.com/SalesforceCommerceCloud/commerce-sdk-isomorphic +- PWA Kit storefront example: https://pwa-kit.mobify-storefront.com/ + +## Training Material and Documentation: + +For a detailed introduction into commerce clouds feature set and data setup please refer to our Training Material and Documentation: + +- [Salesforce Trailhead for B2C Commerce Cloud](https://trailhead.salesforce.com/en/content/learn/trails/cc-overview) +- [Salesforce Trailhead for Development on B2C Commerce Cloud](https://trailhead.salesforce.com/en/content/learn/trails/develop-for-commerce-cloud) +- [B2C Commerce Cloud Documentation](https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp) +- [B2C Commerce Cloud Open Commerce API Doc](https://documentation.b2c.commercecloud.salesforce.com/DOC1/topic/com.demandware.dochelp/OCAPI/current/usage/OpenCommerceAPI.html?cp=0_15) +- [Developer Center for Commerce Cloud (Commerce APIs specifically)](https://developer.salesforce.com/docs/commerce/commerce-api/overview) +- [SLAS Org Admin Setup Guide](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=slas-admin:Summary) diff --git a/packages/sfcc/package.json b/packages/sfcc/package.json new file mode 100644 index 0000000..c04dc19 --- /dev/null +++ b/packages/sfcc/package.json @@ -0,0 +1,80 @@ +{ + "name": "@vercel/commerce-sfcc", + "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", + "commerce-sdk": "^2.7.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/sfcc/src/api/endpoints/cart/index.ts b/packages/sfcc/src/api/endpoints/cart/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/sfcc/src/api/endpoints/cart/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/sfcc/src/api/endpoints/catalog/products/get-products.ts b/packages/sfcc/src/api/endpoints/catalog/products/get-products.ts new file mode 100644 index 0000000..3b676e5 --- /dev/null +++ b/packages/sfcc/src/api/endpoints/catalog/products/get-products.ts @@ -0,0 +1,32 @@ +import { normalizeSearchProducts } from '../../../utils/normalise-product' +import { ProductsEndpoint } from '.' + +const getProducts: ProductsEndpoint['handlers']['getProducts'] = async ({ + req, + res, + body: { search, categoryId, brandId, sort }, + config, +}) => { + const { sdk } = config + + // 'clothing' is our main category default, and a manually set category has priority + const searchTerm = categoryId ? (categoryId as string) : search || 'clothing' + + const searchClient = await sdk.getSearchClient() + // use SDK search API for initial products + const searchResults = await searchClient.productSearch({ + parameters: { + q: searchTerm, + limit: 20, + }, + }) + let products = [] + let found = false + if (searchResults.total) { + found = true + products = normalizeSearchProducts(searchResults.hits) as any[] + } + res.status(200).json({ data: { products, found } }) +} + +export default getProducts diff --git a/packages/sfcc/src/api/endpoints/catalog/products/index.ts b/packages/sfcc/src/api/endpoints/catalog/products/index.ts new file mode 100644 index 0000000..196eb04 --- /dev/null +++ b/packages/sfcc/src/api/endpoints/catalog/products/index.ts @@ -0,0 +1,19 @@ +import type { SFCCProviderAPI } from '../../..' + +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/sfcc/src/api/endpoints/checkout/index.ts b/packages/sfcc/src/api/endpoints/checkout/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/sfcc/src/api/endpoints/checkout/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/sfcc/src/api/endpoints/customer/address.ts b/packages/sfcc/src/api/endpoints/customer/address.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/sfcc/src/api/endpoints/customer/address.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/sfcc/src/api/endpoints/customer/card.ts b/packages/sfcc/src/api/endpoints/customer/card.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/sfcc/src/api/endpoints/customer/card.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/sfcc/src/api/endpoints/customer/index.ts b/packages/sfcc/src/api/endpoints/customer/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/sfcc/src/api/endpoints/customer/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/sfcc/src/api/endpoints/login/index.ts b/packages/sfcc/src/api/endpoints/login/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/sfcc/src/api/endpoints/login/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/sfcc/src/api/endpoints/logout/index.ts b/packages/sfcc/src/api/endpoints/logout/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/sfcc/src/api/endpoints/logout/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/sfcc/src/api/endpoints/signup/index.ts b/packages/sfcc/src/api/endpoints/signup/index.ts new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/sfcc/src/api/endpoints/signup/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/sfcc/src/api/endpoints/wishlist/index.tsx b/packages/sfcc/src/api/endpoints/wishlist/index.tsx new file mode 100644 index 0000000..491bf0a --- /dev/null +++ b/packages/sfcc/src/api/endpoints/wishlist/index.tsx @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/sfcc/src/api/index.ts b/packages/sfcc/src/api/index.ts new file mode 100644 index 0000000..50c6f46 --- /dev/null +++ b/packages/sfcc/src/api/index.ts @@ -0,0 +1,48 @@ +import type { CommerceAPI, CommerceAPIConfig } from '@vercel/commerce/api' +import { getCommerceApi as commerceApi } from '@vercel/commerce/api' +import createFetcher from './utils/fetch-local' +import sdk, { Sdk } from './utils/sfcc-sdk' + +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 SFCCConfig extends CommerceAPIConfig { + sdk: Sdk +} +const config: SFCCConfig = { + commerceUrl: '', + apiToken: '', + cartCookie: '', + customerCookie: '', + cartCookieMaxAge: 2592000, + fetch: createFetcher(() => getCommerceApi().getConfig()), + sdk, // SalesForce Cloud Commerce API SDK +} + +const operations = { + getAllPages, + getPage, + getSiteInfo, + getCustomerWishlist, + getAllProductPaths, + getAllProducts, + getProduct, +} + +export const provider = { config, operations } + +export type Provider = typeof provider +export type SFCCProviderAPI

= CommerceAPI< + P | any +> + +export function getCommerceApi

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

{ + return commerceApi(customProvider as any) +} diff --git a/packages/sfcc/src/api/operations/get-all-pages.ts b/packages/sfcc/src/api/operations/get-all-pages.ts new file mode 100644 index 0000000..4465fe6 --- /dev/null +++ b/packages/sfcc/src/api/operations/get-all-pages.ts @@ -0,0 +1,19 @@ +export type Page = { url: string } +export type GetAllPagesResult = { pages: Page[] } +import type { SFCCConfig } from '../index' + +export default function getAllPagesOperation() { + function getAllPages({ + config, + preview, + }: { + url?: string + config?: Partial + preview?: boolean + }): Promise { + return Promise.resolve({ + pages: [], + }) + } + return getAllPages +} diff --git a/packages/sfcc/src/api/operations/get-all-product-paths.ts b/packages/sfcc/src/api/operations/get-all-product-paths.ts new file mode 100644 index 0000000..85dd4f5 --- /dev/null +++ b/packages/sfcc/src/api/operations/get-all-product-paths.ts @@ -0,0 +1,45 @@ +import { Product } from '@vercel/commerce/types/product' +import { OperationContext } from '@vercel/commerce/api/operations' +import { normalizeSearchProducts } from '../utils/normalise-product' +import { SFCCConfig } from '..' + +export type GetAllProductPathsResult = { + products: Array<{ path: string }> +} + +export default function getAllProductPathsOperation({ + commerce, +}: OperationContext) { + async function getAllProductPaths({ + query, + config, + variables, + }: { + query?: string + config?: SFCCConfig + variables?: any + } = {}): Promise { + // TODO: support locale + const { sdk, locale } = commerce.getConfig(config) as SFCCConfig + const searchClient = await sdk.getSearchClient() + + // use SDK search API for initial products same as getAllProductsOperation + const searchResults = await searchClient.productSearch({ + parameters: { q: 'dress', limit: variables?.first }, + }) + + let products = [] as Product[] + + if (searchResults.total) { + products = normalizeSearchProducts(searchResults.hits) + } + + return { + products: products?.map(({ slug }: Product) => ({ + path: `/${slug}`, + })), + } + } + + return getAllProductPaths +} diff --git a/packages/sfcc/src/api/operations/get-all-products.ts b/packages/sfcc/src/api/operations/get-all-products.ts new file mode 100644 index 0000000..cb891e7 --- /dev/null +++ b/packages/sfcc/src/api/operations/get-all-products.ts @@ -0,0 +1,40 @@ +import { Product } from '@vercel/commerce/types/product' +import { GetAllProductsOperation } from '@vercel/commerce/types/product' +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { SFCCConfig } from '../index' +import { normalizeSearchProducts } from '../utils/normalise-product' + +export default function getAllProductsOperation({ + commerce, +}: OperationContext) { + async function getAllProducts({ + query = '', + variables, + config, + }: { + query?: string + variables?: T['variables'] + config?: Partial + preview?: boolean + } = {}): Promise<{ products: Product[] | any[] }> { + // TODO: support locale + const { sdk, locale } = commerce.getConfig(config) as SFCCConfig + const searchClient = await sdk.getSearchClient() + + // use SDK search API for initial products + const searchResults = await searchClient.productSearch({ + parameters: { q: 'dress', limit: variables?.first }, + }) + + let products = [] as Product[] + + if (searchResults.total) { + products = normalizeSearchProducts(searchResults.hits) + } + + return { + products: products, + } + } + return getAllProducts +} diff --git a/packages/sfcc/src/api/operations/get-customer-wishlist.ts b/packages/sfcc/src/api/operations/get-customer-wishlist.ts new file mode 100644 index 0000000..8c34b9e --- /dev/null +++ b/packages/sfcc/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/sfcc/src/api/operations/get-page.ts b/packages/sfcc/src/api/operations/get-page.ts new file mode 100644 index 0000000..b0cfdf5 --- /dev/null +++ b/packages/sfcc/src/api/operations/get-page.ts @@ -0,0 +1,13 @@ +export type Page = any +export type GetPageResult = { page?: Page } + +export type PageVariables = { + id: number +} + +export default function getPageOperation() { + function getPage(): Promise { + return Promise.resolve({}) + } + return getPage +} diff --git a/packages/sfcc/src/api/operations/get-product.ts b/packages/sfcc/src/api/operations/get-product.ts new file mode 100644 index 0000000..72449c5 --- /dev/null +++ b/packages/sfcc/src/api/operations/get-product.ts @@ -0,0 +1,33 @@ +import { GetProductOperation, Product } from '@vercel/commerce/types/product' +import type { SFCCConfig } from '../index' +import type { OperationContext } from '@vercel/commerce/api/operations' +import { normalizeProduct } from '../utils/normalise-product' + +export default function getProductOperation({ + commerce, +}: OperationContext) { + async function getProduct({ + query = '', + variables, + config, + }: { + query?: string + variables?: T['variables'] + config?: Partial + preview?: boolean + } = {}): Promise { + // TODO: support locale + const { sdk, locale } = commerce.getConfig(config) as SFCCConfig + const shopperProductsClient = await sdk.getshopperProductsClient() + const product = await shopperProductsClient.getProduct({ + parameters: { id: variables?.slug as string }, + }) + const normalizedProduct = normalizeProduct(product) + + return { + product: normalizedProduct, + } + } + + return getProduct +} diff --git a/packages/sfcc/src/api/operations/get-site-info.ts b/packages/sfcc/src/api/operations/get-site-info.ts new file mode 100644 index 0000000..43a74b1 --- /dev/null +++ b/packages/sfcc/src/api/operations/get-site-info.ts @@ -0,0 +1,43 @@ +import { OperationContext } from '@vercel/commerce/api/operations' +import { Category } from '@vercel/commerce/types/site' +import { SFCCConfig } from '../index' + +export type GetSiteInfoResult< + T extends { categories: any[]; brands: any[] } = { + categories: Category[] + brands: any[] + } +> = T + +export default function getSiteInfoOperation({}: OperationContext) { + function getSiteInfo({ + query, + variables, + config: cfg, + }: { + query?: string + variables?: any + config?: Partial + preview?: boolean + } = {}): Promise { + return Promise.resolve({ + categories: [ + { + id: 'new-arrivals', + name: 'New Arrivals', + slug: 'new-arrivals', + path: '/new-arrivals', + }, + { + id: 'womens-clothing-dresses', + name: 'Womens Clothing Dresses', + slug: 'womens-clothing-dresses', + path: '/womens-clothing-dresses', + }, + ], + brands: [], + }) + } + + return getSiteInfo +} diff --git a/packages/sfcc/src/api/operations/index.ts b/packages/sfcc/src/api/operations/index.ts new file mode 100644 index 0000000..086fdf8 --- /dev/null +++ b/packages/sfcc/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/sfcc/src/api/utils/fetch-local.ts b/packages/sfcc/src/api/utils/fetch-local.ts new file mode 100644 index 0000000..5a2bab0 --- /dev/null +++ b/packages/sfcc/src/api/utils/fetch-local.ts @@ -0,0 +1,34 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { GraphQLFetcher } from '@vercel/commerce/api' +import type { SFCCConfig } from '../index' +import fetch from './fetch' + +const fetchGraphqlApi: (getConfig: () => SFCCConfig) => GraphQLFetcher = + (getConfig) => + async (query: string, { variables, preview } = {}, fetchOptions) => { + const config = getConfig() + const res = await fetch(config.commerceUrl, { + ...fetchOptions, + method: 'POST', + headers: { + ...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 for API' }], + status: res.status, + }) + } + + return { data: json.data, res } + } + +export default fetchGraphqlApi diff --git a/packages/sfcc/src/api/utils/fetch.ts b/packages/sfcc/src/api/utils/fetch.ts new file mode 100644 index 0000000..9d9fff3 --- /dev/null +++ b/packages/sfcc/src/api/utils/fetch.ts @@ -0,0 +1,3 @@ +import zeitFetch from '@vercel/fetch' + +export default zeitFetch() diff --git a/packages/sfcc/src/api/utils/get-auth-token.ts b/packages/sfcc/src/api/utils/get-auth-token.ts new file mode 100644 index 0000000..373d6c6 --- /dev/null +++ b/packages/sfcc/src/api/utils/get-auth-token.ts @@ -0,0 +1,42 @@ +import { ClientConfig, Customer } from 'commerce-sdk' + +// client configuration parameters +export const clientConfig: ClientConfig = { + headers: { + authorization: ``, + }, + parameters: { + clientId: process.env.SFCC_CLIENT_ID || '', + organizationId: process.env.SFCC_ORG_ID || '', + shortCode: process.env.SFCC_SHORT_CODE || '', + siteId: process.env.SFCC_SITE_ID || '', + }, +} + +/** + * Get the shopper or guest JWT/access token, along with a refresh token, using client credentials + * + * @returns guest user authorization token + */ +export async function getGuestUserAuthToken(): Promise { + const credentials = `${process.env.SFCC_CLIENT_ID}:${process.env.SFCC_CLIENT_SECRET}` + const base64data = Buffer.from(credentials).toString('base64') + const headers = { Authorization: `Basic ${base64data}` } + const client = new Customer.ShopperLogin(clientConfig) + + return await client.getAccessToken({ + headers, + body: { + grant_type: 'client_credentials', + }, + }) +} + +export const getConfigAuth = async () => { + const shopperToken = await getGuestUserAuthToken() + const configAuth = { + ...clientConfig, + headers: { authorization: `Bearer ${shopperToken.access_token}` }, + } + return configAuth +} diff --git a/packages/sfcc/src/api/utils/normalise-product.ts b/packages/sfcc/src/api/utils/normalise-product.ts new file mode 100644 index 0000000..b8d0e2e --- /dev/null +++ b/packages/sfcc/src/api/utils/normalise-product.ts @@ -0,0 +1,96 @@ +import { Product as SFCCProduct, Search } from 'commerce-sdk' +import type { + Product, + ProductImage, + ProductOption, + ProductVariant, +} from '@vercel/commerce/types/product' + +const normaliseOptions = ( + options: SFCCProduct.ShopperProducts.Product['variationAttributes'] +): Product['options'] => { + if (!Array.isArray(options)) return [] + + return options.map((option) => { + return { + id: option.id, + displayName: option.name as string, + values: option.values!.map((value) => ({ label: value.name })), + } as ProductOption + }) +} + +const normaliseVariants = ( + variants: SFCCProduct.ShopperProducts.Product['variants'] +): Product['variants'] => { + if (!Array.isArray(variants)) return [] + + return variants.map((variant) => { + const options = [] as ProductOption[] + + if (variant.variationValues) { + for (const [key, value] of Object.entries(variant.variationValues)) { + const variantOptionObject = { + id: `${variant.productId}-${key}`, + displayName: key, + values: [ + { + label: value, + }, + ], + } + options.push(variantOptionObject) + } + } + + return { + id: variant.productId, + options, + } as ProductVariant + }) +} + +export function normalizeProduct( + product: SFCCProduct.ShopperProducts.Product +): Product { + return { + id: product.id, + // TODO: use `name-ID` as a virtual slug (for search 1:1) + slug: product.id, // use product ID as a slug + name: product.name!, + description: product.longDescription!, + price: { + value: product.price!, + currencyCode: product.currency, + }, + images: product.imageGroups![0].images.map((image) => ({ + url: image.disBaseLink, + altText: image.title, + })) as ProductImage[], + variants: normaliseVariants(product.variants), + options: normaliseOptions(product.variationAttributes), + } +} + +export function normalizeSearchProducts( + products: Search.ShopperSearch.ProductSearchHit[] +): Product[] { + return products.map((product) => ({ + id: product.productId, + slug: product.productId, // use product ID as a slug + name: product.productName!, + description: '', + price: { + value: product.price!, + currencyCode: product.currency, + }, + images: [ + { + url: product.image!.link, + altText: product.productName, + } as ProductImage, + ], + variants: normaliseVariants(product.variants), + options: normaliseOptions(product.variationAttributes), + })) +} diff --git a/packages/sfcc/src/api/utils/sfcc-sdk.ts b/packages/sfcc/src/api/utils/sfcc-sdk.ts new file mode 100644 index 0000000..8d20b67 --- /dev/null +++ b/packages/sfcc/src/api/utils/sfcc-sdk.ts @@ -0,0 +1,19 @@ +import { Product, Search } from 'commerce-sdk' +import { getConfigAuth } from './get-auth-token' + +const getSearchClient = async () => { + const configAuth = await getConfigAuth() + return new Search.ShopperSearch(configAuth) +} + +const getshopperProductsClient = async () => { + const configAuth = await getConfigAuth() + return new Product.ShopperProducts(configAuth) +} + +export const sdk = { + getshopperProductsClient, + getSearchClient, +} +export type Sdk = typeof sdk +export default sdk diff --git a/packages/sfcc/src/auth/index.ts b/packages/sfcc/src/auth/index.ts new file mode 100644 index 0000000..36e757a --- /dev/null +++ b/packages/sfcc/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/sfcc/src/auth/use-login.tsx b/packages/sfcc/src/auth/use-login.tsx new file mode 100644 index 0000000..20e3ed2 --- /dev/null +++ b/packages/sfcc/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/sfcc/src/auth/use-logout.tsx b/packages/sfcc/src/auth/use-logout.tsx new file mode 100644 index 0000000..4e74908 --- /dev/null +++ b/packages/sfcc/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/sfcc/src/auth/use-signup.tsx b/packages/sfcc/src/auth/use-signup.tsx new file mode 100644 index 0000000..e488114 --- /dev/null +++ b/packages/sfcc/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/sfcc/src/cart/index.ts b/packages/sfcc/src/cart/index.ts new file mode 100644 index 0000000..3b8ba99 --- /dev/null +++ b/packages/sfcc/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/sfcc/src/cart/use-add-item.tsx b/packages/sfcc/src/cart/use-add-item.tsx new file mode 100644 index 0000000..2be6e0a --- /dev/null +++ b/packages/sfcc/src/cart/use-add-item.tsx @@ -0,0 +1,17 @@ +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 = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => { + return async function addItem() { + return {} + } + }, +} diff --git a/packages/sfcc/src/cart/use-cart.tsx b/packages/sfcc/src/cart/use-cart.tsx new file mode 100644 index 0000000..8f92de3 --- /dev/null +++ b/packages/sfcc/src/cart/use-cart.tsx @@ -0,0 +1,42 @@ +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: { + query: '', + }, + async fetcher() { + return { + id: '', + createdAt: '', + currency: { code: '' }, + taxesIncluded: '', + lineItems: [], + lineItemsSubtotalPrice: '', + subtotalPrice: 0, + totalPrice: 0, + } + }, + useHook: + ({ useData }) => + (input) => { + return useMemo( + () => + Object.create( + {}, + { + isEmpty: { + get() { + return true + }, + enumerable: true, + }, + } + ), + [] + ) + }, +} diff --git a/packages/sfcc/src/cart/use-remove-item.tsx b/packages/sfcc/src/cart/use-remove-item.tsx new file mode 100644 index 0000000..92d52c9 --- /dev/null +++ b/packages/sfcc/src/cart/use-remove-item.tsx @@ -0,0 +1,20 @@ +import { MutationHook } from '@vercel/commerce/utils/types' +import useRemoveItem, { + UseRemoveItem, +} from '@vercel/commerce/cart/use-remove-item' + +export default useRemoveItem as UseRemoveItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => { + return async function removeItem(input) { + return {} + } + }, +} diff --git a/packages/sfcc/src/cart/use-update-item.tsx b/packages/sfcc/src/cart/use-update-item.tsx new file mode 100644 index 0000000..950f422 --- /dev/null +++ b/packages/sfcc/src/cart/use-update-item.tsx @@ -0,0 +1,20 @@ +import { MutationHook } from '@vercel/commerce/utils/types' +import useUpdateItem, { + UseUpdateItem, +} from '@vercel/commerce/cart/use-update-item' + +export default useUpdateItem as UseUpdateItem + +export const handler: MutationHook = { + fetchOptions: { + query: '', + }, + async fetcher({ input, options, fetch }) {}, + useHook: + ({ fetch }) => + () => { + return async function addItem() { + return {} + } + }, +} diff --git a/packages/sfcc/src/checkout/use-checkout.tsx b/packages/sfcc/src/checkout/use-checkout.tsx new file mode 100644 index 0000000..76997be --- /dev/null +++ b/packages/sfcc/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/sfcc/src/commerce.config.json b/packages/sfcc/src/commerce.config.json new file mode 100644 index 0000000..1d20645 --- /dev/null +++ b/packages/sfcc/src/commerce.config.json @@ -0,0 +1,10 @@ +{ + "provider": "sfcc", + "features": { + "wishlist": false, + "cart": false, + "search": true, + "customerAuth": false, + "customCheckout": false + } +} diff --git a/packages/sfcc/src/customer/address/use-add-item.tsx b/packages/sfcc/src/customer/address/use-add-item.tsx new file mode 100644 index 0000000..4f85c84 --- /dev/null +++ b/packages/sfcc/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/sfcc/src/customer/card/use-add-item.tsx b/packages/sfcc/src/customer/card/use-add-item.tsx new file mode 100644 index 0000000..77d149e --- /dev/null +++ b/packages/sfcc/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/sfcc/src/customer/index.ts b/packages/sfcc/src/customer/index.ts new file mode 100644 index 0000000..6c903ec --- /dev/null +++ b/packages/sfcc/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/packages/sfcc/src/customer/use-customer.tsx b/packages/sfcc/src/customer/use-customer.tsx new file mode 100644 index 0000000..04c4894 --- /dev/null +++ b/packages/sfcc/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/packages/sfcc/src/fetcher.ts b/packages/sfcc/src/fetcher.ts new file mode 100644 index 0000000..1da3571 --- /dev/null +++ b/packages/sfcc/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/sfcc/src/index.tsx b/packages/sfcc/src/index.tsx new file mode 100644 index 0000000..561f641 --- /dev/null +++ b/packages/sfcc/src/index.tsx @@ -0,0 +1,12 @@ +import { + getCommerceProvider, + useCommerce as useCoreCommerce, +} from '@vercel/commerce' +import { sfccProvider, SfccProvider } from './provider' + +export { sfccProvider } +export type { SfccProvider } + +export const CommerceProvider = getCommerceProvider(sfccProvider) + +export const useCommerce = () => useCoreCommerce() diff --git a/packages/sfcc/src/next.config.cjs b/packages/sfcc/src/next.config.cjs new file mode 100644 index 0000000..6c42018 --- /dev/null +++ b/packages/sfcc/src/next.config.cjs @@ -0,0 +1,12 @@ +const commerce = require('./commerce.config.json') + +module.exports = { + commerce, + images: { + domains: [ + 'localhost', + 'edge.disstg.commercecloud.salesforce.com', + 'zzte-053.sandbox.us02.dx.commercecloud.salesforce.com', + ], + }, +} diff --git a/packages/sfcc/src/product/index.ts b/packages/sfcc/src/product/index.ts new file mode 100644 index 0000000..426a3ed --- /dev/null +++ b/packages/sfcc/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/sfcc/src/product/use-price.tsx b/packages/sfcc/src/product/use-price.tsx new file mode 100644 index 0000000..fd42d70 --- /dev/null +++ b/packages/sfcc/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/sfcc/src/product/use-search.tsx b/packages/sfcc/src/product/use-search.tsx new file mode 100644 index 0000000..bb5e971 --- /dev/null +++ b/packages/sfcc/src/product/use-search.tsx @@ -0,0 +1,42 @@ +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 }) { + console.log('search', search, categoryId, options) + // 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/sfcc/src/provider.ts b/packages/sfcc/src/provider.ts new file mode 100644 index 0000000..47063f8 --- /dev/null +++ b/packages/sfcc/src/provider.ts @@ -0,0 +1,22 @@ +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' + +export const sfccProvider = { + locale: 'en-us', + cartCookie: 'session', + fetcher, + cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, + customer: { useCustomer }, + products: { useSearch }, + auth: { useLogin, useLogout, useSignup }, +} + +export type SfccProvider = typeof sfccProvider diff --git a/packages/sfcc/src/wishlist/use-add-item.tsx b/packages/sfcc/src/wishlist/use-add-item.tsx new file mode 100644 index 0000000..75f067c --- /dev/null +++ b/packages/sfcc/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/sfcc/src/wishlist/use-remove-item.tsx b/packages/sfcc/src/wishlist/use-remove-item.tsx new file mode 100644 index 0000000..a2d3a8a --- /dev/null +++ b/packages/sfcc/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/packages/sfcc/src/wishlist/use-wishlist.tsx b/packages/sfcc/src/wishlist/use-wishlist.tsx new file mode 100644 index 0000000..b2785d4 --- /dev/null +++ b/packages/sfcc/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/sfcc/taskfile.js b/packages/sfcc/taskfile.js new file mode 100644 index 0000000..39b1b2a --- /dev/null +++ b/packages/sfcc/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/sfcc/tsconfig.json b/packages/sfcc/tsconfig.json new file mode 100644 index 0000000..cd04ab2 --- /dev/null +++ b/packages/sfcc/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/shopify/.env.template b/packages/shopify/.env.template new file mode 100644 index 0000000..7ad711e --- /dev/null +++ b/packages/shopify/.env.template @@ -0,0 +1,4 @@ +COMMERCE_PROVIDER=@vercel/commerce-shopify + +NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN= +NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN= diff --git a/packages/shopify/.prettierignore b/packages/shopify/.prettierignore new file mode 100644 index 0000000..f06235c --- /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 0000000..e1076ed --- /dev/null +++ b/packages/shopify/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/shopify/README.md b/packages/shopify/README.md new file mode 100644 index 0000000..15a6e1f --- /dev/null +++ b/packages/shopify/README.md @@ -0,0 +1,135 @@ +## Shopify Provider + +**Demo:** https://shopify.demo.vercel.store/ + +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 packages/shopify/.env.template .env.local +``` + +Then, set the environment variables in `.env.local` to match the ones from your store. + +## 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). + +## Modifications + +These modifications are temporarily until contributions are made to remove them. + +### Adding item to Cart + +```js +// components/product/ProductView/ProductView.tsx +const ProductView: FC = ({ product }) => { + const addToCart = async () => { + setLoading(true) + try { + await addItem({ + productId: product.id, + variantId: variant ? variant.id : product.variants[0].id, + }) + openSidebar() + setLoading(false) + } catch (err) { + setLoading(false) + } + } +} +``` + +### Proceed to Checkout + +```js +// components/cart/CartSidebarView/CartSidebarView.tsx +import { useCommerce } from '@framework' + +const CartSidebarView: FC = () => { + const { checkout } = useCommerce() + return ( + + ) +} +``` + +## APIs + +Collections of APIs to fetch data from a Shopify store. + +The data is fetched using the [Shopify JavaScript Buy SDK](https://github.com/Shopify/js-buy-sdk#readme). Read the [Shopify Storefront API reference](https://shopify.dev/docs/storefront-api/reference) for more information. + +### getProduct + +Get a single product by its `handle`. + +```js +import getProduct from '@framework/product/get-product' +import { getConfig } from '@framework/api' + +const config = getConfig() + +const product = await getProduct({ + variables: { slug }, + config, +}) +``` + +### getAllProducts + +```js +import getAllProducts from '@framework/product/get-all-products' +import { getConfig } from '@framework/api' + +const config = getConfig() + +const { products } = await getAllProducts({ + variables: { first: 12 }, + config, +}) +``` + +### getAllCollections + +```js +import getAllCollections from '@framework/product/get-all-collections' +import { getConfig } from '@framework/api' + +const config = getConfig() + +const collections = await getAllCollections({ + config, +}) +``` + +### getAllPages + +```js +import getAllPages from '@framework/common/get-all-pages' +import { getConfig } from '@framework/api' + +const config = getConfig() + +const pages = await getAllPages({ + variables: { first: 12 }, + config, +}) +``` + +## Code generation + +This provider makes use of GraphQL code generation. The [schema.graphql](./schema.graphql) and [schema.d.ts](./schema.d.ts) files contain the generated types & schema introspection results. + +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: + +```sh +yarn generate:shopify +``` diff --git a/packages/shopify/codegen.json b/packages/shopify/codegen.json new file mode 100644 index 0000000..c82882c --- /dev/null +++ b/packages/shopify/codegen.json @@ -0,0 +1,32 @@ +{ + "schema": { + "https://${NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN}/api/2022-04/graphql.json": { + "headers": { + "X-Shopify-Storefront-Access-Token": "${NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN}" + } + } + }, + "documents": [ + { + "./src/**/*.{ts,tsx}": { + "noRequire": true + } + } + ], + "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/shopify/package.json b/packages/shopify/package.json new file mode 100644 index 0000000..6cc45b4 --- /dev/null +++ b/packages/shopify/package.json @@ -0,0 +1,88 @@ +{ + "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", + "lodash.debounce": "^4.0.8" + }, + "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/lodash.debounce": "^4.0.6", + "@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/packages/shopify/schema.d.ts b/packages/shopify/schema.d.ts new file mode 100644 index 0000000..328f0ff --- /dev/null +++ b/packages/shopify/schema.d.ts @@ -0,0 +1,5586 @@ +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 + /** An ISO-8601 encoded UTC date time string. Example value: `"2019-07-03T20:47:55Z"`. */ + DateTime: any + /** A signed decimal number, which supports arbitrary precision and is serialized as a string. Example value: `"29.99"`. */ + Decimal: any + /** A string containing HTML code. Example value: `"

Grey cotton knit sweater.

"`. */ + HTML: any + /** A monetary value string. Example value: `"100.57"`. */ + Money: any + /** + * An RFC 3986 and RFC 3987 compliant URI string. + * + * Example value: `"https://johns-apparel.myshopify.com"`. + * + */ + URL: any +} + +/** A version of the API. */ +export type ApiVersion = { + __typename?: 'ApiVersion' + /** The human-readable name of the version. */ + displayName: Scalars['String'] + /** The unique identifier of an ApiVersion. All supported API versions have a date-based (YYYY-MM) or `unstable` handle. */ + handle: Scalars['String'] + /** Whether the version is actively supported by Shopify. Supported API versions are guaranteed to be stable. Unsupported API versions include unstable, release candidate, and end-of-life versions that are marked as unsupported. For more information, refer to [Versioning](https://shopify.dev/concepts/about-apis/versioning). */ + supported: Scalars['Boolean'] +} + +/** Details about the gift card used on the checkout. */ +export type AppliedGiftCard = Node & { + __typename?: 'AppliedGiftCard' + /** + * The amount that was taken from the gift card by applying it. + * @deprecated Use `amountUsedV2` instead + */ + amountUsed: Scalars['Money'] + /** The amount that was taken from the gift card by applying it. */ + amountUsedV2: MoneyV2 + /** + * The amount left on the gift card. + * @deprecated Use `balanceV2` instead + */ + balance: Scalars['Money'] + /** The amount left on the gift card. */ + balanceV2: MoneyV2 + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The last characters of the gift card. */ + lastCharacters: Scalars['String'] + /** The amount that was applied to the checkout in its currency. */ + presentmentAmountUsed: MoneyV2 +} + +/** An article in an online store blog. */ +export type Article = Node & { + __typename?: 'Article' + /** + * The article's author. + * @deprecated Use `authorV2` instead + */ + author: ArticleAuthor + /** The article's author. */ + authorV2?: Maybe + /** The blog that the article belongs to. */ + blog: Blog + /** List of comments posted on the article. */ + comments: CommentConnection + /** Stripped content of the article, single line with HTML tags removed. */ + content: Scalars['String'] + /** The content of the article, complete with HTML formatting. */ + contentHtml: Scalars['HTML'] + /** Stripped excerpt of the article, single line with HTML tags removed. */ + excerpt?: Maybe + /** The excerpt of the article, complete with HTML formatting. */ + excerptHtml?: Maybe + /** A human-friendly unique string for the Article automatically generated from its title. */ + handle: Scalars['String'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The image associated with the article. */ + image?: Maybe + /** The date and time when the article was published. */ + publishedAt: Scalars['DateTime'] + /** The article’s SEO information. */ + seo?: Maybe + /** A categorization that a article can be tagged with. */ + tags: Array + /** The article’s name. */ + title: Scalars['String'] + /** The url pointing to the article accessible from the web. */ + url: Scalars['URL'] +} + +/** An article in an online store blog. */ +export type ArticleCommentsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** An article in an online store blog. */ +export type ArticleContentArgs = { + truncateAt?: Maybe +} + +/** An article in an online store blog. */ +export type ArticleExcerptArgs = { + truncateAt?: Maybe +} + +/** An article in an online store blog. */ +export type ArticleImageArgs = { + maxWidth?: Maybe + maxHeight?: Maybe + crop?: Maybe + scale?: Maybe +} + +/** The author of an article. */ +export type ArticleAuthor = { + __typename?: 'ArticleAuthor' + /** The author's bio. */ + bio?: Maybe + /** The author’s email. */ + email: Scalars['String'] + /** The author's first name. */ + firstName: Scalars['String'] + /** The author's last name. */ + lastName: Scalars['String'] + /** The author's full name. */ + name: Scalars['String'] +} + +/** An auto-generated type for paginating through multiple Articles. */ +export type ArticleConnection = { + __typename?: 'ArticleConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Article and a cursor during pagination. */ +export type ArticleEdge = { + __typename?: 'ArticleEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of ArticleEdge. */ + node: Article +} + +/** The set of valid sort keys for the Article query. */ +export enum ArticleSortKeys { + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `blog_title` value. */ + BlogTitle = 'BLOG_TITLE', + /** Sort by the `author` value. */ + Author = 'AUTHOR', + /** Sort by the `updated_at` value. */ + UpdatedAt = 'UPDATED_AT', + /** Sort by the `published_at` value. */ + PublishedAt = 'PUBLISHED_AT', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** Represents a generic custom attribute. */ +export type Attribute = { + __typename?: 'Attribute' + /** Key or name of the attribute. */ + key: Scalars['String'] + /** Value of the attribute. */ + value?: Maybe +} + +/** Specifies the input fields required for an attribute. */ +export type AttributeInput = { + /** Key or name of the attribute. */ + key: Scalars['String'] + /** Value of the attribute. */ + value: Scalars['String'] +} + +/** Automatic discount applications capture the intentions of a discount that was automatically applied. */ +export type AutomaticDiscountApplication = DiscountApplication & { + __typename?: 'AutomaticDiscountApplication' + /** The method by which the discount's value is allocated to its entitled items. */ + allocationMethod: DiscountApplicationAllocationMethod + /** Which lines of targetType that the discount is allocated over. */ + targetSelection: DiscountApplicationTargetSelection + /** The type of line that the discount is applicable towards. */ + targetType: DiscountApplicationTargetType + /** The title of the application. */ + title: Scalars['String'] + /** The value of the discount application. */ + value: PricingValue +} + +/** A collection of available shipping rates for a checkout. */ +export type AvailableShippingRates = { + __typename?: 'AvailableShippingRates' + /** + * Whether or not the shipping rates are ready. + * The `shippingRates` field is `null` when this value is `false`. + * This field should be polled until its value becomes `true`. + */ + ready: Scalars['Boolean'] + /** The fetched shipping rates. `null` until the `ready` field is `true`. */ + shippingRates?: Maybe> +} + +/** An online store blog. */ +export type Blog = Node & { + __typename?: 'Blog' + /** Find an article by its handle. */ + articleByHandle?: Maybe
+ /** List of the blog's articles. */ + articles: ArticleConnection + /** The authors who have contributed to the blog. */ + authors: Array + /** A human-friendly unique string for the Blog automatically generated from its title. */ + handle: Scalars['String'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The blog's SEO information. */ + seo?: Maybe + /** The blogs’s title. */ + title: Scalars['String'] + /** The url pointing to the blog accessible from the web. */ + url: Scalars['URL'] +} + +/** An online store blog. */ +export type BlogArticleByHandleArgs = { + handle: Scalars['String'] +} + +/** An online store blog. */ +export type BlogArticlesArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** An auto-generated type for paginating through multiple Blogs. */ +export type BlogConnection = { + __typename?: 'BlogConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Blog and a cursor during pagination. */ +export type BlogEdge = { + __typename?: 'BlogEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of BlogEdge. */ + node: Blog +} + +/** The set of valid sort keys for the Blog query. */ +export enum BlogSortKeys { + /** Sort by the `handle` value. */ + Handle = 'HANDLE', + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** Card brand, such as Visa or Mastercard, which can be used for payments. */ +export enum CardBrand { + /** Visa. */ + Visa = 'VISA', + /** Mastercard. */ + Mastercard = 'MASTERCARD', + /** Discover. */ + Discover = 'DISCOVER', + /** American Express. */ + AmericanExpress = 'AMERICAN_EXPRESS', + /** Diners Club. */ + DinersClub = 'DINERS_CLUB', + /** JCB. */ + Jcb = 'JCB', +} + +/** A container for all the information required to checkout items and pay. */ +export type Checkout = Node & { + __typename?: 'Checkout' + /** The gift cards used on the checkout. */ + appliedGiftCards: Array + /** + * The available shipping rates for this Checkout. + * Should only be used when checkout `requiresShipping` is `true` and + * the shipping address is valid. + */ + availableShippingRates?: Maybe + /** The date and time when the checkout was completed. */ + completedAt?: Maybe + /** The date and time when the checkout was created. */ + createdAt: Scalars['DateTime'] + /** The currency code for the Checkout. */ + currencyCode: CurrencyCode + /** A list of extra information that is added to the checkout. */ + customAttributes: Array + /** + * The customer associated with the checkout. + * @deprecated This field will always return null. If you have an authentication token for the customer, you can use the `customer` field on the query root to retrieve it. + */ + customer?: Maybe + /** Discounts that have been applied on the checkout. */ + discountApplications: DiscountApplicationConnection + /** The email attached to this checkout. */ + email?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** A list of line item objects, each one containing information about an item in the checkout. */ + lineItems: CheckoutLineItemConnection + /** The sum of all the prices of all the items in the checkout. Duties, taxes, shipping and discounts excluded. */ + lineItemsSubtotalPrice: MoneyV2 + /** The note associated with the checkout. */ + note?: Maybe + /** The resulting order from a paid checkout. */ + order?: Maybe + /** The Order Status Page for this Checkout, null when checkout is not completed. */ + orderStatusUrl?: Maybe + /** + * The amount left to be paid. This is equal to the cost of the line items, taxes and shipping minus discounts and gift cards. + * @deprecated Use `paymentDueV2` instead + */ + paymentDue: Scalars['Money'] + /** The amount left to be paid. This is equal to the cost of the line items, duties, taxes and shipping minus discounts and gift cards. */ + paymentDueV2: MoneyV2 + /** + * Whether or not the Checkout is ready and can be completed. Checkouts may + * have asynchronous operations that can take time to finish. If you want + * to complete a checkout or ensure all the fields are populated and up to + * date, polling is required until the value is true. + */ + ready: Scalars['Boolean'] + /** States whether or not the fulfillment requires shipping. */ + requiresShipping: Scalars['Boolean'] + /** The shipping address to where the line items will be shipped. */ + shippingAddress?: Maybe + /** The discounts that have been allocated onto the shipping line by discount applications. */ + shippingDiscountAllocations: Array + /** Once a shipping rate is selected by the customer it is transitioned to a `shipping_line` object. */ + shippingLine?: Maybe + /** + * Price of the checkout before shipping and taxes. + * @deprecated Use `subtotalPriceV2` instead + */ + subtotalPrice: Scalars['Money'] + /** Price of the checkout before duties, shipping and taxes. */ + subtotalPriceV2: MoneyV2 + /** Specifies if the Checkout is tax exempt. */ + taxExempt: Scalars['Boolean'] + /** Specifies if taxes are included in the line item and shipping line prices. */ + taxesIncluded: Scalars['Boolean'] + /** + * The sum of all the prices of all the items in the checkout, taxes and discounts included. + * @deprecated Use `totalPriceV2` instead + */ + totalPrice: Scalars['Money'] + /** The sum of all the prices of all the items in the checkout, duties, taxes and discounts included. */ + totalPriceV2: MoneyV2 + /** + * The sum of all the taxes applied to the line items and shipping lines in the checkout. + * @deprecated Use `totalTaxV2` instead + */ + totalTax: Scalars['Money'] + /** The sum of all the taxes applied to the line items and shipping lines in the checkout. */ + totalTaxV2: MoneyV2 + /** The date and time when the checkout was last updated. */ + updatedAt: Scalars['DateTime'] + /** The url pointing to the checkout accessible from the web. */ + webUrl: Scalars['URL'] +} + +/** A container for all the information required to checkout items and pay. */ +export type CheckoutDiscountApplicationsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** A container for all the information required to checkout items and pay. */ +export type CheckoutLineItemsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** Specifies the fields required to update a checkout's attributes. */ +export type CheckoutAttributesUpdateInput = { + /** The text of an optional note that a shop owner can attach to the checkout. */ + note?: Maybe + /** A list of extra information that is added to the checkout. */ + customAttributes?: Maybe> + /** + * Allows setting partial addresses on a Checkout, skipping the full validation of attributes. + * The required attributes are city, province, and country. + * Full validation of the addresses is still done at complete time. + */ + allowPartialAddresses?: Maybe +} + +/** Return type for `checkoutAttributesUpdate` mutation. */ +export type CheckoutAttributesUpdatePayload = { + __typename?: 'CheckoutAttributesUpdatePayload' + /** The updated checkout object. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Specifies the fields required to update a checkout's attributes. */ +export type CheckoutAttributesUpdateV2Input = { + /** The text of an optional note that a shop owner can attach to the checkout. */ + note?: Maybe + /** A list of extra information that is added to the checkout. */ + customAttributes?: Maybe> + /** + * Allows setting partial addresses on a Checkout, skipping the full validation of attributes. + * The required attributes are city, province, and country. + * Full validation of the addresses is still done at complete time. + */ + allowPartialAddresses?: Maybe +} + +/** Return type for `checkoutAttributesUpdateV2` mutation. */ +export type CheckoutAttributesUpdateV2Payload = { + __typename?: 'CheckoutAttributesUpdateV2Payload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCompleteFree` mutation. */ +export type CheckoutCompleteFreePayload = { + __typename?: 'CheckoutCompleteFreePayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCompleteWithCreditCard` mutation. */ +export type CheckoutCompleteWithCreditCardPayload = { + __typename?: 'CheckoutCompleteWithCreditCardPayload' + /** The checkout on which the payment was applied. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** A representation of the attempted payment. */ + payment?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCompleteWithCreditCardV2` mutation. */ +export type CheckoutCompleteWithCreditCardV2Payload = { + __typename?: 'CheckoutCompleteWithCreditCardV2Payload' + /** The checkout on which the payment was applied. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** A representation of the attempted payment. */ + payment?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCompleteWithTokenizedPayment` mutation. */ +export type CheckoutCompleteWithTokenizedPaymentPayload = { + __typename?: 'CheckoutCompleteWithTokenizedPaymentPayload' + /** The checkout on which the payment was applied. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** A representation of the attempted payment. */ + payment?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCompleteWithTokenizedPaymentV2` mutation. */ +export type CheckoutCompleteWithTokenizedPaymentV2Payload = { + __typename?: 'CheckoutCompleteWithTokenizedPaymentV2Payload' + /** The checkout on which the payment was applied. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** A representation of the attempted payment. */ + payment?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. */ +export type CheckoutCompleteWithTokenizedPaymentV3Payload = { + __typename?: 'CheckoutCompleteWithTokenizedPaymentV3Payload' + /** The checkout on which the payment was applied. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** A representation of the attempted payment. */ + payment?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Specifies the fields required to create a checkout. */ +export type CheckoutCreateInput = { + /** The email with which the customer wants to checkout. */ + email?: Maybe + /** A list of line item objects, each one containing information about an item in the checkout. */ + lineItems?: Maybe> + /** The shipping address to where the line items will be shipped. */ + shippingAddress?: Maybe + /** The text of an optional note that a shop owner can attach to the checkout. */ + note?: Maybe + /** A list of extra information that is added to the checkout. */ + customAttributes?: Maybe> + /** + * Allows setting partial addresses on a Checkout, skipping the full validation of attributes. + * The required attributes are city, province, and country. + * Full validation of addresses is still done at complete time. + */ + allowPartialAddresses?: Maybe + /** + * The three-letter currency code of one of the shop's enabled presentment currencies. + * Including this field creates a checkout in the specified currency. By default, new + * checkouts are created in the shop's primary currency. + */ + presentmentCurrencyCode?: Maybe +} + +/** Return type for `checkoutCreate` mutation. */ +export type CheckoutCreatePayload = { + __typename?: 'CheckoutCreatePayload' + /** The new checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCustomerAssociate` mutation. */ +export type CheckoutCustomerAssociatePayload = { + __typename?: 'CheckoutCustomerAssociatePayload' + /** The updated checkout object. */ + checkout: Checkout + /** The associated customer object. */ + customer?: Maybe + /** List of errors that occurred executing the mutation. */ + userErrors: Array +} + +/** Return type for `checkoutCustomerAssociateV2` mutation. */ +export type CheckoutCustomerAssociateV2Payload = { + __typename?: 'CheckoutCustomerAssociateV2Payload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** The associated customer object. */ + customer?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCustomerDisassociate` mutation. */ +export type CheckoutCustomerDisassociatePayload = { + __typename?: 'CheckoutCustomerDisassociatePayload' + /** The updated checkout object. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCustomerDisassociateV2` mutation. */ +export type CheckoutCustomerDisassociateV2Payload = { + __typename?: 'CheckoutCustomerDisassociateV2Payload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutDiscountCodeApply` mutation. */ +export type CheckoutDiscountCodeApplyPayload = { + __typename?: 'CheckoutDiscountCodeApplyPayload' + /** The updated checkout object. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutDiscountCodeApplyV2` mutation. */ +export type CheckoutDiscountCodeApplyV2Payload = { + __typename?: 'CheckoutDiscountCodeApplyV2Payload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutDiscountCodeRemove` mutation. */ +export type CheckoutDiscountCodeRemovePayload = { + __typename?: 'CheckoutDiscountCodeRemovePayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutEmailUpdate` mutation. */ +export type CheckoutEmailUpdatePayload = { + __typename?: 'CheckoutEmailUpdatePayload' + /** The checkout object with the updated email. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutEmailUpdateV2` mutation. */ +export type CheckoutEmailUpdateV2Payload = { + __typename?: 'CheckoutEmailUpdateV2Payload' + /** The checkout object with the updated email. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Possible error codes that could be returned by CheckoutUserError. */ +export enum CheckoutErrorCode { + /** Input value is blank. */ + Blank = 'BLANK', + /** Input value is invalid. */ + Invalid = 'INVALID', + /** Input value is too long. */ + TooLong = 'TOO_LONG', + /** Input value is not present. */ + Present = 'PRESENT', + /** Input value should be less than maximum allowed value. */ + LessThan = 'LESS_THAN', + /** Input value should be greater than or equal to minimum allowed value. */ + GreaterThanOrEqualTo = 'GREATER_THAN_OR_EQUAL_TO', + /** Input value should be less or equal to maximum allowed value. */ + LessThanOrEqualTo = 'LESS_THAN_OR_EQUAL_TO', + /** Checkout is already completed. */ + AlreadyCompleted = 'ALREADY_COMPLETED', + /** Checkout is locked. */ + Locked = 'LOCKED', + /** Input value is not supported. */ + NotSupported = 'NOT_SUPPORTED', + /** Input email contains an invalid domain name. */ + BadDomain = 'BAD_DOMAIN', + /** Input Zip is invalid for country provided. */ + InvalidForCountry = 'INVALID_FOR_COUNTRY', + /** Input Zip is invalid for country and province provided. */ + InvalidForCountryAndProvince = 'INVALID_FOR_COUNTRY_AND_PROVINCE', + /** Invalid state in country. */ + InvalidStateInCountry = 'INVALID_STATE_IN_COUNTRY', + /** Invalid province in country. */ + InvalidProvinceInCountry = 'INVALID_PROVINCE_IN_COUNTRY', + /** Invalid region in country. */ + InvalidRegionInCountry = 'INVALID_REGION_IN_COUNTRY', + /** Shipping rate expired. */ + ShippingRateExpired = 'SHIPPING_RATE_EXPIRED', + /** Gift card cannot be applied to a checkout that contains a gift card. */ + GiftCardUnusable = 'GIFT_CARD_UNUSABLE', + /** Gift card is disabled. */ + GiftCardDisabled = 'GIFT_CARD_DISABLED', + /** Gift card code is invalid. */ + GiftCardCodeInvalid = 'GIFT_CARD_CODE_INVALID', + /** Gift card has already been applied. */ + GiftCardAlreadyApplied = 'GIFT_CARD_ALREADY_APPLIED', + /** Gift card currency does not match checkout currency. */ + GiftCardCurrencyMismatch = 'GIFT_CARD_CURRENCY_MISMATCH', + /** Gift card is expired. */ + GiftCardExpired = 'GIFT_CARD_EXPIRED', + /** Gift card has no funds left. */ + GiftCardDepleted = 'GIFT_CARD_DEPLETED', + /** Gift card was not found. */ + GiftCardNotFound = 'GIFT_CARD_NOT_FOUND', + /** Cart does not meet discount requirements notice. */ + CartDoesNotMeetDiscountRequirementsNotice = 'CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE', + /** Discount expired. */ + DiscountExpired = 'DISCOUNT_EXPIRED', + /** Discount disabled. */ + DiscountDisabled = 'DISCOUNT_DISABLED', + /** Discount limit reached. */ + DiscountLimitReached = 'DISCOUNT_LIMIT_REACHED', + /** Discount not found. */ + DiscountNotFound = 'DISCOUNT_NOT_FOUND', + /** Customer already used once per customer discount notice. */ + CustomerAlreadyUsedOncePerCustomerDiscountNotice = 'CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE', + /** Checkout is already completed. */ + Empty = 'EMPTY', + /** Not enough in stock. */ + NotEnoughInStock = 'NOT_ENOUGH_IN_STOCK', + /** Missing payment input. */ + MissingPaymentInput = 'MISSING_PAYMENT_INPUT', + /** The amount of the payment does not match the value to be paid. */ + TotalPriceMismatch = 'TOTAL_PRICE_MISMATCH', + /** Line item was not found in checkout. */ + LineItemNotFound = 'LINE_ITEM_NOT_FOUND', + /** Unable to apply discount. */ + UnableToApply = 'UNABLE_TO_APPLY', + /** Discount already applied. */ + DiscountAlreadyApplied = 'DISCOUNT_ALREADY_APPLIED', +} + +/** Return type for `checkoutGiftCardApply` mutation. */ +export type CheckoutGiftCardApplyPayload = { + __typename?: 'CheckoutGiftCardApplyPayload' + /** The updated checkout object. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutGiftCardRemove` mutation. */ +export type CheckoutGiftCardRemovePayload = { + __typename?: 'CheckoutGiftCardRemovePayload' + /** The updated checkout object. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutGiftCardRemoveV2` mutation. */ +export type CheckoutGiftCardRemoveV2Payload = { + __typename?: 'CheckoutGiftCardRemoveV2Payload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutGiftCardsAppend` mutation. */ +export type CheckoutGiftCardsAppendPayload = { + __typename?: 'CheckoutGiftCardsAppendPayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** A single line item in the checkout, grouped by variant and attributes. */ +export type CheckoutLineItem = Node & { + __typename?: 'CheckoutLineItem' + /** Extra information in the form of an array of Key-Value pairs about the line item. */ + customAttributes: Array + /** The discounts that have been allocated onto the checkout line item by discount applications. */ + discountAllocations: Array + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The quantity of the line item. */ + quantity: Scalars['Int'] + /** Title of the line item. Defaults to the product's title. */ + title: Scalars['String'] + /** Unit price of the line item. */ + unitPrice?: Maybe + /** Product variant of the line item. */ + variant?: Maybe +} + +/** An auto-generated type for paginating through multiple CheckoutLineItems. */ +export type CheckoutLineItemConnection = { + __typename?: 'CheckoutLineItemConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one CheckoutLineItem and a cursor during pagination. */ +export type CheckoutLineItemEdge = { + __typename?: 'CheckoutLineItemEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of CheckoutLineItemEdge. */ + node: CheckoutLineItem +} + +/** Specifies the input fields to create a line item on a checkout. */ +export type CheckoutLineItemInput = { + /** Extra information in the form of an array of Key-Value pairs about the line item. */ + customAttributes?: Maybe> + /** The quantity of the line item. */ + quantity: Scalars['Int'] + /** The identifier of the product variant for the line item. */ + variantId: Scalars['ID'] +} + +/** Specifies the input fields to update a line item on the checkout. */ +export type CheckoutLineItemUpdateInput = { + /** The identifier of the line item. */ + id?: Maybe + /** The variant identifier of the line item. */ + variantId?: Maybe + /** The quantity of the line item. */ + quantity?: Maybe + /** Extra information in the form of an array of Key-Value pairs about the line item. */ + customAttributes?: Maybe> +} + +/** Return type for `checkoutLineItemsAdd` mutation. */ +export type CheckoutLineItemsAddPayload = { + __typename?: 'CheckoutLineItemsAddPayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutLineItemsRemove` mutation. */ +export type CheckoutLineItemsRemovePayload = { + __typename?: 'CheckoutLineItemsRemovePayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutLineItemsReplace` mutation. */ +export type CheckoutLineItemsReplacePayload = { + __typename?: 'CheckoutLineItemsReplacePayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + userErrors: Array +} + +/** Return type for `checkoutLineItemsUpdate` mutation. */ +export type CheckoutLineItemsUpdatePayload = { + __typename?: 'CheckoutLineItemsUpdatePayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutShippingAddressUpdate` mutation. */ +export type CheckoutShippingAddressUpdatePayload = { + __typename?: 'CheckoutShippingAddressUpdatePayload' + /** The updated checkout object. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutShippingAddressUpdateV2` mutation. */ +export type CheckoutShippingAddressUpdateV2Payload = { + __typename?: 'CheckoutShippingAddressUpdateV2Payload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutShippingLineUpdate` mutation. */ +export type CheckoutShippingLineUpdatePayload = { + __typename?: 'CheckoutShippingLineUpdatePayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Represents an error that happens during execution of a checkout mutation. */ +export type CheckoutUserError = DisplayableError & { + __typename?: 'CheckoutUserError' + /** Error code to uniquely identify the error. */ + code?: Maybe + /** Path to the input field which caused the error. */ + field?: Maybe> + /** The error message. */ + message: Scalars['String'] +} + +/** A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. */ +export type Collection = Node & { + __typename?: 'Collection' + /** Stripped description of the collection, single line with HTML tags removed. */ + description: Scalars['String'] + /** The description of the collection, complete with HTML formatting. */ + descriptionHtml: Scalars['HTML'] + /** + * A human-friendly unique string for the collection automatically generated from its title. + * Limit of 255 characters. + */ + handle: Scalars['String'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** Image associated with the collection. */ + image?: Maybe + /** List of products in the collection. */ + products: ProductConnection + /** The collection’s name. Limit of 255 characters. */ + title: Scalars['String'] + /** The date and time when the collection was last modified. */ + updatedAt: Scalars['DateTime'] +} + +/** A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. */ +export type CollectionDescriptionArgs = { + truncateAt?: Maybe +} + +/** A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. */ +export type CollectionImageArgs = { + maxWidth?: Maybe + maxHeight?: Maybe + crop?: Maybe + scale?: Maybe +} + +/** A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. */ +export type CollectionProductsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe +} + +/** An auto-generated type for paginating through multiple Collections. */ +export type CollectionConnection = { + __typename?: 'CollectionConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Collection and a cursor during pagination. */ +export type CollectionEdge = { + __typename?: 'CollectionEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of CollectionEdge. */ + node: Collection +} + +/** The set of valid sort keys for the Collection query. */ +export enum CollectionSortKeys { + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `updated_at` value. */ + UpdatedAt = 'UPDATED_AT', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** A comment on an article. */ +export type Comment = Node & { + __typename?: 'Comment' + /** The comment’s author. */ + author: CommentAuthor + /** Stripped content of the comment, single line with HTML tags removed. */ + content: Scalars['String'] + /** The content of the comment, complete with HTML formatting. */ + contentHtml: Scalars['HTML'] + /** Globally unique identifier. */ + id: Scalars['ID'] +} + +/** A comment on an article. */ +export type CommentContentArgs = { + truncateAt?: Maybe +} + +/** The author of a comment. */ +export type CommentAuthor = { + __typename?: 'CommentAuthor' + /** The author's email. */ + email: Scalars['String'] + /** The author’s name. */ + name: Scalars['String'] +} + +/** An auto-generated type for paginating through multiple Comments. */ +export type CommentConnection = { + __typename?: 'CommentConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Comment and a cursor during pagination. */ +export type CommentEdge = { + __typename?: 'CommentEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of CommentEdge. */ + node: Comment +} + +/** ISO 3166-1 alpha-2 country codes with some differences. */ +export enum CountryCode { + /** Afghanistan. */ + Af = 'AF', + /** Åland Islands. */ + Ax = 'AX', + /** Albania. */ + Al = 'AL', + /** Algeria. */ + Dz = 'DZ', + /** Andorra. */ + Ad = 'AD', + /** Angola. */ + Ao = 'AO', + /** Anguilla. */ + Ai = 'AI', + /** Antigua & Barbuda. */ + Ag = 'AG', + /** Argentina. */ + Ar = 'AR', + /** Armenia. */ + Am = 'AM', + /** Aruba. */ + Aw = 'AW', + /** Ascension Island. */ + Ac = 'AC', + /** Australia. */ + Au = 'AU', + /** Austria. */ + At = 'AT', + /** Azerbaijan. */ + Az = 'AZ', + /** Bahamas. */ + Bs = 'BS', + /** Bahrain. */ + Bh = 'BH', + /** Bangladesh. */ + Bd = 'BD', + /** Barbados. */ + Bb = 'BB', + /** Belarus. */ + By = 'BY', + /** Belgium. */ + Be = 'BE', + /** Belize. */ + Bz = 'BZ', + /** Benin. */ + Bj = 'BJ', + /** Bermuda. */ + Bm = 'BM', + /** Bhutan. */ + Bt = 'BT', + /** Bolivia. */ + Bo = 'BO', + /** Bosnia & Herzegovina. */ + Ba = 'BA', + /** Botswana. */ + Bw = 'BW', + /** Bouvet Island. */ + Bv = 'BV', + /** Brazil. */ + Br = 'BR', + /** British Indian Ocean Territory. */ + Io = 'IO', + /** Brunei. */ + Bn = 'BN', + /** Bulgaria. */ + Bg = 'BG', + /** Burkina Faso. */ + Bf = 'BF', + /** Burundi. */ + Bi = 'BI', + /** Cambodia. */ + Kh = 'KH', + /** Canada. */ + Ca = 'CA', + /** Cape Verde. */ + Cv = 'CV', + /** Caribbean Netherlands. */ + Bq = 'BQ', + /** Cayman Islands. */ + Ky = 'KY', + /** Central African Republic. */ + Cf = 'CF', + /** Chad. */ + Td = 'TD', + /** Chile. */ + Cl = 'CL', + /** China. */ + Cn = 'CN', + /** Christmas Island. */ + Cx = 'CX', + /** Cocos (Keeling) Islands. */ + Cc = 'CC', + /** Colombia. */ + Co = 'CO', + /** Comoros. */ + Km = 'KM', + /** Congo - Brazzaville. */ + Cg = 'CG', + /** Congo - Kinshasa. */ + Cd = 'CD', + /** Cook Islands. */ + Ck = 'CK', + /** Costa Rica. */ + Cr = 'CR', + /** Croatia. */ + Hr = 'HR', + /** Cuba. */ + Cu = 'CU', + /** Curaçao. */ + Cw = 'CW', + /** Cyprus. */ + Cy = 'CY', + /** Czechia. */ + Cz = 'CZ', + /** Côte d’Ivoire. */ + Ci = 'CI', + /** Denmark. */ + Dk = 'DK', + /** Djibouti. */ + Dj = 'DJ', + /** Dominica. */ + Dm = 'DM', + /** Dominican Republic. */ + Do = 'DO', + /** Ecuador. */ + Ec = 'EC', + /** Egypt. */ + Eg = 'EG', + /** El Salvador. */ + Sv = 'SV', + /** Equatorial Guinea. */ + Gq = 'GQ', + /** Eritrea. */ + Er = 'ER', + /** Estonia. */ + Ee = 'EE', + /** Eswatini. */ + Sz = 'SZ', + /** Ethiopia. */ + Et = 'ET', + /** Falkland Islands. */ + Fk = 'FK', + /** Faroe Islands. */ + Fo = 'FO', + /** Fiji. */ + Fj = 'FJ', + /** Finland. */ + Fi = 'FI', + /** France. */ + Fr = 'FR', + /** French Guiana. */ + Gf = 'GF', + /** French Polynesia. */ + Pf = 'PF', + /** French Southern Territories. */ + Tf = 'TF', + /** Gabon. */ + Ga = 'GA', + /** Gambia. */ + Gm = 'GM', + /** Georgia. */ + Ge = 'GE', + /** Germany. */ + De = 'DE', + /** Ghana. */ + Gh = 'GH', + /** Gibraltar. */ + Gi = 'GI', + /** Greece. */ + Gr = 'GR', + /** Greenland. */ + Gl = 'GL', + /** Grenada. */ + Gd = 'GD', + /** Guadeloupe. */ + Gp = 'GP', + /** Guatemala. */ + Gt = 'GT', + /** Guernsey. */ + Gg = 'GG', + /** Guinea. */ + Gn = 'GN', + /** Guinea-Bissau. */ + Gw = 'GW', + /** Guyana. */ + Gy = 'GY', + /** Haiti. */ + Ht = 'HT', + /** Heard & McDonald Islands. */ + Hm = 'HM', + /** Vatican City. */ + Va = 'VA', + /** Honduras. */ + Hn = 'HN', + /** Hong Kong SAR. */ + Hk = 'HK', + /** Hungary. */ + Hu = 'HU', + /** Iceland. */ + Is = 'IS', + /** India. */ + In = 'IN', + /** Indonesia. */ + Id = 'ID', + /** Iran. */ + Ir = 'IR', + /** Iraq. */ + Iq = 'IQ', + /** Ireland. */ + Ie = 'IE', + /** Isle of Man. */ + Im = 'IM', + /** Israel. */ + Il = 'IL', + /** Italy. */ + It = 'IT', + /** Jamaica. */ + Jm = 'JM', + /** Japan. */ + Jp = 'JP', + /** Jersey. */ + Je = 'JE', + /** Jordan. */ + Jo = 'JO', + /** Kazakhstan. */ + Kz = 'KZ', + /** Kenya. */ + Ke = 'KE', + /** Kiribati. */ + Ki = 'KI', + /** North Korea. */ + Kp = 'KP', + /** Kosovo. */ + Xk = 'XK', + /** Kuwait. */ + Kw = 'KW', + /** Kyrgyzstan. */ + Kg = 'KG', + /** Laos. */ + La = 'LA', + /** Latvia. */ + Lv = 'LV', + /** Lebanon. */ + Lb = 'LB', + /** Lesotho. */ + Ls = 'LS', + /** Liberia. */ + Lr = 'LR', + /** Libya. */ + Ly = 'LY', + /** Liechtenstein. */ + Li = 'LI', + /** Lithuania. */ + Lt = 'LT', + /** Luxembourg. */ + Lu = 'LU', + /** Macao SAR. */ + Mo = 'MO', + /** Madagascar. */ + Mg = 'MG', + /** Malawi. */ + Mw = 'MW', + /** Malaysia. */ + My = 'MY', + /** Maldives. */ + Mv = 'MV', + /** Mali. */ + Ml = 'ML', + /** Malta. */ + Mt = 'MT', + /** Martinique. */ + Mq = 'MQ', + /** Mauritania. */ + Mr = 'MR', + /** Mauritius. */ + Mu = 'MU', + /** Mayotte. */ + Yt = 'YT', + /** Mexico. */ + Mx = 'MX', + /** Moldova. */ + Md = 'MD', + /** Monaco. */ + Mc = 'MC', + /** Mongolia. */ + Mn = 'MN', + /** Montenegro. */ + Me = 'ME', + /** Montserrat. */ + Ms = 'MS', + /** Morocco. */ + Ma = 'MA', + /** Mozambique. */ + Mz = 'MZ', + /** Myanmar (Burma). */ + Mm = 'MM', + /** Namibia. */ + Na = 'NA', + /** Nauru. */ + Nr = 'NR', + /** Nepal. */ + Np = 'NP', + /** Netherlands. */ + Nl = 'NL', + /** Netherlands Antilles. */ + An = 'AN', + /** New Caledonia. */ + Nc = 'NC', + /** New Zealand. */ + Nz = 'NZ', + /** Nicaragua. */ + Ni = 'NI', + /** Niger. */ + Ne = 'NE', + /** Nigeria. */ + Ng = 'NG', + /** Niue. */ + Nu = 'NU', + /** Norfolk Island. */ + Nf = 'NF', + /** North Macedonia. */ + Mk = 'MK', + /** Norway. */ + No = 'NO', + /** Oman. */ + Om = 'OM', + /** Pakistan. */ + Pk = 'PK', + /** Palestinian Territories. */ + Ps = 'PS', + /** Panama. */ + Pa = 'PA', + /** Papua New Guinea. */ + Pg = 'PG', + /** Paraguay. */ + Py = 'PY', + /** Peru. */ + Pe = 'PE', + /** Philippines. */ + Ph = 'PH', + /** Pitcairn Islands. */ + Pn = 'PN', + /** Poland. */ + Pl = 'PL', + /** Portugal. */ + Pt = 'PT', + /** Qatar. */ + Qa = 'QA', + /** Cameroon. */ + Cm = 'CM', + /** Réunion. */ + Re = 'RE', + /** Romania. */ + Ro = 'RO', + /** Russia. */ + Ru = 'RU', + /** Rwanda. */ + Rw = 'RW', + /** St. Barthélemy. */ + Bl = 'BL', + /** St. Helena. */ + Sh = 'SH', + /** St. Kitts & Nevis. */ + Kn = 'KN', + /** St. Lucia. */ + Lc = 'LC', + /** St. Martin. */ + Mf = 'MF', + /** St. Pierre & Miquelon. */ + Pm = 'PM', + /** Samoa. */ + Ws = 'WS', + /** San Marino. */ + Sm = 'SM', + /** São Tomé & Príncipe. */ + St = 'ST', + /** Saudi Arabia. */ + Sa = 'SA', + /** Senegal. */ + Sn = 'SN', + /** Serbia. */ + Rs = 'RS', + /** Seychelles. */ + Sc = 'SC', + /** Sierra Leone. */ + Sl = 'SL', + /** Singapore. */ + Sg = 'SG', + /** Sint Maarten. */ + Sx = 'SX', + /** Slovakia. */ + Sk = 'SK', + /** Slovenia. */ + Si = 'SI', + /** Solomon Islands. */ + Sb = 'SB', + /** Somalia. */ + So = 'SO', + /** South Africa. */ + Za = 'ZA', + /** South Georgia & South Sandwich Islands. */ + Gs = 'GS', + /** South Korea. */ + Kr = 'KR', + /** South Sudan. */ + Ss = 'SS', + /** Spain. */ + Es = 'ES', + /** Sri Lanka. */ + Lk = 'LK', + /** St. Vincent & Grenadines. */ + Vc = 'VC', + /** Sudan. */ + Sd = 'SD', + /** Suriname. */ + Sr = 'SR', + /** Svalbard & Jan Mayen. */ + Sj = 'SJ', + /** Sweden. */ + Se = 'SE', + /** Switzerland. */ + Ch = 'CH', + /** Syria. */ + Sy = 'SY', + /** Taiwan. */ + Tw = 'TW', + /** Tajikistan. */ + Tj = 'TJ', + /** Tanzania. */ + Tz = 'TZ', + /** Thailand. */ + Th = 'TH', + /** Timor-Leste. */ + Tl = 'TL', + /** Togo. */ + Tg = 'TG', + /** Tokelau. */ + Tk = 'TK', + /** Tonga. */ + To = 'TO', + /** Trinidad & Tobago. */ + Tt = 'TT', + /** Tristan da Cunha. */ + Ta = 'TA', + /** Tunisia. */ + Tn = 'TN', + /** Turkey. */ + Tr = 'TR', + /** Turkmenistan. */ + Tm = 'TM', + /** Turks & Caicos Islands. */ + Tc = 'TC', + /** Tuvalu. */ + Tv = 'TV', + /** Uganda. */ + Ug = 'UG', + /** Ukraine. */ + Ua = 'UA', + /** United Arab Emirates. */ + Ae = 'AE', + /** United Kingdom. */ + Gb = 'GB', + /** United States. */ + Us = 'US', + /** U.S. Outlying Islands. */ + Um = 'UM', + /** Uruguay. */ + Uy = 'UY', + /** Uzbekistan. */ + Uz = 'UZ', + /** Vanuatu. */ + Vu = 'VU', + /** Venezuela. */ + Ve = 'VE', + /** Vietnam. */ + Vn = 'VN', + /** British Virgin Islands. */ + Vg = 'VG', + /** Wallis & Futuna. */ + Wf = 'WF', + /** Western Sahara. */ + Eh = 'EH', + /** Yemen. */ + Ye = 'YE', + /** Zambia. */ + Zm = 'ZM', + /** Zimbabwe. */ + Zw = 'ZW', +} + +/** Credit card information used for a payment. */ +export type CreditCard = { + __typename?: 'CreditCard' + /** The brand of the credit card. */ + brand?: Maybe + /** The expiry month of the credit card. */ + expiryMonth?: Maybe + /** The expiry year of the credit card. */ + expiryYear?: Maybe + /** The credit card's BIN number. */ + firstDigits?: Maybe + /** The first name of the card holder. */ + firstName?: Maybe + /** The last 4 digits of the credit card. */ + lastDigits?: Maybe + /** The last name of the card holder. */ + lastName?: Maybe + /** The masked credit card number with only the last 4 digits displayed. */ + maskedNumber?: Maybe +} + +/** + * Specifies the fields required to complete a checkout with + * a Shopify vaulted credit card payment. + */ +export type CreditCardPaymentInput = { + /** The amount of the payment. */ + amount: Scalars['Money'] + /** A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). */ + idempotencyKey: Scalars['String'] + /** The billing address for the payment. */ + billingAddress: MailingAddressInput + /** The ID returned by Shopify's Card Vault. */ + vaultId: Scalars['String'] + /** Executes the payment in test mode if possible. Defaults to `false`. */ + test?: Maybe +} + +/** + * Specifies the fields required to complete a checkout with + * a Shopify vaulted credit card payment. + */ +export type CreditCardPaymentInputV2 = { + /** The amount and currency of the payment. */ + paymentAmount: MoneyInput + /** A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). */ + idempotencyKey: Scalars['String'] + /** The billing address for the payment. */ + billingAddress: MailingAddressInput + /** The ID returned by Shopify's Card Vault. */ + vaultId: Scalars['String'] + /** Executes the payment in test mode if possible. Defaults to `false`. */ + test?: Maybe +} + +/** The part of the image that should remain after cropping. */ +export enum CropRegion { + /** Keep the center of the image. */ + Center = 'CENTER', + /** Keep the top of the image. */ + Top = 'TOP', + /** Keep the bottom of the image. */ + Bottom = 'BOTTOM', + /** Keep the left of the image. */ + Left = 'LEFT', + /** Keep the right of the image. */ + Right = 'RIGHT', +} + +/** Currency codes. */ +export enum CurrencyCode { + /** United States Dollars (USD). */ + Usd = 'USD', + /** Euro (EUR). */ + Eur = 'EUR', + /** United Kingdom Pounds (GBP). */ + Gbp = 'GBP', + /** Canadian Dollars (CAD). */ + Cad = 'CAD', + /** Afghan Afghani (AFN). */ + Afn = 'AFN', + /** Albanian Lek (ALL). */ + All = 'ALL', + /** Algerian Dinar (DZD). */ + Dzd = 'DZD', + /** Angolan Kwanza (AOA). */ + Aoa = 'AOA', + /** Argentine Pesos (ARS). */ + Ars = 'ARS', + /** Armenian Dram (AMD). */ + Amd = 'AMD', + /** Aruban Florin (AWG). */ + Awg = 'AWG', + /** Australian Dollars (AUD). */ + Aud = 'AUD', + /** Barbadian Dollar (BBD). */ + Bbd = 'BBD', + /** Azerbaijani Manat (AZN). */ + Azn = 'AZN', + /** Bangladesh Taka (BDT). */ + Bdt = 'BDT', + /** Bahamian Dollar (BSD). */ + Bsd = 'BSD', + /** Bahraini Dinar (BHD). */ + Bhd = 'BHD', + /** Burundian Franc (BIF). */ + Bif = 'BIF', + /** Belize Dollar (BZD). */ + Bzd = 'BZD', + /** Bermudian Dollar (BMD). */ + Bmd = 'BMD', + /** Bhutanese Ngultrum (BTN). */ + Btn = 'BTN', + /** Bosnia and Herzegovina Convertible Mark (BAM). */ + Bam = 'BAM', + /** Brazilian Real (BRL). */ + Brl = 'BRL', + /** Bolivian Boliviano (BOB). */ + Bob = 'BOB', + /** Botswana Pula (BWP). */ + Bwp = 'BWP', + /** Brunei Dollar (BND). */ + Bnd = 'BND', + /** Bulgarian Lev (BGN). */ + Bgn = 'BGN', + /** Burmese Kyat (MMK). */ + Mmk = 'MMK', + /** Cambodian Riel. */ + Khr = 'KHR', + /** Cape Verdean escudo (CVE). */ + Cve = 'CVE', + /** Cayman Dollars (KYD). */ + Kyd = 'KYD', + /** Central African CFA Franc (XAF). */ + Xaf = 'XAF', + /** Chilean Peso (CLP). */ + Clp = 'CLP', + /** Chinese Yuan Renminbi (CNY). */ + Cny = 'CNY', + /** Colombian Peso (COP). */ + Cop = 'COP', + /** Comorian Franc (KMF). */ + Kmf = 'KMF', + /** Congolese franc (CDF). */ + Cdf = 'CDF', + /** Costa Rican Colones (CRC). */ + Crc = 'CRC', + /** Croatian Kuna (HRK). */ + Hrk = 'HRK', + /** Czech Koruny (CZK). */ + Czk = 'CZK', + /** Danish Kroner (DKK). */ + Dkk = 'DKK', + /** Dominican Peso (DOP). */ + Dop = 'DOP', + /** East Caribbean Dollar (XCD). */ + Xcd = 'XCD', + /** Egyptian Pound (EGP). */ + Egp = 'EGP', + /** Ethiopian Birr (ETB). */ + Etb = 'ETB', + /** CFP Franc (XPF). */ + Xpf = 'XPF', + /** Fijian Dollars (FJD). */ + Fjd = 'FJD', + /** Gambian Dalasi (GMD). */ + Gmd = 'GMD', + /** Ghanaian Cedi (GHS). */ + Ghs = 'GHS', + /** Guatemalan Quetzal (GTQ). */ + Gtq = 'GTQ', + /** Guyanese Dollar (GYD). */ + Gyd = 'GYD', + /** Georgian Lari (GEL). */ + Gel = 'GEL', + /** Haitian Gourde (HTG). */ + Htg = 'HTG', + /** Honduran Lempira (HNL). */ + Hnl = 'HNL', + /** Hong Kong Dollars (HKD). */ + Hkd = 'HKD', + /** Hungarian Forint (HUF). */ + Huf = 'HUF', + /** Icelandic Kronur (ISK). */ + Isk = 'ISK', + /** Indian Rupees (INR). */ + Inr = 'INR', + /** Indonesian Rupiah (IDR). */ + Idr = 'IDR', + /** Israeli New Shekel (NIS). */ + Ils = 'ILS', + /** Iraqi Dinar (IQD). */ + Iqd = 'IQD', + /** Jamaican Dollars (JMD). */ + Jmd = 'JMD', + /** Japanese Yen (JPY). */ + Jpy = 'JPY', + /** Jersey Pound. */ + Jep = 'JEP', + /** Jordanian Dinar (JOD). */ + Jod = 'JOD', + /** Kazakhstani Tenge (KZT). */ + Kzt = 'KZT', + /** Kenyan Shilling (KES). */ + Kes = 'KES', + /** Kuwaiti Dinar (KWD). */ + Kwd = 'KWD', + /** Kyrgyzstani Som (KGS). */ + Kgs = 'KGS', + /** Laotian Kip (LAK). */ + Lak = 'LAK', + /** Latvian Lati (LVL). */ + Lvl = 'LVL', + /** Lebanese Pounds (LBP). */ + Lbp = 'LBP', + /** Lesotho Loti (LSL). */ + Lsl = 'LSL', + /** Liberian Dollar (LRD). */ + Lrd = 'LRD', + /** Lithuanian Litai (LTL). */ + Ltl = 'LTL', + /** Malagasy Ariary (MGA). */ + Mga = 'MGA', + /** Macedonia Denar (MKD). */ + Mkd = 'MKD', + /** Macanese Pataca (MOP). */ + Mop = 'MOP', + /** Malawian Kwacha (MWK). */ + Mwk = 'MWK', + /** Maldivian Rufiyaa (MVR). */ + Mvr = 'MVR', + /** Mexican Pesos (MXN). */ + Mxn = 'MXN', + /** Malaysian Ringgits (MYR). */ + Myr = 'MYR', + /** Mauritian Rupee (MUR). */ + Mur = 'MUR', + /** Moldovan Leu (MDL). */ + Mdl = 'MDL', + /** Moroccan Dirham. */ + Mad = 'MAD', + /** Mongolian Tugrik. */ + Mnt = 'MNT', + /** Mozambican Metical. */ + Mzn = 'MZN', + /** Namibian Dollar. */ + Nad = 'NAD', + /** Nepalese Rupee (NPR). */ + Npr = 'NPR', + /** Netherlands Antillean Guilder. */ + Ang = 'ANG', + /** New Zealand Dollars (NZD). */ + Nzd = 'NZD', + /** Nicaraguan Córdoba (NIO). */ + Nio = 'NIO', + /** Nigerian Naira (NGN). */ + Ngn = 'NGN', + /** Norwegian Kroner (NOK). */ + Nok = 'NOK', + /** Omani Rial (OMR). */ + Omr = 'OMR', + /** Panamian Balboa (PAB). */ + Pab = 'PAB', + /** Pakistani Rupee (PKR). */ + Pkr = 'PKR', + /** Papua New Guinean Kina (PGK). */ + Pgk = 'PGK', + /** Paraguayan Guarani (PYG). */ + Pyg = 'PYG', + /** Peruvian Nuevo Sol (PEN). */ + Pen = 'PEN', + /** Philippine Peso (PHP). */ + Php = 'PHP', + /** Polish Zlotych (PLN). */ + Pln = 'PLN', + /** Qatari Rial (QAR). */ + Qar = 'QAR', + /** Romanian Lei (RON). */ + Ron = 'RON', + /** Russian Rubles (RUB). */ + Rub = 'RUB', + /** Rwandan Franc (RWF). */ + Rwf = 'RWF', + /** Samoan Tala (WST). */ + Wst = 'WST', + /** Saudi Riyal (SAR). */ + Sar = 'SAR', + /** Sao Tome And Principe Dobra (STD). */ + Std = 'STD', + /** Serbian dinar (RSD). */ + Rsd = 'RSD', + /** Seychellois Rupee (SCR). */ + Scr = 'SCR', + /** Singapore Dollars (SGD). */ + Sgd = 'SGD', + /** Sudanese Pound (SDG). */ + Sdg = 'SDG', + /** Syrian Pound (SYP). */ + Syp = 'SYP', + /** South African Rand (ZAR). */ + Zar = 'ZAR', + /** South Korean Won (KRW). */ + Krw = 'KRW', + /** South Sudanese Pound (SSP). */ + Ssp = 'SSP', + /** Solomon Islands Dollar (SBD). */ + Sbd = 'SBD', + /** Sri Lankan Rupees (LKR). */ + Lkr = 'LKR', + /** Surinamese Dollar (SRD). */ + Srd = 'SRD', + /** Swazi Lilangeni (SZL). */ + Szl = 'SZL', + /** Swedish Kronor (SEK). */ + Sek = 'SEK', + /** Swiss Francs (CHF). */ + Chf = 'CHF', + /** Taiwan Dollars (TWD). */ + Twd = 'TWD', + /** Thai baht (THB). */ + Thb = 'THB', + /** Tanzanian Shilling (TZS). */ + Tzs = 'TZS', + /** Trinidad and Tobago Dollars (TTD). */ + Ttd = 'TTD', + /** Tunisian Dinar (TND). */ + Tnd = 'TND', + /** Turkish Lira (TRY). */ + Try = 'TRY', + /** Turkmenistani Manat (TMT). */ + Tmt = 'TMT', + /** Ugandan Shilling (UGX). */ + Ugx = 'UGX', + /** Ukrainian Hryvnia (UAH). */ + Uah = 'UAH', + /** United Arab Emirates Dirham (AED). */ + Aed = 'AED', + /** Uruguayan Pesos (UYU). */ + Uyu = 'UYU', + /** Uzbekistan som (UZS). */ + Uzs = 'UZS', + /** Vanuatu Vatu (VUV). */ + Vuv = 'VUV', + /** Vietnamese đồng (VND). */ + Vnd = 'VND', + /** West African CFA franc (XOF). */ + Xof = 'XOF', + /** Yemeni Rial (YER). */ + Yer = 'YER', + /** Zambian Kwacha (ZMW). */ + Zmw = 'ZMW', + /** Belarusian Ruble (BYN). */ + Byn = 'BYN', + /** Belarusian Ruble (BYR). */ + Byr = 'BYR', + /** Djiboutian Franc (DJF). */ + Djf = 'DJF', + /** Eritrean Nakfa (ERN). */ + Ern = 'ERN', + /** Falkland Islands Pounds (FKP). */ + Fkp = 'FKP', + /** Gibraltar Pounds (GIP). */ + Gip = 'GIP', + /** Guinean Franc (GNF). */ + Gnf = 'GNF', + /** Iranian Rial (IRR). */ + Irr = 'IRR', + /** Kiribati Dollar (KID). */ + Kid = 'KID', + /** Libyan Dinar (LYD). */ + Lyd = 'LYD', + /** Mauritanian Ouguiya (MRU). */ + Mru = 'MRU', + /** Sierra Leonean Leone (SLL). */ + Sll = 'SLL', + /** Saint Helena Pounds (SHP). */ + Shp = 'SHP', + /** Somali Shilling (SOS). */ + Sos = 'SOS', + /** Tajikistani Somoni (TJS). */ + Tjs = 'TJS', + /** Tongan Pa'anga (TOP). */ + Top = 'TOP', + /** Venezuelan Bolivares (VEF). */ + Vef = 'VEF', + /** Venezuelan Bolivares (VES). */ + Ves = 'VES', +} + +/** A customer represents a customer account with the shop. Customer accounts store contact information for the customer, saving logged-in customers the trouble of having to provide it at every checkout. */ +export type Customer = { + __typename?: 'Customer' + /** Indicates whether the customer has consented to be sent marketing material via email. */ + acceptsMarketing: Scalars['Boolean'] + /** A list of addresses for the customer. */ + addresses: MailingAddressConnection + /** The date and time when the customer was created. */ + createdAt: Scalars['DateTime'] + /** The customer’s default address. */ + defaultAddress?: Maybe + /** The customer’s name, email or phone number. */ + displayName: Scalars['String'] + /** The customer’s email address. */ + email?: Maybe + /** The customer’s first name. */ + firstName?: Maybe + /** A unique identifier for the customer. */ + id: Scalars['ID'] + /** The customer's most recently updated, incomplete checkout. */ + lastIncompleteCheckout?: Maybe + /** The customer’s last name. */ + lastName?: Maybe + /** The orders associated with the customer. */ + orders: OrderConnection + /** The customer’s phone number. */ + phone?: Maybe + /** + * A comma separated list of tags that have been added to the customer. + * Additional access scope required: unauthenticated_read_customer_tags. + */ + tags: Array + /** The date and time when the customer information was updated. */ + updatedAt: Scalars['DateTime'] +} + +/** A customer represents a customer account with the shop. Customer accounts store contact information for the customer, saving logged-in customers the trouble of having to provide it at every checkout. */ +export type CustomerAddressesArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** A customer represents a customer account with the shop. Customer accounts store contact information for the customer, saving logged-in customers the trouble of having to provide it at every checkout. */ +export type CustomerOrdersArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** A CustomerAccessToken represents the unique token required to make modifications to the customer object. */ +export type CustomerAccessToken = { + __typename?: 'CustomerAccessToken' + /** The customer’s access token. */ + accessToken: Scalars['String'] + /** The date and time when the customer access token expires. */ + expiresAt: Scalars['DateTime'] +} + +/** Specifies the input fields required to create a customer access token. */ +export type CustomerAccessTokenCreateInput = { + /** The email associated to the customer. */ + email: Scalars['String'] + /** The login password to be used by the customer. */ + password: Scalars['String'] +} + +/** Return type for `customerAccessTokenCreate` mutation. */ +export type CustomerAccessTokenCreatePayload = { + __typename?: 'CustomerAccessTokenCreatePayload' + /** The newly created customer access token object. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `customerAccessTokenCreateWithMultipass` mutation. */ +export type CustomerAccessTokenCreateWithMultipassPayload = { + __typename?: 'CustomerAccessTokenCreateWithMultipassPayload' + /** An access token object associated with the customer. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array +} + +/** Return type for `customerAccessTokenDelete` mutation. */ +export type CustomerAccessTokenDeletePayload = { + __typename?: 'CustomerAccessTokenDeletePayload' + /** The destroyed access token. */ + deletedAccessToken?: Maybe + /** ID of the destroyed customer access token. */ + deletedCustomerAccessTokenId?: Maybe + /** List of errors that occurred executing the mutation. */ + userErrors: Array +} + +/** Return type for `customerAccessTokenRenew` mutation. */ +export type CustomerAccessTokenRenewPayload = { + __typename?: 'CustomerAccessTokenRenewPayload' + /** The renewed customer access token object. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + userErrors: Array +} + +/** Return type for `customerActivateByUrl` mutation. */ +export type CustomerActivateByUrlPayload = { + __typename?: 'CustomerActivateByUrlPayload' + /** The customer that was activated. */ + customer?: Maybe + /** A new customer access token for the customer. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array +} + +/** Specifies the input fields required to activate a customer. */ +export type CustomerActivateInput = { + /** The activation token required to activate the customer. */ + activationToken: Scalars['String'] + /** New password that will be set during activation. */ + password: Scalars['String'] +} + +/** Return type for `customerActivate` mutation. */ +export type CustomerActivatePayload = { + __typename?: 'CustomerActivatePayload' + /** The customer object. */ + customer?: Maybe + /** A newly created customer access token object for the customer. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `customerAddressCreate` mutation. */ +export type CustomerAddressCreatePayload = { + __typename?: 'CustomerAddressCreatePayload' + /** The new customer address object. */ + customerAddress?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `customerAddressDelete` mutation. */ +export type CustomerAddressDeletePayload = { + __typename?: 'CustomerAddressDeletePayload' + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** ID of the deleted customer address. */ + deletedCustomerAddressId?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `customerAddressUpdate` mutation. */ +export type CustomerAddressUpdatePayload = { + __typename?: 'CustomerAddressUpdatePayload' + /** The customer’s updated mailing address. */ + customerAddress?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Specifies the fields required to create a new customer. */ +export type CustomerCreateInput = { + /** The customer’s first name. */ + firstName?: Maybe + /** The customer’s last name. */ + lastName?: Maybe + /** The customer’s email. */ + email: Scalars['String'] + /** + * A unique phone number for the customer. + * + * Formatted using E.164 standard. For example, _+16135551111_. + */ + phone?: Maybe + /** The login password used by the customer. */ + password: Scalars['String'] + /** Indicates whether the customer has consented to be sent marketing material via email. */ + acceptsMarketing?: Maybe +} + +/** Return type for `customerCreate` mutation. */ +export type CustomerCreatePayload = { + __typename?: 'CustomerCreatePayload' + /** The created customer object. */ + customer?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `customerDefaultAddressUpdate` mutation. */ +export type CustomerDefaultAddressUpdatePayload = { + __typename?: 'CustomerDefaultAddressUpdatePayload' + /** The updated customer object. */ + customer?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Possible error codes that could be returned by CustomerUserError. */ +export enum CustomerErrorCode { + /** Input value is blank. */ + Blank = 'BLANK', + /** Input value is invalid. */ + Invalid = 'INVALID', + /** Input value is already taken. */ + Taken = 'TAKEN', + /** Input value is too long. */ + TooLong = 'TOO_LONG', + /** Input value is too short. */ + TooShort = 'TOO_SHORT', + /** Unidentified customer. */ + UnidentifiedCustomer = 'UNIDENTIFIED_CUSTOMER', + /** Customer is disabled. */ + CustomerDisabled = 'CUSTOMER_DISABLED', + /** Input password starts or ends with whitespace. */ + PasswordStartsOrEndsWithWhitespace = 'PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE', + /** Input contains HTML tags. */ + ContainsHtmlTags = 'CONTAINS_HTML_TAGS', + /** Input contains URL. */ + ContainsUrl = 'CONTAINS_URL', + /** Invalid activation token. */ + TokenInvalid = 'TOKEN_INVALID', + /** Customer already enabled. */ + AlreadyEnabled = 'ALREADY_ENABLED', + /** Address does not exist. */ + NotFound = 'NOT_FOUND', + /** Input email contains an invalid domain name. */ + BadDomain = 'BAD_DOMAIN', + /** Multipass token is not valid. */ + InvalidMultipassRequest = 'INVALID_MULTIPASS_REQUEST', +} + +/** Return type for `customerRecover` mutation. */ +export type CustomerRecoverPayload = { + __typename?: 'CustomerRecoverPayload' + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `customerResetByUrl` mutation. */ +export type CustomerResetByUrlPayload = { + __typename?: 'CustomerResetByUrlPayload' + /** The customer object which was reset. */ + customer?: Maybe + /** A newly created customer access token object for the customer. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Specifies the fields required to reset a customer’s password. */ +export type CustomerResetInput = { + /** The reset token required to reset the customer’s password. */ + resetToken: Scalars['String'] + /** New password that will be set as part of the reset password process. */ + password: Scalars['String'] +} + +/** Return type for `customerReset` mutation. */ +export type CustomerResetPayload = { + __typename?: 'CustomerResetPayload' + /** The customer object which was reset. */ + customer?: Maybe + /** A newly created customer access token object for the customer. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Specifies the fields required to update the Customer information. */ +export type CustomerUpdateInput = { + /** The customer’s first name. */ + firstName?: Maybe + /** The customer’s last name. */ + lastName?: Maybe + /** The customer’s email. */ + email?: Maybe + /** + * A unique phone number for the customer. + * + * Formatted using E.164 standard. For example, _+16135551111_. To remove the phone number, specify `null`. + */ + phone?: Maybe + /** The login password used by the customer. */ + password?: Maybe + /** Indicates whether the customer has consented to be sent marketing material via email. */ + acceptsMarketing?: Maybe +} + +/** Return type for `customerUpdate` mutation. */ +export type CustomerUpdatePayload = { + __typename?: 'CustomerUpdatePayload' + /** The updated customer object. */ + customer?: Maybe + /** + * The newly created customer access token. If the customer's password is updated, all previous access tokens + * (including the one used to perform this mutation) become invalid, and a new token is generated. + */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Represents an error that happens during execution of a customer mutation. */ +export type CustomerUserError = DisplayableError & { + __typename?: 'CustomerUserError' + /** Error code to uniquely identify the error. */ + code?: Maybe + /** Path to the input field which caused the error. */ + field?: Maybe> + /** The error message. */ + message: Scalars['String'] +} + +/** Digital wallet, such as Apple Pay, which can be used for accelerated checkouts. */ +export enum DigitalWallet { + /** Apple Pay. */ + ApplePay = 'APPLE_PAY', + /** Android Pay. */ + AndroidPay = 'ANDROID_PAY', + /** Google Pay. */ + GooglePay = 'GOOGLE_PAY', + /** Shopify Pay. */ + ShopifyPay = 'SHOPIFY_PAY', +} + +/** An amount discounting the line that has been allocated by a discount. */ +export type DiscountAllocation = { + __typename?: 'DiscountAllocation' + /** Amount of discount allocated. */ + allocatedAmount: MoneyV2 + /** The discount this allocated amount originated from. */ + discountApplication: DiscountApplication +} + +/** + * Discount applications capture the intentions of a discount source at + * the time of application. + */ +export type DiscountApplication = { + /** The method by which the discount's value is allocated to its entitled items. */ + allocationMethod: DiscountApplicationAllocationMethod + /** Which lines of targetType that the discount is allocated over. */ + targetSelection: DiscountApplicationTargetSelection + /** The type of line that the discount is applicable towards. */ + targetType: DiscountApplicationTargetType + /** The value of the discount application. */ + value: PricingValue +} + +/** The method by which the discount's value is allocated onto its entitled lines. */ +export enum DiscountApplicationAllocationMethod { + /** The value is spread across all entitled lines. */ + Across = 'ACROSS', + /** The value is applied onto every entitled line. */ + Each = 'EACH', + /** The value is specifically applied onto a particular line. */ + One = 'ONE', +} + +/** An auto-generated type for paginating through multiple DiscountApplications. */ +export type DiscountApplicationConnection = { + __typename?: 'DiscountApplicationConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one DiscountApplication and a cursor during pagination. */ +export type DiscountApplicationEdge = { + __typename?: 'DiscountApplicationEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of DiscountApplicationEdge. */ + node: DiscountApplication +} + +/** + * Which lines on the order that the discount is allocated over, of the type + * defined by the Discount Application's target_type. + */ +export enum DiscountApplicationTargetSelection { + /** The discount is allocated onto all the lines. */ + All = 'ALL', + /** The discount is allocated onto only the lines it is entitled for. */ + Entitled = 'ENTITLED', + /** The discount is allocated onto explicitly chosen lines. */ + Explicit = 'EXPLICIT', +} + +/** The type of line (i.e. line item or shipping line) on an order that the discount is applicable towards. */ +export enum DiscountApplicationTargetType { + /** The discount applies onto line items. */ + LineItem = 'LINE_ITEM', + /** The discount applies onto shipping lines. */ + ShippingLine = 'SHIPPING_LINE', +} + +/** + * Discount code applications capture the intentions of a discount code at + * the time that it is applied. + */ +export type DiscountCodeApplication = DiscountApplication & { + __typename?: 'DiscountCodeApplication' + /** The method by which the discount's value is allocated to its entitled items. */ + allocationMethod: DiscountApplicationAllocationMethod + /** Specifies whether the discount code was applied successfully. */ + applicable: Scalars['Boolean'] + /** The string identifying the discount code that was used at the time of application. */ + code: Scalars['String'] + /** Which lines of targetType that the discount is allocated over. */ + targetSelection: DiscountApplicationTargetSelection + /** The type of line that the discount is applicable towards. */ + targetType: DiscountApplicationTargetType + /** The value of the discount application. */ + value: PricingValue +} + +/** Represents an error in the input of a mutation. */ +export type DisplayableError = { + /** Path to the input field which caused the error. */ + field?: Maybe> + /** The error message. */ + message: Scalars['String'] +} + +/** Represents a web address. */ +export type Domain = { + __typename?: 'Domain' + /** The host name of the domain (eg: `example.com`). */ + host: Scalars['String'] + /** Whether SSL is enabled or not. */ + sslEnabled: Scalars['Boolean'] + /** The URL of the domain (eg: `https://example.com`). */ + url: Scalars['URL'] +} + +/** Represents a video hosted outside of Shopify. */ +export type ExternalVideo = Node & + Media & { + __typename?: 'ExternalVideo' + /** A word or phrase to share the nature or contents of a media. */ + alt?: Maybe + /** The URL. */ + embeddedUrl: Scalars['URL'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The media content type. */ + mediaContentType: MediaContentType + /** The preview image for the media. */ + previewImage?: Maybe + } + +/** Represents a single fulfillment in an order. */ +export type Fulfillment = { + __typename?: 'Fulfillment' + /** List of the fulfillment's line items. */ + fulfillmentLineItems: FulfillmentLineItemConnection + /** The name of the tracking company. */ + trackingCompany?: Maybe + /** + * Tracking information associated with the fulfillment, + * such as the tracking number and tracking URL. + */ + trackingInfo: Array +} + +/** Represents a single fulfillment in an order. */ +export type FulfillmentFulfillmentLineItemsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** Represents a single fulfillment in an order. */ +export type FulfillmentTrackingInfoArgs = { + first?: Maybe +} + +/** Represents a single line item in a fulfillment. There is at most one fulfillment line item for each order line item. */ +export type FulfillmentLineItem = { + __typename?: 'FulfillmentLineItem' + /** The associated order's line item. */ + lineItem: OrderLineItem + /** The amount fulfilled in this fulfillment. */ + quantity: Scalars['Int'] +} + +/** An auto-generated type for paginating through multiple FulfillmentLineItems. */ +export type FulfillmentLineItemConnection = { + __typename?: 'FulfillmentLineItemConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. */ +export type FulfillmentLineItemEdge = { + __typename?: 'FulfillmentLineItemEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of FulfillmentLineItemEdge. */ + node: FulfillmentLineItem +} + +/** Tracking information associated with the fulfillment. */ +export type FulfillmentTrackingInfo = { + __typename?: 'FulfillmentTrackingInfo' + /** The tracking number of the fulfillment. */ + number?: Maybe + /** The URL to track the fulfillment. */ + url?: Maybe +} + +/** Represents information about the metafields associated to the specified resource. */ +export type HasMetafields = { + /** The metafield associated with the resource. */ + metafield?: Maybe + /** A paginated list of metafields associated with the resource. */ + metafields: MetafieldConnection +} + +/** Represents information about the metafields associated to the specified resource. */ +export type HasMetafieldsMetafieldArgs = { + namespace: Scalars['String'] + key: Scalars['String'] +} + +/** Represents information about the metafields associated to the specified resource. */ +export type HasMetafieldsMetafieldsArgs = { + namespace?: Maybe + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** Represents an image resource. */ +export type Image = { + __typename?: 'Image' + /** A word or phrase to share the nature or contents of an image. */ + altText?: Maybe + /** The original height of the image in pixels. Returns `null` if the image is not hosted by Shopify. */ + height?: Maybe + /** A unique identifier for the image. */ + id?: Maybe + /** + * The location of the original image as a URL. + * + * If there are any existing transformations in the original source URL, they will remain and not be stripped. + */ + originalSrc: Scalars['URL'] + /** + * The location of the image as a URL. + * @deprecated Previously an image had a single `src` field. This could either return the original image + * location or a URL that contained transformations such as sizing or scale. + * + * These transformations were specified by arguments on the parent field. + * + * Now an image has two distinct URL fields: `originalSrc` and `transformedSrc`. + * + * * `originalSrc` - the original unmodified image URL + * * `transformedSrc` - the image URL with the specified transformations included + * + * To migrate to the new fields, image transformations should be moved from the parent field to `transformedSrc`. + * + * Before: + * ```graphql + * { + * shop { + * productImages(maxWidth: 200, scale: 2) { + * edges { + * node { + * src + * } + * } + * } + * } + * } + * ``` + * + * After: + * ```graphql + * { + * shop { + * productImages { + * edges { + * node { + * transformedSrc(maxWidth: 200, scale: 2) + * } + * } + * } + * } + * } + * ``` + * + */ + src: Scalars['URL'] + /** + * The location of the transformed image as a URL. + * + * All transformation arguments are considered "best-effort". If they can be applied to an image, they will be. + * Otherwise any transformations which an image type does not support will be ignored. + */ + transformedSrc: Scalars['URL'] + /** The original width of the image in pixels. Returns `null` if the image is not hosted by Shopify. */ + width?: Maybe +} + +/** Represents an image resource. */ +export type ImageTransformedSrcArgs = { + maxWidth?: Maybe + maxHeight?: Maybe + crop?: Maybe + scale?: Maybe + preferredContentType?: Maybe +} + +/** An auto-generated type for paginating through multiple Images. */ +export type ImageConnection = { + __typename?: 'ImageConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** List of supported image content types. */ +export enum ImageContentType { + /** A PNG image. */ + Png = 'PNG', + /** A JPG image. */ + Jpg = 'JPG', + /** A WEBP image. */ + Webp = 'WEBP', +} + +/** An auto-generated type which holds one Image and a cursor during pagination. */ +export type ImageEdge = { + __typename?: 'ImageEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of ImageEdge. */ + node: Image +} + +/** Represents a mailing address for customers and shipping. */ +export type MailingAddress = Node & { + __typename?: 'MailingAddress' + /** The first line of the address. Typically the street address or PO Box number. */ + address1?: Maybe + /** The second line of the address. Typically the number of the apartment, suite, or unit. */ + address2?: Maybe + /** The name of the city, district, village, or town. */ + city?: Maybe + /** The name of the customer's company or organization. */ + company?: Maybe + /** The name of the country. */ + country?: Maybe + /** + * The two-letter code for the country of the address. + * + * For example, US. + * @deprecated Use `countryCodeV2` instead + */ + countryCode?: Maybe + /** + * The two-letter code for the country of the address. + * + * For example, US. + */ + countryCodeV2?: Maybe + /** The first name of the customer. */ + firstName?: Maybe + /** A formatted version of the address, customized by the provided arguments. */ + formatted: Array + /** A comma-separated list of the values for city, province, and country. */ + formattedArea?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The last name of the customer. */ + lastName?: Maybe + /** The latitude coordinate of the customer address. */ + latitude?: Maybe + /** The longitude coordinate of the customer address. */ + longitude?: Maybe + /** The full name of the customer, based on firstName and lastName. */ + name?: Maybe + /** + * A unique phone number for the customer. + * + * Formatted using E.164 standard. For example, _+16135551111_. + */ + phone?: Maybe + /** The region of the address, such as the province, state, or district. */ + province?: Maybe + /** + * The two-letter code for the region. + * + * For example, ON. + */ + provinceCode?: Maybe + /** The zip or postal code of the address. */ + zip?: Maybe +} + +/** Represents a mailing address for customers and shipping. */ +export type MailingAddressFormattedArgs = { + withName?: Maybe + withCompany?: Maybe +} + +/** An auto-generated type for paginating through multiple MailingAddresses. */ +export type MailingAddressConnection = { + __typename?: 'MailingAddressConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one MailingAddress and a cursor during pagination. */ +export type MailingAddressEdge = { + __typename?: 'MailingAddressEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of MailingAddressEdge. */ + node: MailingAddress +} + +/** Specifies the fields accepted to create or update a mailing address. */ +export type MailingAddressInput = { + /** The first line of the address. Typically the street address or PO Box number. */ + address1?: Maybe + /** The second line of the address. Typically the number of the apartment, suite, or unit. */ + address2?: Maybe + /** The name of the city, district, village, or town. */ + city?: Maybe + /** The name of the customer's company or organization. */ + company?: Maybe + /** The name of the country. */ + country?: Maybe + /** The first name of the customer. */ + firstName?: Maybe + /** The last name of the customer. */ + lastName?: Maybe + /** + * A unique phone number for the customer. + * + * Formatted using E.164 standard. For example, _+16135551111_. + */ + phone?: Maybe + /** The region of the address, such as the province, state, or district. */ + province?: Maybe + /** The zip or postal code of the address. */ + zip?: Maybe +} + +/** Manual discount applications capture the intentions of a discount that was manually created. */ +export type ManualDiscountApplication = DiscountApplication & { + __typename?: 'ManualDiscountApplication' + /** The method by which the discount's value is allocated to its entitled items. */ + allocationMethod: DiscountApplicationAllocationMethod + /** The description of the application. */ + description?: Maybe + /** Which lines of targetType that the discount is allocated over. */ + targetSelection: DiscountApplicationTargetSelection + /** The type of line that the discount is applicable towards. */ + targetType: DiscountApplicationTargetType + /** The title of the application. */ + title: Scalars['String'] + /** The value of the discount application. */ + value: PricingValue +} + +/** Represents a media interface. */ +export type Media = { + /** A word or phrase to share the nature or contents of a media. */ + alt?: Maybe + /** The media content type. */ + mediaContentType: MediaContentType + /** The preview image for the media. */ + previewImage?: Maybe +} + +/** An auto-generated type for paginating through multiple Media. */ +export type MediaConnection = { + __typename?: 'MediaConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** The possible content types for a media object. */ +export enum MediaContentType { + /** An externally hosted video. */ + ExternalVideo = 'EXTERNAL_VIDEO', + /** A Shopify hosted image. */ + Image = 'IMAGE', + /** A 3d model. */ + Model_3D = 'MODEL_3D', + /** A Shopify hosted video. */ + Video = 'VIDEO', +} + +/** An auto-generated type which holds one Media and a cursor during pagination. */ +export type MediaEdge = { + __typename?: 'MediaEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of MediaEdge. */ + node: Media +} + +/** Represents a Shopify hosted image. */ +export type MediaImage = Node & + Media & { + __typename?: 'MediaImage' + /** A word or phrase to share the nature or contents of a media. */ + alt?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The image for the media. */ + image?: Maybe + /** The media content type. */ + mediaContentType: MediaContentType + /** The preview image for the media. */ + previewImage?: Maybe + } + +/** + * Metafields represent custom metadata attached to a resource. Metafields can be sorted into namespaces and are + * comprised of keys, values, and value types. + */ +export type Metafield = Node & { + __typename?: 'Metafield' + /** The date and time when the storefront metafield was created. */ + createdAt: Scalars['DateTime'] + /** The description of a metafield. */ + description?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The key name for a metafield. */ + key: Scalars['String'] + /** The namespace for a metafield. */ + namespace: Scalars['String'] + /** The parent object that the metafield belongs to. */ + parentResource: MetafieldParentResource + /** The date and time when the storefront metafield was updated. */ + updatedAt: Scalars['DateTime'] + /** The value of a metafield. */ + value: Scalars['String'] + /** Represents the metafield value type. */ + valueType: MetafieldValueType +} + +/** An auto-generated type for paginating through multiple Metafields. */ +export type MetafieldConnection = { + __typename?: 'MetafieldConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Metafield and a cursor during pagination. */ +export type MetafieldEdge = { + __typename?: 'MetafieldEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of MetafieldEdge. */ + node: Metafield +} + +/** A resource that the metafield belongs to. */ +export type MetafieldParentResource = Product | ProductVariant + +/** Metafield value types. */ +export enum MetafieldValueType { + /** A string metafield. */ + String = 'STRING', + /** An integer metafield. */ + Integer = 'INTEGER', + /** A json string metafield. */ + JsonString = 'JSON_STRING', +} + +/** Represents a Shopify hosted 3D model. */ +export type Model3d = Node & + Media & { + __typename?: 'Model3d' + /** A word or phrase to share the nature or contents of a media. */ + alt?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The media content type. */ + mediaContentType: MediaContentType + /** The preview image for the media. */ + previewImage?: Maybe + /** The sources for a 3d model. */ + sources: Array + } + +/** Represents a source for a Shopify hosted 3d model. */ +export type Model3dSource = { + __typename?: 'Model3dSource' + /** The filesize of the 3d model. */ + filesize: Scalars['Int'] + /** The format of the 3d model. */ + format: Scalars['String'] + /** The MIME type of the 3d model. */ + mimeType: Scalars['String'] + /** The URL of the 3d model. */ + url: Scalars['String'] +} + +/** Specifies the fields for a monetary value with currency. */ +export type MoneyInput = { + /** Decimal money amount. */ + amount: Scalars['Decimal'] + /** Currency of the money. */ + currencyCode: CurrencyCode +} + +/** + * A monetary value with currency. + * + * To format currencies, combine this type's amount and currencyCode fields with your client's locale. + * + * For example, in JavaScript you could use Intl.NumberFormat: + * + * ```js + * new Intl.NumberFormat(locale, { + * style: 'currency', + * currency: currencyCode + * }).format(amount); + * ``` + * + * Other formatting libraries include: + * + * * iOS - [NumberFormatter](https://developer.apple.com/documentation/foundation/numberformatter) + * * Android - [NumberFormat](https://developer.android.com/reference/java/text/NumberFormat.html) + * * PHP - [NumberFormatter](http://php.net/manual/en/class.numberformatter.php) + * + * For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations + * (such as [TwitterCldr](https://github.com/twitter/twitter-cldr-rb)). + */ +export type MoneyV2 = { + __typename?: 'MoneyV2' + /** Decimal money amount. */ + amount: Scalars['Decimal'] + /** Currency of the money. */ + currencyCode: CurrencyCode +} + +/** An auto-generated type for paginating through multiple MoneyV2s. */ +export type MoneyV2Connection = { + __typename?: 'MoneyV2Connection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one MoneyV2 and a cursor during pagination. */ +export type MoneyV2Edge = { + __typename?: 'MoneyV2Edge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of MoneyV2Edge. */ + node: MoneyV2 +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type Mutation = { + __typename?: 'Mutation' + /** + * Updates the attributes of a checkout. + * @deprecated Use `checkoutAttributesUpdateV2` instead + */ + checkoutAttributesUpdate?: Maybe + /** Updates the attributes of a checkout. */ + checkoutAttributesUpdateV2?: Maybe + /** Completes a checkout without providing payment information. You can use this mutation for free items or items whose purchase price is covered by a gift card. */ + checkoutCompleteFree?: Maybe + /** + * Completes a checkout using a credit card token from Shopify's Vault. + * @deprecated Use `checkoutCompleteWithCreditCardV2` instead + */ + checkoutCompleteWithCreditCard?: Maybe + /** Completes a checkout using a credit card token from Shopify's card vault. Before you can complete checkouts using CheckoutCompleteWithCreditCardV2, you need to [_request payment processing_](https://help.shopify.com/api/guides/sales-channel-sdk/getting-started#request-payment-processing). */ + checkoutCompleteWithCreditCardV2?: Maybe + /** + * Completes a checkout with a tokenized payment. + * @deprecated Use `checkoutCompleteWithTokenizedPaymentV2` instead + */ + checkoutCompleteWithTokenizedPayment?: Maybe + /** + * Completes a checkout with a tokenized payment. + * @deprecated Use `checkoutCompleteWithTokenizedPaymentV3` instead + */ + checkoutCompleteWithTokenizedPaymentV2?: Maybe + /** Completes a checkout with a tokenized payment. */ + checkoutCompleteWithTokenizedPaymentV3?: Maybe + /** Creates a new checkout. */ + checkoutCreate?: Maybe + /** + * Associates a customer to the checkout. + * @deprecated Use `checkoutCustomerAssociateV2` instead + */ + checkoutCustomerAssociate?: Maybe + /** Associates a customer to the checkout. */ + checkoutCustomerAssociateV2?: Maybe + /** + * Disassociates the current checkout customer from the checkout. + * @deprecated Use `checkoutCustomerDisassociateV2` instead + */ + checkoutCustomerDisassociate?: Maybe + /** Disassociates the current checkout customer from the checkout. */ + checkoutCustomerDisassociateV2?: Maybe + /** + * Applies a discount to an existing checkout using a discount code. + * @deprecated Use `checkoutDiscountCodeApplyV2` instead + */ + checkoutDiscountCodeApply?: Maybe + /** Applies a discount to an existing checkout using a discount code. */ + checkoutDiscountCodeApplyV2?: Maybe + /** Removes the applied discount from an existing checkout. */ + checkoutDiscountCodeRemove?: Maybe + /** + * Updates the email on an existing checkout. + * @deprecated Use `checkoutEmailUpdateV2` instead + */ + checkoutEmailUpdate?: Maybe + /** Updates the email on an existing checkout. */ + checkoutEmailUpdateV2?: Maybe + /** + * Applies a gift card to an existing checkout using a gift card code. This will replace all currently applied gift cards. + * @deprecated Use `checkoutGiftCardsAppend` instead + */ + checkoutGiftCardApply?: Maybe + /** + * Removes an applied gift card from the checkout. + * @deprecated Use `checkoutGiftCardRemoveV2` instead + */ + checkoutGiftCardRemove?: Maybe + /** Removes an applied gift card from the checkout. */ + checkoutGiftCardRemoveV2?: Maybe + /** Appends gift cards to an existing checkout. */ + checkoutGiftCardsAppend?: Maybe + /** Adds a list of line items to a checkout. */ + checkoutLineItemsAdd?: Maybe + /** Removes line items from an existing checkout. */ + checkoutLineItemsRemove?: Maybe + /** Sets a list of line items to a checkout. */ + checkoutLineItemsReplace?: Maybe + /** Updates line items on a checkout. */ + checkoutLineItemsUpdate?: Maybe + /** + * Updates the shipping address of an existing checkout. + * @deprecated Use `checkoutShippingAddressUpdateV2` instead + */ + checkoutShippingAddressUpdate?: Maybe + /** Updates the shipping address of an existing checkout. */ + checkoutShippingAddressUpdateV2?: Maybe + /** Updates the shipping lines on an existing checkout. */ + checkoutShippingLineUpdate?: Maybe + /** + * Creates a customer access token. + * The customer access token is required to modify the customer object in any way. + */ + customerAccessTokenCreate?: Maybe + /** + * Creates a customer access token using a multipass token instead of email and password. + * A customer record is created if customer does not exist. If a customer record already + * exists but the record is disabled, then it's enabled. + */ + customerAccessTokenCreateWithMultipass?: Maybe + /** Permanently destroys a customer access token. */ + customerAccessTokenDelete?: Maybe + /** + * Renews a customer access token. + * + * Access token renewal must happen *before* a token expires. + * If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. + */ + customerAccessTokenRenew?: Maybe + /** Activates a customer. */ + customerActivate?: Maybe + /** Activates a customer with the activation url received from `customerCreate`. */ + customerActivateByUrl?: Maybe + /** Creates a new address for a customer. */ + customerAddressCreate?: Maybe + /** Permanently deletes the address of an existing customer. */ + customerAddressDelete?: Maybe + /** Updates the address of an existing customer. */ + customerAddressUpdate?: Maybe + /** Creates a new customer. */ + customerCreate?: Maybe + /** Updates the default address of an existing customer. */ + customerDefaultAddressUpdate?: Maybe + /** Sends a reset password email to the customer, as the first step in the reset password process. */ + customerRecover?: Maybe + /** Resets a customer’s password with a token received from `CustomerRecover`. */ + customerReset?: Maybe + /** Resets a customer’s password with the reset password url received from `CustomerRecover`. */ + customerResetByUrl?: Maybe + /** Updates an existing customer. */ + customerUpdate?: Maybe +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutAttributesUpdateArgs = { + checkoutId: Scalars['ID'] + input: CheckoutAttributesUpdateInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutAttributesUpdateV2Args = { + checkoutId: Scalars['ID'] + input: CheckoutAttributesUpdateV2Input +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCompleteFreeArgs = { + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCompleteWithCreditCardArgs = { + checkoutId: Scalars['ID'] + payment: CreditCardPaymentInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCompleteWithCreditCardV2Args = { + checkoutId: Scalars['ID'] + payment: CreditCardPaymentInputV2 +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCompleteWithTokenizedPaymentArgs = { + checkoutId: Scalars['ID'] + payment: TokenizedPaymentInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCompleteWithTokenizedPaymentV2Args = { + checkoutId: Scalars['ID'] + payment: TokenizedPaymentInputV2 +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCompleteWithTokenizedPaymentV3Args = { + checkoutId: Scalars['ID'] + payment: TokenizedPaymentInputV3 +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCreateArgs = { + input: CheckoutCreateInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCustomerAssociateArgs = { + checkoutId: Scalars['ID'] + customerAccessToken: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCustomerAssociateV2Args = { + checkoutId: Scalars['ID'] + customerAccessToken: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCustomerDisassociateArgs = { + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCustomerDisassociateV2Args = { + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutDiscountCodeApplyArgs = { + discountCode: Scalars['String'] + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutDiscountCodeApplyV2Args = { + discountCode: Scalars['String'] + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutDiscountCodeRemoveArgs = { + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutEmailUpdateArgs = { + checkoutId: Scalars['ID'] + email: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutEmailUpdateV2Args = { + checkoutId: Scalars['ID'] + email: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutGiftCardApplyArgs = { + giftCardCode: Scalars['String'] + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutGiftCardRemoveArgs = { + appliedGiftCardId: Scalars['ID'] + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutGiftCardRemoveV2Args = { + appliedGiftCardId: Scalars['ID'] + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutGiftCardsAppendArgs = { + giftCardCodes: Array + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutLineItemsAddArgs = { + lineItems: Array + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutLineItemsRemoveArgs = { + checkoutId: Scalars['ID'] + lineItemIds: Array +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutLineItemsReplaceArgs = { + lineItems: Array + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutLineItemsUpdateArgs = { + checkoutId: Scalars['ID'] + lineItems: Array +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutShippingAddressUpdateArgs = { + shippingAddress: MailingAddressInput + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutShippingAddressUpdateV2Args = { + shippingAddress: MailingAddressInput + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutShippingLineUpdateArgs = { + checkoutId: Scalars['ID'] + shippingRateHandle: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAccessTokenCreateArgs = { + input: CustomerAccessTokenCreateInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAccessTokenCreateWithMultipassArgs = { + multipassToken: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAccessTokenDeleteArgs = { + customerAccessToken: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAccessTokenRenewArgs = { + customerAccessToken: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerActivateArgs = { + id: Scalars['ID'] + input: CustomerActivateInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerActivateByUrlArgs = { + activationUrl: Scalars['URL'] + password: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAddressCreateArgs = { + customerAccessToken: Scalars['String'] + address: MailingAddressInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAddressDeleteArgs = { + id: Scalars['ID'] + customerAccessToken: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAddressUpdateArgs = { + customerAccessToken: Scalars['String'] + id: Scalars['ID'] + address: MailingAddressInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerCreateArgs = { + input: CustomerCreateInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerDefaultAddressUpdateArgs = { + customerAccessToken: Scalars['String'] + addressId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerRecoverArgs = { + email: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerResetArgs = { + id: Scalars['ID'] + input: CustomerResetInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerResetByUrlArgs = { + resetUrl: Scalars['URL'] + password: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerUpdateArgs = { + customerAccessToken: Scalars['String'] + customer: CustomerUpdateInput +} + +/** An object with an ID to support global identification. */ +export type Node = { + /** Globally unique identifier. */ + id: Scalars['ID'] +} + +/** An order is a customer’s completed request to purchase one or more products from a shop. An order is created when a customer completes the checkout process, during which time they provides an email address, billing address and payment information. */ +export type Order = Node & { + __typename?: 'Order' + /** The reason for the order's cancellation. Returns `null` if the order wasn't canceled. */ + cancelReason?: Maybe + /** The date and time when the order was canceled. Returns null if the order wasn't canceled. */ + canceledAt?: Maybe + /** The code of the currency used for the payment. */ + currencyCode: CurrencyCode + /** The subtotal of line items and their discounts, excluding line items that have been removed. Does not contain order-level discounts, duties, shipping costs, or shipping discounts. Taxes are not included unless the order is a taxes-included order. */ + currentSubtotalPrice: MoneyV2 + /** The total amount of the order, including duties, taxes and discounts, minus amounts for line items that have been removed. */ + currentTotalPrice: MoneyV2 + /** The total of all taxes applied to the order, excluding taxes for returned line items. */ + currentTotalTax: MoneyV2 + /** The locale code in which this specific order happened. */ + customerLocale?: Maybe + /** The unique URL that the customer can use to access the order. */ + customerUrl?: Maybe + /** Discounts that have been applied on the order. */ + discountApplications: DiscountApplicationConnection + /** Whether the order has had any edits applied or not. */ + edited: Scalars['Boolean'] + /** The customer's email address. */ + email?: Maybe + /** The financial status of the order. */ + financialStatus?: Maybe + /** The fulfillment status for the order. */ + fulfillmentStatus: OrderFulfillmentStatus + /** Globally unique identifier. */ + id: Scalars['ID'] + /** List of the order’s line items. */ + lineItems: OrderLineItemConnection + /** + * Unique identifier for the order that appears on the order. + * For example, _#1000_ or _Store1001. + */ + name: Scalars['String'] + /** A unique numeric identifier for the order for use by shop owner and customer. */ + orderNumber: Scalars['Int'] + /** The total price of the order before any applied edits. */ + originalTotalPrice: MoneyV2 + /** The customer's phone number for receiving SMS notifications. */ + phone?: Maybe + /** + * The date and time when the order was imported. + * This value can be set to dates in the past when importing from other systems. + * If no value is provided, it will be auto-generated based on current date and time. + */ + processedAt: Scalars['DateTime'] + /** The address to where the order will be shipped. */ + shippingAddress?: Maybe + /** The discounts that have been allocated onto the shipping line by discount applications. */ + shippingDiscountAllocations: Array + /** The unique URL for the order's status page. */ + statusUrl: Scalars['URL'] + /** + * Price of the order before shipping and taxes. + * @deprecated Use `subtotalPriceV2` instead + */ + subtotalPrice?: Maybe + /** Price of the order before duties, shipping and taxes. */ + subtotalPriceV2?: Maybe + /** List of the order’s successful fulfillments. */ + successfulFulfillments?: Maybe> + /** + * The sum of all the prices of all the items in the order, taxes and discounts included (must be positive). + * @deprecated Use `totalPriceV2` instead + */ + totalPrice: Scalars['Money'] + /** The sum of all the prices of all the items in the order, duties, taxes and discounts included (must be positive). */ + totalPriceV2: MoneyV2 + /** + * The total amount that has been refunded. + * @deprecated Use `totalRefundedV2` instead + */ + totalRefunded: Scalars['Money'] + /** The total amount that has been refunded. */ + totalRefundedV2: MoneyV2 + /** + * The total cost of shipping. + * @deprecated Use `totalShippingPriceV2` instead + */ + totalShippingPrice: Scalars['Money'] + /** The total cost of shipping. */ + totalShippingPriceV2: MoneyV2 + /** + * The total cost of taxes. + * @deprecated Use `totalTaxV2` instead + */ + totalTax?: Maybe + /** The total cost of taxes. */ + totalTaxV2?: Maybe +} + +/** An order is a customer’s completed request to purchase one or more products from a shop. An order is created when a customer completes the checkout process, during which time they provides an email address, billing address and payment information. */ +export type OrderDiscountApplicationsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** An order is a customer’s completed request to purchase one or more products from a shop. An order is created when a customer completes the checkout process, during which time they provides an email address, billing address and payment information. */ +export type OrderLineItemsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** An order is a customer’s completed request to purchase one or more products from a shop. An order is created when a customer completes the checkout process, during which time they provides an email address, billing address and payment information. */ +export type OrderSuccessfulFulfillmentsArgs = { + first?: Maybe +} + +/** Represents the reason for the order's cancellation. */ +export enum OrderCancelReason { + /** The customer wanted to cancel the order. */ + Customer = 'CUSTOMER', + /** The order was fraudulent. */ + Fraud = 'FRAUD', + /** There was insufficient inventory. */ + Inventory = 'INVENTORY', + /** Payment was declined. */ + Declined = 'DECLINED', + /** The order was canceled for an unlisted reason. */ + Other = 'OTHER', +} + +/** An auto-generated type for paginating through multiple Orders. */ +export type OrderConnection = { + __typename?: 'OrderConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Order and a cursor during pagination. */ +export type OrderEdge = { + __typename?: 'OrderEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of OrderEdge. */ + node: Order +} + +/** Represents the order's current financial status. */ +export enum OrderFinancialStatus { + /** Displayed as **Pending**. */ + Pending = 'PENDING', + /** Displayed as **Authorized**. */ + Authorized = 'AUTHORIZED', + /** Displayed as **Partially paid**. */ + PartiallyPaid = 'PARTIALLY_PAID', + /** Displayed as **Partially refunded**. */ + PartiallyRefunded = 'PARTIALLY_REFUNDED', + /** Displayed as **Voided**. */ + Voided = 'VOIDED', + /** Displayed as **Paid**. */ + Paid = 'PAID', + /** Displayed as **Refunded**. */ + Refunded = 'REFUNDED', +} + +/** Represents the order's current fulfillment status. */ +export enum OrderFulfillmentStatus { + /** Displayed as **Unfulfilled**. */ + Unfulfilled = 'UNFULFILLED', + /** Displayed as **Partially fulfilled**. */ + PartiallyFulfilled = 'PARTIALLY_FULFILLED', + /** Displayed as **Fulfilled**. */ + Fulfilled = 'FULFILLED', + /** Displayed as **Restocked**. */ + Restocked = 'RESTOCKED', + /** Displayed as **Pending fulfillment**. */ + PendingFulfillment = 'PENDING_FULFILLMENT', + /** Displayed as **Open**. */ + Open = 'OPEN', + /** Displayed as **In progress**. */ + InProgress = 'IN_PROGRESS', + /** Displayed as **Scheduled**. */ + Scheduled = 'SCHEDULED', +} + +/** Represents a single line in an order. There is one line item for each distinct product variant. */ +export type OrderLineItem = { + __typename?: 'OrderLineItem' + /** The number of entries associated to the line item minus the items that have been removed. */ + currentQuantity: Scalars['Int'] + /** List of custom attributes associated to the line item. */ + customAttributes: Array + /** The discounts that have been allocated onto the order line item by discount applications. */ + discountAllocations: Array + /** The total price of the line item, including discounts, and displayed in the presentment currency. */ + discountedTotalPrice: MoneyV2 + /** The total price of the line item, not including any discounts. The total price is calculated using the original unit price multiplied by the quantity, and it is displayed in the presentment currency. */ + originalTotalPrice: MoneyV2 + /** The number of products variants associated to the line item. */ + quantity: Scalars['Int'] + /** The title of the product combined with title of the variant. */ + title: Scalars['String'] + /** The product variant object associated to the line item. */ + variant?: Maybe +} + +/** An auto-generated type for paginating through multiple OrderLineItems. */ +export type OrderLineItemConnection = { + __typename?: 'OrderLineItemConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one OrderLineItem and a cursor during pagination. */ +export type OrderLineItemEdge = { + __typename?: 'OrderLineItemEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of OrderLineItemEdge. */ + node: OrderLineItem +} + +/** The set of valid sort keys for the Order query. */ +export enum OrderSortKeys { + /** Sort by the `processed_at` value. */ + ProcessedAt = 'PROCESSED_AT', + /** Sort by the `total_price` value. */ + TotalPrice = 'TOTAL_PRICE', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom page on the online store. */ +export type Page = Node & { + __typename?: 'Page' + /** The description of the page, complete with HTML formatting. */ + body: Scalars['HTML'] + /** Summary of the page body. */ + bodySummary: Scalars['String'] + /** The timestamp of the page creation. */ + createdAt: Scalars['DateTime'] + /** A human-friendly unique string for the page automatically generated from its title. */ + handle: Scalars['String'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The page's SEO information. */ + seo?: Maybe + /** The title of the page. */ + title: Scalars['String'] + /** The timestamp of the latest page update. */ + updatedAt: Scalars['DateTime'] + /** The url pointing to the page accessible from the web. */ + url: Scalars['URL'] +} + +/** An auto-generated type for paginating through multiple Pages. */ +export type PageConnection = { + __typename?: 'PageConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Page and a cursor during pagination. */ +export type PageEdge = { + __typename?: 'PageEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of PageEdge. */ + node: Page +} + +/** Information about pagination in a connection. */ +export type PageInfo = { + __typename?: 'PageInfo' + /** Indicates if there are more pages to fetch. */ + hasNextPage: Scalars['Boolean'] + /** Indicates if there are any pages prior to the current page. */ + hasPreviousPage: Scalars['Boolean'] +} + +/** The set of valid sort keys for the Page query. */ +export enum PageSortKeys { + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `updated_at` value. */ + UpdatedAt = 'UPDATED_AT', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** A payment applied to a checkout. */ +export type Payment = Node & { + __typename?: 'Payment' + /** + * The amount of the payment. + * @deprecated Use `amountV2` instead + */ + amount: Scalars['Money'] + /** The amount of the payment. */ + amountV2: MoneyV2 + /** The billing address for the payment. */ + billingAddress?: Maybe + /** The checkout to which the payment belongs. */ + checkout: Checkout + /** The credit card used for the payment in the case of direct payments. */ + creditCard?: Maybe + /** A message describing a processing error during asynchronous processing. */ + errorMessage?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** + * A client-side generated token to identify a payment and perform idempotent operations. + * For more information, refer to + * [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). + */ + idempotencyKey?: Maybe + /** The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow. */ + nextActionUrl?: Maybe + /** Whether or not the payment is still processing asynchronously. */ + ready: Scalars['Boolean'] + /** A flag to indicate if the payment is to be done in test mode for gateways that support it. */ + test: Scalars['Boolean'] + /** The actual transaction recorded by Shopify after having processed the payment with the gateway. */ + transaction?: Maybe +} + +/** Settings related to payments. */ +export type PaymentSettings = { + __typename?: 'PaymentSettings' + /** List of the card brands which the shop accepts. */ + acceptedCardBrands: Array + /** The url pointing to the endpoint to vault credit cards. */ + cardVaultUrl: Scalars['URL'] + /** The country where the shop is located. */ + countryCode: CountryCode + /** The three-letter code for the shop's primary currency. */ + currencyCode: CurrencyCode + /** A list of enabled currencies (ISO 4217 format) that the shop accepts. Merchants can enable currencies from their Shopify Payments settings in the Shopify admin. */ + enabledPresentmentCurrencies: Array + /** The shop’s Shopify Payments account id. */ + shopifyPaymentsAccountId?: Maybe + /** List of the digital wallets which the shop supports. */ + supportedDigitalWallets: Array +} + +/** The valid values for the types of payment token. */ +export enum PaymentTokenType { + /** Apple Pay token type. */ + ApplePay = 'APPLE_PAY', + /** Vault payment token type. */ + Vault = 'VAULT', + /** Shopify Pay token type. */ + ShopifyPay = 'SHOPIFY_PAY', + /** Google Pay token type. */ + GooglePay = 'GOOGLE_PAY', +} + +/** The value of the percentage pricing object. */ +export type PricingPercentageValue = { + __typename?: 'PricingPercentageValue' + /** The percentage value of the object. */ + percentage: Scalars['Float'] +} + +/** The price value (fixed or percentage) for a discount application. */ +export type PricingValue = MoneyV2 | PricingPercentageValue + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type Product = Node & + HasMetafields & { + __typename?: 'Product' + /** Indicates if at least one product variant is available for sale. */ + availableForSale: Scalars['Boolean'] + /** List of collections a product belongs to. */ + collections: CollectionConnection + /** The compare at price of the product across all variants. */ + compareAtPriceRange: ProductPriceRange + /** The date and time when the product was created. */ + createdAt: Scalars['DateTime'] + /** Stripped description of the product, single line with HTML tags removed. */ + description: Scalars['String'] + /** The description of the product, complete with HTML formatting. */ + descriptionHtml: Scalars['HTML'] + /** + * A human-friendly unique string for the Product automatically generated from its title. + * They are used by the Liquid templating language to refer to objects. + */ + handle: Scalars['String'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** List of images associated with the product. */ + images: ImageConnection + /** The media associated with the product. */ + media: MediaConnection + /** The metafield associated with the resource. */ + metafield?: Maybe + /** A paginated list of metafields associated with the resource. */ + metafields: MetafieldConnection + /** + * The online store URL for the product. + * A value of `null` indicates that the product is not published to the Online Store sales channel. + */ + onlineStoreUrl?: Maybe + /** List of product options. */ + options: Array + /** List of price ranges in the presentment currencies for this shop. */ + presentmentPriceRanges: ProductPriceRangeConnection + /** The price range. */ + priceRange: ProductPriceRange + /** A categorization that a product can be tagged with, commonly used for filtering and searching. */ + productType: Scalars['String'] + /** The date and time when the product was published to the channel. */ + publishedAt: Scalars['DateTime'] + /** The product's SEO information. */ + seo: Seo + /** + * A comma separated list of tags that have been added to the product. + * Additional access scope required for private apps: unauthenticated_read_product_tags. + */ + tags: Array + /** The product’s title. */ + title: Scalars['String'] + /** The total quantity of inventory in stock for this Product. */ + totalInventory?: Maybe + /** + * The date and time when the product was last modified. + * A product's `updatedAt` value can change for different reasons. For example, if an order + * is placed for a product that has inventory tracking set up, then the inventory adjustment + * is counted as an update. + */ + updatedAt: Scalars['DateTime'] + /** + * Find a product’s variant based on its selected options. + * This is useful for converting a user’s selection of product options into a single matching variant. + * If there is not a variant for the selected options, `null` will be returned. + */ + variantBySelectedOptions?: Maybe + /** List of the product’s variants. */ + variants: ProductVariantConnection + /** The product’s vendor name. */ + vendor: Scalars['String'] + } + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductCollectionsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductDescriptionArgs = { + truncateAt?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductImagesArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + maxWidth?: Maybe + maxHeight?: Maybe + crop?: Maybe + scale?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductMediaArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductMetafieldArgs = { + namespace: Scalars['String'] + key: Scalars['String'] +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductMetafieldsArgs = { + namespace?: Maybe + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductOptionsArgs = { + first?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductPresentmentPriceRangesArgs = { + presentmentCurrencies?: Maybe> + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductVariantBySelectedOptionsArgs = { + selectedOptions: Array +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductVariantsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe +} + +/** The set of valid sort keys for the ProductCollection query. */ +export enum ProductCollectionSortKeys { + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `price` value. */ + Price = 'PRICE', + /** Sort by the `best-selling` value. */ + BestSelling = 'BEST_SELLING', + /** Sort by the `created` value. */ + Created = 'CREATED', + /** Sort by the `id` value. */ + Id = 'ID', + /** Sort by the `manual` value. */ + Manual = 'MANUAL', + /** Sort by the `collection-default` value. */ + CollectionDefault = 'COLLECTION_DEFAULT', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** An auto-generated type for paginating through multiple Products. */ +export type ProductConnection = { + __typename?: 'ProductConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Product and a cursor during pagination. */ +export type ProductEdge = { + __typename?: 'ProductEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of ProductEdge. */ + node: Product +} + +/** The set of valid sort keys for the ProductImage query. */ +export enum ProductImageSortKeys { + /** Sort by the `created_at` value. */ + CreatedAt = 'CREATED_AT', + /** Sort by the `position` value. */ + Position = 'POSITION', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** The set of valid sort keys for the ProductMedia query. */ +export enum ProductMediaSortKeys { + /** Sort by the `position` value. */ + Position = 'POSITION', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** + * Product property names like "Size", "Color", and "Material" that the customers can select. + * Variants are selected based on permutations of these options. + * 255 characters limit each. + */ +export type ProductOption = Node & { + __typename?: 'ProductOption' + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The product option’s name. */ + name: Scalars['String'] + /** The corresponding value to the product option name. */ + values: Array +} + +/** The price range of the product. */ +export type ProductPriceRange = { + __typename?: 'ProductPriceRange' + /** The highest variant's price. */ + maxVariantPrice: MoneyV2 + /** The lowest variant's price. */ + minVariantPrice: MoneyV2 +} + +/** An auto-generated type for paginating through multiple ProductPriceRanges. */ +export type ProductPriceRangeConnection = { + __typename?: 'ProductPriceRangeConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one ProductPriceRange and a cursor during pagination. */ +export type ProductPriceRangeEdge = { + __typename?: 'ProductPriceRangeEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of ProductPriceRangeEdge. */ + node: ProductPriceRange +} + +/** The set of valid sort keys for the Product query. */ +export enum ProductSortKeys { + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `product_type` value. */ + ProductType = 'PRODUCT_TYPE', + /** Sort by the `vendor` value. */ + Vendor = 'VENDOR', + /** Sort by the `updated_at` value. */ + UpdatedAt = 'UPDATED_AT', + /** Sort by the `created_at` value. */ + CreatedAt = 'CREATED_AT', + /** Sort by the `best_selling` value. */ + BestSelling = 'BEST_SELLING', + /** Sort by the `price` value. */ + Price = 'PRICE', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** A product variant represents a different version of a product, such as differing sizes or differing colors. */ +export type ProductVariant = Node & + HasMetafields & { + __typename?: 'ProductVariant' + /** + * Indicates if the product variant is in stock. + * @deprecated Use `availableForSale` instead + */ + available?: Maybe + /** Indicates if the product variant is available for sale. */ + availableForSale: Scalars['Boolean'] + /** + * The compare at price of the variant. This can be used to mark a variant as on sale, when `compareAtPrice` is higher than `price`. + * @deprecated Use `compareAtPriceV2` instead + */ + compareAtPrice?: Maybe + /** The compare at price of the variant. This can be used to mark a variant as on sale, when `compareAtPriceV2` is higher than `priceV2`. */ + compareAtPriceV2?: Maybe + /** Whether a product is out of stock but still available for purchase (used for backorders). */ + currentlyNotInStock: Scalars['Boolean'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** Image associated with the product variant. This field falls back to the product image if no image is available. */ + image?: Maybe + /** The metafield associated with the resource. */ + metafield?: Maybe + /** A paginated list of metafields associated with the resource. */ + metafields: MetafieldConnection + /** List of prices and compare-at prices in the presentment currencies for this shop. */ + presentmentPrices: ProductVariantPricePairConnection + /** List of unit prices in the presentment currencies for this shop. */ + presentmentUnitPrices: MoneyV2Connection + /** + * The product variant’s price. + * @deprecated Use `priceV2` instead + */ + price: Scalars['Money'] + /** The product variant’s price. */ + priceV2: MoneyV2 + /** The product object that the product variant belongs to. */ + product: Product + /** The total sellable quantity of the variant for online sales channels. */ + quantityAvailable?: Maybe + /** Whether a customer needs to provide a shipping address when placing an order for the product variant. */ + requiresShipping: Scalars['Boolean'] + /** List of product options applied to the variant. */ + selectedOptions: Array + /** The SKU (stock keeping unit) associated with the variant. */ + sku?: Maybe + /** The product variant’s title. */ + title: Scalars['String'] + /** The unit price value for the variant based on the variant's measurement. */ + unitPrice?: Maybe + /** The unit price measurement for the variant. */ + unitPriceMeasurement?: Maybe + /** The weight of the product variant in the unit system specified with `weight_unit`. */ + weight?: Maybe + /** Unit of measurement for weight. */ + weightUnit: WeightUnit + } + +/** A product variant represents a different version of a product, such as differing sizes or differing colors. */ +export type ProductVariantImageArgs = { + maxWidth?: Maybe + maxHeight?: Maybe + crop?: Maybe + scale?: Maybe +} + +/** A product variant represents a different version of a product, such as differing sizes or differing colors. */ +export type ProductVariantMetafieldArgs = { + namespace: Scalars['String'] + key: Scalars['String'] +} + +/** A product variant represents a different version of a product, such as differing sizes or differing colors. */ +export type ProductVariantMetafieldsArgs = { + namespace?: Maybe + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** A product variant represents a different version of a product, such as differing sizes or differing colors. */ +export type ProductVariantPresentmentPricesArgs = { + presentmentCurrencies?: Maybe> + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** A product variant represents a different version of a product, such as differing sizes or differing colors. */ +export type ProductVariantPresentmentUnitPricesArgs = { + presentmentCurrencies?: Maybe> + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** An auto-generated type for paginating through multiple ProductVariants. */ +export type ProductVariantConnection = { + __typename?: 'ProductVariantConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one ProductVariant and a cursor during pagination. */ +export type ProductVariantEdge = { + __typename?: 'ProductVariantEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of ProductVariantEdge. */ + node: ProductVariant +} + +/** The compare-at price and price of a variant sharing a currency. */ +export type ProductVariantPricePair = { + __typename?: 'ProductVariantPricePair' + /** The compare-at price of the variant with associated currency. */ + compareAtPrice?: Maybe + /** The price of the variant with associated currency. */ + price: MoneyV2 +} + +/** An auto-generated type for paginating through multiple ProductVariantPricePairs. */ +export type ProductVariantPricePairConnection = { + __typename?: 'ProductVariantPricePairConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one ProductVariantPricePair and a cursor during pagination. */ +export type ProductVariantPricePairEdge = { + __typename?: 'ProductVariantPricePairEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of ProductVariantPricePairEdge. */ + node: ProductVariantPricePair +} + +/** The set of valid sort keys for the ProductVariant query. */ +export enum ProductVariantSortKeys { + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `sku` value. */ + Sku = 'SKU', + /** Sort by the `position` value. */ + Position = 'POSITION', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRoot = { + __typename?: 'QueryRoot' + /** List of the shop's articles. */ + articles: ArticleConnection + /** Find a blog by its handle. */ + blogByHandle?: Maybe + /** List of the shop's blogs. */ + blogs: BlogConnection + /** Find a collection by its handle. */ + collectionByHandle?: Maybe + /** List of the shop’s collections. */ + collections: CollectionConnection + /** Find a customer by its access token. */ + customer?: Maybe + /** Returns a specific node by ID. */ + node?: Maybe + /** Returns the list of nodes with the given IDs. */ + nodes: Array> + /** Find a page by its handle. */ + pageByHandle?: Maybe + /** List of the shop's pages. */ + pages: PageConnection + /** Find a product by its handle. */ + productByHandle?: Maybe + /** + * Find recommended products related to a given `product_id`. + * To learn more about how recommendations are generated, see + * [*Showing product recommendations on product pages*](https://help.shopify.com/themes/development/recommended-products). + */ + productRecommendations?: Maybe> + /** + * Tags added to products. + * Additional access scope required: unauthenticated_read_product_tags. + */ + productTags: StringConnection + /** List of product types for the shop's products that are published to your app. */ + productTypes: StringConnection + /** List of the shop’s products. */ + products: ProductConnection + /** The list of public Storefront API versions, including supported, release candidate and unstable versions. */ + publicApiVersions: Array + /** The shop associated with the storefront access token. */ + shop: Shop +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootArticlesArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootBlogByHandleArgs = { + handle: Scalars['String'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootBlogsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootCollectionByHandleArgs = { + handle: Scalars['String'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootCollectionsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootCustomerArgs = { + customerAccessToken: Scalars['String'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootNodeArgs = { + id: Scalars['ID'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootNodesArgs = { + ids: Array +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootPageByHandleArgs = { + handle: Scalars['String'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootPagesArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootProductByHandleArgs = { + handle: Scalars['String'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootProductRecommendationsArgs = { + productId: Scalars['ID'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootProductTagsArgs = { + first: Scalars['Int'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootProductTypesArgs = { + first: Scalars['Int'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootProductsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** SEO information. */ +export type Seo = { + __typename?: 'SEO' + /** The meta description. */ + description?: Maybe + /** The SEO title. */ + title?: Maybe +} + +/** + * Script discount applications capture the intentions of a discount that + * was created by a Shopify Script. + */ +export type ScriptDiscountApplication = DiscountApplication & { + __typename?: 'ScriptDiscountApplication' + /** The method by which the discount's value is allocated to its entitled items. */ + allocationMethod: DiscountApplicationAllocationMethod + /** + * The description of the application as defined by the Script. + * @deprecated Use `title` instead + */ + description: Scalars['String'] + /** Which lines of targetType that the discount is allocated over. */ + targetSelection: DiscountApplicationTargetSelection + /** The type of line that the discount is applicable towards. */ + targetType: DiscountApplicationTargetType + /** The title of the application as defined by the Script. */ + title: Scalars['String'] + /** The value of the discount application. */ + value: PricingValue +} + +/** + * Properties used by customers to select a product variant. + * Products can have multiple options, like different sizes or colors. + */ +export type SelectedOption = { + __typename?: 'SelectedOption' + /** The product option’s name. */ + name: Scalars['String'] + /** The product option’s value. */ + value: Scalars['String'] +} + +/** Specifies the input fields required for a selected option. */ +export type SelectedOptionInput = { + /** The product option’s name. */ + name: Scalars['String'] + /** The product option’s value. */ + value: Scalars['String'] +} + +/** A shipping rate to be applied to a checkout. */ +export type ShippingRate = { + __typename?: 'ShippingRate' + /** Human-readable unique identifier for this shipping rate. */ + handle: Scalars['String'] + /** + * Price of this shipping rate. + * @deprecated Use `priceV2` instead + */ + price: Scalars['Money'] + /** Price of this shipping rate. */ + priceV2: MoneyV2 + /** Title of this shipping rate. */ + title: Scalars['String'] +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type Shop = { + __typename?: 'Shop' + /** + * List of the shop' articles. + * @deprecated Use `QueryRoot.articles` instead. + */ + articles: ArticleConnection + /** + * List of the shop' blogs. + * @deprecated Use `QueryRoot.blogs` instead. + */ + blogs: BlogConnection + /** + * Find a collection by its handle. + * @deprecated Use `QueryRoot.collectionByHandle` instead. + */ + collectionByHandle?: Maybe + /** + * List of the shop’s collections. + * @deprecated Use `QueryRoot.collections` instead. + */ + collections: CollectionConnection + /** + * The three-letter code for the currency that the shop accepts. + * @deprecated Use `paymentSettings` instead + */ + currencyCode: CurrencyCode + /** A description of the shop. */ + description?: Maybe + /** A string representing the way currency is formatted when the currency isn’t specified. */ + moneyFormat: Scalars['String'] + /** The shop’s name. */ + name: Scalars['String'] + /** Settings related to payments. */ + paymentSettings: PaymentSettings + /** The shop’s primary domain. */ + primaryDomain: Domain + /** The shop’s privacy policy. */ + privacyPolicy?: Maybe + /** + * Find a product by its handle. + * @deprecated Use `QueryRoot.productByHandle` instead. + */ + productByHandle?: Maybe + /** + * A list of tags that have been added to products. + * Additional access scope required: unauthenticated_read_product_tags. + * @deprecated Use `QueryRoot.productTags` instead. + */ + productTags: StringConnection + /** + * List of the shop’s product types. + * @deprecated Use `QueryRoot.productTypes` instead. + */ + productTypes: StringConnection + /** + * List of the shop’s products. + * @deprecated Use `QueryRoot.products` instead. + */ + products: ProductConnection + /** The shop’s refund policy. */ + refundPolicy?: Maybe + /** The shop’s shipping policy. */ + shippingPolicy?: Maybe + /** Countries that the shop ships to. */ + shipsToCountries: Array + /** + * The shop’s Shopify Payments account id. + * @deprecated Use `paymentSettings` instead + */ + shopifyPaymentsAccountId?: Maybe + /** The shop’s terms of service. */ + termsOfService?: Maybe +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopArticlesArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopBlogsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopCollectionByHandleArgs = { + handle: Scalars['String'] +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopCollectionsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopProductByHandleArgs = { + handle: Scalars['String'] +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopProductTagsArgs = { + first: Scalars['Int'] +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopProductTypesArgs = { + first: Scalars['Int'] +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopProductsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** Policy that a merchant has configured for their store, such as their refund or privacy policy. */ +export type ShopPolicy = Node & { + __typename?: 'ShopPolicy' + /** Policy text, maximum size of 64kb. */ + body: Scalars['String'] + /** Policy’s handle. */ + handle: Scalars['String'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** Policy’s title. */ + title: Scalars['String'] + /** Public URL to the policy. */ + url: Scalars['URL'] +} + +/** An auto-generated type for paginating through multiple Strings. */ +export type StringConnection = { + __typename?: 'StringConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one String and a cursor during pagination. */ +export type StringEdge = { + __typename?: 'StringEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of StringEdge. */ + node: Scalars['String'] +} + +/** + * Specifies the fields required to complete a checkout with + * a tokenized payment. + */ +export type TokenizedPaymentInput = { + /** The amount of the payment. */ + amount: Scalars['Money'] + /** A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). */ + idempotencyKey: Scalars['String'] + /** The billing address for the payment. */ + billingAddress: MailingAddressInput + /** The type of payment token. */ + type: Scalars['String'] + /** A simple string or JSON containing the required payment data for the tokenized payment. */ + paymentData: Scalars['String'] + /** Executes the payment in test mode if possible. Defaults to `false`. */ + test?: Maybe + /** Public Hash Key used for AndroidPay payments only. */ + identifier?: Maybe +} + +/** + * Specifies the fields required to complete a checkout with + * a tokenized payment. + */ +export type TokenizedPaymentInputV2 = { + /** The amount and currency of the payment. */ + paymentAmount: MoneyInput + /** A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). */ + idempotencyKey: Scalars['String'] + /** The billing address for the payment. */ + billingAddress: MailingAddressInput + /** A simple string or JSON containing the required payment data for the tokenized payment. */ + paymentData: Scalars['String'] + /** Whether to execute the payment in test mode, if possible. Test mode is not supported in production stores. Defaults to `false`. */ + test?: Maybe + /** Public Hash Key used for AndroidPay payments only. */ + identifier?: Maybe + /** The type of payment token. */ + type: Scalars['String'] +} + +/** + * Specifies the fields required to complete a checkout with + * a tokenized payment. + */ +export type TokenizedPaymentInputV3 = { + /** The amount and currency of the payment. */ + paymentAmount: MoneyInput + /** A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). */ + idempotencyKey: Scalars['String'] + /** The billing address for the payment. */ + billingAddress: MailingAddressInput + /** A simple string or JSON containing the required payment data for the tokenized payment. */ + paymentData: Scalars['String'] + /** Whether to execute the payment in test mode, if possible. Test mode is not supported in production stores. Defaults to `false`. */ + test?: Maybe + /** Public Hash Key used for AndroidPay payments only. */ + identifier?: Maybe + /** The type of payment token. */ + type: PaymentTokenType +} + +/** An object representing exchange of money for a product or service. */ +export type Transaction = { + __typename?: 'Transaction' + /** + * The amount of money that the transaction was for. + * @deprecated Use `amountV2` instead + */ + amount: Scalars['Money'] + /** The amount of money that the transaction was for. */ + amountV2: MoneyV2 + /** The kind of the transaction. */ + kind: TransactionKind + /** + * The status of the transaction. + * @deprecated Use `statusV2` instead + */ + status: TransactionStatus + /** The status of the transaction. */ + statusV2?: Maybe + /** Whether the transaction was done in test mode or not. */ + test: Scalars['Boolean'] +} + +/** The different kinds of order transactions. */ +export enum TransactionKind { + /** An authorization and capture performed together in a single step. */ + Sale = 'SALE', + /** A transfer of the money that was reserved during the authorization stage. */ + Capture = 'CAPTURE', + /** + * An amount reserved against the cardholder's funding source. + * Money does not change hands until the authorization is captured. + */ + Authorization = 'AUTHORIZATION', + /** An authorization for a payment taken with an EMV credit card reader. */ + EmvAuthorization = 'EMV_AUTHORIZATION', + /** Money returned to the customer when they have paid too much. */ + Change = 'CHANGE', +} + +/** Transaction statuses describe the status of a transaction. */ +export enum TransactionStatus { + /** The transaction is pending. */ + Pending = 'PENDING', + /** The transaction succeeded. */ + Success = 'SUCCESS', + /** The transaction failed. */ + Failure = 'FAILURE', + /** There was an error while processing the transaction. */ + Error = 'ERROR', +} + +/** The measurement used to calculate a unit price for a product variant (e.g. $9.99 / 100ml). */ +export type UnitPriceMeasurement = { + __typename?: 'UnitPriceMeasurement' + /** The type of unit of measurement for the unit price measurement. */ + measuredType?: Maybe + /** The quantity unit for the unit price measurement. */ + quantityUnit?: Maybe + /** The quantity value for the unit price measurement. */ + quantityValue: Scalars['Float'] + /** The reference unit for the unit price measurement. */ + referenceUnit?: Maybe + /** The reference value for the unit price measurement. */ + referenceValue: Scalars['Int'] +} + +/** The accepted types of unit of measurement. */ +export enum UnitPriceMeasurementMeasuredType { + /** Unit of measurements representing volumes. */ + Volume = 'VOLUME', + /** Unit of measurements representing weights. */ + Weight = 'WEIGHT', + /** Unit of measurements representing lengths. */ + Length = 'LENGTH', + /** Unit of measurements representing areas. */ + Area = 'AREA', +} + +/** The valid units of measurement for a unit price measurement. */ +export enum UnitPriceMeasurementMeasuredUnit { + /** 1000 milliliters equals 1 liter. */ + Ml = 'ML', + /** 100 centiliters equals 1 liter. */ + Cl = 'CL', + /** Metric system unit of volume. */ + L = 'L', + /** 1 cubic meter equals 1000 liters. */ + M3 = 'M3', + /** 1000 milligrams equals 1 gram. */ + Mg = 'MG', + /** Metric system unit of weight. */ + G = 'G', + /** 1 kilogram equals 1000 grams. */ + Kg = 'KG', + /** 1000 millimeters equals 1 meter. */ + Mm = 'MM', + /** 100 centimeters equals 1 meter. */ + Cm = 'CM', + /** Metric system unit of length. */ + M = 'M', + /** Metric system unit of area. */ + M2 = 'M2', +} + +/** Represents an error in the input of a mutation. */ +export type UserError = DisplayableError & { + __typename?: 'UserError' + /** Path to the input field which caused the error. */ + field?: Maybe> + /** The error message. */ + message: Scalars['String'] +} + +/** Represents a Shopify hosted video. */ +export type Video = Node & + Media & { + __typename?: 'Video' + /** A word or phrase to share the nature or contents of a media. */ + alt?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The media content type. */ + mediaContentType: MediaContentType + /** The preview image for the media. */ + previewImage?: Maybe + /** The sources for a video. */ + sources: Array + } + +/** Represents a source for a Shopify hosted video. */ +export type VideoSource = { + __typename?: 'VideoSource' + /** The format of the video source. */ + format: Scalars['String'] + /** The height of the video. */ + height: Scalars['Int'] + /** The video MIME type. */ + mimeType: Scalars['String'] + /** The URL of the video. */ + url: Scalars['String'] + /** The width of the video. */ + width: Scalars['Int'] +} + +/** Units of measurement for weight. */ +export enum WeightUnit { + /** 1 kilogram equals 1000 grams. */ + Kilograms = 'KILOGRAMS', + /** Metric system unit of mass. */ + Grams = 'GRAMS', + /** 1 pound equals 16 ounces. */ + Pounds = 'POUNDS', + /** Imperial system unit of mass. */ + Ounces = 'OUNCES', +} + +export type AssociateCustomerWithCheckoutMutationVariables = Exact<{ + checkoutId: Scalars['ID'] + customerAccessToken: Scalars['String'] +}> + +export type AssociateCustomerWithCheckoutMutation = { + __typename?: 'Mutation' +} & { + checkoutCustomerAssociateV2?: Maybe< + { __typename?: 'CheckoutCustomerAssociateV2Payload' } & { + checkout?: Maybe<{ __typename?: 'Checkout' } & Pick> + checkoutUserErrors: Array< + { __typename?: 'CheckoutUserError' } & Pick< + CheckoutUserError, + 'code' | 'field' | 'message' + > + > + customer?: Maybe<{ __typename?: 'Customer' } & Pick> + } + > +} + +export type CheckoutCreateMutationVariables = Exact<{ + input?: Maybe +}> + +export type CheckoutCreateMutation = { __typename?: 'Mutation' } & { + checkoutCreate?: Maybe< + { __typename?: 'CheckoutCreatePayload' } & { + checkoutUserErrors: Array< + { __typename?: 'CheckoutUserError' } & Pick< + CheckoutUserError, + 'code' | 'field' | 'message' + > + > + checkout?: Maybe<{ __typename?: 'Checkout' } & CheckoutDetailsFragment> + } + > +} + +export type CheckoutLineItemAddMutationVariables = Exact<{ + checkoutId: Scalars['ID'] + lineItems: Array | CheckoutLineItemInput +}> + +export type CheckoutLineItemAddMutation = { __typename?: 'Mutation' } & { + checkoutLineItemsAdd?: Maybe< + { __typename?: 'CheckoutLineItemsAddPayload' } & { + checkoutUserErrors: Array< + { __typename?: 'CheckoutUserError' } & Pick< + CheckoutUserError, + 'code' | 'field' | 'message' + > + > + checkout?: Maybe<{ __typename?: 'Checkout' } & CheckoutDetailsFragment> + } + > +} + +export type CheckoutLineItemRemoveMutationVariables = Exact<{ + checkoutId: Scalars['ID'] + lineItemIds: Array | Scalars['ID'] +}> + +export type CheckoutLineItemRemoveMutation = { __typename?: 'Mutation' } & { + checkoutLineItemsRemove?: Maybe< + { __typename?: 'CheckoutLineItemsRemovePayload' } & { + checkoutUserErrors: Array< + { __typename?: 'CheckoutUserError' } & Pick< + CheckoutUserError, + 'code' | 'field' | 'message' + > + > + checkout?: Maybe<{ __typename?: 'Checkout' } & CheckoutDetailsFragment> + } + > +} + +export type CheckoutLineItemUpdateMutationVariables = Exact<{ + checkoutId: Scalars['ID'] + lineItems: Array | CheckoutLineItemUpdateInput +}> + +export type CheckoutLineItemUpdateMutation = { __typename?: 'Mutation' } & { + checkoutLineItemsUpdate?: Maybe< + { __typename?: 'CheckoutLineItemsUpdatePayload' } & { + checkoutUserErrors: Array< + { __typename?: 'CheckoutUserError' } & Pick< + CheckoutUserError, + 'code' | 'field' | 'message' + > + > + checkout?: Maybe<{ __typename?: 'Checkout' } & CheckoutDetailsFragment> + } + > +} + +export type CustomerAccessTokenCreateMutationVariables = Exact<{ + input: CustomerAccessTokenCreateInput +}> + +export type CustomerAccessTokenCreateMutation = { __typename?: 'Mutation' } & { + customerAccessTokenCreate?: Maybe< + { __typename?: 'CustomerAccessTokenCreatePayload' } & { + customerAccessToken?: Maybe< + { __typename?: 'CustomerAccessToken' } & Pick< + CustomerAccessToken, + 'accessToken' | 'expiresAt' + > + > + customerUserErrors: Array< + { __typename?: 'CustomerUserError' } & Pick< + CustomerUserError, + 'code' | 'field' | 'message' + > + > + } + > +} + +export type CustomerAccessTokenDeleteMutationVariables = Exact<{ + customerAccessToken: Scalars['String'] +}> + +export type CustomerAccessTokenDeleteMutation = { __typename?: 'Mutation' } & { + customerAccessTokenDelete?: Maybe< + { __typename?: 'CustomerAccessTokenDeletePayload' } & Pick< + CustomerAccessTokenDeletePayload, + 'deletedAccessToken' | 'deletedCustomerAccessTokenId' + > & { + userErrors: Array< + { __typename?: 'UserError' } & Pick + > + } + > +} + +export type CustomerActivateByUrlMutationVariables = Exact<{ + activationUrl: Scalars['URL'] + password: Scalars['String'] +}> + +export type CustomerActivateByUrlMutation = { __typename?: 'Mutation' } & { + customerActivateByUrl?: Maybe< + { __typename?: 'CustomerActivateByUrlPayload' } & { + customer?: Maybe<{ __typename?: 'Customer' } & Pick> + customerAccessToken?: Maybe< + { __typename?: 'CustomerAccessToken' } & Pick< + CustomerAccessToken, + 'accessToken' | 'expiresAt' + > + > + customerUserErrors: Array< + { __typename?: 'CustomerUserError' } & Pick< + CustomerUserError, + 'code' | 'field' | 'message' + > + > + } + > +} + +export type CustomerActivateMutationVariables = Exact<{ + id: Scalars['ID'] + input: CustomerActivateInput +}> + +export type CustomerActivateMutation = { __typename?: 'Mutation' } & { + customerActivate?: Maybe< + { __typename?: 'CustomerActivatePayload' } & { + customer?: Maybe<{ __typename?: 'Customer' } & Pick> + customerAccessToken?: Maybe< + { __typename?: 'CustomerAccessToken' } & Pick< + CustomerAccessToken, + 'accessToken' | 'expiresAt' + > + > + customerUserErrors: Array< + { __typename?: 'CustomerUserError' } & Pick< + CustomerUserError, + 'code' | 'field' | 'message' + > + > + } + > +} + +export type CustomerCreateMutationVariables = Exact<{ + input: CustomerCreateInput +}> + +export type CustomerCreateMutation = { __typename?: 'Mutation' } & { + customerCreate?: Maybe< + { __typename?: 'CustomerCreatePayload' } & { + customerUserErrors: Array< + { __typename?: 'CustomerUserError' } & Pick< + CustomerUserError, + 'code' | 'field' | 'message' + > + > + customer?: Maybe<{ __typename?: 'Customer' } & Pick> + } + > +} + +export type GetSiteCollectionsQueryVariables = Exact<{ + first: Scalars['Int'] +}> + +export type GetSiteCollectionsQuery = { __typename?: 'QueryRoot' } & { + collections: { __typename?: 'CollectionConnection' } & { + edges: Array< + { __typename?: 'CollectionEdge' } & { + node: { __typename?: 'Collection' } & Pick< + Collection, + 'id' | 'title' | 'handle' + > + } + > + } +} + +export type GetAllPagesQueryVariables = Exact<{ + first?: Maybe +}> + +export type GetAllPagesQuery = { __typename?: 'QueryRoot' } & { + pages: { __typename?: 'PageConnection' } & { + edges: Array< + { __typename?: 'PageEdge' } & { + node: { __typename?: 'Page' } & Pick + } + > + } +} + +export type GetAllProductVendorsQueryVariables = Exact<{ + first?: Maybe + cursor?: Maybe +}> + +export type GetAllProductVendorsQuery = { __typename?: 'QueryRoot' } & { + products: { __typename?: 'ProductConnection' } & { + pageInfo: { __typename?: 'PageInfo' } & Pick< + PageInfo, + 'hasNextPage' | 'hasPreviousPage' + > + edges: Array< + { __typename?: 'ProductEdge' } & Pick & { + node: { __typename?: 'Product' } & Pick + } + > + } +} + +export type GetAllProductPathsQueryVariables = Exact<{ + first?: Maybe + cursor?: Maybe +}> + +export type GetAllProductPathsQuery = { __typename?: 'QueryRoot' } & { + products: { __typename?: 'ProductConnection' } & { + pageInfo: { __typename?: 'PageInfo' } & Pick< + PageInfo, + 'hasNextPage' | 'hasPreviousPage' + > + edges: Array< + { __typename?: 'ProductEdge' } & Pick & { + node: { __typename?: 'Product' } & Pick + } + > + } +} + +export type ProductConnectionFragment = { __typename?: 'ProductConnection' } & { + pageInfo: { __typename?: 'PageInfo' } & Pick< + PageInfo, + 'hasNextPage' | 'hasPreviousPage' + > + edges: Array< + { __typename?: 'ProductEdge' } & { + node: { __typename?: 'Product' } & Pick< + Product, + 'id' | 'title' | 'vendor' | 'handle' + > & { + priceRange: { __typename?: 'ProductPriceRange' } & { + minVariantPrice: { __typename?: 'MoneyV2' } & Pick< + MoneyV2, + 'amount' | 'currencyCode' + > + } + images: { __typename?: 'ImageConnection' } & { + pageInfo: { __typename?: 'PageInfo' } & Pick< + PageInfo, + 'hasNextPage' | 'hasPreviousPage' + > + edges: Array< + { __typename?: 'ImageEdge' } & { + node: { __typename?: 'Image' } & Pick< + Image, + 'originalSrc' | 'altText' | 'width' | 'height' + > + } + > + } + } + } + > +} + +export type GetAllProductsQueryVariables = Exact<{ + first?: Maybe + query?: Maybe + sortKey?: Maybe + reverse?: Maybe +}> + +export type GetAllProductsQuery = { __typename?: 'QueryRoot' } & { + products: { __typename?: 'ProductConnection' } & ProductConnectionFragment +} + +export type CheckoutDetailsFragment = { __typename?: 'Checkout' } & Pick< + Checkout, + 'id' | 'webUrl' | 'completedAt' | 'createdAt' | 'taxesIncluded' +> & { + subtotalPriceV2: { __typename?: 'MoneyV2' } & Pick< + MoneyV2, + 'amount' | 'currencyCode' + > + totalTaxV2: { __typename?: 'MoneyV2' } & Pick< + MoneyV2, + 'amount' | 'currencyCode' + > + totalPriceV2: { __typename?: 'MoneyV2' } & Pick< + MoneyV2, + 'amount' | 'currencyCode' + > + lineItems: { __typename?: 'CheckoutLineItemConnection' } & { + pageInfo: { __typename?: 'PageInfo' } & Pick< + PageInfo, + 'hasNextPage' | 'hasPreviousPage' + > + edges: Array< + { __typename?: 'CheckoutLineItemEdge' } & { + node: { __typename?: 'CheckoutLineItem' } & Pick< + CheckoutLineItem, + 'id' | 'title' | 'quantity' + > & { + variant?: Maybe< + { __typename?: 'ProductVariant' } & Pick< + ProductVariant, + 'id' | 'sku' | 'title' + > & { + image?: Maybe< + { __typename?: 'Image' } & Pick< + Image, + 'originalSrc' | 'altText' | 'width' | 'height' + > + > + priceV2: { __typename?: 'MoneyV2' } & Pick< + MoneyV2, + 'amount' | 'currencyCode' + > + compareAtPriceV2?: Maybe< + { __typename?: 'MoneyV2' } & Pick< + MoneyV2, + 'amount' | 'currencyCode' + > + > + product: { __typename?: 'Product' } & Pick< + Product, + 'handle' + > + } + > + } + } + > + } + } + +export type GetCheckoutQueryVariables = Exact<{ + checkoutId: Scalars['ID'] +}> + +export type GetCheckoutQuery = { __typename?: 'QueryRoot' } & { + node?: Maybe< + | { __typename?: 'AppliedGiftCard' } + | { __typename?: 'Article' } + | { __typename?: 'Blog' } + | ({ __typename?: 'Checkout' } & CheckoutDetailsFragment) + | { __typename?: 'CheckoutLineItem' } + | { __typename?: 'Collection' } + | { __typename?: 'Comment' } + | { __typename?: 'ExternalVideo' } + | { __typename?: 'MailingAddress' } + | { __typename?: 'MediaImage' } + | { __typename?: 'Metafield' } + | { __typename?: 'Model3d' } + | { __typename?: 'Order' } + | { __typename?: 'Page' } + | { __typename?: 'Payment' } + | { __typename?: 'Product' } + | { __typename?: 'ProductOption' } + | { __typename?: 'ProductVariant' } + | { __typename?: 'ShopPolicy' } + | { __typename?: 'Video' } + > +} + +export type GetProductsFromCollectionQueryVariables = Exact<{ + categoryId: Scalars['ID'] + first?: Maybe + sortKey?: Maybe + reverse?: Maybe +}> + +export type GetProductsFromCollectionQuery = { __typename?: 'QueryRoot' } & { + node?: Maybe< + | ({ __typename?: 'AppliedGiftCard' } & Pick) + | ({ __typename?: 'Article' } & Pick) + | ({ __typename?: 'Blog' } & Pick) + | ({ __typename?: 'Checkout' } & Pick) + | ({ __typename?: 'CheckoutLineItem' } & Pick) + | ({ __typename?: 'Collection' } & Pick & { + products: { + __typename?: 'ProductConnection' + } & ProductConnectionFragment + }) + | ({ __typename?: 'Comment' } & Pick) + | ({ __typename?: 'ExternalVideo' } & Pick) + | ({ __typename?: 'MailingAddress' } & Pick) + | ({ __typename?: 'MediaImage' } & Pick) + | ({ __typename?: 'Metafield' } & Pick) + | ({ __typename?: 'Model3d' } & Pick) + | ({ __typename?: 'Order' } & Pick) + | ({ __typename?: 'Page' } & Pick) + | ({ __typename?: 'Payment' } & Pick) + | ({ __typename?: 'Product' } & Pick) + | ({ __typename?: 'ProductOption' } & Pick) + | ({ __typename?: 'ProductVariant' } & Pick) + | ({ __typename?: 'ShopPolicy' } & Pick) + | ({ __typename?: 'Video' } & Pick) + > +} + +export type GetCustomerIdQueryVariables = Exact<{ + customerAccessToken: Scalars['String'] +}> + +export type GetCustomerIdQuery = { __typename?: 'QueryRoot' } & { + customer?: Maybe<{ __typename?: 'Customer' } & Pick> +} + +export type GetCustomerQueryVariables = Exact<{ + customerAccessToken: Scalars['String'] +}> + +export type GetCustomerQuery = { __typename?: 'QueryRoot' } & { + customer?: Maybe< + { __typename?: 'Customer' } & Pick< + Customer, + | 'id' + | 'firstName' + | 'lastName' + | 'displayName' + | 'email' + | 'phone' + | 'tags' + | 'acceptsMarketing' + | 'createdAt' + > + > +} + +export type GetPageQueryVariables = Exact<{ + id: Scalars['ID'] +}> + +export type GetPageQuery = { __typename?: 'QueryRoot' } & { + node?: Maybe< + | ({ __typename?: 'AppliedGiftCard' } & Pick) + | ({ __typename?: 'Article' } & Pick) + | ({ __typename?: 'Blog' } & Pick) + | ({ __typename?: 'Checkout' } & Pick) + | ({ __typename?: 'CheckoutLineItem' } & Pick) + | ({ __typename?: 'Collection' } & Pick) + | ({ __typename?: 'Comment' } & Pick) + | ({ __typename?: 'ExternalVideo' } & Pick) + | ({ __typename?: 'MailingAddress' } & Pick) + | ({ __typename?: 'MediaImage' } & Pick) + | ({ __typename?: 'Metafield' } & Pick) + | ({ __typename?: 'Model3d' } & Pick) + | ({ __typename?: 'Order' } & Pick) + | ({ __typename?: 'Page' } & Pick< + Page, + 'title' | 'handle' | 'body' | 'bodySummary' | 'id' + >) + | ({ __typename?: 'Payment' } & Pick) + | ({ __typename?: 'Product' } & Pick) + | ({ __typename?: 'ProductOption' } & Pick) + | ({ __typename?: 'ProductVariant' } & Pick) + | ({ __typename?: 'ShopPolicy' } & Pick) + | ({ __typename?: 'Video' } & Pick) + > +} + +export type GetProductBySlugQueryVariables = Exact<{ + slug: Scalars['String'] +}> + +export type GetProductBySlugQuery = { __typename?: 'QueryRoot' } & { + productByHandle?: Maybe< + { __typename?: 'Product' } & Pick< + Product, + | 'id' + | 'handle' + | 'title' + | 'productType' + | 'vendor' + | 'description' + | 'descriptionHtml' + > & { + options: Array< + { __typename?: 'ProductOption' } & Pick< + ProductOption, + 'id' | 'name' | 'values' + > + > + priceRange: { __typename?: 'ProductPriceRange' } & { + maxVariantPrice: { __typename?: 'MoneyV2' } & Pick< + MoneyV2, + 'amount' | 'currencyCode' + > + minVariantPrice: { __typename?: 'MoneyV2' } & Pick< + MoneyV2, + 'amount' | 'currencyCode' + > + } + variants: { __typename?: 'ProductVariantConnection' } & { + pageInfo: { __typename?: 'PageInfo' } & Pick< + PageInfo, + 'hasNextPage' | 'hasPreviousPage' + > + edges: Array< + { __typename?: 'ProductVariantEdge' } & { + node: { __typename?: 'ProductVariant' } & Pick< + ProductVariant, + 'id' | 'title' | 'sku' + > & { + selectedOptions: Array< + { __typename?: 'SelectedOption' } & Pick< + SelectedOption, + 'name' | 'value' + > + > + priceV2: { __typename?: 'MoneyV2' } & Pick< + MoneyV2, + 'amount' | 'currencyCode' + > + compareAtPriceV2?: Maybe< + { __typename?: 'MoneyV2' } & Pick< + MoneyV2, + 'amount' | 'currencyCode' + > + > + } + } + > + } + images: { __typename?: 'ImageConnection' } & { + pageInfo: { __typename?: 'PageInfo' } & Pick< + PageInfo, + 'hasNextPage' | 'hasPreviousPage' + > + edges: Array< + { __typename?: 'ImageEdge' } & { + node: { __typename?: 'Image' } & Pick< + Image, + 'originalSrc' | 'altText' | 'width' | 'height' + > + } + > + } + } + > +} + +export type GetSiteInfoQueryVariables = Exact<{ [key: string]: never }> + +export type GetSiteInfoQuery = { __typename?: 'QueryRoot' } & { + shop: { __typename?: 'Shop' } & Pick +} diff --git a/packages/shopify/schema.graphql b/packages/shopify/schema.graphql new file mode 100644 index 0000000..9c657fe --- /dev/null +++ b/packages/shopify/schema.graphql @@ -0,0 +1,9702 @@ +schema { + query: QueryRoot + mutation: Mutation +} + +""" +Marks an element of a GraphQL schema as having restricted access. +""" +directive @accessRestricted( + """ + Explains the reason around this restriction + """ + reason: String = null +) on FIELD_DEFINITION | OBJECT + +""" +Contextualize data. +""" +directive @inContext( + """ + The country code for context. + """ + country: CountryCode! +) on QUERY | MUTATION + +""" +A version of the API. +""" +type ApiVersion { + """ + The human-readable name of the version. + """ + displayName: String! + + """ + The unique identifier of an ApiVersion. All supported API versions have a date-based (YYYY-MM) or `unstable` handle. + """ + handle: String! + + """ + Whether the version is actively supported by Shopify. Supported API versions are guaranteed to be stable. Unsupported API versions include unstable, release candidate, and end-of-life versions that are marked as unsupported. For more information, refer to [Versioning](https://shopify.dev/concepts/about-apis/versioning). + """ + supported: Boolean! +} + +""" +Details about the gift card used on the checkout. +""" +type AppliedGiftCard implements Node { + """ + The amount that was taken from the gift card by applying it. + """ + amountUsed: Money! @deprecated(reason: "Use `amountUsedV2` instead") + + """ + The amount that was taken from the gift card by applying it. + """ + amountUsedV2: MoneyV2! + + """ + The amount left on the gift card. + """ + balance: Money! @deprecated(reason: "Use `balanceV2` instead") + + """ + The amount left on the gift card. + """ + balanceV2: MoneyV2! + + """ + Globally unique identifier. + """ + id: ID! + + """ + The last characters of the gift card. + """ + lastCharacters: String! + + """ + The amount that was applied to the checkout in its currency. + """ + presentmentAmountUsed: MoneyV2! +} + +""" +An article in an online store blog. +""" +type Article implements Node { + """ + The article's author. + """ + author: ArticleAuthor! @deprecated(reason: "Use `authorV2` instead") + + """ + The article's author. + """ + authorV2: ArticleAuthor + + """ + The blog that the article belongs to. + """ + blog: Blog! + + """ + List of comments posted on the article. + """ + comments( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): CommentConnection! + + """ + Stripped content of the article, single line with HTML tags removed. + """ + content( + """ + Truncates string after the given length. + """ + truncateAt: Int + ): String! + + """ + The content of the article, complete with HTML formatting. + """ + contentHtml: HTML! + + """ + Stripped excerpt of the article, single line with HTML tags removed. + """ + excerpt( + """ + Truncates string after the given length. + """ + truncateAt: Int + ): String + + """ + The excerpt of the article, complete with HTML formatting. + """ + excerptHtml: HTML + + """ + A human-friendly unique string for the Article automatically generated from its title. + """ + handle: String! + + """ + Globally unique identifier. + """ + id: ID! + + """ + The image associated with the article. + """ + image( + """ + Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead. + """ + maxWidth: Int + + """ + Image height in pixels between 1 and 2048. This argument is deprecated: Use `maxHeight` on `Image.transformedSrc` instead. + """ + maxHeight: Int + + """ + Crops the image according to the specified region. This argument is deprecated: Use `crop` on `Image.transformedSrc` instead. + """ + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead. + """ + scale: Int = 1 + ): Image + + """ + The date and time when the article was published. + """ + publishedAt: DateTime! + + """ + The article’s SEO information. + """ + seo: SEO + + """ + A categorization that a article can be tagged with. + """ + tags: [String!]! + + """ + The article’s name. + """ + title: String! + + """ + The url pointing to the article accessible from the web. + """ + url: URL! +} + +""" +The author of an article. +""" +type ArticleAuthor { + """ + The author's bio. + """ + bio: String + + """ + The author’s email. + """ + email: String! + + """ + The author's first name. + """ + firstName: String! + + """ + The author's last name. + """ + lastName: String! + + """ + The author's full name. + """ + name: String! +} + +""" +An auto-generated type for paginating through multiple Articles. +""" +type ArticleConnection { + """ + A list of edges. + """ + edges: [ArticleEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Article and a cursor during pagination. +""" +type ArticleEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of ArticleEdge. + """ + node: Article! +} + +""" +The set of valid sort keys for the Article query. +""" +enum ArticleSortKeys { + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `blog_title` value. + """ + BLOG_TITLE + + """ + Sort by the `author` value. + """ + AUTHOR + + """ + Sort by the `updated_at` value. + """ + UPDATED_AT + + """ + Sort by the `published_at` value. + """ + PUBLISHED_AT + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +Represents a generic custom attribute. +""" +type Attribute { + """ + Key or name of the attribute. + """ + key: String! + + """ + Value of the attribute. + """ + value: String +} + +""" +Specifies the input fields required for an attribute. +""" +input AttributeInput { + """ + Key or name of the attribute. + """ + key: String! + + """ + Value of the attribute. + """ + value: String! +} + +""" +Automatic discount applications capture the intentions of a discount that was automatically applied. +""" +type AutomaticDiscountApplication implements DiscountApplication { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + Which lines of targetType that the discount is allocated over. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line that the discount is applicable towards. + """ + targetType: DiscountApplicationTargetType! + + """ + The title of the application. + """ + title: String! + + """ + The value of the discount application. + """ + value: PricingValue! +} + +""" +A collection of available shipping rates for a checkout. +""" +type AvailableShippingRates { + """ + Whether or not the shipping rates are ready. + The `shippingRates` field is `null` when this value is `false`. + This field should be polled until its value becomes `true`. + """ + ready: Boolean! + + """ + The fetched shipping rates. `null` until the `ready` field is `true`. + """ + shippingRates: [ShippingRate!] +} + +""" +An online store blog. +""" +type Blog implements Node { + """ + Find an article by its handle. + """ + articleByHandle( + """ + The handle of the article. + """ + handle: String! + ): Article + + """ + List of the blog's articles. + """ + articles( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ArticleSortKeys = ID + + """ + Supported filter parameters: + - `author` + - `blog_title` + - `created_at` + - `tag` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): ArticleConnection! + + """ + The authors who have contributed to the blog. + """ + authors: [ArticleAuthor!]! + + """ + A human-friendly unique string for the Blog automatically generated from its title. + """ + handle: String! + + """ + Globally unique identifier. + """ + id: ID! + + """ + The blog's SEO information. + """ + seo: SEO + + """ + The blogs’s title. + """ + title: String! + + """ + The url pointing to the blog accessible from the web. + """ + url: URL! +} + +""" +An auto-generated type for paginating through multiple Blogs. +""" +type BlogConnection { + """ + A list of edges. + """ + edges: [BlogEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Blog and a cursor during pagination. +""" +type BlogEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of BlogEdge. + """ + node: Blog! +} + +""" +The set of valid sort keys for the Blog query. +""" +enum BlogSortKeys { + """ + Sort by the `handle` value. + """ + HANDLE + + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +Card brand, such as Visa or Mastercard, which can be used for payments. +""" +enum CardBrand { + """ + Visa. + """ + VISA + + """ + Mastercard. + """ + MASTERCARD + + """ + Discover. + """ + DISCOVER + + """ + American Express. + """ + AMERICAN_EXPRESS + + """ + Diners Club. + """ + DINERS_CLUB + + """ + JCB. + """ + JCB +} + +""" +A container for all the information required to checkout items and pay. +""" +type Checkout implements Node { + """ + The gift cards used on the checkout. + """ + appliedGiftCards: [AppliedGiftCard!]! + + """ + The available shipping rates for this Checkout. + Should only be used when checkout `requiresShipping` is `true` and + the shipping address is valid. + """ + availableShippingRates: AvailableShippingRates + + """ + The date and time when the checkout was completed. + """ + completedAt: DateTime + + """ + The date and time when the checkout was created. + """ + createdAt: DateTime! + + """ + The currency code for the Checkout. + """ + currencyCode: CurrencyCode! + + """ + A list of extra information that is added to the checkout. + """ + customAttributes: [Attribute!]! + + """ + The customer associated with the checkout. + """ + customer: Customer + @deprecated( + reason: "This field will always return null. If you have an authentication token for the customer, you can use the `customer` field on the query root to retrieve it." + ) + + """ + Discounts that have been applied on the checkout. + """ + discountApplications( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): DiscountApplicationConnection! + + """ + The email attached to this checkout. + """ + email: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + A list of line item objects, each one containing information about an item in the checkout. + """ + lineItems( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): CheckoutLineItemConnection! + + """ + The sum of all the prices of all the items in the checkout. Duties, taxes, shipping and discounts excluded. + """ + lineItemsSubtotalPrice: MoneyV2! + + """ + The note associated with the checkout. + """ + note: String + + """ + The resulting order from a paid checkout. + """ + order: Order + + """ + The Order Status Page for this Checkout, null when checkout is not completed. + """ + orderStatusUrl: URL + + """ + The amount left to be paid. This is equal to the cost of the line items, taxes and shipping minus discounts and gift cards. + """ + paymentDue: Money! @deprecated(reason: "Use `paymentDueV2` instead") + + """ + The amount left to be paid. This is equal to the cost of the line items, duties, taxes and shipping minus discounts and gift cards. + """ + paymentDueV2: MoneyV2! + + """ + Whether or not the Checkout is ready and can be completed. Checkouts may + have asynchronous operations that can take time to finish. If you want + to complete a checkout or ensure all the fields are populated and up to + date, polling is required until the value is true. + """ + ready: Boolean! + + """ + States whether or not the fulfillment requires shipping. + """ + requiresShipping: Boolean! + + """ + The shipping address to where the line items will be shipped. + """ + shippingAddress: MailingAddress + + """ + The discounts that have been allocated onto the shipping line by discount applications. + """ + shippingDiscountAllocations: [DiscountAllocation!]! + + """ + Once a shipping rate is selected by the customer it is transitioned to a `shipping_line` object. + """ + shippingLine: ShippingRate + + """ + Price of the checkout before shipping and taxes. + """ + subtotalPrice: Money! @deprecated(reason: "Use `subtotalPriceV2` instead") + + """ + Price of the checkout before duties, shipping and taxes. + """ + subtotalPriceV2: MoneyV2! + + """ + Specifies if the Checkout is tax exempt. + """ + taxExempt: Boolean! + + """ + Specifies if taxes are included in the line item and shipping line prices. + """ + taxesIncluded: Boolean! + + """ + The sum of all the prices of all the items in the checkout, taxes and discounts included. + """ + totalPrice: Money! @deprecated(reason: "Use `totalPriceV2` instead") + + """ + The sum of all the prices of all the items in the checkout, duties, taxes and discounts included. + """ + totalPriceV2: MoneyV2! + + """ + The sum of all the taxes applied to the line items and shipping lines in the checkout. + """ + totalTax: Money! @deprecated(reason: "Use `totalTaxV2` instead") + + """ + The sum of all the taxes applied to the line items and shipping lines in the checkout. + """ + totalTaxV2: MoneyV2! + + """ + The date and time when the checkout was last updated. + """ + updatedAt: DateTime! + + """ + The url pointing to the checkout accessible from the web. + """ + webUrl: URL! +} + +""" +Specifies the fields required to update a checkout's attributes. +""" +input CheckoutAttributesUpdateInput { + """ + The text of an optional note that a shop owner can attach to the checkout. + """ + note: String + + """ + A list of extra information that is added to the checkout. + """ + customAttributes: [AttributeInput!] + + """ + Allows setting partial addresses on a Checkout, skipping the full validation of attributes. + The required attributes are city, province, and country. + Full validation of the addresses is still done at complete time. + """ + allowPartialAddresses: Boolean +} + +""" +Return type for `checkoutAttributesUpdate` mutation. +""" +type CheckoutAttributesUpdatePayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Specifies the fields required to update a checkout's attributes. +""" +input CheckoutAttributesUpdateV2Input { + """ + The text of an optional note that a shop owner can attach to the checkout. + """ + note: String + + """ + A list of extra information that is added to the checkout. + """ + customAttributes: [AttributeInput!] + + """ + Allows setting partial addresses on a Checkout, skipping the full validation of attributes. + The required attributes are city, province, and country. + Full validation of the addresses is still done at complete time. + """ + allowPartialAddresses: Boolean +} + +""" +Return type for `checkoutAttributesUpdateV2` mutation. +""" +type CheckoutAttributesUpdateV2Payload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCompleteFree` mutation. +""" +type CheckoutCompleteFreePayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCompleteWithCreditCard` mutation. +""" +type CheckoutCompleteWithCreditCardPayload { + """ + The checkout on which the payment was applied. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + A representation of the attempted payment. + """ + payment: Payment + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCompleteWithCreditCardV2` mutation. +""" +type CheckoutCompleteWithCreditCardV2Payload { + """ + The checkout on which the payment was applied. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + A representation of the attempted payment. + """ + payment: Payment + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCompleteWithTokenizedPayment` mutation. +""" +type CheckoutCompleteWithTokenizedPaymentPayload { + """ + The checkout on which the payment was applied. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + A representation of the attempted payment. + """ + payment: Payment + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCompleteWithTokenizedPaymentV2` mutation. +""" +type CheckoutCompleteWithTokenizedPaymentV2Payload { + """ + The checkout on which the payment was applied. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + A representation of the attempted payment. + """ + payment: Payment + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. +""" +type CheckoutCompleteWithTokenizedPaymentV3Payload { + """ + The checkout on which the payment was applied. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + A representation of the attempted payment. + """ + payment: Payment + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Specifies the fields required to create a checkout. +""" +input CheckoutCreateInput { + """ + The email with which the customer wants to checkout. + """ + email: String + + """ + A list of line item objects, each one containing information about an item in the checkout. + """ + lineItems: [CheckoutLineItemInput!] + + """ + The shipping address to where the line items will be shipped. + """ + shippingAddress: MailingAddressInput + + """ + The text of an optional note that a shop owner can attach to the checkout. + """ + note: String + + """ + A list of extra information that is added to the checkout. + """ + customAttributes: [AttributeInput!] + + """ + Allows setting partial addresses on a Checkout, skipping the full validation of attributes. + The required attributes are city, province, and country. + Full validation of addresses is still done at complete time. + """ + allowPartialAddresses: Boolean + + """ + The three-letter currency code of one of the shop's enabled presentment currencies. + Including this field creates a checkout in the specified currency. By default, new + checkouts are created in the shop's primary currency. + """ + presentmentCurrencyCode: CurrencyCode +} + +""" +Return type for `checkoutCreate` mutation. +""" +type CheckoutCreatePayload { + """ + The new checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCustomerAssociate` mutation. +""" +type CheckoutCustomerAssociatePayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + The associated customer object. + """ + customer: Customer + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! +} + +""" +Return type for `checkoutCustomerAssociateV2` mutation. +""" +type CheckoutCustomerAssociateV2Payload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + The associated customer object. + """ + customer: Customer + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCustomerDisassociate` mutation. +""" +type CheckoutCustomerDisassociatePayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCustomerDisassociateV2` mutation. +""" +type CheckoutCustomerDisassociateV2Payload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutDiscountCodeApply` mutation. +""" +type CheckoutDiscountCodeApplyPayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutDiscountCodeApplyV2` mutation. +""" +type CheckoutDiscountCodeApplyV2Payload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutDiscountCodeRemove` mutation. +""" +type CheckoutDiscountCodeRemovePayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutEmailUpdate` mutation. +""" +type CheckoutEmailUpdatePayload { + """ + The checkout object with the updated email. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutEmailUpdateV2` mutation. +""" +type CheckoutEmailUpdateV2Payload { + """ + The checkout object with the updated email. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Possible error codes that could be returned by CheckoutUserError. +""" +enum CheckoutErrorCode { + """ + Input value is blank. + """ + BLANK + + """ + Input value is invalid. + """ + INVALID + + """ + Input value is too long. + """ + TOO_LONG + + """ + Input value is not present. + """ + PRESENT + + """ + Input value should be less than maximum allowed value. + """ + LESS_THAN + + """ + Input value should be greater than or equal to minimum allowed value. + """ + GREATER_THAN_OR_EQUAL_TO + + """ + Input value should be less or equal to maximum allowed value. + """ + LESS_THAN_OR_EQUAL_TO + + """ + Checkout is already completed. + """ + ALREADY_COMPLETED + + """ + Checkout is locked. + """ + LOCKED + + """ + Input value is not supported. + """ + NOT_SUPPORTED + + """ + Input email contains an invalid domain name. + """ + BAD_DOMAIN + + """ + Input Zip is invalid for country provided. + """ + INVALID_FOR_COUNTRY + + """ + Input Zip is invalid for country and province provided. + """ + INVALID_FOR_COUNTRY_AND_PROVINCE + + """ + Invalid state in country. + """ + INVALID_STATE_IN_COUNTRY + + """ + Invalid province in country. + """ + INVALID_PROVINCE_IN_COUNTRY + + """ + Invalid region in country. + """ + INVALID_REGION_IN_COUNTRY + + """ + Shipping rate expired. + """ + SHIPPING_RATE_EXPIRED + + """ + Gift card cannot be applied to a checkout that contains a gift card. + """ + GIFT_CARD_UNUSABLE + + """ + Gift card is disabled. + """ + GIFT_CARD_DISABLED + + """ + Gift card code is invalid. + """ + GIFT_CARD_CODE_INVALID + + """ + Gift card has already been applied. + """ + GIFT_CARD_ALREADY_APPLIED + + """ + Gift card currency does not match checkout currency. + """ + GIFT_CARD_CURRENCY_MISMATCH + + """ + Gift card is expired. + """ + GIFT_CARD_EXPIRED + + """ + Gift card has no funds left. + """ + GIFT_CARD_DEPLETED + + """ + Gift card was not found. + """ + GIFT_CARD_NOT_FOUND + + """ + Cart does not meet discount requirements notice. + """ + CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE + + """ + Discount expired. + """ + DISCOUNT_EXPIRED + + """ + Discount disabled. + """ + DISCOUNT_DISABLED + + """ + Discount limit reached. + """ + DISCOUNT_LIMIT_REACHED + + """ + Discount not found. + """ + DISCOUNT_NOT_FOUND + + """ + Customer already used once per customer discount notice. + """ + CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE + + """ + Checkout is already completed. + """ + EMPTY + + """ + Not enough in stock. + """ + NOT_ENOUGH_IN_STOCK + + """ + Missing payment input. + """ + MISSING_PAYMENT_INPUT + + """ + The amount of the payment does not match the value to be paid. + """ + TOTAL_PRICE_MISMATCH + + """ + Line item was not found in checkout. + """ + LINE_ITEM_NOT_FOUND + + """ + Unable to apply discount. + """ + UNABLE_TO_APPLY + + """ + Discount already applied. + """ + DISCOUNT_ALREADY_APPLIED +} + +""" +Return type for `checkoutGiftCardApply` mutation. +""" +type CheckoutGiftCardApplyPayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutGiftCardRemove` mutation. +""" +type CheckoutGiftCardRemovePayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutGiftCardRemoveV2` mutation. +""" +type CheckoutGiftCardRemoveV2Payload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutGiftCardsAppend` mutation. +""" +type CheckoutGiftCardsAppendPayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +A single line item in the checkout, grouped by variant and attributes. +""" +type CheckoutLineItem implements Node { + """ + Extra information in the form of an array of Key-Value pairs about the line item. + """ + customAttributes: [Attribute!]! + + """ + The discounts that have been allocated onto the checkout line item by discount applications. + """ + discountAllocations: [DiscountAllocation!]! + + """ + Globally unique identifier. + """ + id: ID! + + """ + The quantity of the line item. + """ + quantity: Int! + + """ + Title of the line item. Defaults to the product's title. + """ + title: String! + + """ + Unit price of the line item. + """ + unitPrice: MoneyV2 + + """ + Product variant of the line item. + """ + variant: ProductVariant +} + +""" +An auto-generated type for paginating through multiple CheckoutLineItems. +""" +type CheckoutLineItemConnection { + """ + A list of edges. + """ + edges: [CheckoutLineItemEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one CheckoutLineItem and a cursor during pagination. +""" +type CheckoutLineItemEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of CheckoutLineItemEdge. + """ + node: CheckoutLineItem! +} + +""" +Specifies the input fields to create a line item on a checkout. +""" +input CheckoutLineItemInput { + """ + Extra information in the form of an array of Key-Value pairs about the line item. + """ + customAttributes: [AttributeInput!] + + """ + The quantity of the line item. + """ + quantity: Int! + + """ + The identifier of the product variant for the line item. + """ + variantId: ID! +} + +""" +Specifies the input fields to update a line item on the checkout. +""" +input CheckoutLineItemUpdateInput { + """ + The identifier of the line item. + """ + id: ID + + """ + The variant identifier of the line item. + """ + variantId: ID + + """ + The quantity of the line item. + """ + quantity: Int + + """ + Extra information in the form of an array of Key-Value pairs about the line item. + """ + customAttributes: [AttributeInput!] +} + +""" +Return type for `checkoutLineItemsAdd` mutation. +""" +type CheckoutLineItemsAddPayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutLineItemsRemove` mutation. +""" +type CheckoutLineItemsRemovePayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutLineItemsReplace` mutation. +""" +type CheckoutLineItemsReplacePayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [CheckoutUserError!]! +} + +""" +Return type for `checkoutLineItemsUpdate` mutation. +""" +type CheckoutLineItemsUpdatePayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutShippingAddressUpdate` mutation. +""" +type CheckoutShippingAddressUpdatePayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutShippingAddressUpdateV2` mutation. +""" +type CheckoutShippingAddressUpdateV2Payload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutShippingLineUpdate` mutation. +""" +type CheckoutShippingLineUpdatePayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Represents an error that happens during execution of a checkout mutation. +""" +type CheckoutUserError implements DisplayableError { + """ + Error code to uniquely identify the error. + """ + code: CheckoutErrorCode + + """ + Path to the input field which caused the error. + """ + field: [String!] + + """ + The error message. + """ + message: String! +} + +""" +A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. +""" +type Collection implements Node { + """ + Stripped description of the collection, single line with HTML tags removed. + """ + description( + """ + Truncates string after the given length. + """ + truncateAt: Int + ): String! + + """ + The description of the collection, complete with HTML formatting. + """ + descriptionHtml: HTML! + + """ + A human-friendly unique string for the collection automatically generated from its title. + Limit of 255 characters. + """ + handle: String! + + """ + Globally unique identifier. + """ + id: ID! + + """ + Image associated with the collection. + """ + image( + """ + Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead. + """ + maxWidth: Int + + """ + Image height in pixels between 1 and 2048. This argument is deprecated: Use `maxHeight` on `Image.transformedSrc` instead. + """ + maxHeight: Int + + """ + Crops the image according to the specified region. This argument is deprecated: Use `crop` on `Image.transformedSrc` instead. + """ + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead. + """ + scale: Int = 1 + ): Image + + """ + List of products in the collection. + """ + products( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ProductCollectionSortKeys = COLLECTION_DEFAULT + ): ProductConnection! + + """ + The collection’s name. Limit of 255 characters. + """ + title: String! + + """ + The date and time when the collection was last modified. + """ + updatedAt: DateTime! +} + +""" +An auto-generated type for paginating through multiple Collections. +""" +type CollectionConnection { + """ + A list of edges. + """ + edges: [CollectionEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Collection and a cursor during pagination. +""" +type CollectionEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of CollectionEdge. + """ + node: Collection! +} + +""" +The set of valid sort keys for the Collection query. +""" +enum CollectionSortKeys { + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `updated_at` value. + """ + UPDATED_AT + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +A comment on an article. +""" +type Comment implements Node { + """ + The comment’s author. + """ + author: CommentAuthor! + + """ + Stripped content of the comment, single line with HTML tags removed. + """ + content( + """ + Truncates string after the given length. + """ + truncateAt: Int + ): String! + + """ + The content of the comment, complete with HTML formatting. + """ + contentHtml: HTML! + + """ + Globally unique identifier. + """ + id: ID! +} + +""" +The author of a comment. +""" +type CommentAuthor { + """ + The author's email. + """ + email: String! + + """ + The author’s name. + """ + name: String! +} + +""" +An auto-generated type for paginating through multiple Comments. +""" +type CommentConnection { + """ + A list of edges. + """ + edges: [CommentEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Comment and a cursor during pagination. +""" +type CommentEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of CommentEdge. + """ + node: Comment! +} + +""" +ISO 3166-1 alpha-2 country codes with some differences. +""" +enum CountryCode { + """ + Afghanistan. + """ + AF + + """ + Åland Islands. + """ + AX + + """ + Albania. + """ + AL + + """ + Algeria. + """ + DZ + + """ + Andorra. + """ + AD + + """ + Angola. + """ + AO + + """ + Anguilla. + """ + AI + + """ + Antigua & Barbuda. + """ + AG + + """ + Argentina. + """ + AR + + """ + Armenia. + """ + AM + + """ + Aruba. + """ + AW + + """ + Ascension Island. + """ + AC + + """ + Australia. + """ + AU + + """ + Austria. + """ + AT + + """ + Azerbaijan. + """ + AZ + + """ + Bahamas. + """ + BS + + """ + Bahrain. + """ + BH + + """ + Bangladesh. + """ + BD + + """ + Barbados. + """ + BB + + """ + Belarus. + """ + BY + + """ + Belgium. + """ + BE + + """ + Belize. + """ + BZ + + """ + Benin. + """ + BJ + + """ + Bermuda. + """ + BM + + """ + Bhutan. + """ + BT + + """ + Bolivia. + """ + BO + + """ + Bosnia & Herzegovina. + """ + BA + + """ + Botswana. + """ + BW + + """ + Bouvet Island. + """ + BV + + """ + Brazil. + """ + BR + + """ + British Indian Ocean Territory. + """ + IO + + """ + Brunei. + """ + BN + + """ + Bulgaria. + """ + BG + + """ + Burkina Faso. + """ + BF + + """ + Burundi. + """ + BI + + """ + Cambodia. + """ + KH + + """ + Canada. + """ + CA + + """ + Cape Verde. + """ + CV + + """ + Caribbean Netherlands. + """ + BQ + + """ + Cayman Islands. + """ + KY + + """ + Central African Republic. + """ + CF + + """ + Chad. + """ + TD + + """ + Chile. + """ + CL + + """ + China. + """ + CN + + """ + Christmas Island. + """ + CX + + """ + Cocos (Keeling) Islands. + """ + CC + + """ + Colombia. + """ + CO + + """ + Comoros. + """ + KM + + """ + Congo - Brazzaville. + """ + CG + + """ + Congo - Kinshasa. + """ + CD + + """ + Cook Islands. + """ + CK + + """ + Costa Rica. + """ + CR + + """ + Croatia. + """ + HR + + """ + Cuba. + """ + CU + + """ + Curaçao. + """ + CW + + """ + Cyprus. + """ + CY + + """ + Czechia. + """ + CZ + + """ + Côte d’Ivoire. + """ + CI + + """ + Denmark. + """ + DK + + """ + Djibouti. + """ + DJ + + """ + Dominica. + """ + DM + + """ + Dominican Republic. + """ + DO + + """ + Ecuador. + """ + EC + + """ + Egypt. + """ + EG + + """ + El Salvador. + """ + SV + + """ + Equatorial Guinea. + """ + GQ + + """ + Eritrea. + """ + ER + + """ + Estonia. + """ + EE + + """ + Eswatini. + """ + SZ + + """ + Ethiopia. + """ + ET + + """ + Falkland Islands. + """ + FK + + """ + Faroe Islands. + """ + FO + + """ + Fiji. + """ + FJ + + """ + Finland. + """ + FI + + """ + France. + """ + FR + + """ + French Guiana. + """ + GF + + """ + French Polynesia. + """ + PF + + """ + French Southern Territories. + """ + TF + + """ + Gabon. + """ + GA + + """ + Gambia. + """ + GM + + """ + Georgia. + """ + GE + + """ + Germany. + """ + DE + + """ + Ghana. + """ + GH + + """ + Gibraltar. + """ + GI + + """ + Greece. + """ + GR + + """ + Greenland. + """ + GL + + """ + Grenada. + """ + GD + + """ + Guadeloupe. + """ + GP + + """ + Guatemala. + """ + GT + + """ + Guernsey. + """ + GG + + """ + Guinea. + """ + GN + + """ + Guinea-Bissau. + """ + GW + + """ + Guyana. + """ + GY + + """ + Haiti. + """ + HT + + """ + Heard & McDonald Islands. + """ + HM + + """ + Vatican City. + """ + VA + + """ + Honduras. + """ + HN + + """ + Hong Kong SAR. + """ + HK + + """ + Hungary. + """ + HU + + """ + Iceland. + """ + IS + + """ + India. + """ + IN + + """ + Indonesia. + """ + ID + + """ + Iran. + """ + IR + + """ + Iraq. + """ + IQ + + """ + Ireland. + """ + IE + + """ + Isle of Man. + """ + IM + + """ + Israel. + """ + IL + + """ + Italy. + """ + IT + + """ + Jamaica. + """ + JM + + """ + Japan. + """ + JP + + """ + Jersey. + """ + JE + + """ + Jordan. + """ + JO + + """ + Kazakhstan. + """ + KZ + + """ + Kenya. + """ + KE + + """ + Kiribati. + """ + KI + + """ + North Korea. + """ + KP + + """ + Kosovo. + """ + XK + + """ + Kuwait. + """ + KW + + """ + Kyrgyzstan. + """ + KG + + """ + Laos. + """ + LA + + """ + Latvia. + """ + LV + + """ + Lebanon. + """ + LB + + """ + Lesotho. + """ + LS + + """ + Liberia. + """ + LR + + """ + Libya. + """ + LY + + """ + Liechtenstein. + """ + LI + + """ + Lithuania. + """ + LT + + """ + Luxembourg. + """ + LU + + """ + Macao SAR. + """ + MO + + """ + Madagascar. + """ + MG + + """ + Malawi. + """ + MW + + """ + Malaysia. + """ + MY + + """ + Maldives. + """ + MV + + """ + Mali. + """ + ML + + """ + Malta. + """ + MT + + """ + Martinique. + """ + MQ + + """ + Mauritania. + """ + MR + + """ + Mauritius. + """ + MU + + """ + Mayotte. + """ + YT + + """ + Mexico. + """ + MX + + """ + Moldova. + """ + MD + + """ + Monaco. + """ + MC + + """ + Mongolia. + """ + MN + + """ + Montenegro. + """ + ME + + """ + Montserrat. + """ + MS + + """ + Morocco. + """ + MA + + """ + Mozambique. + """ + MZ + + """ + Myanmar (Burma). + """ + MM + + """ + Namibia. + """ + NA + + """ + Nauru. + """ + NR + + """ + Nepal. + """ + NP + + """ + Netherlands. + """ + NL + + """ + Netherlands Antilles. + """ + AN + + """ + New Caledonia. + """ + NC + + """ + New Zealand. + """ + NZ + + """ + Nicaragua. + """ + NI + + """ + Niger. + """ + NE + + """ + Nigeria. + """ + NG + + """ + Niue. + """ + NU + + """ + Norfolk Island. + """ + NF + + """ + North Macedonia. + """ + MK + + """ + Norway. + """ + NO + + """ + Oman. + """ + OM + + """ + Pakistan. + """ + PK + + """ + Palestinian Territories. + """ + PS + + """ + Panama. + """ + PA + + """ + Papua New Guinea. + """ + PG + + """ + Paraguay. + """ + PY + + """ + Peru. + """ + PE + + """ + Philippines. + """ + PH + + """ + Pitcairn Islands. + """ + PN + + """ + Poland. + """ + PL + + """ + Portugal. + """ + PT + + """ + Qatar. + """ + QA + + """ + Cameroon. + """ + CM + + """ + Réunion. + """ + RE + + """ + Romania. + """ + RO + + """ + Russia. + """ + RU + + """ + Rwanda. + """ + RW + + """ + St. Barthélemy. + """ + BL + + """ + St. Helena. + """ + SH + + """ + St. Kitts & Nevis. + """ + KN + + """ + St. Lucia. + """ + LC + + """ + St. Martin. + """ + MF + + """ + St. Pierre & Miquelon. + """ + PM + + """ + Samoa. + """ + WS + + """ + San Marino. + """ + SM + + """ + São Tomé & Príncipe. + """ + ST + + """ + Saudi Arabia. + """ + SA + + """ + Senegal. + """ + SN + + """ + Serbia. + """ + RS + + """ + Seychelles. + """ + SC + + """ + Sierra Leone. + """ + SL + + """ + Singapore. + """ + SG + + """ + Sint Maarten. + """ + SX + + """ + Slovakia. + """ + SK + + """ + Slovenia. + """ + SI + + """ + Solomon Islands. + """ + SB + + """ + Somalia. + """ + SO + + """ + South Africa. + """ + ZA + + """ + South Georgia & South Sandwich Islands. + """ + GS + + """ + South Korea. + """ + KR + + """ + South Sudan. + """ + SS + + """ + Spain. + """ + ES + + """ + Sri Lanka. + """ + LK + + """ + St. Vincent & Grenadines. + """ + VC + + """ + Sudan. + """ + SD + + """ + Suriname. + """ + SR + + """ + Svalbard & Jan Mayen. + """ + SJ + + """ + Sweden. + """ + SE + + """ + Switzerland. + """ + CH + + """ + Syria. + """ + SY + + """ + Taiwan. + """ + TW + + """ + Tajikistan. + """ + TJ + + """ + Tanzania. + """ + TZ + + """ + Thailand. + """ + TH + + """ + Timor-Leste. + """ + TL + + """ + Togo. + """ + TG + + """ + Tokelau. + """ + TK + + """ + Tonga. + """ + TO + + """ + Trinidad & Tobago. + """ + TT + + """ + Tristan da Cunha. + """ + TA + + """ + Tunisia. + """ + TN + + """ + Turkey. + """ + TR + + """ + Turkmenistan. + """ + TM + + """ + Turks & Caicos Islands. + """ + TC + + """ + Tuvalu. + """ + TV + + """ + Uganda. + """ + UG + + """ + Ukraine. + """ + UA + + """ + United Arab Emirates. + """ + AE + + """ + United Kingdom. + """ + GB + + """ + United States. + """ + US + + """ + U.S. Outlying Islands. + """ + UM + + """ + Uruguay. + """ + UY + + """ + Uzbekistan. + """ + UZ + + """ + Vanuatu. + """ + VU + + """ + Venezuela. + """ + VE + + """ + Vietnam. + """ + VN + + """ + British Virgin Islands. + """ + VG + + """ + Wallis & Futuna. + """ + WF + + """ + Western Sahara. + """ + EH + + """ + Yemen. + """ + YE + + """ + Zambia. + """ + ZM + + """ + Zimbabwe. + """ + ZW +} + +""" +Credit card information used for a payment. +""" +type CreditCard { + """ + The brand of the credit card. + """ + brand: String + + """ + The expiry month of the credit card. + """ + expiryMonth: Int + + """ + The expiry year of the credit card. + """ + expiryYear: Int + + """ + The credit card's BIN number. + """ + firstDigits: String + + """ + The first name of the card holder. + """ + firstName: String + + """ + The last 4 digits of the credit card. + """ + lastDigits: String + + """ + The last name of the card holder. + """ + lastName: String + + """ + The masked credit card number with only the last 4 digits displayed. + """ + maskedNumber: String +} + +""" +Specifies the fields required to complete a checkout with +a Shopify vaulted credit card payment. +""" +input CreditCardPaymentInput { + """ + The amount of the payment. + """ + amount: Money! + + """ + A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). + """ + idempotencyKey: String! + + """ + The billing address for the payment. + """ + billingAddress: MailingAddressInput! + + """ + The ID returned by Shopify's Card Vault. + """ + vaultId: String! + + """ + Executes the payment in test mode if possible. Defaults to `false`. + """ + test: Boolean +} + +""" +Specifies the fields required to complete a checkout with +a Shopify vaulted credit card payment. +""" +input CreditCardPaymentInputV2 { + """ + The amount and currency of the payment. + """ + paymentAmount: MoneyInput! + + """ + A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). + """ + idempotencyKey: String! + + """ + The billing address for the payment. + """ + billingAddress: MailingAddressInput! + + """ + The ID returned by Shopify's Card Vault. + """ + vaultId: String! + + """ + Executes the payment in test mode if possible. Defaults to `false`. + """ + test: Boolean +} + +""" +The part of the image that should remain after cropping. +""" +enum CropRegion { + """ + Keep the center of the image. + """ + CENTER + + """ + Keep the top of the image. + """ + TOP + + """ + Keep the bottom of the image. + """ + BOTTOM + + """ + Keep the left of the image. + """ + LEFT + + """ + Keep the right of the image. + """ + RIGHT +} + +""" +Currency codes. +""" +enum CurrencyCode { + """ + United States Dollars (USD). + """ + USD + + """ + Euro (EUR). + """ + EUR + + """ + United Kingdom Pounds (GBP). + """ + GBP + + """ + Canadian Dollars (CAD). + """ + CAD + + """ + Afghan Afghani (AFN). + """ + AFN + + """ + Albanian Lek (ALL). + """ + ALL + + """ + Algerian Dinar (DZD). + """ + DZD + + """ + Angolan Kwanza (AOA). + """ + AOA + + """ + Argentine Pesos (ARS). + """ + ARS + + """ + Armenian Dram (AMD). + """ + AMD + + """ + Aruban Florin (AWG). + """ + AWG + + """ + Australian Dollars (AUD). + """ + AUD + + """ + Barbadian Dollar (BBD). + """ + BBD + + """ + Azerbaijani Manat (AZN). + """ + AZN + + """ + Bangladesh Taka (BDT). + """ + BDT + + """ + Bahamian Dollar (BSD). + """ + BSD + + """ + Bahraini Dinar (BHD). + """ + BHD + + """ + Burundian Franc (BIF). + """ + BIF + + """ + Belize Dollar (BZD). + """ + BZD + + """ + Bermudian Dollar (BMD). + """ + BMD + + """ + Bhutanese Ngultrum (BTN). + """ + BTN + + """ + Bosnia and Herzegovina Convertible Mark (BAM). + """ + BAM + + """ + Brazilian Real (BRL). + """ + BRL + + """ + Bolivian Boliviano (BOB). + """ + BOB + + """ + Botswana Pula (BWP). + """ + BWP + + """ + Brunei Dollar (BND). + """ + BND + + """ + Bulgarian Lev (BGN). + """ + BGN + + """ + Burmese Kyat (MMK). + """ + MMK + + """ + Cambodian Riel. + """ + KHR + + """ + Cape Verdean escudo (CVE). + """ + CVE + + """ + Cayman Dollars (KYD). + """ + KYD + + """ + Central African CFA Franc (XAF). + """ + XAF + + """ + Chilean Peso (CLP). + """ + CLP + + """ + Chinese Yuan Renminbi (CNY). + """ + CNY + + """ + Colombian Peso (COP). + """ + COP + + """ + Comorian Franc (KMF). + """ + KMF + + """ + Congolese franc (CDF). + """ + CDF + + """ + Costa Rican Colones (CRC). + """ + CRC + + """ + Croatian Kuna (HRK). + """ + HRK + + """ + Czech Koruny (CZK). + """ + CZK + + """ + Danish Kroner (DKK). + """ + DKK + + """ + Dominican Peso (DOP). + """ + DOP + + """ + East Caribbean Dollar (XCD). + """ + XCD + + """ + Egyptian Pound (EGP). + """ + EGP + + """ + Ethiopian Birr (ETB). + """ + ETB + + """ + CFP Franc (XPF). + """ + XPF + + """ + Fijian Dollars (FJD). + """ + FJD + + """ + Gambian Dalasi (GMD). + """ + GMD + + """ + Ghanaian Cedi (GHS). + """ + GHS + + """ + Guatemalan Quetzal (GTQ). + """ + GTQ + + """ + Guyanese Dollar (GYD). + """ + GYD + + """ + Georgian Lari (GEL). + """ + GEL + + """ + Haitian Gourde (HTG). + """ + HTG + + """ + Honduran Lempira (HNL). + """ + HNL + + """ + Hong Kong Dollars (HKD). + """ + HKD + + """ + Hungarian Forint (HUF). + """ + HUF + + """ + Icelandic Kronur (ISK). + """ + ISK + + """ + Indian Rupees (INR). + """ + INR + + """ + Indonesian Rupiah (IDR). + """ + IDR + + """ + Israeli New Shekel (NIS). + """ + ILS + + """ + Iraqi Dinar (IQD). + """ + IQD + + """ + Jamaican Dollars (JMD). + """ + JMD + + """ + Japanese Yen (JPY). + """ + JPY + + """ + Jersey Pound. + """ + JEP + + """ + Jordanian Dinar (JOD). + """ + JOD + + """ + Kazakhstani Tenge (KZT). + """ + KZT + + """ + Kenyan Shilling (KES). + """ + KES + + """ + Kuwaiti Dinar (KWD). + """ + KWD + + """ + Kyrgyzstani Som (KGS). + """ + KGS + + """ + Laotian Kip (LAK). + """ + LAK + + """ + Latvian Lati (LVL). + """ + LVL + + """ + Lebanese Pounds (LBP). + """ + LBP + + """ + Lesotho Loti (LSL). + """ + LSL + + """ + Liberian Dollar (LRD). + """ + LRD + + """ + Lithuanian Litai (LTL). + """ + LTL + + """ + Malagasy Ariary (MGA). + """ + MGA + + """ + Macedonia Denar (MKD). + """ + MKD + + """ + Macanese Pataca (MOP). + """ + MOP + + """ + Malawian Kwacha (MWK). + """ + MWK + + """ + Maldivian Rufiyaa (MVR). + """ + MVR + + """ + Mexican Pesos (MXN). + """ + MXN + + """ + Malaysian Ringgits (MYR). + """ + MYR + + """ + Mauritian Rupee (MUR). + """ + MUR + + """ + Moldovan Leu (MDL). + """ + MDL + + """ + Moroccan Dirham. + """ + MAD + + """ + Mongolian Tugrik. + """ + MNT + + """ + Mozambican Metical. + """ + MZN + + """ + Namibian Dollar. + """ + NAD + + """ + Nepalese Rupee (NPR). + """ + NPR + + """ + Netherlands Antillean Guilder. + """ + ANG + + """ + New Zealand Dollars (NZD). + """ + NZD + + """ + Nicaraguan Córdoba (NIO). + """ + NIO + + """ + Nigerian Naira (NGN). + """ + NGN + + """ + Norwegian Kroner (NOK). + """ + NOK + + """ + Omani Rial (OMR). + """ + OMR + + """ + Panamian Balboa (PAB). + """ + PAB + + """ + Pakistani Rupee (PKR). + """ + PKR + + """ + Papua New Guinean Kina (PGK). + """ + PGK + + """ + Paraguayan Guarani (PYG). + """ + PYG + + """ + Peruvian Nuevo Sol (PEN). + """ + PEN + + """ + Philippine Peso (PHP). + """ + PHP + + """ + Polish Zlotych (PLN). + """ + PLN + + """ + Qatari Rial (QAR). + """ + QAR + + """ + Romanian Lei (RON). + """ + RON + + """ + Russian Rubles (RUB). + """ + RUB + + """ + Rwandan Franc (RWF). + """ + RWF + + """ + Samoan Tala (WST). + """ + WST + + """ + Saudi Riyal (SAR). + """ + SAR + + """ + Sao Tome And Principe Dobra (STD). + """ + STD + + """ + Serbian dinar (RSD). + """ + RSD + + """ + Seychellois Rupee (SCR). + """ + SCR + + """ + Singapore Dollars (SGD). + """ + SGD + + """ + Sudanese Pound (SDG). + """ + SDG + + """ + Syrian Pound (SYP). + """ + SYP + + """ + South African Rand (ZAR). + """ + ZAR + + """ + South Korean Won (KRW). + """ + KRW + + """ + South Sudanese Pound (SSP). + """ + SSP + + """ + Solomon Islands Dollar (SBD). + """ + SBD + + """ + Sri Lankan Rupees (LKR). + """ + LKR + + """ + Surinamese Dollar (SRD). + """ + SRD + + """ + Swazi Lilangeni (SZL). + """ + SZL + + """ + Swedish Kronor (SEK). + """ + SEK + + """ + Swiss Francs (CHF). + """ + CHF + + """ + Taiwan Dollars (TWD). + """ + TWD + + """ + Thai baht (THB). + """ + THB + + """ + Tanzanian Shilling (TZS). + """ + TZS + + """ + Trinidad and Tobago Dollars (TTD). + """ + TTD + + """ + Tunisian Dinar (TND). + """ + TND + + """ + Turkish Lira (TRY). + """ + TRY + + """ + Turkmenistani Manat (TMT). + """ + TMT + + """ + Ugandan Shilling (UGX). + """ + UGX + + """ + Ukrainian Hryvnia (UAH). + """ + UAH + + """ + United Arab Emirates Dirham (AED). + """ + AED + + """ + Uruguayan Pesos (UYU). + """ + UYU + + """ + Uzbekistan som (UZS). + """ + UZS + + """ + Vanuatu Vatu (VUV). + """ + VUV + + """ + Vietnamese đồng (VND). + """ + VND + + """ + West African CFA franc (XOF). + """ + XOF + + """ + Yemeni Rial (YER). + """ + YER + + """ + Zambian Kwacha (ZMW). + """ + ZMW + + """ + Belarusian Ruble (BYN). + """ + BYN + + """ + Belarusian Ruble (BYR). + """ + BYR + + """ + Djiboutian Franc (DJF). + """ + DJF + + """ + Eritrean Nakfa (ERN). + """ + ERN + + """ + Falkland Islands Pounds (FKP). + """ + FKP + + """ + Gibraltar Pounds (GIP). + """ + GIP + + """ + Guinean Franc (GNF). + """ + GNF + + """ + Iranian Rial (IRR). + """ + IRR + + """ + Kiribati Dollar (KID). + """ + KID + + """ + Libyan Dinar (LYD). + """ + LYD + + """ + Mauritanian Ouguiya (MRU). + """ + MRU + + """ + Sierra Leonean Leone (SLL). + """ + SLL + + """ + Saint Helena Pounds (SHP). + """ + SHP + + """ + Somali Shilling (SOS). + """ + SOS + + """ + Tajikistani Somoni (TJS). + """ + TJS + + """ + Tongan Pa'anga (TOP). + """ + TOP + + """ + Venezuelan Bolivares (VEF). + """ + VEF + + """ + Venezuelan Bolivares (VES). + """ + VES +} + +""" +A customer represents a customer account with the shop. Customer accounts store contact information for the customer, saving logged-in customers the trouble of having to provide it at every checkout. +""" +type Customer { + """ + Indicates whether the customer has consented to be sent marketing material via email. + """ + acceptsMarketing: Boolean! + + """ + A list of addresses for the customer. + """ + addresses( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): MailingAddressConnection! + + """ + The date and time when the customer was created. + """ + createdAt: DateTime! + + """ + The customer’s default address. + """ + defaultAddress: MailingAddress + + """ + The customer’s name, email or phone number. + """ + displayName: String! + + """ + The customer’s email address. + """ + email: String + + """ + The customer’s first name. + """ + firstName: String + + """ + A unique identifier for the customer. + """ + id: ID! + + """ + The customer's most recently updated, incomplete checkout. + """ + lastIncompleteCheckout: Checkout + + """ + The customer’s last name. + """ + lastName: String + + """ + The orders associated with the customer. + """ + orders( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: OrderSortKeys = ID + + """ + Supported filter parameters: + - `processed_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): OrderConnection! + + """ + The customer’s phone number. + """ + phone: String + + """ + A comma separated list of tags that have been added to the customer. + Additional access scope required: unauthenticated_read_customer_tags. + """ + tags: [String!]! + + """ + The date and time when the customer information was updated. + """ + updatedAt: DateTime! +} + +""" +A CustomerAccessToken represents the unique token required to make modifications to the customer object. +""" +type CustomerAccessToken { + """ + The customer’s access token. + """ + accessToken: String! + + """ + The date and time when the customer access token expires. + """ + expiresAt: DateTime! +} + +""" +Specifies the input fields required to create a customer access token. +""" +input CustomerAccessTokenCreateInput { + """ + The email associated to the customer. + """ + email: String! + + """ + The login password to be used by the customer. + """ + password: String! +} + +""" +Return type for `customerAccessTokenCreate` mutation. +""" +type CustomerAccessTokenCreatePayload { + """ + The newly created customer access token object. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Return type for `customerAccessTokenCreateWithMultipass` mutation. +""" +type CustomerAccessTokenCreateWithMultipassPayload { + """ + An access token object associated with the customer. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! +} + +""" +Return type for `customerAccessTokenDelete` mutation. +""" +type CustomerAccessTokenDeletePayload { + """ + The destroyed access token. + """ + deletedAccessToken: String + + """ + ID of the destroyed customer access token. + """ + deletedCustomerAccessTokenId: String + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! +} + +""" +Return type for `customerAccessTokenRenew` mutation. +""" +type CustomerAccessTokenRenewPayload { + """ + The renewed customer access token object. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! +} + +""" +Return type for `customerActivateByUrl` mutation. +""" +type CustomerActivateByUrlPayload { + """ + The customer that was activated. + """ + customer: Customer + + """ + A new customer access token for the customer. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! +} + +""" +Specifies the input fields required to activate a customer. +""" +input CustomerActivateInput { + """ + The activation token required to activate the customer. + """ + activationToken: String! + + """ + New password that will be set during activation. + """ + password: String! +} + +""" +Return type for `customerActivate` mutation. +""" +type CustomerActivatePayload { + """ + The customer object. + """ + customer: Customer + + """ + A newly created customer access token object for the customer. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Return type for `customerAddressCreate` mutation. +""" +type CustomerAddressCreatePayload { + """ + The new customer address object. + """ + customerAddress: MailingAddress + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Return type for `customerAddressDelete` mutation. +""" +type CustomerAddressDeletePayload { + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + ID of the deleted customer address. + """ + deletedCustomerAddressId: String + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Return type for `customerAddressUpdate` mutation. +""" +type CustomerAddressUpdatePayload { + """ + The customer’s updated mailing address. + """ + customerAddress: MailingAddress + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Specifies the fields required to create a new customer. +""" +input CustomerCreateInput { + """ + The customer’s first name. + """ + firstName: String + + """ + The customer’s last name. + """ + lastName: String + + """ + The customer’s email. + """ + email: String! + + """ + A unique phone number for the customer. + + Formatted using E.164 standard. For example, _+16135551111_. + """ + phone: String + + """ + The login password used by the customer. + """ + password: String! + + """ + Indicates whether the customer has consented to be sent marketing material via email. + """ + acceptsMarketing: Boolean +} + +""" +Return type for `customerCreate` mutation. +""" +type CustomerCreatePayload { + """ + The created customer object. + """ + customer: Customer + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Return type for `customerDefaultAddressUpdate` mutation. +""" +type CustomerDefaultAddressUpdatePayload { + """ + The updated customer object. + """ + customer: Customer + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Possible error codes that could be returned by CustomerUserError. +""" +enum CustomerErrorCode { + """ + Input value is blank. + """ + BLANK + + """ + Input value is invalid. + """ + INVALID + + """ + Input value is already taken. + """ + TAKEN + + """ + Input value is too long. + """ + TOO_LONG + + """ + Input value is too short. + """ + TOO_SHORT + + """ + Unidentified customer. + """ + UNIDENTIFIED_CUSTOMER + + """ + Customer is disabled. + """ + CUSTOMER_DISABLED + + """ + Input password starts or ends with whitespace. + """ + PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE + + """ + Input contains HTML tags. + """ + CONTAINS_HTML_TAGS + + """ + Input contains URL. + """ + CONTAINS_URL + + """ + Invalid activation token. + """ + TOKEN_INVALID + + """ + Customer already enabled. + """ + ALREADY_ENABLED + + """ + Address does not exist. + """ + NOT_FOUND + + """ + Input email contains an invalid domain name. + """ + BAD_DOMAIN + + """ + Multipass token is not valid. + """ + INVALID_MULTIPASS_REQUEST +} + +""" +Return type for `customerRecover` mutation. +""" +type CustomerRecoverPayload { + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Return type for `customerResetByUrl` mutation. +""" +type CustomerResetByUrlPayload { + """ + The customer object which was reset. + """ + customer: Customer + + """ + A newly created customer access token object for the customer. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Specifies the fields required to reset a customer’s password. +""" +input CustomerResetInput { + """ + The reset token required to reset the customer’s password. + """ + resetToken: String! + + """ + New password that will be set as part of the reset password process. + """ + password: String! +} + +""" +Return type for `customerReset` mutation. +""" +type CustomerResetPayload { + """ + The customer object which was reset. + """ + customer: Customer + + """ + A newly created customer access token object for the customer. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Specifies the fields required to update the Customer information. +""" +input CustomerUpdateInput { + """ + The customer’s first name. + """ + firstName: String + + """ + The customer’s last name. + """ + lastName: String + + """ + The customer’s email. + """ + email: String + + """ + A unique phone number for the customer. + + Formatted using E.164 standard. For example, _+16135551111_. To remove the phone number, specify `null`. + """ + phone: String + + """ + The login password used by the customer. + """ + password: String + + """ + Indicates whether the customer has consented to be sent marketing material via email. + """ + acceptsMarketing: Boolean +} + +""" +Return type for `customerUpdate` mutation. +""" +type CustomerUpdatePayload { + """ + The updated customer object. + """ + customer: Customer + + """ + The newly created customer access token. If the customer's password is updated, all previous access tokens + (including the one used to perform this mutation) become invalid, and a new token is generated. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Represents an error that happens during execution of a customer mutation. +""" +type CustomerUserError implements DisplayableError { + """ + Error code to uniquely identify the error. + """ + code: CustomerErrorCode + + """ + Path to the input field which caused the error. + """ + field: [String!] + + """ + The error message. + """ + message: String! +} + +""" +An ISO-8601 encoded UTC date time string. Example value: `"2019-07-03T20:47:55Z"`. +""" +scalar DateTime + +""" +A signed decimal number, which supports arbitrary precision and is serialized as a string. Example value: `"29.99"`. +""" +scalar Decimal + +""" +Digital wallet, such as Apple Pay, which can be used for accelerated checkouts. +""" +enum DigitalWallet { + """ + Apple Pay. + """ + APPLE_PAY + + """ + Android Pay. + """ + ANDROID_PAY + + """ + Google Pay. + """ + GOOGLE_PAY + + """ + Shopify Pay. + """ + SHOPIFY_PAY +} + +""" +An amount discounting the line that has been allocated by a discount. +""" +type DiscountAllocation { + """ + Amount of discount allocated. + """ + allocatedAmount: MoneyV2! + + """ + The discount this allocated amount originated from. + """ + discountApplication: DiscountApplication! +} + +""" +Discount applications capture the intentions of a discount source at +the time of application. +""" +interface DiscountApplication { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + Which lines of targetType that the discount is allocated over. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line that the discount is applicable towards. + """ + targetType: DiscountApplicationTargetType! + + """ + The value of the discount application. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH + + """ + The value is specifically applied onto a particular line. + """ + ONE +} + +""" +An auto-generated type for paginating through multiple DiscountApplications. +""" +type DiscountApplicationConnection { + """ + A list of edges. + """ + edges: [DiscountApplicationEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one DiscountApplication and a cursor during pagination. +""" +type DiscountApplicationEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of DiscountApplicationEdge. + """ + node: DiscountApplication! +} + +""" +Which lines on the order that the discount is allocated over, of the type +defined by the Discount Application's target_type. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines it is entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + +""" +The type of line (i.e. line item or shipping line) on an order that the discount is applicable towards. +""" +enum DiscountApplicationTargetType { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +Discount code applications capture the intentions of a discount code at +the time that it is applied. +""" +type DiscountCodeApplication implements DiscountApplication { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + Specifies whether the discount code was applied successfully. + """ + applicable: Boolean! + + """ + The string identifying the discount code that was used at the time of application. + """ + code: String! + + """ + Which lines of targetType that the discount is allocated over. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line that the discount is applicable towards. + """ + targetType: DiscountApplicationTargetType! + + """ + The value of the discount application. + """ + value: PricingValue! +} + +""" +Represents an error in the input of a mutation. +""" +interface DisplayableError { + """ + Path to the input field which caused the error. + """ + field: [String!] + + """ + The error message. + """ + message: String! +} + +""" +Represents a web address. +""" +type Domain { + """ + The host name of the domain (eg: `example.com`). + """ + host: String! + + """ + Whether SSL is enabled or not. + """ + sslEnabled: Boolean! + + """ + The URL of the domain (eg: `https://example.com`). + """ + url: URL! +} + +""" +Represents a video hosted outside of Shopify. +""" +type ExternalVideo implements Node & Media { + """ + A word or phrase to share the nature or contents of a media. + """ + alt: String + + """ + The URL. + """ + embeddedUrl: URL! + + """ + Globally unique identifier. + """ + id: ID! + + """ + The media content type. + """ + mediaContentType: MediaContentType! + + """ + The preview image for the media. + """ + previewImage: Image +} + +""" +Represents a single fulfillment in an order. +""" +type Fulfillment { + """ + List of the fulfillment's line items. + """ + fulfillmentLineItems( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): FulfillmentLineItemConnection! + + """ + The name of the tracking company. + """ + trackingCompany: String + + """ + Tracking information associated with the fulfillment, + such as the tracking number and tracking URL. + """ + trackingInfo( + """ + Truncate the array result to this size. + """ + first: Int + ): [FulfillmentTrackingInfo!]! +} + +""" +Represents a single line item in a fulfillment. There is at most one fulfillment line item for each order line item. +""" +type FulfillmentLineItem { + """ + The associated order's line item. + """ + lineItem: OrderLineItem! + + """ + The amount fulfilled in this fulfillment. + """ + quantity: Int! +} + +""" +An auto-generated type for paginating through multiple FulfillmentLineItems. +""" +type FulfillmentLineItemConnection { + """ + A list of edges. + """ + edges: [FulfillmentLineItemEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. +""" +type FulfillmentLineItemEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of FulfillmentLineItemEdge. + """ + node: FulfillmentLineItem! +} + +""" +Tracking information associated with the fulfillment. +""" +type FulfillmentTrackingInfo { + """ + The tracking number of the fulfillment. + """ + number: String + + """ + The URL to track the fulfillment. + """ + url: URL +} + +""" +A string containing HTML code. Example value: `"

Grey cotton knit sweater.

"`. +""" +scalar HTML + +""" +Represents information about the metafields associated to the specified resource. +""" +interface HasMetafields { + """ + The metafield associated with the resource. + """ + metafield( + """ + Container for a set of metafields (maximum of 20 characters). + """ + namespace: String! + + """ + Identifier for the metafield (maximum of 30 characters). + """ + key: String! + ): Metafield + + """ + A paginated list of metafields associated with the resource. + """ + metafields( + """ + Container for a set of metafields (maximum of 20 characters). + """ + namespace: String + + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): MetafieldConnection! +} + +""" +Represents an image resource. +""" +type Image { + """ + A word or phrase to share the nature or contents of an image. + """ + altText: String + + """ + The original height of the image in pixels. Returns `null` if the image is not hosted by Shopify. + """ + height: Int + + """ + A unique identifier for the image. + """ + id: ID + + """ + The location of the original image as a URL. + + If there are any existing transformations in the original source URL, they will remain and not be stripped. + """ + originalSrc: URL! + + """ + The location of the image as a URL. + """ + src: URL! + @deprecated( + reason: "Previously an image had a single `src` field. This could either return the original image\nlocation or a URL that contained transformations such as sizing or scale.\n\nThese transformations were specified by arguments on the parent field.\n\nNow an image has two distinct URL fields: `originalSrc` and `transformedSrc`.\n\n* `originalSrc` - the original unmodified image URL\n* `transformedSrc` - the image URL with the specified transformations included\n\nTo migrate to the new fields, image transformations should be moved from the parent field to `transformedSrc`.\n\nBefore:\n```graphql\n{\n shop {\n productImages(maxWidth: 200, scale: 2) {\n edges {\n node {\n src\n }\n }\n }\n }\n}\n```\n\nAfter:\n```graphql\n{\n shop {\n productImages {\n edges {\n node {\n transformedSrc(maxWidth: 200, scale: 2)\n }\n }\n }\n }\n}\n```\n" + ) + + """ + The location of the transformed image as a URL. + + All transformation arguments are considered "best-effort". If they can be applied to an image, they will be. + Otherwise any transformations which an image type does not support will be ignored. + """ + transformedSrc( + """ + Image width in pixels between 1 and 5760. + """ + maxWidth: Int + + """ + Image height in pixels between 1 and 5760. + """ + maxHeight: Int + + """ + Crops the image according to the specified region. + """ + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 and 3. + """ + scale: Int = 1 + + """ + Best effort conversion of image into content type (SVG -> PNG, Anything -> JGP, Anything -> WEBP are supported). + """ + preferredContentType: ImageContentType + ): URL! + + """ + The original width of the image in pixels. Returns `null` if the image is not hosted by Shopify. + """ + width: Int +} + +""" +An auto-generated type for paginating through multiple Images. +""" +type ImageConnection { + """ + A list of edges. + """ + edges: [ImageEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +List of supported image content types. +""" +enum ImageContentType { + """ + A PNG image. + """ + PNG + + """ + A JPG image. + """ + JPG + + """ + A WEBP image. + """ + WEBP +} + +""" +An auto-generated type which holds one Image and a cursor during pagination. +""" +type ImageEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of ImageEdge. + """ + node: Image! +} + +""" +Represents a mailing address for customers and shipping. +""" +type MailingAddress implements Node { + """ + The first line of the address. Typically the street address or PO Box number. + """ + address1: String + + """ + The second line of the address. Typically the number of the apartment, suite, or unit. + """ + address2: String + + """ + The name of the city, district, village, or town. + """ + city: String + + """ + The name of the customer's company or organization. + """ + company: String + + """ + The name of the country. + """ + country: String + + """ + The two-letter code for the country of the address. + + For example, US. + """ + countryCode: String @deprecated(reason: "Use `countryCodeV2` instead") + + """ + The two-letter code for the country of the address. + + For example, US. + """ + countryCodeV2: CountryCode + + """ + The first name of the customer. + """ + firstName: String + + """ + A formatted version of the address, customized by the provided arguments. + """ + formatted( + """ + Whether to include the customer's name in the formatted address. + """ + withName: Boolean = false + + """ + Whether to include the customer's company in the formatted address. + """ + withCompany: Boolean = true + ): [String!]! + + """ + A comma-separated list of the values for city, province, and country. + """ + formattedArea: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + The last name of the customer. + """ + lastName: String + + """ + The latitude coordinate of the customer address. + """ + latitude: Float + + """ + The longitude coordinate of the customer address. + """ + longitude: Float + + """ + The full name of the customer, based on firstName and lastName. + """ + name: String + + """ + A unique phone number for the customer. + + Formatted using E.164 standard. For example, _+16135551111_. + """ + phone: String + + """ + The region of the address, such as the province, state, or district. + """ + province: String + + """ + The two-letter code for the region. + + For example, ON. + """ + provinceCode: String + + """ + The zip or postal code of the address. + """ + zip: String +} + +""" +An auto-generated type for paginating through multiple MailingAddresses. +""" +type MailingAddressConnection { + """ + A list of edges. + """ + edges: [MailingAddressEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one MailingAddress and a cursor during pagination. +""" +type MailingAddressEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of MailingAddressEdge. + """ + node: MailingAddress! +} + +""" +Specifies the fields accepted to create or update a mailing address. +""" +input MailingAddressInput { + """ + The first line of the address. Typically the street address or PO Box number. + """ + address1: String + + """ + The second line of the address. Typically the number of the apartment, suite, or unit. + """ + address2: String + + """ + The name of the city, district, village, or town. + """ + city: String + + """ + The name of the customer's company or organization. + """ + company: String + + """ + The name of the country. + """ + country: String + + """ + The first name of the customer. + """ + firstName: String + + """ + The last name of the customer. + """ + lastName: String + + """ + A unique phone number for the customer. + + Formatted using E.164 standard. For example, _+16135551111_. + """ + phone: String + + """ + The region of the address, such as the province, state, or district. + """ + province: String + + """ + The zip or postal code of the address. + """ + zip: String +} + +""" +Manual discount applications capture the intentions of a discount that was manually created. +""" +type ManualDiscountApplication implements DiscountApplication { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + The description of the application. + """ + description: String + + """ + Which lines of targetType that the discount is allocated over. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line that the discount is applicable towards. + """ + targetType: DiscountApplicationTargetType! + + """ + The title of the application. + """ + title: String! + + """ + The value of the discount application. + """ + value: PricingValue! +} + +""" +Represents a media interface. +""" +interface Media { + """ + A word or phrase to share the nature or contents of a media. + """ + alt: String + + """ + The media content type. + """ + mediaContentType: MediaContentType! + + """ + The preview image for the media. + """ + previewImage: Image +} + +""" +An auto-generated type for paginating through multiple Media. +""" +type MediaConnection { + """ + A list of edges. + """ + edges: [MediaEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +The possible content types for a media object. +""" +enum MediaContentType { + """ + An externally hosted video. + """ + EXTERNAL_VIDEO + + """ + A Shopify hosted image. + """ + IMAGE + + """ + A 3d model. + """ + MODEL_3D + + """ + A Shopify hosted video. + """ + VIDEO +} + +""" +An auto-generated type which holds one Media and a cursor during pagination. +""" +type MediaEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of MediaEdge. + """ + node: Media! +} + +""" +Represents a Shopify hosted image. +""" +type MediaImage implements Node & Media { + """ + A word or phrase to share the nature or contents of a media. + """ + alt: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + The image for the media. + """ + image: Image + + """ + The media content type. + """ + mediaContentType: MediaContentType! + + """ + The preview image for the media. + """ + previewImage: Image +} + +""" +Metafields represent custom metadata attached to a resource. Metafields can be sorted into namespaces and are +comprised of keys, values, and value types. +""" +type Metafield implements Node { + """ + The date and time when the storefront metafield was created. + """ + createdAt: DateTime! + + """ + The description of a metafield. + """ + description: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + The key name for a metafield. + """ + key: String! + + """ + The namespace for a metafield. + """ + namespace: String! + + """ + The parent object that the metafield belongs to. + """ + parentResource: MetafieldParentResource! + + """ + The date and time when the storefront metafield was updated. + """ + updatedAt: DateTime! + + """ + The value of a metafield. + """ + value: String! + + """ + Represents the metafield value type. + """ + valueType: MetafieldValueType! +} + +""" +An auto-generated type for paginating through multiple Metafields. +""" +type MetafieldConnection { + """ + A list of edges. + """ + edges: [MetafieldEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Metafield and a cursor during pagination. +""" +type MetafieldEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of MetafieldEdge. + """ + node: Metafield! +} + +""" +A resource that the metafield belongs to. +""" +union MetafieldParentResource = Product | ProductVariant + +""" +Metafield value types. +""" +enum MetafieldValueType { + """ + A string metafield. + """ + STRING + + """ + An integer metafield. + """ + INTEGER + + """ + A json string metafield. + """ + JSON_STRING +} + +""" +Represents a Shopify hosted 3D model. +""" +type Model3d implements Node & Media { + """ + A word or phrase to share the nature or contents of a media. + """ + alt: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + The media content type. + """ + mediaContentType: MediaContentType! + + """ + The preview image for the media. + """ + previewImage: Image + + """ + The sources for a 3d model. + """ + sources: [Model3dSource!]! +} + +""" +Represents a source for a Shopify hosted 3d model. +""" +type Model3dSource { + """ + The filesize of the 3d model. + """ + filesize: Int! + + """ + The format of the 3d model. + """ + format: String! + + """ + The MIME type of the 3d model. + """ + mimeType: String! + + """ + The URL of the 3d model. + """ + url: String! +} + +""" +A monetary value string. Example value: `"100.57"`. +""" +scalar Money + +""" +Specifies the fields for a monetary value with currency. +""" +input MoneyInput { + """ + Decimal money amount. + """ + amount: Decimal! + + """ + Currency of the money. + """ + currencyCode: CurrencyCode! +} + +""" +A monetary value with currency. + +To format currencies, combine this type's amount and currencyCode fields with your client's locale. + +For example, in JavaScript you could use Intl.NumberFormat: + +```js +new Intl.NumberFormat(locale, { + style: 'currency', + currency: currencyCode +}).format(amount); +``` + +Other formatting libraries include: + +* iOS - [NumberFormatter](https://developer.apple.com/documentation/foundation/numberformatter) +* Android - [NumberFormat](https://developer.android.com/reference/java/text/NumberFormat.html) +* PHP - [NumberFormatter](http://php.net/manual/en/class.numberformatter.php) + +For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations +(such as [TwitterCldr](https://github.com/twitter/twitter-cldr-rb)). +""" +type MoneyV2 { + """ + Decimal money amount. + """ + amount: Decimal! + + """ + Currency of the money. + """ + currencyCode: CurrencyCode! +} + +""" +An auto-generated type for paginating through multiple MoneyV2s. +""" +type MoneyV2Connection { + """ + A list of edges. + """ + edges: [MoneyV2Edge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one MoneyV2 and a cursor during pagination. +""" +type MoneyV2Edge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of MoneyV2Edge. + """ + node: MoneyV2! +} + +""" +The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. +""" +type Mutation { + """ + Updates the attributes of a checkout. + """ + checkoutAttributesUpdate( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The fields used to update a checkout's attributes. + """ + input: CheckoutAttributesUpdateInput! + ): CheckoutAttributesUpdatePayload + @deprecated(reason: "Use `checkoutAttributesUpdateV2` instead") + + """ + Updates the attributes of a checkout. + """ + checkoutAttributesUpdateV2( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The checkout attributes to update. + """ + input: CheckoutAttributesUpdateV2Input! + ): CheckoutAttributesUpdateV2Payload + + """ + Completes a checkout without providing payment information. You can use this mutation for free items or items whose purchase price is covered by a gift card. + """ + checkoutCompleteFree( + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutCompleteFreePayload + + """ + Completes a checkout using a credit card token from Shopify's Vault. + """ + checkoutCompleteWithCreditCard( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The credit card info to apply as a payment. + """ + payment: CreditCardPaymentInput! + ): CheckoutCompleteWithCreditCardPayload + @deprecated(reason: "Use `checkoutCompleteWithCreditCardV2` instead") + + """ + Completes a checkout using a credit card token from Shopify's card vault. Before you can complete checkouts using CheckoutCompleteWithCreditCardV2, you need to [_request payment processing_](https://help.shopify.com/api/guides/sales-channel-sdk/getting-started#request-payment-processing). + """ + checkoutCompleteWithCreditCardV2( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The credit card info to apply as a payment. + """ + payment: CreditCardPaymentInputV2! + ): CheckoutCompleteWithCreditCardV2Payload + + """ + Completes a checkout with a tokenized payment. + """ + checkoutCompleteWithTokenizedPayment( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The info to apply as a tokenized payment. + """ + payment: TokenizedPaymentInput! + ): CheckoutCompleteWithTokenizedPaymentPayload + @deprecated(reason: "Use `checkoutCompleteWithTokenizedPaymentV2` instead") + + """ + Completes a checkout with a tokenized payment. + """ + checkoutCompleteWithTokenizedPaymentV2( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The info to apply as a tokenized payment. + """ + payment: TokenizedPaymentInputV2! + ): CheckoutCompleteWithTokenizedPaymentV2Payload + @deprecated(reason: "Use `checkoutCompleteWithTokenizedPaymentV3` instead") + + """ + Completes a checkout with a tokenized payment. + """ + checkoutCompleteWithTokenizedPaymentV3( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The info to apply as a tokenized payment. + """ + payment: TokenizedPaymentInputV3! + ): CheckoutCompleteWithTokenizedPaymentV3Payload + + """ + Creates a new checkout. + """ + checkoutCreate( + """ + The fields used to create a checkout. + """ + input: CheckoutCreateInput! + ): CheckoutCreatePayload + + """ + Associates a customer to the checkout. + """ + checkoutCustomerAssociate( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The customer access token of the customer to associate. + """ + customerAccessToken: String! + ): CheckoutCustomerAssociatePayload + @deprecated(reason: "Use `checkoutCustomerAssociateV2` instead") + + """ + Associates a customer to the checkout. + """ + checkoutCustomerAssociateV2( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The customer access token of the customer to associate. + """ + customerAccessToken: String! + ): CheckoutCustomerAssociateV2Payload + + """ + Disassociates the current checkout customer from the checkout. + """ + checkoutCustomerDisassociate( + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutCustomerDisassociatePayload + @deprecated(reason: "Use `checkoutCustomerDisassociateV2` instead") + + """ + Disassociates the current checkout customer from the checkout. + """ + checkoutCustomerDisassociateV2( + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutCustomerDisassociateV2Payload + + """ + Applies a discount to an existing checkout using a discount code. + """ + checkoutDiscountCodeApply( + """ + The discount code to apply to the checkout. + """ + discountCode: String! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutDiscountCodeApplyPayload + @deprecated(reason: "Use `checkoutDiscountCodeApplyV2` instead") + + """ + Applies a discount to an existing checkout using a discount code. + """ + checkoutDiscountCodeApplyV2( + """ + The discount code to apply to the checkout. + """ + discountCode: String! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutDiscountCodeApplyV2Payload + + """ + Removes the applied discount from an existing checkout. + """ + checkoutDiscountCodeRemove( + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutDiscountCodeRemovePayload + + """ + Updates the email on an existing checkout. + """ + checkoutEmailUpdate( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The email to update the checkout with. + """ + email: String! + ): CheckoutEmailUpdatePayload + @deprecated(reason: "Use `checkoutEmailUpdateV2` instead") + + """ + Updates the email on an existing checkout. + """ + checkoutEmailUpdateV2( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The email to update the checkout with. + """ + email: String! + ): CheckoutEmailUpdateV2Payload + + """ + Applies a gift card to an existing checkout using a gift card code. This will replace all currently applied gift cards. + """ + checkoutGiftCardApply( + """ + The code of the gift card to apply on the checkout. + """ + giftCardCode: String! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutGiftCardApplyPayload + @deprecated(reason: "Use `checkoutGiftCardsAppend` instead") + + """ + Removes an applied gift card from the checkout. + """ + checkoutGiftCardRemove( + """ + The ID of the Applied Gift Card to remove from the Checkout. + """ + appliedGiftCardId: ID! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutGiftCardRemovePayload + @deprecated(reason: "Use `checkoutGiftCardRemoveV2` instead") + + """ + Removes an applied gift card from the checkout. + """ + checkoutGiftCardRemoveV2( + """ + The ID of the Applied Gift Card to remove from the Checkout. + """ + appliedGiftCardId: ID! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutGiftCardRemoveV2Payload + + """ + Appends gift cards to an existing checkout. + """ + checkoutGiftCardsAppend( + """ + A list of gift card codes to append to the checkout. + """ + giftCardCodes: [String!]! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutGiftCardsAppendPayload + + """ + Adds a list of line items to a checkout. + """ + checkoutLineItemsAdd( + """ + A list of line item objects to add to the checkout. + """ + lineItems: [CheckoutLineItemInput!]! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutLineItemsAddPayload + + """ + Removes line items from an existing checkout. + """ + checkoutLineItemsRemove( + """ + The checkout on which to remove line items. + """ + checkoutId: ID! + + """ + Line item ids to remove. + """ + lineItemIds: [ID!]! + ): CheckoutLineItemsRemovePayload + + """ + Sets a list of line items to a checkout. + """ + checkoutLineItemsReplace( + """ + A list of line item objects to set on the checkout. + """ + lineItems: [CheckoutLineItemInput!]! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutLineItemsReplacePayload + + """ + Updates line items on a checkout. + """ + checkoutLineItemsUpdate( + """ + The checkout on which to update line items. + """ + checkoutId: ID! + + """ + Line items to update. + """ + lineItems: [CheckoutLineItemUpdateInput!]! + ): CheckoutLineItemsUpdatePayload + + """ + Updates the shipping address of an existing checkout. + """ + checkoutShippingAddressUpdate( + """ + The shipping address to where the line items will be shipped. + """ + shippingAddress: MailingAddressInput! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutShippingAddressUpdatePayload + @deprecated(reason: "Use `checkoutShippingAddressUpdateV2` instead") + + """ + Updates the shipping address of an existing checkout. + """ + checkoutShippingAddressUpdateV2( + """ + The shipping address to where the line items will be shipped. + """ + shippingAddress: MailingAddressInput! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutShippingAddressUpdateV2Payload + + """ + Updates the shipping lines on an existing checkout. + """ + checkoutShippingLineUpdate( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + A unique identifier to a Checkout’s shipping provider, price, and title combination, enabling the customer to select the availableShippingRates. + """ + shippingRateHandle: String! + ): CheckoutShippingLineUpdatePayload + + """ + Creates a customer access token. + The customer access token is required to modify the customer object in any way. + """ + customerAccessTokenCreate( + """ + The fields used to create a customer access token. + """ + input: CustomerAccessTokenCreateInput! + ): CustomerAccessTokenCreatePayload + + """ + Creates a customer access token using a multipass token instead of email and password. + A customer record is created if customer does not exist. If a customer record already + exists but the record is disabled, then it's enabled. + """ + customerAccessTokenCreateWithMultipass( + """ + A valid multipass token to be authenticated. + """ + multipassToken: String! + ): CustomerAccessTokenCreateWithMultipassPayload + + """ + Permanently destroys a customer access token. + """ + customerAccessTokenDelete( + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + ): CustomerAccessTokenDeletePayload + + """ + Renews a customer access token. + + Access token renewal must happen *before* a token expires. + If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. + """ + customerAccessTokenRenew( + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + ): CustomerAccessTokenRenewPayload + + """ + Activates a customer. + """ + customerActivate( + """ + Specifies the customer to activate. + """ + id: ID! + + """ + The fields used to activate a customer. + """ + input: CustomerActivateInput! + ): CustomerActivatePayload + + """ + Activates a customer with the activation url received from `customerCreate`. + """ + customerActivateByUrl( + """ + The customer activation URL. + """ + activationUrl: URL! + + """ + A new password set during activation. + """ + password: String! + ): CustomerActivateByUrlPayload + + """ + Creates a new address for a customer. + """ + customerAddressCreate( + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + + """ + The customer mailing address to create. + """ + address: MailingAddressInput! + ): CustomerAddressCreatePayload + + """ + Permanently deletes the address of an existing customer. + """ + customerAddressDelete( + """ + Specifies the address to delete. + """ + id: ID! + + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + ): CustomerAddressDeletePayload + + """ + Updates the address of an existing customer. + """ + customerAddressUpdate( + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + + """ + Specifies the customer address to update. + """ + id: ID! + + """ + The customer’s mailing address. + """ + address: MailingAddressInput! + ): CustomerAddressUpdatePayload + + """ + Creates a new customer. + """ + customerCreate( + """ + The fields used to create a new customer. + """ + input: CustomerCreateInput! + ): CustomerCreatePayload + + """ + Updates the default address of an existing customer. + """ + customerDefaultAddressUpdate( + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + + """ + ID of the address to set as the new default for the customer. + """ + addressId: ID! + ): CustomerDefaultAddressUpdatePayload + + """ + Sends a reset password email to the customer, as the first step in the reset password process. + """ + customerRecover( + """ + The email address of the customer to recover. + """ + email: String! + ): CustomerRecoverPayload + + """ + Resets a customer’s password with a token received from `CustomerRecover`. + """ + customerReset( + """ + Specifies the customer to reset. + """ + id: ID! + + """ + The fields used to reset a customer’s password. + """ + input: CustomerResetInput! + ): CustomerResetPayload + + """ + Resets a customer’s password with the reset password url received from `CustomerRecover`. + """ + customerResetByUrl( + """ + The customer's reset password url. + """ + resetUrl: URL! + + """ + New password that will be set as part of the reset password process. + """ + password: String! + ): CustomerResetByUrlPayload + + """ + Updates an existing customer. + """ + customerUpdate( + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + + """ + The customer object input. + """ + customer: CustomerUpdateInput! + ): CustomerUpdatePayload +} + +""" +An object with an ID to support global identification. +""" +interface Node { + """ + Globally unique identifier. + """ + id: ID! +} + +""" +An order is a customer’s completed request to purchase one or more products from a shop. An order is created when a customer completes the checkout process, during which time they provides an email address, billing address and payment information. +""" +type Order implements Node { + """ + The reason for the order's cancellation. Returns `null` if the order wasn't canceled. + """ + cancelReason: OrderCancelReason + + """ + The date and time when the order was canceled. Returns null if the order wasn't canceled. + """ + canceledAt: DateTime + + """ + The code of the currency used for the payment. + """ + currencyCode: CurrencyCode! + + """ + The subtotal of line items and their discounts, excluding line items that have been removed. Does not contain order-level discounts, duties, shipping costs, or shipping discounts. Taxes are not included unless the order is a taxes-included order. + """ + currentSubtotalPrice: MoneyV2! + + """ + The total amount of the order, including duties, taxes and discounts, minus amounts for line items that have been removed. + """ + currentTotalPrice: MoneyV2! + + """ + The total of all taxes applied to the order, excluding taxes for returned line items. + """ + currentTotalTax: MoneyV2! + + """ + The locale code in which this specific order happened. + """ + customerLocale: String + + """ + The unique URL that the customer can use to access the order. + """ + customerUrl: URL + + """ + Discounts that have been applied on the order. + """ + discountApplications( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): DiscountApplicationConnection! + + """ + Whether the order has had any edits applied or not. + """ + edited: Boolean! + + """ + The customer's email address. + """ + email: String + + """ + The financial status of the order. + """ + financialStatus: OrderFinancialStatus + + """ + The fulfillment status for the order. + """ + fulfillmentStatus: OrderFulfillmentStatus! + + """ + Globally unique identifier. + """ + id: ID! + + """ + List of the order’s line items. + """ + lineItems( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): OrderLineItemConnection! + + """ + Unique identifier for the order that appears on the order. + For example, _#1000_ or _Store1001. + """ + name: String! + + """ + A unique numeric identifier for the order for use by shop owner and customer. + """ + orderNumber: Int! + + """ + The total price of the order before any applied edits. + """ + originalTotalPrice: MoneyV2! + + """ + The customer's phone number for receiving SMS notifications. + """ + phone: String + + """ + The date and time when the order was imported. + This value can be set to dates in the past when importing from other systems. + If no value is provided, it will be auto-generated based on current date and time. + """ + processedAt: DateTime! + + """ + The address to where the order will be shipped. + """ + shippingAddress: MailingAddress + + """ + The discounts that have been allocated onto the shipping line by discount applications. + """ + shippingDiscountAllocations: [DiscountAllocation!]! + + """ + The unique URL for the order's status page. + """ + statusUrl: URL! + + """ + Price of the order before shipping and taxes. + """ + subtotalPrice: Money @deprecated(reason: "Use `subtotalPriceV2` instead") + + """ + Price of the order before duties, shipping and taxes. + """ + subtotalPriceV2: MoneyV2 + + """ + List of the order’s successful fulfillments. + """ + successfulFulfillments( + """ + Truncate the array result to this size. + """ + first: Int + ): [Fulfillment!] + + """ + The sum of all the prices of all the items in the order, taxes and discounts included (must be positive). + """ + totalPrice: Money! @deprecated(reason: "Use `totalPriceV2` instead") + + """ + The sum of all the prices of all the items in the order, duties, taxes and discounts included (must be positive). + """ + totalPriceV2: MoneyV2! + + """ + The total amount that has been refunded. + """ + totalRefunded: Money! @deprecated(reason: "Use `totalRefundedV2` instead") + + """ + The total amount that has been refunded. + """ + totalRefundedV2: MoneyV2! + + """ + The total cost of shipping. + """ + totalShippingPrice: Money! + @deprecated(reason: "Use `totalShippingPriceV2` instead") + + """ + The total cost of shipping. + """ + totalShippingPriceV2: MoneyV2! + + """ + The total cost of taxes. + """ + totalTax: Money @deprecated(reason: "Use `totalTaxV2` instead") + + """ + The total cost of taxes. + """ + totalTaxV2: MoneyV2 +} + +""" +Represents the reason for the order's cancellation. +""" +enum OrderCancelReason { + """ + The customer wanted to cancel the order. + """ + CUSTOMER + + """ + The order was fraudulent. + """ + FRAUD + + """ + There was insufficient inventory. + """ + INVENTORY + + """ + Payment was declined. + """ + DECLINED + + """ + The order was canceled for an unlisted reason. + """ + OTHER +} + +""" +An auto-generated type for paginating through multiple Orders. +""" +type OrderConnection { + """ + A list of edges. + """ + edges: [OrderEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Order and a cursor during pagination. +""" +type OrderEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of OrderEdge. + """ + node: Order! +} + +""" +Represents the order's current financial status. +""" +enum OrderFinancialStatus { + """ + Displayed as **Pending**. + """ + PENDING + + """ + Displayed as **Authorized**. + """ + AUTHORIZED + + """ + Displayed as **Partially paid**. + """ + PARTIALLY_PAID + + """ + Displayed as **Partially refunded**. + """ + PARTIALLY_REFUNDED + + """ + Displayed as **Voided**. + """ + VOIDED + + """ + Displayed as **Paid**. + """ + PAID + + """ + Displayed as **Refunded**. + """ + REFUNDED +} + +""" +Represents the order's current fulfillment status. +""" +enum OrderFulfillmentStatus { + """ + Displayed as **Unfulfilled**. + """ + UNFULFILLED + + """ + Displayed as **Partially fulfilled**. + """ + PARTIALLY_FULFILLED + + """ + Displayed as **Fulfilled**. + """ + FULFILLED + + """ + Displayed as **Restocked**. + """ + RESTOCKED + + """ + Displayed as **Pending fulfillment**. + """ + PENDING_FULFILLMENT + + """ + Displayed as **Open**. + """ + OPEN + + """ + Displayed as **In progress**. + """ + IN_PROGRESS + + """ + Displayed as **Scheduled**. + """ + SCHEDULED +} + +""" +Represents a single line in an order. There is one line item for each distinct product variant. +""" +type OrderLineItem { + """ + The number of entries associated to the line item minus the items that have been removed. + """ + currentQuantity: Int! + + """ + List of custom attributes associated to the line item. + """ + customAttributes: [Attribute!]! + + """ + The discounts that have been allocated onto the order line item by discount applications. + """ + discountAllocations: [DiscountAllocation!]! + + """ + The total price of the line item, including discounts, and displayed in the presentment currency. + """ + discountedTotalPrice: MoneyV2! + + """ + The total price of the line item, not including any discounts. The total price is calculated using the original unit price multiplied by the quantity, and it is displayed in the presentment currency. + """ + originalTotalPrice: MoneyV2! + + """ + The number of products variants associated to the line item. + """ + quantity: Int! + + """ + The title of the product combined with title of the variant. + """ + title: String! + + """ + The product variant object associated to the line item. + """ + variant: ProductVariant +} + +""" +An auto-generated type for paginating through multiple OrderLineItems. +""" +type OrderLineItemConnection { + """ + A list of edges. + """ + edges: [OrderLineItemEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one OrderLineItem and a cursor during pagination. +""" +type OrderLineItemEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of OrderLineItemEdge. + """ + node: OrderLineItem! +} + +""" +The set of valid sort keys for the Order query. +""" +enum OrderSortKeys { + """ + Sort by the `processed_at` value. + """ + PROCESSED_AT + + """ + Sort by the `total_price` value. + """ + TOTAL_PRICE + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom page on the online store. +""" +type Page implements Node { + """ + The description of the page, complete with HTML formatting. + """ + body: HTML! + + """ + Summary of the page body. + """ + bodySummary: String! + + """ + The timestamp of the page creation. + """ + createdAt: DateTime! + + """ + A human-friendly unique string for the page automatically generated from its title. + """ + handle: String! + + """ + Globally unique identifier. + """ + id: ID! + + """ + The page's SEO information. + """ + seo: SEO + + """ + The title of the page. + """ + title: String! + + """ + The timestamp of the latest page update. + """ + updatedAt: DateTime! + + """ + The url pointing to the page accessible from the web. + """ + url: URL! +} + +""" +An auto-generated type for paginating through multiple Pages. +""" +type PageConnection { + """ + A list of edges. + """ + edges: [PageEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Page and a cursor during pagination. +""" +type PageEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of PageEdge. + """ + node: Page! +} + +""" +Information about pagination in a connection. +""" +type PageInfo { + """ + Indicates if there are more pages to fetch. + """ + hasNextPage: Boolean! + + """ + Indicates if there are any pages prior to the current page. + """ + hasPreviousPage: Boolean! +} + +""" +The set of valid sort keys for the Page query. +""" +enum PageSortKeys { + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `updated_at` value. + """ + UPDATED_AT + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +A payment applied to a checkout. +""" +type Payment implements Node { + """ + The amount of the payment. + """ + amount: Money! @deprecated(reason: "Use `amountV2` instead") + + """ + The amount of the payment. + """ + amountV2: MoneyV2! + + """ + The billing address for the payment. + """ + billingAddress: MailingAddress + + """ + The checkout to which the payment belongs. + """ + checkout: Checkout! + + """ + The credit card used for the payment in the case of direct payments. + """ + creditCard: CreditCard + + """ + A message describing a processing error during asynchronous processing. + """ + errorMessage: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + A client-side generated token to identify a payment and perform idempotent operations. + For more information, refer to + [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). + """ + idempotencyKey: String + + """ + The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow. + """ + nextActionUrl: URL + + """ + Whether or not the payment is still processing asynchronously. + """ + ready: Boolean! + + """ + A flag to indicate if the payment is to be done in test mode for gateways that support it. + """ + test: Boolean! + + """ + The actual transaction recorded by Shopify after having processed the payment with the gateway. + """ + transaction: Transaction +} + +""" +Settings related to payments. +""" +type PaymentSettings { + """ + List of the card brands which the shop accepts. + """ + acceptedCardBrands: [CardBrand!]! + + """ + The url pointing to the endpoint to vault credit cards. + """ + cardVaultUrl: URL! + + """ + The country where the shop is located. + """ + countryCode: CountryCode! + + """ + The three-letter code for the shop's primary currency. + """ + currencyCode: CurrencyCode! + + """ + A list of enabled currencies (ISO 4217 format) that the shop accepts. Merchants can enable currencies from their Shopify Payments settings in the Shopify admin. + """ + enabledPresentmentCurrencies: [CurrencyCode!]! + + """ + The shop’s Shopify Payments account id. + """ + shopifyPaymentsAccountId: String + + """ + List of the digital wallets which the shop supports. + """ + supportedDigitalWallets: [DigitalWallet!]! +} + +""" +The valid values for the types of payment token. +""" +enum PaymentTokenType { + """ + Apple Pay token type. + """ + APPLE_PAY + + """ + Vault payment token type. + """ + VAULT + + """ + Shopify Pay token type. + """ + SHOPIFY_PAY + + """ + Google Pay token type. + """ + GOOGLE_PAY +} + +""" +The value of the percentage pricing object. +""" +type PricingPercentageValue { + """ + The percentage value of the object. + """ + percentage: Float! +} + +""" +The price value (fixed or percentage) for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + +""" +A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. +For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). +""" +type Product implements Node & HasMetafields { + """ + Indicates if at least one product variant is available for sale. + """ + availableForSale: Boolean! + + """ + List of collections a product belongs to. + """ + collections( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): CollectionConnection! + + """ + The compare at price of the product across all variants. + """ + compareAtPriceRange: ProductPriceRange! + + """ + The date and time when the product was created. + """ + createdAt: DateTime! + + """ + Stripped description of the product, single line with HTML tags removed. + """ + description( + """ + Truncates string after the given length. + """ + truncateAt: Int + ): String! + + """ + The description of the product, complete with HTML formatting. + """ + descriptionHtml: HTML! + + """ + A human-friendly unique string for the Product automatically generated from its title. + They are used by the Liquid templating language to refer to objects. + """ + handle: String! + + """ + Globally unique identifier. + """ + id: ID! + + """ + List of images associated with the product. + """ + images( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ProductImageSortKeys = POSITION + + """ + Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead. + """ + maxWidth: Int + + """ + Image height in pixels between 1 and 2048. This argument is deprecated: Use `maxHeight` on `Image.transformedSrc` instead. + """ + maxHeight: Int + + """ + Crops the image according to the specified region. This argument is deprecated: Use `crop` on `Image.transformedSrc` instead. + """ + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead. + """ + scale: Int = 1 + ): ImageConnection! + + """ + The media associated with the product. + """ + media( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ProductMediaSortKeys = POSITION + ): MediaConnection! + + """ + The metafield associated with the resource. + """ + metafield( + """ + Container for a set of metafields (maximum of 20 characters). + """ + namespace: String! + + """ + Identifier for the metafield (maximum of 30 characters). + """ + key: String! + ): Metafield + + """ + A paginated list of metafields associated with the resource. + """ + metafields( + """ + Container for a set of metafields (maximum of 20 characters). + """ + namespace: String + + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): MetafieldConnection! + + """ + The online store URL for the product. + A value of `null` indicates that the product is not published to the Online Store sales channel. + """ + onlineStoreUrl: URL + + """ + List of product options. + """ + options( + """ + Truncate the array result to this size. + """ + first: Int + ): [ProductOption!]! + + """ + List of price ranges in the presentment currencies for this shop. + """ + presentmentPriceRanges( + """ + Specifies the presentment currencies to return a price range in. + """ + presentmentCurrencies: [CurrencyCode!] + + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): ProductPriceRangeConnection! + + """ + The price range. + """ + priceRange: ProductPriceRange! + + """ + A categorization that a product can be tagged with, commonly used for filtering and searching. + """ + productType: String! + + """ + The date and time when the product was published to the channel. + """ + publishedAt: DateTime! + + """ + The product's SEO information. + """ + seo: SEO! + + """ + A comma separated list of tags that have been added to the product. + Additional access scope required for private apps: unauthenticated_read_product_tags. + """ + tags: [String!]! + + """ + The product’s title. + """ + title: String! + + """ + The total quantity of inventory in stock for this Product. + """ + totalInventory: Int + + """ + The date and time when the product was last modified. + A product's `updatedAt` value can change for different reasons. For example, if an order + is placed for a product that has inventory tracking set up, then the inventory adjustment + is counted as an update. + """ + updatedAt: DateTime! + + """ + Find a product’s variant based on its selected options. + This is useful for converting a user’s selection of product options into a single matching variant. + If there is not a variant for the selected options, `null` will be returned. + """ + variantBySelectedOptions( + """ + The input fields used for a selected option. + """ + selectedOptions: [SelectedOptionInput!]! + ): ProductVariant + + """ + List of the product’s variants. + """ + variants( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ProductVariantSortKeys = POSITION + ): ProductVariantConnection! + + """ + The product’s vendor name. + """ + vendor: String! +} + +""" +The set of valid sort keys for the ProductCollection query. +""" +enum ProductCollectionSortKeys { + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `price` value. + """ + PRICE + + """ + Sort by the `best-selling` value. + """ + BEST_SELLING + + """ + Sort by the `created` value. + """ + CREATED + + """ + Sort by the `id` value. + """ + ID + + """ + Sort by the `manual` value. + """ + MANUAL + + """ + Sort by the `collection-default` value. + """ + COLLECTION_DEFAULT + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +An auto-generated type for paginating through multiple Products. +""" +type ProductConnection { + """ + A list of edges. + """ + edges: [ProductEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Product and a cursor during pagination. +""" +type ProductEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of ProductEdge. + """ + node: Product! +} + +""" +The set of valid sort keys for the ProductImage query. +""" +enum ProductImageSortKeys { + """ + Sort by the `created_at` value. + """ + CREATED_AT + + """ + Sort by the `position` value. + """ + POSITION + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +The set of valid sort keys for the ProductMedia query. +""" +enum ProductMediaSortKeys { + """ + Sort by the `position` value. + """ + POSITION + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +Product property names like "Size", "Color", and "Material" that the customers can select. +Variants are selected based on permutations of these options. +255 characters limit each. +""" +type ProductOption implements Node { + """ + Globally unique identifier. + """ + id: ID! + + """ + The product option’s name. + """ + name: String! + + """ + The corresponding value to the product option name. + """ + values: [String!]! +} + +""" +The price range of the product. +""" +type ProductPriceRange { + """ + The highest variant's price. + """ + maxVariantPrice: MoneyV2! + + """ + The lowest variant's price. + """ + minVariantPrice: MoneyV2! +} + +""" +An auto-generated type for paginating through multiple ProductPriceRanges. +""" +type ProductPriceRangeConnection { + """ + A list of edges. + """ + edges: [ProductPriceRangeEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one ProductPriceRange and a cursor during pagination. +""" +type ProductPriceRangeEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of ProductPriceRangeEdge. + """ + node: ProductPriceRange! +} + +""" +The set of valid sort keys for the Product query. +""" +enum ProductSortKeys { + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `product_type` value. + """ + PRODUCT_TYPE + + """ + Sort by the `vendor` value. + """ + VENDOR + + """ + Sort by the `updated_at` value. + """ + UPDATED_AT + + """ + Sort by the `created_at` value. + """ + CREATED_AT + + """ + Sort by the `best_selling` value. + """ + BEST_SELLING + + """ + Sort by the `price` value. + """ + PRICE + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +A product variant represents a different version of a product, such as differing sizes or differing colors. +""" +type ProductVariant implements Node & HasMetafields { + """ + Indicates if the product variant is in stock. + """ + available: Boolean @deprecated(reason: "Use `availableForSale` instead") + + """ + Indicates if the product variant is available for sale. + """ + availableForSale: Boolean! + + """ + The compare at price of the variant. This can be used to mark a variant as on sale, when `compareAtPrice` is higher than `price`. + """ + compareAtPrice: Money @deprecated(reason: "Use `compareAtPriceV2` instead") + + """ + The compare at price of the variant. This can be used to mark a variant as on sale, when `compareAtPriceV2` is higher than `priceV2`. + """ + compareAtPriceV2: MoneyV2 + + """ + Whether a product is out of stock but still available for purchase (used for backorders). + """ + currentlyNotInStock: Boolean! + + """ + Globally unique identifier. + """ + id: ID! + + """ + Image associated with the product variant. This field falls back to the product image if no image is available. + """ + image( + """ + Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead. + """ + maxWidth: Int + + """ + Image height in pixels between 1 and 2048. This argument is deprecated: Use `maxHeight` on `Image.transformedSrc` instead. + """ + maxHeight: Int + + """ + Crops the image according to the specified region. This argument is deprecated: Use `crop` on `Image.transformedSrc` instead. + """ + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead. + """ + scale: Int = 1 + ): Image + + """ + The metafield associated with the resource. + """ + metafield( + """ + Container for a set of metafields (maximum of 20 characters). + """ + namespace: String! + + """ + Identifier for the metafield (maximum of 30 characters). + """ + key: String! + ): Metafield + + """ + A paginated list of metafields associated with the resource. + """ + metafields( + """ + Container for a set of metafields (maximum of 20 characters). + """ + namespace: String + + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): MetafieldConnection! + + """ + List of prices and compare-at prices in the presentment currencies for this shop. + """ + presentmentPrices( + """ + The presentment currencies prices should return in. + """ + presentmentCurrencies: [CurrencyCode!] + + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): ProductVariantPricePairConnection! + + """ + List of unit prices in the presentment currencies for this shop. + """ + presentmentUnitPrices( + """ + Specify the currencies in which to return presentment unit prices. + """ + presentmentCurrencies: [CurrencyCode!] + + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): MoneyV2Connection! + + """ + The product variant’s price. + """ + price: Money! @deprecated(reason: "Use `priceV2` instead") + + """ + The product variant’s price. + """ + priceV2: MoneyV2! + + """ + The product object that the product variant belongs to. + """ + product: Product! + + """ + The total sellable quantity of the variant for online sales channels. + """ + quantityAvailable: Int + + """ + Whether a customer needs to provide a shipping address when placing an order for the product variant. + """ + requiresShipping: Boolean! + + """ + List of product options applied to the variant. + """ + selectedOptions: [SelectedOption!]! + + """ + The SKU (stock keeping unit) associated with the variant. + """ + sku: String + + """ + The product variant’s title. + """ + title: String! + + """ + The unit price value for the variant based on the variant's measurement. + """ + unitPrice: MoneyV2 + + """ + The unit price measurement for the variant. + """ + unitPriceMeasurement: UnitPriceMeasurement + + """ + The weight of the product variant in the unit system specified with `weight_unit`. + """ + weight: Float + + """ + Unit of measurement for weight. + """ + weightUnit: WeightUnit! +} + +""" +An auto-generated type for paginating through multiple ProductVariants. +""" +type ProductVariantConnection { + """ + A list of edges. + """ + edges: [ProductVariantEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one ProductVariant and a cursor during pagination. +""" +type ProductVariantEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of ProductVariantEdge. + """ + node: ProductVariant! +} + +""" +The compare-at price and price of a variant sharing a currency. +""" +type ProductVariantPricePair { + """ + The compare-at price of the variant with associated currency. + """ + compareAtPrice: MoneyV2 + + """ + The price of the variant with associated currency. + """ + price: MoneyV2! +} + +""" +An auto-generated type for paginating through multiple ProductVariantPricePairs. +""" +type ProductVariantPricePairConnection { + """ + A list of edges. + """ + edges: [ProductVariantPricePairEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one ProductVariantPricePair and a cursor during pagination. +""" +type ProductVariantPricePairEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of ProductVariantPricePairEdge. + """ + node: ProductVariantPricePair! +} + +""" +The set of valid sort keys for the ProductVariant query. +""" +enum ProductVariantSortKeys { + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `sku` value. + """ + SKU + + """ + Sort by the `position` value. + """ + POSITION + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. +""" +type QueryRoot { + """ + List of the shop's articles. + """ + articles( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ArticleSortKeys = ID + + """ + Supported filter parameters: + - `author` + - `blog_title` + - `created_at` + - `tag` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): ArticleConnection! + + """ + Find a blog by its handle. + """ + blogByHandle( + """ + The handle of the blog. + """ + handle: String! + ): Blog + + """ + List of the shop's blogs. + """ + blogs( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: BlogSortKeys = ID + + """ + Supported filter parameters: + - `created_at` + - `handle` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): BlogConnection! + + """ + Find a collection by its handle. + """ + collectionByHandle( + """ + The handle of the collection. + """ + handle: String! + ): Collection + + """ + List of the shop’s collections. + """ + collections( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: CollectionSortKeys = ID + + """ + Supported filter parameters: + - `collection_type` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): CollectionConnection! + + """ + Find a customer by its access token. + """ + customer( + """ + The customer access token. + """ + customerAccessToken: String! + ): Customer + + """ + Returns a specific node by ID. + """ + node( + """ + The ID of the Node to return. + """ + id: ID! + ): Node + + """ + Returns the list of nodes with the given IDs. + """ + nodes( + """ + The IDs of the Nodes to return. + """ + ids: [ID!]! + ): [Node]! + + """ + Find a page by its handle. + """ + pageByHandle( + """ + The handle of the page. + """ + handle: String! + ): Page + + """ + List of the shop's pages. + """ + pages( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: PageSortKeys = ID + + """ + Supported filter parameters: + - `created_at` + - `handle` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): PageConnection! + + """ + Find a product by its handle. + """ + productByHandle( + """ + The handle of the product. + """ + handle: String! + ): Product + + """ + Find recommended products related to a given `product_id`. + To learn more about how recommendations are generated, see + [*Showing product recommendations on product pages*](https://help.shopify.com/themes/development/recommended-products). + """ + productRecommendations( + """ + The id of the product. + """ + productId: ID! + ): [Product!] + + """ + Tags added to products. + Additional access scope required: unauthenticated_read_product_tags. + """ + productTags( + """ + Returns up to the first `n` elements from the list. + """ + first: Int! + ): StringConnection! + + """ + List of product types for the shop's products that are published to your app. + """ + productTypes( + """ + Returns up to the first `n` elements from the list. + """ + first: Int! + ): StringConnection! + + """ + List of the shop’s products. + """ + products( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ProductSortKeys = ID + + """ + Supported filter parameters: + - `available_for_sale` + - `created_at` + - `product_type` + - `tag` + - `title` + - `updated_at` + - `variants.price` + - `vendor` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): ProductConnection! + + """ + The list of public Storefront API versions, including supported, release candidate and unstable versions. + """ + publicApiVersions: [ApiVersion!]! + + """ + The shop associated with the storefront access token. + """ + shop: Shop! +} + +""" +SEO information. +""" +type SEO { + """ + The meta description. + """ + description: String + + """ + The SEO title. + """ + title: String +} + +""" +Script discount applications capture the intentions of a discount that +was created by a Shopify Script. +""" +type ScriptDiscountApplication implements DiscountApplication { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + The description of the application as defined by the Script. + """ + description: String! @deprecated(reason: "Use `title` instead") + + """ + Which lines of targetType that the discount is allocated over. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line that the discount is applicable towards. + """ + targetType: DiscountApplicationTargetType! + + """ + The title of the application as defined by the Script. + """ + title: String! + + """ + The value of the discount application. + """ + value: PricingValue! +} + +""" +Properties used by customers to select a product variant. +Products can have multiple options, like different sizes or colors. +""" +type SelectedOption { + """ + The product option’s name. + """ + name: String! + + """ + The product option’s value. + """ + value: String! +} + +""" +Specifies the input fields required for a selected option. +""" +input SelectedOptionInput { + """ + The product option’s name. + """ + name: String! + + """ + The product option’s value. + """ + value: String! +} + +""" +A shipping rate to be applied to a checkout. +""" +type ShippingRate { + """ + Human-readable unique identifier for this shipping rate. + """ + handle: String! + + """ + Price of this shipping rate. + """ + price: Money! @deprecated(reason: "Use `priceV2` instead") + + """ + Price of this shipping rate. + """ + priceV2: MoneyV2! + + """ + Title of this shipping rate. + """ + title: String! +} + +""" +Shop represents a collection of the general settings and information about the shop. +""" +type Shop { + """ + List of the shop' articles. + """ + articles( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ArticleSortKeys = ID + + """ + Supported filter parameters: + - `author` + - `blog_title` + - `created_at` + - `tag` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): ArticleConnection! @deprecated(reason: "Use `QueryRoot.articles` instead.") + + """ + List of the shop' blogs. + """ + blogs( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: BlogSortKeys = ID + + """ + Supported filter parameters: + - `created_at` + - `handle` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): BlogConnection! @deprecated(reason: "Use `QueryRoot.blogs` instead.") + + """ + Find a collection by its handle. + """ + collectionByHandle( + """ + The handle of the collection. + """ + handle: String! + ): Collection + @deprecated(reason: "Use `QueryRoot.collectionByHandle` instead.") + + """ + List of the shop’s collections. + """ + collections( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: CollectionSortKeys = ID + + """ + Supported filter parameters: + - `collection_type` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): CollectionConnection! + @deprecated(reason: "Use `QueryRoot.collections` instead.") + + """ + The three-letter code for the currency that the shop accepts. + """ + currencyCode: CurrencyCode! + @deprecated(reason: "Use `paymentSettings` instead") + + """ + A description of the shop. + """ + description: String + + """ + A string representing the way currency is formatted when the currency isn’t specified. + """ + moneyFormat: String! + + """ + The shop’s name. + """ + name: String! + + """ + Settings related to payments. + """ + paymentSettings: PaymentSettings! + + """ + The shop’s primary domain. + """ + primaryDomain: Domain! + + """ + The shop’s privacy policy. + """ + privacyPolicy: ShopPolicy + + """ + Find a product by its handle. + """ + productByHandle( + """ + The handle of the product. + """ + handle: String! + ): Product @deprecated(reason: "Use `QueryRoot.productByHandle` instead.") + + """ + A list of tags that have been added to products. + Additional access scope required: unauthenticated_read_product_tags. + """ + productTags( + """ + Returns up to the first `n` elements from the list. + """ + first: Int! + ): StringConnection! + @deprecated(reason: "Use `QueryRoot.productTags` instead.") + + """ + List of the shop’s product types. + """ + productTypes( + """ + Returns up to the first `n` elements from the list. + """ + first: Int! + ): StringConnection! + @deprecated(reason: "Use `QueryRoot.productTypes` instead.") + + """ + List of the shop’s products. + """ + products( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ProductSortKeys = ID + + """ + Supported filter parameters: + - `available_for_sale` + - `created_at` + - `product_type` + - `tag` + - `title` + - `updated_at` + - `variants.price` + - `vendor` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): ProductConnection! @deprecated(reason: "Use `QueryRoot.products` instead.") + + """ + The shop’s refund policy. + """ + refundPolicy: ShopPolicy + + """ + The shop’s shipping policy. + """ + shippingPolicy: ShopPolicy + + """ + Countries that the shop ships to. + """ + shipsToCountries: [CountryCode!]! + + """ + The shop’s Shopify Payments account id. + """ + shopifyPaymentsAccountId: String + @deprecated(reason: "Use `paymentSettings` instead") + + """ + The shop’s terms of service. + """ + termsOfService: ShopPolicy +} + +""" +Policy that a merchant has configured for their store, such as their refund or privacy policy. +""" +type ShopPolicy implements Node { + """ + Policy text, maximum size of 64kb. + """ + body: String! + + """ + Policy’s handle. + """ + handle: String! + + """ + Globally unique identifier. + """ + id: ID! + + """ + Policy’s title. + """ + title: String! + + """ + Public URL to the policy. + """ + url: URL! +} + +""" +An auto-generated type for paginating through multiple Strings. +""" +type StringConnection { + """ + A list of edges. + """ + edges: [StringEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one String and a cursor during pagination. +""" +type StringEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of StringEdge. + """ + node: String! +} + +""" +Specifies the fields required to complete a checkout with +a tokenized payment. +""" +input TokenizedPaymentInput { + """ + The amount of the payment. + """ + amount: Money! + + """ + A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). + """ + idempotencyKey: String! + + """ + The billing address for the payment. + """ + billingAddress: MailingAddressInput! + + """ + The type of payment token. + """ + type: String! + + """ + A simple string or JSON containing the required payment data for the tokenized payment. + """ + paymentData: String! + + """ + Executes the payment in test mode if possible. Defaults to `false`. + """ + test: Boolean + + """ + Public Hash Key used for AndroidPay payments only. + """ + identifier: String +} + +""" +Specifies the fields required to complete a checkout with +a tokenized payment. +""" +input TokenizedPaymentInputV2 { + """ + The amount and currency of the payment. + """ + paymentAmount: MoneyInput! + + """ + A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). + """ + idempotencyKey: String! + + """ + The billing address for the payment. + """ + billingAddress: MailingAddressInput! + + """ + A simple string or JSON containing the required payment data for the tokenized payment. + """ + paymentData: String! + + """ + Whether to execute the payment in test mode, if possible. Test mode is not supported in production stores. Defaults to `false`. + """ + test: Boolean + + """ + Public Hash Key used for AndroidPay payments only. + """ + identifier: String + + """ + The type of payment token. + """ + type: String! +} + +""" +Specifies the fields required to complete a checkout with +a tokenized payment. +""" +input TokenizedPaymentInputV3 { + """ + The amount and currency of the payment. + """ + paymentAmount: MoneyInput! + + """ + A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). + """ + idempotencyKey: String! + + """ + The billing address for the payment. + """ + billingAddress: MailingAddressInput! + + """ + A simple string or JSON containing the required payment data for the tokenized payment. + """ + paymentData: String! + + """ + Whether to execute the payment in test mode, if possible. Test mode is not supported in production stores. Defaults to `false`. + """ + test: Boolean + + """ + Public Hash Key used for AndroidPay payments only. + """ + identifier: String + + """ + The type of payment token. + """ + type: PaymentTokenType! +} + +""" +An object representing exchange of money for a product or service. +""" +type Transaction { + """ + The amount of money that the transaction was for. + """ + amount: Money! @deprecated(reason: "Use `amountV2` instead") + + """ + The amount of money that the transaction was for. + """ + amountV2: MoneyV2! + + """ + The kind of the transaction. + """ + kind: TransactionKind! + + """ + The status of the transaction. + """ + status: TransactionStatus! @deprecated(reason: "Use `statusV2` instead") + + """ + The status of the transaction. + """ + statusV2: TransactionStatus + + """ + Whether the transaction was done in test mode or not. + """ + test: Boolean! +} + +""" +The different kinds of order transactions. +""" +enum TransactionKind { + """ + An authorization and capture performed together in a single step. + """ + SALE + + """ + A transfer of the money that was reserved during the authorization stage. + """ + CAPTURE + + """ + An amount reserved against the cardholder's funding source. + Money does not change hands until the authorization is captured. + """ + AUTHORIZATION + + """ + An authorization for a payment taken with an EMV credit card reader. + """ + EMV_AUTHORIZATION + + """ + Money returned to the customer when they have paid too much. + """ + CHANGE +} + +""" +Transaction statuses describe the status of a transaction. +""" +enum TransactionStatus { + """ + The transaction is pending. + """ + PENDING + + """ + The transaction succeeded. + """ + SUCCESS + + """ + The transaction failed. + """ + FAILURE + + """ + There was an error while processing the transaction. + """ + ERROR +} + +""" +An RFC 3986 and RFC 3987 compliant URI string. + +Example value: `"https://johns-apparel.myshopify.com"`. +""" +scalar URL + +""" +The measurement used to calculate a unit price for a product variant (e.g. $9.99 / 100ml). +""" +type UnitPriceMeasurement { + """ + The type of unit of measurement for the unit price measurement. + """ + measuredType: UnitPriceMeasurementMeasuredType + + """ + The quantity unit for the unit price measurement. + """ + quantityUnit: UnitPriceMeasurementMeasuredUnit + + """ + The quantity value for the unit price measurement. + """ + quantityValue: Float! + + """ + The reference unit for the unit price measurement. + """ + referenceUnit: UnitPriceMeasurementMeasuredUnit + + """ + The reference value for the unit price measurement. + """ + referenceValue: Int! +} + +""" +The accepted types of unit of measurement. +""" +enum UnitPriceMeasurementMeasuredType { + """ + Unit of measurements representing volumes. + """ + VOLUME + + """ + Unit of measurements representing weights. + """ + WEIGHT + + """ + Unit of measurements representing lengths. + """ + LENGTH + + """ + Unit of measurements representing areas. + """ + AREA +} + +""" +The valid units of measurement for a unit price measurement. +""" +enum UnitPriceMeasurementMeasuredUnit { + """ + 1000 milliliters equals 1 liter. + """ + ML + + """ + 100 centiliters equals 1 liter. + """ + CL + + """ + Metric system unit of volume. + """ + L + + """ + 1 cubic meter equals 1000 liters. + """ + M3 + + """ + 1000 milligrams equals 1 gram. + """ + MG + + """ + Metric system unit of weight. + """ + G + + """ + 1 kilogram equals 1000 grams. + """ + KG + + """ + 1000 millimeters equals 1 meter. + """ + MM + + """ + 100 centimeters equals 1 meter. + """ + CM + + """ + Metric system unit of length. + """ + M + + """ + Metric system unit of area. + """ + M2 +} + +""" +Represents an error in the input of a mutation. +""" +type UserError implements DisplayableError { + """ + Path to the input field which caused the error. + """ + field: [String!] + + """ + The error message. + """ + message: String! +} + +""" +Represents a Shopify hosted video. +""" +type Video implements Node & Media { + """ + A word or phrase to share the nature or contents of a media. + """ + alt: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + The media content type. + """ + mediaContentType: MediaContentType! + + """ + The preview image for the media. + """ + previewImage: Image + + """ + The sources for a video. + """ + sources: [VideoSource!]! +} + +""" +Represents a source for a Shopify hosted video. +""" +type VideoSource { + """ + The format of the video source. + """ + format: String! + + """ + The height of the video. + """ + height: Int! + + """ + The video MIME type. + """ + mimeType: String! + + """ + The URL of the video. + """ + url: String! + + """ + The width of the video. + """ + width: Int! +} + +""" +Units of measurement for weight. +""" +enum WeightUnit { + """ + 1 kilogram equals 1000 grams. + """ + KILOGRAMS + + """ + Metric system unit of mass. + """ + GRAMS + + """ + 1 pound equals 16 ounces. + """ + POUNDS + + """ + Imperial system unit of mass. + """ + OUNCES +} diff --git a/packages/shopify/src/api/endpoints/cart.ts b/packages/shopify/src/api/endpoints/cart.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/shopify/src/api/endpoints/cart.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/shopify/src/api/endpoints/catalog/products.ts b/packages/shopify/src/api/endpoints/catalog/products.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/shopify/src/api/endpoints/catalog/products.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/shopify/src/api/endpoints/checkout/get-checkout.ts b/packages/shopify/src/api/endpoints/checkout/get-checkout.ts new file mode 100644 index 0000000..1889150 --- /dev/null +++ b/packages/shopify/src/api/endpoints/checkout/get-checkout.ts @@ -0,0 +1,38 @@ +import { + SHOPIFY_CHECKOUT_ID_COOKIE, + SHOPIFY_CHECKOUT_URL_COOKIE, + SHOPIFY_CUSTOMER_TOKEN_COOKIE, +} from '../../../const' +import associateCustomerWithCheckoutMutation from '../../../utils/mutations/associate-customer-with-checkout' +import type { CheckoutEndpoint } from '.' + +const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ + req, + res, + config, +}) => { + const { cookies } = req + const checkoutUrl = cookies[SHOPIFY_CHECKOUT_URL_COOKIE] + const customerCookie = cookies[SHOPIFY_CUSTOMER_TOKEN_COOKIE] + + if (customerCookie) { + try { + await config.fetch(associateCustomerWithCheckoutMutation, { + variables: { + checkoutId: cookies[SHOPIFY_CHECKOUT_ID_COOKIE], + customerAccessToken: cookies[SHOPIFY_CUSTOMER_TOKEN_COOKIE], + }, + }) + } catch (error) { + console.error(error) + } + } + + if (checkoutUrl) { + res.redirect(checkoutUrl) + } else { + res.redirect('/cart') + } +} + +export default getCheckout diff --git a/packages/shopify/src/api/endpoints/checkout/index.ts b/packages/shopify/src/api/endpoints/checkout/index.ts new file mode 100644 index 0000000..6402081 --- /dev/null +++ b/packages/shopify/src/api/endpoints/checkout/index.ts @@ -0,0 +1,18 @@ +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 getCheckout from './get-checkout' + +export type CheckoutAPI = GetAPISchema + +export type CheckoutEndpoint = CheckoutAPI['endpoint'] + +export const handlers: CheckoutEndpoint['handlers'] = { getCheckout } + +const checkoutApi = createEndpoint({ + handler: checkoutEndpoint, + handlers, +}) + +export default checkoutApi 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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /dev/null +++ b/packages/shopify/src/api/endpoints/customer/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/shopify/src/api/endpoints/login.ts b/packages/shopify/src/api/endpoints/login.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/shopify/src/api/endpoints/login.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/shopify/src/api/endpoints/logout.ts b/packages/shopify/src/api/endpoints/logout.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/shopify/src/api/endpoints/logout.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/shopify/src/api/endpoints/signup.ts b/packages/shopify/src/api/endpoints/signup.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/shopify/src/api/endpoints/signup.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/shopify/src/api/endpoints/wishlist.ts b/packages/shopify/src/api/endpoints/wishlist.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/shopify/src/api/endpoints/wishlist.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/shopify/src/api/index.ts b/packages/shopify/src/api/index.ts new file mode 100644 index 0000000..7ae6a42 --- /dev/null +++ b/packages/shopify/src/api/index.ts @@ -0,0 +1,55 @@ +import { + CommerceAPI, + CommerceAPIConfig, + getCommerceApi as commerceApi, +} from '@vercel/commerce/api' + +import { + API_URL, + API_TOKEN, + SHOPIFY_CUSTOMER_TOKEN_COOKIE, + SHOPIFY_CHECKOUT_ID_COOKIE, +} from '../const' + +import fetchGraphqlApi from './utils/fetch-graphql-api' + +import * as operations from './operations' + +if (!API_URL) { + throw new Error( + `The environment variable NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN is missing and it's required to access your store` + ) +} + +if (!API_TOKEN) { + throw new Error( + `The environment variable NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN is missing and it's required to access your store` + ) +} +export interface ShopifyConfig extends CommerceAPIConfig {} + +const ONE_DAY = 60 * 60 * 24 + +const config: ShopifyConfig = { + commerceUrl: API_URL, + apiToken: API_TOKEN, + customerCookie: SHOPIFY_CUSTOMER_TOKEN_COOKIE, + cartCookie: SHOPIFY_CHECKOUT_ID_COOKIE, + cartCookieMaxAge: ONE_DAY * 30, + fetch: fetchGraphqlApi, +} + +export const provider = { + config, + operations, +} + +export type Provider = typeof provider + +export type ShopifyAPI

= CommerceAPI

+ +export function getCommerceApi

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

{ + return commerceApi(customProvider) +} diff --git a/packages/shopify/src/api/operations/get-all-pages.ts b/packages/shopify/src/api/operations/get-all-pages.ts new file mode 100644 index 0000000..2f6cc09 --- /dev/null +++ b/packages/shopify/src/api/operations/get-all-pages.ts @@ -0,0 +1,71 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import { + GetAllPagesQuery, + GetAllPagesQueryVariables, + PageEdge, +} from '../../../schema' +import { normalizePages } from '../../utils' +import type { ShopifyConfig, Provider } from '..' +import type { GetAllPagesOperation, Page } from '../../types/page' +import getAllPagesQuery from '../../utils/queries/get-all-pages-query' + +export default function getAllPagesOperation({ + commerce, +}: OperationContext) { + async function getAllPages(opts?: { + config?: Partial + preview?: boolean + }): Promise + + async function getAllPages( + opts: { + config?: Partial + preview?: boolean + } & OperationOptions + ): Promise + + async function getAllPages({ + query = getAllPagesQuery, + config, + variables, + }: { + url?: string + config?: Partial + variables?: GetAllPagesQueryVariables + preview?: boolean + query?: string + } = {}): Promise { + const { + fetch, + locale, + locales = ['en-US', 'es'], + } = commerce.getConfig(config) + + const { data } = await fetch( + query, + { + variables, + }, + { + ...(locale && { + headers: { + 'Accept-Language': locale, + }, + }), + } + ) + + return { + pages: locales.reduce( + (arr, locale) => + arr.concat(normalizePages(data.pages.edges as PageEdge[], locale)), + [] + ), + } + } + + return getAllPages +} diff --git a/packages/shopify/src/api/operations/get-all-product-paths.ts b/packages/shopify/src/api/operations/get-all-product-paths.ts new file mode 100644 index 0000000..e5a7d2d --- /dev/null +++ b/packages/shopify/src/api/operations/get-all-product-paths.ts @@ -0,0 +1,55 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import { GetAllProductPathsOperation } from '../../types/product' +import { + GetAllProductPathsQuery, + GetAllProductPathsQueryVariables, + ProductEdge, +} from '../../../schema' +import type { ShopifyConfig, Provider } from '..' +import { getAllProductsQuery } from '../../utils' + +export default function getAllProductPathsOperation({ + commerce, +}: OperationContext) { + async function getAllProductPaths< + T extends GetAllProductPathsOperation + >(opts?: { + variables?: T['variables'] + config?: ShopifyConfig + }): Promise + + async function getAllProductPaths( + opts: { + variables?: T['variables'] + config?: ShopifyConfig + } & OperationOptions + ): Promise + + async function getAllProductPaths({ + query = getAllProductsQuery, + config, + variables, + }: { + query?: string + config?: ShopifyConfig + variables?: T['variables'] + } = {}): Promise { + config = commerce.getConfig(config) + + const { data } = await config.fetch< + GetAllProductPathsQuery, + GetAllProductPathsQueryVariables + >(query, { variables }) + + return { + products: data.products.edges.map(({ node: { handle } }) => ({ + path: `/${handle}`, + })), + } + } + + return getAllProductPaths +} diff --git a/packages/shopify/src/api/operations/get-all-products.ts b/packages/shopify/src/api/operations/get-all-products.ts new file mode 100644 index 0000000..003e272 --- /dev/null +++ b/packages/shopify/src/api/operations/get-all-products.ts @@ -0,0 +1,67 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import { GetAllProductsOperation } from '../../types/product' +import { + GetAllProductsQuery, + GetAllProductsQueryVariables, + Product as ShopifyProduct, +} from '../../../schema' +import type { ShopifyConfig, Provider } from '..' +import getAllProductsQuery from '../../utils/queries/get-all-products-query' +import { normalizeProduct } from '../../utils' + +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({ + query = getAllProductsQuery, + variables, + config, + }: { + query?: string + variables?: T['variables'] + config?: Partial + preview?: boolean + } = {}): Promise { + const { fetch, locale } = commerce.getConfig(config) + + const { data } = await fetch< + GetAllProductsQuery, + GetAllProductsQueryVariables + >( + query, + { variables }, + { + ...(locale && { + headers: { + 'Accept-Language': locale, + }, + }), + } + ) + + return { + products: data.products.edges.map(({ node }) => + normalizeProduct(node as ShopifyProduct) + ), + } + } + + return getAllProducts +} diff --git a/packages/shopify/src/api/operations/get-page.ts b/packages/shopify/src/api/operations/get-page.ts new file mode 100644 index 0000000..2cea521 --- /dev/null +++ b/packages/shopify/src/api/operations/get-page.ts @@ -0,0 +1,64 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import { normalizePage } from '../../utils' +import type { ShopifyConfig, Provider } from '..' +import { + GetPageQuery, + GetPageQueryVariables, + Page as ShopifyPage, +} from '../../../schema' +import { GetPageOperation } from '../../types/page' +import getPageQuery from '../../utils/queries/get-page-query' + +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({ + query = getPageQuery, + variables, + config, + }: { + query?: string + variables: T['variables'] + config?: Partial + preview?: boolean + }): Promise { + const { fetch, locale } = commerce.getConfig(config) + + const { + data: { node: page }, + } = await fetch( + query, + { + variables, + }, + { + ...(locale && { + headers: { + 'Accept-Language': locale, + }, + }), + } + ) + + return page ? { page: normalizePage(page as ShopifyPage, locale) } : {} + } + + return getPage +} diff --git a/packages/shopify/src/api/operations/get-product.ts b/packages/shopify/src/api/operations/get-product.ts new file mode 100644 index 0000000..1697b0f --- /dev/null +++ b/packages/shopify/src/api/operations/get-product.ts @@ -0,0 +1,66 @@ +import type { + OperationContext, + OperationOptions, +} 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' + +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 = getProductQuery, + variables, + config: cfg, + }: { + query?: string + variables: T['variables'] + config?: Partial + preview?: boolean + }): Promise { + const { fetch, locale } = commerce.getConfig(cfg) + + const { + data: { productByHandle }, + } = await fetch( + query, + { + variables, + }, + { + ...(locale && { + headers: { + 'Accept-Language': locale, + }, + }), + } + ) + + return { + ...(productByHandle && { + product: normalizeProduct(productByHandle as ShopifyProduct), + }), + } + } + + return getProduct +} diff --git a/packages/shopify/src/api/operations/get-site-info.ts b/packages/shopify/src/api/operations/get-site-info.ts new file mode 100644 index 0000000..6bb6de4 --- /dev/null +++ b/packages/shopify/src/api/operations/get-site-info.ts @@ -0,0 +1,62 @@ +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import { GetSiteInfoQueryVariables } from '../../../schema' +import type { ShopifyConfig, Provider } from '..' +import { GetSiteInfoOperation } from '../../types/site' + +import { getCategories, getBrands, getSiteInfoQuery } from '../../utils' + +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 = getSiteInfoQuery, + config, + variables, + }: { + query?: string + config?: Partial + preview?: boolean + variables?: GetSiteInfoQueryVariables + } = {}): Promise { + const cfg = commerce.getConfig(config) + + const categoriesPromise = getCategories(cfg) + const brandsPromise = getBrands(cfg) + /* + const { fetch, locale } = cfg + const { data } = await fetch( + query, + { variables }, + { + ...(locale && { + headers: { + 'Accept-Language': locale, + }, + }), + } + ) + */ + + return { + categories: await categoriesPromise, + brands: await brandsPromise, + } + } + + return getSiteInfo +} diff --git a/packages/shopify/src/api/operations/index.ts b/packages/shopify/src/api/operations/index.ts new file mode 100644 index 0000000..7872a20 --- /dev/null +++ b/packages/shopify/src/api/operations/index.ts @@ -0,0 +1,7 @@ +export { default as getAllPages } from './get-all-pages' +export { default as getPage } from './get-page' +export { default as getAllProducts } from './get-all-products' +export { default as getAllProductPaths } from './get-all-product-paths' +export { default as getProduct } from './get-product' +export { default as getSiteInfo } from './get-site-info' +export { default as login } from './login' diff --git a/packages/shopify/src/api/operations/login.ts b/packages/shopify/src/api/operations/login.ts new file mode 100644 index 0000000..5fad769 --- /dev/null +++ b/packages/shopify/src/api/operations/login.ts @@ -0,0 +1,48 @@ +import type { ServerResponse } from 'http' +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { LoginOperation } from '../../types/login' +import type { ShopifyConfig, Provider } from '..' +import { + customerAccessTokenCreateMutation, + setCustomerToken, + throwUserErrors, +} from '../../utils' +import { CustomerAccessTokenCreateMutation } from '../../../schema' + +export default function loginOperation({ + commerce, +}: OperationContext) { + async function login({ + query = customerAccessTokenCreateMutation, + variables, + config, + }: { + query?: string + variables: T['variables'] + res: ServerResponse + config?: ShopifyConfig + }): Promise { + config = commerce.getConfig(config) + + const { + data: { customerAccessTokenCreate }, + } = await config.fetch(query, { + variables, + }) + + throwUserErrors(customerAccessTokenCreate?.customerUserErrors) + + const customerAccessToken = customerAccessTokenCreate?.customerAccessToken + const accessToken = customerAccessToken?.accessToken + + if (accessToken) { + setCustomerToken(accessToken) + } + + return { + result: customerAccessToken?.accessToken, + } + } + + return login +} diff --git a/packages/shopify/src/api/utils/fetch-graphql-api.ts b/packages/shopify/src/api/utils/fetch-graphql-api.ts new file mode 100644 index 0000000..1970db5 --- /dev/null +++ b/packages/shopify/src/api/utils/fetch-graphql-api.ts @@ -0,0 +1,45 @@ +import type { GraphQLFetcher } from '@vercel/commerce/api' +import fetch from './fetch' + +import { API_URL, API_TOKEN } from '../../const' +import { getError } from '../../utils/handle-fetch-response' + +const fetchGraphqlApi: GraphQLFetcher = async ( + query: string, + { variables } = {}, + fetchOptions +) => { + try { + const res = await fetch(API_URL, { + ...fetchOptions, + method: 'POST', + headers: { + 'X-Shopify-Storefront-Access-Token': API_TOKEN!, + ...fetchOptions?.headers, + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + query, + variables, + }), + }) + + const { data, errors, status } = await res.json() + + if (errors) { + throw getError(errors, status) + } + + return { data, res } + } catch (err) { + throw getError( + [ + { + message: `${err} \n Most likely related to an unexpected output. e.g the store might be protected with password or not available.`, + }, + ], + 500 + ) + } +} +export default fetchGraphqlApi diff --git a/packages/shopify/src/api/utils/fetch.ts b/packages/shopify/src/api/utils/fetch.ts new file mode 100644 index 0000000..0b83671 --- /dev/null +++ b/packages/shopify/src/api/utils/fetch.ts @@ -0,0 +1,2 @@ +import zeitFetch from '@vercel/fetch' +export default zeitFetch() diff --git a/packages/shopify/src/auth/use-login.tsx b/packages/shopify/src/auth/use-login.tsx new file mode 100644 index 0000000..c9d183e --- /dev/null +++ b/packages/shopify/src/auth/use-login.tsx @@ -0,0 +1,63 @@ +import { useCallback } from 'react' +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' + +import { + setCustomerToken, + throwUserErrors, + customerAccessTokenCreateMutation, +} from '../utils' +import { Mutation, MutationCustomerAccessTokenCreateArgs } from '../../schema' + +export default useLogin as UseLogin + +export const handler: MutationHook = { + fetchOptions: { + query: customerAccessTokenCreateMutation, + }, + async fetcher({ input: { email, password }, options, fetch }) { + if (!(email && password)) { + throw new CommerceError({ + message: 'An email and password are required to login', + }) + } + + const { customerAccessTokenCreate } = await fetch< + Mutation, + MutationCustomerAccessTokenCreateArgs + >({ + ...options, + variables: { + input: { email, password }, + }, + }) + + throwUserErrors(customerAccessTokenCreate?.customerUserErrors) + + const customerAccessToken = customerAccessTokenCreate?.customerAccessToken + const accessToken = customerAccessToken?.accessToken + + if (accessToken) { + setCustomerToken(accessToken) + } + + return null + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCustomer() + + return useCallback( + async function login(input) { + const data = await fetch({ input }) + await mutate() + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/shopify/src/auth/use-logout.tsx b/packages/shopify/src/auth/use-logout.tsx new file mode 100644 index 0000000..c37b0fc --- /dev/null +++ b/packages/shopify/src/auth/use-logout.tsx @@ -0,0 +1,39 @@ +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 customerAccessTokenDeleteMutation from '../utils/mutations/customer-access-token-delete' +import { getCustomerToken, setCustomerToken } from '../utils/customer-token' + +export default useLogout as UseLogout + +export const handler: MutationHook = { + fetchOptions: { + query: customerAccessTokenDeleteMutation, + }, + async fetcher({ options, fetch }) { + await fetch({ + ...options, + variables: { + customerAccessToken: getCustomerToken(), + }, + }) + setCustomerToken(null) + return null + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCustomer() + + return useCallback( + async function logout() { + const data = await fetch() + await mutate(null, false) + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/shopify/src/auth/use-signup.tsx b/packages/shopify/src/auth/use-signup.tsx new file mode 100644 index 0000000..8af0fec --- /dev/null +++ b/packages/shopify/src/auth/use-signup.tsx @@ -0,0 +1,67 @@ +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' +import { Mutation, MutationCustomerCreateArgs } from '../../schema' + +import { + handleAutomaticLogin, + throwUserErrors, + customerCreateMutation, +} from '../utils' + +export default useSignup as UseSignup + +export const handler: MutationHook = { + fetchOptions: { + query: customerCreateMutation, + }, + 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', + }) + } + + const { customerCreate } = await fetch< + Mutation, + MutationCustomerCreateArgs + >({ + ...options, + variables: { + input: { + firstName, + lastName, + email, + password, + }, + }, + }) + + throwUserErrors(customerCreate?.customerUserErrors) + await handleAutomaticLogin(fetch, { email, password }) + + return null + }, + 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/packages/shopify/src/cart/index.ts b/packages/shopify/src/cart/index.ts new file mode 100644 index 0000000..f6d36b4 --- /dev/null +++ b/packages/shopify/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 useUpdateItem } from './use-update-item' +export { default as useRemoveItem } from './use-remove-item' diff --git a/packages/shopify/src/cart/use-add-item.tsx b/packages/shopify/src/cart/use-add-item.tsx new file mode 100644 index 0000000..5460bd7 --- /dev/null +++ b/packages/shopify/src/cart/use-add-item.tsx @@ -0,0 +1,70 @@ +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 '../types/cart' +import useCart from './use-cart' + +import { + checkoutLineItemAddMutation, + getCheckoutId, + checkoutToCart, + checkoutCreate, +} from '../utils' +import { Mutation, MutationCheckoutLineItemsAddArgs } from '../../schema' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: checkoutLineItemAddMutation, + }, + 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 lineItems = [ + { + variantId: item.variantId, + quantity: item.quantity ?? 1, + }, + ] + + 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 }) + await mutate(data, false) + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/shopify/src/cart/use-cart.tsx b/packages/shopify/src/cart/use-cart.tsx new file mode 100644 index 0000000..2fe68be --- /dev/null +++ b/packages/shopify/src/cart/use-cart.tsx @@ -0,0 +1,60 @@ +import { useMemo } from 'react' +import useCommerceCart, { UseCart } from '@vercel/commerce/cart/use-cart' + +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 { + SHOPIFY_CHECKOUT_ID_COOKIE, + SHOPIFY_CHECKOUT_URL_COOKIE, +} from '../const' + +export default useCommerceCart as UseCart + +export const handler: SWRHook = { + fetchOptions: { + query: getCheckoutQuery, + }, + async fetcher({ input: { cartId }, options, fetch }) { + if (cartId) { + const { node: checkout } = await fetch({ + ...options, + variables: { + checkoutId: cartId, + }, + }) + if (checkout?.completedAt) { + Cookies.remove(SHOPIFY_CHECKOUT_ID_COOKIE) + Cookies.remove(SHOPIFY_CHECKOUT_URL_COOKIE) + return null + } else { + return checkoutToCart({ + checkout, + }) + } + } + return null + }, + 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/shopify/src/cart/use-remove-item.tsx b/packages/shopify/src/cart/use-remove-item.tsx new file mode 100644 index 0000000..d04c7c5 --- /dev/null +++ b/packages/shopify/src/cart/use-remove-item.tsx @@ -0,0 +1,67 @@ +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 '../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 + +import { + checkoutLineItemRemoveMutation, + getCheckoutId, + checkoutToCart, +} from '../utils' + +import { Mutation, MutationCheckoutLineItemsRemoveArgs } from '../../schema' + +export const handler = { + fetchOptions: { + query: checkoutLineItemRemoveMutation, + }, + async fetcher({ + input: { itemId }, + options, + fetch, + }: HookFetcherContext) { + const data = await fetch({ + ...options, + variables: { checkoutId: getCheckoutId(), lineItemIds: [itemId] }, + }) + return checkoutToCart(data.checkoutLineItemsRemove) + }, + 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/shopify/src/cart/use-update-item.tsx b/packages/shopify/src/cart/use-update-item.tsx new file mode 100644 index 0000000..0e8258a --- /dev/null +++ b/packages/shopify/src/cart/use-update-item.tsx @@ -0,0 +1,107 @@ +import { useCallback } from 'react' +import debounce from 'lodash.debounce' +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 { UpdateItemHook, LineItem } from '../types/cart' +import { + getCheckoutId, + checkoutLineItemUpdateMutation, + checkoutToCart, +} from '../utils' +import { Mutation, MutationCheckoutLineItemsUpdateArgs } from '../../schema' + +export type UpdateItemActionInput = T extends LineItem + ? Partial + : UpdateItemHook['actionInput'] + +export default useUpdateItem as UseUpdateItem + +export const handler = { + fetchOptions: { + query: checkoutLineItemUpdateMutation, + }, + 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', + }) + } + const { checkoutLineItemsUpdate } = await fetch< + Mutation, + MutationCheckoutLineItemsUpdateArgs + >({ + ...options, + variables: { + checkoutId: getCheckoutId(), + lineItems: [ + { + id: itemId, + quantity: item.quantity, + }, + ], + }, + }) + + return checkoutToCart(checkoutLineItemsUpdate) + }, + 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: { + item: { + productId, + variantId, + quantity: input.quantity, + }, + itemId, + }, + }) + await mutate(data, false) + return data + }, ctx.wait ?? 500), + [fetch, mutate] + ) + }, +} diff --git a/packages/shopify/src/checkout/use-checkout.tsx b/packages/shopify/src/checkout/use-checkout.tsx new file mode 100644 index 0000000..76997be --- /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 0000000..b194b62 --- /dev/null +++ b/packages/shopify/src/commerce.config.json @@ -0,0 +1,7 @@ +{ + "provider": "shopify", + "features": { + "wishlist": false, + "customerAuth": true + } +} diff --git a/packages/shopify/src/const.ts b/packages/shopify/src/const.ts new file mode 100644 index 0000000..a8ee705 --- /dev/null +++ b/packages/shopify/src/const.ts @@ -0,0 +1,13 @@ +export const SHOPIFY_CHECKOUT_ID_COOKIE = 'shopify_checkoutId' + +export const SHOPIFY_CHECKOUT_URL_COOKIE = 'shopify_checkoutUrl' + +export const SHOPIFY_CUSTOMER_TOKEN_COOKIE = 'shopify_customerToken' + +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-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 0000000..4f85c84 --- /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 0000000..77d149e --- /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 0000000..6c903ec --- /dev/null +++ b/packages/shopify/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/packages/shopify/src/customer/use-customer.tsx b/packages/shopify/src/customer/use-customer.tsx new file mode 100644 index 0000000..6fc9a53 --- /dev/null +++ b/packages/shopify/src/customer/use-customer.tsx @@ -0,0 +1,36 @@ +import useCustomer, { + UseCustomer, +} from '@vercel/commerce/customer/use-customer' +import type { CustomerHook } from '../types/customer' +import { SWRHook } from '@vercel/commerce/utils/types' +import { getCustomerQuery, getCustomerToken } from '../utils' +import { GetCustomerQuery, GetCustomerQueryVariables } from '../../schema' + +export default useCustomer as UseCustomer + +export const handler: SWRHook = { + fetchOptions: { + query: getCustomerQuery, + }, + async fetcher({ options, fetch }) { + const customerAccessToken = getCustomerToken() + if (customerAccessToken) { + const data = await fetch({ + ...options, + variables: { customerAccessToken: getCustomerToken() }, + }) + return data.customer + } + return null + }, + useHook: + ({ useData }) => + (input) => { + return useData({ + swrOptions: { + revalidateOnFocus: false, + ...input?.swrOptions, + }, + }) + }, +} diff --git a/packages/shopify/src/fetcher.ts b/packages/shopify/src/fetcher.ts new file mode 100644 index 0000000..64f4926 --- /dev/null +++ b/packages/shopify/src/fetcher.ts @@ -0,0 +1,27 @@ +import { Fetcher } from '@vercel/commerce/utils/types' +import { API_TOKEN, API_URL } from './const' +import { handleFetchResponse } from './utils' + +const fetcher: Fetcher = async ({ + url = API_URL, + method = 'POST', + variables, + query, +}) => { + const { locale, ...vars } = variables ?? {} + return handleFetchResponse( + await fetch(url, { + method, + body: JSON.stringify({ query, variables: vars }), + headers: { + 'X-Shopify-Storefront-Access-Token': API_TOKEN!, + 'Content-Type': 'application/json', + ...(locale && { + 'Accept-Language': locale, + }), + }, + }) + ) +} + +export default fetcher diff --git a/packages/shopify/src/index.tsx b/packages/shopify/src/index.tsx new file mode 100644 index 0000000..51199bb --- /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/packages/shopify/src/next.config.cjs b/packages/shopify/src/next.config.cjs new file mode 100644 index 0000000..e9d48c0 --- /dev/null +++ b/packages/shopify/src/next.config.cjs @@ -0,0 +1,8 @@ +const commerce = require('./commerce.config.json') + +module.exports = { + commerce, + images: { + domains: ['cdn.shopify.com'], + }, +} diff --git a/packages/shopify/src/product/use-price.tsx b/packages/shopify/src/product/use-price.tsx new file mode 100644 index 0000000..fd42d70 --- /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/packages/shopify/src/product/use-search.tsx b/packages/shopify/src/product/use-search.tsx new file mode 100644 index 0000000..582423e --- /dev/null +++ b/packages/shopify/src/product/use-search.tsx @@ -0,0 +1,91 @@ +import { SWRHook } from '@vercel/commerce/utils/types' +import useSearch, { UseSearch } from '@vercel/commerce/product/use-search' + +import { + CollectionEdge, + GetAllProductsQuery, + GetProductsFromCollectionQueryVariables, + Product as ShopifyProduct, + ProductEdge, +} from '../../schema' + +import { + getAllProductsQuery, + getCollectionProductsQuery, + getSearchVariables, + normalizeProduct, +} from '../utils' + +import type { SearchProductsHook } from '../types/product' + +export type SearchProductsInput = { + search?: string + categoryId?: number + brandId?: number + sort?: string + locale?: string +} + +export default useSearch as UseSearch + +export const handler: SWRHook = { + fetchOptions: { + query: getAllProductsQuery, + }, + async fetcher({ input, options, fetch }) { + const { categoryId, brandId } = input + const method = options?.method + const variables = getSearchVariables(input) + let products + + // change the query to getCollectionProductsQuery when categoryId is set + if (categoryId) { + const data = await fetch< + CollectionEdge, + GetProductsFromCollectionQueryVariables + >({ + query: getCollectionProductsQuery, + method, + variables, + }) + // filter on client when brandId & categoryId are set since is not available on collection product query + products = brandId + ? data.node?.products?.edges?.filter( + ({ node: { vendor } }: ProductEdge) => + vendor.replace(/\s+/g, '-').toLowerCase() === brandId + ) + : data.node?.products?.edges + } else { + const data = await fetch({ + query: options.query, + method, + variables, + }) + products = data.products?.edges + } + + return { + products: products?.map(({ node }) => + normalizeProduct(node as ShopifyProduct) + ), + found: !!products?.length, + } + }, + useHook: + ({ useData }) => + (input = {}) => { + return useData({ + input: [ + ['search', input.search], + ['categoryId', input.categoryId], + ['brandId', input.brandId], + ['sort', input.sort], + ['locale', input.locale], + ], + swrOptions: { + revalidateOnFocus: false, + ...input.swrOptions, + }, + }) + }, +} diff --git a/packages/shopify/src/provider.ts b/packages/shopify/src/provider.ts new file mode 100644 index 0000000..00db5c1 --- /dev/null +++ b/packages/shopify/src/provider.ts @@ -0,0 +1,27 @@ +import { SHOPIFY_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' +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 fetcher from './fetcher' + +export const shopifyProvider = { + locale: 'en-us', + cartCookie: SHOPIFY_CHECKOUT_ID_COOKIE, + fetcher, + cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, + customer: { useCustomer }, + products: { useSearch }, + auth: { useLogin, useLogout, useSignup }, +} + +export type ShopifyProvider = typeof shopifyProvider diff --git a/packages/shopify/src/types/cart.ts b/packages/shopify/src/types/cart.ts new file mode 100644 index 0000000..243d369 --- /dev/null +++ b/packages/shopify/src/types/cart.ts @@ -0,0 +1,32 @@ +import * as Core from '@vercel/commerce/types/cart' + +export * from '@vercel/commerce/types/cart' + +export type ShopifyCart = {} + +/** + * 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/shopify/src/types/checkout.ts b/packages/shopify/src/types/checkout.ts new file mode 100644 index 0000000..d139db6 --- /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 0000000..23b8daa --- /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 0000000..6e66366 --- /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/packages/shopify/src/types/index.ts b/packages/shopify/src/types/index.ts new file mode 100644 index 0000000..7ab0b7f --- /dev/null +++ b/packages/shopify/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/shopify/src/types/login.ts b/packages/shopify/src/types/login.ts new file mode 100644 index 0000000..ab99bf8 --- /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 0000000..1de06f8 --- /dev/null +++ b/packages/shopify/src/types/logout.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/logout' diff --git a/packages/shopify/src/types/page.ts b/packages/shopify/src/types/page.ts new file mode 100644 index 0000000..ccbc29f --- /dev/null +++ b/packages/shopify/src/types/page.ts @@ -0,0 +1,11 @@ +import * as Core from '@vercel/commerce/types/page' +export * from '@vercel/commerce/types/page' + +export type Page = Core.Page + +export type PageTypes = { + page: Page +} + +export type GetAllPagesOperation = Core.GetAllPagesOperation +export type GetPageOperation = Core.GetPageOperation diff --git a/packages/shopify/src/types/product.ts b/packages/shopify/src/types/product.ts new file mode 100644 index 0000000..72ca02f --- /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 0000000..3f0d1af --- /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 0000000..96a2e47 --- /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 0000000..af92d9f --- /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 0000000..2f681c9 --- /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/packages/shopify/src/utils/checkout-to-cart.ts b/packages/shopify/src/utils/checkout-to-cart.ts new file mode 100644 index 0000000..97b3f0a --- /dev/null +++ b/packages/shopify/src/utils/checkout-to-cart.ts @@ -0,0 +1,41 @@ +import type { Cart } from '../types/cart' +import { CommerceError } from '@vercel/commerce/utils/errors' + +import { + CheckoutLineItemsAddPayload, + CheckoutLineItemsRemovePayload, + CheckoutLineItemsUpdatePayload, + CheckoutCreatePayload, + CheckoutUserError, + Checkout, + Maybe, +} from '../../schema' + +import { normalizeCart } from './normalize' +import throwUserErrors from './throw-user-errors' + +export type CheckoutQuery = { + checkout: Checkout + checkoutUserErrors?: Array +} + +export type CheckoutPayload = + | CheckoutLineItemsAddPayload + | CheckoutLineItemsUpdatePayload + | CheckoutLineItemsRemovePayload + | CheckoutCreatePayload + | CheckoutQuery + +const checkoutToCart = (checkoutPayload?: Maybe): Cart => { + throwUserErrors(checkoutPayload?.checkoutUserErrors) + + if (!checkoutPayload?.checkout) { + throw new CommerceError({ + message: 'Missing checkout object from response', + }) + } + + 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 0000000..f9822c4 --- /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/packages/shopify/src/utils/customer-token.ts b/packages/shopify/src/utils/customer-token.ts new file mode 100644 index 0000000..85454cb --- /dev/null +++ b/packages/shopify/src/utils/customer-token.ts @@ -0,0 +1,21 @@ +import Cookies, { CookieAttributes } from 'js-cookie' +import { SHOPIFY_COOKIE_EXPIRE, SHOPIFY_CUSTOMER_TOKEN_COOKIE } from '../const' + +export const getCustomerToken = () => Cookies.get(SHOPIFY_CUSTOMER_TOKEN_COOKIE) + +export const setCustomerToken = ( + token: string | null, + options?: CookieAttributes +) => { + if (!token) { + Cookies.remove(SHOPIFY_CUSTOMER_TOKEN_COOKIE) + } else { + Cookies.set( + SHOPIFY_CUSTOMER_TOKEN_COOKIE, + token, + options ?? { + expires: SHOPIFY_COOKIE_EXPIRE, + } + ) + } +} diff --git a/packages/shopify/src/utils/get-brands.ts b/packages/shopify/src/utils/get-brands.ts new file mode 100644 index 0000000..eb87b51 --- /dev/null +++ b/packages/shopify/src/utils/get-brands.ts @@ -0,0 +1,44 @@ +import { + GetAllProductVendorsQuery, + GetAllProductVendorsQueryVariables, +} from '../../schema' +import { ShopifyConfig } from '../api' +import getAllProductVendors from './queries/get-all-product-vendors-query' + +export type Brand = { + entityId: string + name: string + path: string +} + +export type BrandEdge = { + node: Brand +} + +export type Brands = BrandEdge[] + +const getBrands = async (config: ShopifyConfig): Promise => { + const { data } = await config.fetch< + GetAllProductVendorsQuery, + GetAllProductVendorsQueryVariables + >(getAllProductVendors, { + variables: { + first: 250, + }, + }) + + let vendorsStrings = data.products.edges.map(({ node: { vendor } }) => vendor) + + return [...new Set(vendorsStrings)].map((v) => { + const id = v.replace(/\s+/g, '-').toLowerCase() + return { + node: { + entityId: id, + name: v, + path: `brands/${id}`, + }, + } + }) +} + +export default getBrands diff --git a/packages/shopify/src/utils/get-categories.ts b/packages/shopify/src/utils/get-categories.ts new file mode 100644 index 0000000..e5ca16d --- /dev/null +++ b/packages/shopify/src/utils/get-categories.ts @@ -0,0 +1,34 @@ +import type { Category } from '../types/site' +import { ShopifyConfig } from '../api' +import { CollectionEdge } from '../../schema' +import { normalizeCategory } from './normalize' +import getSiteCollectionsQuery from './queries/get-all-collections-query' + +const getCategories = async ({ + fetch, + locale, +}: ShopifyConfig): Promise => { + const { data } = await fetch( + getSiteCollectionsQuery, + { + variables: { + first: 250, + }, + }, + { + ...(locale && { + headers: { + 'Accept-Language': locale, + }, + }), + } + ) + + return ( + data.collections?.edges?.map(({ node }: CollectionEdge) => + normalizeCategory(node) + ) ?? [] + ) +} + +export default getCategories diff --git a/packages/shopify/src/utils/get-checkout-id.ts b/packages/shopify/src/utils/get-checkout-id.ts new file mode 100644 index 0000000..11e3802 --- /dev/null +++ b/packages/shopify/src/utils/get-checkout-id.ts @@ -0,0 +1,8 @@ +import Cookies from 'js-cookie' +import { SHOPIFY_CHECKOUT_ID_COOKIE } from '../const' + +const getCheckoutId = (id?: string) => { + return id ?? Cookies.get(SHOPIFY_CHECKOUT_ID_COOKIE) +} + +export default getCheckoutId diff --git a/packages/shopify/src/utils/get-search-variables.ts b/packages/shopify/src/utils/get-search-variables.ts new file mode 100644 index 0000000..f486365 --- /dev/null +++ b/packages/shopify/src/utils/get-search-variables.ts @@ -0,0 +1,31 @@ +import getSortVariables from './get-sort-variables' +import { SearchProductsBody } from '../types/product' + +export const getSearchVariables = ({ + brandId, + search, + categoryId, + sort, + locale, +}: SearchProductsBody) => { + let query = '' + + if (search) { + query += `product_type:${search} OR title:${search} OR tag:${search} ` + } + + if (brandId) { + query += `${search ? 'AND ' : ''}vendor:${brandId}` + } + + return { + categoryId, + query, + ...getSortVariables(sort, !!categoryId), + ...(locale && { + locale, + }), + } +} + +export default getSearchVariables diff --git a/packages/shopify/src/utils/get-sort-variables.ts b/packages/shopify/src/utils/get-sort-variables.ts new file mode 100644 index 0000000..141d9a1 --- /dev/null +++ b/packages/shopify/src/utils/get-sort-variables.ts @@ -0,0 +1,32 @@ +const getSortVariables = (sort?: string, isCategory: boolean = false) => { + let output = {} + switch (sort) { + case 'price-asc': + output = { + sortKey: 'PRICE', + reverse: false, + } + break + case 'price-desc': + output = { + sortKey: 'PRICE', + reverse: true, + } + break + case 'trending-desc': + output = { + sortKey: 'BEST_SELLING', + reverse: false, + } + break + case 'latest-desc': + output = { + sortKey: isCategory ? 'CREATED' : 'CREATED_AT', + reverse: true, + } + break + } + return output +} + +export default getSortVariables diff --git a/packages/shopify/src/utils/handle-account-activation.ts b/packages/shopify/src/utils/handle-account-activation.ts new file mode 100644 index 0000000..2519590 --- /dev/null +++ b/packages/shopify/src/utils/handle-account-activation.ts @@ -0,0 +1,30 @@ +import { FetcherOptions } from '@vercel/commerce/utils/types' +import throwUserErrors from './throw-user-errors' + +import { + MutationCustomerActivateArgs, + MutationCustomerActivateByUrlArgs, +} from '../../schema' +import { Mutation } from '../../schema' +import { customerActivateByUrlMutation } from './mutations' + +const handleAccountActivation = async ( + fetch: (options: FetcherOptions) => Promise, + input: MutationCustomerActivateByUrlArgs +) => { + try { + const { customerActivateByUrl } = await fetch< + Mutation, + MutationCustomerActivateArgs + >({ + query: customerActivateByUrlMutation, + variables: { + input, + }, + }) + + throwUserErrors(customerActivateByUrl?.customerUserErrors) + } catch (error) {} +} + +export default handleAccountActivation diff --git a/packages/shopify/src/utils/handle-fetch-response.ts b/packages/shopify/src/utils/handle-fetch-response.ts new file mode 100644 index 0000000..927ab54 --- /dev/null +++ b/packages/shopify/src/utils/handle-fetch-response.ts @@ -0,0 +1,27 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' + +export function getError(errors: any[] | null, status: number) { + errors = errors ?? [{ message: 'Failed to fetch Shopify API' }] + return new FetcherError({ errors, status }) +} + +export async function getAsyncError(res: Response) { + const data = await res.json() + return getError(data.errors, res.status) +} + +const handleFetchResponse = async (res: Response) => { + if (res.ok) { + const { data, errors } = await res.json() + + if (errors && errors.length) { + throw getError(errors, res.status) + } + + return data + } + + throw await getAsyncError(res) +} + +export default handleFetchResponse diff --git a/packages/shopify/src/utils/handle-login.ts b/packages/shopify/src/utils/handle-login.ts new file mode 100644 index 0000000..dda6f6e --- /dev/null +++ b/packages/shopify/src/utils/handle-login.ts @@ -0,0 +1,36 @@ +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' + +const handleLogin = (data: any) => { + const response = data.customerAccessTokenCreate + throwUserErrors(response?.customerUserErrors) + + const customerAccessToken = response?.customerAccessToken + const accessToken = customerAccessToken?.accessToken + + if (accessToken) { + setCustomerToken(accessToken) + } + + return customerAccessToken +} + +export const handleAutomaticLogin = async ( + fetch: (options: FetcherOptions) => Promise, + input: CustomerAccessTokenCreateInput +) => { + try { + const loginData = await fetch({ + query: customerAccessTokenCreateMutation, + variables: { + input, + }, + }) + handleLogin(loginData) + } catch (error) {} +} + +export default handleLogin diff --git a/packages/shopify/src/utils/index.ts b/packages/shopify/src/utils/index.ts new file mode 100644 index 0000000..a8454ff --- /dev/null +++ b/packages/shopify/src/utils/index.ts @@ -0,0 +1,15 @@ +export { default as handleFetchResponse } from './handle-fetch-response' +export { default as getSearchVariables } from './get-search-variables' +export { default as getSortVariables } from './get-sort-variables' +export { default as getBrands } from './get-brands' +export { default as getCategories } from './get-categories' +export { default as getCheckoutId } from './get-checkout-id' +export { default as checkoutCreate } from './checkout-create' +export { default as checkoutToCart } from './checkout-to-cart' +export { default as handleLogin, handleAutomaticLogin } from './handle-login' +export { default as handleAccountActivation } from './handle-account-activation' +export { default as throwUserErrors } from './throw-user-errors' +export * from './queries' +export * from './mutations' +export * from './normalize' +export * from './customer-token' diff --git a/packages/shopify/src/utils/mutations/associate-customer-with-checkout.ts b/packages/shopify/src/utils/mutations/associate-customer-with-checkout.ts new file mode 100644 index 0000000..6b1350e --- /dev/null +++ b/packages/shopify/src/utils/mutations/associate-customer-with-checkout.ts @@ -0,0 +1,18 @@ +const associateCustomerWithCheckoutMutation = /* GraphQl */ ` +mutation associateCustomerWithCheckout($checkoutId: ID!, $customerAccessToken: String!) { + checkoutCustomerAssociateV2(checkoutId: $checkoutId, customerAccessToken: $customerAccessToken) { + checkout { + id + } + checkoutUserErrors { + code + field + message + } + customer { + id + } + } + } +` +export default associateCustomerWithCheckoutMutation diff --git a/packages/shopify/src/utils/mutations/checkout-create.ts b/packages/shopify/src/utils/mutations/checkout-create.ts new file mode 100644 index 0000000..7bff7e7 --- /dev/null +++ b/packages/shopify/src/utils/mutations/checkout-create.ts @@ -0,0 +1,19 @@ +import { checkoutDetailsFragment } from '../queries/get-checkout-query' + +const checkoutCreateMutation = /* GraphQL */ ` + mutation checkoutCreate($input: CheckoutCreateInput = {}) { + checkoutCreate(input: $input) { + checkoutUserErrors { + code + field + message + } + checkout { + ...checkoutDetails + } + } + } + + ${checkoutDetailsFragment} +` +export default checkoutCreateMutation diff --git a/packages/shopify/src/utils/mutations/checkout-line-item-add.ts b/packages/shopify/src/utils/mutations/checkout-line-item-add.ts new file mode 100644 index 0000000..02f5b71 --- /dev/null +++ b/packages/shopify/src/utils/mutations/checkout-line-item-add.ts @@ -0,0 +1,22 @@ +import { checkoutDetailsFragment } from '../queries/get-checkout-query' + +const checkoutLineItemAddMutation = /* GraphQL */ ` + mutation checkoutLineItemAdd( + $checkoutId: ID! + $lineItems: [CheckoutLineItemInput!]! + ) { + checkoutLineItemsAdd(checkoutId: $checkoutId, lineItems: $lineItems) { + checkoutUserErrors { + code + field + message + } + checkout { + ...checkoutDetails + } + } + } + + ${checkoutDetailsFragment} +` +export default checkoutLineItemAddMutation diff --git a/packages/shopify/src/utils/mutations/checkout-line-item-remove.ts b/packages/shopify/src/utils/mutations/checkout-line-item-remove.ts new file mode 100644 index 0000000..30cb830 --- /dev/null +++ b/packages/shopify/src/utils/mutations/checkout-line-item-remove.ts @@ -0,0 +1,21 @@ +import { checkoutDetailsFragment } from '../queries/get-checkout-query' + +const checkoutLineItemRemoveMutation = /* GraphQL */ ` + mutation checkoutLineItemRemove($checkoutId: ID!, $lineItemIds: [ID!]!) { + checkoutLineItemsRemove( + checkoutId: $checkoutId + lineItemIds: $lineItemIds + ) { + checkoutUserErrors { + code + field + message + } + checkout { + ...checkoutDetails + } + } + } + ${checkoutDetailsFragment} +` +export default checkoutLineItemRemoveMutation diff --git a/packages/shopify/src/utils/mutations/checkout-line-item-update.ts b/packages/shopify/src/utils/mutations/checkout-line-item-update.ts new file mode 100644 index 0000000..fca617f --- /dev/null +++ b/packages/shopify/src/utils/mutations/checkout-line-item-update.ts @@ -0,0 +1,22 @@ +import { checkoutDetailsFragment } from '../queries/get-checkout-query' + +const checkoutLineItemUpdateMutation = /* GraphQL */ ` + mutation checkoutLineItemUpdate( + $checkoutId: ID! + $lineItems: [CheckoutLineItemUpdateInput!]! + ) { + checkoutLineItemsUpdate(checkoutId: $checkoutId, lineItems: $lineItems) { + checkoutUserErrors { + code + field + message + } + checkout { + ...checkoutDetails + } + } + } + + ${checkoutDetailsFragment} +` +export default checkoutLineItemUpdateMutation diff --git a/packages/shopify/src/utils/mutations/customer-access-token-create.ts b/packages/shopify/src/utils/mutations/customer-access-token-create.ts new file mode 100644 index 0000000..7a45c3f --- /dev/null +++ b/packages/shopify/src/utils/mutations/customer-access-token-create.ts @@ -0,0 +1,16 @@ +const customerAccessTokenCreateMutation = /* GraphQL */ ` + mutation customerAccessTokenCreate($input: CustomerAccessTokenCreateInput!) { + customerAccessTokenCreate(input: $input) { + customerAccessToken { + accessToken + expiresAt + } + customerUserErrors { + code + field + message + } + } + } +` +export default customerAccessTokenCreateMutation diff --git a/packages/shopify/src/utils/mutations/customer-access-token-delete.ts b/packages/shopify/src/utils/mutations/customer-access-token-delete.ts new file mode 100644 index 0000000..c46eff1 --- /dev/null +++ b/packages/shopify/src/utils/mutations/customer-access-token-delete.ts @@ -0,0 +1,14 @@ +const customerAccessTokenDeleteMutation = /* GraphQL */ ` + mutation customerAccessTokenDelete($customerAccessToken: String!) { + customerAccessTokenDelete(customerAccessToken: $customerAccessToken) { + deletedAccessToken + deletedCustomerAccessTokenId + userErrors { + field + message + } + } + } +` + +export default customerAccessTokenDeleteMutation diff --git a/packages/shopify/src/utils/mutations/customer-activate-by-url.ts b/packages/shopify/src/utils/mutations/customer-activate-by-url.ts new file mode 100644 index 0000000..345d502 --- /dev/null +++ b/packages/shopify/src/utils/mutations/customer-activate-by-url.ts @@ -0,0 +1,19 @@ +const customerActivateByUrlMutation = /* GraphQL */ ` + mutation customerActivateByUrl($activationUrl: URL!, $password: String!) { + customerActivateByUrl(activationUrl: $activationUrl, password: $password) { + customer { + id + } + customerAccessToken { + accessToken + expiresAt + } + customerUserErrors { + code + field + message + } + } + } +` +export default customerActivateByUrlMutation diff --git a/packages/shopify/src/utils/mutations/customer-activate.ts b/packages/shopify/src/utils/mutations/customer-activate.ts new file mode 100644 index 0000000..b1d057c --- /dev/null +++ b/packages/shopify/src/utils/mutations/customer-activate.ts @@ -0,0 +1,19 @@ +const customerActivateMutation = /* GraphQL */ ` + mutation customerActivate($id: ID!, $input: CustomerActivateInput!) { + customerActivate(id: $id, input: $input) { + customer { + id + } + customerAccessToken { + accessToken + expiresAt + } + customerUserErrors { + code + field + message + } + } + } +` +export default customerActivateMutation diff --git a/packages/shopify/src/utils/mutations/customer-create.ts b/packages/shopify/src/utils/mutations/customer-create.ts new file mode 100644 index 0000000..05c728a --- /dev/null +++ b/packages/shopify/src/utils/mutations/customer-create.ts @@ -0,0 +1,15 @@ +const customerCreateMutation = /* GraphQL */ ` + mutation customerCreate($input: CustomerCreateInput!) { + customerCreate(input: $input) { + customerUserErrors { + code + field + message + } + customer { + id + } + } + } +` +export default customerCreateMutation diff --git a/packages/shopify/src/utils/mutations/index.ts b/packages/shopify/src/utils/mutations/index.ts new file mode 100644 index 0000000..165fb19 --- /dev/null +++ b/packages/shopify/src/utils/mutations/index.ts @@ -0,0 +1,9 @@ +export { default as customerCreateMutation } from './customer-create' +export { default as checkoutCreateMutation } from './checkout-create' +export { default as checkoutLineItemAddMutation } from './checkout-line-item-add' +export { default as checkoutLineItemUpdateMutation } from './checkout-line-item-update' +export { default as checkoutLineItemRemoveMutation } from './checkout-line-item-remove' +export { default as customerAccessTokenCreateMutation } from './customer-access-token-create' +export { default as customerAccessTokenDeleteMutation } from './customer-access-token-delete' +export { default as customerActivateMutation } from './customer-activate' +export { default as customerActivateByUrlMutation } from './customer-activate-by-url' diff --git a/packages/shopify/src/utils/normalize.ts b/packages/shopify/src/utils/normalize.ts new file mode 100644 index 0000000..2782f59 --- /dev/null +++ b/packages/shopify/src/utils/normalize.ts @@ -0,0 +1,197 @@ +import type { Page } from '../types/page' +import type { Product } from '../types/product' +import type { Cart, LineItem } from '../types/cart' +import type { Category } from '../types/site' + +import { + Product as ShopifyProduct, + Checkout, + CheckoutLineItemEdge, + SelectedOption, + ImageConnection, + ProductVariantConnection, + MoneyV2, + ProductOption, + Page as ShopifyPage, + PageEdge, + Collection, +} from '../../schema' +import { colorMap } from './colors' + +const money = ({ amount, currencyCode }: MoneyV2) => { + return { + value: +amount, + currencyCode, + } +} + +const normalizeProductOption = ({ + id, + name: displayName, + values, +}: ProductOption) => { + return { + __typename: 'MultipleChoiceOption', + id, + displayName: displayName.toLowerCase(), + values: values.map((value) => { + let output: any = { + label: value, + } + if (displayName.match(/colou?r/gi)) { + const mapedColor = colorMap[value.toLowerCase().replace(/ /g, '')] + if (mapedColor) { + output = { + ...output, + hexColors: [mapedColor], + } + } + } + return output + }), + } +} + +const normalizeProductImages = ({ edges }: ImageConnection) => + edges?.map(({ node: { originalSrc: url, ...rest } }) => ({ + url, + ...rest, + })) + +const normalizeProductVariants = ({ edges }: ProductVariantConnection) => { + return edges?.map( + ({ + node: { + id, + selectedOptions, + sku, + title, + priceV2, + compareAtPriceV2, + requiresShipping, + availableForSale, + }, + }) => { + return { + id, + name: title, + sku: sku ?? id, + price: +priceV2.amount, + listPrice: +compareAtPriceV2?.amount, + requiresShipping, + availableForSale, + options: selectedOptions.map(({ name, value }: SelectedOption) => { + const options = normalizeProductOption({ + id, + name, + values: [value], + }) + + return options + }), + } + } + ) +} + +export function normalizeProduct({ + id, + title: name, + vendor, + images, + variants, + description, + descriptionHtml, + handle, + priceRange, + options, + metafields, + ...rest +}: ShopifyProduct): Product { + return { + id, + name, + vendor, + path: `/${handle}`, + slug: handle?.replace(/^\/+|\/+$/g, ''), + price: money(priceRange?.minVariantPrice), + images: normalizeProductImages(images), + variants: variants ? normalizeProductVariants(variants) : [], + options: options + ? options + .filter((o) => o.name !== 'Title') // By default Shopify adds a 'Title' name when there's only one option. We don't need it. https://community.shopify.com/c/Shopify-APIs-SDKs/Adding-new-product-variant-is-automatically-adding-quot-Default/td-p/358095 + .map((o) => normalizeProductOption(o)) + : [], + ...(description && { description }), + ...(descriptionHtml && { descriptionHtml }), + ...rest, + } +} + +export function normalizeCart(checkout: Checkout): Cart { + return { + id: checkout.id, + url: checkout.webUrl, + customerId: '', + email: '', + createdAt: checkout.createdAt, + currency: { + code: checkout.totalPriceV2?.currencyCode, + }, + taxesIncluded: checkout.taxesIncluded, + lineItems: checkout.lineItems?.edges.map(normalizeLineItem), + lineItemsSubtotalPrice: +checkout.subtotalPriceV2?.amount, + subtotalPrice: +checkout.subtotalPriceV2?.amount, + totalPrice: checkout.totalPriceV2?.amount, + discounts: [], + } +} + +function normalizeLineItem({ + node: { id, title, variant, quantity }, +}: CheckoutLineItemEdge): LineItem { + return { + id, + variantId: String(variant?.id), + productId: String(variant?.id), + name: `${title}`, + quantity, + variant: { + id: String(variant?.id), + sku: variant?.sku ?? '', + name: variant?.title!, + image: { + url: variant?.image?.originalSrc || '/product-img-placeholder.svg', + }, + requiresShipping: variant?.requiresShipping ?? false, + price: variant?.priceV2?.amount, + listPrice: variant?.compareAtPriceV2?.amount, + }, + path: String(variant?.product?.handle), + discounts: [], + options: variant?.title == 'Default Title' ? [] : variant?.selectedOptions, + } +} + +export const normalizePage = ( + { title: name, handle, ...page }: ShopifyPage, + locale: string = 'en-US' +): Page => ({ + ...page, + url: `/${locale}/${handle}`, + name, +}) + +export const normalizePages = (edges: PageEdge[], locale?: string): Page[] => + edges?.map((edge) => normalizePage(edge.node, locale)) + +export const normalizeCategory = ({ + title: name, + handle, + id, +}: Collection): Category => ({ + id, + name, + slug: handle, + path: `/${handle}`, +}) diff --git a/packages/shopify/src/utils/queries/get-all-collections-query.ts b/packages/shopify/src/utils/queries/get-all-collections-query.ts new file mode 100644 index 0000000..2abf374 --- /dev/null +++ b/packages/shopify/src/utils/queries/get-all-collections-query.ts @@ -0,0 +1,14 @@ +const getSiteCollectionsQuery = /* GraphQL */ ` + query getSiteCollections($first: Int!) { + collections(first: $first) { + edges { + node { + id + title + handle + } + } + } + } +` +export default getSiteCollectionsQuery diff --git a/packages/shopify/src/utils/queries/get-all-pages-query.ts b/packages/shopify/src/utils/queries/get-all-pages-query.ts new file mode 100644 index 0000000..e3aee1f --- /dev/null +++ b/packages/shopify/src/utils/queries/get-all-pages-query.ts @@ -0,0 +1,14 @@ +export const getAllPagesQuery = /* GraphQL */ ` + query getAllPages($first: Int = 250) { + pages(first: $first) { + edges { + node { + id + title + handle + } + } + } + } +` +export default getAllPagesQuery diff --git a/packages/shopify/src/utils/queries/get-all-product-vendors-query.ts b/packages/shopify/src/utils/queries/get-all-product-vendors-query.ts new file mode 100644 index 0000000..be08b8e --- /dev/null +++ b/packages/shopify/src/utils/queries/get-all-product-vendors-query.ts @@ -0,0 +1,17 @@ +const getAllProductVendors = /* GraphQL */ ` + query getAllProductVendors($first: Int = 250, $cursor: String) { + products(first: $first, after: $cursor) { + pageInfo { + hasNextPage + hasPreviousPage + } + edges { + node { + vendor + } + cursor + } + } + } +` +export default getAllProductVendors diff --git a/packages/shopify/src/utils/queries/get-all-products-paths-query.ts b/packages/shopify/src/utils/queries/get-all-products-paths-query.ts new file mode 100644 index 0000000..56298c2 --- /dev/null +++ b/packages/shopify/src/utils/queries/get-all-products-paths-query.ts @@ -0,0 +1,17 @@ +const getAllProductsPathsQuery = /* GraphQL */ ` + query getAllProductPaths($first: Int = 250, $cursor: String) { + products(first: $first, after: $cursor) { + pageInfo { + hasNextPage + hasPreviousPage + } + edges { + node { + handle + } + cursor + } + } + } +` +export default getAllProductsPathsQuery diff --git a/packages/shopify/src/utils/queries/get-all-products-query.ts b/packages/shopify/src/utils/queries/get-all-products-query.ts new file mode 100644 index 0000000..179cf98 --- /dev/null +++ b/packages/shopify/src/utils/queries/get-all-products-query.ts @@ -0,0 +1,57 @@ +export const productConnectionFragment = /* GraphQL */ ` + fragment productConnection on ProductConnection { + pageInfo { + hasNextPage + hasPreviousPage + } + edges { + node { + id + title + vendor + handle + priceRange { + minVariantPrice { + amount + currencyCode + } + } + images(first: 1) { + pageInfo { + hasNextPage + hasPreviousPage + } + edges { + node { + originalSrc + altText + width + height + } + } + } + } + } + } +` + +const getAllProductsQuery = /* GraphQL */ ` + query getAllProducts( + $first: Int = 250 + $query: String = "" + $sortKey: ProductSortKeys = RELEVANCE + $reverse: Boolean = false + ) { + products( + first: $first + sortKey: $sortKey + reverse: $reverse + query: $query + ) { + ...productConnection + } + } + + ${productConnectionFragment} +` +export default getAllProductsQuery diff --git a/packages/shopify/src/utils/queries/get-checkout-query.ts b/packages/shopify/src/utils/queries/get-checkout-query.ts new file mode 100644 index 0000000..9969e67 --- /dev/null +++ b/packages/shopify/src/utils/queries/get-checkout-query.ts @@ -0,0 +1,70 @@ +export const checkoutDetailsFragment = /* GraphQL */ ` + fragment checkoutDetails on Checkout { + id + webUrl + subtotalPriceV2 { + amount + currencyCode + } + totalTaxV2 { + amount + currencyCode + } + totalPriceV2 { + amount + currencyCode + } + completedAt + createdAt + taxesIncluded + lineItems(first: 250) { + pageInfo { + hasNextPage + hasPreviousPage + } + edges { + node { + id + title + variant { + id + sku + title + selectedOptions { + name + value + } + image { + originalSrc + altText + width + height + } + priceV2 { + amount + currencyCode + } + compareAtPriceV2 { + amount + currencyCode + } + product { + handle + } + } + quantity + } + } + } + } +` + +const getCheckoutQuery = /* GraphQL */ ` + query getCheckout($checkoutId: ID!) { + node(id: $checkoutId) { + ...checkoutDetails + } + } + ${checkoutDetailsFragment} +` +export default getCheckoutQuery diff --git a/packages/shopify/src/utils/queries/get-collection-products-query.ts b/packages/shopify/src/utils/queries/get-collection-products-query.ts new file mode 100644 index 0000000..b773a7e --- /dev/null +++ b/packages/shopify/src/utils/queries/get-collection-products-query.ts @@ -0,0 +1,21 @@ +import { productConnectionFragment } from './get-all-products-query' + +const getCollectionProductsQuery = /* GraphQL */ ` + query getProductsFromCollection( + $categoryId: ID! + $first: Int = 250 + $sortKey: ProductCollectionSortKeys = RELEVANCE + $reverse: Boolean = false + ) { + node(id: $categoryId) { + id + ... on Collection { + products(first: $first, sortKey: $sortKey, reverse: $reverse) { + ...productConnection + } + } + } + } + ${productConnectionFragment} +` +export default getCollectionProductsQuery diff --git a/packages/shopify/src/utils/queries/get-customer-id-query.ts b/packages/shopify/src/utils/queries/get-customer-id-query.ts new file mode 100644 index 0000000..076ceb1 --- /dev/null +++ b/packages/shopify/src/utils/queries/get-customer-id-query.ts @@ -0,0 +1,8 @@ +export const getCustomerQuery = /* GraphQL */ ` + query getCustomerId($customerAccessToken: String!) { + customer(customerAccessToken: $customerAccessToken) { + id + } + } +` +export default getCustomerQuery diff --git a/packages/shopify/src/utils/queries/get-customer-query.ts b/packages/shopify/src/utils/queries/get-customer-query.ts new file mode 100644 index 0000000..87e37e6 --- /dev/null +++ b/packages/shopify/src/utils/queries/get-customer-query.ts @@ -0,0 +1,16 @@ +export const getCustomerQuery = /* GraphQL */ ` + query getCustomer($customerAccessToken: String!) { + customer(customerAccessToken: $customerAccessToken) { + id + firstName + lastName + displayName + email + phone + tags + acceptsMarketing + createdAt + } + } +` +export default getCustomerQuery diff --git a/packages/shopify/src/utils/queries/get-page-query.ts b/packages/shopify/src/utils/queries/get-page-query.ts new file mode 100644 index 0000000..7939f02 --- /dev/null +++ b/packages/shopify/src/utils/queries/get-page-query.ts @@ -0,0 +1,14 @@ +export const getPageQuery = /* GraphQL */ ` + query getPage($id: ID!) { + node(id: $id) { + id + ... on Page { + title + handle + body + bodySummary + } + } + } +` +export default getPageQuery diff --git a/packages/shopify/src/utils/queries/get-product-query.ts b/packages/shopify/src/utils/queries/get-product-query.ts new file mode 100644 index 0000000..b2998a4 --- /dev/null +++ b/packages/shopify/src/utils/queries/get-product-query.ts @@ -0,0 +1,72 @@ +const getProductQuery = /* GraphQL */ ` + query getProductBySlug($slug: String!) { + productByHandle(handle: $slug) { + id + handle + availableForSale + title + productType + vendor + description + descriptionHtml + options { + id + name + values + } + priceRange { + maxVariantPrice { + amount + currencyCode + } + minVariantPrice { + amount + currencyCode + } + } + variants(first: 250) { + pageInfo { + hasNextPage + hasPreviousPage + } + edges { + node { + id + title + sku + availableForSale + requiresShipping + selectedOptions { + name + value + } + priceV2 { + amount + currencyCode + } + compareAtPriceV2 { + amount + currencyCode + } + } + } + } + images(first: 250) { + pageInfo { + hasNextPage + hasPreviousPage + } + edges { + node { + originalSrc + altText + width + height + } + } + } + } + } +` + +export default getProductQuery diff --git a/packages/shopify/src/utils/queries/get-site-info-query.ts b/packages/shopify/src/utils/queries/get-site-info-query.ts new file mode 100644 index 0000000..7421557 --- /dev/null +++ b/packages/shopify/src/utils/queries/get-site-info-query.ts @@ -0,0 +1,8 @@ +const getSiteInfoQuery = /* GraphQL */ ` + query getSiteInfo { + shop { + name + } + } +` +export default getSiteInfoQuery diff --git a/packages/shopify/src/utils/queries/index.ts b/packages/shopify/src/utils/queries/index.ts new file mode 100644 index 0000000..9531134 --- /dev/null +++ b/packages/shopify/src/utils/queries/index.ts @@ -0,0 +1,11 @@ +export { default as getSiteCollectionsQuery } from './get-all-collections-query' +export { default as getProductQuery } from './get-product-query' +export { default as getAllProductsQuery } from './get-all-products-query' +export { default as getAllProductsPathtsQuery } from './get-all-products-paths-query' +export { default as getAllProductVendors } from './get-all-product-vendors-query' +export { default as getCollectionProductsQuery } from './get-collection-products-query' +export { default as getCheckoutQuery } from './get-checkout-query' +export { default as getAllPagesQuery } from './get-all-pages-query' +export { default as getPageQuery } from './get-page-query' +export { default as getCustomerQuery } from './get-customer-query' +export { default as getSiteInfoQuery } from './get-site-info-query' diff --git a/packages/shopify/src/utils/throw-user-errors.ts b/packages/shopify/src/utils/throw-user-errors.ts new file mode 100644 index 0000000..2173b2b --- /dev/null +++ b/packages/shopify/src/utils/throw-user-errors.ts @@ -0,0 +1,38 @@ +import { ValidationError } from '@vercel/commerce/utils/errors' + +import { + CheckoutErrorCode, + CheckoutUserError, + CustomerErrorCode, + CustomerUserError, +} from '../../schema' + +export type UserErrors = Array + +export type UserErrorCode = + | CustomerErrorCode + | CheckoutErrorCode + | null + | undefined + +const getCustomMessage = (code: UserErrorCode, message: string) => { + switch (code) { + case 'UNIDENTIFIED_CUSTOMER': + message = 'Cannot find an account that matches the provided credentials' + break + } + return message +} + +export const throwUserErrors = (errors?: UserErrors) => { + if (errors && errors.length) { + throw new ValidationError({ + errors: errors.map(({ code, message }) => ({ + code: code ?? 'validation_error', + message: getCustomMessage(code, message), + })), + }) + } +} + +export default throwUserErrors diff --git a/packages/shopify/src/wishlist/use-add-item.tsx b/packages/shopify/src/wishlist/use-add-item.tsx new file mode 100644 index 0000000..75f067c --- /dev/null +++ b/packages/shopify/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/shopify/src/wishlist/use-remove-item.tsx b/packages/shopify/src/wishlist/use-remove-item.tsx new file mode 100644 index 0000000..a2d3a8a --- /dev/null +++ b/packages/shopify/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/packages/shopify/src/wishlist/use-wishlist.tsx b/packages/shopify/src/wishlist/use-wishlist.tsx new file mode 100644 index 0000000..c951950 --- /dev/null +++ b/packages/shopify/src/wishlist/use-wishlist.tsx @@ -0,0 +1,46 @@ +// TODO: replace this hook and other wishlist hooks with a handler, or remove them if +// Shopify doesn't have a wishlist + +import { HookFetcher } from '@vercel/commerce/utils/types' +import { Product } from '../../schema' + +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/shopify/taskfile.js b/packages/shopify/taskfile.js new file mode 100644 index 0000000..39b1b2a --- /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 0000000..cd04ab2 --- /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 0000000..36aae07 --- /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=@vercel/commerce-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 0000000..f06235c --- /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 0000000..e1076ed --- /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 0000000..93c133e 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 0000000..0b172cb --- /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 0000000..491a12d --- /dev/null +++ b/packages/spree/package.json @@ -0,0 +1,83 @@ +{ + "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", + "lodash.debounce": "^4.0.8" + }, + "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/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/packages/spree/src/api/endpoints/cart/index.ts b/packages/spree/src/api/endpoints/cart/index.ts new file mode 100644 index 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..9852396 --- /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 0000000..2be2a5d --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..3971ed5 --- /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 0000000..b5fae62 --- /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 0000000..424f46c --- /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 0000000..2b718d9 --- /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 0000000..8c34b9e --- /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 0000000..711870e --- /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 0000000..bd93791 --- /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 0000000..13b11e4 --- /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 0000000..086fdf8 --- /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 0000000..b26a2fb --- /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 0000000..26f9ab6 --- /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 0000000..36e757a --- /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 0000000..b23b8a6 --- /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 0000000..8b22021 --- /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 0000000..7dd8879 --- /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 0000000..3b8ba99 --- /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 0000000..5f7d1f4 --- /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 0000000..699a023 --- /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 0000000..6bbecd3 --- /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 0000000..679d68a --- /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 0000000..bd8e3ac --- /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 0000000..6f8399f --- /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 0000000..6329680 --- /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 0000000..4028114 --- /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 0000000..6c903ec --- /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 0000000..56f330d --- /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 0000000..4c79c0b --- /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 0000000..0717ae4 --- /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 0000000..02b497b --- /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 0000000..d9bee08 --- /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 0000000..04457ac --- /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 0000000..f9af41b --- /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 0000000..3098be6 --- /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 0000000..09b9d2e --- /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 0000000..5ed9e0e --- /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 0000000..a79365b --- /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 0000000..19c10cf --- /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 0000000..bf15aad --- /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 0000000..245f664 --- /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 0000000..9631971 --- /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 0000000..cb14c1e --- /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 0000000..9291e2b --- /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 0000000..b824fd8 --- /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 0000000..0aaa87e --- /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 0000000..426a3ed --- /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 0000000..fd42d70 --- /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 0000000..7de5d82 --- /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 0000000..de6ddb2 --- /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 0000000..74ddeb5 --- /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 0000000..f35a00d --- /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 0000000..f0821c1 --- /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 0000000..efbd687 --- /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 0000000..6e9e326 --- /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 0000000..382ea3b --- /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 0000000..630b685 --- /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 0000000..8594f5c --- /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 0000000..dd2dacb --- /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 0000000..6749a4a --- /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 0000000..9b87daa --- /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 0000000..a5d49fd --- /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 0000000..fd82d65 --- /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 0000000..4544a48 --- /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 0000000..1355566 --- /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 0000000..c5597fd --- /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 0000000..a2464ff --- /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 0000000..6965f01 --- /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 0000000..8b738fb --- /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 0000000..c9cfee2 --- /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 0000000..7917420 --- /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 0000000..92b7916 --- /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 0000000..bac632e --- /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 0000000..8352f9a --- /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 0000000..de22634 --- /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 0000000..0d4e6f8 --- /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 0000000..218c25b --- /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 0000000..8213354 --- /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 0000000..0c524ec --- /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 0000000..5eaaa0b --- /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 0000000..1bd9872 --- /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 0000000..8b6ef98 --- /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 0000000..909caad --- /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 0000000..e02036d --- /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 0000000..cce2e27 --- /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 0000000..024db1e --- /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 0000000..241af3c --- /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 0000000..010a71e --- /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 0000000..d8481f5 --- /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 0000000..9f25862 --- /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 0000000..39b1b2a --- /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 0000000..cd04ab2 --- /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/packages/swell/.env.template b/packages/swell/.env.template new file mode 100644 index 0000000..62bbcf5 --- /dev/null +++ b/packages/swell/.env.template @@ -0,0 +1,7 @@ +COMMERCE_PROVIDER=@vercel/commerce-swell + +SWELL_STORE_DOMAIN= +SWELL_STOREFRONT_ACCESS_TOKEN= + +NEXT_PUBLIC_SWELL_STORE_ID= +NEXT_PUBLIC_SWELL_PUBLIC_KEY= diff --git a/packages/swell/.prettierignore b/packages/swell/.prettierignore new file mode 100644 index 0000000..f06235c --- /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 0000000..e1076ed --- /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 0000000..27a1798 --- /dev/null +++ b/packages/swell/package.json @@ -0,0 +1,83 @@ +{ + "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", + "lodash.debounce": "^4.0.8" + }, + "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/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/packages/swell/schema.d.ts b/packages/swell/schema.d.ts new file mode 100644 index 0000000..0ec6250 --- /dev/null +++ b/packages/swell/schema.d.ts @@ -0,0 +1,5002 @@ +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 + /** An ISO-8601 encoded UTC date time string. Example value: `"2019-07-03T20:47:55Z"`. */ + DateTime: any + /** A signed decimal number, which supports arbitrary precision and is serialized as a string. Example value: `"29.99"`. */ + Decimal: any + /** A string containing HTML code. Example value: `"

Grey cotton knit sweater.

"`. */ + HTML: any + /** A monetary value string. Example value: `"100.57"`. */ + Money: any + /** + * An RFC 3986 and RFC 3987 compliant URI string. + * + * Example value: `"https://johns-apparel.myshopify.com"`. + * + */ + URL: any +} + +/** A version of the API. */ +export type ApiVersion = { + __typename?: 'ApiVersion' + /** The human-readable name of the version. */ + displayName: Scalars['String'] + /** The unique identifier of an ApiVersion. All supported API versions have a date-based (YYYY-MM) or `unstable` handle. */ + handle: Scalars['String'] + /** Whether the version is supported by Shopify. */ + supported: Scalars['Boolean'] +} + +/** Details about the gift card used on the checkout. */ +export type AppliedGiftCard = Node & { + __typename?: 'AppliedGiftCard' + /** + * The amount that was taken from the gift card by applying it. + * @deprecated Use `amountUsedV2` instead + */ + amountUsed: Scalars['Money'] + /** The amount that was taken from the gift card by applying it. */ + amountUsedV2: MoneyV2 + /** + * The amount left on the gift card. + * @deprecated Use `balanceV2` instead + */ + balance: Scalars['Money'] + /** The amount left on the gift card. */ + balanceV2: MoneyV2 + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The last characters of the gift card. */ + lastCharacters: Scalars['String'] + /** The amount that was applied to the checkout in its currency. */ + presentmentAmountUsed: MoneyV2 +} + +/** An article in an online store blog. */ +export type Article = Node & { + __typename?: 'Article' + /** + * The article's author. + * @deprecated Use `authorV2` instead + */ + author: ArticleAuthor + /** The article's author. */ + authorV2?: Maybe + /** The blog that the article belongs to. */ + blog: Blog + /** List of comments posted on the article. */ + comments: CommentConnection + /** Stripped content of the article, single line with HTML tags removed. */ + content: Scalars['String'] + /** The content of the article, complete with HTML formatting. */ + contentHtml: Scalars['HTML'] + /** Stripped excerpt of the article, single line with HTML tags removed. */ + excerpt?: Maybe + /** The excerpt of the article, complete with HTML formatting. */ + excerptHtml?: Maybe + /** A human-friendly unique string for the Article automatically generated from its title. */ + handle: Scalars['String'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The image associated with the article. */ + image?: Maybe + /** The date and time when the article was published. */ + publishedAt: Scalars['DateTime'] + /** The article’s SEO information. */ + seo?: Maybe + /** A categorization that a article can be tagged with. */ + tags: Array + /** The article’s name. */ + title: Scalars['String'] + /** The url pointing to the article accessible from the web. */ + url: Scalars['URL'] +} + +/** An article in an online store blog. */ +export type ArticleCommentsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** An article in an online store blog. */ +export type ArticleContentArgs = { + truncateAt?: Maybe +} + +/** An article in an online store blog. */ +export type ArticleExcerptArgs = { + truncateAt?: Maybe +} + +/** An article in an online store blog. */ +export type ArticleImageArgs = { + maxWidth?: Maybe + maxHeight?: Maybe + crop?: Maybe + scale?: Maybe +} + +/** The author of an article. */ +export type ArticleAuthor = { + __typename?: 'ArticleAuthor' + /** The author's bio. */ + bio?: Maybe + /** The author’s email. */ + email: Scalars['String'] + /** The author's first name. */ + firstName: Scalars['String'] + /** The author's last name. */ + lastName: Scalars['String'] + /** The author's full name. */ + name: Scalars['String'] +} + +/** An auto-generated type for paginating through multiple Articles. */ +export type ArticleConnection = { + __typename?: 'ArticleConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Article and a cursor during pagination. */ +export type ArticleEdge = { + __typename?: 'ArticleEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of ArticleEdge. */ + node: Article +} + +/** The set of valid sort keys for the Article query. */ +export enum ArticleSortKeys { + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `blog_title` value. */ + BlogTitle = 'BLOG_TITLE', + /** Sort by the `author` value. */ + Author = 'AUTHOR', + /** Sort by the `updated_at` value. */ + UpdatedAt = 'UPDATED_AT', + /** Sort by the `published_at` value. */ + PublishedAt = 'PUBLISHED_AT', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** Represents a generic custom attribute. */ +export type Attribute = { + __typename?: 'Attribute' + /** Key or name of the attribute. */ + key: Scalars['String'] + /** Value of the attribute. */ + value?: Maybe +} + +/** Specifies the input fields required for an attribute. */ +export type AttributeInput = { + /** Key or name of the attribute. */ + key: Scalars['String'] + /** Value of the attribute. */ + value: Scalars['String'] +} + +/** Automatic discount applications capture the intentions of a discount that was automatically applied. */ +export type AutomaticDiscountApplication = DiscountApplication & { + __typename?: 'AutomaticDiscountApplication' + /** The method by which the discount's value is allocated to its entitled items. */ + allocationMethod: DiscountApplicationAllocationMethod + /** Which lines of targetType that the discount is allocated over. */ + targetSelection: DiscountApplicationTargetSelection + /** The type of line that the discount is applicable towards. */ + targetType: DiscountApplicationTargetType + /** The title of the application. */ + title: Scalars['String'] + /** The value of the discount application. */ + value: PricingValue +} + +/** A collection of available shipping rates for a checkout. */ +export type AvailableShippingRates = { + __typename?: 'AvailableShippingRates' + /** + * Whether or not the shipping rates are ready. + * The `shippingRates` field is `null` when this value is `false`. + * This field should be polled until its value becomes `true`. + */ + ready: Scalars['Boolean'] + /** The fetched shipping rates. `null` until the `ready` field is `true`. */ + shippingRates?: Maybe> +} + +/** An online store blog. */ +export type Blog = Node & { + __typename?: 'Blog' + /** Find an article by its handle. */ + articleByHandle?: Maybe
+ /** List of the blog's articles. */ + articles: ArticleConnection + /** The authors who have contributed to the blog. */ + authors: Array + /** A human-friendly unique string for the Blog automatically generated from its title. */ + handle: Scalars['String'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The blog's SEO information. */ + seo?: Maybe + /** The blogs’s title. */ + title: Scalars['String'] + /** The url pointing to the blog accessible from the web. */ + url: Scalars['URL'] +} + +/** An online store blog. */ +export type BlogArticleByHandleArgs = { + handle: Scalars['String'] +} + +/** An online store blog. */ +export type BlogArticlesArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** An auto-generated type for paginating through multiple Blogs. */ +export type BlogConnection = { + __typename?: 'BlogConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Blog and a cursor during pagination. */ +export type BlogEdge = { + __typename?: 'BlogEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of BlogEdge. */ + node: Blog +} + +/** The set of valid sort keys for the Blog query. */ +export enum BlogSortKeys { + /** Sort by the `handle` value. */ + Handle = 'HANDLE', + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** Card brand, such as Visa or Mastercard, which can be used for payments. */ +export enum CardBrand { + /** Visa */ + Visa = 'VISA', + /** Mastercard */ + Mastercard = 'MASTERCARD', + /** Discover */ + Discover = 'DISCOVER', + /** American Express */ + AmericanExpress = 'AMERICAN_EXPRESS', + /** Diners Club */ + DinersClub = 'DINERS_CLUB', + /** JCB */ + Jcb = 'JCB', +} + +/** A container for all the information required to checkout items and pay. */ +export type Checkout = { + name: string + currency: string + support_email: string + fields: any[] + scripts: any[] + accounts: string + email_optin: boolean + terms_policy?: string + refund_policy?: string + privacy_policy?: string + theme?: string + countries: any[] + currencies: any[] + payment_methods: any[] + coupons: boolean + giftcards: boolean + + // __typename?: 'Checkout' + // /** The gift cards used on the checkout. */ + // appliedGiftCards: Array + // /** + // * The available shipping rates for this Checkout. + // * Should only be used when checkout `requiresShipping` is `true` and + // * the shipping address is valid. + // */ + // availableShippingRates?: Maybe + // /** The date and time when the checkout was completed. */ + // completedAt?: Maybe + // /** The date and time when the checkout was created. */ + // createdAt: Scalars['DateTime'] + // /** The currency code for the Checkout. */ + // currencyCode: CurrencyCode + // /** A list of extra information that is added to the checkout. */ + // customAttributes: Array + // /** + // * The customer associated with the checkout. + // * @deprecated This field will always return null. If you have an authentication token for the customer, you can use the `customer` field on the query root to retrieve it. + // */ + // customer?: Maybe + // /** Discounts that have been applied on the checkout. */ + // discountApplications: DiscountApplicationConnection + // /** The email attached to this checkout. */ + // email?: Maybe + // /** Globally unique identifier. */ + // id: Scalars['ID'] + // /** A list of line item objects, each one containing information about an item in the checkout. */ + // lineItems: CheckoutLineItemConnection + // /** The sum of all the prices of all the items in the checkout. Duties, taxes, shipping and discounts excluded. */ + // lineItemsSubtotalPrice: MoneyV2 + // /** The note associated with the checkout. */ + // note?: Maybe + // /** The resulting order from a paid checkout. */ + // order?: Maybe + // /** The Order Status Page for this Checkout, null when checkout is not completed. */ + // orderStatusUrl?: Maybe + // /** + // * The amount left to be paid. This is equal to the cost of the line items, taxes and shipping minus discounts and gift cards. + // * @deprecated Use `paymentDueV2` instead + // */ + // paymentDue: Scalars['Money'] + // /** The amount left to be paid. This is equal to the cost of the line items, duties, taxes and shipping minus discounts and gift cards. */ + // paymentDueV2: MoneyV2 + // /** + // * Whether or not the Checkout is ready and can be completed. Checkouts may + // * have asynchronous operations that can take time to finish. If you want + // * to complete a checkout or ensure all the fields are populated and up to + // * date, polling is required until the value is true. + // */ + // ready: Scalars['Boolean'] + // /** States whether or not the fulfillment requires shipping. */ + // requiresShipping: Scalars['Boolean'] + // /** The shipping address to where the line items will be shipped. */ + // shippingAddress?: Maybe + // /** The discounts that have been allocated onto the shipping line by discount applications. */ + // shippingDiscountAllocations: Array + // /** Once a shipping rate is selected by the customer it is transitioned to a `shipping_line` object. */ + // shippingLine?: Maybe + // /** + // * Price of the checkout before shipping and taxes. + // * @deprecated Use `subtotalPriceV2` instead + // */ + // subtotalPrice: Scalars['Money'] + // /** Price of the checkout before duties, shipping and taxes. */ + // subtotalPriceV2: MoneyV2 + // /** Specifies if the Checkout is tax exempt. */ + // taxExempt: Scalars['Boolean'] + // /** Specifies if taxes are included in the line item and shipping line prices. */ + // taxesIncluded: Scalars['Boolean'] + // /** + // * The sum of all the prices of all the items in the checkout, taxes and discounts included. + // * @deprecated Use `totalPriceV2` instead + // */ + // totalPrice: Scalars['Money'] + // /** The sum of all the prices of all the items in the checkout, duties, taxes and discounts included. */ + // totalPriceV2: MoneyV2 + // /** + // * The sum of all the taxes applied to the line items and shipping lines in the checkout. + // * @deprecated Use `totalTaxV2` instead + // */ + // totalTax: Scalars['Money'] + // /** The sum of all the taxes applied to the line items and shipping lines in the checkout. */ + // totalTaxV2: MoneyV2 + // /** The date and time when the checkout was last updated. */ + // updatedAt: Scalars['DateTime'] + // /** The url pointing to the checkout accessible from the web. */ + // webUrl: Scalars['URL'] +} + +/** A container for all the information required to checkout items and pay. */ +export type CheckoutDiscountApplicationsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** A container for all the information required to checkout items and pay. */ +export type CheckoutLineItemsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** Specifies the fields required to update a checkout's attributes. */ +export type CheckoutAttributesUpdateInput = { + /** The text of an optional note that a shop owner can attach to the checkout. */ + note?: Maybe + /** A list of extra information that is added to the checkout. */ + customAttributes?: Maybe> + /** + * Allows setting partial addresses on a Checkout, skipping the full validation of attributes. + * The required attributes are city, province, and country. + * Full validation of the addresses is still done at complete time. + */ + allowPartialAddresses?: Maybe +} + +/** Return type for `checkoutAttributesUpdate` mutation. */ +export type CheckoutAttributesUpdatePayload = { + __typename?: 'CheckoutAttributesUpdatePayload' + /** The updated checkout object. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Specifies the fields required to update a checkout's attributes. */ +export type CheckoutAttributesUpdateV2Input = { + /** The text of an optional note that a shop owner can attach to the checkout. */ + note?: Maybe + /** A list of extra information that is added to the checkout. */ + customAttributes?: Maybe> + /** + * Allows setting partial addresses on a Checkout, skipping the full validation of attributes. + * The required attributes are city, province, and country. + * Full validation of the addresses is still done at complete time. + */ + allowPartialAddresses?: Maybe +} + +/** Return type for `checkoutAttributesUpdateV2` mutation. */ +export type CheckoutAttributesUpdateV2Payload = { + __typename?: 'CheckoutAttributesUpdateV2Payload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCompleteFree` mutation. */ +export type CheckoutCompleteFreePayload = { + __typename?: 'CheckoutCompleteFreePayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCompleteWithCreditCard` mutation. */ +export type CheckoutCompleteWithCreditCardPayload = { + __typename?: 'CheckoutCompleteWithCreditCardPayload' + /** The checkout on which the payment was applied. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** A representation of the attempted payment. */ + payment?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCompleteWithCreditCardV2` mutation. */ +export type CheckoutCompleteWithCreditCardV2Payload = { + __typename?: 'CheckoutCompleteWithCreditCardV2Payload' + /** The checkout on which the payment was applied. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** A representation of the attempted payment. */ + payment?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCompleteWithTokenizedPayment` mutation. */ +export type CheckoutCompleteWithTokenizedPaymentPayload = { + __typename?: 'CheckoutCompleteWithTokenizedPaymentPayload' + /** The checkout on which the payment was applied. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** A representation of the attempted payment. */ + payment?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCompleteWithTokenizedPaymentV2` mutation. */ +export type CheckoutCompleteWithTokenizedPaymentV2Payload = { + __typename?: 'CheckoutCompleteWithTokenizedPaymentV2Payload' + /** The checkout on which the payment was applied. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** A representation of the attempted payment. */ + payment?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. */ +export type CheckoutCompleteWithTokenizedPaymentV3Payload = { + __typename?: 'CheckoutCompleteWithTokenizedPaymentV3Payload' + /** The checkout on which the payment was applied. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** A representation of the attempted payment. */ + payment?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Specifies the fields required to create a checkout. */ +export type CheckoutCreateInput = { + /** The email with which the customer wants to checkout. */ + email?: Maybe + /** A list of line item objects, each one containing information about an item in the checkout. */ + lineItems?: Maybe> + /** The shipping address to where the line items will be shipped. */ + shippingAddress?: Maybe + /** The text of an optional note that a shop owner can attach to the checkout. */ + note?: Maybe + /** A list of extra information that is added to the checkout. */ + customAttributes?: Maybe> + /** + * Allows setting partial addresses on a Checkout, skipping the full validation of attributes. + * The required attributes are city, province, and country. + * Full validation of addresses is still done at complete time. + */ + allowPartialAddresses?: Maybe + /** + * The three-letter currency code of one of the shop's enabled presentment currencies. + * Including this field creates a checkout in the specified currency. By default, new + * checkouts are created in the shop's primary currency. + */ + presentmentCurrencyCode?: Maybe +} + +/** Return type for `checkoutCreate` mutation. */ +export type CheckoutCreatePayload = { + __typename?: 'CheckoutCreatePayload' + /** The new checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCustomerAssociate` mutation. */ +export type CheckoutCustomerAssociatePayload = { + __typename?: 'CheckoutCustomerAssociatePayload' + /** The updated checkout object. */ + checkout: Checkout + /** The associated customer object. */ + customer?: Maybe + /** List of errors that occurred executing the mutation. */ + userErrors: Array +} + +/** Return type for `checkoutCustomerAssociateV2` mutation. */ +export type CheckoutCustomerAssociateV2Payload = { + __typename?: 'CheckoutCustomerAssociateV2Payload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** The associated customer object. */ + customer?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCustomerDisassociate` mutation. */ +export type CheckoutCustomerDisassociatePayload = { + __typename?: 'CheckoutCustomerDisassociatePayload' + /** The updated checkout object. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutCustomerDisassociateV2` mutation. */ +export type CheckoutCustomerDisassociateV2Payload = { + __typename?: 'CheckoutCustomerDisassociateV2Payload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutDiscountCodeApply` mutation. */ +export type CheckoutDiscountCodeApplyPayload = { + __typename?: 'CheckoutDiscountCodeApplyPayload' + /** The updated checkout object. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutDiscountCodeApplyV2` mutation. */ +export type CheckoutDiscountCodeApplyV2Payload = { + __typename?: 'CheckoutDiscountCodeApplyV2Payload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutDiscountCodeRemove` mutation. */ +export type CheckoutDiscountCodeRemovePayload = { + __typename?: 'CheckoutDiscountCodeRemovePayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutEmailUpdate` mutation. */ +export type CheckoutEmailUpdatePayload = { + __typename?: 'CheckoutEmailUpdatePayload' + /** The checkout object with the updated email. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutEmailUpdateV2` mutation. */ +export type CheckoutEmailUpdateV2Payload = { + __typename?: 'CheckoutEmailUpdateV2Payload' + /** The checkout object with the updated email. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Possible error codes that could be returned by CheckoutUserError. */ +export enum CheckoutErrorCode { + /** Input value is blank. */ + Blank = 'BLANK', + /** Input value is invalid. */ + Invalid = 'INVALID', + /** Input value is too long. */ + TooLong = 'TOO_LONG', + /** Input value is not present. */ + Present = 'PRESENT', + /** Input value should be less than maximum allowed value. */ + LessThan = 'LESS_THAN', + /** Input value should be greater than or equal to minimum allowed value. */ + GreaterThanOrEqualTo = 'GREATER_THAN_OR_EQUAL_TO', + /** Input value should be less or equal to maximum allowed value. */ + LessThanOrEqualTo = 'LESS_THAN_OR_EQUAL_TO', + /** Checkout is already completed. */ + AlreadyCompleted = 'ALREADY_COMPLETED', + /** Checkout is locked. */ + Locked = 'LOCKED', + /** Input value is not supported. */ + NotSupported = 'NOT_SUPPORTED', + /** Input email contains an invalid domain name. */ + BadDomain = 'BAD_DOMAIN', + /** Input Zip is invalid for country provided. */ + InvalidForCountry = 'INVALID_FOR_COUNTRY', + /** Input Zip is invalid for country and province provided. */ + InvalidForCountryAndProvince = 'INVALID_FOR_COUNTRY_AND_PROVINCE', + /** Invalid state in country. */ + InvalidStateInCountry = 'INVALID_STATE_IN_COUNTRY', + /** Invalid province in country. */ + InvalidProvinceInCountry = 'INVALID_PROVINCE_IN_COUNTRY', + /** Invalid region in country. */ + InvalidRegionInCountry = 'INVALID_REGION_IN_COUNTRY', + /** Shipping rate expired. */ + ShippingRateExpired = 'SHIPPING_RATE_EXPIRED', + /** Gift card cannot be applied to a checkout that contains a gift card. */ + GiftCardUnusable = 'GIFT_CARD_UNUSABLE', + /** Gift card is disabled. */ + GiftCardDisabled = 'GIFT_CARD_DISABLED', + /** Gift card code is invalid. */ + GiftCardCodeInvalid = 'GIFT_CARD_CODE_INVALID', + /** Gift card has already been applied. */ + GiftCardAlreadyApplied = 'GIFT_CARD_ALREADY_APPLIED', + /** Gift card currency does not match checkout currency. */ + GiftCardCurrencyMismatch = 'GIFT_CARD_CURRENCY_MISMATCH', + /** Gift card is expired. */ + GiftCardExpired = 'GIFT_CARD_EXPIRED', + /** Gift card has no funds left. */ + GiftCardDepleted = 'GIFT_CARD_DEPLETED', + /** Gift card was not found. */ + GiftCardNotFound = 'GIFT_CARD_NOT_FOUND', + /** Cart does not meet discount requirements notice. */ + CartDoesNotMeetDiscountRequirementsNotice = 'CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE', + /** Discount expired. */ + DiscountExpired = 'DISCOUNT_EXPIRED', + /** Discount disabled. */ + DiscountDisabled = 'DISCOUNT_DISABLED', + /** Discount limit reached. */ + DiscountLimitReached = 'DISCOUNT_LIMIT_REACHED', + /** Discount not found. */ + DiscountNotFound = 'DISCOUNT_NOT_FOUND', + /** Customer already used once per customer discount notice. */ + CustomerAlreadyUsedOncePerCustomerDiscountNotice = 'CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE', + /** Checkout is already completed. */ + Empty = 'EMPTY', + /** Not enough in stock. */ + NotEnoughInStock = 'NOT_ENOUGH_IN_STOCK', + /** Missing payment input. */ + MissingPaymentInput = 'MISSING_PAYMENT_INPUT', + /** The amount of the payment does not match the value to be paid. */ + TotalPriceMismatch = 'TOTAL_PRICE_MISMATCH', + /** Line item was not found in checkout. */ + LineItemNotFound = 'LINE_ITEM_NOT_FOUND', + /** Unable to apply discount. */ + UnableToApply = 'UNABLE_TO_APPLY', + /** Discount already applied. */ + DiscountAlreadyApplied = 'DISCOUNT_ALREADY_APPLIED', +} + +/** Return type for `checkoutGiftCardApply` mutation. */ +export type CheckoutGiftCardApplyPayload = { + __typename?: 'CheckoutGiftCardApplyPayload' + /** The updated checkout object. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutGiftCardRemove` mutation. */ +export type CheckoutGiftCardRemovePayload = { + __typename?: 'CheckoutGiftCardRemovePayload' + /** The updated checkout object. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutGiftCardRemoveV2` mutation. */ +export type CheckoutGiftCardRemoveV2Payload = { + __typename?: 'CheckoutGiftCardRemoveV2Payload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutGiftCardsAppend` mutation. */ +export type CheckoutGiftCardsAppendPayload = { + __typename?: 'CheckoutGiftCardsAppendPayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** A single line item in the checkout, grouped by variant and attributes. */ +export type CheckoutLineItem = Node & { + __typename?: 'CheckoutLineItem' + /** Extra information in the form of an array of Key-Value pairs about the line item. */ + customAttributes: Array + /** The discounts that have been allocated onto the checkout line item by discount applications. */ + discountAllocations: Array + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The quantity of the line item. */ + quantity: Scalars['Int'] + /** Title of the line item. Defaults to the product's title. */ + title: Scalars['String'] + /** Unit price of the line item. */ + unitPrice?: Maybe + /** Product variant of the line item. */ + variant?: Maybe +} + +/** An auto-generated type for paginating through multiple CheckoutLineItems. */ +export type CheckoutLineItemConnection = { + __typename?: 'CheckoutLineItemConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one CheckoutLineItem and a cursor during pagination. */ +export type CheckoutLineItemEdge = { + __typename?: 'CheckoutLineItemEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of CheckoutLineItemEdge. */ + node: CheckoutLineItem +} + +/** Specifies the input fields to create a line item on a checkout. */ +export type CheckoutLineItemInput = { + /** Extra information in the form of an array of Key-Value pairs about the line item. */ + customAttributes?: Maybe> + /** The quantity of the line item. */ + quantity: Scalars['Int'] + /** The identifier of the product variant for the line item. */ + variantId: Scalars['ID'] +} + +/** Specifies the input fields to update a line item on the checkout. */ +export type CheckoutLineItemUpdateInput = { + /** The identifier of the line item. */ + id?: Maybe + /** The variant identifier of the line item. */ + variantId?: Maybe + /** The quantity of the line item. */ + quantity?: Maybe + /** Extra information in the form of an array of Key-Value pairs about the line item. */ + customAttributes?: Maybe> +} + +/** Return type for `checkoutLineItemsAdd` mutation. */ +export type CheckoutLineItemsAddPayload = { + __typename?: 'CheckoutLineItemsAddPayload' + /** The updated checkout object. */ + items?: Maybe + /** List of errors that occurred executing the mutation. */ + // checkoutUserErrors: Array + // /** + // * List of errors that occurred executing the mutation. + // * @deprecated Use `checkoutUserErrors` instead + // */ + // userErrors: Array +} + +/** Return type for `checkoutLineItemsRemove` mutation. */ +export type CheckoutLineItemsRemovePayload = { + __typename?: 'CheckoutLineItemsRemovePayload' + /** The updated checkout object. */ + items?: Maybe + /** List of errors that occurred executing the mutation. */ + // checkoutUserErrors: Array + // /** + // * List of errors that occurred executing the mutation. + // * @deprecated Use `checkoutUserErrors` instead + // */ + // userErrors: Array +} + +/** Return type for `checkoutLineItemsReplace` mutation. */ +export type CheckoutLineItemsReplacePayload = { + __typename?: 'CheckoutLineItemsReplacePayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + userErrors: Array +} + +/** Return type for `checkoutLineItemsUpdate` mutation. */ +export type CheckoutLineItemsUpdatePayload = { + __typename?: 'CheckoutLineItemsUpdatePayload' + /** The updated checkout object. */ + items?: Maybe + /** List of errors that occurred executing the mutation. */ + // checkoutUserErrors: Array + // /** + // * List of errors that occurred executing the mutation. + // * @deprecated Use `checkoutUserErrors` instead + // */ + // userErrors: Array +} + +/** Return type for `checkoutShippingAddressUpdate` mutation. */ +export type CheckoutShippingAddressUpdatePayload = { + __typename?: 'CheckoutShippingAddressUpdatePayload' + /** The updated checkout object. */ + checkout: Checkout + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutShippingAddressUpdateV2` mutation. */ +export type CheckoutShippingAddressUpdateV2Payload = { + __typename?: 'CheckoutShippingAddressUpdateV2Payload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `checkoutShippingLineUpdate` mutation. */ +export type CheckoutShippingLineUpdatePayload = { + __typename?: 'CheckoutShippingLineUpdatePayload' + /** The updated checkout object. */ + checkout?: Maybe + /** List of errors that occurred executing the mutation. */ + checkoutUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `checkoutUserErrors` instead + */ + userErrors: Array +} + +/** Represents an error that happens during execution of a checkout mutation. */ +export type CheckoutUserError = DisplayableError & { + __typename?: 'CheckoutUserError' + /** Error code to uniquely identify the error. */ + code?: Maybe + /** Path to the input field which caused the error. */ + field?: Maybe> + /** The error message. */ + message: Scalars['String'] +} + +/** A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. */ +export type Collection = Node & { + __typename?: 'Collection' + /** Stripped description of the collection, single line with HTML tags removed. */ + description: Scalars['String'] + /** The description of the collection, complete with HTML formatting. */ + descriptionHtml: Scalars['HTML'] + /** + * A human-friendly unique string for the collection automatically generated from its title. + * Limit of 255 characters. + */ + handle: Scalars['String'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** Image associated with the collection. */ + image?: Maybe + /** List of products in the collection. */ + products: ProductConnection + /** The collection’s name. Limit of 255 characters. */ + title: Scalars['String'] + /** The date and time when the collection was last modified. */ + updatedAt: Scalars['DateTime'] +} + +/** A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. */ +export type CollectionDescriptionArgs = { + truncateAt?: Maybe +} + +/** A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. */ +export type CollectionImageArgs = { + maxWidth?: Maybe + maxHeight?: Maybe + crop?: Maybe + scale?: Maybe +} + +/** A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. */ +export type CollectionProductsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe +} + +/** An auto-generated type for paginating through multiple Collections. */ +export type CollectionConnection = { + __typename?: 'CollectionConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Collection and a cursor during pagination. */ +export type CollectionEdge = { + __typename?: 'CollectionEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of CollectionEdge. */ + node: Collection +} + +/** The set of valid sort keys for the Collection query. */ +export enum CollectionSortKeys { + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `updated_at` value. */ + UpdatedAt = 'UPDATED_AT', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** A comment on an article. */ +export type Comment = Node & { + __typename?: 'Comment' + /** The comment’s author. */ + author: CommentAuthor + /** Stripped content of the comment, single line with HTML tags removed. */ + content: Scalars['String'] + /** The content of the comment, complete with HTML formatting. */ + contentHtml: Scalars['HTML'] + /** Globally unique identifier. */ + id: Scalars['ID'] +} + +/** A comment on an article. */ +export type CommentContentArgs = { + truncateAt?: Maybe +} + +/** The author of a comment. */ +export type CommentAuthor = { + __typename?: 'CommentAuthor' + /** The author's email. */ + email: Scalars['String'] + /** The author’s name. */ + name: Scalars['String'] +} + +/** An auto-generated type for paginating through multiple Comments. */ +export type CommentConnection = { + __typename?: 'CommentConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Comment and a cursor during pagination. */ +export type CommentEdge = { + __typename?: 'CommentEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of CommentEdge. */ + node: Comment +} + +/** ISO 3166-1 alpha-2 country codes with some differences. */ +export enum CountryCode { + /** Afghanistan. */ + Af = 'AF', + /** Åland Islands. */ + Ax = 'AX', + /** Albania. */ + Al = 'AL', + /** Algeria. */ + Dz = 'DZ', + /** Andorra. */ + Ad = 'AD', + /** Angola. */ + Ao = 'AO', + /** Anguilla. */ + Ai = 'AI', + /** Antigua & Barbuda. */ + Ag = 'AG', + /** Argentina. */ + Ar = 'AR', + /** Armenia. */ + Am = 'AM', + /** Aruba. */ + Aw = 'AW', + /** Australia. */ + Au = 'AU', + /** Austria. */ + At = 'AT', + /** Azerbaijan. */ + Az = 'AZ', + /** Bahamas. */ + Bs = 'BS', + /** Bahrain. */ + Bh = 'BH', + /** Bangladesh. */ + Bd = 'BD', + /** Barbados. */ + Bb = 'BB', + /** Belarus. */ + By = 'BY', + /** Belgium. */ + Be = 'BE', + /** Belize. */ + Bz = 'BZ', + /** Benin. */ + Bj = 'BJ', + /** Bermuda. */ + Bm = 'BM', + /** Bhutan. */ + Bt = 'BT', + /** Bolivia. */ + Bo = 'BO', + /** Bosnia & Herzegovina. */ + Ba = 'BA', + /** Botswana. */ + Bw = 'BW', + /** Bouvet Island. */ + Bv = 'BV', + /** Brazil. */ + Br = 'BR', + /** British Indian Ocean Territory. */ + Io = 'IO', + /** Brunei. */ + Bn = 'BN', + /** Bulgaria. */ + Bg = 'BG', + /** Burkina Faso. */ + Bf = 'BF', + /** Burundi. */ + Bi = 'BI', + /** Cambodia. */ + Kh = 'KH', + /** Canada. */ + Ca = 'CA', + /** Cape Verde. */ + Cv = 'CV', + /** Caribbean Netherlands. */ + Bq = 'BQ', + /** Cayman Islands. */ + Ky = 'KY', + /** Central African Republic. */ + Cf = 'CF', + /** Chad. */ + Td = 'TD', + /** Chile. */ + Cl = 'CL', + /** China. */ + Cn = 'CN', + /** Christmas Island. */ + Cx = 'CX', + /** Cocos (Keeling) Islands. */ + Cc = 'CC', + /** Colombia. */ + Co = 'CO', + /** Comoros. */ + Km = 'KM', + /** Congo - Brazzaville. */ + Cg = 'CG', + /** Congo - Kinshasa. */ + Cd = 'CD', + /** Cook Islands. */ + Ck = 'CK', + /** Costa Rica. */ + Cr = 'CR', + /** Croatia. */ + Hr = 'HR', + /** Cuba. */ + Cu = 'CU', + /** Curaçao. */ + Cw = 'CW', + /** Cyprus. */ + Cy = 'CY', + /** Czechia. */ + Cz = 'CZ', + /** Côte d’Ivoire. */ + Ci = 'CI', + /** Denmark. */ + Dk = 'DK', + /** Djibouti. */ + Dj = 'DJ', + /** Dominica. */ + Dm = 'DM', + /** Dominican Republic. */ + Do = 'DO', + /** Ecuador. */ + Ec = 'EC', + /** Egypt. */ + Eg = 'EG', + /** El Salvador. */ + Sv = 'SV', + /** Equatorial Guinea. */ + Gq = 'GQ', + /** Eritrea. */ + Er = 'ER', + /** Estonia. */ + Ee = 'EE', + /** Eswatini. */ + Sz = 'SZ', + /** Ethiopia. */ + Et = 'ET', + /** Falkland Islands. */ + Fk = 'FK', + /** Faroe Islands. */ + Fo = 'FO', + /** Fiji. */ + Fj = 'FJ', + /** Finland. */ + Fi = 'FI', + /** France. */ + Fr = 'FR', + /** French Guiana. */ + Gf = 'GF', + /** French Polynesia. */ + Pf = 'PF', + /** French Southern Territories. */ + Tf = 'TF', + /** Gabon. */ + Ga = 'GA', + /** Gambia. */ + Gm = 'GM', + /** Georgia. */ + Ge = 'GE', + /** Germany. */ + De = 'DE', + /** Ghana. */ + Gh = 'GH', + /** Gibraltar. */ + Gi = 'GI', + /** Greece. */ + Gr = 'GR', + /** Greenland. */ + Gl = 'GL', + /** Grenada. */ + Gd = 'GD', + /** Guadeloupe. */ + Gp = 'GP', + /** Guatemala. */ + Gt = 'GT', + /** Guernsey. */ + Gg = 'GG', + /** Guinea. */ + Gn = 'GN', + /** Guinea-Bissau. */ + Gw = 'GW', + /** Guyana. */ + Gy = 'GY', + /** Haiti. */ + Ht = 'HT', + /** Heard & McDonald Islands. */ + Hm = 'HM', + /** Vatican City. */ + Va = 'VA', + /** Honduras. */ + Hn = 'HN', + /** Hong Kong SAR. */ + Hk = 'HK', + /** Hungary. */ + Hu = 'HU', + /** Iceland. */ + Is = 'IS', + /** India. */ + In = 'IN', + /** Indonesia. */ + Id = 'ID', + /** Iran. */ + Ir = 'IR', + /** Iraq. */ + Iq = 'IQ', + /** Ireland. */ + Ie = 'IE', + /** Isle of Man. */ + Im = 'IM', + /** Israel. */ + Il = 'IL', + /** Italy. */ + It = 'IT', + /** Jamaica. */ + Jm = 'JM', + /** Japan. */ + Jp = 'JP', + /** Jersey. */ + Je = 'JE', + /** Jordan. */ + Jo = 'JO', + /** Kazakhstan. */ + Kz = 'KZ', + /** Kenya. */ + Ke = 'KE', + /** Kiribati. */ + Ki = 'KI', + /** North Korea. */ + Kp = 'KP', + /** Kosovo. */ + Xk = 'XK', + /** Kuwait. */ + Kw = 'KW', + /** Kyrgyzstan. */ + Kg = 'KG', + /** Laos. */ + La = 'LA', + /** Latvia. */ + Lv = 'LV', + /** Lebanon. */ + Lb = 'LB', + /** Lesotho. */ + Ls = 'LS', + /** Liberia. */ + Lr = 'LR', + /** Libya. */ + Ly = 'LY', + /** Liechtenstein. */ + Li = 'LI', + /** Lithuania. */ + Lt = 'LT', + /** Luxembourg. */ + Lu = 'LU', + /** Macao SAR. */ + Mo = 'MO', + /** Madagascar. */ + Mg = 'MG', + /** Malawi. */ + Mw = 'MW', + /** Malaysia. */ + My = 'MY', + /** Maldives. */ + Mv = 'MV', + /** Mali. */ + Ml = 'ML', + /** Malta. */ + Mt = 'MT', + /** Martinique. */ + Mq = 'MQ', + /** Mauritania. */ + Mr = 'MR', + /** Mauritius. */ + Mu = 'MU', + /** Mayotte. */ + Yt = 'YT', + /** Mexico. */ + Mx = 'MX', + /** Moldova. */ + Md = 'MD', + /** Monaco. */ + Mc = 'MC', + /** Mongolia. */ + Mn = 'MN', + /** Montenegro. */ + Me = 'ME', + /** Montserrat. */ + Ms = 'MS', + /** Morocco. */ + Ma = 'MA', + /** Mozambique. */ + Mz = 'MZ', + /** Myanmar (Burma). */ + Mm = 'MM', + /** Namibia. */ + Na = 'NA', + /** Nauru. */ + Nr = 'NR', + /** Nepal. */ + Np = 'NP', + /** Netherlands. */ + Nl = 'NL', + /** Netherlands Antilles. */ + An = 'AN', + /** New Caledonia. */ + Nc = 'NC', + /** New Zealand. */ + Nz = 'NZ', + /** Nicaragua. */ + Ni = 'NI', + /** Niger. */ + Ne = 'NE', + /** Nigeria. */ + Ng = 'NG', + /** Niue. */ + Nu = 'NU', + /** Norfolk Island. */ + Nf = 'NF', + /** North Macedonia. */ + Mk = 'MK', + /** Norway. */ + No = 'NO', + /** Oman. */ + Om = 'OM', + /** Pakistan. */ + Pk = 'PK', + /** Palestinian Territories. */ + Ps = 'PS', + /** Panama. */ + Pa = 'PA', + /** Papua New Guinea. */ + Pg = 'PG', + /** Paraguay. */ + Py = 'PY', + /** Peru. */ + Pe = 'PE', + /** Philippines. */ + Ph = 'PH', + /** Pitcairn Islands. */ + Pn = 'PN', + /** Poland. */ + Pl = 'PL', + /** Portugal. */ + Pt = 'PT', + /** Qatar. */ + Qa = 'QA', + /** Cameroon. */ + Cm = 'CM', + /** Réunion. */ + Re = 'RE', + /** Romania. */ + Ro = 'RO', + /** Russia. */ + Ru = 'RU', + /** Rwanda. */ + Rw = 'RW', + /** St. Barthélemy. */ + Bl = 'BL', + /** St. Helena. */ + Sh = 'SH', + /** St. Kitts & Nevis. */ + Kn = 'KN', + /** St. Lucia. */ + Lc = 'LC', + /** St. Martin. */ + Mf = 'MF', + /** St. Pierre & Miquelon. */ + Pm = 'PM', + /** Samoa. */ + Ws = 'WS', + /** San Marino. */ + Sm = 'SM', + /** São Tomé & Príncipe. */ + St = 'ST', + /** Saudi Arabia. */ + Sa = 'SA', + /** Senegal. */ + Sn = 'SN', + /** Serbia. */ + Rs = 'RS', + /** Seychelles. */ + Sc = 'SC', + /** Sierra Leone. */ + Sl = 'SL', + /** Singapore. */ + Sg = 'SG', + /** Sint Maarten. */ + Sx = 'SX', + /** Slovakia. */ + Sk = 'SK', + /** Slovenia. */ + Si = 'SI', + /** Solomon Islands. */ + Sb = 'SB', + /** Somalia. */ + So = 'SO', + /** South Africa. */ + Za = 'ZA', + /** South Georgia & South Sandwich Islands. */ + Gs = 'GS', + /** South Korea. */ + Kr = 'KR', + /** South Sudan. */ + Ss = 'SS', + /** Spain. */ + Es = 'ES', + /** Sri Lanka. */ + Lk = 'LK', + /** St. Vincent & Grenadines. */ + Vc = 'VC', + /** Sudan. */ + Sd = 'SD', + /** Suriname. */ + Sr = 'SR', + /** Svalbard & Jan Mayen. */ + Sj = 'SJ', + /** Sweden. */ + Se = 'SE', + /** Switzerland. */ + Ch = 'CH', + /** Syria. */ + Sy = 'SY', + /** Taiwan. */ + Tw = 'TW', + /** Tajikistan. */ + Tj = 'TJ', + /** Tanzania. */ + Tz = 'TZ', + /** Thailand. */ + Th = 'TH', + /** Timor-Leste. */ + Tl = 'TL', + /** Togo. */ + Tg = 'TG', + /** Tokelau. */ + Tk = 'TK', + /** Tonga. */ + To = 'TO', + /** Trinidad & Tobago. */ + Tt = 'TT', + /** Tunisia. */ + Tn = 'TN', + /** Turkey. */ + Tr = 'TR', + /** Turkmenistan. */ + Tm = 'TM', + /** Turks & Caicos Islands. */ + Tc = 'TC', + /** Tuvalu. */ + Tv = 'TV', + /** Uganda. */ + Ug = 'UG', + /** Ukraine. */ + Ua = 'UA', + /** United Arab Emirates. */ + Ae = 'AE', + /** United Kingdom. */ + Gb = 'GB', + /** United States. */ + Us = 'US', + /** U.S. Outlying Islands. */ + Um = 'UM', + /** Uruguay. */ + Uy = 'UY', + /** Uzbekistan. */ + Uz = 'UZ', + /** Vanuatu. */ + Vu = 'VU', + /** Venezuela. */ + Ve = 'VE', + /** Vietnam. */ + Vn = 'VN', + /** British Virgin Islands. */ + Vg = 'VG', + /** Wallis & Futuna. */ + Wf = 'WF', + /** Western Sahara. */ + Eh = 'EH', + /** Yemen. */ + Ye = 'YE', + /** Zambia. */ + Zm = 'ZM', + /** Zimbabwe. */ + Zw = 'ZW', +} + +/** Credit card information used for a payment. */ +export type CreditCard = { + __typename?: 'CreditCard' + /** The brand of the credit card. */ + brand?: Maybe + /** The expiry month of the credit card. */ + expiryMonth?: Maybe + /** The expiry year of the credit card. */ + expiryYear?: Maybe + /** The credit card's BIN number. */ + firstDigits?: Maybe + /** The first name of the card holder. */ + firstName?: Maybe + /** The last 4 digits of the credit card. */ + lastDigits?: Maybe + /** The last name of the card holder. */ + lastName?: Maybe + /** The masked credit card number with only the last 4 digits displayed. */ + maskedNumber?: Maybe +} + +/** + * Specifies the fields required to complete a checkout with + * a Shopify vaulted credit card payment. + */ +export type CreditCardPaymentInput = { + /** The amount of the payment. */ + amount: Scalars['Money'] + /** A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. */ + idempotencyKey: Scalars['String'] + /** The billing address for the payment. */ + billingAddress: MailingAddressInput + /** The ID returned by Shopify's Card Vault. */ + vaultId: Scalars['String'] + /** Executes the payment in test mode if possible. Defaults to `false`. */ + test?: Maybe +} + +/** + * Specifies the fields required to complete a checkout with + * a Shopify vaulted credit card payment. + */ +export type CreditCardPaymentInputV2 = { + /** The amount and currency of the payment. */ + paymentAmount: MoneyInput + /** A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. */ + idempotencyKey: Scalars['String'] + /** The billing address for the payment. */ + billingAddress: MailingAddressInput + /** The ID returned by Shopify's Card Vault. */ + vaultId: Scalars['String'] + /** Executes the payment in test mode if possible. Defaults to `false`. */ + test?: Maybe +} + +/** The part of the image that should remain after cropping. */ +export enum CropRegion { + /** Keep the center of the image. */ + Center = 'CENTER', + /** Keep the top of the image. */ + Top = 'TOP', + /** Keep the bottom of the image. */ + Bottom = 'BOTTOM', + /** Keep the left of the image. */ + Left = 'LEFT', + /** Keep the right of the image. */ + Right = 'RIGHT', +} + +/** Currency codes. */ +export enum CurrencyCode { + /** United States Dollars (USD). */ + Usd = 'USD', + /** Euro (EUR). */ + Eur = 'EUR', + /** United Kingdom Pounds (GBP). */ + Gbp = 'GBP', + /** Canadian Dollars (CAD). */ + Cad = 'CAD', + /** Afghan Afghani (AFN). */ + Afn = 'AFN', + /** Albanian Lek (ALL). */ + All = 'ALL', + /** Algerian Dinar (DZD). */ + Dzd = 'DZD', + /** Angolan Kwanza (AOA). */ + Aoa = 'AOA', + /** Argentine Pesos (ARS). */ + Ars = 'ARS', + /** Armenian Dram (AMD). */ + Amd = 'AMD', + /** Aruban Florin (AWG). */ + Awg = 'AWG', + /** Australian Dollars (AUD). */ + Aud = 'AUD', + /** Barbadian Dollar (BBD). */ + Bbd = 'BBD', + /** Azerbaijani Manat (AZN). */ + Azn = 'AZN', + /** Bangladesh Taka (BDT). */ + Bdt = 'BDT', + /** Bahamian Dollar (BSD). */ + Bsd = 'BSD', + /** Bahraini Dinar (BHD). */ + Bhd = 'BHD', + /** Burundian Franc (BIF). */ + Bif = 'BIF', + /** Belarusian Ruble (BYN). */ + Byn = 'BYN', + /** Belarusian Ruble (BYR). */ + Byr = 'BYR', + /** Belize Dollar (BZD). */ + Bzd = 'BZD', + /** Bermudian Dollar (BMD). */ + Bmd = 'BMD', + /** Bhutanese Ngultrum (BTN). */ + Btn = 'BTN', + /** Bosnia and Herzegovina Convertible Mark (BAM). */ + Bam = 'BAM', + /** Brazilian Real (BRL). */ + Brl = 'BRL', + /** Bolivian Boliviano (BOB). */ + Bob = 'BOB', + /** Botswana Pula (BWP). */ + Bwp = 'BWP', + /** Brunei Dollar (BND). */ + Bnd = 'BND', + /** Bulgarian Lev (BGN). */ + Bgn = 'BGN', + /** Burmese Kyat (MMK). */ + Mmk = 'MMK', + /** Cambodian Riel. */ + Khr = 'KHR', + /** Cape Verdean escudo (CVE). */ + Cve = 'CVE', + /** Cayman Dollars (KYD). */ + Kyd = 'KYD', + /** Central African CFA Franc (XAF). */ + Xaf = 'XAF', + /** Chilean Peso (CLP). */ + Clp = 'CLP', + /** Chinese Yuan Renminbi (CNY). */ + Cny = 'CNY', + /** Colombian Peso (COP). */ + Cop = 'COP', + /** Comorian Franc (KMF). */ + Kmf = 'KMF', + /** Congolese franc (CDF). */ + Cdf = 'CDF', + /** Costa Rican Colones (CRC). */ + Crc = 'CRC', + /** Croatian Kuna (HRK). */ + Hrk = 'HRK', + /** Czech Koruny (CZK). */ + Czk = 'CZK', + /** Danish Kroner (DKK). */ + Dkk = 'DKK', + /** Djiboutian Franc (DJF). */ + Djf = 'DJF', + /** Dominican Peso (DOP). */ + Dop = 'DOP', + /** East Caribbean Dollar (XCD). */ + Xcd = 'XCD', + /** Egyptian Pound (EGP). */ + Egp = 'EGP', + /** Eritrean Nakfa (ERN). */ + Ern = 'ERN', + /** Ethiopian Birr (ETB). */ + Etb = 'ETB', + /** Falkland Islands Pounds (FKP). */ + Fkp = 'FKP', + /** CFP Franc (XPF). */ + Xpf = 'XPF', + /** Fijian Dollars (FJD). */ + Fjd = 'FJD', + /** Gibraltar Pounds (GIP). */ + Gip = 'GIP', + /** Gambian Dalasi (GMD). */ + Gmd = 'GMD', + /** Ghanaian Cedi (GHS). */ + Ghs = 'GHS', + /** Guatemalan Quetzal (GTQ). */ + Gtq = 'GTQ', + /** Guyanese Dollar (GYD). */ + Gyd = 'GYD', + /** Georgian Lari (GEL). */ + Gel = 'GEL', + /** Guinean Franc (GNF). */ + Gnf = 'GNF', + /** Haitian Gourde (HTG). */ + Htg = 'HTG', + /** Honduran Lempira (HNL). */ + Hnl = 'HNL', + /** Hong Kong Dollars (HKD). */ + Hkd = 'HKD', + /** Hungarian Forint (HUF). */ + Huf = 'HUF', + /** Icelandic Kronur (ISK). */ + Isk = 'ISK', + /** Indian Rupees (INR). */ + Inr = 'INR', + /** Indonesian Rupiah (IDR). */ + Idr = 'IDR', + /** Israeli New Shekel (NIS). */ + Ils = 'ILS', + /** Iranian Rial (IRR). */ + Irr = 'IRR', + /** Iraqi Dinar (IQD). */ + Iqd = 'IQD', + /** Jamaican Dollars (JMD). */ + Jmd = 'JMD', + /** Japanese Yen (JPY). */ + Jpy = 'JPY', + /** Jersey Pound. */ + Jep = 'JEP', + /** Jordanian Dinar (JOD). */ + Jod = 'JOD', + /** Kazakhstani Tenge (KZT). */ + Kzt = 'KZT', + /** Kenyan Shilling (KES). */ + Kes = 'KES', + /** Kiribati Dollar (KID). */ + Kid = 'KID', + /** Kuwaiti Dinar (KWD). */ + Kwd = 'KWD', + /** Kyrgyzstani Som (KGS). */ + Kgs = 'KGS', + /** Laotian Kip (LAK). */ + Lak = 'LAK', + /** Latvian Lati (LVL). */ + Lvl = 'LVL', + /** Lebanese Pounds (LBP). */ + Lbp = 'LBP', + /** Lesotho Loti (LSL). */ + Lsl = 'LSL', + /** Liberian Dollar (LRD). */ + Lrd = 'LRD', + /** Libyan Dinar (LYD). */ + Lyd = 'LYD', + /** Lithuanian Litai (LTL). */ + Ltl = 'LTL', + /** Malagasy Ariary (MGA). */ + Mga = 'MGA', + /** Macedonia Denar (MKD). */ + Mkd = 'MKD', + /** Macanese Pataca (MOP). */ + Mop = 'MOP', + /** Malawian Kwacha (MWK). */ + Mwk = 'MWK', + /** Maldivian Rufiyaa (MVR). */ + Mvr = 'MVR', + /** Mauritanian Ouguiya (MRU). */ + Mru = 'MRU', + /** Mexican Pesos (MXN). */ + Mxn = 'MXN', + /** Malaysian Ringgits (MYR). */ + Myr = 'MYR', + /** Mauritian Rupee (MUR). */ + Mur = 'MUR', + /** Moldovan Leu (MDL). */ + Mdl = 'MDL', + /** Moroccan Dirham. */ + Mad = 'MAD', + /** Mongolian Tugrik. */ + Mnt = 'MNT', + /** Mozambican Metical. */ + Mzn = 'MZN', + /** Namibian Dollar. */ + Nad = 'NAD', + /** Nepalese Rupee (NPR). */ + Npr = 'NPR', + /** Netherlands Antillean Guilder. */ + Ang = 'ANG', + /** New Zealand Dollars (NZD). */ + Nzd = 'NZD', + /** Nicaraguan Córdoba (NIO). */ + Nio = 'NIO', + /** Nigerian Naira (NGN). */ + Ngn = 'NGN', + /** Norwegian Kroner (NOK). */ + Nok = 'NOK', + /** Omani Rial (OMR). */ + Omr = 'OMR', + /** Panamian Balboa (PAB). */ + Pab = 'PAB', + /** Pakistani Rupee (PKR). */ + Pkr = 'PKR', + /** Papua New Guinean Kina (PGK). */ + Pgk = 'PGK', + /** Paraguayan Guarani (PYG). */ + Pyg = 'PYG', + /** Peruvian Nuevo Sol (PEN). */ + Pen = 'PEN', + /** Philippine Peso (PHP). */ + Php = 'PHP', + /** Polish Zlotych (PLN). */ + Pln = 'PLN', + /** Qatari Rial (QAR). */ + Qar = 'QAR', + /** Romanian Lei (RON). */ + Ron = 'RON', + /** Russian Rubles (RUB). */ + Rub = 'RUB', + /** Rwandan Franc (RWF). */ + Rwf = 'RWF', + /** Samoan Tala (WST). */ + Wst = 'WST', + /** Saint Helena Pounds (SHP). */ + Shp = 'SHP', + /** Saudi Riyal (SAR). */ + Sar = 'SAR', + /** Sao Tome And Principe Dobra (STD). */ + Std = 'STD', + /** Serbian dinar (RSD). */ + Rsd = 'RSD', + /** Seychellois Rupee (SCR). */ + Scr = 'SCR', + /** Sierra Leonean Leone (SLL). */ + Sll = 'SLL', + /** Singapore Dollars (SGD). */ + Sgd = 'SGD', + /** Sudanese Pound (SDG). */ + Sdg = 'SDG', + /** Somali Shilling (SOS). */ + Sos = 'SOS', + /** Syrian Pound (SYP). */ + Syp = 'SYP', + /** South African Rand (ZAR). */ + Zar = 'ZAR', + /** South Korean Won (KRW). */ + Krw = 'KRW', + /** South Sudanese Pound (SSP). */ + Ssp = 'SSP', + /** Solomon Islands Dollar (SBD). */ + Sbd = 'SBD', + /** Sri Lankan Rupees (LKR). */ + Lkr = 'LKR', + /** Surinamese Dollar (SRD). */ + Srd = 'SRD', + /** Swazi Lilangeni (SZL). */ + Szl = 'SZL', + /** Swedish Kronor (SEK). */ + Sek = 'SEK', + /** Swiss Francs (CHF). */ + Chf = 'CHF', + /** Taiwan Dollars (TWD). */ + Twd = 'TWD', + /** Thai baht (THB). */ + Thb = 'THB', + /** Tajikistani Somoni (TJS). */ + Tjs = 'TJS', + /** Tanzanian Shilling (TZS). */ + Tzs = 'TZS', + /** Tongan Pa'anga (TOP). */ + Top = 'TOP', + /** Trinidad and Tobago Dollars (TTD). */ + Ttd = 'TTD', + /** Tunisian Dinar (TND). */ + Tnd = 'TND', + /** Turkish Lira (TRY). */ + Try = 'TRY', + /** Turkmenistani Manat (TMT). */ + Tmt = 'TMT', + /** Ugandan Shilling (UGX). */ + Ugx = 'UGX', + /** Ukrainian Hryvnia (UAH). */ + Uah = 'UAH', + /** United Arab Emirates Dirham (AED). */ + Aed = 'AED', + /** Uruguayan Pesos (UYU). */ + Uyu = 'UYU', + /** Uzbekistan som (UZS). */ + Uzs = 'UZS', + /** Vanuatu Vatu (VUV). */ + Vuv = 'VUV', + /** Venezuelan Bolivares (VEF). */ + Vef = 'VEF', + /** Venezuelan Bolivares (VES). */ + Ves = 'VES', + /** Vietnamese đồng (VND). */ + Vnd = 'VND', + /** West African CFA franc (XOF). */ + Xof = 'XOF', + /** Yemeni Rial (YER). */ + Yer = 'YER', + /** Zambian Kwacha (ZMW). */ + Zmw = 'ZMW', +} + +/** A customer represents a customer account with the shop. Customer accounts store contact information for the customer, saving logged-in customers the trouble of having to provide it at every checkout. */ +export type Customer = { + __typename?: 'Customer' + /** Indicates whether the customer has consented to be sent marketing material via email. */ + acceptsMarketing: Scalars['Boolean'] + /** A list of addresses for the customer. */ + addresses: MailingAddressConnection + /** The date and time when the customer was created. */ + createdAt: Scalars['DateTime'] + /** The customer’s default address. */ + defaultAddress?: Maybe + /** The customer’s name, email or phone number. */ + displayName: Scalars['String'] + /** The customer’s email address. */ + email?: Maybe + /** The customer’s first name. */ + firstName?: Maybe + /** A unique identifier for the customer. */ + id: Scalars['ID'] + /** The customer's most recently updated, incomplete checkout. */ + lastIncompleteCheckout?: Maybe + /** The customer’s last name. */ + lastName?: Maybe + /** The orders associated with the customer. */ + orders: OrderConnection + /** The customer’s phone number. */ + phone?: Maybe + /** + * A comma separated list of tags that have been added to the customer. + * Additional access scope required: unauthenticated_read_customer_tags. + */ + tags: Array + /** The date and time when the customer information was updated. */ + updatedAt: Scalars['DateTime'] +} + +/** A customer represents a customer account with the shop. Customer accounts store contact information for the customer, saving logged-in customers the trouble of having to provide it at every checkout. */ +export type CustomerAddressesArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** A customer represents a customer account with the shop. Customer accounts store contact information for the customer, saving logged-in customers the trouble of having to provide it at every checkout. */ +export type CustomerOrdersArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** A CustomerAccessToken represents the unique token required to make modifications to the customer object. */ +export type CustomerAccessToken = { + __typename?: 'CustomerAccessToken' + /** The customer’s access token. */ + accessToken: Scalars['String'] + /** The date and time when the customer access token expires. */ + expiresAt: Scalars['DateTime'] +} + +/** Specifies the input fields required to create a customer access token. */ +export type CustomerAccessTokenCreateInput = { + /** The email associated to the customer. */ + email: Scalars['String'] + /** The login password to be used by the customer. */ + password: Scalars['String'] +} + +/** Return type for `customerAccessTokenCreate` mutation. */ +export type CustomerAccessTokenCreatePayload = { + __typename?: 'CustomerAccessTokenCreatePayload' + /** The newly created customer access token object. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `customerAccessTokenCreateWithMultipass` mutation. */ +export type CustomerAccessTokenCreateWithMultipassPayload = { + __typename?: 'CustomerAccessTokenCreateWithMultipassPayload' + /** An access token object associated with the customer. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array +} + +/** Return type for `customerAccessTokenDelete` mutation. */ +export type CustomerAccessTokenDeletePayload = { + __typename?: 'CustomerAccessTokenDeletePayload' + /** The destroyed access token. */ + deletedAccessToken?: Maybe + /** ID of the destroyed customer access token. */ + deletedCustomerAccessTokenId?: Maybe + /** List of errors that occurred executing the mutation. */ + userErrors: Array +} + +/** Return type for `customerAccessTokenRenew` mutation. */ +export type CustomerAccessTokenRenewPayload = { + __typename?: 'CustomerAccessTokenRenewPayload' + /** The renewed customer access token object. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + userErrors: Array +} + +/** Return type for `customerActivateByUrl` mutation. */ +export type CustomerActivateByUrlPayload = { + __typename?: 'CustomerActivateByUrlPayload' + /** The customer that was activated. */ + customer?: Maybe + /** A new customer access token for the customer. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array +} + +/** Specifies the input fields required to activate a customer. */ +export type CustomerActivateInput = { + /** The activation token required to activate the customer. */ + activationToken: Scalars['String'] + /** New password that will be set during activation. */ + password: Scalars['String'] +} + +/** Return type for `customerActivate` mutation. */ +export type CustomerActivatePayload = { + __typename?: 'CustomerActivatePayload' + /** The customer object. */ + customer?: Maybe + /** A newly created customer access token object for the customer. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `customerAddressCreate` mutation. */ +export type CustomerAddressCreatePayload = { + __typename?: 'CustomerAddressCreatePayload' + /** The new customer address object. */ + customerAddress?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `customerAddressDelete` mutation. */ +export type CustomerAddressDeletePayload = { + __typename?: 'CustomerAddressDeletePayload' + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** ID of the deleted customer address. */ + deletedCustomerAddressId?: Maybe + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `customerAddressUpdate` mutation. */ +export type CustomerAddressUpdatePayload = { + __typename?: 'CustomerAddressUpdatePayload' + /** The customer’s updated mailing address. */ + customerAddress?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Specifies the fields required to create a new customer. */ +export type CustomerCreateInput = { + /** The customer’s first name. */ + firstName?: Maybe + /** The customer’s last name. */ + lastName?: Maybe + /** The customer’s email. */ + email: Scalars['String'] + /** + * A unique phone number for the customer. + * + * Formatted using E.164 standard. For example, _+16135551111_. + */ + phone?: Maybe + /** The login password used by the customer. */ + password: Scalars['String'] + /** Indicates whether the customer has consented to be sent marketing material via email. */ + acceptsMarketing?: Maybe +} + +/** Return type for `customerCreate` mutation. */ +export type CustomerCreatePayload = { + __typename?: 'CustomerCreatePayload' + /** The created customer object. */ + customer?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `customerDefaultAddressUpdate` mutation. */ +export type CustomerDefaultAddressUpdatePayload = { + __typename?: 'CustomerDefaultAddressUpdatePayload' + /** The updated customer object. */ + customer?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Possible error codes that could be returned by CustomerUserError. */ +export enum CustomerErrorCode { + /** Input value is blank. */ + Blank = 'BLANK', + /** Input value is invalid. */ + Invalid = 'INVALID', + /** Input value is already taken. */ + Taken = 'TAKEN', + /** Input value is too long. */ + TooLong = 'TOO_LONG', + /** Input value is too short. */ + TooShort = 'TOO_SHORT', + /** Unidentified customer. */ + UnidentifiedCustomer = 'UNIDENTIFIED_CUSTOMER', + /** Customer is disabled. */ + CustomerDisabled = 'CUSTOMER_DISABLED', + /** Input password starts or ends with whitespace. */ + PasswordStartsOrEndsWithWhitespace = 'PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE', + /** Input contains HTML tags. */ + ContainsHtmlTags = 'CONTAINS_HTML_TAGS', + /** Input contains URL. */ + ContainsUrl = 'CONTAINS_URL', + /** Invalid activation token. */ + TokenInvalid = 'TOKEN_INVALID', + /** Customer already enabled. */ + AlreadyEnabled = 'ALREADY_ENABLED', + /** Address does not exist. */ + NotFound = 'NOT_FOUND', + /** Input email contains an invalid domain name. */ + BadDomain = 'BAD_DOMAIN', + /** Multipass token is not valid. */ + InvalidMultipassRequest = 'INVALID_MULTIPASS_REQUEST', +} + +/** Return type for `customerRecover` mutation. */ +export type CustomerRecoverPayload = { + __typename?: 'CustomerRecoverPayload' + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Return type for `customerResetByUrl` mutation. */ +export type CustomerResetByUrlPayload = { + __typename?: 'CustomerResetByUrlPayload' + /** The customer object which was reset. */ + customer?: Maybe + /** A newly created customer access token object for the customer. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Specifies the fields required to reset a customer’s password. */ +export type CustomerResetInput = { + /** The reset token required to reset the customer’s password. */ + resetToken: Scalars['String'] + /** New password that will be set as part of the reset password process. */ + password: Scalars['String'] +} + +/** Return type for `customerReset` mutation. */ +export type CustomerResetPayload = { + __typename?: 'CustomerResetPayload' + /** The customer object which was reset. */ + customer?: Maybe + /** A newly created customer access token object for the customer. */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Specifies the fields required to update the Customer information. */ +export type CustomerUpdateInput = { + /** The customer’s first name. */ + firstName?: Maybe + /** The customer’s last name. */ + lastName?: Maybe + /** The customer’s email. */ + email?: Maybe + /** + * A unique phone number for the customer. + * + * Formatted using E.164 standard. For example, _+16135551111_. To remove the phone number, specify `null`. + */ + phone?: Maybe + /** The login password used by the customer. */ + password?: Maybe + /** Indicates whether the customer has consented to be sent marketing material via email. */ + acceptsMarketing?: Maybe +} + +/** Return type for `customerUpdate` mutation. */ +export type CustomerUpdatePayload = { + __typename?: 'CustomerUpdatePayload' + /** The updated customer object. */ + customer?: Maybe + /** + * The newly created customer access token. If the customer's password is updated, all previous access tokens + * (including the one used to perform this mutation) become invalid, and a new token is generated. + */ + customerAccessToken?: Maybe + /** List of errors that occurred executing the mutation. */ + customerUserErrors: Array + /** + * List of errors that occurred executing the mutation. + * @deprecated Use `customerUserErrors` instead + */ + userErrors: Array +} + +/** Represents an error that happens during execution of a customer mutation. */ +export type CustomerUserError = DisplayableError & { + __typename?: 'CustomerUserError' + /** Error code to uniquely identify the error. */ + code?: Maybe + /** Path to the input field which caused the error. */ + field?: Maybe> + /** The error message. */ + message: Scalars['String'] +} + +/** Digital wallet, such as Apple Pay, which can be used for accelerated checkouts. */ +export enum DigitalWallet { + /** Apple Pay. */ + ApplePay = 'APPLE_PAY', + /** Android Pay. */ + AndroidPay = 'ANDROID_PAY', + /** Google Pay. */ + GooglePay = 'GOOGLE_PAY', + /** Shopify Pay. */ + ShopifyPay = 'SHOPIFY_PAY', +} + +/** An amount discounting the line that has been allocated by a discount. */ +export type DiscountAllocation = { + __typename?: 'DiscountAllocation' + /** Amount of discount allocated. */ + allocatedAmount: MoneyV2 + /** The discount this allocated amount originated from. */ + discountApplication: DiscountApplication +} + +/** + * Discount applications capture the intentions of a discount source at + * the time of application. + */ +export type DiscountApplication = { + /** The method by which the discount's value is allocated to its entitled items. */ + allocationMethod: DiscountApplicationAllocationMethod + /** Which lines of targetType that the discount is allocated over. */ + targetSelection: DiscountApplicationTargetSelection + /** The type of line that the discount is applicable towards. */ + targetType: DiscountApplicationTargetType + /** The value of the discount application. */ + value: PricingValue +} + +/** The method by which the discount's value is allocated onto its entitled lines. */ +export enum DiscountApplicationAllocationMethod { + /** The value is spread across all entitled lines. */ + Across = 'ACROSS', + /** The value is applied onto every entitled line. */ + Each = 'EACH', + /** The value is specifically applied onto a particular line. */ + One = 'ONE', +} + +/** An auto-generated type for paginating through multiple DiscountApplications. */ +export type DiscountApplicationConnection = { + __typename?: 'DiscountApplicationConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one DiscountApplication and a cursor during pagination. */ +export type DiscountApplicationEdge = { + __typename?: 'DiscountApplicationEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of DiscountApplicationEdge. */ + node: DiscountApplication +} + +/** + * Which lines on the order that the discount is allocated over, of the type + * defined by the Discount Application's target_type. + */ +export enum DiscountApplicationTargetSelection { + /** The discount is allocated onto all the lines. */ + All = 'ALL', + /** The discount is allocated onto only the lines it is entitled for. */ + Entitled = 'ENTITLED', + /** The discount is allocated onto explicitly chosen lines. */ + Explicit = 'EXPLICIT', +} + +/** The type of line (i.e. line item or shipping line) on an order that the discount is applicable towards. */ +export enum DiscountApplicationTargetType { + /** The discount applies onto line items. */ + LineItem = 'LINE_ITEM', + /** The discount applies onto shipping lines. */ + ShippingLine = 'SHIPPING_LINE', +} + +/** + * Discount code applications capture the intentions of a discount code at + * the time that it is applied. + */ +export type DiscountCodeApplication = DiscountApplication & { + __typename?: 'DiscountCodeApplication' + /** The method by which the discount's value is allocated to its entitled items. */ + allocationMethod: DiscountApplicationAllocationMethod + /** Specifies whether the discount code was applied successfully. */ + applicable: Scalars['Boolean'] + /** The string identifying the discount code that was used at the time of application. */ + code: Scalars['String'] + /** Which lines of targetType that the discount is allocated over. */ + targetSelection: DiscountApplicationTargetSelection + /** The type of line that the discount is applicable towards. */ + targetType: DiscountApplicationTargetType + /** The value of the discount application. */ + value: PricingValue +} + +/** Represents an error in the input of a mutation. */ +export type DisplayableError = { + /** Path to the input field which caused the error. */ + field?: Maybe> + /** The error message. */ + message: Scalars['String'] +} + +/** Represents a web address. */ +export type Domain = { + __typename?: 'Domain' + /** The host name of the domain (eg: `example.com`). */ + host: Scalars['String'] + /** Whether SSL is enabled or not. */ + sslEnabled: Scalars['Boolean'] + /** The URL of the domain (eg: `https://example.com`). */ + url: Scalars['URL'] +} + +/** Represents a video hosted outside of Shopify. */ +export type ExternalVideo = Node & + Media & { + __typename?: 'ExternalVideo' + /** A word or phrase to share the nature or contents of a media. */ + alt?: Maybe + /** The URL. */ + embeddedUrl: Scalars['URL'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The media content type. */ + mediaContentType: MediaContentType + /** The preview image for the media. */ + previewImage?: Maybe + } + +/** Represents a single fulfillment in an order. */ +export type Fulfillment = { + __typename?: 'Fulfillment' + /** List of the fulfillment's line items. */ + fulfillmentLineItems: FulfillmentLineItemConnection + /** The name of the tracking company. */ + trackingCompany?: Maybe + /** + * Tracking information associated with the fulfillment, + * such as the tracking number and tracking URL. + */ + trackingInfo: Array +} + +/** Represents a single fulfillment in an order. */ +export type FulfillmentFulfillmentLineItemsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** Represents a single fulfillment in an order. */ +export type FulfillmentTrackingInfoArgs = { + first?: Maybe +} + +/** Represents a single line item in a fulfillment. There is at most one fulfillment line item for each order line item. */ +export type FulfillmentLineItem = { + __typename?: 'FulfillmentLineItem' + /** The associated order's line item. */ + lineItem: OrderLineItem + /** The amount fulfilled in this fulfillment. */ + quantity: Scalars['Int'] +} + +/** An auto-generated type for paginating through multiple FulfillmentLineItems. */ +export type FulfillmentLineItemConnection = { + __typename?: 'FulfillmentLineItemConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. */ +export type FulfillmentLineItemEdge = { + __typename?: 'FulfillmentLineItemEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of FulfillmentLineItemEdge. */ + node: FulfillmentLineItem +} + +/** Tracking information associated with the fulfillment. */ +export type FulfillmentTrackingInfo = { + __typename?: 'FulfillmentTrackingInfo' + /** The tracking number of the fulfillment. */ + number?: Maybe + /** The URL to track the fulfillment. */ + url?: Maybe +} + +/** Represents information about the metafields associated to the specified resource. */ +export type HasMetafields = { + /** The metafield associated with the resource. */ + metafield?: Maybe + /** A paginated list of metafields associated with the resource. */ + metafields: MetafieldConnection +} + +/** Represents information about the metafields associated to the specified resource. */ +export type HasMetafieldsMetafieldArgs = { + namespace: Scalars['String'] + key: Scalars['String'] +} + +/** Represents information about the metafields associated to the specified resource. */ +export type HasMetafieldsMetafieldsArgs = { + namespace?: Maybe + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** Represents an image resource. */ +export type Image = { + __typename?: 'Image' + /** A word or phrase to share the nature or contents of an image. */ + altText?: Maybe + /** The original height of the image in pixels. Returns `null` if the image is not hosted by Shopify. */ + height?: Maybe + /** A unique identifier for the image. */ + id?: Maybe + /** + * The location of the original image as a URL. + * + * If there are any existing transformations in the original source URL, they will remain and not be stripped. + */ + originalSrc: Scalars['URL'] + /** + * The location of the image as a URL. + * @deprecated Previously an image had a single `src` field. This could either return the original image + * location or a URL that contained transformations such as sizing or scale. + * + * These transformations were specified by arguments on the parent field. + * + * Now an image has two distinct URL fields: `originalSrc` and `transformedSrc`. + * + * * `originalSrc` - the original unmodified image URL + * * `transformedSrc` - the image URL with the specified transformations included + * + * To migrate to the new fields, image transformations should be moved from the parent field to `transformedSrc`. + * + * Before: + * ```graphql + * { + * shop { + * productImages(maxWidth: 200, scale: 2) { + * edges { + * node { + * src + * } + * } + * } + * } + * } + * ``` + * + * After: + * ```graphql + * { + * shop { + * productImages { + * edges { + * node { + * transformedSrc(maxWidth: 200, scale: 2) + * } + * } + * } + * } + * } + * ``` + * + */ + src: Scalars['URL'] + /** + * The location of the transformed image as a URL. + * + * All transformation arguments are considered "best-effort". If they can be applied to an image, they will be. + * Otherwise any transformations which an image type does not support will be ignored. + */ + transformedSrc: Scalars['URL'] + /** The original width of the image in pixels. Returns `null` if the image is not hosted by Shopify. */ + width?: Maybe +} + +/** Represents an image resource. */ +export type ImageTransformedSrcArgs = { + maxWidth?: Maybe + maxHeight?: Maybe + crop?: Maybe + scale?: Maybe + preferredContentType?: Maybe +} + +/** An auto-generated type for paginating through multiple Images. */ +export type ImageConnection = { + __typename?: 'ImageConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** List of supported image content types. */ +export enum ImageContentType { + /** A PNG image. */ + Png = 'PNG', + /** A JPG image. */ + Jpg = 'JPG', + /** A WEBP image. */ + Webp = 'WEBP', +} + +/** An auto-generated type which holds one Image and a cursor during pagination. */ +export type ImageEdge = { + __typename?: 'ImageEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of ImageEdge. */ + node: Image +} + +/** Represents a mailing address for customers and shipping. */ +export type MailingAddress = Node & { + __typename?: 'MailingAddress' + /** The first line of the address. Typically the street address or PO Box number. */ + address1?: Maybe + /** The second line of the address. Typically the number of the apartment, suite, or unit. */ + address2?: Maybe + /** The name of the city, district, village, or town. */ + city?: Maybe + /** The name of the customer's company or organization. */ + company?: Maybe + /** The name of the country. */ + country?: Maybe + /** + * The two-letter code for the country of the address. + * + * For example, US. + * @deprecated Use `countryCodeV2` instead + */ + countryCode?: Maybe + /** + * The two-letter code for the country of the address. + * + * For example, US. + */ + countryCodeV2?: Maybe + /** The first name of the customer. */ + firstName?: Maybe + /** A formatted version of the address, customized by the provided arguments. */ + formatted: Array + /** A comma-separated list of the values for city, province, and country. */ + formattedArea?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The last name of the customer. */ + lastName?: Maybe + /** The latitude coordinate of the customer address. */ + latitude?: Maybe + /** The longitude coordinate of the customer address. */ + longitude?: Maybe + /** The full name of the customer, based on firstName and lastName. */ + name?: Maybe + /** + * A unique phone number for the customer. + * + * Formatted using E.164 standard. For example, _+16135551111_. + */ + phone?: Maybe + /** The region of the address, such as the province, state, or district. */ + province?: Maybe + /** + * The two-letter code for the region. + * + * For example, ON. + */ + provinceCode?: Maybe + /** The zip or postal code of the address. */ + zip?: Maybe +} + +/** Represents a mailing address for customers and shipping. */ +export type MailingAddressFormattedArgs = { + withName?: Maybe + withCompany?: Maybe +} + +/** An auto-generated type for paginating through multiple MailingAddresses. */ +export type MailingAddressConnection = { + __typename?: 'MailingAddressConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one MailingAddress and a cursor during pagination. */ +export type MailingAddressEdge = { + __typename?: 'MailingAddressEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of MailingAddressEdge. */ + node: MailingAddress +} + +/** Specifies the fields accepted to create or update a mailing address. */ +export type MailingAddressInput = { + /** The first line of the address. Typically the street address or PO Box number. */ + address1?: Maybe + /** The second line of the address. Typically the number of the apartment, suite, or unit. */ + address2?: Maybe + /** The name of the city, district, village, or town. */ + city?: Maybe + /** The name of the customer's company or organization. */ + company?: Maybe + /** The name of the country. */ + country?: Maybe + /** The first name of the customer. */ + firstName?: Maybe + /** The last name of the customer. */ + lastName?: Maybe + /** + * A unique phone number for the customer. + * + * Formatted using E.164 standard. For example, _+16135551111_. + */ + phone?: Maybe + /** The region of the address, such as the province, state, or district. */ + province?: Maybe + /** The zip or postal code of the address. */ + zip?: Maybe +} + +/** Manual discount applications capture the intentions of a discount that was manually created. */ +export type ManualDiscountApplication = DiscountApplication & { + __typename?: 'ManualDiscountApplication' + /** The method by which the discount's value is allocated to its entitled items. */ + allocationMethod: DiscountApplicationAllocationMethod + /** The description of the application. */ + description?: Maybe + /** Which lines of targetType that the discount is allocated over. */ + targetSelection: DiscountApplicationTargetSelection + /** The type of line that the discount is applicable towards. */ + targetType: DiscountApplicationTargetType + /** The title of the application. */ + title: Scalars['String'] + /** The value of the discount application. */ + value: PricingValue +} + +/** Represents a media interface. */ +export type Media = { + /** A word or phrase to share the nature or contents of a media. */ + alt?: Maybe + /** The media content type. */ + mediaContentType: MediaContentType + /** The preview image for the media. */ + previewImage?: Maybe +} + +/** An auto-generated type for paginating through multiple Media. */ +export type MediaConnection = { + __typename?: 'MediaConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** The possible content types for a media object. */ +export enum MediaContentType { + /** An externally hosted video. */ + ExternalVideo = 'EXTERNAL_VIDEO', + /** A Shopify hosted image. */ + Image = 'IMAGE', + /** A 3d model. */ + Model_3D = 'MODEL_3D', + /** A Shopify hosted video. */ + Video = 'VIDEO', +} + +/** An auto-generated type which holds one Media and a cursor during pagination. */ +export type MediaEdge = { + __typename?: 'MediaEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of MediaEdge. */ + node: Media +} + +/** Represents a Shopify hosted image. */ +export type MediaImage = Node & + Media & { + __typename?: 'MediaImage' + /** A word or phrase to share the nature or contents of a media. */ + alt?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The image for the media. */ + image?: Maybe + /** The media content type. */ + mediaContentType: MediaContentType + /** The preview image for the media. */ + previewImage?: Maybe + } + +/** + * Metafields represent custom metadata attached to a resource. Metafields can be sorted into namespaces and are + * comprised of keys, values, and value types. + */ +export type Metafield = Node & { + __typename?: 'Metafield' + /** The date and time when the storefront metafield was created. */ + createdAt: Scalars['DateTime'] + /** The description of a metafield. */ + description?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The key name for a metafield. */ + key: Scalars['String'] + /** The namespace for a metafield. */ + namespace: Scalars['String'] + /** The parent object that the metafield belongs to. */ + parentResource: MetafieldParentResource + /** The date and time when the storefront metafield was updated. */ + updatedAt: Scalars['DateTime'] + /** The value of a metafield. */ + value: Scalars['String'] + /** Represents the metafield value type. */ + valueType: MetafieldValueType +} + +/** An auto-generated type for paginating through multiple Metafields. */ +export type MetafieldConnection = { + __typename?: 'MetafieldConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Metafield and a cursor during pagination. */ +export type MetafieldEdge = { + __typename?: 'MetafieldEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of MetafieldEdge. */ + node: Metafield +} + +/** A resource that the metafield belongs to. */ +export type MetafieldParentResource = Product | ProductVariant + +/** Metafield value types. */ +export enum MetafieldValueType { + /** A string metafield. */ + String = 'STRING', + /** An integer metafield. */ + Integer = 'INTEGER', + /** A json string metafield. */ + JsonString = 'JSON_STRING', +} + +/** Represents a Shopify hosted 3D model. */ +export type Model3d = Node & + Media & { + __typename?: 'Model3d' + /** A word or phrase to share the nature or contents of a media. */ + alt?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The media content type. */ + mediaContentType: MediaContentType + /** The preview image for the media. */ + previewImage?: Maybe + /** The sources for a 3d model. */ + sources: Array + } + +/** Represents a source for a Shopify hosted 3d model. */ +export type Model3dSource = { + __typename?: 'Model3dSource' + /** The filesize of the 3d model. */ + filesize: Scalars['Int'] + /** The format of the 3d model. */ + format: Scalars['String'] + /** The MIME type of the 3d model. */ + mimeType: Scalars['String'] + /** The URL of the 3d model. */ + url: Scalars['String'] +} + +/** Specifies the fields for a monetary value with currency. */ +export type MoneyInput = { + /** Decimal money amount. */ + amount: Scalars['Decimal'] + /** Currency of the money. */ + currencyCode: CurrencyCode +} + +/** + * A monetary value with currency. + * + * To format currencies, combine this type's amount and currencyCode fields with your client's locale. + * + * For example, in JavaScript you could use Intl.NumberFormat: + * + * ```js + * new Intl.NumberFormat(locale, { + * style: 'currency', + * currency: currencyCode + * }).format(amount); + * ``` + * + * Other formatting libraries include: + * + * * iOS - [NumberFormatter](https://developer.apple.com/documentation/foundation/numberformatter) + * * Android - [NumberFormat](https://developer.android.com/reference/java/text/NumberFormat.html) + * * PHP - [NumberFormatter](http://php.net/manual/en/class.numberformatter.php) + * + * For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations + * (such as [TwitterCldr](https://github.com/twitter/twitter-cldr-rb)). + */ +export type MoneyV2 = { + __typename?: 'MoneyV2' + /** Decimal money amount. */ + amount: Scalars['Decimal'] + /** Currency of the money. */ + currencyCode: CurrencyCode +} + +/** An auto-generated type for paginating through multiple MoneyV2s. */ +export type MoneyV2Connection = { + __typename?: 'MoneyV2Connection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one MoneyV2 and a cursor during pagination. */ +export type MoneyV2Edge = { + __typename?: 'MoneyV2Edge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of MoneyV2Edge. */ + node: MoneyV2 +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type Mutation = { + __typename?: 'Mutation' + /** + * Updates the attributes of a checkout. + * @deprecated Use `checkoutAttributesUpdateV2` instead + */ + checkoutAttributesUpdate?: Maybe + /** Updates the attributes of a checkout. */ + checkoutAttributesUpdateV2?: Maybe + /** Completes a checkout without providing payment information. You can use this mutation for free items or items whose purchase price is covered by a gift card. */ + checkoutCompleteFree?: Maybe + /** + * Completes a checkout using a credit card token from Shopify's Vault. + * @deprecated Use `checkoutCompleteWithCreditCardV2` instead + */ + checkoutCompleteWithCreditCard?: Maybe + /** Completes a checkout using a credit card token from Shopify's card vault. Before you can complete checkouts using CheckoutCompleteWithCreditCardV2, you need to [_request payment processing_](https://help.shopify.com/api/guides/sales-channel-sdk/getting-started#request-payment-processing). */ + checkoutCompleteWithCreditCardV2?: Maybe + /** + * Completes a checkout with a tokenized payment. + * @deprecated Use `checkoutCompleteWithTokenizedPaymentV2` instead + */ + checkoutCompleteWithTokenizedPayment?: Maybe + /** + * Completes a checkout with a tokenized payment. + * @deprecated Use `checkoutCompleteWithTokenizedPaymentV3` instead + */ + checkoutCompleteWithTokenizedPaymentV2?: Maybe + /** Completes a checkout with a tokenized payment. */ + checkoutCompleteWithTokenizedPaymentV3?: Maybe + /** Creates a new checkout. */ + checkoutCreate?: Maybe + /** + * Associates a customer to the checkout. + * @deprecated Use `checkoutCustomerAssociateV2` instead + */ + checkoutCustomerAssociate?: Maybe + /** Associates a customer to the checkout. */ + checkoutCustomerAssociateV2?: Maybe + /** + * Disassociates the current checkout customer from the checkout. + * @deprecated Use `checkoutCustomerDisassociateV2` instead + */ + checkoutCustomerDisassociate?: Maybe + /** Disassociates the current checkout customer from the checkout. */ + checkoutCustomerDisassociateV2?: Maybe + /** + * Applies a discount to an existing checkout using a discount code. + * @deprecated Use `checkoutDiscountCodeApplyV2` instead + */ + checkoutDiscountCodeApply?: Maybe + /** Applies a discount to an existing checkout using a discount code. */ + checkoutDiscountCodeApplyV2?: Maybe + /** Removes the applied discount from an existing checkout. */ + checkoutDiscountCodeRemove?: Maybe + /** + * Updates the email on an existing checkout. + * @deprecated Use `checkoutEmailUpdateV2` instead + */ + checkoutEmailUpdate?: Maybe + /** Updates the email on an existing checkout. */ + checkoutEmailUpdateV2?: Maybe + /** + * Applies a gift card to an existing checkout using a gift card code. This will replace all currently applied gift cards. + * @deprecated Use `checkoutGiftCardsAppend` instead + */ + checkoutGiftCardApply?: Maybe + /** + * Removes an applied gift card from the checkout. + * @deprecated Use `checkoutGiftCardRemoveV2` instead + */ + checkoutGiftCardRemove?: Maybe + /** Removes an applied gift card from the checkout. */ + checkoutGiftCardRemoveV2?: Maybe + /** Appends gift cards to an existing checkout. */ + checkoutGiftCardsAppend?: Maybe + /** Adds a list of line items to a checkout. */ + checkoutLineItemsAdd?: Maybe + /** Removes line items from an existing checkout. */ + checkoutLineItemsRemove?: Maybe + /** Sets a list of line items to a checkout. */ + checkoutLineItemsReplace?: Maybe + /** Updates line items on a checkout. */ + checkoutLineItemsUpdate?: Maybe + /** + * Updates the shipping address of an existing checkout. + * @deprecated Use `checkoutShippingAddressUpdateV2` instead + */ + checkoutShippingAddressUpdate?: Maybe + /** Updates the shipping address of an existing checkout. */ + checkoutShippingAddressUpdateV2?: Maybe + /** Updates the shipping lines on an existing checkout. */ + checkoutShippingLineUpdate?: Maybe + /** + * Creates a customer access token. + * The customer access token is required to modify the customer object in any way. + */ + customerAccessTokenCreate?: Maybe + /** + * Creates a customer access token using a multipass token instead of email and password. + * A customer record is created if customer does not exist. If a customer record already + * exists but the record is disabled, then it's enabled. + */ + customerAccessTokenCreateWithMultipass?: Maybe + /** Permanently destroys a customer access token. */ + customerAccessTokenDelete?: Maybe + /** + * Renews a customer access token. + * + * Access token renewal must happen *before* a token expires. + * If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. + */ + customerAccessTokenRenew?: Maybe + /** Activates a customer. */ + customerActivate?: Maybe + /** Activates a customer with the activation url received from `customerCreate`. */ + customerActivateByUrl?: Maybe + /** Creates a new address for a customer. */ + customerAddressCreate?: Maybe + /** Permanently deletes the address of an existing customer. */ + customerAddressDelete?: Maybe + /** Updates the address of an existing customer. */ + customerAddressUpdate?: Maybe + /** Creates a new customer. */ + customerCreate?: Maybe + /** Updates the default address of an existing customer. */ + customerDefaultAddressUpdate?: Maybe + /** Sends a reset password email to the customer, as the first step in the reset password process. */ + customerRecover?: Maybe + /** Resets a customer’s password with a token received from `CustomerRecover`. */ + customerReset?: Maybe + /** Resets a customer’s password with the reset password url received from `CustomerRecover`. */ + customerResetByUrl?: Maybe + /** Updates an existing customer. */ + customerUpdate?: Maybe +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutAttributesUpdateArgs = { + checkoutId: Scalars['ID'] + input: CheckoutAttributesUpdateInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutAttributesUpdateV2Args = { + checkoutId: Scalars['ID'] + input: CheckoutAttributesUpdateV2Input +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCompleteFreeArgs = { + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCompleteWithCreditCardArgs = { + checkoutId: Scalars['ID'] + payment: CreditCardPaymentInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCompleteWithCreditCardV2Args = { + checkoutId: Scalars['ID'] + payment: CreditCardPaymentInputV2 +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCompleteWithTokenizedPaymentArgs = { + checkoutId: Scalars['ID'] + payment: TokenizedPaymentInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCompleteWithTokenizedPaymentV2Args = { + checkoutId: Scalars['ID'] + payment: TokenizedPaymentInputV2 +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCompleteWithTokenizedPaymentV3Args = { + checkoutId: Scalars['ID'] + payment: TokenizedPaymentInputV3 +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCreateArgs = { + input: CheckoutCreateInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCustomerAssociateArgs = { + checkoutId: Scalars['ID'] + customerAccessToken: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCustomerAssociateV2Args = { + checkoutId: Scalars['ID'] + customerAccessToken: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCustomerDisassociateArgs = { + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutCustomerDisassociateV2Args = { + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutDiscountCodeApplyArgs = { + discountCode: Scalars['String'] + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutDiscountCodeApplyV2Args = { + discountCode: Scalars['String'] + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutDiscountCodeRemoveArgs = { + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutEmailUpdateArgs = { + checkoutId: Scalars['ID'] + email: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutEmailUpdateV2Args = { + checkoutId: Scalars['ID'] + email: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutGiftCardApplyArgs = { + giftCardCode: Scalars['String'] + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutGiftCardRemoveArgs = { + appliedGiftCardId: Scalars['ID'] + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutGiftCardRemoveV2Args = { + appliedGiftCardId: Scalars['ID'] + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutGiftCardsAppendArgs = { + giftCardCodes: Array + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutLineItemsAddArgs = { + lineItems: Array + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutLineItemsRemoveArgs = { + checkoutId: Scalars['ID'] + lineItemIds: Array +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutLineItemsReplaceArgs = { + lineItems: Array + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutLineItemsUpdateArgs = { + checkoutId: Scalars['ID'] + lineItems: Array +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutShippingAddressUpdateArgs = { + shippingAddress: MailingAddressInput + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutShippingAddressUpdateV2Args = { + shippingAddress: MailingAddressInput + checkoutId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCheckoutShippingLineUpdateArgs = { + checkoutId: Scalars['ID'] + shippingRateHandle: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAccessTokenCreateArgs = { + input: CustomerAccessTokenCreateInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAccessTokenCreateWithMultipassArgs = { + multipassToken: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAccessTokenDeleteArgs = { + customerAccessToken: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAccessTokenRenewArgs = { + customerAccessToken: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerActivateArgs = { + id: Scalars['ID'] + input: CustomerActivateInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerActivateByUrlArgs = { + activationUrl: Scalars['URL'] + password: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAddressCreateArgs = { + customerAccessToken: Scalars['String'] + address: MailingAddressInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAddressDeleteArgs = { + id: Scalars['ID'] + customerAccessToken: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerAddressUpdateArgs = { + customerAccessToken: Scalars['String'] + id: Scalars['ID'] + address: MailingAddressInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerCreateArgs = { + input: CustomerCreateInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerDefaultAddressUpdateArgs = { + customerAccessToken: Scalars['String'] + addressId: Scalars['ID'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerRecoverArgs = { + email: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerResetArgs = { + id: Scalars['ID'] + input: CustomerResetInput +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerResetByUrlArgs = { + resetUrl: Scalars['URL'] + password: Scalars['String'] +} + +/** The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. */ +export type MutationCustomerUpdateArgs = { + customerAccessToken: Scalars['String'] + customer: CustomerUpdateInput +} + +/** An object with an ID to support global identification. */ +export type Node = { + /** Globally unique identifier. */ + id: Scalars['ID'] +} + +/** An order is a customer’s completed request to purchase one or more products from a shop. An order is created when a customer completes the checkout process, during which time they provides an email address, billing address and payment information. */ +export type Order = Node & { + __typename?: 'Order' + /** The reason for the order's cancellation. Returns `null` if the order wasn't canceled. */ + cancelReason?: Maybe + /** The date and time when the order was canceled. Returns null if the order wasn't canceled. */ + canceledAt?: Maybe + /** The code of the currency used for the payment. */ + currencyCode: CurrencyCode + /** The subtotal of line items and their discounts, excluding line items that have been removed. Does not contain order-level discounts, duties, shipping costs, or shipping discounts. Taxes are not included unless the order is a taxes-included order. */ + currentSubtotalPrice: MoneyV2 + /** The total amount of the order, including duties, taxes and discounts, minus amounts for line items that have been removed. */ + currentTotalPrice: MoneyV2 + /** The total of all taxes applied to the order, excluding taxes for returned line items. */ + currentTotalTax: MoneyV2 + /** The locale code in which this specific order happened. */ + customerLocale?: Maybe + /** The unique URL that the customer can use to access the order. */ + customerUrl?: Maybe + /** Discounts that have been applied on the order. */ + discountApplications: DiscountApplicationConnection + /** Whether the order has had any edits applied or not. */ + edited: Scalars['Boolean'] + /** The customer's email address. */ + email?: Maybe + /** The financial status of the order. */ + financialStatus?: Maybe + /** The fulfillment status for the order. */ + fulfillmentStatus: OrderFulfillmentStatus + /** Globally unique identifier. */ + id: Scalars['ID'] + /** List of the order’s line items. */ + lineItems: OrderLineItemConnection + /** + * Unique identifier for the order that appears on the order. + * For example, _#1000_ or _Store1001. + */ + name: Scalars['String'] + /** A unique numeric identifier for the order for use by shop owner and customer. */ + orderNumber: Scalars['Int'] + /** The total price of the order before any applied edits. */ + originalTotalPrice: MoneyV2 + /** The customer's phone number for receiving SMS notifications. */ + phone?: Maybe + /** + * The date and time when the order was imported. + * This value can be set to dates in the past when importing from other systems. + * If no value is provided, it will be auto-generated based on current date and time. + */ + processedAt: Scalars['DateTime'] + /** The address to where the order will be shipped. */ + shippingAddress?: Maybe + /** The discounts that have been allocated onto the shipping line by discount applications. */ + shippingDiscountAllocations: Array + /** The unique URL for the order's status page. */ + statusUrl: Scalars['URL'] + /** + * Price of the order before shipping and taxes. + * @deprecated Use `subtotalPriceV2` instead + */ + subtotalPrice?: Maybe + /** Price of the order before duties, shipping and taxes. */ + subtotalPriceV2?: Maybe + /** List of the order’s successful fulfillments. */ + successfulFulfillments?: Maybe> + /** + * The sum of all the prices of all the items in the order, taxes and discounts included (must be positive). + * @deprecated Use `totalPriceV2` instead + */ + totalPrice: Scalars['Money'] + /** The sum of all the prices of all the items in the order, duties, taxes and discounts included (must be positive). */ + totalPriceV2: MoneyV2 + /** + * The total amount that has been refunded. + * @deprecated Use `totalRefundedV2` instead + */ + totalRefunded: Scalars['Money'] + /** The total amount that has been refunded. */ + totalRefundedV2: MoneyV2 + /** + * The total cost of shipping. + * @deprecated Use `totalShippingPriceV2` instead + */ + totalShippingPrice: Scalars['Money'] + /** The total cost of shipping. */ + totalShippingPriceV2: MoneyV2 + /** + * The total cost of taxes. + * @deprecated Use `totalTaxV2` instead + */ + totalTax?: Maybe + /** The total cost of taxes. */ + totalTaxV2?: Maybe +} + +/** An order is a customer’s completed request to purchase one or more products from a shop. An order is created when a customer completes the checkout process, during which time they provides an email address, billing address and payment information. */ +export type OrderDiscountApplicationsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** An order is a customer’s completed request to purchase one or more products from a shop. An order is created when a customer completes the checkout process, during which time they provides an email address, billing address and payment information. */ +export type OrderLineItemsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** An order is a customer’s completed request to purchase one or more products from a shop. An order is created when a customer completes the checkout process, during which time they provides an email address, billing address and payment information. */ +export type OrderSuccessfulFulfillmentsArgs = { + first?: Maybe +} + +/** Represents the reason for the order's cancellation. */ +export enum OrderCancelReason { + /** The customer wanted to cancel the order. */ + Customer = 'CUSTOMER', + /** The order was fraudulent. */ + Fraud = 'FRAUD', + /** There was insufficient inventory. */ + Inventory = 'INVENTORY', + /** Payment was declined. */ + Declined = 'DECLINED', + /** The order was canceled for an unlisted reason. */ + Other = 'OTHER', +} + +/** An auto-generated type for paginating through multiple Orders. */ +export type OrderConnection = { + __typename?: 'OrderConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Order and a cursor during pagination. */ +export type OrderEdge = { + __typename?: 'OrderEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of OrderEdge. */ + node: Order +} + +/** Represents the order's current financial status. */ +export enum OrderFinancialStatus { + /** Displayed as **Pending**. */ + Pending = 'PENDING', + /** Displayed as **Authorized**. */ + Authorized = 'AUTHORIZED', + /** Displayed as **Partially paid**. */ + PartiallyPaid = 'PARTIALLY_PAID', + /** Displayed as **Partially refunded**. */ + PartiallyRefunded = 'PARTIALLY_REFUNDED', + /** Displayed as **Voided**. */ + Voided = 'VOIDED', + /** Displayed as **Paid**. */ + Paid = 'PAID', + /** Displayed as **Refunded**. */ + Refunded = 'REFUNDED', +} + +/** Represents the order's current fulfillment status. */ +export enum OrderFulfillmentStatus { + /** Displayed as **Unfulfilled**. */ + Unfulfilled = 'UNFULFILLED', + /** Displayed as **Partially fulfilled**. */ + PartiallyFulfilled = 'PARTIALLY_FULFILLED', + /** Displayed as **Fulfilled**. */ + Fulfilled = 'FULFILLED', + /** Displayed as **Restocked**. */ + Restocked = 'RESTOCKED', + /** Displayed as **Pending fulfillment**. */ + PendingFulfillment = 'PENDING_FULFILLMENT', + /** Displayed as **Open**. */ + Open = 'OPEN', + /** Displayed as **In progress**. */ + InProgress = 'IN_PROGRESS', + /** Displayed as **Scheduled**. */ + Scheduled = 'SCHEDULED', +} + +/** Represents a single line in an order. There is one line item for each distinct product variant. */ +export type OrderLineItem = { + __typename?: 'OrderLineItem' + /** The number of entries associated to the line item minus the items that have been removed. */ + currentQuantity: Scalars['Int'] + /** List of custom attributes associated to the line item. */ + customAttributes: Array + /** The discounts that have been allocated onto the order line item by discount applications. */ + discountAllocations: Array + /** The total price of the line item, including discounts, and displayed in the presentment currency. */ + discountedTotalPrice: MoneyV2 + /** The total price of the line item, not including any discounts. The total price is calculated using the original unit price multiplied by the quantity, and it is displayed in the presentment currency. */ + originalTotalPrice: MoneyV2 + /** The number of products variants associated to the line item. */ + quantity: Scalars['Int'] + /** The title of the product combined with title of the variant. */ + title: Scalars['String'] + /** The product variant object associated to the line item. */ + variant?: Maybe +} + +/** An auto-generated type for paginating through multiple OrderLineItems. */ +export type OrderLineItemConnection = { + __typename?: 'OrderLineItemConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one OrderLineItem and a cursor during pagination. */ +export type OrderLineItemEdge = { + __typename?: 'OrderLineItemEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of OrderLineItemEdge. */ + node: OrderLineItem +} + +/** The set of valid sort keys for the Order query. */ +export enum OrderSortKeys { + /** Sort by the `processed_at` value. */ + ProcessedAt = 'PROCESSED_AT', + /** Sort by the `total_price` value. */ + TotalPrice = 'TOTAL_PRICE', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom page on the online store. */ +export type Page = Node & { + __typename?: 'Page' + /** The description of the page, complete with HTML formatting. */ + body: Scalars['HTML'] + /** Summary of the page body. */ + bodySummary: Scalars['String'] + /** The timestamp of the page creation. */ + createdAt: Scalars['DateTime'] + /** A human-friendly unique string for the page automatically generated from its title. */ + handle: Scalars['String'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The page's SEO information. */ + seo?: Maybe + /** The title of the page. */ + title: Scalars['String'] + /** The timestamp of the latest page update. */ + updatedAt: Scalars['DateTime'] + /** The url pointing to the page accessible from the web. */ + url: Scalars['URL'] +} + +/** An auto-generated type for paginating through multiple Pages. */ +export type PageConnection = { + __typename?: 'PageConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Page and a cursor during pagination. */ +export type PageEdge = { + __typename?: 'PageEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of PageEdge. */ + node: Page +} + +/** Information about pagination in a connection. */ +export type PageInfo = { + __typename?: 'PageInfo' + /** Indicates if there are more pages to fetch. */ + hasNextPage: Scalars['Boolean'] + /** Indicates if there are any pages prior to the current page. */ + hasPreviousPage: Scalars['Boolean'] +} + +/** The set of valid sort keys for the Page query. */ +export enum PageSortKeys { + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `updated_at` value. */ + UpdatedAt = 'UPDATED_AT', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** A payment applied to a checkout. */ +export type Payment = Node & { + __typename?: 'Payment' + /** + * The amount of the payment. + * @deprecated Use `amountV2` instead + */ + amount: Scalars['Money'] + /** The amount of the payment. */ + amountV2: MoneyV2 + /** The billing address for the payment. */ + billingAddress?: Maybe + /** The checkout to which the payment belongs. */ + checkout: Checkout + /** The credit card used for the payment in the case of direct payments. */ + creditCard?: Maybe + /** A message describing a processing error during asynchronous processing. */ + errorMessage?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** A client-side generated token to identify a payment and perform idempotent operations. */ + idempotencyKey?: Maybe + /** The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow. */ + nextActionUrl?: Maybe + /** Whether or not the payment is still processing asynchronously. */ + ready: Scalars['Boolean'] + /** A flag to indicate if the payment is to be done in test mode for gateways that support it. */ + test: Scalars['Boolean'] + /** The actual transaction recorded by Shopify after having processed the payment with the gateway. */ + transaction?: Maybe +} + +/** Settings related to payments. */ +export type PaymentSettings = { + __typename?: 'PaymentSettings' + /** List of the card brands which the shop accepts. */ + acceptedCardBrands: Array + /** The url pointing to the endpoint to vault credit cards. */ + cardVaultUrl: Scalars['URL'] + /** The country where the shop is located. */ + countryCode: CountryCode + /** The three-letter code for the shop's primary currency. */ + currencyCode: CurrencyCode + /** A list of enabled currencies (ISO 4217 format) that the shop accepts. Merchants can enable currencies from their Shopify Payments settings in the Shopify admin. */ + enabledPresentmentCurrencies: Array + /** The shop’s Shopify Payments account id. */ + shopifyPaymentsAccountId?: Maybe + /** List of the digital wallets which the shop supports. */ + supportedDigitalWallets: Array +} + +/** The valid values for the types of payment token. */ +export enum PaymentTokenType { + /** Apple Pay token type. */ + ApplePay = 'APPLE_PAY', + /** Vault payment token type. */ + Vault = 'VAULT', + /** Shopify Pay token type. */ + ShopifyPay = 'SHOPIFY_PAY', + /** Google Pay token type. */ + GooglePay = 'GOOGLE_PAY', +} + +/** The value of the percentage pricing object. */ +export type PricingPercentageValue = { + __typename?: 'PricingPercentageValue' + /** The percentage value of the object. */ + percentage: Scalars['Float'] +} + +/** The price value (fixed or percentage) for a discount application. */ +export type PricingValue = MoneyV2 | PricingPercentageValue + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type Product = Node & + HasMetafields & { + __typename?: 'Product' + /** Indicates if at least one product variant is available for sale. */ + availableForSale: Scalars['Boolean'] + /** List of collections a product belongs to. */ + collections: CollectionConnection + /** The compare at price of the product across all variants. */ + compareAtPriceRange: ProductPriceRange + /** The date and time when the product was created. */ + createdAt: Scalars['DateTime'] + /** Stripped description of the product, single line with HTML tags removed. */ + description: Scalars['String'] + /** The description of the product, complete with HTML formatting. */ + descriptionHtml: Scalars['HTML'] + /** + * A human-friendly unique string for the Product automatically generated from its title. + * They are used by the Liquid templating language to refer to objects. + */ + handle: Scalars['String'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** List of images associated with the product. */ + images: ImageConnection + /** The media associated with the product. */ + media: MediaConnection + /** The metafield associated with the resource. */ + metafield?: Maybe + /** A paginated list of metafields associated with the resource. */ + metafields: MetafieldConnection + /** + * The online store URL for the product. + * A value of `null` indicates that the product is not published to the Online Store sales channel. + */ + onlineStoreUrl?: Maybe + /** List of product options. */ + options: Array + /** List of price ranges in the presentment currencies for this shop. */ + presentmentPriceRanges: ProductPriceRangeConnection + /** The price range. */ + priceRange: ProductPriceRange + /** A categorization that a product can be tagged with, commonly used for filtering and searching. */ + productType: Scalars['String'] + /** The date and time when the product was published to the channel. */ + publishedAt: Scalars['DateTime'] + /** The product's SEO information. */ + seo: Seo + /** + * A comma separated list of tags that have been added to the product. + * Additional access scope required for private apps: unauthenticated_read_product_tags. + */ + tags: Array + /** The product’s title. */ + title: Scalars['String'] + /** The total quantity of inventory in stock for this Product. */ + totalInventory?: Maybe + /** + * The date and time when the product was last modified. + * A product's `updatedAt` value can change for different reasons. For example, if an order + * is placed for a product that has inventory tracking set up, then the inventory adjustment + * is counted as an update. + */ + updatedAt: Scalars['DateTime'] + /** + * Find a product’s variant based on its selected options. + * This is useful for converting a user’s selection of product options into a single matching variant. + * If there is not a variant for the selected options, `null` will be returned. + */ + variantBySelectedOptions?: Maybe + /** List of the product’s variants. */ + variants: ProductVariantConnection + /** The product’s vendor name. */ + vendor: Scalars['String'] + } + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductCollectionsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductDescriptionArgs = { + truncateAt?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductImagesArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + maxWidth?: Maybe + maxHeight?: Maybe + crop?: Maybe + scale?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductMediaArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductMetafieldArgs = { + namespace: Scalars['String'] + key: Scalars['String'] +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductMetafieldsArgs = { + namespace?: Maybe + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductOptionsArgs = { + first?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductPresentmentPriceRangesArgs = { + presentmentCurrencies?: Maybe> + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductVariantBySelectedOptionsArgs = { + selectedOptions: Array +} + +/** + * A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). + */ +export type ProductVariantsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe +} + +/** The set of valid sort keys for the ProductCollection query. */ +export enum ProductCollectionSortKeys { + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `price` value. */ + Price = 'PRICE', + /** Sort by the `best-selling` value. */ + BestSelling = 'BEST_SELLING', + /** Sort by the `created` value. */ + Created = 'CREATED', + /** Sort by the `id` value. */ + Id = 'ID', + /** Sort by the `manual` value. */ + Manual = 'MANUAL', + /** Sort by the `collection-default` value. */ + CollectionDefault = 'COLLECTION_DEFAULT', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** An auto-generated type for paginating through multiple Products. */ +export type ProductConnection = { + __typename?: 'ProductConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one Product and a cursor during pagination. */ +export type ProductEdge = { + __typename?: 'ProductEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of ProductEdge. */ + node: Product +} + +/** The set of valid sort keys for the ProductImage query. */ +export enum ProductImageSortKeys { + /** Sort by the `created_at` value. */ + CreatedAt = 'CREATED_AT', + /** Sort by the `position` value. */ + Position = 'POSITION', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** The set of valid sort keys for the ProductMedia query. */ +export enum ProductMediaSortKeys { + /** Sort by the `position` value. */ + Position = 'POSITION', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** + * Product property names like "Size", "Color", and "Material" that the customers can select. + * Variants are selected based on permutations of these options. + * 255 characters limit each. + */ +export type ProductOption = Node & { + __typename?: 'ProductOption' + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The product option’s name. */ + name: Scalars['String'] + /** The corresponding value to the product option name. */ + values: Array +} + +/** The price range of the product. */ +export type ProductPriceRange = { + __typename?: 'ProductPriceRange' + /** The highest variant's price. */ + maxVariantPrice: MoneyV2 + /** The lowest variant's price. */ + minVariantPrice: MoneyV2 +} + +/** An auto-generated type for paginating through multiple ProductPriceRanges. */ +export type ProductPriceRangeConnection = { + __typename?: 'ProductPriceRangeConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one ProductPriceRange and a cursor during pagination. */ +export type ProductPriceRangeEdge = { + __typename?: 'ProductPriceRangeEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of ProductPriceRangeEdge. */ + node: ProductPriceRange +} + +/** The set of valid sort keys for the Product query. */ +export enum ProductSortKeys { + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `product_type` value. */ + ProductType = 'PRODUCT_TYPE', + /** Sort by the `vendor` value. */ + Vendor = 'VENDOR', + /** Sort by the `updated_at` value. */ + UpdatedAt = 'UPDATED_AT', + /** Sort by the `created_at` value. */ + CreatedAt = 'CREATED_AT', + /** Sort by the `best_selling` value. */ + BestSelling = 'BEST_SELLING', + /** Sort by the `price` value. */ + Price = 'PRICE', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** A product variant represents a different version of a product, such as differing sizes or differing colors. */ +export type ProductVariant = Node & + HasMetafields & { + __typename?: 'ProductVariant' + /** + * Indicates if the product variant is in stock. + * @deprecated Use `availableForSale` instead + */ + available?: Maybe + /** Indicates if the product variant is available for sale. */ + availableForSale: Scalars['Boolean'] + /** + * The compare at price of the variant. This can be used to mark a variant as on sale, when `compareAtPrice` is higher than `price`. + * @deprecated Use `compareAtPriceV2` instead + */ + compareAtPrice?: Maybe + /** The compare at price of the variant. This can be used to mark a variant as on sale, when `compareAtPriceV2` is higher than `priceV2`. */ + compareAtPriceV2?: Maybe + /** Whether a product is out of stock but still available for purchase (used for backorders). */ + currentlyNotInStock: Scalars['Boolean'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** Image associated with the product variant. This field falls back to the product image if no image is available. */ + image?: Maybe + /** The metafield associated with the resource. */ + metafield?: Maybe + /** A paginated list of metafields associated with the resource. */ + metafields: MetafieldConnection + /** List of prices and compare-at prices in the presentment currencies for this shop. */ + presentmentPrices: ProductVariantPricePairConnection + /** List of unit prices in the presentment currencies for this shop. */ + presentmentUnitPrices: MoneyV2Connection + /** + * The product variant’s price. + * @deprecated Use `priceV2` instead + */ + price: Scalars['Money'] + /** The product variant’s price. */ + priceV2: MoneyV2 + /** The product object that the product variant belongs to. */ + product: Product + /** The total sellable quantity of the variant for online sales channels. */ + quantityAvailable?: Maybe + /** Whether a customer needs to provide a shipping address when placing an order for the product variant. */ + requiresShipping: Scalars['Boolean'] + /** List of product options applied to the variant. */ + selectedOptions: Array + /** The SKU (stock keeping unit) associated with the variant. */ + sku?: Maybe + /** The product variant’s title. */ + title: Scalars['String'] + /** The unit price value for the variant based on the variant's measurement. */ + unitPrice?: Maybe + /** The unit price measurement for the variant. */ + unitPriceMeasurement?: Maybe + /** The weight of the product variant in the unit system specified with `weight_unit`. */ + weight?: Maybe + /** Unit of measurement for weight. */ + weightUnit: WeightUnit + } + +/** A product variant represents a different version of a product, such as differing sizes or differing colors. */ +export type ProductVariantImageArgs = { + maxWidth?: Maybe + maxHeight?: Maybe + crop?: Maybe + scale?: Maybe +} + +/** A product variant represents a different version of a product, such as differing sizes or differing colors. */ +export type ProductVariantMetafieldArgs = { + namespace: Scalars['String'] + key: Scalars['String'] +} + +/** A product variant represents a different version of a product, such as differing sizes or differing colors. */ +export type ProductVariantMetafieldsArgs = { + namespace?: Maybe + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** A product variant represents a different version of a product, such as differing sizes or differing colors. */ +export type ProductVariantPresentmentPricesArgs = { + presentmentCurrencies?: Maybe> + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** A product variant represents a different version of a product, such as differing sizes or differing colors. */ +export type ProductVariantPresentmentUnitPricesArgs = { + presentmentCurrencies?: Maybe> + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe +} + +/** An auto-generated type for paginating through multiple ProductVariants. */ +export type ProductVariantConnection = { + __typename?: 'ProductVariantConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one ProductVariant and a cursor during pagination. */ +export type ProductVariantEdge = { + __typename?: 'ProductVariantEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of ProductVariantEdge. */ + node: ProductVariant +} + +/** The compare-at price and price of a variant sharing a currency. */ +export type ProductVariantPricePair = { + __typename?: 'ProductVariantPricePair' + /** The compare-at price of the variant with associated currency. */ + compareAtPrice?: Maybe + /** The price of the variant with associated currency. */ + price: MoneyV2 +} + +/** An auto-generated type for paginating through multiple ProductVariantPricePairs. */ +export type ProductVariantPricePairConnection = { + __typename?: 'ProductVariantPricePairConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one ProductVariantPricePair and a cursor during pagination. */ +export type ProductVariantPricePairEdge = { + __typename?: 'ProductVariantPricePairEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of ProductVariantPricePairEdge. */ + node: ProductVariantPricePair +} + +/** The set of valid sort keys for the ProductVariant query. */ +export enum ProductVariantSortKeys { + /** Sort by the `title` value. */ + Title = 'TITLE', + /** Sort by the `sku` value. */ + Sku = 'SKU', + /** Sort by the `position` value. */ + Position = 'POSITION', + /** Sort by the `id` value. */ + Id = 'ID', + /** + * During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + * results by relevance to the search term(s). When no search query is specified, this sort key is not + * deterministic and should not be used. + */ + Relevance = 'RELEVANCE', +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRoot = { + __typename?: 'QueryRoot' + /** List of the shop's articles. */ + articles: ArticleConnection + /** Find a blog by its handle. */ + blogByHandle?: Maybe + /** List of the shop's blogs. */ + blogs: BlogConnection + /** Find a collection by its handle. */ + collectionByHandle?: Maybe + /** List of the shop’s collections. */ + collections: CollectionConnection + /** Find a customer by its access token. */ + customer?: Maybe + node?: Maybe + nodes: Array> + /** Find a page by its handle. */ + pageByHandle?: Maybe + /** List of the shop's pages. */ + pages: PageConnection + /** Find a product by its handle. */ + productByHandle?: Maybe + /** + * Find recommended products related to a given `product_id`. + * To learn more about how recommendations are generated, see + * [*Showing product recommendations on product pages*](https://help.shopify.com/themes/development/recommended-products). + */ + productRecommendations?: Maybe> + /** + * Tags added to products. + * Additional access scope required: unauthenticated_read_product_tags. + */ + productTags: StringConnection + /** List of product types for the shop's products that are published to your app. */ + productTypes: StringConnection + /** List of the shop’s products. */ + products: ProductConnection + /** The list of public Storefront API versions, including supported, release candidate and unstable versions. */ + publicApiVersions: Array + /** The shop associated with the storefront access token. */ + shop: Shop +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootArticlesArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootBlogByHandleArgs = { + handle: Scalars['String'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootBlogsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootCollectionByHandleArgs = { + handle: Scalars['String'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootCollectionsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootCustomerArgs = { + customerAccessToken: Scalars['String'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootNodeArgs = { + id: Scalars['ID'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootNodesArgs = { + ids: Array +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootPageByHandleArgs = { + handle: Scalars['String'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootPagesArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootProductByHandleArgs = { + handle: Scalars['String'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootProductRecommendationsArgs = { + productId: Scalars['ID'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootProductTagsArgs = { + first: Scalars['Int'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootProductTypesArgs = { + first: Scalars['Int'] +} + +/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */ +export type QueryRootProductsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** SEO information. */ +export type Seo = { + __typename?: 'SEO' + /** The meta description. */ + description?: Maybe + /** The SEO title. */ + title?: Maybe +} + +/** + * Script discount applications capture the intentions of a discount that + * was created by a Shopify Script. + */ +export type ScriptDiscountApplication = DiscountApplication & { + __typename?: 'ScriptDiscountApplication' + /** The method by which the discount's value is allocated to its entitled items. */ + allocationMethod: DiscountApplicationAllocationMethod + /** + * The description of the application as defined by the Script. + * @deprecated Use `title` instead + */ + description: Scalars['String'] + /** Which lines of targetType that the discount is allocated over. */ + targetSelection: DiscountApplicationTargetSelection + /** The type of line that the discount is applicable towards. */ + targetType: DiscountApplicationTargetType + /** The title of the application as defined by the Script. */ + title: Scalars['String'] + /** The value of the discount application. */ + value: PricingValue +} + +/** + * Properties used by customers to select a product variant. + * Products can have multiple options, like different sizes or colors. + */ +export type SelectedOption = { + __typename?: 'SelectedOption' + /** The product option’s name. */ + name: Scalars['String'] + /** The product option’s value. */ + value: Scalars['String'] +} + +/** Specifies the input fields required for a selected option. */ +export type SelectedOptionInput = { + /** The product option’s name. */ + name: Scalars['String'] + /** The product option’s value. */ + value: Scalars['String'] +} + +/** A shipping rate to be applied to a checkout. */ +export type ShippingRate = { + __typename?: 'ShippingRate' + /** Human-readable unique identifier for this shipping rate. */ + handle: Scalars['String'] + /** + * Price of this shipping rate. + * @deprecated Use `priceV2` instead + */ + price: Scalars['Money'] + /** Price of this shipping rate. */ + priceV2: MoneyV2 + /** Title of this shipping rate. */ + title: Scalars['String'] +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type Shop = { + __typename?: 'Shop' + /** + * List of the shop' articles. + * @deprecated Use `QueryRoot.articles` instead. + */ + articles: ArticleConnection + /** + * List of the shop' blogs. + * @deprecated Use `QueryRoot.blogs` instead. + */ + blogs: BlogConnection + /** + * Find a collection by its handle. + * @deprecated Use `QueryRoot.collectionByHandle` instead. + */ + collectionByHandle?: Maybe + /** + * List of the shop’s collections. + * @deprecated Use `QueryRoot.collections` instead. + */ + collections: CollectionConnection + /** + * The three-letter code for the currency that the shop accepts. + * @deprecated Use `paymentSettings` instead + */ + currencyCode: CurrencyCode + /** A description of the shop. */ + description?: Maybe + /** A string representing the way currency is formatted when the currency isn’t specified. */ + moneyFormat: Scalars['String'] + /** The shop’s name. */ + name: Scalars['String'] + /** Settings related to payments. */ + paymentSettings: PaymentSettings + /** The shop’s primary domain. */ + primaryDomain: Domain + /** The shop’s privacy policy. */ + privacyPolicy?: Maybe + /** + * Find a product by its handle. + * @deprecated Use `QueryRoot.productByHandle` instead. + */ + productByHandle?: Maybe + /** + * A list of tags that have been added to products. + * Additional access scope required: unauthenticated_read_product_tags. + * @deprecated Use `QueryRoot.productTags` instead. + */ + productTags: StringConnection + /** + * List of the shop’s product types. + * @deprecated Use `QueryRoot.productTypes` instead. + */ + productTypes: StringConnection + /** + * List of the shop’s products. + * @deprecated Use `QueryRoot.products` instead. + */ + products: ProductConnection + /** The shop’s refund policy. */ + refundPolicy?: Maybe + /** The shop’s shipping policy. */ + shippingPolicy?: Maybe + /** Countries that the shop ships to. */ + shipsToCountries: Array + /** + * The shop’s Shopify Payments account id. + * @deprecated Use `paymentSettings` instead + */ + shopifyPaymentsAccountId?: Maybe + /** The shop’s terms of service. */ + termsOfService?: Maybe +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopArticlesArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopBlogsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopCollectionByHandleArgs = { + handle: Scalars['String'] +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopCollectionsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopProductByHandleArgs = { + handle: Scalars['String'] +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopProductTagsArgs = { + first: Scalars['Int'] +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopProductTypesArgs = { + first: Scalars['Int'] +} + +/** Shop represents a collection of the general settings and information about the shop. */ +export type ShopProductsArgs = { + first?: Maybe + after?: Maybe + last?: Maybe + before?: Maybe + reverse?: Maybe + sortKey?: Maybe + query?: Maybe +} + +/** Policy that a merchant has configured for their store, such as their refund or privacy policy. */ +export type ShopPolicy = Node & { + __typename?: 'ShopPolicy' + /** Policy text, maximum size of 64kb. */ + body: Scalars['String'] + /** Policy’s handle. */ + handle: Scalars['String'] + /** Globally unique identifier. */ + id: Scalars['ID'] + /** Policy’s title. */ + title: Scalars['String'] + /** Public URL to the policy. */ + url: Scalars['URL'] +} + +/** An auto-generated type for paginating through multiple Strings. */ +export type StringConnection = { + __typename?: 'StringConnection' + /** A list of edges. */ + edges: Array + /** Information to aid in pagination. */ + pageInfo: PageInfo +} + +/** An auto-generated type which holds one String and a cursor during pagination. */ +export type StringEdge = { + __typename?: 'StringEdge' + /** A cursor for use in pagination. */ + cursor: Scalars['String'] + /** The item at the end of StringEdge. */ + node: Scalars['String'] +} + +/** + * Specifies the fields required to complete a checkout with + * a tokenized payment. + */ +export type TokenizedPaymentInput = { + /** The amount of the payment. */ + amount: Scalars['Money'] + /** A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. */ + idempotencyKey: Scalars['String'] + /** The billing address for the payment. */ + billingAddress: MailingAddressInput + /** The type of payment token. */ + type: Scalars['String'] + /** A simple string or JSON containing the required payment data for the tokenized payment. */ + paymentData: Scalars['String'] + /** Executes the payment in test mode if possible. Defaults to `false`. */ + test?: Maybe + /** Public Hash Key used for AndroidPay payments only. */ + identifier?: Maybe +} + +/** + * Specifies the fields required to complete a checkout with + * a tokenized payment. + */ +export type TokenizedPaymentInputV2 = { + /** The amount and currency of the payment. */ + paymentAmount: MoneyInput + /** A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. */ + idempotencyKey: Scalars['String'] + /** The billing address for the payment. */ + billingAddress: MailingAddressInput + /** A simple string or JSON containing the required payment data for the tokenized payment. */ + paymentData: Scalars['String'] + /** Whether to execute the payment in test mode, if possible. Test mode is not supported in production stores. Defaults to `false`. */ + test?: Maybe + /** Public Hash Key used for AndroidPay payments only. */ + identifier?: Maybe + /** The type of payment token. */ + type: Scalars['String'] +} + +/** + * Specifies the fields required to complete a checkout with + * a tokenized payment. + */ +export type TokenizedPaymentInputV3 = { + /** The amount and currency of the payment. */ + paymentAmount: MoneyInput + /** A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. */ + idempotencyKey: Scalars['String'] + /** The billing address for the payment. */ + billingAddress: MailingAddressInput + /** A simple string or JSON containing the required payment data for the tokenized payment. */ + paymentData: Scalars['String'] + /** Whether to execute the payment in test mode, if possible. Test mode is not supported in production stores. Defaults to `false`. */ + test?: Maybe + /** Public Hash Key used for AndroidPay payments only. */ + identifier?: Maybe + /** The type of payment token. */ + type: PaymentTokenType +} + +/** An object representing exchange of money for a product or service. */ +export type Transaction = { + __typename?: 'Transaction' + /** + * The amount of money that the transaction was for. + * @deprecated Use `amountV2` instead + */ + amount: Scalars['Money'] + /** The amount of money that the transaction was for. */ + amountV2: MoneyV2 + /** The kind of the transaction. */ + kind: TransactionKind + /** + * The status of the transaction. + * @deprecated Use `statusV2` instead + */ + status: TransactionStatus + /** The status of the transaction. */ + statusV2?: Maybe + /** Whether the transaction was done in test mode or not. */ + test: Scalars['Boolean'] +} + +export enum TransactionKind { + Sale = 'SALE', + Capture = 'CAPTURE', + Authorization = 'AUTHORIZATION', + EmvAuthorization = 'EMV_AUTHORIZATION', + Change = 'CHANGE', +} + +export enum TransactionStatus { + Pending = 'PENDING', + Success = 'SUCCESS', + Failure = 'FAILURE', + Error = 'ERROR', +} + +/** The measurement used to calculate a unit price for a product variant (e.g. $9.99 / 100ml). */ +export type UnitPriceMeasurement = { + __typename?: 'UnitPriceMeasurement' + /** The type of unit of measurement for the unit price measurement. */ + measuredType?: Maybe + /** The quantity unit for the unit price measurement. */ + quantityUnit?: Maybe + /** The quantity value for the unit price measurement. */ + quantityValue: Scalars['Float'] + /** The reference unit for the unit price measurement. */ + referenceUnit?: Maybe + /** The reference value for the unit price measurement. */ + referenceValue: Scalars['Int'] +} + +/** The accepted types of unit of measurement. */ +export enum UnitPriceMeasurementMeasuredType { + /** Unit of measurements representing volumes. */ + Volume = 'VOLUME', + /** Unit of measurements representing weights. */ + Weight = 'WEIGHT', + /** Unit of measurements representing lengths. */ + Length = 'LENGTH', + /** Unit of measurements representing areas. */ + Area = 'AREA', +} + +/** The valid units of measurement for a unit price measurement. */ +export enum UnitPriceMeasurementMeasuredUnit { + /** 1000 milliliters equals 1 liter. */ + Ml = 'ML', + /** 100 centiliters equals 1 liter. */ + Cl = 'CL', + /** Metric system unit of volume. */ + L = 'L', + /** 1 cubic meter equals 1000 liters. */ + M3 = 'M3', + /** 1000 milligrams equals 1 gram. */ + Mg = 'MG', + /** Metric system unit of weight. */ + G = 'G', + /** 1 kilogram equals 1000 grams. */ + Kg = 'KG', + /** 1000 millimeters equals 1 meter. */ + Mm = 'MM', + /** 100 centimeters equals 1 meter. */ + Cm = 'CM', + /** Metric system unit of length. */ + M = 'M', + /** Metric system unit of area. */ + M2 = 'M2', +} + +/** Represents an error in the input of a mutation. */ +export type UserError = DisplayableError & { + __typename?: 'UserError' + /** Path to the input field which caused the error. */ + field?: Maybe> + /** The error message. */ + message: Scalars['String'] +} + +/** Represents a Shopify hosted video. */ +export type Video = Node & + Media & { + __typename?: 'Video' + /** A word or phrase to share the nature or contents of a media. */ + alt?: Maybe + /** Globally unique identifier. */ + id: Scalars['ID'] + /** The media content type. */ + mediaContentType: MediaContentType + /** The preview image for the media. */ + previewImage?: Maybe + /** The sources for a video. */ + sources: Array + } + +/** Represents a source for a Shopify hosted video. */ +export type VideoSource = { + __typename?: 'VideoSource' + /** The format of the video source. */ + format: Scalars['String'] + /** The height of the video. */ + height: Scalars['Int'] + /** The video MIME type. */ + mimeType: Scalars['String'] + /** The URL of the video. */ + url: Scalars['String'] + /** The width of the video. */ + width: Scalars['Int'] +} + +/** Units of measurement for weight. */ +export enum WeightUnit { + /** 1 kilogram equals 1000 grams. */ + Kilograms = 'KILOGRAMS', + /** Metric system unit of mass. */ + Grams = 'GRAMS', + /** 1 pound equals 16 ounces. */ + Pounds = 'POUNDS', + /** Imperial system unit of mass. */ + Ounces = 'OUNCES', +} + +export type Unnamed_1_QueryVariables = Exact<{ + first: Scalars['Int'] +}> + +export type Unnamed_1_Query = { __typename?: 'QueryRoot' } & { + pages: { __typename?: 'PageConnection' } & { + edges: Array< + { __typename?: 'PageEdge' } & { + node: { __typename?: 'Page' } & Pick< + Page, + 'id' | 'title' | 'handle' | 'body' | 'bodySummary' | 'url' + > + } + > + } +} diff --git a/packages/swell/schema.graphql b/packages/swell/schema.graphql new file mode 100644 index 0000000..822e600 --- /dev/null +++ b/packages/swell/schema.graphql @@ -0,0 +1,9631 @@ +schema { + query: QueryRoot + mutation: Mutation +} + +""" +Marks an element of a GraphQL schema as having restricted access. +""" +directive @accessRestricted( + """ + Explains the reason around this restriction + """ + reason: String = null +) on FIELD_DEFINITION | OBJECT + +""" +A version of the API. +""" +type ApiVersion { + """ + The human-readable name of the version. + """ + displayName: String! + + """ + The unique identifier of an ApiVersion. All supported API versions have a date-based (YYYY-MM) or `unstable` handle. + """ + handle: String! + + """ + Whether the version is supported by Shopify. + """ + supported: Boolean! +} + +""" +Details about the gift card used on the checkout. +""" +type AppliedGiftCard implements Node { + """ + The amount that was taken from the gift card by applying it. + """ + amountUsed: Money! @deprecated(reason: "Use `amountUsedV2` instead") + + """ + The amount that was taken from the gift card by applying it. + """ + amountUsedV2: MoneyV2! + + """ + The amount left on the gift card. + """ + balance: Money! @deprecated(reason: "Use `balanceV2` instead") + + """ + The amount left on the gift card. + """ + balanceV2: MoneyV2! + + """ + Globally unique identifier. + """ + id: ID! + + """ + The last characters of the gift card. + """ + lastCharacters: String! + + """ + The amount that was applied to the checkout in its currency. + """ + presentmentAmountUsed: MoneyV2! +} + +""" +An article in an online store blog. +""" +type Article implements Node { + """ + The article's author. + """ + author: ArticleAuthor! @deprecated(reason: "Use `authorV2` instead") + + """ + The article's author. + """ + authorV2: ArticleAuthor + + """ + The blog that the article belongs to. + """ + blog: Blog! + + """ + List of comments posted on the article. + """ + comments( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): CommentConnection! + + """ + Stripped content of the article, single line with HTML tags removed. + """ + content( + """ + Truncates string after the given length. + """ + truncateAt: Int + ): String! + + """ + The content of the article, complete with HTML formatting. + """ + contentHtml: HTML! + + """ + Stripped excerpt of the article, single line with HTML tags removed. + """ + excerpt( + """ + Truncates string after the given length. + """ + truncateAt: Int + ): String + + """ + The excerpt of the article, complete with HTML formatting. + """ + excerptHtml: HTML + + """ + A human-friendly unique string for the Article automatically generated from its title. + """ + handle: String! + + """ + Globally unique identifier. + """ + id: ID! + + """ + The image associated with the article. + """ + image( + """ + Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead. + """ + maxWidth: Int + + """ + Image height in pixels between 1 and 2048. This argument is deprecated: Use `maxHeight` on `Image.transformedSrc` instead. + """ + maxHeight: Int + + """ + Crops the image according to the specified region. This argument is deprecated: Use `crop` on `Image.transformedSrc` instead. + """ + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead. + """ + scale: Int = 1 + ): Image + + """ + The date and time when the article was published. + """ + publishedAt: DateTime! + + """ + The article’s SEO information. + """ + seo: SEO + + """ + A categorization that a article can be tagged with. + """ + tags: [String!]! + + """ + The article’s name. + """ + title: String! + + """ + The url pointing to the article accessible from the web. + """ + url: URL! +} + +""" +The author of an article. +""" +type ArticleAuthor { + """ + The author's bio. + """ + bio: String + + """ + The author’s email. + """ + email: String! + + """ + The author's first name. + """ + firstName: String! + + """ + The author's last name. + """ + lastName: String! + + """ + The author's full name. + """ + name: String! +} + +""" +An auto-generated type for paginating through multiple Articles. +""" +type ArticleConnection { + """ + A list of edges. + """ + edges: [ArticleEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Article and a cursor during pagination. +""" +type ArticleEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of ArticleEdge. + """ + node: Article! +} + +""" +The set of valid sort keys for the Article query. +""" +enum ArticleSortKeys { + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `blog_title` value. + """ + BLOG_TITLE + + """ + Sort by the `author` value. + """ + AUTHOR + + """ + Sort by the `updated_at` value. + """ + UPDATED_AT + + """ + Sort by the `published_at` value. + """ + PUBLISHED_AT + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +Represents a generic custom attribute. +""" +type Attribute { + """ + Key or name of the attribute. + """ + key: String! + + """ + Value of the attribute. + """ + value: String +} + +""" +Specifies the input fields required for an attribute. +""" +input AttributeInput { + """ + Key or name of the attribute. + """ + key: String! + + """ + Value of the attribute. + """ + value: String! +} + +""" +Automatic discount applications capture the intentions of a discount that was automatically applied. +""" +type AutomaticDiscountApplication implements DiscountApplication { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + Which lines of targetType that the discount is allocated over. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line that the discount is applicable towards. + """ + targetType: DiscountApplicationTargetType! + + """ + The title of the application. + """ + title: String! + + """ + The value of the discount application. + """ + value: PricingValue! +} + +""" +A collection of available shipping rates for a checkout. +""" +type AvailableShippingRates { + """ + Whether or not the shipping rates are ready. + The `shippingRates` field is `null` when this value is `false`. + This field should be polled until its value becomes `true`. + """ + ready: Boolean! + + """ + The fetched shipping rates. `null` until the `ready` field is `true`. + """ + shippingRates: [ShippingRate!] +} + +""" +An online store blog. +""" +type Blog implements Node { + """ + Find an article by its handle. + """ + articleByHandle( + """ + The handle of the article. + """ + handle: String! + ): Article + + """ + List of the blog's articles. + """ + articles( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ArticleSortKeys = ID + + """ + Supported filter parameters: + - `author` + - `blog_title` + - `created_at` + - `tag` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): ArticleConnection! + + """ + The authors who have contributed to the blog. + """ + authors: [ArticleAuthor!]! + + """ + A human-friendly unique string for the Blog automatically generated from its title. + """ + handle: String! + + """ + Globally unique identifier. + """ + id: ID! + + """ + The blog's SEO information. + """ + seo: SEO + + """ + The blogs’s title. + """ + title: String! + + """ + The url pointing to the blog accessible from the web. + """ + url: URL! +} + +""" +An auto-generated type for paginating through multiple Blogs. +""" +type BlogConnection { + """ + A list of edges. + """ + edges: [BlogEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Blog and a cursor during pagination. +""" +type BlogEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of BlogEdge. + """ + node: Blog! +} + +""" +The set of valid sort keys for the Blog query. +""" +enum BlogSortKeys { + """ + Sort by the `handle` value. + """ + HANDLE + + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +Card brand, such as Visa or Mastercard, which can be used for payments. +""" +enum CardBrand { + """ + Visa + """ + VISA + + """ + Mastercard + """ + MASTERCARD + + """ + Discover + """ + DISCOVER + + """ + American Express + """ + AMERICAN_EXPRESS + + """ + Diners Club + """ + DINERS_CLUB + + """ + JCB + """ + JCB +} + +""" +A container for all the information required to checkout items and pay. +""" +type Checkout implements Node { + """ + The gift cards used on the checkout. + """ + appliedGiftCards: [AppliedGiftCard!]! + + """ + The available shipping rates for this Checkout. + Should only be used when checkout `requiresShipping` is `true` and + the shipping address is valid. + """ + availableShippingRates: AvailableShippingRates + + """ + The date and time when the checkout was completed. + """ + completedAt: DateTime + + """ + The date and time when the checkout was created. + """ + createdAt: DateTime! + + """ + The currency code for the Checkout. + """ + currencyCode: CurrencyCode! + + """ + A list of extra information that is added to the checkout. + """ + customAttributes: [Attribute!]! + + """ + The customer associated with the checkout. + """ + customer: Customer + @deprecated( + reason: "This field will always return null. If you have an authentication token for the customer, you can use the `customer` field on the query root to retrieve it." + ) + + """ + Discounts that have been applied on the checkout. + """ + discountApplications( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): DiscountApplicationConnection! + + """ + The email attached to this checkout. + """ + email: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + A list of line item objects, each one containing information about an item in the checkout. + """ + lineItems( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): CheckoutLineItemConnection! + + """ + The sum of all the prices of all the items in the checkout. Duties, taxes, shipping and discounts excluded. + """ + lineItemsSubtotalPrice: MoneyV2! + + """ + The note associated with the checkout. + """ + note: String + + """ + The resulting order from a paid checkout. + """ + order: Order + + """ + The Order Status Page for this Checkout, null when checkout is not completed. + """ + orderStatusUrl: URL + + """ + The amount left to be paid. This is equal to the cost of the line items, taxes and shipping minus discounts and gift cards. + """ + paymentDue: Money! @deprecated(reason: "Use `paymentDueV2` instead") + + """ + The amount left to be paid. This is equal to the cost of the line items, duties, taxes and shipping minus discounts and gift cards. + """ + paymentDueV2: MoneyV2! + + """ + Whether or not the Checkout is ready and can be completed. Checkouts may + have asynchronous operations that can take time to finish. If you want + to complete a checkout or ensure all the fields are populated and up to + date, polling is required until the value is true. + """ + ready: Boolean! + + """ + States whether or not the fulfillment requires shipping. + """ + requiresShipping: Boolean! + + """ + The shipping address to where the line items will be shipped. + """ + shippingAddress: MailingAddress + + """ + The discounts that have been allocated onto the shipping line by discount applications. + """ + shippingDiscountAllocations: [DiscountAllocation!]! + + """ + Once a shipping rate is selected by the customer it is transitioned to a `shipping_line` object. + """ + shippingLine: ShippingRate + + """ + Price of the checkout before shipping and taxes. + """ + subtotalPrice: Money! @deprecated(reason: "Use `subtotalPriceV2` instead") + + """ + Price of the checkout before duties, shipping and taxes. + """ + subtotalPriceV2: MoneyV2! + + """ + Specifies if the Checkout is tax exempt. + """ + taxExempt: Boolean! + + """ + Specifies if taxes are included in the line item and shipping line prices. + """ + taxesIncluded: Boolean! + + """ + The sum of all the prices of all the items in the checkout, taxes and discounts included. + """ + totalPrice: Money! @deprecated(reason: "Use `totalPriceV2` instead") + + """ + The sum of all the prices of all the items in the checkout, duties, taxes and discounts included. + """ + totalPriceV2: MoneyV2! + + """ + The sum of all the taxes applied to the line items and shipping lines in the checkout. + """ + totalTax: Money! @deprecated(reason: "Use `totalTaxV2` instead") + + """ + The sum of all the taxes applied to the line items and shipping lines in the checkout. + """ + totalTaxV2: MoneyV2! + + """ + The date and time when the checkout was last updated. + """ + updatedAt: DateTime! + + """ + The url pointing to the checkout accessible from the web. + """ + webUrl: URL! +} + +""" +Specifies the fields required to update a checkout's attributes. +""" +input CheckoutAttributesUpdateInput { + """ + The text of an optional note that a shop owner can attach to the checkout. + """ + note: String + + """ + A list of extra information that is added to the checkout. + """ + customAttributes: [AttributeInput!] + + """ + Allows setting partial addresses on a Checkout, skipping the full validation of attributes. + The required attributes are city, province, and country. + Full validation of the addresses is still done at complete time. + """ + allowPartialAddresses: Boolean +} + +""" +Return type for `checkoutAttributesUpdate` mutation. +""" +type CheckoutAttributesUpdatePayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Specifies the fields required to update a checkout's attributes. +""" +input CheckoutAttributesUpdateV2Input { + """ + The text of an optional note that a shop owner can attach to the checkout. + """ + note: String + + """ + A list of extra information that is added to the checkout. + """ + customAttributes: [AttributeInput!] + + """ + Allows setting partial addresses on a Checkout, skipping the full validation of attributes. + The required attributes are city, province, and country. + Full validation of the addresses is still done at complete time. + """ + allowPartialAddresses: Boolean +} + +""" +Return type for `checkoutAttributesUpdateV2` mutation. +""" +type CheckoutAttributesUpdateV2Payload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCompleteFree` mutation. +""" +type CheckoutCompleteFreePayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCompleteWithCreditCard` mutation. +""" +type CheckoutCompleteWithCreditCardPayload { + """ + The checkout on which the payment was applied. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + A representation of the attempted payment. + """ + payment: Payment + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCompleteWithCreditCardV2` mutation. +""" +type CheckoutCompleteWithCreditCardV2Payload { + """ + The checkout on which the payment was applied. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + A representation of the attempted payment. + """ + payment: Payment + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCompleteWithTokenizedPayment` mutation. +""" +type CheckoutCompleteWithTokenizedPaymentPayload { + """ + The checkout on which the payment was applied. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + A representation of the attempted payment. + """ + payment: Payment + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCompleteWithTokenizedPaymentV2` mutation. +""" +type CheckoutCompleteWithTokenizedPaymentV2Payload { + """ + The checkout on which the payment was applied. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + A representation of the attempted payment. + """ + payment: Payment + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. +""" +type CheckoutCompleteWithTokenizedPaymentV3Payload { + """ + The checkout on which the payment was applied. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + A representation of the attempted payment. + """ + payment: Payment + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Specifies the fields required to create a checkout. +""" +input CheckoutCreateInput { + """ + The email with which the customer wants to checkout. + """ + email: String + + """ + A list of line item objects, each one containing information about an item in the checkout. + """ + lineItems: [CheckoutLineItemInput!] + + """ + The shipping address to where the line items will be shipped. + """ + shippingAddress: MailingAddressInput + + """ + The text of an optional note that a shop owner can attach to the checkout. + """ + note: String + + """ + A list of extra information that is added to the checkout. + """ + customAttributes: [AttributeInput!] + + """ + Allows setting partial addresses on a Checkout, skipping the full validation of attributes. + The required attributes are city, province, and country. + Full validation of addresses is still done at complete time. + """ + allowPartialAddresses: Boolean + + """ + The three-letter currency code of one of the shop's enabled presentment currencies. + Including this field creates a checkout in the specified currency. By default, new + checkouts are created in the shop's primary currency. + """ + presentmentCurrencyCode: CurrencyCode +} + +""" +Return type for `checkoutCreate` mutation. +""" +type CheckoutCreatePayload { + """ + The new checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCustomerAssociate` mutation. +""" +type CheckoutCustomerAssociatePayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + The associated customer object. + """ + customer: Customer + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! +} + +""" +Return type for `checkoutCustomerAssociateV2` mutation. +""" +type CheckoutCustomerAssociateV2Payload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + The associated customer object. + """ + customer: Customer + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCustomerDisassociate` mutation. +""" +type CheckoutCustomerDisassociatePayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutCustomerDisassociateV2` mutation. +""" +type CheckoutCustomerDisassociateV2Payload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutDiscountCodeApply` mutation. +""" +type CheckoutDiscountCodeApplyPayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutDiscountCodeApplyV2` mutation. +""" +type CheckoutDiscountCodeApplyV2Payload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutDiscountCodeRemove` mutation. +""" +type CheckoutDiscountCodeRemovePayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutEmailUpdate` mutation. +""" +type CheckoutEmailUpdatePayload { + """ + The checkout object with the updated email. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutEmailUpdateV2` mutation. +""" +type CheckoutEmailUpdateV2Payload { + """ + The checkout object with the updated email. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Possible error codes that could be returned by CheckoutUserError. +""" +enum CheckoutErrorCode { + """ + Input value is blank. + """ + BLANK + + """ + Input value is invalid. + """ + INVALID + + """ + Input value is too long. + """ + TOO_LONG + + """ + Input value is not present. + """ + PRESENT + + """ + Input value should be less than maximum allowed value. + """ + LESS_THAN + + """ + Input value should be greater than or equal to minimum allowed value. + """ + GREATER_THAN_OR_EQUAL_TO + + """ + Input value should be less or equal to maximum allowed value. + """ + LESS_THAN_OR_EQUAL_TO + + """ + Checkout is already completed. + """ + ALREADY_COMPLETED + + """ + Checkout is locked. + """ + LOCKED + + """ + Input value is not supported. + """ + NOT_SUPPORTED + + """ + Input email contains an invalid domain name. + """ + BAD_DOMAIN + + """ + Input Zip is invalid for country provided. + """ + INVALID_FOR_COUNTRY + + """ + Input Zip is invalid for country and province provided. + """ + INVALID_FOR_COUNTRY_AND_PROVINCE + + """ + Invalid state in country. + """ + INVALID_STATE_IN_COUNTRY + + """ + Invalid province in country. + """ + INVALID_PROVINCE_IN_COUNTRY + + """ + Invalid region in country. + """ + INVALID_REGION_IN_COUNTRY + + """ + Shipping rate expired. + """ + SHIPPING_RATE_EXPIRED + + """ + Gift card cannot be applied to a checkout that contains a gift card. + """ + GIFT_CARD_UNUSABLE + + """ + Gift card is disabled. + """ + GIFT_CARD_DISABLED + + """ + Gift card code is invalid. + """ + GIFT_CARD_CODE_INVALID + + """ + Gift card has already been applied. + """ + GIFT_CARD_ALREADY_APPLIED + + """ + Gift card currency does not match checkout currency. + """ + GIFT_CARD_CURRENCY_MISMATCH + + """ + Gift card is expired. + """ + GIFT_CARD_EXPIRED + + """ + Gift card has no funds left. + """ + GIFT_CARD_DEPLETED + + """ + Gift card was not found. + """ + GIFT_CARD_NOT_FOUND + + """ + Cart does not meet discount requirements notice. + """ + CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE + + """ + Discount expired. + """ + DISCOUNT_EXPIRED + + """ + Discount disabled. + """ + DISCOUNT_DISABLED + + """ + Discount limit reached. + """ + DISCOUNT_LIMIT_REACHED + + """ + Discount not found. + """ + DISCOUNT_NOT_FOUND + + """ + Customer already used once per customer discount notice. + """ + CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE + + """ + Checkout is already completed. + """ + EMPTY + + """ + Not enough in stock. + """ + NOT_ENOUGH_IN_STOCK + + """ + Missing payment input. + """ + MISSING_PAYMENT_INPUT + + """ + The amount of the payment does not match the value to be paid. + """ + TOTAL_PRICE_MISMATCH + + """ + Line item was not found in checkout. + """ + LINE_ITEM_NOT_FOUND + + """ + Unable to apply discount. + """ + UNABLE_TO_APPLY + + """ + Discount already applied. + """ + DISCOUNT_ALREADY_APPLIED +} + +""" +Return type for `checkoutGiftCardApply` mutation. +""" +type CheckoutGiftCardApplyPayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutGiftCardRemove` mutation. +""" +type CheckoutGiftCardRemovePayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutGiftCardRemoveV2` mutation. +""" +type CheckoutGiftCardRemoveV2Payload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutGiftCardsAppend` mutation. +""" +type CheckoutGiftCardsAppendPayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +A single line item in the checkout, grouped by variant and attributes. +""" +type CheckoutLineItem implements Node { + """ + Extra information in the form of an array of Key-Value pairs about the line item. + """ + customAttributes: [Attribute!]! + + """ + The discounts that have been allocated onto the checkout line item by discount applications. + """ + discountAllocations: [DiscountAllocation!]! + + """ + Globally unique identifier. + """ + id: ID! + + """ + The quantity of the line item. + """ + quantity: Int! + + """ + Title of the line item. Defaults to the product's title. + """ + title: String! + + """ + Unit price of the line item. + """ + unitPrice: MoneyV2 + + """ + Product variant of the line item. + """ + variant: ProductVariant +} + +""" +An auto-generated type for paginating through multiple CheckoutLineItems. +""" +type CheckoutLineItemConnection { + """ + A list of edges. + """ + edges: [CheckoutLineItemEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one CheckoutLineItem and a cursor during pagination. +""" +type CheckoutLineItemEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of CheckoutLineItemEdge. + """ + node: CheckoutLineItem! +} + +""" +Specifies the input fields to create a line item on a checkout. +""" +input CheckoutLineItemInput { + """ + Extra information in the form of an array of Key-Value pairs about the line item. + """ + customAttributes: [AttributeInput!] + + """ + The quantity of the line item. + """ + quantity: Int! + + """ + The identifier of the product variant for the line item. + """ + variantId: ID! +} + +""" +Specifies the input fields to update a line item on the checkout. +""" +input CheckoutLineItemUpdateInput { + """ + The identifier of the line item. + """ + id: ID + + """ + The variant identifier of the line item. + """ + variantId: ID + + """ + The quantity of the line item. + """ + quantity: Int + + """ + Extra information in the form of an array of Key-Value pairs about the line item. + """ + customAttributes: [AttributeInput!] +} + +""" +Return type for `checkoutLineItemsAdd` mutation. +""" +type CheckoutLineItemsAddPayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutLineItemsRemove` mutation. +""" +type CheckoutLineItemsRemovePayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutLineItemsReplace` mutation. +""" +type CheckoutLineItemsReplacePayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [CheckoutUserError!]! +} + +""" +Return type for `checkoutLineItemsUpdate` mutation. +""" +type CheckoutLineItemsUpdatePayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutShippingAddressUpdate` mutation. +""" +type CheckoutShippingAddressUpdatePayload { + """ + The updated checkout object. + """ + checkout: Checkout! + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutShippingAddressUpdateV2` mutation. +""" +type CheckoutShippingAddressUpdateV2Payload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Return type for `checkoutShippingLineUpdate` mutation. +""" +type CheckoutShippingLineUpdatePayload { + """ + The updated checkout object. + """ + checkout: Checkout + + """ + List of errors that occurred executing the mutation. + """ + checkoutUserErrors: [CheckoutUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `checkoutUserErrors` instead") +} + +""" +Represents an error that happens during execution of a checkout mutation. +""" +type CheckoutUserError implements DisplayableError { + """ + Error code to uniquely identify the error. + """ + code: CheckoutErrorCode + + """ + Path to the input field which caused the error. + """ + field: [String!] + + """ + The error message. + """ + message: String! +} + +""" +A collection represents a grouping of products that a shop owner can create to organize them or make their shops easier to browse. +""" +type Collection implements Node { + """ + Stripped description of the collection, single line with HTML tags removed. + """ + description( + """ + Truncates string after the given length. + """ + truncateAt: Int + ): String! + + """ + The description of the collection, complete with HTML formatting. + """ + descriptionHtml: HTML! + + """ + A human-friendly unique string for the collection automatically generated from its title. + Limit of 255 characters. + """ + handle: String! + + """ + Globally unique identifier. + """ + id: ID! + + """ + Image associated with the collection. + """ + image( + """ + Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead. + """ + maxWidth: Int + + """ + Image height in pixels between 1 and 2048. This argument is deprecated: Use `maxHeight` on `Image.transformedSrc` instead. + """ + maxHeight: Int + + """ + Crops the image according to the specified region. This argument is deprecated: Use `crop` on `Image.transformedSrc` instead. + """ + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead. + """ + scale: Int = 1 + ): Image + + """ + List of products in the collection. + """ + products( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ProductCollectionSortKeys = COLLECTION_DEFAULT + ): ProductConnection! + + """ + The collection’s name. Limit of 255 characters. + """ + title: String! + + """ + The date and time when the collection was last modified. + """ + updatedAt: DateTime! +} + +""" +An auto-generated type for paginating through multiple Collections. +""" +type CollectionConnection { + """ + A list of edges. + """ + edges: [CollectionEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Collection and a cursor during pagination. +""" +type CollectionEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of CollectionEdge. + """ + node: Collection! +} + +""" +The set of valid sort keys for the Collection query. +""" +enum CollectionSortKeys { + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `updated_at` value. + """ + UPDATED_AT + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +A comment on an article. +""" +type Comment implements Node { + """ + The comment’s author. + """ + author: CommentAuthor! + + """ + Stripped content of the comment, single line with HTML tags removed. + """ + content( + """ + Truncates string after the given length. + """ + truncateAt: Int + ): String! + + """ + The content of the comment, complete with HTML formatting. + """ + contentHtml: HTML! + + """ + Globally unique identifier. + """ + id: ID! +} + +""" +The author of a comment. +""" +type CommentAuthor { + """ + The author's email. + """ + email: String! + + """ + The author’s name. + """ + name: String! +} + +""" +An auto-generated type for paginating through multiple Comments. +""" +type CommentConnection { + """ + A list of edges. + """ + edges: [CommentEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Comment and a cursor during pagination. +""" +type CommentEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of CommentEdge. + """ + node: Comment! +} + +""" +ISO 3166-1 alpha-2 country codes with some differences. +""" +enum CountryCode { + """ + Afghanistan. + """ + AF + + """ + Åland Islands. + """ + AX + + """ + Albania. + """ + AL + + """ + Algeria. + """ + DZ + + """ + Andorra. + """ + AD + + """ + Angola. + """ + AO + + """ + Anguilla. + """ + AI + + """ + Antigua & Barbuda. + """ + AG + + """ + Argentina. + """ + AR + + """ + Armenia. + """ + AM + + """ + Aruba. + """ + AW + + """ + Australia. + """ + AU + + """ + Austria. + """ + AT + + """ + Azerbaijan. + """ + AZ + + """ + Bahamas. + """ + BS + + """ + Bahrain. + """ + BH + + """ + Bangladesh. + """ + BD + + """ + Barbados. + """ + BB + + """ + Belarus. + """ + BY + + """ + Belgium. + """ + BE + + """ + Belize. + """ + BZ + + """ + Benin. + """ + BJ + + """ + Bermuda. + """ + BM + + """ + Bhutan. + """ + BT + + """ + Bolivia. + """ + BO + + """ + Bosnia & Herzegovina. + """ + BA + + """ + Botswana. + """ + BW + + """ + Bouvet Island. + """ + BV + + """ + Brazil. + """ + BR + + """ + British Indian Ocean Territory. + """ + IO + + """ + Brunei. + """ + BN + + """ + Bulgaria. + """ + BG + + """ + Burkina Faso. + """ + BF + + """ + Burundi. + """ + BI + + """ + Cambodia. + """ + KH + + """ + Canada. + """ + CA + + """ + Cape Verde. + """ + CV + + """ + Caribbean Netherlands. + """ + BQ + + """ + Cayman Islands. + """ + KY + + """ + Central African Republic. + """ + CF + + """ + Chad. + """ + TD + + """ + Chile. + """ + CL + + """ + China. + """ + CN + + """ + Christmas Island. + """ + CX + + """ + Cocos (Keeling) Islands. + """ + CC + + """ + Colombia. + """ + CO + + """ + Comoros. + """ + KM + + """ + Congo - Brazzaville. + """ + CG + + """ + Congo - Kinshasa. + """ + CD + + """ + Cook Islands. + """ + CK + + """ + Costa Rica. + """ + CR + + """ + Croatia. + """ + HR + + """ + Cuba. + """ + CU + + """ + Curaçao. + """ + CW + + """ + Cyprus. + """ + CY + + """ + Czechia. + """ + CZ + + """ + Côte d’Ivoire. + """ + CI + + """ + Denmark. + """ + DK + + """ + Djibouti. + """ + DJ + + """ + Dominica. + """ + DM + + """ + Dominican Republic. + """ + DO + + """ + Ecuador. + """ + EC + + """ + Egypt. + """ + EG + + """ + El Salvador. + """ + SV + + """ + Equatorial Guinea. + """ + GQ + + """ + Eritrea. + """ + ER + + """ + Estonia. + """ + EE + + """ + Eswatini. + """ + SZ + + """ + Ethiopia. + """ + ET + + """ + Falkland Islands. + """ + FK + + """ + Faroe Islands. + """ + FO + + """ + Fiji. + """ + FJ + + """ + Finland. + """ + FI + + """ + France. + """ + FR + + """ + French Guiana. + """ + GF + + """ + French Polynesia. + """ + PF + + """ + French Southern Territories. + """ + TF + + """ + Gabon. + """ + GA + + """ + Gambia. + """ + GM + + """ + Georgia. + """ + GE + + """ + Germany. + """ + DE + + """ + Ghana. + """ + GH + + """ + Gibraltar. + """ + GI + + """ + Greece. + """ + GR + + """ + Greenland. + """ + GL + + """ + Grenada. + """ + GD + + """ + Guadeloupe. + """ + GP + + """ + Guatemala. + """ + GT + + """ + Guernsey. + """ + GG + + """ + Guinea. + """ + GN + + """ + Guinea-Bissau. + """ + GW + + """ + Guyana. + """ + GY + + """ + Haiti. + """ + HT + + """ + Heard & McDonald Islands. + """ + HM + + """ + Vatican City. + """ + VA + + """ + Honduras. + """ + HN + + """ + Hong Kong SAR. + """ + HK + + """ + Hungary. + """ + HU + + """ + Iceland. + """ + IS + + """ + India. + """ + IN + + """ + Indonesia. + """ + ID + + """ + Iran. + """ + IR + + """ + Iraq. + """ + IQ + + """ + Ireland. + """ + IE + + """ + Isle of Man. + """ + IM + + """ + Israel. + """ + IL + + """ + Italy. + """ + IT + + """ + Jamaica. + """ + JM + + """ + Japan. + """ + JP + + """ + Jersey. + """ + JE + + """ + Jordan. + """ + JO + + """ + Kazakhstan. + """ + KZ + + """ + Kenya. + """ + KE + + """ + Kiribati. + """ + KI + + """ + North Korea. + """ + KP + + """ + Kosovo. + """ + XK + + """ + Kuwait. + """ + KW + + """ + Kyrgyzstan. + """ + KG + + """ + Laos. + """ + LA + + """ + Latvia. + """ + LV + + """ + Lebanon. + """ + LB + + """ + Lesotho. + """ + LS + + """ + Liberia. + """ + LR + + """ + Libya. + """ + LY + + """ + Liechtenstein. + """ + LI + + """ + Lithuania. + """ + LT + + """ + Luxembourg. + """ + LU + + """ + Macao SAR. + """ + MO + + """ + Madagascar. + """ + MG + + """ + Malawi. + """ + MW + + """ + Malaysia. + """ + MY + + """ + Maldives. + """ + MV + + """ + Mali. + """ + ML + + """ + Malta. + """ + MT + + """ + Martinique. + """ + MQ + + """ + Mauritania. + """ + MR + + """ + Mauritius. + """ + MU + + """ + Mayotte. + """ + YT + + """ + Mexico. + """ + MX + + """ + Moldova. + """ + MD + + """ + Monaco. + """ + MC + + """ + Mongolia. + """ + MN + + """ + Montenegro. + """ + ME + + """ + Montserrat. + """ + MS + + """ + Morocco. + """ + MA + + """ + Mozambique. + """ + MZ + + """ + Myanmar (Burma). + """ + MM + + """ + Namibia. + """ + NA + + """ + Nauru. + """ + NR + + """ + Nepal. + """ + NP + + """ + Netherlands. + """ + NL + + """ + Netherlands Antilles. + """ + AN + + """ + New Caledonia. + """ + NC + + """ + New Zealand. + """ + NZ + + """ + Nicaragua. + """ + NI + + """ + Niger. + """ + NE + + """ + Nigeria. + """ + NG + + """ + Niue. + """ + NU + + """ + Norfolk Island. + """ + NF + + """ + North Macedonia. + """ + MK + + """ + Norway. + """ + NO + + """ + Oman. + """ + OM + + """ + Pakistan. + """ + PK + + """ + Palestinian Territories. + """ + PS + + """ + Panama. + """ + PA + + """ + Papua New Guinea. + """ + PG + + """ + Paraguay. + """ + PY + + """ + Peru. + """ + PE + + """ + Philippines. + """ + PH + + """ + Pitcairn Islands. + """ + PN + + """ + Poland. + """ + PL + + """ + Portugal. + """ + PT + + """ + Qatar. + """ + QA + + """ + Cameroon. + """ + CM + + """ + Réunion. + """ + RE + + """ + Romania. + """ + RO + + """ + Russia. + """ + RU + + """ + Rwanda. + """ + RW + + """ + St. Barthélemy. + """ + BL + + """ + St. Helena. + """ + SH + + """ + St. Kitts & Nevis. + """ + KN + + """ + St. Lucia. + """ + LC + + """ + St. Martin. + """ + MF + + """ + St. Pierre & Miquelon. + """ + PM + + """ + Samoa. + """ + WS + + """ + San Marino. + """ + SM + + """ + São Tomé & Príncipe. + """ + ST + + """ + Saudi Arabia. + """ + SA + + """ + Senegal. + """ + SN + + """ + Serbia. + """ + RS + + """ + Seychelles. + """ + SC + + """ + Sierra Leone. + """ + SL + + """ + Singapore. + """ + SG + + """ + Sint Maarten. + """ + SX + + """ + Slovakia. + """ + SK + + """ + Slovenia. + """ + SI + + """ + Solomon Islands. + """ + SB + + """ + Somalia. + """ + SO + + """ + South Africa. + """ + ZA + + """ + South Georgia & South Sandwich Islands. + """ + GS + + """ + South Korea. + """ + KR + + """ + South Sudan. + """ + SS + + """ + Spain. + """ + ES + + """ + Sri Lanka. + """ + LK + + """ + St. Vincent & Grenadines. + """ + VC + + """ + Sudan. + """ + SD + + """ + Suriname. + """ + SR + + """ + Svalbard & Jan Mayen. + """ + SJ + + """ + Sweden. + """ + SE + + """ + Switzerland. + """ + CH + + """ + Syria. + """ + SY + + """ + Taiwan. + """ + TW + + """ + Tajikistan. + """ + TJ + + """ + Tanzania. + """ + TZ + + """ + Thailand. + """ + TH + + """ + Timor-Leste. + """ + TL + + """ + Togo. + """ + TG + + """ + Tokelau. + """ + TK + + """ + Tonga. + """ + TO + + """ + Trinidad & Tobago. + """ + TT + + """ + Tunisia. + """ + TN + + """ + Turkey. + """ + TR + + """ + Turkmenistan. + """ + TM + + """ + Turks & Caicos Islands. + """ + TC + + """ + Tuvalu. + """ + TV + + """ + Uganda. + """ + UG + + """ + Ukraine. + """ + UA + + """ + United Arab Emirates. + """ + AE + + """ + United Kingdom. + """ + GB + + """ + United States. + """ + US + + """ + U.S. Outlying Islands. + """ + UM + + """ + Uruguay. + """ + UY + + """ + Uzbekistan. + """ + UZ + + """ + Vanuatu. + """ + VU + + """ + Venezuela. + """ + VE + + """ + Vietnam. + """ + VN + + """ + British Virgin Islands. + """ + VG + + """ + Wallis & Futuna. + """ + WF + + """ + Western Sahara. + """ + EH + + """ + Yemen. + """ + YE + + """ + Zambia. + """ + ZM + + """ + Zimbabwe. + """ + ZW +} + +""" +Credit card information used for a payment. +""" +type CreditCard { + """ + The brand of the credit card. + """ + brand: String + + """ + The expiry month of the credit card. + """ + expiryMonth: Int + + """ + The expiry year of the credit card. + """ + expiryYear: Int + + """ + The credit card's BIN number. + """ + firstDigits: String + + """ + The first name of the card holder. + """ + firstName: String + + """ + The last 4 digits of the credit card. + """ + lastDigits: String + + """ + The last name of the card holder. + """ + lastName: String + + """ + The masked credit card number with only the last 4 digits displayed. + """ + maskedNumber: String +} + +""" +Specifies the fields required to complete a checkout with +a Shopify vaulted credit card payment. +""" +input CreditCardPaymentInput { + """ + The amount of the payment. + """ + amount: Money! + + """ + A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. + """ + idempotencyKey: String! + + """ + The billing address for the payment. + """ + billingAddress: MailingAddressInput! + + """ + The ID returned by Shopify's Card Vault. + """ + vaultId: String! + + """ + Executes the payment in test mode if possible. Defaults to `false`. + """ + test: Boolean +} + +""" +Specifies the fields required to complete a checkout with +a Shopify vaulted credit card payment. +""" +input CreditCardPaymentInputV2 { + """ + The amount and currency of the payment. + """ + paymentAmount: MoneyInput! + + """ + A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. + """ + idempotencyKey: String! + + """ + The billing address for the payment. + """ + billingAddress: MailingAddressInput! + + """ + The ID returned by Shopify's Card Vault. + """ + vaultId: String! + + """ + Executes the payment in test mode if possible. Defaults to `false`. + """ + test: Boolean +} + +""" +The part of the image that should remain after cropping. +""" +enum CropRegion { + """ + Keep the center of the image. + """ + CENTER + + """ + Keep the top of the image. + """ + TOP + + """ + Keep the bottom of the image. + """ + BOTTOM + + """ + Keep the left of the image. + """ + LEFT + + """ + Keep the right of the image. + """ + RIGHT +} + +""" +Currency codes. +""" +enum CurrencyCode { + """ + United States Dollars (USD). + """ + USD + + """ + Euro (EUR). + """ + EUR + + """ + United Kingdom Pounds (GBP). + """ + GBP + + """ + Canadian Dollars (CAD). + """ + CAD + + """ + Afghan Afghani (AFN). + """ + AFN + + """ + Albanian Lek (ALL). + """ + ALL + + """ + Algerian Dinar (DZD). + """ + DZD + + """ + Angolan Kwanza (AOA). + """ + AOA + + """ + Argentine Pesos (ARS). + """ + ARS + + """ + Armenian Dram (AMD). + """ + AMD + + """ + Aruban Florin (AWG). + """ + AWG + + """ + Australian Dollars (AUD). + """ + AUD + + """ + Barbadian Dollar (BBD). + """ + BBD + + """ + Azerbaijani Manat (AZN). + """ + AZN + + """ + Bangladesh Taka (BDT). + """ + BDT + + """ + Bahamian Dollar (BSD). + """ + BSD + + """ + Bahraini Dinar (BHD). + """ + BHD + + """ + Burundian Franc (BIF). + """ + BIF + + """ + Belarusian Ruble (BYN). + """ + BYN + + """ + Belarusian Ruble (BYR). + """ + BYR + + """ + Belize Dollar (BZD). + """ + BZD + + """ + Bermudian Dollar (BMD). + """ + BMD + + """ + Bhutanese Ngultrum (BTN). + """ + BTN + + """ + Bosnia and Herzegovina Convertible Mark (BAM). + """ + BAM + + """ + Brazilian Real (BRL). + """ + BRL + + """ + Bolivian Boliviano (BOB). + """ + BOB + + """ + Botswana Pula (BWP). + """ + BWP + + """ + Brunei Dollar (BND). + """ + BND + + """ + Bulgarian Lev (BGN). + """ + BGN + + """ + Burmese Kyat (MMK). + """ + MMK + + """ + Cambodian Riel. + """ + KHR + + """ + Cape Verdean escudo (CVE). + """ + CVE + + """ + Cayman Dollars (KYD). + """ + KYD + + """ + Central African CFA Franc (XAF). + """ + XAF + + """ + Chilean Peso (CLP). + """ + CLP + + """ + Chinese Yuan Renminbi (CNY). + """ + CNY + + """ + Colombian Peso (COP). + """ + COP + + """ + Comorian Franc (KMF). + """ + KMF + + """ + Congolese franc (CDF). + """ + CDF + + """ + Costa Rican Colones (CRC). + """ + CRC + + """ + Croatian Kuna (HRK). + """ + HRK + + """ + Czech Koruny (CZK). + """ + CZK + + """ + Danish Kroner (DKK). + """ + DKK + + """ + Djiboutian Franc (DJF). + """ + DJF + + """ + Dominican Peso (DOP). + """ + DOP + + """ + East Caribbean Dollar (XCD). + """ + XCD + + """ + Egyptian Pound (EGP). + """ + EGP + + """ + Eritrean Nakfa (ERN). + """ + ERN + + """ + Ethiopian Birr (ETB). + """ + ETB + + """ + Falkland Islands Pounds (FKP). + """ + FKP + + """ + CFP Franc (XPF). + """ + XPF + + """ + Fijian Dollars (FJD). + """ + FJD + + """ + Gibraltar Pounds (GIP). + """ + GIP + + """ + Gambian Dalasi (GMD). + """ + GMD + + """ + Ghanaian Cedi (GHS). + """ + GHS + + """ + Guatemalan Quetzal (GTQ). + """ + GTQ + + """ + Guyanese Dollar (GYD). + """ + GYD + + """ + Georgian Lari (GEL). + """ + GEL + + """ + Guinean Franc (GNF). + """ + GNF + + """ + Haitian Gourde (HTG). + """ + HTG + + """ + Honduran Lempira (HNL). + """ + HNL + + """ + Hong Kong Dollars (HKD). + """ + HKD + + """ + Hungarian Forint (HUF). + """ + HUF + + """ + Icelandic Kronur (ISK). + """ + ISK + + """ + Indian Rupees (INR). + """ + INR + + """ + Indonesian Rupiah (IDR). + """ + IDR + + """ + Israeli New Shekel (NIS). + """ + ILS + + """ + Iranian Rial (IRR). + """ + IRR + + """ + Iraqi Dinar (IQD). + """ + IQD + + """ + Jamaican Dollars (JMD). + """ + JMD + + """ + Japanese Yen (JPY). + """ + JPY + + """ + Jersey Pound. + """ + JEP + + """ + Jordanian Dinar (JOD). + """ + JOD + + """ + Kazakhstani Tenge (KZT). + """ + KZT + + """ + Kenyan Shilling (KES). + """ + KES + + """ + Kiribati Dollar (KID). + """ + KID + + """ + Kuwaiti Dinar (KWD). + """ + KWD + + """ + Kyrgyzstani Som (KGS). + """ + KGS + + """ + Laotian Kip (LAK). + """ + LAK + + """ + Latvian Lati (LVL). + """ + LVL + + """ + Lebanese Pounds (LBP). + """ + LBP + + """ + Lesotho Loti (LSL). + """ + LSL + + """ + Liberian Dollar (LRD). + """ + LRD + + """ + Libyan Dinar (LYD). + """ + LYD + + """ + Lithuanian Litai (LTL). + """ + LTL + + """ + Malagasy Ariary (MGA). + """ + MGA + + """ + Macedonia Denar (MKD). + """ + MKD + + """ + Macanese Pataca (MOP). + """ + MOP + + """ + Malawian Kwacha (MWK). + """ + MWK + + """ + Maldivian Rufiyaa (MVR). + """ + MVR + + """ + Mauritanian Ouguiya (MRU). + """ + MRU + + """ + Mexican Pesos (MXN). + """ + MXN + + """ + Malaysian Ringgits (MYR). + """ + MYR + + """ + Mauritian Rupee (MUR). + """ + MUR + + """ + Moldovan Leu (MDL). + """ + MDL + + """ + Moroccan Dirham. + """ + MAD + + """ + Mongolian Tugrik. + """ + MNT + + """ + Mozambican Metical. + """ + MZN + + """ + Namibian Dollar. + """ + NAD + + """ + Nepalese Rupee (NPR). + """ + NPR + + """ + Netherlands Antillean Guilder. + """ + ANG + + """ + New Zealand Dollars (NZD). + """ + NZD + + """ + Nicaraguan Córdoba (NIO). + """ + NIO + + """ + Nigerian Naira (NGN). + """ + NGN + + """ + Norwegian Kroner (NOK). + """ + NOK + + """ + Omani Rial (OMR). + """ + OMR + + """ + Panamian Balboa (PAB). + """ + PAB + + """ + Pakistani Rupee (PKR). + """ + PKR + + """ + Papua New Guinean Kina (PGK). + """ + PGK + + """ + Paraguayan Guarani (PYG). + """ + PYG + + """ + Peruvian Nuevo Sol (PEN). + """ + PEN + + """ + Philippine Peso (PHP). + """ + PHP + + """ + Polish Zlotych (PLN). + """ + PLN + + """ + Qatari Rial (QAR). + """ + QAR + + """ + Romanian Lei (RON). + """ + RON + + """ + Russian Rubles (RUB). + """ + RUB + + """ + Rwandan Franc (RWF). + """ + RWF + + """ + Samoan Tala (WST). + """ + WST + + """ + Saint Helena Pounds (SHP). + """ + SHP + + """ + Saudi Riyal (SAR). + """ + SAR + + """ + Sao Tome And Principe Dobra (STD). + """ + STD + + """ + Serbian dinar (RSD). + """ + RSD + + """ + Seychellois Rupee (SCR). + """ + SCR + + """ + Sierra Leonean Leone (SLL). + """ + SLL + + """ + Singapore Dollars (SGD). + """ + SGD + + """ + Sudanese Pound (SDG). + """ + SDG + + """ + Somali Shilling (SOS). + """ + SOS + + """ + Syrian Pound (SYP). + """ + SYP + + """ + South African Rand (ZAR). + """ + ZAR + + """ + South Korean Won (KRW). + """ + KRW + + """ + South Sudanese Pound (SSP). + """ + SSP + + """ + Solomon Islands Dollar (SBD). + """ + SBD + + """ + Sri Lankan Rupees (LKR). + """ + LKR + + """ + Surinamese Dollar (SRD). + """ + SRD + + """ + Swazi Lilangeni (SZL). + """ + SZL + + """ + Swedish Kronor (SEK). + """ + SEK + + """ + Swiss Francs (CHF). + """ + CHF + + """ + Taiwan Dollars (TWD). + """ + TWD + + """ + Thai baht (THB). + """ + THB + + """ + Tajikistani Somoni (TJS). + """ + TJS + + """ + Tanzanian Shilling (TZS). + """ + TZS + + """ + Tongan Pa'anga (TOP). + """ + TOP + + """ + Trinidad and Tobago Dollars (TTD). + """ + TTD + + """ + Tunisian Dinar (TND). + """ + TND + + """ + Turkish Lira (TRY). + """ + TRY + + """ + Turkmenistani Manat (TMT). + """ + TMT + + """ + Ugandan Shilling (UGX). + """ + UGX + + """ + Ukrainian Hryvnia (UAH). + """ + UAH + + """ + United Arab Emirates Dirham (AED). + """ + AED + + """ + Uruguayan Pesos (UYU). + """ + UYU + + """ + Uzbekistan som (UZS). + """ + UZS + + """ + Vanuatu Vatu (VUV). + """ + VUV + + """ + Venezuelan Bolivares (VEF). + """ + VEF + + """ + Venezuelan Bolivares (VES). + """ + VES + + """ + Vietnamese đồng (VND). + """ + VND + + """ + West African CFA franc (XOF). + """ + XOF + + """ + Yemeni Rial (YER). + """ + YER + + """ + Zambian Kwacha (ZMW). + """ + ZMW +} + +""" +A customer represents a customer account with the shop. Customer accounts store contact information for the customer, saving logged-in customers the trouble of having to provide it at every checkout. +""" +type Customer { + """ + Indicates whether the customer has consented to be sent marketing material via email. + """ + acceptsMarketing: Boolean! + + """ + A list of addresses for the customer. + """ + addresses( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): MailingAddressConnection! + + """ + The date and time when the customer was created. + """ + createdAt: DateTime! + + """ + The customer’s default address. + """ + defaultAddress: MailingAddress + + """ + The customer’s name, email or phone number. + """ + displayName: String! + + """ + The customer’s email address. + """ + email: String + + """ + The customer’s first name. + """ + firstName: String + + """ + A unique identifier for the customer. + """ + id: ID! + + """ + The customer's most recently updated, incomplete checkout. + """ + lastIncompleteCheckout: Checkout + + """ + The customer’s last name. + """ + lastName: String + + """ + The orders associated with the customer. + """ + orders( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: OrderSortKeys = ID + + """ + Supported filter parameters: + - `processed_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): OrderConnection! + + """ + The customer’s phone number. + """ + phone: String + + """ + A comma separated list of tags that have been added to the customer. + Additional access scope required: unauthenticated_read_customer_tags. + """ + tags: [String!]! + + """ + The date and time when the customer information was updated. + """ + updatedAt: DateTime! +} + +""" +A CustomerAccessToken represents the unique token required to make modifications to the customer object. +""" +type CustomerAccessToken { + """ + The customer’s access token. + """ + accessToken: String! + + """ + The date and time when the customer access token expires. + """ + expiresAt: DateTime! +} + +""" +Specifies the input fields required to create a customer access token. +""" +input CustomerAccessTokenCreateInput { + """ + The email associated to the customer. + """ + email: String! + + """ + The login password to be used by the customer. + """ + password: String! +} + +""" +Return type for `customerAccessTokenCreate` mutation. +""" +type CustomerAccessTokenCreatePayload { + """ + The newly created customer access token object. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Return type for `customerAccessTokenCreateWithMultipass` mutation. +""" +type CustomerAccessTokenCreateWithMultipassPayload { + """ + An access token object associated with the customer. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! +} + +""" +Return type for `customerAccessTokenDelete` mutation. +""" +type CustomerAccessTokenDeletePayload { + """ + The destroyed access token. + """ + deletedAccessToken: String + + """ + ID of the destroyed customer access token. + """ + deletedCustomerAccessTokenId: String + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! +} + +""" +Return type for `customerAccessTokenRenew` mutation. +""" +type CustomerAccessTokenRenewPayload { + """ + The renewed customer access token object. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! +} + +""" +Return type for `customerActivateByUrl` mutation. +""" +type CustomerActivateByUrlPayload { + """ + The customer that was activated. + """ + customer: Customer + + """ + A new customer access token for the customer. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! +} + +""" +Specifies the input fields required to activate a customer. +""" +input CustomerActivateInput { + """ + The activation token required to activate the customer. + """ + activationToken: String! + + """ + New password that will be set during activation. + """ + password: String! +} + +""" +Return type for `customerActivate` mutation. +""" +type CustomerActivatePayload { + """ + The customer object. + """ + customer: Customer + + """ + A newly created customer access token object for the customer. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Return type for `customerAddressCreate` mutation. +""" +type CustomerAddressCreatePayload { + """ + The new customer address object. + """ + customerAddress: MailingAddress + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Return type for `customerAddressDelete` mutation. +""" +type CustomerAddressDeletePayload { + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + ID of the deleted customer address. + """ + deletedCustomerAddressId: String + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Return type for `customerAddressUpdate` mutation. +""" +type CustomerAddressUpdatePayload { + """ + The customer’s updated mailing address. + """ + customerAddress: MailingAddress + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Specifies the fields required to create a new customer. +""" +input CustomerCreateInput { + """ + The customer’s first name. + """ + firstName: String + + """ + The customer’s last name. + """ + lastName: String + + """ + The customer’s email. + """ + email: String! + + """ + A unique phone number for the customer. + + Formatted using E.164 standard. For example, _+16135551111_. + """ + phone: String + + """ + The login password used by the customer. + """ + password: String! + + """ + Indicates whether the customer has consented to be sent marketing material via email. + """ + acceptsMarketing: Boolean +} + +""" +Return type for `customerCreate` mutation. +""" +type CustomerCreatePayload { + """ + The created customer object. + """ + customer: Customer + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Return type for `customerDefaultAddressUpdate` mutation. +""" +type CustomerDefaultAddressUpdatePayload { + """ + The updated customer object. + """ + customer: Customer + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Possible error codes that could be returned by CustomerUserError. +""" +enum CustomerErrorCode { + """ + Input value is blank. + """ + BLANK + + """ + Input value is invalid. + """ + INVALID + + """ + Input value is already taken. + """ + TAKEN + + """ + Input value is too long. + """ + TOO_LONG + + """ + Input value is too short. + """ + TOO_SHORT + + """ + Unidentified customer. + """ + UNIDENTIFIED_CUSTOMER + + """ + Customer is disabled. + """ + CUSTOMER_DISABLED + + """ + Input password starts or ends with whitespace. + """ + PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE + + """ + Input contains HTML tags. + """ + CONTAINS_HTML_TAGS + + """ + Input contains URL. + """ + CONTAINS_URL + + """ + Invalid activation token. + """ + TOKEN_INVALID + + """ + Customer already enabled. + """ + ALREADY_ENABLED + + """ + Address does not exist. + """ + NOT_FOUND + + """ + Input email contains an invalid domain name. + """ + BAD_DOMAIN + + """ + Multipass token is not valid. + """ + INVALID_MULTIPASS_REQUEST +} + +""" +Return type for `customerRecover` mutation. +""" +type CustomerRecoverPayload { + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Return type for `customerResetByUrl` mutation. +""" +type CustomerResetByUrlPayload { + """ + The customer object which was reset. + """ + customer: Customer + + """ + A newly created customer access token object for the customer. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Specifies the fields required to reset a customer’s password. +""" +input CustomerResetInput { + """ + The reset token required to reset the customer’s password. + """ + resetToken: String! + + """ + New password that will be set as part of the reset password process. + """ + password: String! +} + +""" +Return type for `customerReset` mutation. +""" +type CustomerResetPayload { + """ + The customer object which was reset. + """ + customer: Customer + + """ + A newly created customer access token object for the customer. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Specifies the fields required to update the Customer information. +""" +input CustomerUpdateInput { + """ + The customer’s first name. + """ + firstName: String + + """ + The customer’s last name. + """ + lastName: String + + """ + The customer’s email. + """ + email: String + + """ + A unique phone number for the customer. + + Formatted using E.164 standard. For example, _+16135551111_. To remove the phone number, specify `null`. + """ + phone: String + + """ + The login password used by the customer. + """ + password: String + + """ + Indicates whether the customer has consented to be sent marketing material via email. + """ + acceptsMarketing: Boolean +} + +""" +Return type for `customerUpdate` mutation. +""" +type CustomerUpdatePayload { + """ + The updated customer object. + """ + customer: Customer + + """ + The newly created customer access token. If the customer's password is updated, all previous access tokens + (including the one used to perform this mutation) become invalid, and a new token is generated. + """ + customerAccessToken: CustomerAccessToken + + """ + List of errors that occurred executing the mutation. + """ + customerUserErrors: [CustomerUserError!]! + + """ + List of errors that occurred executing the mutation. + """ + userErrors: [UserError!]! + @deprecated(reason: "Use `customerUserErrors` instead") +} + +""" +Represents an error that happens during execution of a customer mutation. +""" +type CustomerUserError implements DisplayableError { + """ + Error code to uniquely identify the error. + """ + code: CustomerErrorCode + + """ + Path to the input field which caused the error. + """ + field: [String!] + + """ + The error message. + """ + message: String! +} + +""" +An ISO-8601 encoded UTC date time string. Example value: `"2019-07-03T20:47:55Z"`. +""" +scalar DateTime + +""" +A signed decimal number, which supports arbitrary precision and is serialized as a string. Example value: `"29.99"`. +""" +scalar Decimal + +""" +Digital wallet, such as Apple Pay, which can be used for accelerated checkouts. +""" +enum DigitalWallet { + """ + Apple Pay. + """ + APPLE_PAY + + """ + Android Pay. + """ + ANDROID_PAY + + """ + Google Pay. + """ + GOOGLE_PAY + + """ + Shopify Pay. + """ + SHOPIFY_PAY +} + +""" +An amount discounting the line that has been allocated by a discount. +""" +type DiscountAllocation { + """ + Amount of discount allocated. + """ + allocatedAmount: MoneyV2! + + """ + The discount this allocated amount originated from. + """ + discountApplication: DiscountApplication! +} + +""" +Discount applications capture the intentions of a discount source at +the time of application. +""" +interface DiscountApplication { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + Which lines of targetType that the discount is allocated over. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line that the discount is applicable towards. + """ + targetType: DiscountApplicationTargetType! + + """ + The value of the discount application. + """ + value: PricingValue! +} + +""" +The method by which the discount's value is allocated onto its entitled lines. +""" +enum DiscountApplicationAllocationMethod { + """ + The value is spread across all entitled lines. + """ + ACROSS + + """ + The value is applied onto every entitled line. + """ + EACH + + """ + The value is specifically applied onto a particular line. + """ + ONE +} + +""" +An auto-generated type for paginating through multiple DiscountApplications. +""" +type DiscountApplicationConnection { + """ + A list of edges. + """ + edges: [DiscountApplicationEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one DiscountApplication and a cursor during pagination. +""" +type DiscountApplicationEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of DiscountApplicationEdge. + """ + node: DiscountApplication! +} + +""" +Which lines on the order that the discount is allocated over, of the type +defined by the Discount Application's target_type. +""" +enum DiscountApplicationTargetSelection { + """ + The discount is allocated onto all the lines. + """ + ALL + + """ + The discount is allocated onto only the lines it is entitled for. + """ + ENTITLED + + """ + The discount is allocated onto explicitly chosen lines. + """ + EXPLICIT +} + +""" +The type of line (i.e. line item or shipping line) on an order that the discount is applicable towards. +""" +enum DiscountApplicationTargetType { + """ + The discount applies onto line items. + """ + LINE_ITEM + + """ + The discount applies onto shipping lines. + """ + SHIPPING_LINE +} + +""" +Discount code applications capture the intentions of a discount code at +the time that it is applied. +""" +type DiscountCodeApplication implements DiscountApplication { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + Specifies whether the discount code was applied successfully. + """ + applicable: Boolean! + + """ + The string identifying the discount code that was used at the time of application. + """ + code: String! + + """ + Which lines of targetType that the discount is allocated over. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line that the discount is applicable towards. + """ + targetType: DiscountApplicationTargetType! + + """ + The value of the discount application. + """ + value: PricingValue! +} + +""" +Represents an error in the input of a mutation. +""" +interface DisplayableError { + """ + Path to the input field which caused the error. + """ + field: [String!] + + """ + The error message. + """ + message: String! +} + +""" +Represents a web address. +""" +type Domain { + """ + The host name of the domain (eg: `example.com`). + """ + host: String! + + """ + Whether SSL is enabled or not. + """ + sslEnabled: Boolean! + + """ + The URL of the domain (eg: `https://example.com`). + """ + url: URL! +} + +""" +Represents a video hosted outside of Shopify. +""" +type ExternalVideo implements Node & Media { + """ + A word or phrase to share the nature or contents of a media. + """ + alt: String + + """ + The URL. + """ + embeddedUrl: URL! + + """ + Globally unique identifier. + """ + id: ID! + + """ + The media content type. + """ + mediaContentType: MediaContentType! + + """ + The preview image for the media. + """ + previewImage: Image +} + +""" +Represents a single fulfillment in an order. +""" +type Fulfillment { + """ + List of the fulfillment's line items. + """ + fulfillmentLineItems( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): FulfillmentLineItemConnection! + + """ + The name of the tracking company. + """ + trackingCompany: String + + """ + Tracking information associated with the fulfillment, + such as the tracking number and tracking URL. + """ + trackingInfo( + """ + Truncate the array result to this size. + """ + first: Int + ): [FulfillmentTrackingInfo!]! +} + +""" +Represents a single line item in a fulfillment. There is at most one fulfillment line item for each order line item. +""" +type FulfillmentLineItem { + """ + The associated order's line item. + """ + lineItem: OrderLineItem! + + """ + The amount fulfilled in this fulfillment. + """ + quantity: Int! +} + +""" +An auto-generated type for paginating through multiple FulfillmentLineItems. +""" +type FulfillmentLineItemConnection { + """ + A list of edges. + """ + edges: [FulfillmentLineItemEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. +""" +type FulfillmentLineItemEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of FulfillmentLineItemEdge. + """ + node: FulfillmentLineItem! +} + +""" +Tracking information associated with the fulfillment. +""" +type FulfillmentTrackingInfo { + """ + The tracking number of the fulfillment. + """ + number: String + + """ + The URL to track the fulfillment. + """ + url: URL +} + +""" +A string containing HTML code. Example value: `"

Grey cotton knit sweater.

"`. +""" +scalar HTML + +""" +Represents information about the metafields associated to the specified resource. +""" +interface HasMetafields { + """ + The metafield associated with the resource. + """ + metafield( + """ + Container for a set of metafields (maximum of 20 characters). + """ + namespace: String! + + """ + Identifier for the metafield (maximum of 30 characters). + """ + key: String! + ): Metafield + + """ + A paginated list of metafields associated with the resource. + """ + metafields( + """ + Container for a set of metafields (maximum of 20 characters). + """ + namespace: String + + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): MetafieldConnection! +} + +""" +Represents an image resource. +""" +type Image { + """ + A word or phrase to share the nature or contents of an image. + """ + altText: String + + """ + The original height of the image in pixels. Returns `null` if the image is not hosted by Shopify. + """ + height: Int + + """ + A unique identifier for the image. + """ + id: ID + + """ + The location of the original image as a URL. + + If there are any existing transformations in the original source URL, they will remain and not be stripped. + """ + originalSrc: URL! + + """ + The location of the image as a URL. + """ + src: URL! + @deprecated( + reason: "Previously an image had a single `src` field. This could either return the original image\nlocation or a URL that contained transformations such as sizing or scale.\n\nThese transformations were specified by arguments on the parent field.\n\nNow an image has two distinct URL fields: `originalSrc` and `transformedSrc`.\n\n* `originalSrc` - the original unmodified image URL\n* `transformedSrc` - the image URL with the specified transformations included\n\nTo migrate to the new fields, image transformations should be moved from the parent field to `transformedSrc`.\n\nBefore:\n```graphql\n{\n shop {\n productImages(maxWidth: 200, scale: 2) {\n edges {\n node {\n src\n }\n }\n }\n }\n}\n```\n\nAfter:\n```graphql\n{\n shop {\n productImages {\n edges {\n node {\n transformedSrc(maxWidth: 200, scale: 2)\n }\n }\n }\n }\n}\n```\n" + ) + + """ + The location of the transformed image as a URL. + + All transformation arguments are considered "best-effort". If they can be applied to an image, they will be. + Otherwise any transformations which an image type does not support will be ignored. + """ + transformedSrc( + """ + Image width in pixels between 1 and 5760. + """ + maxWidth: Int + + """ + Image height in pixels between 1 and 5760. + """ + maxHeight: Int + + """ + Crops the image according to the specified region. + """ + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 and 3. + """ + scale: Int = 1 + + """ + Best effort conversion of image into content type (SVG -> PNG, Anything -> JGP, Anything -> WEBP are supported). + """ + preferredContentType: ImageContentType + ): URL! + + """ + The original width of the image in pixels. Returns `null` if the image is not hosted by Shopify. + """ + width: Int +} + +""" +An auto-generated type for paginating through multiple Images. +""" +type ImageConnection { + """ + A list of edges. + """ + edges: [ImageEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +List of supported image content types. +""" +enum ImageContentType { + """ + A PNG image. + """ + PNG + + """ + A JPG image. + """ + JPG + + """ + A WEBP image. + """ + WEBP +} + +""" +An auto-generated type which holds one Image and a cursor during pagination. +""" +type ImageEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of ImageEdge. + """ + node: Image! +} + +""" +Represents a mailing address for customers and shipping. +""" +type MailingAddress implements Node { + """ + The first line of the address. Typically the street address or PO Box number. + """ + address1: String + + """ + The second line of the address. Typically the number of the apartment, suite, or unit. + """ + address2: String + + """ + The name of the city, district, village, or town. + """ + city: String + + """ + The name of the customer's company or organization. + """ + company: String + + """ + The name of the country. + """ + country: String + + """ + The two-letter code for the country of the address. + + For example, US. + """ + countryCode: String @deprecated(reason: "Use `countryCodeV2` instead") + + """ + The two-letter code for the country of the address. + + For example, US. + """ + countryCodeV2: CountryCode + + """ + The first name of the customer. + """ + firstName: String + + """ + A formatted version of the address, customized by the provided arguments. + """ + formatted( + """ + Whether to include the customer's name in the formatted address. + """ + withName: Boolean = false + + """ + Whether to include the customer's company in the formatted address. + """ + withCompany: Boolean = true + ): [String!]! + + """ + A comma-separated list of the values for city, province, and country. + """ + formattedArea: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + The last name of the customer. + """ + lastName: String + + """ + The latitude coordinate of the customer address. + """ + latitude: Float + + """ + The longitude coordinate of the customer address. + """ + longitude: Float + + """ + The full name of the customer, based on firstName and lastName. + """ + name: String + + """ + A unique phone number for the customer. + + Formatted using E.164 standard. For example, _+16135551111_. + """ + phone: String + + """ + The region of the address, such as the province, state, or district. + """ + province: String + + """ + The two-letter code for the region. + + For example, ON. + """ + provinceCode: String + + """ + The zip or postal code of the address. + """ + zip: String +} + +""" +An auto-generated type for paginating through multiple MailingAddresses. +""" +type MailingAddressConnection { + """ + A list of edges. + """ + edges: [MailingAddressEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one MailingAddress and a cursor during pagination. +""" +type MailingAddressEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of MailingAddressEdge. + """ + node: MailingAddress! +} + +""" +Specifies the fields accepted to create or update a mailing address. +""" +input MailingAddressInput { + """ + The first line of the address. Typically the street address or PO Box number. + """ + address1: String + + """ + The second line of the address. Typically the number of the apartment, suite, or unit. + """ + address2: String + + """ + The name of the city, district, village, or town. + """ + city: String + + """ + The name of the customer's company or organization. + """ + company: String + + """ + The name of the country. + """ + country: String + + """ + The first name of the customer. + """ + firstName: String + + """ + The last name of the customer. + """ + lastName: String + + """ + A unique phone number for the customer. + + Formatted using E.164 standard. For example, _+16135551111_. + """ + phone: String + + """ + The region of the address, such as the province, state, or district. + """ + province: String + + """ + The zip or postal code of the address. + """ + zip: String +} + +""" +Manual discount applications capture the intentions of a discount that was manually created. +""" +type ManualDiscountApplication implements DiscountApplication { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + The description of the application. + """ + description: String + + """ + Which lines of targetType that the discount is allocated over. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line that the discount is applicable towards. + """ + targetType: DiscountApplicationTargetType! + + """ + The title of the application. + """ + title: String! + + """ + The value of the discount application. + """ + value: PricingValue! +} + +""" +Represents a media interface. +""" +interface Media { + """ + A word or phrase to share the nature or contents of a media. + """ + alt: String + + """ + The media content type. + """ + mediaContentType: MediaContentType! + + """ + The preview image for the media. + """ + previewImage: Image +} + +""" +An auto-generated type for paginating through multiple Media. +""" +type MediaConnection { + """ + A list of edges. + """ + edges: [MediaEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +The possible content types for a media object. +""" +enum MediaContentType { + """ + An externally hosted video. + """ + EXTERNAL_VIDEO + + """ + A Shopify hosted image. + """ + IMAGE + + """ + A 3d model. + """ + MODEL_3D + + """ + A Shopify hosted video. + """ + VIDEO +} + +""" +An auto-generated type which holds one Media and a cursor during pagination. +""" +type MediaEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of MediaEdge. + """ + node: Media! +} + +""" +Represents a Shopify hosted image. +""" +type MediaImage implements Node & Media { + """ + A word or phrase to share the nature or contents of a media. + """ + alt: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + The image for the media. + """ + image: Image + + """ + The media content type. + """ + mediaContentType: MediaContentType! + + """ + The preview image for the media. + """ + previewImage: Image +} + +""" +Metafields represent custom metadata attached to a resource. Metafields can be sorted into namespaces and are +comprised of keys, values, and value types. +""" +type Metafield implements Node { + """ + The date and time when the storefront metafield was created. + """ + createdAt: DateTime! + + """ + The description of a metafield. + """ + description: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + The key name for a metafield. + """ + key: String! + + """ + The namespace for a metafield. + """ + namespace: String! + + """ + The parent object that the metafield belongs to. + """ + parentResource: MetafieldParentResource! + + """ + The date and time when the storefront metafield was updated. + """ + updatedAt: DateTime! + + """ + The value of a metafield. + """ + value: String! + + """ + Represents the metafield value type. + """ + valueType: MetafieldValueType! +} + +""" +An auto-generated type for paginating through multiple Metafields. +""" +type MetafieldConnection { + """ + A list of edges. + """ + edges: [MetafieldEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Metafield and a cursor during pagination. +""" +type MetafieldEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of MetafieldEdge. + """ + node: Metafield! +} + +""" +A resource that the metafield belongs to. +""" +union MetafieldParentResource = Product | ProductVariant + +""" +Metafield value types. +""" +enum MetafieldValueType { + """ + A string metafield. + """ + STRING + + """ + An integer metafield. + """ + INTEGER + + """ + A json string metafield. + """ + JSON_STRING +} + +""" +Represents a Shopify hosted 3D model. +""" +type Model3d implements Node & Media { + """ + A word or phrase to share the nature or contents of a media. + """ + alt: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + The media content type. + """ + mediaContentType: MediaContentType! + + """ + The preview image for the media. + """ + previewImage: Image + + """ + The sources for a 3d model. + """ + sources: [Model3dSource!]! +} + +""" +Represents a source for a Shopify hosted 3d model. +""" +type Model3dSource { + """ + The filesize of the 3d model. + """ + filesize: Int! + + """ + The format of the 3d model. + """ + format: String! + + """ + The MIME type of the 3d model. + """ + mimeType: String! + + """ + The URL of the 3d model. + """ + url: String! +} + +""" +A monetary value string. Example value: `"100.57"`. +""" +scalar Money + +""" +Specifies the fields for a monetary value with currency. +""" +input MoneyInput { + """ + Decimal money amount. + """ + amount: Decimal! + + """ + Currency of the money. + """ + currencyCode: CurrencyCode! +} + +""" +A monetary value with currency. + +To format currencies, combine this type's amount and currencyCode fields with your client's locale. + +For example, in JavaScript you could use Intl.NumberFormat: + +```js +new Intl.NumberFormat(locale, { + style: 'currency', + currency: currencyCode +}).format(amount); +``` + +Other formatting libraries include: + +* iOS - [NumberFormatter](https://developer.apple.com/documentation/foundation/numberformatter) +* Android - [NumberFormat](https://developer.android.com/reference/java/text/NumberFormat.html) +* PHP - [NumberFormatter](http://php.net/manual/en/class.numberformatter.php) + +For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations +(such as [TwitterCldr](https://github.com/twitter/twitter-cldr-rb)). +""" +type MoneyV2 { + """ + Decimal money amount. + """ + amount: Decimal! + + """ + Currency of the money. + """ + currencyCode: CurrencyCode! +} + +""" +An auto-generated type for paginating through multiple MoneyV2s. +""" +type MoneyV2Connection { + """ + A list of edges. + """ + edges: [MoneyV2Edge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one MoneyV2 and a cursor during pagination. +""" +type MoneyV2Edge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of MoneyV2Edge. + """ + node: MoneyV2! +} + +""" +The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. +""" +type Mutation { + """ + Updates the attributes of a checkout. + """ + checkoutAttributesUpdate( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The fields used to update a checkout's attributes. + """ + input: CheckoutAttributesUpdateInput! + ): CheckoutAttributesUpdatePayload + @deprecated(reason: "Use `checkoutAttributesUpdateV2` instead") + + """ + Updates the attributes of a checkout. + """ + checkoutAttributesUpdateV2( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The checkout attributes to update. + """ + input: CheckoutAttributesUpdateV2Input! + ): CheckoutAttributesUpdateV2Payload + + """ + Completes a checkout without providing payment information. You can use this mutation for free items or items whose purchase price is covered by a gift card. + """ + checkoutCompleteFree( + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutCompleteFreePayload + + """ + Completes a checkout using a credit card token from Shopify's Vault. + """ + checkoutCompleteWithCreditCard( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The credit card info to apply as a payment. + """ + payment: CreditCardPaymentInput! + ): CheckoutCompleteWithCreditCardPayload + @deprecated(reason: "Use `checkoutCompleteWithCreditCardV2` instead") + + """ + Completes a checkout using a credit card token from Shopify's card vault. Before you can complete checkouts using CheckoutCompleteWithCreditCardV2, you need to [_request payment processing_](https://help.shopify.com/api/guides/sales-channel-sdk/getting-started#request-payment-processing). + """ + checkoutCompleteWithCreditCardV2( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The credit card info to apply as a payment. + """ + payment: CreditCardPaymentInputV2! + ): CheckoutCompleteWithCreditCardV2Payload + + """ + Completes a checkout with a tokenized payment. + """ + checkoutCompleteWithTokenizedPayment( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The info to apply as a tokenized payment. + """ + payment: TokenizedPaymentInput! + ): CheckoutCompleteWithTokenizedPaymentPayload + @deprecated(reason: "Use `checkoutCompleteWithTokenizedPaymentV2` instead") + + """ + Completes a checkout with a tokenized payment. + """ + checkoutCompleteWithTokenizedPaymentV2( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The info to apply as a tokenized payment. + """ + payment: TokenizedPaymentInputV2! + ): CheckoutCompleteWithTokenizedPaymentV2Payload + @deprecated(reason: "Use `checkoutCompleteWithTokenizedPaymentV3` instead") + + """ + Completes a checkout with a tokenized payment. + """ + checkoutCompleteWithTokenizedPaymentV3( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The info to apply as a tokenized payment. + """ + payment: TokenizedPaymentInputV3! + ): CheckoutCompleteWithTokenizedPaymentV3Payload + + """ + Creates a new checkout. + """ + checkoutCreate( + """ + The fields used to create a checkout. + """ + input: CheckoutCreateInput! + ): CheckoutCreatePayload + + """ + Associates a customer to the checkout. + """ + checkoutCustomerAssociate( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The customer access token of the customer to associate. + """ + customerAccessToken: String! + ): CheckoutCustomerAssociatePayload + @deprecated(reason: "Use `checkoutCustomerAssociateV2` instead") + + """ + Associates a customer to the checkout. + """ + checkoutCustomerAssociateV2( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The customer access token of the customer to associate. + """ + customerAccessToken: String! + ): CheckoutCustomerAssociateV2Payload + + """ + Disassociates the current checkout customer from the checkout. + """ + checkoutCustomerDisassociate( + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutCustomerDisassociatePayload + @deprecated(reason: "Use `checkoutCustomerDisassociateV2` instead") + + """ + Disassociates the current checkout customer from the checkout. + """ + checkoutCustomerDisassociateV2( + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutCustomerDisassociateV2Payload + + """ + Applies a discount to an existing checkout using a discount code. + """ + checkoutDiscountCodeApply( + """ + The discount code to apply to the checkout. + """ + discountCode: String! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutDiscountCodeApplyPayload + @deprecated(reason: "Use `checkoutDiscountCodeApplyV2` instead") + + """ + Applies a discount to an existing checkout using a discount code. + """ + checkoutDiscountCodeApplyV2( + """ + The discount code to apply to the checkout. + """ + discountCode: String! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutDiscountCodeApplyV2Payload + + """ + Removes the applied discount from an existing checkout. + """ + checkoutDiscountCodeRemove( + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutDiscountCodeRemovePayload + + """ + Updates the email on an existing checkout. + """ + checkoutEmailUpdate( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The email to update the checkout with. + """ + email: String! + ): CheckoutEmailUpdatePayload + @deprecated(reason: "Use `checkoutEmailUpdateV2` instead") + + """ + Updates the email on an existing checkout. + """ + checkoutEmailUpdateV2( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + The email to update the checkout with. + """ + email: String! + ): CheckoutEmailUpdateV2Payload + + """ + Applies a gift card to an existing checkout using a gift card code. This will replace all currently applied gift cards. + """ + checkoutGiftCardApply( + """ + The code of the gift card to apply on the checkout. + """ + giftCardCode: String! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutGiftCardApplyPayload + @deprecated(reason: "Use `checkoutGiftCardsAppend` instead") + + """ + Removes an applied gift card from the checkout. + """ + checkoutGiftCardRemove( + """ + The ID of the Applied Gift Card to remove from the Checkout. + """ + appliedGiftCardId: ID! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutGiftCardRemovePayload + @deprecated(reason: "Use `checkoutGiftCardRemoveV2` instead") + + """ + Removes an applied gift card from the checkout. + """ + checkoutGiftCardRemoveV2( + """ + The ID of the Applied Gift Card to remove from the Checkout. + """ + appliedGiftCardId: ID! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutGiftCardRemoveV2Payload + + """ + Appends gift cards to an existing checkout. + """ + checkoutGiftCardsAppend( + """ + A list of gift card codes to append to the checkout. + """ + giftCardCodes: [String!]! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutGiftCardsAppendPayload + + """ + Adds a list of line items to a checkout. + """ + checkoutLineItemsAdd( + """ + A list of line item objects to add to the checkout. + """ + lineItems: [CheckoutLineItemInput!]! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutLineItemsAddPayload + + """ + Removes line items from an existing checkout. + """ + checkoutLineItemsRemove( + """ + The checkout on which to remove line items. + """ + checkoutId: ID! + + """ + Line item ids to remove. + """ + lineItemIds: [ID!]! + ): CheckoutLineItemsRemovePayload + + """ + Sets a list of line items to a checkout. + """ + checkoutLineItemsReplace( + """ + A list of line item objects to set on the checkout. + """ + lineItems: [CheckoutLineItemInput!]! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutLineItemsReplacePayload + + """ + Updates line items on a checkout. + """ + checkoutLineItemsUpdate( + """ + The checkout on which to update line items. + """ + checkoutId: ID! + + """ + Line items to update. + """ + lineItems: [CheckoutLineItemUpdateInput!]! + ): CheckoutLineItemsUpdatePayload + + """ + Updates the shipping address of an existing checkout. + """ + checkoutShippingAddressUpdate( + """ + The shipping address to where the line items will be shipped. + """ + shippingAddress: MailingAddressInput! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutShippingAddressUpdatePayload + @deprecated(reason: "Use `checkoutShippingAddressUpdateV2` instead") + + """ + Updates the shipping address of an existing checkout. + """ + checkoutShippingAddressUpdateV2( + """ + The shipping address to where the line items will be shipped. + """ + shippingAddress: MailingAddressInput! + + """ + The ID of the checkout. + """ + checkoutId: ID! + ): CheckoutShippingAddressUpdateV2Payload + + """ + Updates the shipping lines on an existing checkout. + """ + checkoutShippingLineUpdate( + """ + The ID of the checkout. + """ + checkoutId: ID! + + """ + A unique identifier to a Checkout’s shipping provider, price, and title combination, enabling the customer to select the availableShippingRates. + """ + shippingRateHandle: String! + ): CheckoutShippingLineUpdatePayload + + """ + Creates a customer access token. + The customer access token is required to modify the customer object in any way. + """ + customerAccessTokenCreate( + """ + The fields used to create a customer access token. + """ + input: CustomerAccessTokenCreateInput! + ): CustomerAccessTokenCreatePayload + + """ + Creates a customer access token using a multipass token instead of email and password. + A customer record is created if customer does not exist. If a customer record already + exists but the record is disabled, then it's enabled. + """ + customerAccessTokenCreateWithMultipass( + """ + A valid multipass token to be authenticated. + """ + multipassToken: String! + ): CustomerAccessTokenCreateWithMultipassPayload + + """ + Permanently destroys a customer access token. + """ + customerAccessTokenDelete( + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + ): CustomerAccessTokenDeletePayload + + """ + Renews a customer access token. + + Access token renewal must happen *before* a token expires. + If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. + """ + customerAccessTokenRenew( + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + ): CustomerAccessTokenRenewPayload + + """ + Activates a customer. + """ + customerActivate( + """ + Specifies the customer to activate. + """ + id: ID! + + """ + The fields used to activate a customer. + """ + input: CustomerActivateInput! + ): CustomerActivatePayload + + """ + Activates a customer with the activation url received from `customerCreate`. + """ + customerActivateByUrl( + """ + The customer activation URL. + """ + activationUrl: URL! + + """ + A new password set during activation. + """ + password: String! + ): CustomerActivateByUrlPayload + + """ + Creates a new address for a customer. + """ + customerAddressCreate( + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + + """ + The customer mailing address to create. + """ + address: MailingAddressInput! + ): CustomerAddressCreatePayload + + """ + Permanently deletes the address of an existing customer. + """ + customerAddressDelete( + """ + Specifies the address to delete. + """ + id: ID! + + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + ): CustomerAddressDeletePayload + + """ + Updates the address of an existing customer. + """ + customerAddressUpdate( + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + + """ + Specifies the customer address to update. + """ + id: ID! + + """ + The customer’s mailing address. + """ + address: MailingAddressInput! + ): CustomerAddressUpdatePayload + + """ + Creates a new customer. + """ + customerCreate( + """ + The fields used to create a new customer. + """ + input: CustomerCreateInput! + ): CustomerCreatePayload + + """ + Updates the default address of an existing customer. + """ + customerDefaultAddressUpdate( + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + + """ + ID of the address to set as the new default for the customer. + """ + addressId: ID! + ): CustomerDefaultAddressUpdatePayload + + """ + Sends a reset password email to the customer, as the first step in the reset password process. + """ + customerRecover( + """ + The email address of the customer to recover. + """ + email: String! + ): CustomerRecoverPayload + + """ + Resets a customer’s password with a token received from `CustomerRecover`. + """ + customerReset( + """ + Specifies the customer to reset. + """ + id: ID! + + """ + The fields used to reset a customer’s password. + """ + input: CustomerResetInput! + ): CustomerResetPayload + + """ + Resets a customer’s password with the reset password url received from `CustomerRecover`. + """ + customerResetByUrl( + """ + The customer's reset password url. + """ + resetUrl: URL! + + """ + New password that will be set as part of the reset password process. + """ + password: String! + ): CustomerResetByUrlPayload + + """ + Updates an existing customer. + """ + customerUpdate( + """ + The access token used to identify the customer. + """ + customerAccessToken: String! + + """ + The customer object input. + """ + customer: CustomerUpdateInput! + ): CustomerUpdatePayload +} + +""" +An object with an ID to support global identification. +""" +interface Node { + """ + Globally unique identifier. + """ + id: ID! +} + +""" +An order is a customer’s completed request to purchase one or more products from a shop. An order is created when a customer completes the checkout process, during which time they provides an email address, billing address and payment information. +""" +type Order implements Node { + """ + The reason for the order's cancellation. Returns `null` if the order wasn't canceled. + """ + cancelReason: OrderCancelReason + + """ + The date and time when the order was canceled. Returns null if the order wasn't canceled. + """ + canceledAt: DateTime + + """ + The code of the currency used for the payment. + """ + currencyCode: CurrencyCode! + + """ + The subtotal of line items and their discounts, excluding line items that have been removed. Does not contain order-level discounts, duties, shipping costs, or shipping discounts. Taxes are not included unless the order is a taxes-included order. + """ + currentSubtotalPrice: MoneyV2! + + """ + The total amount of the order, including duties, taxes and discounts, minus amounts for line items that have been removed. + """ + currentTotalPrice: MoneyV2! + + """ + The total of all taxes applied to the order, excluding taxes for returned line items. + """ + currentTotalTax: MoneyV2! + + """ + The locale code in which this specific order happened. + """ + customerLocale: String + + """ + The unique URL that the customer can use to access the order. + """ + customerUrl: URL + + """ + Discounts that have been applied on the order. + """ + discountApplications( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): DiscountApplicationConnection! + + """ + Whether the order has had any edits applied or not. + """ + edited: Boolean! + + """ + The customer's email address. + """ + email: String + + """ + The financial status of the order. + """ + financialStatus: OrderFinancialStatus + + """ + The fulfillment status for the order. + """ + fulfillmentStatus: OrderFulfillmentStatus! + + """ + Globally unique identifier. + """ + id: ID! + + """ + List of the order’s line items. + """ + lineItems( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): OrderLineItemConnection! + + """ + Unique identifier for the order that appears on the order. + For example, _#1000_ or _Store1001. + """ + name: String! + + """ + A unique numeric identifier for the order for use by shop owner and customer. + """ + orderNumber: Int! + + """ + The total price of the order before any applied edits. + """ + originalTotalPrice: MoneyV2! + + """ + The customer's phone number for receiving SMS notifications. + """ + phone: String + + """ + The date and time when the order was imported. + This value can be set to dates in the past when importing from other systems. + If no value is provided, it will be auto-generated based on current date and time. + """ + processedAt: DateTime! + + """ + The address to where the order will be shipped. + """ + shippingAddress: MailingAddress + + """ + The discounts that have been allocated onto the shipping line by discount applications. + """ + shippingDiscountAllocations: [DiscountAllocation!]! + + """ + The unique URL for the order's status page. + """ + statusUrl: URL! + + """ + Price of the order before shipping and taxes. + """ + subtotalPrice: Money @deprecated(reason: "Use `subtotalPriceV2` instead") + + """ + Price of the order before duties, shipping and taxes. + """ + subtotalPriceV2: MoneyV2 + + """ + List of the order’s successful fulfillments. + """ + successfulFulfillments( + """ + Truncate the array result to this size. + """ + first: Int + ): [Fulfillment!] + + """ + The sum of all the prices of all the items in the order, taxes and discounts included (must be positive). + """ + totalPrice: Money! @deprecated(reason: "Use `totalPriceV2` instead") + + """ + The sum of all the prices of all the items in the order, duties, taxes and discounts included (must be positive). + """ + totalPriceV2: MoneyV2! + + """ + The total amount that has been refunded. + """ + totalRefunded: Money! @deprecated(reason: "Use `totalRefundedV2` instead") + + """ + The total amount that has been refunded. + """ + totalRefundedV2: MoneyV2! + + """ + The total cost of shipping. + """ + totalShippingPrice: Money! + @deprecated(reason: "Use `totalShippingPriceV2` instead") + + """ + The total cost of shipping. + """ + totalShippingPriceV2: MoneyV2! + + """ + The total cost of taxes. + """ + totalTax: Money @deprecated(reason: "Use `totalTaxV2` instead") + + """ + The total cost of taxes. + """ + totalTaxV2: MoneyV2 +} + +""" +Represents the reason for the order's cancellation. +""" +enum OrderCancelReason { + """ + The customer wanted to cancel the order. + """ + CUSTOMER + + """ + The order was fraudulent. + """ + FRAUD + + """ + There was insufficient inventory. + """ + INVENTORY + + """ + Payment was declined. + """ + DECLINED + + """ + The order was canceled for an unlisted reason. + """ + OTHER +} + +""" +An auto-generated type for paginating through multiple Orders. +""" +type OrderConnection { + """ + A list of edges. + """ + edges: [OrderEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Order and a cursor during pagination. +""" +type OrderEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of OrderEdge. + """ + node: Order! +} + +""" +Represents the order's current financial status. +""" +enum OrderFinancialStatus { + """ + Displayed as **Pending**. + """ + PENDING + + """ + Displayed as **Authorized**. + """ + AUTHORIZED + + """ + Displayed as **Partially paid**. + """ + PARTIALLY_PAID + + """ + Displayed as **Partially refunded**. + """ + PARTIALLY_REFUNDED + + """ + Displayed as **Voided**. + """ + VOIDED + + """ + Displayed as **Paid**. + """ + PAID + + """ + Displayed as **Refunded**. + """ + REFUNDED +} + +""" +Represents the order's current fulfillment status. +""" +enum OrderFulfillmentStatus { + """ + Displayed as **Unfulfilled**. + """ + UNFULFILLED + + """ + Displayed as **Partially fulfilled**. + """ + PARTIALLY_FULFILLED + + """ + Displayed as **Fulfilled**. + """ + FULFILLED + + """ + Displayed as **Restocked**. + """ + RESTOCKED + + """ + Displayed as **Pending fulfillment**. + """ + PENDING_FULFILLMENT + + """ + Displayed as **Open**. + """ + OPEN + + """ + Displayed as **In progress**. + """ + IN_PROGRESS + + """ + Displayed as **Scheduled**. + """ + SCHEDULED +} + +""" +Represents a single line in an order. There is one line item for each distinct product variant. +""" +type OrderLineItem { + """ + The number of entries associated to the line item minus the items that have been removed. + """ + currentQuantity: Int! + + """ + List of custom attributes associated to the line item. + """ + customAttributes: [Attribute!]! + + """ + The discounts that have been allocated onto the order line item by discount applications. + """ + discountAllocations: [DiscountAllocation!]! + + """ + The total price of the line item, including discounts, and displayed in the presentment currency. + """ + discountedTotalPrice: MoneyV2! + + """ + The total price of the line item, not including any discounts. The total price is calculated using the original unit price multiplied by the quantity, and it is displayed in the presentment currency. + """ + originalTotalPrice: MoneyV2! + + """ + The number of products variants associated to the line item. + """ + quantity: Int! + + """ + The title of the product combined with title of the variant. + """ + title: String! + + """ + The product variant object associated to the line item. + """ + variant: ProductVariant +} + +""" +An auto-generated type for paginating through multiple OrderLineItems. +""" +type OrderLineItemConnection { + """ + A list of edges. + """ + edges: [OrderLineItemEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one OrderLineItem and a cursor during pagination. +""" +type OrderLineItemEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of OrderLineItemEdge. + """ + node: OrderLineItem! +} + +""" +The set of valid sort keys for the Order query. +""" +enum OrderSortKeys { + """ + Sort by the `processed_at` value. + """ + PROCESSED_AT + + """ + Sort by the `total_price` value. + """ + TOTAL_PRICE + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom page on the online store. +""" +type Page implements Node { + """ + The description of the page, complete with HTML formatting. + """ + body: HTML! + + """ + Summary of the page body. + """ + bodySummary: String! + + """ + The timestamp of the page creation. + """ + createdAt: DateTime! + + """ + A human-friendly unique string for the page automatically generated from its title. + """ + handle: String! + + """ + Globally unique identifier. + """ + id: ID! + + """ + The page's SEO information. + """ + seo: SEO + + """ + The title of the page. + """ + title: String! + + """ + The timestamp of the latest page update. + """ + updatedAt: DateTime! + + """ + The url pointing to the page accessible from the web. + """ + url: URL! +} + +""" +An auto-generated type for paginating through multiple Pages. +""" +type PageConnection { + """ + A list of edges. + """ + edges: [PageEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Page and a cursor during pagination. +""" +type PageEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of PageEdge. + """ + node: Page! +} + +""" +Information about pagination in a connection. +""" +type PageInfo { + """ + Indicates if there are more pages to fetch. + """ + hasNextPage: Boolean! + + """ + Indicates if there are any pages prior to the current page. + """ + hasPreviousPage: Boolean! +} + +""" +The set of valid sort keys for the Page query. +""" +enum PageSortKeys { + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `updated_at` value. + """ + UPDATED_AT + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +A payment applied to a checkout. +""" +type Payment implements Node { + """ + The amount of the payment. + """ + amount: Money! @deprecated(reason: "Use `amountV2` instead") + + """ + The amount of the payment. + """ + amountV2: MoneyV2! + + """ + The billing address for the payment. + """ + billingAddress: MailingAddress + + """ + The checkout to which the payment belongs. + """ + checkout: Checkout! + + """ + The credit card used for the payment in the case of direct payments. + """ + creditCard: CreditCard + + """ + A message describing a processing error during asynchronous processing. + """ + errorMessage: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + A client-side generated token to identify a payment and perform idempotent operations. + """ + idempotencyKey: String + + """ + The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow. + """ + nextActionUrl: URL + + """ + Whether or not the payment is still processing asynchronously. + """ + ready: Boolean! + + """ + A flag to indicate if the payment is to be done in test mode for gateways that support it. + """ + test: Boolean! + + """ + The actual transaction recorded by Shopify after having processed the payment with the gateway. + """ + transaction: Transaction +} + +""" +Settings related to payments. +""" +type PaymentSettings { + """ + List of the card brands which the shop accepts. + """ + acceptedCardBrands: [CardBrand!]! + + """ + The url pointing to the endpoint to vault credit cards. + """ + cardVaultUrl: URL! + + """ + The country where the shop is located. + """ + countryCode: CountryCode! + + """ + The three-letter code for the shop's primary currency. + """ + currencyCode: CurrencyCode! + + """ + A list of enabled currencies (ISO 4217 format) that the shop accepts. Merchants can enable currencies from their Shopify Payments settings in the Shopify admin. + """ + enabledPresentmentCurrencies: [CurrencyCode!]! + + """ + The shop’s Shopify Payments account id. + """ + shopifyPaymentsAccountId: String + + """ + List of the digital wallets which the shop supports. + """ + supportedDigitalWallets: [DigitalWallet!]! +} + +""" +The valid values for the types of payment token. +""" +enum PaymentTokenType { + """ + Apple Pay token type. + """ + APPLE_PAY + + """ + Vault payment token type. + """ + VAULT + + """ + Shopify Pay token type. + """ + SHOPIFY_PAY + + """ + Google Pay token type. + """ + GOOGLE_PAY +} + +""" +The value of the percentage pricing object. +""" +type PricingPercentageValue { + """ + The percentage value of the object. + """ + percentage: Float! +} + +""" +The price value (fixed or percentage) for a discount application. +""" +union PricingValue = MoneyV2 | PricingPercentageValue + +""" +A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. +For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, as do services (such as equipment rental, work for hire, customization of another product or an extended warranty). +""" +type Product implements Node & HasMetafields { + """ + Indicates if at least one product variant is available for sale. + """ + availableForSale: Boolean! + + """ + List of collections a product belongs to. + """ + collections( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): CollectionConnection! + + """ + The compare at price of the product across all variants. + """ + compareAtPriceRange: ProductPriceRange! + + """ + The date and time when the product was created. + """ + createdAt: DateTime! + + """ + Stripped description of the product, single line with HTML tags removed. + """ + description( + """ + Truncates string after the given length. + """ + truncateAt: Int + ): String! + + """ + The description of the product, complete with HTML formatting. + """ + descriptionHtml: HTML! + + """ + A human-friendly unique string for the Product automatically generated from its title. + They are used by the Liquid templating language to refer to objects. + """ + handle: String! + + """ + Globally unique identifier. + """ + id: ID! + + """ + List of images associated with the product. + """ + images( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ProductImageSortKeys = POSITION + + """ + Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead. + """ + maxWidth: Int + + """ + Image height in pixels between 1 and 2048. This argument is deprecated: Use `maxHeight` on `Image.transformedSrc` instead. + """ + maxHeight: Int + + """ + Crops the image according to the specified region. This argument is deprecated: Use `crop` on `Image.transformedSrc` instead. + """ + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead. + """ + scale: Int = 1 + ): ImageConnection! + + """ + The media associated with the product. + """ + media( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ProductMediaSortKeys = POSITION + ): MediaConnection! + + """ + The metafield associated with the resource. + """ + metafield( + """ + Container for a set of metafields (maximum of 20 characters). + """ + namespace: String! + + """ + Identifier for the metafield (maximum of 30 characters). + """ + key: String! + ): Metafield + + """ + A paginated list of metafields associated with the resource. + """ + metafields( + """ + Container for a set of metafields (maximum of 20 characters). + """ + namespace: String + + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): MetafieldConnection! + + """ + The online store URL for the product. + A value of `null` indicates that the product is not published to the Online Store sales channel. + """ + onlineStoreUrl: URL + + """ + List of product options. + """ + options( + """ + Truncate the array result to this size. + """ + first: Int + ): [ProductOption!]! + + """ + List of price ranges in the presentment currencies for this shop. + """ + presentmentPriceRanges( + """ + Specifies the presentment currencies to return a price range in. + """ + presentmentCurrencies: [CurrencyCode!] + + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): ProductPriceRangeConnection! + + """ + The price range. + """ + priceRange: ProductPriceRange! + + """ + A categorization that a product can be tagged with, commonly used for filtering and searching. + """ + productType: String! + + """ + The date and time when the product was published to the channel. + """ + publishedAt: DateTime! + + """ + The product's SEO information. + """ + seo: SEO! + + """ + A comma separated list of tags that have been added to the product. + Additional access scope required for private apps: unauthenticated_read_product_tags. + """ + tags: [String!]! + + """ + The product’s title. + """ + title: String! + + """ + The total quantity of inventory in stock for this Product. + """ + totalInventory: Int + + """ + The date and time when the product was last modified. + A product's `updatedAt` value can change for different reasons. For example, if an order + is placed for a product that has inventory tracking set up, then the inventory adjustment + is counted as an update. + """ + updatedAt: DateTime! + + """ + Find a product’s variant based on its selected options. + This is useful for converting a user’s selection of product options into a single matching variant. + If there is not a variant for the selected options, `null` will be returned. + """ + variantBySelectedOptions( + """ + The input fields used for a selected option. + """ + selectedOptions: [SelectedOptionInput!]! + ): ProductVariant + + """ + List of the product’s variants. + """ + variants( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ProductVariantSortKeys = POSITION + ): ProductVariantConnection! + + """ + The product’s vendor name. + """ + vendor: String! +} + +""" +The set of valid sort keys for the ProductCollection query. +""" +enum ProductCollectionSortKeys { + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `price` value. + """ + PRICE + + """ + Sort by the `best-selling` value. + """ + BEST_SELLING + + """ + Sort by the `created` value. + """ + CREATED + + """ + Sort by the `id` value. + """ + ID + + """ + Sort by the `manual` value. + """ + MANUAL + + """ + Sort by the `collection-default` value. + """ + COLLECTION_DEFAULT + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +An auto-generated type for paginating through multiple Products. +""" +type ProductConnection { + """ + A list of edges. + """ + edges: [ProductEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Product and a cursor during pagination. +""" +type ProductEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of ProductEdge. + """ + node: Product! +} + +""" +The set of valid sort keys for the ProductImage query. +""" +enum ProductImageSortKeys { + """ + Sort by the `created_at` value. + """ + CREATED_AT + + """ + Sort by the `position` value. + """ + POSITION + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +The set of valid sort keys for the ProductMedia query. +""" +enum ProductMediaSortKeys { + """ + Sort by the `position` value. + """ + POSITION + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +Product property names like "Size", "Color", and "Material" that the customers can select. +Variants are selected based on permutations of these options. +255 characters limit each. +""" +type ProductOption implements Node { + """ + Globally unique identifier. + """ + id: ID! + + """ + The product option’s name. + """ + name: String! + + """ + The corresponding value to the product option name. + """ + values: [String!]! +} + +""" +The price range of the product. +""" +type ProductPriceRange { + """ + The highest variant's price. + """ + maxVariantPrice: MoneyV2! + + """ + The lowest variant's price. + """ + minVariantPrice: MoneyV2! +} + +""" +An auto-generated type for paginating through multiple ProductPriceRanges. +""" +type ProductPriceRangeConnection { + """ + A list of edges. + """ + edges: [ProductPriceRangeEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one ProductPriceRange and a cursor during pagination. +""" +type ProductPriceRangeEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of ProductPriceRangeEdge. + """ + node: ProductPriceRange! +} + +""" +The set of valid sort keys for the Product query. +""" +enum ProductSortKeys { + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `product_type` value. + """ + PRODUCT_TYPE + + """ + Sort by the `vendor` value. + """ + VENDOR + + """ + Sort by the `updated_at` value. + """ + UPDATED_AT + + """ + Sort by the `created_at` value. + """ + CREATED_AT + + """ + Sort by the `best_selling` value. + """ + BEST_SELLING + + """ + Sort by the `price` value. + """ + PRICE + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +A product variant represents a different version of a product, such as differing sizes or differing colors. +""" +type ProductVariant implements Node & HasMetafields { + """ + Indicates if the product variant is in stock. + """ + available: Boolean @deprecated(reason: "Use `availableForSale` instead") + + """ + Indicates if the product variant is available for sale. + """ + availableForSale: Boolean! + + """ + The compare at price of the variant. This can be used to mark a variant as on sale, when `compareAtPrice` is higher than `price`. + """ + compareAtPrice: Money @deprecated(reason: "Use `compareAtPriceV2` instead") + + """ + The compare at price of the variant. This can be used to mark a variant as on sale, when `compareAtPriceV2` is higher than `priceV2`. + """ + compareAtPriceV2: MoneyV2 + + """ + Whether a product is out of stock but still available for purchase (used for backorders). + """ + currentlyNotInStock: Boolean! + + """ + Globally unique identifier. + """ + id: ID! + + """ + Image associated with the product variant. This field falls back to the product image if no image is available. + """ + image( + """ + Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead. + """ + maxWidth: Int + + """ + Image height in pixels between 1 and 2048. This argument is deprecated: Use `maxHeight` on `Image.transformedSrc` instead. + """ + maxHeight: Int + + """ + Crops the image according to the specified region. This argument is deprecated: Use `crop` on `Image.transformedSrc` instead. + """ + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead. + """ + scale: Int = 1 + ): Image + + """ + The metafield associated with the resource. + """ + metafield( + """ + Container for a set of metafields (maximum of 20 characters). + """ + namespace: String! + + """ + Identifier for the metafield (maximum of 30 characters). + """ + key: String! + ): Metafield + + """ + A paginated list of metafields associated with the resource. + """ + metafields( + """ + Container for a set of metafields (maximum of 20 characters). + """ + namespace: String + + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): MetafieldConnection! + + """ + List of prices and compare-at prices in the presentment currencies for this shop. + """ + presentmentPrices( + """ + The presentment currencies prices should return in. + """ + presentmentCurrencies: [CurrencyCode!] + + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): ProductVariantPricePairConnection! + + """ + List of unit prices in the presentment currencies for this shop. + """ + presentmentUnitPrices( + """ + Specify the currencies in which to return presentment unit prices. + """ + presentmentCurrencies: [CurrencyCode!] + + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + ): MoneyV2Connection! + + """ + The product variant’s price. + """ + price: Money! @deprecated(reason: "Use `priceV2` instead") + + """ + The product variant’s price. + """ + priceV2: MoneyV2! + + """ + The product object that the product variant belongs to. + """ + product: Product! + + """ + The total sellable quantity of the variant for online sales channels. + """ + quantityAvailable: Int + + """ + Whether a customer needs to provide a shipping address when placing an order for the product variant. + """ + requiresShipping: Boolean! + + """ + List of product options applied to the variant. + """ + selectedOptions: [SelectedOption!]! + + """ + The SKU (stock keeping unit) associated with the variant. + """ + sku: String + + """ + The product variant’s title. + """ + title: String! + + """ + The unit price value for the variant based on the variant's measurement. + """ + unitPrice: MoneyV2 + + """ + The unit price measurement for the variant. + """ + unitPriceMeasurement: UnitPriceMeasurement + + """ + The weight of the product variant in the unit system specified with `weight_unit`. + """ + weight: Float + + """ + Unit of measurement for weight. + """ + weightUnit: WeightUnit! +} + +""" +An auto-generated type for paginating through multiple ProductVariants. +""" +type ProductVariantConnection { + """ + A list of edges. + """ + edges: [ProductVariantEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one ProductVariant and a cursor during pagination. +""" +type ProductVariantEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of ProductVariantEdge. + """ + node: ProductVariant! +} + +""" +The compare-at price and price of a variant sharing a currency. +""" +type ProductVariantPricePair { + """ + The compare-at price of the variant with associated currency. + """ + compareAtPrice: MoneyV2 + + """ + The price of the variant with associated currency. + """ + price: MoneyV2! +} + +""" +An auto-generated type for paginating through multiple ProductVariantPricePairs. +""" +type ProductVariantPricePairConnection { + """ + A list of edges. + """ + edges: [ProductVariantPricePairEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one ProductVariantPricePair and a cursor during pagination. +""" +type ProductVariantPricePairEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of ProductVariantPricePairEdge. + """ + node: ProductVariantPricePair! +} + +""" +The set of valid sort keys for the ProductVariant query. +""" +enum ProductVariantSortKeys { + """ + Sort by the `title` value. + """ + TITLE + + """ + Sort by the `sku` value. + """ + SKU + + """ + Sort by the `position` value. + """ + POSITION + + """ + Sort by the `id` value. + """ + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + """ + RELEVANCE +} + +""" +The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. +""" +type QueryRoot { + """ + List of the shop's articles. + """ + articles( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ArticleSortKeys = ID + + """ + Supported filter parameters: + - `author` + - `blog_title` + - `created_at` + - `tag` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): ArticleConnection! + + """ + Find a blog by its handle. + """ + blogByHandle( + """ + The handle of the blog. + """ + handle: String! + ): Blog + + """ + List of the shop's blogs. + """ + blogs( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: BlogSortKeys = ID + + """ + Supported filter parameters: + - `created_at` + - `handle` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): BlogConnection! + + """ + Find a collection by its handle. + """ + collectionByHandle( + """ + The handle of the collection. + """ + handle: String! + ): Collection + + """ + List of the shop’s collections. + """ + collections( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: CollectionSortKeys = ID + + """ + Supported filter parameters: + - `collection_type` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): CollectionConnection! + + """ + Find a customer by its access token. + """ + customer( + """ + The customer access token. + """ + customerAccessToken: String! + ): Customer + node( + """ + The ID of the Node to return. + """ + id: ID! + ): Node + nodes( + """ + The IDs of the Nodes to return. + """ + ids: [ID!]! + ): [Node]! + + """ + Find a page by its handle. + """ + pageByHandle( + """ + The handle of the page. + """ + handle: String! + ): Page + + """ + List of the shop's pages. + """ + pages( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: PageSortKeys = ID + + """ + Supported filter parameters: + - `created_at` + - `handle` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): PageConnection! + + """ + Find a product by its handle. + """ + productByHandle( + """ + The handle of the product. + """ + handle: String! + ): Product + + """ + Find recommended products related to a given `product_id`. + To learn more about how recommendations are generated, see + [*Showing product recommendations on product pages*](https://help.shopify.com/themes/development/recommended-products). + """ + productRecommendations( + """ + The id of the product. + """ + productId: ID! + ): [Product!] + + """ + Tags added to products. + Additional access scope required: unauthenticated_read_product_tags. + """ + productTags( + """ + Returns up to the first `n` elements from the list. + """ + first: Int! + ): StringConnection! + + """ + List of product types for the shop's products that are published to your app. + """ + productTypes( + """ + Returns up to the first `n` elements from the list. + """ + first: Int! + ): StringConnection! + + """ + List of the shop’s products. + """ + products( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ProductSortKeys = ID + + """ + Supported filter parameters: + - `available_for_sale` + - `created_at` + - `product_type` + - `tag` + - `title` + - `updated_at` + - `variants.price` + - `vendor` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): ProductConnection! + + """ + The list of public Storefront API versions, including supported, release candidate and unstable versions. + """ + publicApiVersions: [ApiVersion!]! + + """ + The shop associated with the storefront access token. + """ + shop: Shop! +} + +""" +SEO information. +""" +type SEO { + """ + The meta description. + """ + description: String + + """ + The SEO title. + """ + title: String +} + +""" +Script discount applications capture the intentions of a discount that +was created by a Shopify Script. +""" +type ScriptDiscountApplication implements DiscountApplication { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """ + The description of the application as defined by the Script. + """ + description: String! @deprecated(reason: "Use `title` instead") + + """ + Which lines of targetType that the discount is allocated over. + """ + targetSelection: DiscountApplicationTargetSelection! + + """ + The type of line that the discount is applicable towards. + """ + targetType: DiscountApplicationTargetType! + + """ + The title of the application as defined by the Script. + """ + title: String! + + """ + The value of the discount application. + """ + value: PricingValue! +} + +""" +Properties used by customers to select a product variant. +Products can have multiple options, like different sizes or colors. +""" +type SelectedOption { + """ + The product option’s name. + """ + name: String! + + """ + The product option’s value. + """ + value: String! +} + +""" +Specifies the input fields required for a selected option. +""" +input SelectedOptionInput { + """ + The product option’s name. + """ + name: String! + + """ + The product option’s value. + """ + value: String! +} + +""" +A shipping rate to be applied to a checkout. +""" +type ShippingRate { + """ + Human-readable unique identifier for this shipping rate. + """ + handle: String! + + """ + Price of this shipping rate. + """ + price: Money! @deprecated(reason: "Use `priceV2` instead") + + """ + Price of this shipping rate. + """ + priceV2: MoneyV2! + + """ + Title of this shipping rate. + """ + title: String! +} + +""" +Shop represents a collection of the general settings and information about the shop. +""" +type Shop { + """ + List of the shop' articles. + """ + articles( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ArticleSortKeys = ID + + """ + Supported filter parameters: + - `author` + - `blog_title` + - `created_at` + - `tag` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): ArticleConnection! @deprecated(reason: "Use `QueryRoot.articles` instead.") + + """ + List of the shop' blogs. + """ + blogs( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: BlogSortKeys = ID + + """ + Supported filter parameters: + - `created_at` + - `handle` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): BlogConnection! @deprecated(reason: "Use `QueryRoot.blogs` instead.") + + """ + Find a collection by its handle. + """ + collectionByHandle( + """ + The handle of the collection. + """ + handle: String! + ): Collection + @deprecated(reason: "Use `QueryRoot.collectionByHandle` instead.") + + """ + List of the shop’s collections. + """ + collections( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: CollectionSortKeys = ID + + """ + Supported filter parameters: + - `collection_type` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): CollectionConnection! + @deprecated(reason: "Use `QueryRoot.collections` instead.") + + """ + The three-letter code for the currency that the shop accepts. + """ + currencyCode: CurrencyCode! + @deprecated(reason: "Use `paymentSettings` instead") + + """ + A description of the shop. + """ + description: String + + """ + A string representing the way currency is formatted when the currency isn’t specified. + """ + moneyFormat: String! + + """ + The shop’s name. + """ + name: String! + + """ + Settings related to payments. + """ + paymentSettings: PaymentSettings! + + """ + The shop’s primary domain. + """ + primaryDomain: Domain! + + """ + The shop’s privacy policy. + """ + privacyPolicy: ShopPolicy + + """ + Find a product by its handle. + """ + productByHandle( + """ + The handle of the product. + """ + handle: String! + ): Product @deprecated(reason: "Use `QueryRoot.productByHandle` instead.") + + """ + A list of tags that have been added to products. + Additional access scope required: unauthenticated_read_product_tags. + """ + productTags( + """ + Returns up to the first `n` elements from the list. + """ + first: Int! + ): StringConnection! + @deprecated(reason: "Use `QueryRoot.productTags` instead.") + + """ + List of the shop’s product types. + """ + productTypes( + """ + Returns up to the first `n` elements from the list. + """ + first: Int! + ): StringConnection! + @deprecated(reason: "Use `QueryRoot.productTypes` instead.") + + """ + List of the shop’s products. + """ + products( + """ + Returns up to the first `n` elements from the list. + """ + first: Int + + """ + Returns the elements that come after the specified cursor. + """ + after: String + + """ + Returns up to the last `n` elements from the list. + """ + last: Int + + """ + Returns the elements that come before the specified cursor. + """ + before: String + + """ + Reverse the order of the underlying list. + """ + reverse: Boolean = false + + """ + Sort the underlying list by the given key. + """ + sortKey: ProductSortKeys = ID + + """ + Supported filter parameters: + - `available_for_sale` + - `created_at` + - `product_type` + - `tag` + - `title` + - `updated_at` + - `variants.price` + - `vendor` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + """ + query: String + ): ProductConnection! @deprecated(reason: "Use `QueryRoot.products` instead.") + + """ + The shop’s refund policy. + """ + refundPolicy: ShopPolicy + + """ + The shop’s shipping policy. + """ + shippingPolicy: ShopPolicy + + """ + Countries that the shop ships to. + """ + shipsToCountries: [CountryCode!]! + + """ + The shop’s Shopify Payments account id. + """ + shopifyPaymentsAccountId: String + @deprecated(reason: "Use `paymentSettings` instead") + + """ + The shop’s terms of service. + """ + termsOfService: ShopPolicy +} + +""" +Policy that a merchant has configured for their store, such as their refund or privacy policy. +""" +type ShopPolicy implements Node { + """ + Policy text, maximum size of 64kb. + """ + body: String! + + """ + Policy’s handle. + """ + handle: String! + + """ + Globally unique identifier. + """ + id: ID! + + """ + Policy’s title. + """ + title: String! + + """ + Public URL to the policy. + """ + url: URL! +} + +""" +An auto-generated type for paginating through multiple Strings. +""" +type StringConnection { + """ + A list of edges. + """ + edges: [StringEdge!]! + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one String and a cursor during pagination. +""" +type StringEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of StringEdge. + """ + node: String! +} + +""" +Specifies the fields required to complete a checkout with +a tokenized payment. +""" +input TokenizedPaymentInput { + """ + The amount of the payment. + """ + amount: Money! + + """ + A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. + """ + idempotencyKey: String! + + """ + The billing address for the payment. + """ + billingAddress: MailingAddressInput! + + """ + The type of payment token. + """ + type: String! + + """ + A simple string or JSON containing the required payment data for the tokenized payment. + """ + paymentData: String! + + """ + Executes the payment in test mode if possible. Defaults to `false`. + """ + test: Boolean + + """ + Public Hash Key used for AndroidPay payments only. + """ + identifier: String +} + +""" +Specifies the fields required to complete a checkout with +a tokenized payment. +""" +input TokenizedPaymentInputV2 { + """ + The amount and currency of the payment. + """ + paymentAmount: MoneyInput! + + """ + A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. + """ + idempotencyKey: String! + + """ + The billing address for the payment. + """ + billingAddress: MailingAddressInput! + + """ + A simple string or JSON containing the required payment data for the tokenized payment. + """ + paymentData: String! + + """ + Whether to execute the payment in test mode, if possible. Test mode is not supported in production stores. Defaults to `false`. + """ + test: Boolean + + """ + Public Hash Key used for AndroidPay payments only. + """ + identifier: String + + """ + The type of payment token. + """ + type: String! +} + +""" +Specifies the fields required to complete a checkout with +a tokenized payment. +""" +input TokenizedPaymentInputV3 { + """ + The amount and currency of the payment. + """ + paymentAmount: MoneyInput! + + """ + A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. + """ + idempotencyKey: String! + + """ + The billing address for the payment. + """ + billingAddress: MailingAddressInput! + + """ + A simple string or JSON containing the required payment data for the tokenized payment. + """ + paymentData: String! + + """ + Whether to execute the payment in test mode, if possible. Test mode is not supported in production stores. Defaults to `false`. + """ + test: Boolean + + """ + Public Hash Key used for AndroidPay payments only. + """ + identifier: String + + """ + The type of payment token. + """ + type: PaymentTokenType! +} + +""" +An object representing exchange of money for a product or service. +""" +type Transaction { + """ + The amount of money that the transaction was for. + """ + amount: Money! @deprecated(reason: "Use `amountV2` instead") + + """ + The amount of money that the transaction was for. + """ + amountV2: MoneyV2! + + """ + The kind of the transaction. + """ + kind: TransactionKind! + + """ + The status of the transaction. + """ + status: TransactionStatus! @deprecated(reason: "Use `statusV2` instead") + + """ + The status of the transaction. + """ + statusV2: TransactionStatus + + """ + Whether the transaction was done in test mode or not. + """ + test: Boolean! +} + +enum TransactionKind { + SALE + CAPTURE + AUTHORIZATION + EMV_AUTHORIZATION + CHANGE +} + +enum TransactionStatus { + PENDING + SUCCESS + FAILURE + ERROR +} + +""" +An RFC 3986 and RFC 3987 compliant URI string. + +Example value: `"https://johns-apparel.myshopify.com"`. +""" +scalar URL + +""" +The measurement used to calculate a unit price for a product variant (e.g. $9.99 / 100ml). +""" +type UnitPriceMeasurement { + """ + The type of unit of measurement for the unit price measurement. + """ + measuredType: UnitPriceMeasurementMeasuredType + + """ + The quantity unit for the unit price measurement. + """ + quantityUnit: UnitPriceMeasurementMeasuredUnit + + """ + The quantity value for the unit price measurement. + """ + quantityValue: Float! + + """ + The reference unit for the unit price measurement. + """ + referenceUnit: UnitPriceMeasurementMeasuredUnit + + """ + The reference value for the unit price measurement. + """ + referenceValue: Int! +} + +""" +The accepted types of unit of measurement. +""" +enum UnitPriceMeasurementMeasuredType { + """ + Unit of measurements representing volumes. + """ + VOLUME + + """ + Unit of measurements representing weights. + """ + WEIGHT + + """ + Unit of measurements representing lengths. + """ + LENGTH + + """ + Unit of measurements representing areas. + """ + AREA +} + +""" +The valid units of measurement for a unit price measurement. +""" +enum UnitPriceMeasurementMeasuredUnit { + """ + 1000 milliliters equals 1 liter. + """ + ML + + """ + 100 centiliters equals 1 liter. + """ + CL + + """ + Metric system unit of volume. + """ + L + + """ + 1 cubic meter equals 1000 liters. + """ + M3 + + """ + 1000 milligrams equals 1 gram. + """ + MG + + """ + Metric system unit of weight. + """ + G + + """ + 1 kilogram equals 1000 grams. + """ + KG + + """ + 1000 millimeters equals 1 meter. + """ + MM + + """ + 100 centimeters equals 1 meter. + """ + CM + + """ + Metric system unit of length. + """ + M + + """ + Metric system unit of area. + """ + M2 +} + +""" +Represents an error in the input of a mutation. +""" +type UserError implements DisplayableError { + """ + Path to the input field which caused the error. + """ + field: [String!] + + """ + The error message. + """ + message: String! +} + +""" +Represents a Shopify hosted video. +""" +type Video implements Node & Media { + """ + A word or phrase to share the nature or contents of a media. + """ + alt: String + + """ + Globally unique identifier. + """ + id: ID! + + """ + The media content type. + """ + mediaContentType: MediaContentType! + + """ + The preview image for the media. + """ + previewImage: Image + + """ + The sources for a video. + """ + sources: [VideoSource!]! +} + +""" +Represents a source for a Shopify hosted video. +""" +type VideoSource { + """ + The format of the video source. + """ + format: String! + + """ + The height of the video. + """ + height: Int! + + """ + The video MIME type. + """ + mimeType: String! + + """ + The URL of the video. + """ + url: String! + + """ + The width of the video. + """ + width: Int! +} + +""" +Units of measurement for weight. +""" +enum WeightUnit { + """ + 1 kilogram equals 1000 grams. + """ + KILOGRAMS + + """ + Metric system unit of mass. + """ + GRAMS + + """ + 1 pound equals 16 ounces. + """ + POUNDS + + """ + Imperial system unit of mass. + """ + OUNCES +} diff --git a/packages/swell/src/api/cart/index.ts b/packages/swell/src/api/cart/index.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/swell/src/api/cart/index.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/swell/src/api/catalog/index.ts b/packages/swell/src/api/catalog/index.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/swell/src/api/catalog/index.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/swell/src/api/catalog/products.ts b/packages/swell/src/api/catalog/products.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/swell/src/api/catalog/products.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/swell/src/api/customer.ts b/packages/swell/src/api/customer.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/swell/src/api/customer.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/swell/src/api/customers/index.ts b/packages/swell/src/api/customers/index.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/swell/src/api/customers/index.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/swell/src/api/customers/logout.ts b/packages/swell/src/api/customers/logout.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/swell/src/api/customers/logout.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/swell/src/api/customers/signup.ts b/packages/swell/src/api/customers/signup.ts new file mode 100644 index 0000000..ea9b101 --- /dev/null +++ b/packages/swell/src/api/customers/signup.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/swell/src/api/endpoints/cart.ts b/packages/swell/src/api/endpoints/cart.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/swell/src/api/endpoints/cart.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/swell/src/api/endpoints/catalog/products.ts b/packages/swell/src/api/endpoints/catalog/products.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/swell/src/api/endpoints/catalog/products.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/swell/src/api/endpoints/checkout/index.ts b/packages/swell/src/api/endpoints/checkout/index.ts new file mode 100644 index 0000000..2695ea3 --- /dev/null +++ b/packages/swell/src/api/endpoints/checkout/index.ts @@ -0,0 +1,30 @@ +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 '@vercel/commerce/api/endpoints/checkout' + +const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ + req, + res, + config, +}) => { + const { cookies } = req + const checkoutUrl = cookies[SWELL_CHECKOUT_URL_COOKIE] + + if (checkoutUrl) { + res.redirect(checkoutUrl) + } else { + res.redirect('/cart') + } +} +export const handlers: CheckoutEndpoint['handlers'] = { getCheckout } + +export type CheckoutAPI = GetAPISchema +export type CheckoutEndpoint = CheckoutAPI['endpoint'] + +const checkoutApi = createEndpoint({ + handler: checkoutEndpoint, + handlers, +}) + +export default checkoutApi 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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /dev/null +++ b/packages/swell/src/api/endpoints/customer/index.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/swell/src/api/endpoints/login.ts b/packages/swell/src/api/endpoints/login.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/swell/src/api/endpoints/login.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/swell/src/api/endpoints/logout.ts b/packages/swell/src/api/endpoints/logout.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/swell/src/api/endpoints/logout.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/swell/src/api/endpoints/signup.ts b/packages/swell/src/api/endpoints/signup.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/swell/src/api/endpoints/signup.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/swell/src/api/endpoints/wishlist.ts b/packages/swell/src/api/endpoints/wishlist.ts new file mode 100644 index 0000000..d09c976 --- /dev/null +++ b/packages/swell/src/api/endpoints/wishlist.ts @@ -0,0 +1 @@ +export default function (_commerce: any) {} diff --git a/packages/swell/src/api/index.ts b/packages/swell/src/api/index.ts new file mode 100644 index 0000000..589acae --- /dev/null +++ b/packages/swell/src/api/index.ts @@ -0,0 +1,53 @@ +import { + CommerceAPI, + CommerceAPIConfig, + getCommerceApi as commerceApi, +} from '@vercel/commerce/api' +import { + SWELL_CHECKOUT_ID_COOKIE, + SWELL_CUSTOMER_TOKEN_COOKIE, + SWELL_COOKIE_EXPIRE, +} from '../const' + +import fetchApi from './utils/fetch-swell-api' +import login from './operations/login' +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' + +export interface SwellConfig extends CommerceAPIConfig { + fetch: any +} + +const config: SwellConfig = { + locale: 'en-US', + commerceUrl: '', + apiToken: ''!, + cartCookie: SWELL_CHECKOUT_ID_COOKIE, + cartCookieMaxAge: SWELL_COOKIE_EXPIRE, + fetch: fetchApi, + customerCookie: SWELL_CUSTOMER_TOKEN_COOKIE, +} + +const operations = { + login, + getAllPages, + getPage, + getSiteInfo, + getAllProductPaths, + getAllProducts, + getProduct, +} + +export const provider = { config, operations } + +export type Provider = typeof provider + +export function getCommerceApi

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

{ + return commerceApi(customProvider) +} diff --git a/packages/swell/src/api/operations/get-all-pages.ts b/packages/swell/src/api/operations/get-all-pages.ts new file mode 100644 index 0000000..7097d68 --- /dev/null +++ b/packages/swell/src/api/operations/get-all-pages.ts @@ -0,0 +1,44 @@ +import { Provider, SwellConfig } from '..' +import type { OperationContext } from '@vercel/commerce/api/operations' +import type { Page } from '../../types/page' + +export type GetAllPagesResult = + T + +export default function getAllPagesOperation({ + commerce, +}: OperationContext) { + async function getAllPages(opts?: { + config?: Partial + preview?: boolean + }): Promise + + async function getAllPages(opts: { + url: string + config?: Partial + preview?: boolean + }): Promise> + + async function getAllPages({ + config: cfg, + preview, + }: { + url?: string + config?: Partial + preview?: boolean + } = {}): Promise { + const config = commerce.getConfig(cfg) + const { locale, fetch } = config + const data = await fetch('content', 'list', ['pages']) + const pages = + data?.results?.map(({ slug, ...rest }: { slug: string }) => ({ + url: `/${locale}/${slug}`, + ...rest, + })) ?? [] + return { + pages, + } + } + + return getAllPages +} diff --git a/packages/swell/src/api/operations/get-all-product-paths.ts b/packages/swell/src/api/operations/get-all-product-paths.ts new file mode 100644 index 0000000..1e50886 --- /dev/null +++ b/packages/swell/src/api/operations/get-all-product-paths.ts @@ -0,0 +1,51 @@ +import { SwellProduct } from '../../types' +import { SwellConfig, Provider } from '..' +import { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import { GetAllProductPathsOperation } from '@vercel/commerce/types/product' + +export default function getAllProductPathsOperation({ + commerce, +}: OperationContext) { + async function getAllProductPaths< + T extends GetAllProductPathsOperation + >(opts?: { + variables?: T['variables'] + config?: SwellConfig + }): Promise + + async function getAllProductPaths( + opts: { + variables?: T['variables'] + config?: SwellConfig + } & OperationOptions + ): Promise + + async function getAllProductPaths({ + variables, + config: cfg, + }: { + query?: string + variables?: T['variables'] + config?: SwellConfig + } = {}): Promise { + const config = commerce.getConfig(cfg) + // RecursivePartial forces the method to check for every prop in the data, which is + // required in case there's a custom `query` + const { results } = await config.fetch('products', 'list', [ + { + limit: variables?.first, + }, + ]) + + return { + products: results?.map(({ slug: handle }: SwellProduct) => ({ + path: `/${handle}`, + })), + } + } + + return getAllProductPaths +} diff --git a/packages/swell/src/api/operations/get-all-products.ts b/packages/swell/src/api/operations/get-all-products.ts new file mode 100644 index 0000000..6527fb9 --- /dev/null +++ b/packages/swell/src/api/operations/get-all-products.ts @@ -0,0 +1,43 @@ +import { normalizeProduct } from '../../utils/normalize' +import { SwellProduct } from '../../types' +import { Product } from '@vercel/commerce/types/product' +import { Provider, SwellConfig } from '../' +import { OperationContext } from '@vercel/commerce/api/operations' + +export type ProductVariables = { first?: number } + +export default function getAllProductsOperation({ + commerce, +}: OperationContext) { + async function getAllProducts(opts?: { + variables?: ProductVariables + config?: Partial + preview?: boolean + }): Promise<{ products: Product[] }> + + async function getAllProducts({ + config: cfg, + variables = { first: 250 }, + }: { + query?: string + variables?: ProductVariables + config?: Partial + preview?: boolean + } = {}): Promise<{ products: Product[] | any[] }> { + const config = commerce.getConfig(cfg) + const { results } = await config.fetch('products', 'list', [ + { + limit: variables.first, + }, + ]) + const products = results.map((product: SwellProduct) => + normalizeProduct(product) + ) + + return { + products, + } + } + + return getAllProducts +} diff --git a/packages/swell/src/api/operations/get-page.ts b/packages/swell/src/api/operations/get-page.ts new file mode 100644 index 0000000..7e71f75 --- /dev/null +++ b/packages/swell/src/api/operations/get-page.ts @@ -0,0 +1,57 @@ +import { Page } from '../../../schema' +import { SwellConfig, Provider } from '..' +import { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import { GetPageOperation } from '../../types/page' + +export type GetPageResult = T + +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({ + variables, + config, + }: { + query?: string + variables: T['variables'] + config?: Partial + preview?: boolean + }): Promise { + const { fetch, locale = 'en-US' } = commerce.getConfig(config) + const id = variables.id + const result = await fetch('content', 'get', ['pages', id]) + const page = result + + return { + page: page + ? { + ...page, + url: `/${locale}/${page.slug}`, + } + : null, + } + } + + return getPage +} diff --git a/packages/swell/src/api/operations/get-product.ts b/packages/swell/src/api/operations/get-product.ts new file mode 100644 index 0000000..fff6257 --- /dev/null +++ b/packages/swell/src/api/operations/get-product.ts @@ -0,0 +1,33 @@ +import { normalizeProduct } from '../../utils' + +import { Product } from '@vercel/commerce/types/product' +import { OperationContext } from '@vercel/commerce/api/operations' +import { Provider, SwellConfig } from '../' + +export default function getProductOperation({ + commerce, +}: OperationContext) { + async function getProduct({ + variables, + config: cfg, + }: { + query?: string + variables: { slug: string } + config?: Partial + preview?: boolean + }): Promise { + const config = commerce.getConfig(cfg) + + const product = await config.fetch('products', 'get', [variables.slug]) + + if (product && product.variants) { + product.variants = product.variants?.results + } + + return { + product: product ? normalizeProduct(product) : null, + } + } + + return getProduct +} diff --git a/packages/swell/src/api/operations/get-site-info.ts b/packages/swell/src/api/operations/get-site-info.ts new file mode 100644 index 0000000..88386ad --- /dev/null +++ b/packages/swell/src/api/operations/get-site-info.ts @@ -0,0 +1,37 @@ +import getCategories from '../../utils/get-categories' +import getVendors, { Brands } from '../../utils/get-vendors' +import { Provider, SwellConfig } from '../' +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[] } = { + categories: Category[] + brands: Brands + } +> = T + +export default function getSiteInfoOperation({ + commerce, +}: OperationContext) { + async function getSiteInfo({ + variables, + config: cfg, + }: { + query?: string + variables?: any + config?: Partial + preview?: boolean + } = {}): Promise { + const config = commerce.getConfig(cfg) + const categories = await getCategories(config) + const brands = await getVendors(config) + + return { + categories, + brands, + } + } + + return getSiteInfo +} diff --git a/packages/swell/src/api/operations/login.ts b/packages/swell/src/api/operations/login.ts new file mode 100644 index 0000000..44ff37a --- /dev/null +++ b/packages/swell/src/api/operations/login.ts @@ -0,0 +1,46 @@ +import type { ServerResponse } from 'http' +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import type { LoginOperation } from '../../types/login' +import { Provider, SwellConfig } from '..' + +export default function loginOperation({ + commerce, +}: OperationContext) { + async function login(opts: { + variables: T['variables'] + config?: Partial + res: ServerResponse + }): Promise + + async function login( + opts: { + variables: T['variables'] + config?: Partial + res: ServerResponse + } & OperationOptions + ): Promise + + async function login({ + variables, + res: response, + config: cfg, + }: { + query?: string + variables: T['variables'] + res: ServerResponse + config?: Partial + }): Promise { + const config = commerce.getConfig(cfg) + + const { data } = await config.fetch('account', 'login', [variables]) + + return { + result: data, + } + } + + return login +} diff --git a/packages/swell/src/api/utils/fetch-swell-api.ts b/packages/swell/src/api/utils/fetch-swell-api.ts new file mode 100644 index 0000000..83055c5 --- /dev/null +++ b/packages/swell/src/api/utils/fetch-swell-api.ts @@ -0,0 +1,7 @@ +import swell from '../../swell' + +const fetchApi = async (query: string, method: string, variables: [] = []) => { + return swell[query][method](...variables) +} + +export default fetchApi diff --git a/packages/swell/src/api/utils/fetch.ts b/packages/swell/src/api/utils/fetch.ts new file mode 100644 index 0000000..0b83671 --- /dev/null +++ b/packages/swell/src/api/utils/fetch.ts @@ -0,0 +1,2 @@ +import zeitFetch from '@vercel/fetch' +export default zeitFetch() diff --git a/packages/swell/src/api/utils/is-allowed-method.ts b/packages/swell/src/api/utils/is-allowed-method.ts new file mode 100644 index 0000000..78bbba5 --- /dev/null +++ b/packages/swell/src/api/utils/is-allowed-method.ts @@ -0,0 +1,28 @@ +import type { NextApiRequest, NextApiResponse } from 'next' + +export default function isAllowedMethod( + req: NextApiRequest, + res: NextApiResponse, + allowedMethods: string[] +) { + const methods = allowedMethods.includes('OPTIONS') + ? allowedMethods + : [...allowedMethods, 'OPTIONS'] + + if (!req.method || !methods.includes(req.method)) { + res.status(405) + res.setHeader('Allow', methods.join(', ')) + res.end() + return false + } + + if (req.method === 'OPTIONS') { + res.status(200) + res.setHeader('Allow', methods.join(', ')) + res.setHeader('Content-Length', '0') + res.end() + return false + } + + return true +} diff --git a/packages/swell/src/api/wishlist/index.tsx b/packages/swell/src/api/wishlist/index.tsx new file mode 100644 index 0000000..a728566 --- /dev/null +++ b/packages/swell/src/api/wishlist/index.tsx @@ -0,0 +1,2 @@ +export type WishlistItem = { product: any; id: number } +export default function () {} diff --git a/packages/swell/src/auth/use-login.tsx b/packages/swell/src/auth/use-login.tsx new file mode 100644 index 0000000..b3fe9f5 --- /dev/null +++ b/packages/swell/src/auth/use-login.tsx @@ -0,0 +1,76 @@ +import { useCallback } from 'react' +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 '@vercel/commerce/auth/use-login' +import { LoginHook } from '../types/login' +import { setCustomerToken } from '../utils' + +export default useLogin as UseLogin + +const getErrorMessage = ({ code, message }: CustomerUserError) => { + switch (code) { + case 'UNIDENTIFIED_CUSTOMER': + message = 'Cannot find an account that matches the provided credentials' + break + } + return message +} + +export const handler: MutationHook = { + fetchOptions: { + query: 'account', + method: 'login', + }, + async fetcher({ input: { email, password }, options, fetch }) { + if (!(email && password)) { + throw new CommerceError({ + message: + 'A first name, last name, email and password are required to login', + }) + } + + const { customerAccessTokenCreate } = await fetch< + Mutation, + MutationCheckoutCreateArgs + >({ + ...options, + variables: [email, password], + }) + + const errors = customerAccessTokenCreate?.customerUserErrors + + if (errors && errors.length) { + throw new ValidationError({ + message: getErrorMessage(errors[0]), + }) + } + const customerAccessToken = customerAccessTokenCreate?.customerAccessToken + const accessToken = customerAccessToken?.accessToken + + if (accessToken) { + setCustomerToken(accessToken) + } + + return null + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCustomer() + + return useCallback( + async function login(input) { + const data = await fetch({ input }) + await mutate() + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/swell/src/auth/use-logout.tsx b/packages/swell/src/auth/use-logout.tsx new file mode 100644 index 0000000..08eec0b --- /dev/null +++ b/packages/swell/src/auth/use-logout.tsx @@ -0,0 +1,39 @@ +import { useCallback } from 'react' +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' + +export default useLogout as UseLogout + +export const handler: MutationHook = { + fetchOptions: { + query: 'account', + method: 'logout', + }, + async fetcher({ options, fetch }) { + await fetch({ + ...options, + variables: { + customerAccessToken: getCustomerToken(), + }, + }) + setCustomerToken(null) + return null + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCustomer() + + return useCallback( + async function logout() { + const data = await fetch() + await mutate(null, false) + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/swell/src/auth/use-signup.tsx b/packages/swell/src/auth/use-signup.tsx new file mode 100644 index 0000000..581312d --- /dev/null +++ b/packages/swell/src/auth/use-signup.tsx @@ -0,0 +1,61 @@ +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 useCustomer from '../customer/use-customer' +import { SignupHook } from '../types/signup' +import handleLogin from '../utils/handle-login' + +export default useSignup as UseSignup + +export const handler: MutationHook = { + fetchOptions: { + query: 'account', + method: 'create', + }, + 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', + }) + } + const data = await fetch({ + ...options, + variables: { + first_name: firstName, + last_name: lastName, + email, + password, + }, + }) + + try { + const loginData = await fetch({ + query: 'account', + method: 'login', + variables: [email, password], + }) + handleLogin(loginData) + } catch (error) {} + return data + }, + 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/packages/swell/src/cart/index.ts b/packages/swell/src/cart/index.ts new file mode 100644 index 0000000..3d288b1 --- /dev/null +++ b/packages/swell/src/cart/index.ts @@ -0,0 +1,3 @@ +export { default as useCart } from './use-cart' +export { default as useAddItem } from './use-add-item' +export { default as useRemoveItem } from './use-remove-item' diff --git a/packages/swell/src/cart/use-add-item.tsx b/packages/swell/src/cart/use-add-item.tsx new file mode 100644 index 0000000..048a1f4 --- /dev/null +++ b/packages/swell/src/cart/use-add-item.tsx @@ -0,0 +1,61 @@ +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' +import { useCallback } from 'react' +import { AddItemHook } from '../types/cart' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: 'cart', + method: 'addItem', + }, + 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 variables: { + product_id: string | undefined + variant_id?: string + checkoutId?: string + quantity?: number + } = { + checkoutId: getCheckoutId(), + product_id: item.productId, + quantity: item.quantity, + } + if (item.productId !== item.variantId) { + variables.variant_id = item.variantId + } + + const response = await fetch({ + ...options, + variables, + }) + + return checkoutToCart(response) as any + }, + 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/swell/src/cart/use-cart.tsx b/packages/swell/src/cart/use-cart.tsx new file mode 100644 index 0000000..5842d1e --- /dev/null +++ b/packages/swell/src/cart/use-cart.tsx @@ -0,0 +1,39 @@ +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 '@vercel/commerce/types/cart' + +export default useCart as UseCart + +export const handler: SWRHook = { + fetchOptions: { + query: 'cart', + method: 'get', + }, + async fetcher({ fetch }) { + const cart = await checkoutCreate(fetch) + + return cart ? normalizeCart(cart) : null + }, + 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/swell/src/cart/use-remove-item.tsx b/packages/swell/src/cart/use-remove-item.tsx new file mode 100644 index 0000000..6e51165 --- /dev/null +++ b/packages/swell/src/cart/use-remove-item.tsx @@ -0,0 +1,57 @@ +import { useCallback } from 'react' +import type { + MutationHookContext, + HookFetcherContext, +} from '@vercel/commerce/utils/types' + +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' + +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: { + query: 'cart', + method: 'removeItem', + }, + async fetcher({ + input: { itemId }, + options, + fetch, + }: HookFetcherContext) { + const response = await fetch({ ...options, variables: [itemId] }) + + return checkoutToCart(response) + }, + useHook: + ({ fetch }: MutationHookContext) => + () => { + const { mutate } = useCart() + + return useCallback( + async function removeItem(input) { + const data = await fetch({ input: { itemId: input.id } }) + await mutate(data, false) + + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/swell/src/cart/use-update-item.tsx b/packages/swell/src/cart/use-update-item.tsx new file mode 100644 index 0000000..c741250 --- /dev/null +++ b/packages/swell/src/cart/use-update-item.tsx @@ -0,0 +1,101 @@ +import { useCallback } from 'react' +import debounce from 'lodash.debounce' +import type { + HookFetcherContext, + MutationHook, + MutationHookContext, +} from '@vercel/commerce/utils/types' +import { ValidationError } from '@vercel/commerce/utils/errors' +// import useUpdateItem, { +// UpdateItemInput as UpdateItemInputBase, +// UseUpdateItem, +// } 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 '@vercel/commerce/types/cart' +import { checkoutToCart } from './utils' +import { UpdateItemHook } from '../types/cart' +// export type UpdateItemInput = T extends LineItem +// ? Partial> +// : UpdateItemInputBase + +export default useUpdateItem as UseUpdateItem + +export type UpdateItemActionInput = T extends LineItem + ? Partial + : UpdateItemHook['actionInput'] + +export const handler = { + fetchOptions: { + query: 'cart', + method: 'updateItem', + }, + 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', + }) + } + const response = await fetch({ + ...options, + variables: [itemId, { quantity: item.quantity }], + }) + + return checkoutToCart(response) + }, + useHook: + ({ fetch }: MutationHookContext) => + ( + ctx: { + item?: T + wait?: number + } = {} + ) => { + const { item } = ctx + const { mutate, data: cartData } = useCart() as any + + return useCallback( + debounce(async (input: UpdateItemActionInput) => { + const firstLineItem = cartData.lineItems[0] + const itemId = item?.id || firstLineItem.id + const productId = item?.productId || firstLineItem.productId + const variantId = item?.variant.id || firstLineItem.variant.id + if (!itemId || !productId) { + throw new ValidationError({ + message: 'Invalid input used for this operation', + }) + } + + const data = await fetch({ + input: { + item: { + productId, + variantId, + quantity: input.quantity, + }, + itemId, + }, + }) + await mutate(data, false) + return data + }, ctx.wait ?? 500), + [fetch, mutate] + ) + }, +} diff --git a/packages/swell/src/cart/utils/checkout-create.ts b/packages/swell/src/cart/utils/checkout-create.ts new file mode 100644 index 0000000..a4b82d8 --- /dev/null +++ b/packages/swell/src/cart/utils/checkout-create.ts @@ -0,0 +1,28 @@ +import { SWELL_CHECKOUT_URL_COOKIE } from '../../const' + +import Cookies from 'js-cookie' + +export const checkoutCreate = async (fetch: any) => { + const cart = await fetch({ + query: 'cart', + method: 'get', + }) + + if (!cart) { + await fetch({ + query: 'cart', + method: 'setItems', + variables: [[]], + }) + } + + const checkoutUrl = cart?.checkout_url + + if (checkoutUrl) { + Cookies.set(SWELL_CHECKOUT_URL_COOKIE, checkoutUrl) + } + + return cart +} + +export default checkoutCreate diff --git a/packages/swell/src/cart/utils/checkout-to-cart.ts b/packages/swell/src/cart/utils/checkout-to-cart.ts new file mode 100644 index 0000000..c9becb1 --- /dev/null +++ b/packages/swell/src/cart/utils/checkout-to-cart.ts @@ -0,0 +1,26 @@ +import { Cart } from '../../types' +import { CommerceError } from '@vercel/commerce/utils/errors' + +import { + CheckoutLineItemsAddPayload, + CheckoutLineItemsRemovePayload, + CheckoutLineItemsUpdatePayload, + Maybe, +} from '../../../schema' +import { normalizeCart } from '../../utils' + +export type CheckoutPayload = + | CheckoutLineItemsAddPayload + | CheckoutLineItemsUpdatePayload + | CheckoutLineItemsRemovePayload + +const checkoutToCart = (checkoutPayload?: Maybe): Cart => { + if (!checkoutPayload) { + throw new CommerceError({ + message: 'Invalid response from Swell', + }) + } + return normalizeCart(checkoutPayload as any) +} + +export default checkoutToCart diff --git a/packages/swell/src/cart/utils/index.ts b/packages/swell/src/cart/utils/index.ts new file mode 100644 index 0000000..20d0495 --- /dev/null +++ b/packages/swell/src/cart/utils/index.ts @@ -0,0 +1,2 @@ +export { default as checkoutToCart } from './checkout-to-cart' +export { default as checkoutCreate } from './checkout-create' diff --git a/packages/swell/src/checkout/use-checkout.tsx b/packages/swell/src/checkout/use-checkout.tsx new file mode 100644 index 0000000..76997be --- /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/packages/swell/src/commerce.config.json b/packages/swell/src/commerce.config.json new file mode 100644 index 0000000..01c9bf9 --- /dev/null +++ b/packages/swell/src/commerce.config.json @@ -0,0 +1,6 @@ +{ + "provider": "swell", + "features": { + "wishlist": false + } +} diff --git a/packages/swell/src/const.ts b/packages/swell/src/const.ts new file mode 100644 index 0000000..16d4938 --- /dev/null +++ b/packages/swell/src/const.ts @@ -0,0 +1,11 @@ +export const SWELL_CHECKOUT_ID_COOKIE = 'SWELL_checkoutId' + +export const SWELL_CHECKOUT_URL_COOKIE = 'swell_checkoutUrl' + +export const SWELL_CUSTOMER_TOKEN_COOKIE = 'swell_customerToken' + +export const SWELL_COOKIE_EXPIRE = 30 + +export const SWELL_STORE_ID = process.env.NEXT_PUBLIC_SWELL_STORE_ID + +export const SWELL_PUBLIC_KEY = process.env.NEXT_PUBLIC_SWELL_PUBLIC_KEY 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 0000000..4f85c84 --- /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 0000000..77d149e --- /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 0000000..6c903ec --- /dev/null +++ b/packages/swell/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/packages/swell/src/customer/use-customer.tsx b/packages/swell/src/customer/use-customer.tsx new file mode 100644 index 0000000..0875310 --- /dev/null +++ b/packages/swell/src/customer/use-customer.tsx @@ -0,0 +1,31 @@ +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' + +export default useCustomer as UseCustomer + +export const handler: SWRHook = { + fetchOptions: { + query: 'account', + method: 'get', + }, + async fetcher({ options, fetch }) { + const data = await fetch({ + ...options, + }) + return data ? normalizeCustomer(data) : null + }, + useHook: + ({ useData }) => + (input) => { + return useData({ + swrOptions: { + revalidateOnFocus: false, + ...input?.swrOptions, + }, + }) + }, +} diff --git a/packages/swell/src/fetcher.ts b/packages/swell/src/fetcher.ts new file mode 100644 index 0000000..1d50bf5 --- /dev/null +++ b/packages/swell/src/fetcher.ts @@ -0,0 +1,26 @@ +import { Fetcher } from '@vercel/commerce/utils/types' +import { CommerceError } from '@vercel/commerce/utils/errors' +import { handleFetchResponse } from './utils' +import swell from './swell' + +const fetcher: Fetcher = async ({ method = 'get', variables, query }) => { + async function callSwell() { + if (Array.isArray(variables)) { + const arg1 = variables[0] + const arg2 = variables[1] + const response = await swell[query!][method](arg1, arg2) + return handleFetchResponse(response) + } else { + const response = await swell[query!][method](variables) + return handleFetchResponse(response) + } + } + + if (query && query in swell) { + return await callSwell() + } else { + throw new CommerceError({ message: 'Invalid query argument!' }) + } +} + +export default fetcher diff --git a/packages/swell/src/index.tsx b/packages/swell/src/index.tsx new file mode 100644 index 0000000..d88d75c --- /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/packages/swell/src/next.config.cjs b/packages/swell/src/next.config.cjs new file mode 100644 index 0000000..f6ac383 --- /dev/null +++ b/packages/swell/src/next.config.cjs @@ -0,0 +1,8 @@ +const commerce = require('./commerce.config.json') + +module.exports = { + commerce, + images: { + domains: ['cdn.schema.io'], + }, +} diff --git a/packages/swell/src/product/index.ts b/packages/swell/src/product/index.ts new file mode 100644 index 0000000..426a3ed --- /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 0000000..fd42d70 --- /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/packages/swell/src/product/use-search.tsx b/packages/swell/src/product/use-search.tsx new file mode 100644 index 0000000..b996099 --- /dev/null +++ b/packages/swell/src/product/use-search.tsx @@ -0,0 +1,61 @@ +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' + +export default useSearch as UseSearch + +export type SearchProductsInput = { + search?: string + categoryId?: string + brandId?: string + sort?: string +} + +export const handler: SWRHook = { + fetchOptions: { + query: 'products', + method: 'list', + }, + async fetcher({ input, options, fetch }) { + const sortMap = new Map([ + ['latest-desc', ''], + ['price-asc', 'price_asc'], + ['price-desc', 'price_desc'], + ['trending-desc', 'popularity'], + ]) + const { categoryId, search, sort = 'latest-desc' } = input + const mappedSort = sortMap.get(sort) + const { results, count: found } = await fetch({ + query: 'products', + method: 'list', + variables: { category: categoryId, search, sort: mappedSort }, + }) + + const products = results.map((product: SwellProduct) => + normalizeProduct(product) + ) + + return { + products, + found, + } + }, + 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/swell/src/provider.ts b/packages/swell/src/provider.ts new file mode 100644 index 0000000..afe07dc --- /dev/null +++ b/packages/swell/src/provider.ts @@ -0,0 +1,30 @@ +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' +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 fetcher from './fetcher' +import swell from './swell' + +export const swellProvider: Provider & { swell: any } = { + locale: 'en-us', + cartCookie: SWELL_CHECKOUT_ID_COOKIE, + swell, + fetcher, + cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, + customer: { useCustomer }, + products: { useSearch }, + auth: { useLogin, useLogout, useSignup }, +} + +export type SwellProvider = typeof swellProvider diff --git a/packages/swell/src/swell.ts b/packages/swell/src/swell.ts new file mode 100644 index 0000000..eb49ce5 --- /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/packages/swell/src/types.ts b/packages/swell/src/types.ts new file mode 100644 index 0000000..b02bbd8 --- /dev/null +++ b/packages/swell/src/types.ts @@ -0,0 +1,112 @@ +import * as Core from '@vercel/commerce/types/cart' +import { Customer } from '@vercel/commerce/types' +import { CheckoutLineItem } from '../schema' + +export type SwellImage = { + file: { + url: String + height: Number + width: Number + } + id: string +} + +export type CartLineItem = { + id: string + product: SwellProduct + price: number + variant: { + name: string | null + sku: string | null + id: string + } + quantity: number +} + +export type SwellCart = { + id: string + account_id: number + currency: string + tax_included_total: number + sub_total: number + grand_total: number + discount_total: number + quantity: number + items: CartLineItem[] + date_created: string + discounts?: { id: number; amount: number }[] | null + // TODO: add missing fields +} + +export type SwellVariant = { + id: string + option_value_ids: string[] + name: string + price?: number + stock_status?: string + __type?: 'MultipleChoiceOption' | undefined +} + +export interface SwellProductOptionValue { + id: string + label: string + hexColors?: string[] +} + +export interface ProductOptionValue { + label: string + hexColors?: string[] +} + +export type ProductOptions = { + id: string + name: string + variant: boolean + values: ProductOptionValue[] + required: boolean + active: boolean + attribute_id: string +} + +export interface SwellProduct { + id: string + description: string + name: string + slug: string + currency: string + price: number + images: any[] + options: any[] + variants: any[] +} + +export type SwellCustomer = any + +export type SwellCheckout = { + id: string + webUrl: string + lineItems: CheckoutLineItem[] +} + +export interface Cart extends Core.Cart { + id: string + lineItems: LineItem[] +} + +export interface LineItem extends Core.LineItem { + options?: any[] +} + +/** + * Cart mutations + */ + +export type OptionSelections = { + option_id: number + option_value: number | string +} + +export type CartItemBody = Core.CartItemBody & { + productId: string // The product id is always required for BC + optionSelections?: OptionSelections +} diff --git a/packages/swell/src/types/cart.ts b/packages/swell/src/types/cart.ts new file mode 100644 index 0000000..e6838fb --- /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 0000000..d139db6 --- /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 0000000..23b8daa --- /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 0000000..c637055 --- /dev/null +++ b/packages/swell/src/types/customer.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/customer' diff --git a/packages/swell/src/types/index.ts b/packages/swell/src/types/index.ts new file mode 100644 index 0000000..7ab0b7f --- /dev/null +++ b/packages/swell/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/swell/src/types/login.ts b/packages/swell/src/types/login.ts new file mode 100644 index 0000000..44b017d --- /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 0000000..1de06f8 --- /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 0000000..12f6b02 --- /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 0000000..72ca02f --- /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 0000000..3f0d1af --- /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 0000000..96a2e47 --- /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 0000000..af92d9f --- /dev/null +++ b/packages/swell/src/types/wishlist.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/wishlist' diff --git a/packages/swell/src/utils/customer-token.ts b/packages/swell/src/utils/customer-token.ts new file mode 100644 index 0000000..63bd51b --- /dev/null +++ b/packages/swell/src/utils/customer-token.ts @@ -0,0 +1,21 @@ +import Cookies, { CookieAttributes } from 'js-cookie' +import { SWELL_COOKIE_EXPIRE, SWELL_CUSTOMER_TOKEN_COOKIE } from '../const' + +export const getCustomerToken = () => Cookies.get(SWELL_CUSTOMER_TOKEN_COOKIE) + +export const setCustomerToken = ( + token: string | null, + options?: CookieAttributes +) => { + if (!token) { + Cookies.remove(SWELL_CUSTOMER_TOKEN_COOKIE) + } else { + Cookies.set( + SWELL_CUSTOMER_TOKEN_COOKIE, + token, + options ?? { + expires: SWELL_COOKIE_EXPIRE, + } + ) + } +} diff --git a/packages/swell/src/utils/get-categories.ts b/packages/swell/src/utils/get-categories.ts new file mode 100644 index 0000000..ab38bae --- /dev/null +++ b/packages/swell/src/utils/get-categories.ts @@ -0,0 +1,16 @@ +import { SwellConfig } from '../api' +import { Category } from '../types/site' + +const getCategories = async (config: SwellConfig): Promise => { + const data = await config.fetch('categories', 'get') + return ( + data.results.map(({ id, name, slug }: any) => ({ + id, + name, + slug, + path: `/${slug}`, + })) ?? [] + ) +} + +export default getCategories diff --git a/packages/swell/src/utils/get-checkout-id.ts b/packages/swell/src/utils/get-checkout-id.ts new file mode 100644 index 0000000..07643f4 --- /dev/null +++ b/packages/swell/src/utils/get-checkout-id.ts @@ -0,0 +1,8 @@ +import Cookies from 'js-cookie' +import { SWELL_CHECKOUT_ID_COOKIE } from '../const' + +const getCheckoutId = (id?: string) => { + return id ?? Cookies.get(SWELL_CHECKOUT_ID_COOKIE) +} + +export default getCheckoutId diff --git a/packages/swell/src/utils/get-search-variables.ts b/packages/swell/src/utils/get-search-variables.ts new file mode 100644 index 0000000..c1b40ae --- /dev/null +++ b/packages/swell/src/utils/get-search-variables.ts @@ -0,0 +1,27 @@ +import getSortVariables from './get-sort-variables' +import type { SearchProductsInput } from '../product/use-search' + +export const getSearchVariables = ({ + brandId, + search, + categoryId, + sort, +}: SearchProductsInput) => { + let query = '' + + if (search) { + query += `product_type:${search} OR title:${search} OR tag:${search}` + } + + if (brandId) { + query += `${search ? ' AND ' : ''}vendor:${brandId}` + } + + return { + categoryId, + query, + ...getSortVariables(sort, !!categoryId), + } +} + +export default getSearchVariables diff --git a/packages/swell/src/utils/get-sort-variables.ts b/packages/swell/src/utils/get-sort-variables.ts new file mode 100644 index 0000000..b8cdeec --- /dev/null +++ b/packages/swell/src/utils/get-sort-variables.ts @@ -0,0 +1,32 @@ +const getSortVariables = (sort?: string, isCategory = false) => { + let output = {} + switch (sort) { + case 'price-asc': + output = { + sortKey: 'PRICE', + reverse: false, + } + break + case 'price-desc': + output = { + sortKey: 'PRICE', + reverse: true, + } + break + case 'trending-desc': + output = { + sortKey: 'BEST_SELLING', + reverse: false, + } + break + case 'latest-desc': + output = { + sortKey: isCategory ? 'CREATED' : 'CREATED_AT', + reverse: true, + } + break + } + return output +} + +export default getSortVariables diff --git a/packages/swell/src/utils/get-vendors.ts b/packages/swell/src/utils/get-vendors.ts new file mode 100644 index 0000000..1ede688 --- /dev/null +++ b/packages/swell/src/utils/get-vendors.ts @@ -0,0 +1,27 @@ +import { SwellConfig } from '../api' + +export type BrandNode = { + name: string + path: string +} + +export type BrandEdge = { + node: BrandNode +} + +export type Brands = BrandEdge[] + +const getVendors = async (config: SwellConfig) => { + const vendors: [string] = + (await config.fetch('attributes', 'get', ['brand']))?.values ?? [] + + return [...new Set(vendors)].map((v) => ({ + node: { + entityId: v, + name: v, + path: `brands/${v}`, + }, + })) +} + +export default getVendors diff --git a/packages/swell/src/utils/handle-fetch-response.ts b/packages/swell/src/utils/handle-fetch-response.ts new file mode 100644 index 0000000..d120cab --- /dev/null +++ b/packages/swell/src/utils/handle-fetch-response.ts @@ -0,0 +1,19 @@ +import { CommerceError } from '@vercel/commerce/utils/errors' + +type SwellFetchResponse = { + error: { + message: string + code?: string + } +} + +const handleFetchResponse = async (res: SwellFetchResponse) => { + if (res) { + if (res.error) { + throw new CommerceError(res.error) + } + return res + } +} + +export default handleFetchResponse diff --git a/packages/swell/src/utils/handle-login.ts b/packages/swell/src/utils/handle-login.ts new file mode 100644 index 0000000..8628262 --- /dev/null +++ b/packages/swell/src/utils/handle-login.ts @@ -0,0 +1,39 @@ +import { ValidationError } from '@vercel/commerce/utils/errors' +import { setCustomerToken } from './customer-token' + +const getErrorMessage = ({ + code, + message, +}: { + code: string + message: string +}) => { + switch (code) { + case 'UNIDENTIFIED_CUSTOMER': + message = 'Cannot find an account that matches the provided credentials' + break + } + return message +} + +const handleLogin = (data: any) => { + const response = data.customerAccessTokenCreate + const errors = response?.customerUserErrors + + if (errors && errors.length) { + throw new ValidationError({ + message: getErrorMessage(errors[0]), + }) + } + + const customerAccessToken = response?.customerAccessToken + const accessToken = customerAccessToken?.accessToken + + if (accessToken) { + setCustomerToken(accessToken) + } + + return customerAccessToken +} + +export default handleLogin diff --git a/packages/swell/src/utils/index.ts b/packages/swell/src/utils/index.ts new file mode 100644 index 0000000..9ec81bf --- /dev/null +++ b/packages/swell/src/utils/index.ts @@ -0,0 +1,9 @@ +export { default as handleFetchResponse } from './handle-fetch-response' +export { default as getSearchVariables } from './get-search-variables' +export { default as getSortVariables } from './get-sort-variables' +export { default as getVendors } from './get-vendors' +export { default as getCategories } from './get-categories' +export { default as getCheckoutId } from './get-checkout-id' + +export * from './normalize' +export * from './customer-token' diff --git a/packages/swell/src/utils/normalize.ts b/packages/swell/src/utils/normalize.ts new file mode 100644 index 0000000..9bbad59 --- /dev/null +++ b/packages/swell/src/utils/normalize.ts @@ -0,0 +1,226 @@ +import { Customer } from '../types/customer' +import { Product, ProductOption } from '../types/product' +import { MoneyV2 } from '../../schema' + +import type { + Cart, + CartLineItem, + SwellCustomer, + SwellProduct, + SwellImage, + SwellVariant, + ProductOptionValue, + SwellProductOptionValue, + SwellCart, + LineItem, +} from '../types' + +const money = ({ amount, currencyCode }: MoneyV2) => { + return { + value: +amount, + currencyCode, + } +} + +type swellProductOption = { + id: string + name: string + values: any[] +} + +type normalizedProductOption = { + id: string + displayName: string + values: ProductOptionValue[] +} + +const normalizeProductOption = ({ + id, + name: displayName = '', + values = [], +}: swellProductOption): ProductOption => { + let returnValues = values.map((value) => { + let output: any = { + label: value.name, + // id: value?.id || id, + } + if (displayName.match(/colou?r/gi)) { + output = { + ...output, + hexColors: [value.name], + } + } + return output + }) + return { + __typename: 'MultipleChoiceOption', + id, + displayName, + values: returnValues, + } +} + +const normalizeProductImages = (images: SwellImage[]) => { + if (!images || images.length < 1) { + return [{ url: '/' }] + } + return images?.map(({ file, ...rest }: SwellImage) => ({ + url: file?.url + '', + height: Number(file?.height), + width: Number(file?.width), + ...rest, + })) +} + +const normalizeProductVariants = ( + variants: SwellVariant[], + productOptions: swellProductOption[] +) => { + return variants?.map( + ({ id, name, price, option_value_ids: optionValueIds = [] }) => { + const values = name + .split(',') + .map((i) => ({ name: i.trim(), label: i.trim() })) + + const options = optionValueIds.map((id) => { + const matchingOption = productOptions.find((option) => { + return option.values.find( + (value: SwellProductOptionValue) => value.id == id + ) + }) + return normalizeProductOption({ + id, + name: matchingOption?.name ?? '', + values, + }) + }) + + return { + id, + // name, + // sku: sku ?? id, + // price: price ?? null, + // listPrice: price ?? null, + // requiresShipping: true, + options, + } + } + ) +} + +export function normalizeProduct(swellProduct: SwellProduct): Product { + const { + id, + name, + description, + images, + options, + slug, + variants, + price: value, + currency: currencyCode, + } = swellProduct + // ProductView accesses variants for each product + const emptyVariants = [{ options: [], id, name }] + + const productOptions = options + ? options.map((o) => normalizeProductOption(o)) + : [] + const productVariants = variants + ? normalizeProductVariants(variants, options) + : [] + + const productImages = normalizeProductImages(images) + const product = { + ...swellProduct, + description, + id, + vendor: '', + path: `/${slug}`, + images: productImages, + variants: + productVariants && productVariants.length + ? productVariants + : emptyVariants, + options: productOptions, + price: { + value, + currencyCode, + }, + } + return product +} + +export function normalizeCart({ + id, + account_id, + date_created, + currency, + tax_included_total, + items, + sub_total, + grand_total, + discounts, +}: SwellCart) { + const cart: Cart = { + id: id, + customerId: account_id + '', + email: '', + createdAt: date_created, + currency: { code: currency }, + taxesIncluded: tax_included_total > 0, + lineItems: items?.map(normalizeLineItem) ?? [], + lineItemsSubtotalPrice: +sub_total, + subtotalPrice: +sub_total, + totalPrice: grand_total, + discounts: discounts?.map((discount) => ({ value: discount.amount })), + } + return cart +} + +export function normalizeCustomer(customer: SwellCustomer): Customer { + const { first_name: firstName, last_name: lastName } = customer + return { + ...customer, + firstName, + lastName, + } +} + +function normalizeLineItem({ + id, + product, + price, + variant, + quantity, +}: CartLineItem): LineItem { + const item = { + id, + variantId: variant?.id, + productId: product.id ?? '', + name: product?.name ?? '', + quantity, + variant: { + id: variant?.id ?? '', + sku: variant?.sku ?? '', + name: variant?.name!, + image: { + url: + product?.images && product.images.length > 0 + ? product?.images[0].file.url + : '/', + }, + requiresShipping: false, + price: price, + listPrice: price, + }, + path: '', + discounts: [], + options: [ + { + value: variant?.name, + }, + ], + } + return item +} diff --git a/packages/swell/src/utils/storage.ts b/packages/swell/src/utils/storage.ts new file mode 100644 index 0000000..d46dadb --- /dev/null +++ b/packages/swell/src/utils/storage.ts @@ -0,0 +1,13 @@ +export const getCheckoutIdFromStorage = (token: string) => { + if (window && window.sessionStorage) { + return window.sessionStorage.getItem(token) + } + + return null +} + +export const setCheckoutIdInStorage = (token: string, id: string | number) => { + if (window && window.sessionStorage) { + return window.sessionStorage.setItem(token, id + '') + } +} 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 0000000..75f067c --- /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 0000000..a2d3a8a --- /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/packages/swell/src/wishlist/use-wishlist.tsx b/packages/swell/src/wishlist/use-wishlist.tsx new file mode 100644 index 0000000..0506ae9 --- /dev/null +++ b/packages/swell/src/wishlist/use-wishlist.tsx @@ -0,0 +1,46 @@ +// TODO: replace this hook and other wishlist hooks with a handler, or remove them if +// Swell doesn't have a wishlist + +import { HookFetcher } from '@vercel/commerce/utils/types' +import { Product } from '../../schema' + +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/swell/taskfile.js b/packages/swell/taskfile.js new file mode 100644 index 0000000..39b1b2a --- /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 0000000..cd04ab2 --- /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 0000000..a4fb43a --- /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 0000000..1a91b5b --- /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 0000000..26fcad5 --- /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/packages/vendure/.env.template b/packages/vendure/.env.template new file mode 100644 index 0000000..0935d8b --- /dev/null +++ b/packages/vendure/.env.template @@ -0,0 +1,4 @@ +COMMERCE_PROVIDER=@vercel/commerce-vendure + +NEXT_PUBLIC_VENDURE_SHOP_API_URL=http://localhost:3000/shop-api +NEXT_PUBLIC_VENDURE_LOCAL_URL=/vendure-shop-api diff --git a/packages/vendure/.prettierignore b/packages/vendure/.prettierignore new file mode 100644 index 0000000..f06235c --- /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 0000000..e1076ed --- /dev/null +++ b/packages/vendure/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/packages/vendure/README.md b/packages/vendure/README.md new file mode 100644 index 0000000..485125c --- /dev/null +++ b/packages/vendure/README.md @@ -0,0 +1,37 @@ +# Vendure Storefront Data Hooks + +UI hooks and data fetching methods built from the ground up for e-commerce applications written in React, that use [Vendure](http://vendure.io/) as a headless e-commerce platform. + +## Usage + +1. Clone this repo and install its dependencies with `yarn install` or `npm install` +2. Set the Vendure provider and API URL in your `.env.local` file: + ``` + COMMERCE_PROVIDER=vendure + NEXT_PUBLIC_VENDURE_SHOP_API_URL=https://demo.vendure.io/shop-api + NEXT_PUBLIC_VENDURE_LOCAL_URL=/vendure-shop-api + ``` +3. With the Vendure server running, start this project using `yarn dev` or `npm run dev`. + +**Note:** The Vendure server needs to be configured to use the "cookie" tokenMethod rather than "bearer" to work with this provider. For more information see the [Managing Sessions docs](https://www.vendure.io/docs/storefront/managing-sessions/). + +## Known Limitations + +1. Vendure does not ship with built-in wishlist functionality. +2. Nor does it come with any kind of blog/page-building feature. Both of these can be created as Vendure plugins, however. +3. The entire Vendure customer flow is carried out via its GraphQL API. This means that there is no external, pre-existing checkout flow. The checkout flow must be created as part of the Next.js app. See https://github.com/vercel/commerce/issues/64 for further discusion. +4. By default, the sign-up flow in Vendure uses email verification. This means that using the existing "sign up" flow from this project will not grant a new user the ability to authenticate, since the new account must first be verified. Again, the necessary parts to support this flow can be created as part of the Next.js app. + +## Code generation + +This provider makes use of GraphQL code generation. The [schema.graphql](./schema.graphql) and [schema.d.ts](./schema.d.ts) files contain the generated types & schema introspection results. + +When developing the provider, changes to any GraphQL operations should be followed by re-generation of the types and schema files: + +From the package dir, run + +```sh +yarn generate +# or +npm run generate +``` diff --git a/packages/vendure/codegen.json b/packages/vendure/codegen.json new file mode 100644 index 0000000..8c84d29 --- /dev/null +++ b/packages/vendure/codegen.json @@ -0,0 +1,28 @@ +{ + "schema": { + "http://localhost:3001/shop-api": {} + }, + "documents": [ + { + "./src/**/*.{ts,tsx}": { + "noRequire": true + } + } + ], + "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/vendure/package.json b/packages/vendure/package.json new file mode 100644 index 0000000..484a527 --- /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/packages/vendure/schema.d.ts b/packages/vendure/schema.d.ts new file mode 100644 index 0000000..9d6b53c --- /dev/null +++ b/packages/vendure/schema.d.ts @@ -0,0 +1,3257 @@ +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 `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ + JSON: any + /** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */ + DateTime: any + /** The `Upload` scalar type represents a file upload. */ + Upload: any +} + +export type Query = { + __typename?: 'Query' + /** The active Channel */ + activeChannel: Channel + /** The active Customer */ + activeCustomer?: Maybe + /** + * The active Order. Will be `null` until an Order is created via `addItemToOrder`. Once an Order reaches the + * state of `PaymentApproved` or `PaymentSettled`, then that Order is no longer considered "active" and this + * query will once again return `null`. + */ + activeOrder?: Maybe + /** An array of supported Countries */ + availableCountries: Array + /** A list of Collections available to the shop */ + collections: CollectionList + /** Returns a Collection either by its id or slug. If neither 'id' nor 'slug' is speicified, an error will result. */ + collection?: Maybe + /** Returns a list of eligible shipping methods based on the current active Order */ + eligibleShippingMethods: Array + /** Returns a list of payment methods and their eligibility based on the current active Order */ + eligiblePaymentMethods: Array + /** Returns information about the current authenticated User */ + me?: Maybe + /** Returns the possible next states that the activeOrder can transition to */ + nextOrderStates: Array + /** + * Returns an Order based on the id. Note that in the Shop API, only orders belonging to the + * currently-authenticated User may be queried. + */ + order?: Maybe + /** + * Returns an Order based on the order `code`. For guest Orders (i.e. Orders placed by non-authenticated Customers) + * this query will only return the Order within 2 hours of the Order being placed. This allows an Order confirmation + * screen to be shown immediately after completion of a guest checkout, yet prevents security risks of allowing + * general anonymous access to Order data. + */ + orderByCode?: Maybe + /** Get a Product either by id or slug. If neither 'id' nor 'slug' is speicified, an error will result. */ + product?: Maybe + /** Get a list of Products */ + products: ProductList + /** Search Products based on the criteria set by the `SearchInput` */ + search: SearchResponse +} + +export type QueryCollectionsArgs = { + options?: Maybe +} + +export type QueryCollectionArgs = { + id?: Maybe + slug?: Maybe +} + +export type QueryOrderArgs = { + id: Scalars['ID'] +} + +export type QueryOrderByCodeArgs = { + code: Scalars['String'] +} + +export type QueryProductArgs = { + id?: Maybe + slug?: Maybe +} + +export type QueryProductsArgs = { + options?: Maybe +} + +export type QuerySearchArgs = { + input: SearchInput +} + +export type Mutation = { + __typename?: 'Mutation' + /** Adds an item to the order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available. */ + addItemToOrder: UpdateOrderItemsResult + /** Remove an OrderLine from the Order */ + removeOrderLine: RemoveOrderItemsResult + /** Remove all OrderLine from the Order */ + removeAllOrderLines: RemoveOrderItemsResult + /** Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available. */ + adjustOrderLine: UpdateOrderItemsResult + /** Applies the given coupon code to the active Order */ + applyCouponCode: ApplyCouponCodeResult + /** Removes the given coupon code from the active Order */ + removeCouponCode?: Maybe + /** Transitions an Order to a new state. Valid next states can be found by querying `nextOrderStates` */ + transitionOrderToState?: Maybe + /** Sets the shipping address for this order */ + setOrderShippingAddress: ActiveOrderResult + /** Sets the billing address for this order */ + setOrderBillingAddress: ActiveOrderResult + /** Allows any custom fields to be set for the active order */ + setOrderCustomFields: ActiveOrderResult + /** Sets the shipping method by id, which can be obtained with the `eligibleShippingMethods` query */ + setOrderShippingMethod: SetOrderShippingMethodResult + /** Add a Payment to the Order */ + addPaymentToOrder: AddPaymentToOrderResult + /** Set the Customer for the Order. Required only if the Customer is not currently logged in */ + setCustomerForOrder: SetCustomerForOrderResult + /** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */ + login: NativeAuthenticationResult + /** Authenticates the user using a named authentication strategy */ + authenticate: AuthenticationResult + /** End the current authenticated session */ + logout: Success + /** + * Register a Customer account with the given credentials. There are three possible registration flows: + * + * _If `authOptions.requireVerification` is set to `true`:_ + * + * 1. **The Customer is registered _with_ a password**. A verificationToken will be created (and typically emailed to the Customer). That + * verificationToken would then be passed to the `verifyCustomerAccount` mutation _without_ a password. The Customer is then + * verified and authenticated in one step. + * 2. **The Customer is registered _without_ a password**. A verificationToken will be created (and typically emailed to the Customer). That + * verificationToken would then be passed to the `verifyCustomerAccount` mutation _with_ the chosed password of the Customer. The Customer is then + * verified and authenticated in one step. + * + * _If `authOptions.requireVerification` is set to `false`:_ + * + * 3. The Customer _must_ be registered _with_ a password. No further action is needed - the Customer is able to authenticate immediately. + */ + registerCustomerAccount: RegisterCustomerAccountResult + /** Regenerate and send a verification token for a new Customer registration. Only applicable if `authOptions.requireVerification` is set to true. */ + refreshCustomerVerification: RefreshCustomerVerificationResult + /** Update an existing Customer */ + updateCustomer: Customer + /** Create a new Customer Address */ + createCustomerAddress: Address + /** Update an existing Address */ + updateCustomerAddress: Address + /** Delete an existing Address */ + deleteCustomerAddress: Success + /** + * Verify a Customer email address with the token sent to that address. Only applicable if `authOptions.requireVerification` is set to true. + * + * If the Customer was not registered with a password in the `registerCustomerAccount` mutation, the a password _must_ be + * provided here. + */ + verifyCustomerAccount: VerifyCustomerAccountResult + /** Update the password of the active Customer */ + updateCustomerPassword: UpdateCustomerPasswordResult + /** + * Request to update the emailAddress of the active Customer. If `authOptions.requireVerification` is enabled + * (as is the default), then the `identifierChangeToken` will be assigned to the current User and + * a IdentifierChangeRequestEvent will be raised. This can then be used e.g. by the EmailPlugin to email + * that verification token to the Customer, which is then used to verify the change of email address. + */ + requestUpdateCustomerEmailAddress: RequestUpdateCustomerEmailAddressResult + /** + * Confirm the update of the emailAddress with the provided token, which has been generated by the + * `requestUpdateCustomerEmailAddress` mutation. + */ + updateCustomerEmailAddress: UpdateCustomerEmailAddressResult + /** Requests a password reset email to be sent */ + requestPasswordReset?: Maybe + /** Resets a Customer's password based on the provided token */ + resetPassword: ResetPasswordResult +} + +export type MutationAddItemToOrderArgs = { + productVariantId: Scalars['ID'] + quantity: Scalars['Int'] +} + +export type MutationRemoveOrderLineArgs = { + orderLineId: Scalars['ID'] +} + +export type MutationAdjustOrderLineArgs = { + orderLineId: Scalars['ID'] + quantity: Scalars['Int'] +} + +export type MutationApplyCouponCodeArgs = { + couponCode: Scalars['String'] +} + +export type MutationRemoveCouponCodeArgs = { + couponCode: Scalars['String'] +} + +export type MutationTransitionOrderToStateArgs = { + state: Scalars['String'] +} + +export type MutationSetOrderShippingAddressArgs = { + input: CreateAddressInput +} + +export type MutationSetOrderBillingAddressArgs = { + input: CreateAddressInput +} + +export type MutationSetOrderCustomFieldsArgs = { + input: UpdateOrderInput +} + +export type MutationSetOrderShippingMethodArgs = { + shippingMethodId: Scalars['ID'] +} + +export type MutationAddPaymentToOrderArgs = { + input: PaymentInput +} + +export type MutationSetCustomerForOrderArgs = { + input: CreateCustomerInput +} + +export type MutationLoginArgs = { + username: Scalars['String'] + password: Scalars['String'] + rememberMe?: Maybe +} + +export type MutationAuthenticateArgs = { + input: AuthenticationInput + rememberMe?: Maybe +} + +export type MutationRegisterCustomerAccountArgs = { + input: RegisterCustomerInput +} + +export type MutationRefreshCustomerVerificationArgs = { + emailAddress: Scalars['String'] +} + +export type MutationUpdateCustomerArgs = { + input: UpdateCustomerInput +} + +export type MutationCreateCustomerAddressArgs = { + input: CreateAddressInput +} + +export type MutationUpdateCustomerAddressArgs = { + input: UpdateAddressInput +} + +export type MutationDeleteCustomerAddressArgs = { + id: Scalars['ID'] +} + +export type MutationVerifyCustomerAccountArgs = { + token: Scalars['String'] + password?: Maybe +} + +export type MutationUpdateCustomerPasswordArgs = { + currentPassword: Scalars['String'] + newPassword: Scalars['String'] +} + +export type MutationRequestUpdateCustomerEmailAddressArgs = { + password: Scalars['String'] + newEmailAddress: Scalars['String'] +} + +export type MutationUpdateCustomerEmailAddressArgs = { + token: Scalars['String'] +} + +export type MutationRequestPasswordResetArgs = { + emailAddress: Scalars['String'] +} + +export type MutationResetPasswordArgs = { + token: Scalars['String'] + password: Scalars['String'] +} + +export type Address = Node & { + __typename?: 'Address' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + fullName?: Maybe + company?: Maybe + streetLine1: Scalars['String'] + streetLine2?: Maybe + city?: Maybe + province?: Maybe + postalCode?: Maybe + country: Country + phoneNumber?: Maybe + defaultShippingAddress?: Maybe + defaultBillingAddress?: Maybe + customFields?: Maybe +} + +export type Asset = Node & { + __typename?: 'Asset' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + name: Scalars['String'] + type: AssetType + fileSize: Scalars['Int'] + mimeType: Scalars['String'] + width: Scalars['Int'] + height: Scalars['Int'] + source: Scalars['String'] + preview: Scalars['String'] + focalPoint?: Maybe + customFields?: Maybe +} + +export type Coordinate = { + __typename?: 'Coordinate' + x: Scalars['Float'] + y: Scalars['Float'] +} + +export type AssetList = PaginatedList & { + __typename?: 'AssetList' + items: Array + totalItems: Scalars['Int'] +} + +export enum AssetType { + Image = 'IMAGE', + Video = 'VIDEO', + Binary = 'BINARY', +} + +export type CurrentUser = { + __typename?: 'CurrentUser' + id: Scalars['ID'] + identifier: Scalars['String'] + channels: Array +} + +export type CurrentUserChannel = { + __typename?: 'CurrentUserChannel' + id: Scalars['ID'] + token: Scalars['String'] + code: Scalars['String'] + permissions: Array +} + +export type Channel = Node & { + __typename?: 'Channel' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + code: Scalars['String'] + token: Scalars['String'] + defaultTaxZone?: Maybe + defaultShippingZone?: Maybe + defaultLanguageCode: LanguageCode + currencyCode: CurrencyCode + pricesIncludeTax: Scalars['Boolean'] + customFields?: Maybe +} + +export type Collection = Node & { + __typename?: 'Collection' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode?: Maybe + name: Scalars['String'] + slug: Scalars['String'] + breadcrumbs: Array + position: Scalars['Int'] + description: Scalars['String'] + featuredAsset?: Maybe + assets: Array + parent?: Maybe + children?: Maybe> + filters: Array + translations: Array + productVariants: ProductVariantList + customFields?: Maybe +} + +export type CollectionProductVariantsArgs = { + options?: Maybe +} + +export type CollectionBreadcrumb = { + __typename?: 'CollectionBreadcrumb' + id: Scalars['ID'] + name: Scalars['String'] + slug: Scalars['String'] +} + +export type CollectionTranslation = { + __typename?: 'CollectionTranslation' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + name: Scalars['String'] + slug: Scalars['String'] + description: Scalars['String'] +} + +export type CollectionList = PaginatedList & { + __typename?: 'CollectionList' + items: Array + totalItems: Scalars['Int'] +} + +export type ProductVariantList = PaginatedList & { + __typename?: 'ProductVariantList' + items: Array + totalItems: Scalars['Int'] +} + +export type ProductVariantListOptions = { + skip?: Maybe + take?: Maybe + sort?: Maybe + filter?: Maybe +} + +export enum GlobalFlag { + True = 'TRUE', + False = 'FALSE', + Inherit = 'INHERIT', +} + +export enum AdjustmentType { + Promotion = 'PROMOTION', + DistributedOrderPromotion = 'DISTRIBUTED_ORDER_PROMOTION', +} + +export enum DeletionResult { + /** The entity was successfully deleted */ + Deleted = 'DELETED', + /** Deletion did not take place, reason given in message */ + NotDeleted = 'NOT_DELETED', +} + +/** + * @description + * Permissions for administrators and customers. Used to control access to + * GraphQL resolvers via the {@link Allow} decorator. + * + * @docsCategory common + */ +export enum Permission { + Placeholder = 'Placeholder', + /** Authenticated means simply that the user is logged in */ + Authenticated = 'Authenticated', + /** SuperAdmin has unrestricted access to all operations */ + SuperAdmin = 'SuperAdmin', + /** Owner means the user owns this entity, e.g. a Customer's own Order */ + Owner = 'Owner', + /** Public means any unauthenticated user may perform the operation */ + Public = 'Public', + /** Grants permission to update GlobalSettings */ + UpdateGlobalSettings = 'UpdateGlobalSettings', + /** Grants permission to create Products, Facets, Assets, Collections */ + CreateCatalog = 'CreateCatalog', + /** Grants permission to read Products, Facets, Assets, Collections */ + ReadCatalog = 'ReadCatalog', + /** Grants permission to update Products, Facets, Assets, Collections */ + UpdateCatalog = 'UpdateCatalog', + /** Grants permission to delete Products, Facets, Assets, Collections */ + DeleteCatalog = 'DeleteCatalog', + /** Grants permission to create PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings */ + CreateSettings = 'CreateSettings', + /** Grants permission to read PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings */ + ReadSettings = 'ReadSettings', + /** Grants permission to update PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings */ + UpdateSettings = 'UpdateSettings', + /** Grants permission to delete PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings */ + DeleteSettings = 'DeleteSettings', + /** Grants permission to create Administrator */ + CreateAdministrator = 'CreateAdministrator', + /** Grants permission to read Administrator */ + ReadAdministrator = 'ReadAdministrator', + /** Grants permission to update Administrator */ + UpdateAdministrator = 'UpdateAdministrator', + /** Grants permission to delete Administrator */ + DeleteAdministrator = 'DeleteAdministrator', + /** Grants permission to create Asset */ + CreateAsset = 'CreateAsset', + /** Grants permission to read Asset */ + ReadAsset = 'ReadAsset', + /** Grants permission to update Asset */ + UpdateAsset = 'UpdateAsset', + /** Grants permission to delete Asset */ + DeleteAsset = 'DeleteAsset', + /** Grants permission to create Channel */ + CreateChannel = 'CreateChannel', + /** Grants permission to read Channel */ + ReadChannel = 'ReadChannel', + /** Grants permission to update Channel */ + UpdateChannel = 'UpdateChannel', + /** Grants permission to delete Channel */ + DeleteChannel = 'DeleteChannel', + /** Grants permission to create Collection */ + CreateCollection = 'CreateCollection', + /** Grants permission to read Collection */ + ReadCollection = 'ReadCollection', + /** Grants permission to update Collection */ + UpdateCollection = 'UpdateCollection', + /** Grants permission to delete Collection */ + DeleteCollection = 'DeleteCollection', + /** Grants permission to create Country */ + CreateCountry = 'CreateCountry', + /** Grants permission to read Country */ + ReadCountry = 'ReadCountry', + /** Grants permission to update Country */ + UpdateCountry = 'UpdateCountry', + /** Grants permission to delete Country */ + DeleteCountry = 'DeleteCountry', + /** Grants permission to create Customer */ + CreateCustomer = 'CreateCustomer', + /** Grants permission to read Customer */ + ReadCustomer = 'ReadCustomer', + /** Grants permission to update Customer */ + UpdateCustomer = 'UpdateCustomer', + /** Grants permission to delete Customer */ + DeleteCustomer = 'DeleteCustomer', + /** Grants permission to create CustomerGroup */ + CreateCustomerGroup = 'CreateCustomerGroup', + /** Grants permission to read CustomerGroup */ + ReadCustomerGroup = 'ReadCustomerGroup', + /** Grants permission to update CustomerGroup */ + UpdateCustomerGroup = 'UpdateCustomerGroup', + /** Grants permission to delete CustomerGroup */ + DeleteCustomerGroup = 'DeleteCustomerGroup', + /** Grants permission to create Facet */ + CreateFacet = 'CreateFacet', + /** Grants permission to read Facet */ + ReadFacet = 'ReadFacet', + /** Grants permission to update Facet */ + UpdateFacet = 'UpdateFacet', + /** Grants permission to delete Facet */ + DeleteFacet = 'DeleteFacet', + /** Grants permission to create Order */ + CreateOrder = 'CreateOrder', + /** Grants permission to read Order */ + ReadOrder = 'ReadOrder', + /** Grants permission to update Order */ + UpdateOrder = 'UpdateOrder', + /** Grants permission to delete Order */ + DeleteOrder = 'DeleteOrder', + /** Grants permission to create PaymentMethod */ + CreatePaymentMethod = 'CreatePaymentMethod', + /** Grants permission to read PaymentMethod */ + ReadPaymentMethod = 'ReadPaymentMethod', + /** Grants permission to update PaymentMethod */ + UpdatePaymentMethod = 'UpdatePaymentMethod', + /** Grants permission to delete PaymentMethod */ + DeletePaymentMethod = 'DeletePaymentMethod', + /** Grants permission to create Product */ + CreateProduct = 'CreateProduct', + /** Grants permission to read Product */ + ReadProduct = 'ReadProduct', + /** Grants permission to update Product */ + UpdateProduct = 'UpdateProduct', + /** Grants permission to delete Product */ + DeleteProduct = 'DeleteProduct', + /** Grants permission to create Promotion */ + CreatePromotion = 'CreatePromotion', + /** Grants permission to read Promotion */ + ReadPromotion = 'ReadPromotion', + /** Grants permission to update Promotion */ + UpdatePromotion = 'UpdatePromotion', + /** Grants permission to delete Promotion */ + DeletePromotion = 'DeletePromotion', + /** Grants permission to create ShippingMethod */ + CreateShippingMethod = 'CreateShippingMethod', + /** Grants permission to read ShippingMethod */ + ReadShippingMethod = 'ReadShippingMethod', + /** Grants permission to update ShippingMethod */ + UpdateShippingMethod = 'UpdateShippingMethod', + /** Grants permission to delete ShippingMethod */ + DeleteShippingMethod = 'DeleteShippingMethod', + /** Grants permission to create Tag */ + CreateTag = 'CreateTag', + /** Grants permission to read Tag */ + ReadTag = 'ReadTag', + /** Grants permission to update Tag */ + UpdateTag = 'UpdateTag', + /** Grants permission to delete Tag */ + DeleteTag = 'DeleteTag', + /** Grants permission to create TaxCategory */ + CreateTaxCategory = 'CreateTaxCategory', + /** Grants permission to read TaxCategory */ + ReadTaxCategory = 'ReadTaxCategory', + /** Grants permission to update TaxCategory */ + UpdateTaxCategory = 'UpdateTaxCategory', + /** Grants permission to delete TaxCategory */ + DeleteTaxCategory = 'DeleteTaxCategory', + /** Grants permission to create TaxRate */ + CreateTaxRate = 'CreateTaxRate', + /** Grants permission to read TaxRate */ + ReadTaxRate = 'ReadTaxRate', + /** Grants permission to update TaxRate */ + UpdateTaxRate = 'UpdateTaxRate', + /** Grants permission to delete TaxRate */ + DeleteTaxRate = 'DeleteTaxRate', + /** Grants permission to create System */ + CreateSystem = 'CreateSystem', + /** Grants permission to read System */ + ReadSystem = 'ReadSystem', + /** Grants permission to update System */ + UpdateSystem = 'UpdateSystem', + /** Grants permission to delete System */ + DeleteSystem = 'DeleteSystem', + /** Grants permission to create Zone */ + CreateZone = 'CreateZone', + /** Grants permission to read Zone */ + ReadZone = 'ReadZone', + /** Grants permission to update Zone */ + UpdateZone = 'UpdateZone', + /** Grants permission to delete Zone */ + DeleteZone = 'DeleteZone', +} + +export enum SortOrder { + Asc = 'ASC', + Desc = 'DESC', +} + +export enum ErrorCode { + UnknownError = 'UNKNOWN_ERROR', + NativeAuthStrategyError = 'NATIVE_AUTH_STRATEGY_ERROR', + InvalidCredentialsError = 'INVALID_CREDENTIALS_ERROR', + OrderStateTransitionError = 'ORDER_STATE_TRANSITION_ERROR', + EmailAddressConflictError = 'EMAIL_ADDRESS_CONFLICT_ERROR', + OrderLimitError = 'ORDER_LIMIT_ERROR', + NegativeQuantityError = 'NEGATIVE_QUANTITY_ERROR', + InsufficientStockError = 'INSUFFICIENT_STOCK_ERROR', + OrderModificationError = 'ORDER_MODIFICATION_ERROR', + IneligibleShippingMethodError = 'INELIGIBLE_SHIPPING_METHOD_ERROR', + OrderPaymentStateError = 'ORDER_PAYMENT_STATE_ERROR', + IneligiblePaymentMethodError = 'INELIGIBLE_PAYMENT_METHOD_ERROR', + PaymentFailedError = 'PAYMENT_FAILED_ERROR', + PaymentDeclinedError = 'PAYMENT_DECLINED_ERROR', + CouponCodeInvalidError = 'COUPON_CODE_INVALID_ERROR', + CouponCodeExpiredError = 'COUPON_CODE_EXPIRED_ERROR', + CouponCodeLimitError = 'COUPON_CODE_LIMIT_ERROR', + AlreadyLoggedInError = 'ALREADY_LOGGED_IN_ERROR', + MissingPasswordError = 'MISSING_PASSWORD_ERROR', + PasswordAlreadySetError = 'PASSWORD_ALREADY_SET_ERROR', + VerificationTokenInvalidError = 'VERIFICATION_TOKEN_INVALID_ERROR', + VerificationTokenExpiredError = 'VERIFICATION_TOKEN_EXPIRED_ERROR', + IdentifierChangeTokenInvalidError = 'IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR', + IdentifierChangeTokenExpiredError = 'IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR', + PasswordResetTokenInvalidError = 'PASSWORD_RESET_TOKEN_INVALID_ERROR', + PasswordResetTokenExpiredError = 'PASSWORD_RESET_TOKEN_EXPIRED_ERROR', + NotVerifiedError = 'NOT_VERIFIED_ERROR', + NoActiveOrderError = 'NO_ACTIVE_ORDER_ERROR', +} + +export enum LogicalOperator { + And = 'AND', + Or = 'OR', +} + +/** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */ +export type NativeAuthStrategyError = ErrorResult & { + __typename?: 'NativeAuthStrategyError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Returned if the user authentication credentials are not valid */ +export type InvalidCredentialsError = ErrorResult & { + __typename?: 'InvalidCredentialsError' + errorCode: ErrorCode + message: Scalars['String'] + authenticationError: Scalars['String'] +} + +/** Returned if there is an error in transitioning the Order state */ +export type OrderStateTransitionError = ErrorResult & { + __typename?: 'OrderStateTransitionError' + errorCode: ErrorCode + message: Scalars['String'] + transitionError: Scalars['String'] + fromState: Scalars['String'] + toState: Scalars['String'] +} + +/** Retured when attemting to create a Customer with an email address already registered to an existing User. */ +export type EmailAddressConflictError = ErrorResult & { + __typename?: 'EmailAddressConflictError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Retured when the maximum order size limit has been reached. */ +export type OrderLimitError = ErrorResult & { + __typename?: 'OrderLimitError' + errorCode: ErrorCode + message: Scalars['String'] + maxItems: Scalars['Int'] +} + +/** Retured when attemting to set a negative OrderLine quantity. */ +export type NegativeQuantityError = ErrorResult & { + __typename?: 'NegativeQuantityError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Returned when attempting to add more items to the Order than are available */ +export type InsufficientStockError = ErrorResult & { + __typename?: 'InsufficientStockError' + errorCode: ErrorCode + message: Scalars['String'] + quantityAvailable: Scalars['Int'] + order: Order +} + +export type PaginatedList = { + items: Array + totalItems: Scalars['Int'] +} + +export type Node = { + id: Scalars['ID'] +} + +export type ErrorResult = { + errorCode: ErrorCode + message: Scalars['String'] +} + +export type Adjustment = { + __typename?: 'Adjustment' + adjustmentSource: Scalars['String'] + type: AdjustmentType + description: Scalars['String'] + amount: Scalars['Int'] +} + +export type TaxLine = { + __typename?: 'TaxLine' + description: Scalars['String'] + taxRate: Scalars['Float'] +} + +export type ConfigArg = { + __typename?: 'ConfigArg' + name: Scalars['String'] + value: Scalars['String'] +} + +export type ConfigArgDefinition = { + __typename?: 'ConfigArgDefinition' + name: Scalars['String'] + type: Scalars['String'] + list: Scalars['Boolean'] + required: Scalars['Boolean'] + defaultValue?: Maybe + label?: Maybe + description?: Maybe + ui?: Maybe +} + +export type ConfigurableOperation = { + __typename?: 'ConfigurableOperation' + code: Scalars['String'] + args: Array +} + +export type ConfigurableOperationDefinition = { + __typename?: 'ConfigurableOperationDefinition' + code: Scalars['String'] + args: Array + description: Scalars['String'] +} + +export type DeletionResponse = { + __typename?: 'DeletionResponse' + result: DeletionResult + message?: Maybe +} + +export type ConfigArgInput = { + name: Scalars['String'] + /** A JSON stringified representation of the actual value */ + value: Scalars['String'] +} + +export type ConfigurableOperationInput = { + code: Scalars['String'] + arguments: Array +} + +export type StringOperators = { + eq?: Maybe + notEq?: Maybe + contains?: Maybe + notContains?: Maybe + in?: Maybe> + notIn?: Maybe> + regex?: Maybe +} + +export type BooleanOperators = { + eq?: Maybe +} + +export type NumberRange = { + start: Scalars['Float'] + end: Scalars['Float'] +} + +export type NumberOperators = { + eq?: Maybe + lt?: Maybe + lte?: Maybe + gt?: Maybe + gte?: Maybe + between?: Maybe +} + +export type DateRange = { + start: Scalars['DateTime'] + end: Scalars['DateTime'] +} + +export type DateOperators = { + eq?: Maybe + before?: Maybe + after?: Maybe + between?: Maybe +} + +/** + * Used to construct boolean expressions for filtering search results + * by FacetValue ID. Examples: + * + * * ID=1 OR ID=2: `{ facetValueFilters: [{ or: [1,2] }] }` + * * ID=1 AND ID=2: `{ facetValueFilters: [{ and: 1 }, { and: 2 }] }` + * * ID=1 AND (ID=2 OR ID=3): `{ facetValueFilters: [{ and: 1 }, { or: [2,3] }] }` + */ +export type FacetValueFilterInput = { + and?: Maybe + or?: Maybe> +} + +export type SearchInput = { + term?: Maybe + facetValueIds?: Maybe> + facetValueOperator?: Maybe + facetValueFilters?: Maybe> + collectionId?: Maybe + collectionSlug?: Maybe + groupByProduct?: Maybe + take?: Maybe + skip?: Maybe + sort?: Maybe +} + +export type SearchResultSortParameter = { + name?: Maybe + price?: Maybe +} + +export type CreateCustomerInput = { + title?: Maybe + firstName: Scalars['String'] + lastName: Scalars['String'] + phoneNumber?: Maybe + emailAddress: Scalars['String'] + customFields?: Maybe +} + +export type CreateAddressInput = { + fullName?: Maybe + company?: Maybe + streetLine1: Scalars['String'] + streetLine2?: Maybe + city?: Maybe + province?: Maybe + postalCode?: Maybe + countryCode: Scalars['String'] + phoneNumber?: Maybe + defaultShippingAddress?: Maybe + defaultBillingAddress?: Maybe + customFields?: Maybe +} + +export type UpdateAddressInput = { + id: Scalars['ID'] + fullName?: Maybe + company?: Maybe + streetLine1?: Maybe + streetLine2?: Maybe + city?: Maybe + province?: Maybe + postalCode?: Maybe + countryCode?: Maybe + phoneNumber?: Maybe + defaultShippingAddress?: Maybe + defaultBillingAddress?: Maybe + customFields?: Maybe +} + +/** Indicates that an operation succeeded, where we do not want to return any more specific information. */ +export type Success = { + __typename?: 'Success' + success: Scalars['Boolean'] +} + +export type ShippingMethodQuote = { + __typename?: 'ShippingMethodQuote' + id: Scalars['ID'] + price: Scalars['Int'] + priceWithTax: Scalars['Int'] + code: Scalars['String'] + name: Scalars['String'] + description: Scalars['String'] + /** Any optional metadata returned by the ShippingCalculator in the ShippingCalculationResult */ + metadata?: Maybe +} + +export type PaymentMethodQuote = { + __typename?: 'PaymentMethodQuote' + id: Scalars['ID'] + code: Scalars['String'] + name: Scalars['String'] + description: Scalars['String'] + isEligible: Scalars['Boolean'] + eligibilityMessage?: Maybe +} + +export type Country = Node & { + __typename?: 'Country' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + code: Scalars['String'] + name: Scalars['String'] + enabled: Scalars['Boolean'] + translations: Array +} + +export type CountryTranslation = { + __typename?: 'CountryTranslation' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + name: Scalars['String'] +} + +export type CountryList = PaginatedList & { + __typename?: 'CountryList' + items: Array + totalItems: Scalars['Int'] +} + +/** + * @description + * ISO 4217 currency code + * + * @docsCategory common + */ +export enum CurrencyCode { + /** United Arab Emirates dirham */ + Aed = 'AED', + /** Afghan afghani */ + Afn = 'AFN', + /** Albanian lek */ + All = 'ALL', + /** Armenian dram */ + Amd = 'AMD', + /** Netherlands Antillean guilder */ + Ang = 'ANG', + /** Angolan kwanza */ + Aoa = 'AOA', + /** Argentine peso */ + Ars = 'ARS', + /** Australian dollar */ + Aud = 'AUD', + /** Aruban florin */ + Awg = 'AWG', + /** Azerbaijani manat */ + Azn = 'AZN', + /** Bosnia and Herzegovina convertible mark */ + Bam = 'BAM', + /** Barbados dollar */ + Bbd = 'BBD', + /** Bangladeshi taka */ + Bdt = 'BDT', + /** Bulgarian lev */ + Bgn = 'BGN', + /** Bahraini dinar */ + Bhd = 'BHD', + /** Burundian franc */ + Bif = 'BIF', + /** Bermudian dollar */ + Bmd = 'BMD', + /** Brunei dollar */ + Bnd = 'BND', + /** Boliviano */ + Bob = 'BOB', + /** Brazilian real */ + Brl = 'BRL', + /** Bahamian dollar */ + Bsd = 'BSD', + /** Bhutanese ngultrum */ + Btn = 'BTN', + /** Botswana pula */ + Bwp = 'BWP', + /** Belarusian ruble */ + Byn = 'BYN', + /** Belize dollar */ + Bzd = 'BZD', + /** Canadian dollar */ + Cad = 'CAD', + /** Congolese franc */ + Cdf = 'CDF', + /** Swiss franc */ + Chf = 'CHF', + /** Chilean peso */ + Clp = 'CLP', + /** Renminbi (Chinese) yuan */ + Cny = 'CNY', + /** Colombian peso */ + Cop = 'COP', + /** Costa Rican colon */ + Crc = 'CRC', + /** Cuban convertible peso */ + Cuc = 'CUC', + /** Cuban peso */ + Cup = 'CUP', + /** Cape Verde escudo */ + Cve = 'CVE', + /** Czech koruna */ + Czk = 'CZK', + /** Djiboutian franc */ + Djf = 'DJF', + /** Danish krone */ + Dkk = 'DKK', + /** Dominican peso */ + Dop = 'DOP', + /** Algerian dinar */ + Dzd = 'DZD', + /** Egyptian pound */ + Egp = 'EGP', + /** Eritrean nakfa */ + Ern = 'ERN', + /** Ethiopian birr */ + Etb = 'ETB', + /** Euro */ + Eur = 'EUR', + /** Fiji dollar */ + Fjd = 'FJD', + /** Falkland Islands pound */ + Fkp = 'FKP', + /** Pound sterling */ + Gbp = 'GBP', + /** Georgian lari */ + Gel = 'GEL', + /** Ghanaian cedi */ + Ghs = 'GHS', + /** Gibraltar pound */ + Gip = 'GIP', + /** Gambian dalasi */ + Gmd = 'GMD', + /** Guinean franc */ + Gnf = 'GNF', + /** Guatemalan quetzal */ + Gtq = 'GTQ', + /** Guyanese dollar */ + Gyd = 'GYD', + /** Hong Kong dollar */ + Hkd = 'HKD', + /** Honduran lempira */ + Hnl = 'HNL', + /** Croatian kuna */ + Hrk = 'HRK', + /** Haitian gourde */ + Htg = 'HTG', + /** Hungarian forint */ + Huf = 'HUF', + /** Indonesian rupiah */ + Idr = 'IDR', + /** Israeli new shekel */ + Ils = 'ILS', + /** Indian rupee */ + Inr = 'INR', + /** Iraqi dinar */ + Iqd = 'IQD', + /** Iranian rial */ + Irr = 'IRR', + /** Icelandic króna */ + Isk = 'ISK', + /** Jamaican dollar */ + Jmd = 'JMD', + /** Jordanian dinar */ + Jod = 'JOD', + /** Japanese yen */ + Jpy = 'JPY', + /** Kenyan shilling */ + Kes = 'KES', + /** Kyrgyzstani som */ + Kgs = 'KGS', + /** Cambodian riel */ + Khr = 'KHR', + /** Comoro franc */ + Kmf = 'KMF', + /** North Korean won */ + Kpw = 'KPW', + /** South Korean won */ + Krw = 'KRW', + /** Kuwaiti dinar */ + Kwd = 'KWD', + /** Cayman Islands dollar */ + Kyd = 'KYD', + /** Kazakhstani tenge */ + Kzt = 'KZT', + /** Lao kip */ + Lak = 'LAK', + /** Lebanese pound */ + Lbp = 'LBP', + /** Sri Lankan rupee */ + Lkr = 'LKR', + /** Liberian dollar */ + Lrd = 'LRD', + /** Lesotho loti */ + Lsl = 'LSL', + /** Libyan dinar */ + Lyd = 'LYD', + /** Moroccan dirham */ + Mad = 'MAD', + /** Moldovan leu */ + Mdl = 'MDL', + /** Malagasy ariary */ + Mga = 'MGA', + /** Macedonian denar */ + Mkd = 'MKD', + /** Myanmar kyat */ + Mmk = 'MMK', + /** Mongolian tögrög */ + Mnt = 'MNT', + /** Macanese pataca */ + Mop = 'MOP', + /** Mauritanian ouguiya */ + Mru = 'MRU', + /** Mauritian rupee */ + Mur = 'MUR', + /** Maldivian rufiyaa */ + Mvr = 'MVR', + /** Malawian kwacha */ + Mwk = 'MWK', + /** Mexican peso */ + Mxn = 'MXN', + /** Malaysian ringgit */ + Myr = 'MYR', + /** Mozambican metical */ + Mzn = 'MZN', + /** Namibian dollar */ + Nad = 'NAD', + /** Nigerian naira */ + Ngn = 'NGN', + /** Nicaraguan córdoba */ + Nio = 'NIO', + /** Norwegian krone */ + Nok = 'NOK', + /** Nepalese rupee */ + Npr = 'NPR', + /** New Zealand dollar */ + Nzd = 'NZD', + /** Omani rial */ + Omr = 'OMR', + /** Panamanian balboa */ + Pab = 'PAB', + /** Peruvian sol */ + Pen = 'PEN', + /** Papua New Guinean kina */ + Pgk = 'PGK', + /** Philippine peso */ + Php = 'PHP', + /** Pakistani rupee */ + Pkr = 'PKR', + /** Polish złoty */ + Pln = 'PLN', + /** Paraguayan guaraní */ + Pyg = 'PYG', + /** Qatari riyal */ + Qar = 'QAR', + /** Romanian leu */ + Ron = 'RON', + /** Serbian dinar */ + Rsd = 'RSD', + /** Russian ruble */ + Rub = 'RUB', + /** Rwandan franc */ + Rwf = 'RWF', + /** Saudi riyal */ + Sar = 'SAR', + /** Solomon Islands dollar */ + Sbd = 'SBD', + /** Seychelles rupee */ + Scr = 'SCR', + /** Sudanese pound */ + Sdg = 'SDG', + /** Swedish krona/kronor */ + Sek = 'SEK', + /** Singapore dollar */ + Sgd = 'SGD', + /** Saint Helena pound */ + Shp = 'SHP', + /** Sierra Leonean leone */ + Sll = 'SLL', + /** Somali shilling */ + Sos = 'SOS', + /** Surinamese dollar */ + Srd = 'SRD', + /** South Sudanese pound */ + Ssp = 'SSP', + /** São Tomé and Príncipe dobra */ + Stn = 'STN', + /** Salvadoran colón */ + Svc = 'SVC', + /** Syrian pound */ + Syp = 'SYP', + /** Swazi lilangeni */ + Szl = 'SZL', + /** Thai baht */ + Thb = 'THB', + /** Tajikistani somoni */ + Tjs = 'TJS', + /** Turkmenistan manat */ + Tmt = 'TMT', + /** Tunisian dinar */ + Tnd = 'TND', + /** Tongan paʻanga */ + Top = 'TOP', + /** Turkish lira */ + Try = 'TRY', + /** Trinidad and Tobago dollar */ + Ttd = 'TTD', + /** New Taiwan dollar */ + Twd = 'TWD', + /** Tanzanian shilling */ + Tzs = 'TZS', + /** Ukrainian hryvnia */ + Uah = 'UAH', + /** Ugandan shilling */ + Ugx = 'UGX', + /** United States dollar */ + Usd = 'USD', + /** Uruguayan peso */ + Uyu = 'UYU', + /** Uzbekistan som */ + Uzs = 'UZS', + /** Venezuelan bolívar soberano */ + Ves = 'VES', + /** Vietnamese đồng */ + Vnd = 'VND', + /** Vanuatu vatu */ + Vuv = 'VUV', + /** Samoan tala */ + Wst = 'WST', + /** CFA franc BEAC */ + Xaf = 'XAF', + /** East Caribbean dollar */ + Xcd = 'XCD', + /** CFA franc BCEAO */ + Xof = 'XOF', + /** CFP franc (franc Pacifique) */ + Xpf = 'XPF', + /** Yemeni rial */ + Yer = 'YER', + /** South African rand */ + Zar = 'ZAR', + /** Zambian kwacha */ + Zmw = 'ZMW', + /** Zimbabwean dollar */ + Zwl = 'ZWL', +} + +export type CustomField = { + name: Scalars['String'] + type: Scalars['String'] + list: Scalars['Boolean'] + label?: Maybe> + description?: Maybe> + readonly?: Maybe + internal?: Maybe +} + +export type StringCustomFieldConfig = CustomField & { + __typename?: 'StringCustomFieldConfig' + name: Scalars['String'] + type: Scalars['String'] + list: Scalars['Boolean'] + length?: Maybe + label?: Maybe> + description?: Maybe> + readonly?: Maybe + internal?: Maybe + pattern?: Maybe + options?: Maybe> +} + +export type StringFieldOption = { + __typename?: 'StringFieldOption' + value: Scalars['String'] + label?: Maybe> +} + +export type LocaleStringCustomFieldConfig = CustomField & { + __typename?: 'LocaleStringCustomFieldConfig' + name: Scalars['String'] + type: Scalars['String'] + list: Scalars['Boolean'] + length?: Maybe + label?: Maybe> + description?: Maybe> + readonly?: Maybe + internal?: Maybe + pattern?: Maybe +} + +export type IntCustomFieldConfig = CustomField & { + __typename?: 'IntCustomFieldConfig' + name: Scalars['String'] + type: Scalars['String'] + list: Scalars['Boolean'] + label?: Maybe> + description?: Maybe> + readonly?: Maybe + internal?: Maybe + min?: Maybe + max?: Maybe + step?: Maybe +} + +export type FloatCustomFieldConfig = CustomField & { + __typename?: 'FloatCustomFieldConfig' + name: Scalars['String'] + type: Scalars['String'] + list: Scalars['Boolean'] + label?: Maybe> + description?: Maybe> + readonly?: Maybe + internal?: Maybe + min?: Maybe + max?: Maybe + step?: Maybe +} + +export type BooleanCustomFieldConfig = CustomField & { + __typename?: 'BooleanCustomFieldConfig' + name: Scalars['String'] + type: Scalars['String'] + list: Scalars['Boolean'] + label?: Maybe> + description?: Maybe> + readonly?: Maybe + internal?: Maybe +} + +/** + * Expects the same validation formats as the `` HTML element. + * See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#Additional_attributes + */ +export type DateTimeCustomFieldConfig = CustomField & { + __typename?: 'DateTimeCustomFieldConfig' + name: Scalars['String'] + type: Scalars['String'] + list: Scalars['Boolean'] + label?: Maybe> + description?: Maybe> + readonly?: Maybe + internal?: Maybe + min?: Maybe + max?: Maybe + step?: Maybe +} + +export type RelationCustomFieldConfig = CustomField & { + __typename?: 'RelationCustomFieldConfig' + name: Scalars['String'] + type: Scalars['String'] + list: Scalars['Boolean'] + label?: Maybe> + description?: Maybe> + readonly?: Maybe + internal?: Maybe + entity: Scalars['String'] + scalarFields: Array +} + +export type LocalizedString = { + __typename?: 'LocalizedString' + languageCode: LanguageCode + value: Scalars['String'] +} + +export type CustomFieldConfig = + | StringCustomFieldConfig + | LocaleStringCustomFieldConfig + | IntCustomFieldConfig + | FloatCustomFieldConfig + | BooleanCustomFieldConfig + | DateTimeCustomFieldConfig + | RelationCustomFieldConfig + +export type CustomerGroup = Node & { + __typename?: 'CustomerGroup' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + name: Scalars['String'] + customers: CustomerList +} + +export type CustomerGroupCustomersArgs = { + options?: Maybe +} + +export type CustomerListOptions = { + skip?: Maybe + take?: Maybe + sort?: Maybe + filter?: Maybe +} + +export type Customer = Node & { + __typename?: 'Customer' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + title?: Maybe + firstName: Scalars['String'] + lastName: Scalars['String'] + phoneNumber?: Maybe + emailAddress: Scalars['String'] + addresses?: Maybe> + orders: OrderList + user?: Maybe + customFields?: Maybe +} + +export type CustomerOrdersArgs = { + options?: Maybe +} + +export type CustomerList = PaginatedList & { + __typename?: 'CustomerList' + items: Array + totalItems: Scalars['Int'] +} + +export type FacetValue = Node & { + __typename?: 'FacetValue' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + facet: Facet + name: Scalars['String'] + code: Scalars['String'] + translations: Array + customFields?: Maybe +} + +export type FacetValueTranslation = { + __typename?: 'FacetValueTranslation' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + name: Scalars['String'] +} + +export type Facet = Node & { + __typename?: 'Facet' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + name: Scalars['String'] + code: Scalars['String'] + values: Array + translations: Array + customFields?: Maybe +} + +export type FacetTranslation = { + __typename?: 'FacetTranslation' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + name: Scalars['String'] +} + +export type FacetList = PaginatedList & { + __typename?: 'FacetList' + items: Array + totalItems: Scalars['Int'] +} + +export type HistoryEntry = Node & { + __typename?: 'HistoryEntry' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + type: HistoryEntryType + data: Scalars['JSON'] +} + +export enum HistoryEntryType { + CustomerRegistered = 'CUSTOMER_REGISTERED', + CustomerVerified = 'CUSTOMER_VERIFIED', + CustomerDetailUpdated = 'CUSTOMER_DETAIL_UPDATED', + CustomerAddedToGroup = 'CUSTOMER_ADDED_TO_GROUP', + CustomerRemovedFromGroup = 'CUSTOMER_REMOVED_FROM_GROUP', + CustomerAddressCreated = 'CUSTOMER_ADDRESS_CREATED', + CustomerAddressUpdated = 'CUSTOMER_ADDRESS_UPDATED', + CustomerAddressDeleted = 'CUSTOMER_ADDRESS_DELETED', + CustomerPasswordUpdated = 'CUSTOMER_PASSWORD_UPDATED', + CustomerPasswordResetRequested = 'CUSTOMER_PASSWORD_RESET_REQUESTED', + CustomerPasswordResetVerified = 'CUSTOMER_PASSWORD_RESET_VERIFIED', + CustomerEmailUpdateRequested = 'CUSTOMER_EMAIL_UPDATE_REQUESTED', + CustomerEmailUpdateVerified = 'CUSTOMER_EMAIL_UPDATE_VERIFIED', + CustomerNote = 'CUSTOMER_NOTE', + OrderStateTransition = 'ORDER_STATE_TRANSITION', + OrderPaymentTransition = 'ORDER_PAYMENT_TRANSITION', + OrderFulfillment = 'ORDER_FULFILLMENT', + OrderCancellation = 'ORDER_CANCELLATION', + OrderRefundTransition = 'ORDER_REFUND_TRANSITION', + OrderFulfillmentTransition = 'ORDER_FULFILLMENT_TRANSITION', + OrderNote = 'ORDER_NOTE', + OrderCouponApplied = 'ORDER_COUPON_APPLIED', + OrderCouponRemoved = 'ORDER_COUPON_REMOVED', + OrderModified = 'ORDER_MODIFIED', +} + +export type HistoryEntryList = PaginatedList & { + __typename?: 'HistoryEntryList' + items: Array + totalItems: Scalars['Int'] +} + +export type HistoryEntryListOptions = { + skip?: Maybe + take?: Maybe + sort?: Maybe + filter?: Maybe +} + +/** + * @description + * Languages in the form of a ISO 639-1 language code with optional + * region or script modifier (e.g. de_AT). The selection available is based + * on the [Unicode CLDR summary list](https://unicode-org.github.io/cldr-staging/charts/37/summary/root.html) + * and includes the major spoken languages of the world and any widely-used variants. + * + * @docsCategory common + */ +export enum LanguageCode { + /** Afrikaans */ + Af = 'af', + /** Akan */ + Ak = 'ak', + /** Albanian */ + Sq = 'sq', + /** Amharic */ + Am = 'am', + /** Arabic */ + Ar = 'ar', + /** Armenian */ + Hy = 'hy', + /** Assamese */ + As = 'as', + /** Azerbaijani */ + Az = 'az', + /** Bambara */ + Bm = 'bm', + /** Bangla */ + Bn = 'bn', + /** Basque */ + Eu = 'eu', + /** Belarusian */ + Be = 'be', + /** Bosnian */ + Bs = 'bs', + /** Breton */ + Br = 'br', + /** Bulgarian */ + Bg = 'bg', + /** Burmese */ + My = 'my', + /** Catalan */ + Ca = 'ca', + /** Chechen */ + Ce = 'ce', + /** Chinese */ + Zh = 'zh', + /** Simplified Chinese */ + ZhHans = 'zh_Hans', + /** Traditional Chinese */ + ZhHant = 'zh_Hant', + /** Church Slavic */ + Cu = 'cu', + /** Cornish */ + Kw = 'kw', + /** Corsican */ + Co = 'co', + /** Croatian */ + Hr = 'hr', + /** Czech */ + Cs = 'cs', + /** Danish */ + Da = 'da', + /** Dutch */ + Nl = 'nl', + /** Flemish */ + NlBe = 'nl_BE', + /** Dzongkha */ + Dz = 'dz', + /** English */ + En = 'en', + /** Australian English */ + EnAu = 'en_AU', + /** Canadian English */ + EnCa = 'en_CA', + /** British English */ + EnGb = 'en_GB', + /** American English */ + EnUs = 'en_US', + /** Esperanto */ + Eo = 'eo', + /** Estonian */ + Et = 'et', + /** Ewe */ + Ee = 'ee', + /** Faroese */ + Fo = 'fo', + /** Finnish */ + Fi = 'fi', + /** French */ + Fr = 'fr', + /** Canadian French */ + FrCa = 'fr_CA', + /** Swiss French */ + FrCh = 'fr_CH', + /** Fulah */ + Ff = 'ff', + /** Galician */ + Gl = 'gl', + /** Ganda */ + Lg = 'lg', + /** Georgian */ + Ka = 'ka', + /** German */ + De = 'de', + /** Austrian German */ + DeAt = 'de_AT', + /** Swiss High German */ + DeCh = 'de_CH', + /** Greek */ + El = 'el', + /** Gujarati */ + Gu = 'gu', + /** Haitian Creole */ + Ht = 'ht', + /** Hausa */ + Ha = 'ha', + /** Hebrew */ + He = 'he', + /** Hindi */ + Hi = 'hi', + /** Hungarian */ + Hu = 'hu', + /** Icelandic */ + Is = 'is', + /** Igbo */ + Ig = 'ig', + /** Indonesian */ + Id = 'id', + /** Interlingua */ + Ia = 'ia', + /** Irish */ + Ga = 'ga', + /** Italian */ + It = 'it', + /** Japanese */ + Ja = 'ja', + /** Javanese */ + Jv = 'jv', + /** Kalaallisut */ + Kl = 'kl', + /** Kannada */ + Kn = 'kn', + /** Kashmiri */ + Ks = 'ks', + /** Kazakh */ + Kk = 'kk', + /** Khmer */ + Km = 'km', + /** Kikuyu */ + Ki = 'ki', + /** Kinyarwanda */ + Rw = 'rw', + /** Korean */ + Ko = 'ko', + /** Kurdish */ + Ku = 'ku', + /** Kyrgyz */ + Ky = 'ky', + /** Lao */ + Lo = 'lo', + /** Latin */ + La = 'la', + /** Latvian */ + Lv = 'lv', + /** Lingala */ + Ln = 'ln', + /** Lithuanian */ + Lt = 'lt', + /** Luba-Katanga */ + Lu = 'lu', + /** Luxembourgish */ + Lb = 'lb', + /** Macedonian */ + Mk = 'mk', + /** Malagasy */ + Mg = 'mg', + /** Malay */ + Ms = 'ms', + /** Malayalam */ + Ml = 'ml', + /** Maltese */ + Mt = 'mt', + /** Manx */ + Gv = 'gv', + /** Maori */ + Mi = 'mi', + /** Marathi */ + Mr = 'mr', + /** Mongolian */ + Mn = 'mn', + /** Nepali */ + Ne = 'ne', + /** North Ndebele */ + Nd = 'nd', + /** Northern Sami */ + Se = 'se', + /** Norwegian Bokmål */ + Nb = 'nb', + /** Norwegian Nynorsk */ + Nn = 'nn', + /** Nyanja */ + Ny = 'ny', + /** Odia */ + Or = 'or', + /** Oromo */ + Om = 'om', + /** Ossetic */ + Os = 'os', + /** Pashto */ + Ps = 'ps', + /** Persian */ + Fa = 'fa', + /** Dari */ + FaAf = 'fa_AF', + /** Polish */ + Pl = 'pl', + /** Portuguese */ + Pt = 'pt', + /** Brazilian Portuguese */ + PtBr = 'pt_BR', + /** European Portuguese */ + PtPt = 'pt_PT', + /** Punjabi */ + Pa = 'pa', + /** Quechua */ + Qu = 'qu', + /** Romanian */ + Ro = 'ro', + /** Moldavian */ + RoMd = 'ro_MD', + /** Romansh */ + Rm = 'rm', + /** Rundi */ + Rn = 'rn', + /** Russian */ + Ru = 'ru', + /** Samoan */ + Sm = 'sm', + /** Sango */ + Sg = 'sg', + /** Sanskrit */ + Sa = 'sa', + /** Scottish Gaelic */ + Gd = 'gd', + /** Serbian */ + Sr = 'sr', + /** Shona */ + Sn = 'sn', + /** Sichuan Yi */ + Ii = 'ii', + /** Sindhi */ + Sd = 'sd', + /** Sinhala */ + Si = 'si', + /** Slovak */ + Sk = 'sk', + /** Slovenian */ + Sl = 'sl', + /** Somali */ + So = 'so', + /** Southern Sotho */ + St = 'st', + /** Spanish */ + Es = 'es', + /** European Spanish */ + EsEs = 'es_ES', + /** Mexican Spanish */ + EsMx = 'es_MX', + /** Sundanese */ + Su = 'su', + /** Swahili */ + Sw = 'sw', + /** Congo Swahili */ + SwCd = 'sw_CD', + /** Swedish */ + Sv = 'sv', + /** Tajik */ + Tg = 'tg', + /** Tamil */ + Ta = 'ta', + /** Tatar */ + Tt = 'tt', + /** Telugu */ + Te = 'te', + /** Thai */ + Th = 'th', + /** Tibetan */ + Bo = 'bo', + /** Tigrinya */ + Ti = 'ti', + /** Tongan */ + To = 'to', + /** Turkish */ + Tr = 'tr', + /** Turkmen */ + Tk = 'tk', + /** Ukrainian */ + Uk = 'uk', + /** Urdu */ + Ur = 'ur', + /** Uyghur */ + Ug = 'ug', + /** Uzbek */ + Uz = 'uz', + /** Vietnamese */ + Vi = 'vi', + /** Volapük */ + Vo = 'vo', + /** Welsh */ + Cy = 'cy', + /** Western Frisian */ + Fy = 'fy', + /** Wolof */ + Wo = 'wo', + /** Xhosa */ + Xh = 'xh', + /** Yiddish */ + Yi = 'yi', + /** Yoruba */ + Yo = 'yo', + /** Zulu */ + Zu = 'zu', +} + +export type Order = Node & { + __typename?: 'Order' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + /** + * The date & time that the Order was placed, i.e. the Customer + * completed the checkout and the Order is no longer "active" + */ + orderPlacedAt?: Maybe + /** A unique code for the Order */ + code: Scalars['String'] + state: Scalars['String'] + /** An order is active as long as the payment process has not been completed */ + active: Scalars['Boolean'] + customer?: Maybe + shippingAddress?: Maybe + billingAddress?: Maybe + lines: Array + /** + * Surcharges are arbitrary modifications to the Order total which are neither + * ProductVariants nor discounts resulting from applied Promotions. For example, + * one-off discounts based on customer interaction, or surcharges based on payment + * methods. + */ + surcharges: Array + discounts: Array + /** An array of all coupon codes applied to the Order */ + couponCodes: Array + /** Promotions applied to the order. Only gets populated after the payment process has completed. */ + promotions: Array + payments?: Maybe> + fulfillments?: Maybe> + totalQuantity: Scalars['Int'] + /** + * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level + * discounts which have been prorated (proportionally distributed) amongst the OrderItems. + * To get a total of all OrderLines which does not account for prorated discounts, use the + * sum of `OrderLine.discountedLinePrice` values. + */ + subTotal: Scalars['Int'] + /** Same as subTotal, but inclusive of tax */ + subTotalWithTax: Scalars['Int'] + currencyCode: CurrencyCode + shippingLines: Array + shipping: Scalars['Int'] + shippingWithTax: Scalars['Int'] + /** Equal to subTotal plus shipping */ + total: Scalars['Int'] + /** The final payable amount. Equal to subTotalWithTax plus shippingWithTax */ + totalWithTax: Scalars['Int'] + /** A summary of the taxes being applied to this Order */ + taxSummary: Array + history: HistoryEntryList + customFields?: Maybe +} + +export type OrderHistoryArgs = { + options?: Maybe +} + +/** + * A summary of the taxes being applied to this order, grouped + * by taxRate. + */ +export type OrderTaxSummary = { + __typename?: 'OrderTaxSummary' + /** A description of this tax */ + description: Scalars['String'] + /** The taxRate as a percentage */ + taxRate: Scalars['Float'] + /** The total net price or OrderItems to which this taxRate applies */ + taxBase: Scalars['Int'] + /** The total tax being applied to the Order at this taxRate */ + taxTotal: Scalars['Int'] +} + +export type OrderAddress = { + __typename?: 'OrderAddress' + fullName?: Maybe + company?: Maybe + streetLine1?: Maybe + streetLine2?: Maybe + city?: Maybe + province?: Maybe + postalCode?: Maybe + country?: Maybe + countryCode?: Maybe + phoneNumber?: Maybe + customFields?: Maybe +} + +export type OrderList = PaginatedList & { + __typename?: 'OrderList' + items: Array + totalItems: Scalars['Int'] +} + +export type ShippingLine = { + __typename?: 'ShippingLine' + shippingMethod: ShippingMethod + price: Scalars['Int'] + priceWithTax: Scalars['Int'] + discountedPrice: Scalars['Int'] + discountedPriceWithTax: Scalars['Int'] + discounts: Array +} + +export type Discount = { + __typename?: 'Discount' + adjustmentSource: Scalars['String'] + type: AdjustmentType + description: Scalars['String'] + amount: Scalars['Int'] + amountWithTax: Scalars['Int'] +} + +export type OrderItem = Node & { + __typename?: 'OrderItem' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + cancelled: Scalars['Boolean'] + /** The price of a single unit, excluding tax and discounts */ + unitPrice: Scalars['Int'] + /** The price of a single unit, including tax but excluding discounts */ + unitPriceWithTax: Scalars['Int'] + /** + * The price of a single unit including discounts, excluding tax. + * + * If Order-level discounts have been applied, this will not be the + * actual taxable unit price (see `proratedUnitPrice`), but is generally the + * correct price to display to customers to avoid confusion + * about the internal handling of distributed Order-level discounts. + */ + discountedUnitPrice: Scalars['Int'] + /** The price of a single unit including discounts and tax */ + discountedUnitPriceWithTax: Scalars['Int'] + /** + * The actual unit price, taking into account both item discounts _and_ prorated (proportially-distributed) + * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax + * and refund calculations. + */ + proratedUnitPrice: Scalars['Int'] + /** The proratedUnitPrice including tax */ + proratedUnitPriceWithTax: Scalars['Int'] + unitTax: Scalars['Int'] + taxRate: Scalars['Float'] + adjustments: Array + taxLines: Array + fulfillment?: Maybe + refundId?: Maybe +} + +export type OrderLine = Node & { + __typename?: 'OrderLine' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + productVariant: ProductVariant + featuredAsset?: Maybe + /** The price of a single unit, excluding tax and discounts */ + unitPrice: Scalars['Int'] + /** The price of a single unit, including tax but excluding discounts */ + unitPriceWithTax: Scalars['Int'] + /** Non-zero if the unitPrice has changed since it was initially added to Order */ + unitPriceChangeSinceAdded: Scalars['Int'] + /** Non-zero if the unitPriceWithTax has changed since it was initially added to Order */ + unitPriceWithTaxChangeSinceAdded: Scalars['Int'] + /** + * The price of a single unit including discounts, excluding tax. + * + * If Order-level discounts have been applied, this will not be the + * actual taxable unit price (see `proratedUnitPrice`), but is generally the + * correct price to display to customers to avoid confusion + * about the internal handling of distributed Order-level discounts. + */ + discountedUnitPrice: Scalars['Int'] + /** The price of a single unit including discounts and tax */ + discountedUnitPriceWithTax: Scalars['Int'] + /** + * The actual unit price, taking into account both item discounts _and_ prorated (proportially-distributed) + * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax + * and refund calculations. + */ + proratedUnitPrice: Scalars['Int'] + /** The proratedUnitPrice including tax */ + proratedUnitPriceWithTax: Scalars['Int'] + quantity: Scalars['Int'] + items: Array + taxRate: Scalars['Float'] + /** The total price of the line excluding tax and discounts. */ + linePrice: Scalars['Int'] + /** The total price of the line including tax bit excluding discounts. */ + linePriceWithTax: Scalars['Int'] + /** The price of the line including discounts, excluding tax */ + discountedLinePrice: Scalars['Int'] + /** The price of the line including discounts and tax */ + discountedLinePriceWithTax: Scalars['Int'] + /** + * The actual line price, taking into account both item discounts _and_ prorated (proportially-distributed) + * Order-level discounts. This value is the true economic value of the OrderLine, and is used in tax + * and refund calculations. + */ + proratedLinePrice: Scalars['Int'] + /** The proratedLinePrice including tax */ + proratedLinePriceWithTax: Scalars['Int'] + /** The total tax on this line */ + lineTax: Scalars['Int'] + discounts: Array + taxLines: Array + order: Order + customFields?: Maybe +} + +export type Payment = Node & { + __typename?: 'Payment' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + method: Scalars['String'] + amount: Scalars['Int'] + state: Scalars['String'] + transactionId?: Maybe + errorMessage?: Maybe + refunds: Array + metadata?: Maybe +} + +export type Refund = Node & { + __typename?: 'Refund' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + items: Scalars['Int'] + shipping: Scalars['Int'] + adjustment: Scalars['Int'] + total: Scalars['Int'] + method?: Maybe + state: Scalars['String'] + transactionId?: Maybe + reason?: Maybe + orderItems: Array + paymentId: Scalars['ID'] + metadata?: Maybe +} + +export type Fulfillment = Node & { + __typename?: 'Fulfillment' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + orderItems: Array + state: Scalars['String'] + method: Scalars['String'] + trackingCode?: Maybe + customFields?: Maybe +} + +export type Surcharge = Node & { + __typename?: 'Surcharge' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + description: Scalars['String'] + sku?: Maybe + taxLines: Array + price: Scalars['Int'] + priceWithTax: Scalars['Int'] + taxRate: Scalars['Float'] +} + +export type ProductOptionGroup = Node & { + __typename?: 'ProductOptionGroup' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + code: Scalars['String'] + name: Scalars['String'] + options: Array + translations: Array + customFields?: Maybe +} + +export type ProductOptionGroupTranslation = { + __typename?: 'ProductOptionGroupTranslation' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + name: Scalars['String'] +} + +export type ProductOption = Node & { + __typename?: 'ProductOption' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + code: Scalars['String'] + name: Scalars['String'] + groupId: Scalars['ID'] + group: ProductOptionGroup + translations: Array + customFields?: Maybe +} + +export type ProductOptionTranslation = { + __typename?: 'ProductOptionTranslation' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + name: Scalars['String'] +} + +export type SearchReindexResponse = { + __typename?: 'SearchReindexResponse' + success: Scalars['Boolean'] +} + +export type SearchResponse = { + __typename?: 'SearchResponse' + items: Array + totalItems: Scalars['Int'] + facetValues: Array +} + +/** + * Which FacetValues are present in the products returned + * by the search, and in what quantity. + */ +export type FacetValueResult = { + __typename?: 'FacetValueResult' + facetValue: FacetValue + count: Scalars['Int'] +} + +export type SearchResultAsset = { + __typename?: 'SearchResultAsset' + id: Scalars['ID'] + preview: Scalars['String'] + focalPoint?: Maybe +} + +export type SearchResult = { + __typename?: 'SearchResult' + sku: Scalars['String'] + slug: Scalars['String'] + productId: Scalars['ID'] + productName: Scalars['String'] + productAsset?: Maybe + productVariantId: Scalars['ID'] + productVariantName: Scalars['String'] + productVariantAsset?: Maybe + price: SearchResultPrice + priceWithTax: SearchResultPrice + currencyCode: CurrencyCode + description: Scalars['String'] + facetIds: Array + facetValueIds: Array + /** An array of ids of the Collections in which this result appears */ + collectionIds: Array + /** A relevence score for the result. Differs between database implementations */ + score: Scalars['Float'] +} + +/** The price of a search result product, either as a range or as a single price */ +export type SearchResultPrice = PriceRange | SinglePrice + +/** The price value where the result has a single price */ +export type SinglePrice = { + __typename?: 'SinglePrice' + value: Scalars['Int'] +} + +/** The price range where the result has more than one price */ +export type PriceRange = { + __typename?: 'PriceRange' + min: Scalars['Int'] + max: Scalars['Int'] +} + +export type Product = Node & { + __typename?: 'Product' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + name: Scalars['String'] + slug: Scalars['String'] + description: Scalars['String'] + featuredAsset?: Maybe + assets: Array + variants: Array + optionGroups: Array + facetValues: Array + translations: Array + collections: Array + customFields?: Maybe +} + +export type ProductTranslation = { + __typename?: 'ProductTranslation' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + name: Scalars['String'] + slug: Scalars['String'] + description: Scalars['String'] +} + +export type ProductList = PaginatedList & { + __typename?: 'ProductList' + items: Array + totalItems: Scalars['Int'] +} + +export type ProductVariant = Node & { + __typename?: 'ProductVariant' + id: Scalars['ID'] + product: Product + productId: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + sku: Scalars['String'] + name: Scalars['String'] + featuredAsset?: Maybe + assets: Array + price: Scalars['Int'] + currencyCode: CurrencyCode + priceWithTax: Scalars['Int'] + stockLevel: Scalars['String'] + taxRateApplied: TaxRate + taxCategory: TaxCategory + options: Array + facetValues: Array + translations: Array + customFields?: Maybe +} + +export type ProductVariantTranslation = { + __typename?: 'ProductVariantTranslation' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + name: Scalars['String'] +} + +export type Promotion = Node & { + __typename?: 'Promotion' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + startsAt?: Maybe + endsAt?: Maybe + couponCode?: Maybe + perCustomerUsageLimit?: Maybe + name: Scalars['String'] + enabled: Scalars['Boolean'] + conditions: Array + actions: Array +} + +export type PromotionList = PaginatedList & { + __typename?: 'PromotionList' + items: Array + totalItems: Scalars['Int'] +} + +export type Role = Node & { + __typename?: 'Role' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + code: Scalars['String'] + description: Scalars['String'] + permissions: Array + channels: Array +} + +export type RoleList = PaginatedList & { + __typename?: 'RoleList' + items: Array + totalItems: Scalars['Int'] +} + +export type ShippingMethod = Node & { + __typename?: 'ShippingMethod' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + code: Scalars['String'] + name: Scalars['String'] + description: Scalars['String'] + fulfillmentHandlerCode: Scalars['String'] + checker: ConfigurableOperation + calculator: ConfigurableOperation + translations: Array + customFields?: Maybe +} + +export type ShippingMethodTranslation = { + __typename?: 'ShippingMethodTranslation' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + languageCode: LanguageCode + name: Scalars['String'] + description: Scalars['String'] +} + +export type ShippingMethodList = PaginatedList & { + __typename?: 'ShippingMethodList' + items: Array + totalItems: Scalars['Int'] +} + +export type Tag = Node & { + __typename?: 'Tag' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + value: Scalars['String'] +} + +export type TagList = PaginatedList & { + __typename?: 'TagList' + items: Array + totalItems: Scalars['Int'] +} + +export type TaxCategory = Node & { + __typename?: 'TaxCategory' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + name: Scalars['String'] + isDefault: Scalars['Boolean'] +} + +export type TaxRate = Node & { + __typename?: 'TaxRate' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + name: Scalars['String'] + enabled: Scalars['Boolean'] + value: Scalars['Float'] + category: TaxCategory + zone: Zone + customerGroup?: Maybe +} + +export type TaxRateList = PaginatedList & { + __typename?: 'TaxRateList' + items: Array + totalItems: Scalars['Int'] +} + +export type User = Node & { + __typename?: 'User' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + identifier: Scalars['String'] + verified: Scalars['Boolean'] + roles: Array + lastLogin?: Maybe + authenticationMethods: Array + customFields?: Maybe +} + +export type AuthenticationMethod = Node & { + __typename?: 'AuthenticationMethod' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + strategy: Scalars['String'] +} + +export type Zone = Node & { + __typename?: 'Zone' + id: Scalars['ID'] + createdAt: Scalars['DateTime'] + updatedAt: Scalars['DateTime'] + name: Scalars['String'] + members: Array +} + +/** Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state. */ +export type OrderModificationError = ErrorResult & { + __typename?: 'OrderModificationError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Returned when attempting to set a ShippingMethod for which the Order is not eligible */ +export type IneligibleShippingMethodError = ErrorResult & { + __typename?: 'IneligibleShippingMethodError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state. */ +export type OrderPaymentStateError = ErrorResult & { + __typename?: 'OrderPaymentStateError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Returned when attempting to add a Payment using a PaymentMethod for which the Order is not eligible. */ +export type IneligiblePaymentMethodError = ErrorResult & { + __typename?: 'IneligiblePaymentMethodError' + errorCode: ErrorCode + message: Scalars['String'] + eligibilityCheckerMessage?: Maybe +} + +/** Returned when a Payment fails due to an error. */ +export type PaymentFailedError = ErrorResult & { + __typename?: 'PaymentFailedError' + errorCode: ErrorCode + message: Scalars['String'] + paymentErrorMessage: Scalars['String'] +} + +/** Returned when a Payment is declined by the payment provider. */ +export type PaymentDeclinedError = ErrorResult & { + __typename?: 'PaymentDeclinedError' + errorCode: ErrorCode + message: Scalars['String'] + paymentErrorMessage: Scalars['String'] +} + +/** Returned if the provided coupon code is invalid */ +export type CouponCodeInvalidError = ErrorResult & { + __typename?: 'CouponCodeInvalidError' + errorCode: ErrorCode + message: Scalars['String'] + couponCode: Scalars['String'] +} + +/** Returned if the provided coupon code is invalid */ +export type CouponCodeExpiredError = ErrorResult & { + __typename?: 'CouponCodeExpiredError' + errorCode: ErrorCode + message: Scalars['String'] + couponCode: Scalars['String'] +} + +/** Returned if the provided coupon code is invalid */ +export type CouponCodeLimitError = ErrorResult & { + __typename?: 'CouponCodeLimitError' + errorCode: ErrorCode + message: Scalars['String'] + couponCode: Scalars['String'] + limit: Scalars['Int'] +} + +/** Retured when attemting to set the Customer for an Order when already logged in. */ +export type AlreadyLoggedInError = ErrorResult & { + __typename?: 'AlreadyLoggedInError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Retured when attemting to register or verify a customer account without a password, when one is required. */ +export type MissingPasswordError = ErrorResult & { + __typename?: 'MissingPasswordError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Retured when attemting to verify a customer account with a password, when a password has already been set. */ +export type PasswordAlreadySetError = ErrorResult & { + __typename?: 'PasswordAlreadySetError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** + * Retured if the verification token (used to verify a Customer's email address) is either + * invalid or does not match any expected tokens. + */ +export type VerificationTokenInvalidError = ErrorResult & { + __typename?: 'VerificationTokenInvalidError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** + * Returned if the verification token (used to verify a Customer's email address) is valid, but has + * expired according to the `verificationTokenDuration` setting in the AuthOptions. + */ +export type VerificationTokenExpiredError = ErrorResult & { + __typename?: 'VerificationTokenExpiredError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** + * Retured if the token used to change a Customer's email address is either + * invalid or does not match any expected tokens. + */ +export type IdentifierChangeTokenInvalidError = ErrorResult & { + __typename?: 'IdentifierChangeTokenInvalidError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** + * Retured if the token used to change a Customer's email address is valid, but has + * expired according to the `verificationTokenDuration` setting in the AuthOptions. + */ +export type IdentifierChangeTokenExpiredError = ErrorResult & { + __typename?: 'IdentifierChangeTokenExpiredError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** + * Retured if the token used to reset a Customer's password is either + * invalid or does not match any expected tokens. + */ +export type PasswordResetTokenInvalidError = ErrorResult & { + __typename?: 'PasswordResetTokenInvalidError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** + * Retured if the token used to reset a Customer's password is valid, but has + * expired according to the `verificationTokenDuration` setting in the AuthOptions. + */ +export type PasswordResetTokenExpiredError = ErrorResult & { + __typename?: 'PasswordResetTokenExpiredError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** + * Returned if `authOptions.requireVerification` is set to `true` (which is the default) + * and an unverified user attempts to authenticate. + */ +export type NotVerifiedError = ErrorResult & { + __typename?: 'NotVerifiedError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** + * Returned when invoking a mutation which depends on there being an active Order on the + * current session. + */ +export type NoActiveOrderError = ErrorResult & { + __typename?: 'NoActiveOrderError' + errorCode: ErrorCode + message: Scalars['String'] +} + +export type AuthenticationInput = { + native?: Maybe +} + +export type RegisterCustomerInput = { + emailAddress: Scalars['String'] + title?: Maybe + firstName?: Maybe + lastName?: Maybe + phoneNumber?: Maybe + password?: Maybe +} + +export type UpdateCustomerInput = { + title?: Maybe + firstName?: Maybe + lastName?: Maybe + phoneNumber?: Maybe + customFields?: Maybe +} + +export type UpdateOrderInput = { + customFields?: Maybe +} + +/** Passed as input to the `addPaymentToOrder` mutation. */ +export type PaymentInput = { + /** This field should correspond to the `code` property of a PaymentMethodHandler. */ + method: Scalars['String'] + /** + * This field should contain arbitrary data passed to the specified PaymentMethodHandler's `createPayment()` method + * as the "metadata" argument. For example, it could contain an ID for the payment and other + * data generated by the payment provider. + */ + metadata: Scalars['JSON'] +} + +export type CollectionListOptions = { + skip?: Maybe + take?: Maybe + sort?: Maybe + filter?: Maybe +} + +export type OrderListOptions = { + skip?: Maybe + take?: Maybe + sort?: Maybe + filter?: Maybe +} + +export type ProductListOptions = { + skip?: Maybe + take?: Maybe + sort?: Maybe + filter?: Maybe +} + +export type UpdateOrderItemsResult = + | Order + | OrderModificationError + | OrderLimitError + | NegativeQuantityError + | InsufficientStockError + +export type RemoveOrderItemsResult = Order | OrderModificationError + +export type SetOrderShippingMethodResult = + | Order + | OrderModificationError + | IneligibleShippingMethodError + | NoActiveOrderError + +export type ApplyCouponCodeResult = + | Order + | CouponCodeExpiredError + | CouponCodeInvalidError + | CouponCodeLimitError + +export type AddPaymentToOrderResult = + | Order + | OrderPaymentStateError + | IneligiblePaymentMethodError + | PaymentFailedError + | PaymentDeclinedError + | OrderStateTransitionError + | NoActiveOrderError + +export type TransitionOrderToStateResult = Order | OrderStateTransitionError + +export type SetCustomerForOrderResult = + | Order + | AlreadyLoggedInError + | EmailAddressConflictError + | NoActiveOrderError + +export type RegisterCustomerAccountResult = + | Success + | MissingPasswordError + | NativeAuthStrategyError + +export type RefreshCustomerVerificationResult = + | Success + | NativeAuthStrategyError + +export type VerifyCustomerAccountResult = + | CurrentUser + | VerificationTokenInvalidError + | VerificationTokenExpiredError + | MissingPasswordError + | PasswordAlreadySetError + | NativeAuthStrategyError + +export type UpdateCustomerPasswordResult = + | Success + | InvalidCredentialsError + | NativeAuthStrategyError + +export type RequestUpdateCustomerEmailAddressResult = + | Success + | InvalidCredentialsError + | EmailAddressConflictError + | NativeAuthStrategyError + +export type UpdateCustomerEmailAddressResult = + | Success + | IdentifierChangeTokenInvalidError + | IdentifierChangeTokenExpiredError + | NativeAuthStrategyError + +export type RequestPasswordResetResult = Success | NativeAuthStrategyError + +export type ResetPasswordResult = + | CurrentUser + | PasswordResetTokenInvalidError + | PasswordResetTokenExpiredError + | NativeAuthStrategyError + +export type NativeAuthenticationResult = + | CurrentUser + | InvalidCredentialsError + | NotVerifiedError + | NativeAuthStrategyError + +export type AuthenticationResult = + | CurrentUser + | InvalidCredentialsError + | NotVerifiedError + +export type ActiveOrderResult = Order | NoActiveOrderError + +export type CollectionFilterParameter = { + createdAt?: Maybe + updatedAt?: Maybe + languageCode?: Maybe + name?: Maybe + slug?: Maybe + position?: Maybe + description?: Maybe +} + +export type CollectionSortParameter = { + id?: Maybe + createdAt?: Maybe + updatedAt?: Maybe + name?: Maybe + slug?: Maybe + position?: Maybe + description?: Maybe +} + +export type ProductFilterParameter = { + createdAt?: Maybe + updatedAt?: Maybe + languageCode?: Maybe + name?: Maybe + slug?: Maybe + description?: Maybe +} + +export type ProductSortParameter = { + id?: Maybe + createdAt?: Maybe + updatedAt?: Maybe + name?: Maybe + slug?: Maybe + description?: Maybe +} + +export type ProductVariantFilterParameter = { + createdAt?: Maybe + updatedAt?: Maybe + languageCode?: Maybe + sku?: Maybe + name?: Maybe + price?: Maybe + currencyCode?: Maybe + priceWithTax?: Maybe + stockLevel?: Maybe + discountPrice?: Maybe +} + +export type ProductVariantSortParameter = { + id?: Maybe + productId?: Maybe + createdAt?: Maybe + updatedAt?: Maybe + sku?: Maybe + name?: Maybe + price?: Maybe + priceWithTax?: Maybe + stockLevel?: Maybe + discountPrice?: Maybe +} + +export type CustomerFilterParameter = { + createdAt?: Maybe + updatedAt?: Maybe + title?: Maybe + firstName?: Maybe + lastName?: Maybe + phoneNumber?: Maybe + emailAddress?: Maybe +} + +export type CustomerSortParameter = { + id?: Maybe + createdAt?: Maybe + updatedAt?: Maybe + title?: Maybe + firstName?: Maybe + lastName?: Maybe + phoneNumber?: Maybe + emailAddress?: Maybe +} + +export type OrderFilterParameter = { + createdAt?: Maybe + updatedAt?: Maybe + orderPlacedAt?: Maybe + code?: Maybe + state?: Maybe + active?: Maybe + totalQuantity?: Maybe + subTotal?: Maybe + subTotalWithTax?: Maybe + currencyCode?: Maybe + shipping?: Maybe + shippingWithTax?: Maybe + total?: Maybe + totalWithTax?: Maybe +} + +export type OrderSortParameter = { + id?: Maybe + createdAt?: Maybe + updatedAt?: Maybe + orderPlacedAt?: Maybe + code?: Maybe + state?: Maybe + totalQuantity?: Maybe + subTotal?: Maybe + subTotalWithTax?: Maybe + shipping?: Maybe + shippingWithTax?: Maybe + total?: Maybe + totalWithTax?: Maybe +} + +export type HistoryEntryFilterParameter = { + createdAt?: Maybe + updatedAt?: Maybe + type?: Maybe +} + +export type HistoryEntrySortParameter = { + id?: Maybe + createdAt?: Maybe + updatedAt?: Maybe +} + +export type ProductVariantCustomFields = { + __typename?: 'ProductVariantCustomFields' + discountPrice?: Maybe +} + +export type NativeAuthInput = { + username: Scalars['String'] + password: Scalars['String'] +} + +export type CartFragment = { __typename?: 'Order' } & Pick< + Order, + | 'id' + | 'code' + | 'createdAt' + | 'totalQuantity' + | 'subTotal' + | 'subTotalWithTax' + | 'total' + | 'totalWithTax' + | 'currencyCode' +> & { + customer?: Maybe<{ __typename?: 'Customer' } & Pick> + lines: Array< + { __typename?: 'OrderLine' } & Pick< + OrderLine, + | 'id' + | 'quantity' + | 'linePriceWithTax' + | 'discountedLinePriceWithTax' + | 'unitPriceWithTax' + | 'discountedUnitPriceWithTax' + > & { + featuredAsset?: Maybe< + { __typename?: 'Asset' } & Pick + > + discounts: Array< + { __typename?: 'Discount' } & Pick< + Discount, + 'description' | 'amount' + > + > + productVariant: { __typename?: 'ProductVariant' } & Pick< + ProductVariant, + | 'id' + | 'name' + | 'sku' + | 'price' + | 'priceWithTax' + | 'stockLevel' + | 'productId' + > & { product: { __typename?: 'Product' } & Pick } + } + > + } + +export type SearchResultFragment = { __typename?: 'SearchResult' } & Pick< + SearchResult, + 'productId' | 'productName' | 'description' | 'slug' | 'sku' | 'currencyCode' +> & { + productAsset?: Maybe< + { __typename?: 'SearchResultAsset' } & Pick< + SearchResultAsset, + 'id' | 'preview' + > + > + priceWithTax: + | ({ __typename?: 'PriceRange' } & Pick) + | ({ __typename?: 'SinglePrice' } & Pick) + } + +export type AddItemToOrderMutationVariables = Exact<{ + variantId: Scalars['ID'] + quantity: Scalars['Int'] +}> + +export type AddItemToOrderMutation = { __typename?: 'Mutation' } & { + addItemToOrder: + | ({ __typename: 'Order' } & CartFragment) + | ({ __typename: 'OrderModificationError' } & Pick< + OrderModificationError, + 'errorCode' | 'message' + >) + | ({ __typename: 'OrderLimitError' } & Pick< + OrderLimitError, + 'errorCode' | 'message' + >) + | ({ __typename: 'NegativeQuantityError' } & Pick< + NegativeQuantityError, + 'errorCode' | 'message' + >) + | ({ __typename: 'InsufficientStockError' } & Pick< + InsufficientStockError, + 'errorCode' | 'message' + >) +} + +export type AdjustOrderLineMutationVariables = Exact<{ + orderLineId: Scalars['ID'] + quantity: Scalars['Int'] +}> + +export type AdjustOrderLineMutation = { __typename?: 'Mutation' } & { + adjustOrderLine: + | ({ __typename: 'Order' } & CartFragment) + | ({ __typename: 'OrderModificationError' } & Pick< + OrderModificationError, + 'errorCode' | 'message' + >) + | ({ __typename: 'OrderLimitError' } & Pick< + OrderLimitError, + 'errorCode' | 'message' + >) + | ({ __typename: 'NegativeQuantityError' } & Pick< + NegativeQuantityError, + 'errorCode' | 'message' + >) + | ({ __typename: 'InsufficientStockError' } & Pick< + InsufficientStockError, + 'errorCode' | 'message' + >) +} + +export type LoginMutationVariables = Exact<{ + username: Scalars['String'] + password: Scalars['String'] +}> + +export type LoginMutation = { __typename?: 'Mutation' } & { + login: + | ({ __typename: 'CurrentUser' } & Pick) + | ({ __typename: 'InvalidCredentialsError' } & Pick< + InvalidCredentialsError, + 'errorCode' | 'message' + >) + | ({ __typename: 'NotVerifiedError' } & Pick< + NotVerifiedError, + 'errorCode' | 'message' + >) + | ({ __typename: 'NativeAuthStrategyError' } & Pick< + NativeAuthStrategyError, + 'errorCode' | 'message' + >) +} + +export type LogoutMutationVariables = Exact<{ [key: string]: never }> + +export type LogoutMutation = { __typename?: 'Mutation' } & { + logout: { __typename?: 'Success' } & Pick +} + +export type RemoveOrderLineMutationVariables = Exact<{ + orderLineId: Scalars['ID'] +}> + +export type RemoveOrderLineMutation = { __typename?: 'Mutation' } & { + removeOrderLine: + | ({ __typename: 'Order' } & CartFragment) + | ({ __typename: 'OrderModificationError' } & Pick< + OrderModificationError, + 'errorCode' | 'message' + >) +} + +export type SignupMutationVariables = Exact<{ + input: RegisterCustomerInput +}> + +export type SignupMutation = { __typename?: 'Mutation' } & { + registerCustomerAccount: + | ({ __typename: 'Success' } & Pick) + | ({ __typename: 'MissingPasswordError' } & Pick< + MissingPasswordError, + 'errorCode' | 'message' + >) + | ({ __typename: 'NativeAuthStrategyError' } & Pick< + NativeAuthStrategyError, + 'errorCode' | 'message' + >) +} + +export type ActiveCustomerQueryVariables = Exact<{ [key: string]: never }> + +export type ActiveCustomerQuery = { __typename?: 'Query' } & { + activeCustomer?: Maybe< + { __typename?: 'Customer' } & Pick< + Customer, + 'id' | 'firstName' | 'lastName' | 'emailAddress' + > + > +} + +export type GetAllProductPathsQueryVariables = Exact<{ + first?: Maybe +}> + +export type GetAllProductPathsQuery = { __typename?: 'Query' } & { + products: { __typename?: 'ProductList' } & { + items: Array<{ __typename?: 'Product' } & Pick> + } +} + +export type GetAllProductsQueryVariables = Exact<{ + input: SearchInput +}> + +export type GetAllProductsQuery = { __typename?: 'Query' } & { + search: { __typename?: 'SearchResponse' } & { + items: Array<{ __typename?: 'SearchResult' } & SearchResultFragment> + } +} + +export type ActiveOrderQueryVariables = Exact<{ [key: string]: never }> + +export type ActiveOrderQuery = { __typename?: 'Query' } & { + activeOrder?: Maybe<{ __typename?: 'Order' } & CartFragment> +} + +export type GetCollectionsQueryVariables = Exact<{ [key: string]: never }> + +export type GetCollectionsQuery = { __typename?: 'Query' } & { + collections: { __typename?: 'CollectionList' } & { + items: Array< + { __typename?: 'Collection' } & Pick< + Collection, + 'id' | 'name' | 'description' | 'slug' + > & { + productVariants: { __typename?: 'ProductVariantList' } & Pick< + ProductVariantList, + 'totalItems' + > + parent?: Maybe<{ __typename?: 'Collection' } & Pick> + children?: Maybe< + Array<{ __typename?: 'Collection' } & Pick> + > + } + > + } +} + +export type GetProductQueryVariables = Exact<{ + slug: Scalars['String'] +}> + +export type GetProductQuery = { __typename?: 'Query' } & { + product?: Maybe< + { __typename?: 'Product' } & Pick< + Product, + 'id' | 'name' | 'slug' | 'description' + > & { + assets: Array< + { __typename?: 'Asset' } & Pick + > + variants: Array< + { __typename?: 'ProductVariant' } & Pick< + ProductVariant, + 'id' | 'priceWithTax' | 'currencyCode' + > & { + options: Array< + { __typename?: 'ProductOption' } & Pick< + ProductOption, + 'id' | 'name' | 'code' | 'groupId' + > & { + group: { __typename?: 'ProductOptionGroup' } & Pick< + ProductOptionGroup, + 'id' + > & { + options: Array< + { __typename?: 'ProductOption' } & Pick< + ProductOption, + 'name' + > + > + } + } + > + } + > + optionGroups: Array< + { __typename?: 'ProductOptionGroup' } & Pick< + ProductOptionGroup, + 'id' | 'code' | 'name' + > & { + options: Array< + { __typename?: 'ProductOption' } & Pick< + ProductOption, + 'id' | 'name' + > + > + } + > + } + > +} + +export type SearchQueryVariables = Exact<{ + input: SearchInput +}> + +export type SearchQuery = { __typename?: 'Query' } & { + search: { __typename?: 'SearchResponse' } & Pick< + SearchResponse, + 'totalItems' + > & { items: Array<{ __typename?: 'SearchResult' } & SearchResultFragment> } +} diff --git a/packages/vendure/schema.graphql b/packages/vendure/schema.graphql new file mode 100644 index 0000000..326e2bc --- /dev/null +++ b/packages/vendure/schema.graphql @@ -0,0 +1,4162 @@ +type Query { + """ + The active Channel + """ + activeChannel: Channel! + + """ + The active Customer + """ + activeCustomer: Customer + + """ + The active Order. Will be `null` until an Order is created via `addItemToOrder`. Once an Order reaches the + state of `PaymentApproved` or `PaymentSettled`, then that Order is no longer considered "active" and this + query will once again return `null`. + """ + activeOrder: Order + + """ + An array of supported Countries + """ + availableCountries: [Country!]! + + """ + A list of Collections available to the shop + """ + collections(options: CollectionListOptions): CollectionList! + + """ + Returns a Collection either by its id or slug. If neither 'id' nor 'slug' is speicified, an error will result. + """ + collection(id: ID, slug: String): Collection + + """ + Returns a list of eligible shipping methods based on the current active Order + """ + eligibleShippingMethods: [ShippingMethodQuote!]! + + """ + Returns a list of payment methods and their eligibility based on the current active Order + """ + eligiblePaymentMethods: [PaymentMethodQuote!]! + + """ + Returns information about the current authenticated User + """ + me: CurrentUser + + """ + Returns the possible next states that the activeOrder can transition to + """ + nextOrderStates: [String!]! + + """ + Returns an Order based on the id. Note that in the Shop API, only orders belonging to the + currently-authenticated User may be queried. + """ + order(id: ID!): Order + + """ + Returns an Order based on the order `code`. For guest Orders (i.e. Orders placed by non-authenticated Customers) + this query will only return the Order within 2 hours of the Order being placed. This allows an Order confirmation + screen to be shown immediately after completion of a guest checkout, yet prevents security risks of allowing + general anonymous access to Order data. + """ + orderByCode(code: String!): Order + + """ + Get a Product either by id or slug. If neither 'id' nor 'slug' is speicified, an error will result. + """ + product(id: ID, slug: String): Product + + """ + Get a list of Products + """ + products(options: ProductListOptions): ProductList! + + """ + Search Products based on the criteria set by the `SearchInput` + """ + search(input: SearchInput!): SearchResponse! +} + +type Mutation { + """ + Adds an item to the order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available. + """ + addItemToOrder(productVariantId: ID!, quantity: Int!): UpdateOrderItemsResult! + + """ + Remove an OrderLine from the Order + """ + removeOrderLine(orderLineId: ID!): RemoveOrderItemsResult! + + """ + Remove all OrderLine from the Order + """ + removeAllOrderLines: RemoveOrderItemsResult! + + """ + Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available. + """ + adjustOrderLine(orderLineId: ID!, quantity: Int!): UpdateOrderItemsResult! + + """ + Applies the given coupon code to the active Order + """ + applyCouponCode(couponCode: String!): ApplyCouponCodeResult! + + """ + Removes the given coupon code from the active Order + """ + removeCouponCode(couponCode: String!): Order + + """ + Transitions an Order to a new state. Valid next states can be found by querying `nextOrderStates` + """ + transitionOrderToState(state: String!): TransitionOrderToStateResult + + """ + Sets the shipping address for this order + """ + setOrderShippingAddress(input: CreateAddressInput!): ActiveOrderResult! + + """ + Sets the billing address for this order + """ + setOrderBillingAddress(input: CreateAddressInput!): ActiveOrderResult! + + """ + Allows any custom fields to be set for the active order + """ + setOrderCustomFields(input: UpdateOrderInput!): ActiveOrderResult! + + """ + Sets the shipping method by id, which can be obtained with the `eligibleShippingMethods` query + """ + setOrderShippingMethod(shippingMethodId: ID!): SetOrderShippingMethodResult! + + """ + Add a Payment to the Order + """ + addPaymentToOrder(input: PaymentInput!): AddPaymentToOrderResult! + + """ + Set the Customer for the Order. Required only if the Customer is not currently logged in + """ + setCustomerForOrder(input: CreateCustomerInput!): SetCustomerForOrderResult! + + """ + Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` + """ + login( + username: String! + password: String! + rememberMe: Boolean + ): NativeAuthenticationResult! + + """ + Authenticates the user using a named authentication strategy + """ + authenticate( + input: AuthenticationInput! + rememberMe: Boolean + ): AuthenticationResult! + + """ + End the current authenticated session + """ + logout: Success! + + """ + Register a Customer account with the given credentials. There are three possible registration flows: + + _If `authOptions.requireVerification` is set to `true`:_ + + 1. **The Customer is registered _with_ a password**. A verificationToken will be created (and typically emailed to the Customer). That + verificationToken would then be passed to the `verifyCustomerAccount` mutation _without_ a password. The Customer is then + verified and authenticated in one step. + 2. **The Customer is registered _without_ a password**. A verificationToken will be created (and typically emailed to the Customer). That + verificationToken would then be passed to the `verifyCustomerAccount` mutation _with_ the chosed password of the Customer. The Customer is then + verified and authenticated in one step. + + _If `authOptions.requireVerification` is set to `false`:_ + + 3. The Customer _must_ be registered _with_ a password. No further action is needed - the Customer is able to authenticate immediately. + """ + registerCustomerAccount( + input: RegisterCustomerInput! + ): RegisterCustomerAccountResult! + + """ + Regenerate and send a verification token for a new Customer registration. Only applicable if `authOptions.requireVerification` is set to true. + """ + refreshCustomerVerification( + emailAddress: String! + ): RefreshCustomerVerificationResult! + + """ + Update an existing Customer + """ + updateCustomer(input: UpdateCustomerInput!): Customer! + + """ + Create a new Customer Address + """ + createCustomerAddress(input: CreateAddressInput!): Address! + + """ + Update an existing Address + """ + updateCustomerAddress(input: UpdateAddressInput!): Address! + + """ + Delete an existing Address + """ + deleteCustomerAddress(id: ID!): Success! + + """ + Verify a Customer email address with the token sent to that address. Only applicable if `authOptions.requireVerification` is set to true. + + If the Customer was not registered with a password in the `registerCustomerAccount` mutation, the a password _must_ be + provided here. + """ + verifyCustomerAccount( + token: String! + password: String + ): VerifyCustomerAccountResult! + + """ + Update the password of the active Customer + """ + updateCustomerPassword( + currentPassword: String! + newPassword: String! + ): UpdateCustomerPasswordResult! + + """ + Request to update the emailAddress of the active Customer. If `authOptions.requireVerification` is enabled + (as is the default), then the `identifierChangeToken` will be assigned to the current User and + a IdentifierChangeRequestEvent will be raised. This can then be used e.g. by the EmailPlugin to email + that verification token to the Customer, which is then used to verify the change of email address. + """ + requestUpdateCustomerEmailAddress( + password: String! + newEmailAddress: String! + ): RequestUpdateCustomerEmailAddressResult! + + """ + Confirm the update of the emailAddress with the provided token, which has been generated by the + `requestUpdateCustomerEmailAddress` mutation. + """ + updateCustomerEmailAddress(token: String!): UpdateCustomerEmailAddressResult! + + """ + Requests a password reset email to be sent + """ + requestPasswordReset(emailAddress: String!): RequestPasswordResetResult + + """ + Resets a Customer's password based on the provided token + """ + resetPassword(token: String!, password: String!): ResetPasswordResult! +} + +type Address implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + fullName: String + company: String + streetLine1: String! + streetLine2: String + city: String + province: String + postalCode: String + country: Country! + phoneNumber: String + defaultShippingAddress: Boolean + defaultBillingAddress: Boolean + customFields: JSON +} + +type Asset implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + name: String! + type: AssetType! + fileSize: Int! + mimeType: String! + width: Int! + height: Int! + source: String! + preview: String! + focalPoint: Coordinate + customFields: JSON +} + +type Coordinate { + x: Float! + y: Float! +} + +type AssetList implements PaginatedList { + items: [Asset!]! + totalItems: Int! +} + +enum AssetType { + IMAGE + VIDEO + BINARY +} + +type CurrentUser { + id: ID! + identifier: String! + channels: [CurrentUserChannel!]! +} + +type CurrentUserChannel { + id: ID! + token: String! + code: String! + permissions: [Permission!]! +} + +type Channel implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + code: String! + token: String! + defaultTaxZone: Zone + defaultShippingZone: Zone + defaultLanguageCode: LanguageCode! + currencyCode: CurrencyCode! + pricesIncludeTax: Boolean! + customFields: JSON +} + +type Collection implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode + name: String! + slug: String! + breadcrumbs: [CollectionBreadcrumb!]! + position: Int! + description: String! + featuredAsset: Asset + assets: [Asset!]! + parent: Collection + children: [Collection!] + filters: [ConfigurableOperation!]! + translations: [CollectionTranslation!]! + productVariants(options: ProductVariantListOptions): ProductVariantList! + customFields: JSON +} + +type CollectionBreadcrumb { + id: ID! + name: String! + slug: String! +} + +type CollectionTranslation { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + name: String! + slug: String! + description: String! +} + +type CollectionList implements PaginatedList { + items: [Collection!]! + totalItems: Int! +} + +type ProductVariantList implements PaginatedList { + items: [ProductVariant!]! + totalItems: Int! +} + +input ProductVariantListOptions { + skip: Int + take: Int + sort: ProductVariantSortParameter + filter: ProductVariantFilterParameter +} + +enum GlobalFlag { + TRUE + FALSE + INHERIT +} + +enum AdjustmentType { + PROMOTION + DISTRIBUTED_ORDER_PROMOTION +} + +enum DeletionResult { + """ + The entity was successfully deleted + """ + DELETED + + """ + Deletion did not take place, reason given in message + """ + NOT_DELETED +} + +""" +@description +Permissions for administrators and customers. Used to control access to +GraphQL resolvers via the {@link Allow} decorator. + +@docsCategory common +""" +enum Permission { + Placeholder + + """ + Authenticated means simply that the user is logged in + """ + Authenticated + + """ + SuperAdmin has unrestricted access to all operations + """ + SuperAdmin + + """ + Owner means the user owns this entity, e.g. a Customer's own Order + """ + Owner + + """ + Public means any unauthenticated user may perform the operation + """ + Public + + """ + Grants permission to update GlobalSettings + """ + UpdateGlobalSettings + + """ + Grants permission to create Products, Facets, Assets, Collections + """ + CreateCatalog + + """ + Grants permission to read Products, Facets, Assets, Collections + """ + ReadCatalog + + """ + Grants permission to update Products, Facets, Assets, Collections + """ + UpdateCatalog + + """ + Grants permission to delete Products, Facets, Assets, Collections + """ + DeleteCatalog + + """ + Grants permission to create PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings + """ + CreateSettings + + """ + Grants permission to read PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings + """ + ReadSettings + + """ + Grants permission to update PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings + """ + UpdateSettings + + """ + Grants permission to delete PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings + """ + DeleteSettings + + """ + Grants permission to create Administrator + """ + CreateAdministrator + + """ + Grants permission to read Administrator + """ + ReadAdministrator + + """ + Grants permission to update Administrator + """ + UpdateAdministrator + + """ + Grants permission to delete Administrator + """ + DeleteAdministrator + + """ + Grants permission to create Asset + """ + CreateAsset + + """ + Grants permission to read Asset + """ + ReadAsset + + """ + Grants permission to update Asset + """ + UpdateAsset + + """ + Grants permission to delete Asset + """ + DeleteAsset + + """ + Grants permission to create Channel + """ + CreateChannel + + """ + Grants permission to read Channel + """ + ReadChannel + + """ + Grants permission to update Channel + """ + UpdateChannel + + """ + Grants permission to delete Channel + """ + DeleteChannel + + """ + Grants permission to create Collection + """ + CreateCollection + + """ + Grants permission to read Collection + """ + ReadCollection + + """ + Grants permission to update Collection + """ + UpdateCollection + + """ + Grants permission to delete Collection + """ + DeleteCollection + + """ + Grants permission to create Country + """ + CreateCountry + + """ + Grants permission to read Country + """ + ReadCountry + + """ + Grants permission to update Country + """ + UpdateCountry + + """ + Grants permission to delete Country + """ + DeleteCountry + + """ + Grants permission to create Customer + """ + CreateCustomer + + """ + Grants permission to read Customer + """ + ReadCustomer + + """ + Grants permission to update Customer + """ + UpdateCustomer + + """ + Grants permission to delete Customer + """ + DeleteCustomer + + """ + Grants permission to create CustomerGroup + """ + CreateCustomerGroup + + """ + Grants permission to read CustomerGroup + """ + ReadCustomerGroup + + """ + Grants permission to update CustomerGroup + """ + UpdateCustomerGroup + + """ + Grants permission to delete CustomerGroup + """ + DeleteCustomerGroup + + """ + Grants permission to create Facet + """ + CreateFacet + + """ + Grants permission to read Facet + """ + ReadFacet + + """ + Grants permission to update Facet + """ + UpdateFacet + + """ + Grants permission to delete Facet + """ + DeleteFacet + + """ + Grants permission to create Order + """ + CreateOrder + + """ + Grants permission to read Order + """ + ReadOrder + + """ + Grants permission to update Order + """ + UpdateOrder + + """ + Grants permission to delete Order + """ + DeleteOrder + + """ + Grants permission to create PaymentMethod + """ + CreatePaymentMethod + + """ + Grants permission to read PaymentMethod + """ + ReadPaymentMethod + + """ + Grants permission to update PaymentMethod + """ + UpdatePaymentMethod + + """ + Grants permission to delete PaymentMethod + """ + DeletePaymentMethod + + """ + Grants permission to create Product + """ + CreateProduct + + """ + Grants permission to read Product + """ + ReadProduct + + """ + Grants permission to update Product + """ + UpdateProduct + + """ + Grants permission to delete Product + """ + DeleteProduct + + """ + Grants permission to create Promotion + """ + CreatePromotion + + """ + Grants permission to read Promotion + """ + ReadPromotion + + """ + Grants permission to update Promotion + """ + UpdatePromotion + + """ + Grants permission to delete Promotion + """ + DeletePromotion + + """ + Grants permission to create ShippingMethod + """ + CreateShippingMethod + + """ + Grants permission to read ShippingMethod + """ + ReadShippingMethod + + """ + Grants permission to update ShippingMethod + """ + UpdateShippingMethod + + """ + Grants permission to delete ShippingMethod + """ + DeleteShippingMethod + + """ + Grants permission to create Tag + """ + CreateTag + + """ + Grants permission to read Tag + """ + ReadTag + + """ + Grants permission to update Tag + """ + UpdateTag + + """ + Grants permission to delete Tag + """ + DeleteTag + + """ + Grants permission to create TaxCategory + """ + CreateTaxCategory + + """ + Grants permission to read TaxCategory + """ + ReadTaxCategory + + """ + Grants permission to update TaxCategory + """ + UpdateTaxCategory + + """ + Grants permission to delete TaxCategory + """ + DeleteTaxCategory + + """ + Grants permission to create TaxRate + """ + CreateTaxRate + + """ + Grants permission to read TaxRate + """ + ReadTaxRate + + """ + Grants permission to update TaxRate + """ + UpdateTaxRate + + """ + Grants permission to delete TaxRate + """ + DeleteTaxRate + + """ + Grants permission to create System + """ + CreateSystem + + """ + Grants permission to read System + """ + ReadSystem + + """ + Grants permission to update System + """ + UpdateSystem + + """ + Grants permission to delete System + """ + DeleteSystem + + """ + Grants permission to create Zone + """ + CreateZone + + """ + Grants permission to read Zone + """ + ReadZone + + """ + Grants permission to update Zone + """ + UpdateZone + + """ + Grants permission to delete Zone + """ + DeleteZone +} + +enum SortOrder { + ASC + DESC +} + +enum ErrorCode { + UNKNOWN_ERROR + NATIVE_AUTH_STRATEGY_ERROR + INVALID_CREDENTIALS_ERROR + ORDER_STATE_TRANSITION_ERROR + EMAIL_ADDRESS_CONFLICT_ERROR + ORDER_LIMIT_ERROR + NEGATIVE_QUANTITY_ERROR + INSUFFICIENT_STOCK_ERROR + ORDER_MODIFICATION_ERROR + INELIGIBLE_SHIPPING_METHOD_ERROR + ORDER_PAYMENT_STATE_ERROR + INELIGIBLE_PAYMENT_METHOD_ERROR + PAYMENT_FAILED_ERROR + PAYMENT_DECLINED_ERROR + COUPON_CODE_INVALID_ERROR + COUPON_CODE_EXPIRED_ERROR + COUPON_CODE_LIMIT_ERROR + ALREADY_LOGGED_IN_ERROR + MISSING_PASSWORD_ERROR + PASSWORD_ALREADY_SET_ERROR + VERIFICATION_TOKEN_INVALID_ERROR + VERIFICATION_TOKEN_EXPIRED_ERROR + IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR + IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR + PASSWORD_RESET_TOKEN_INVALID_ERROR + PASSWORD_RESET_TOKEN_EXPIRED_ERROR + NOT_VERIFIED_ERROR + NO_ACTIVE_ORDER_ERROR +} + +enum LogicalOperator { + AND + OR +} + +""" +Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. +""" +type NativeAuthStrategyError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned if the user authentication credentials are not valid +""" +type InvalidCredentialsError implements ErrorResult { + errorCode: ErrorCode! + message: String! + authenticationError: String! +} + +""" +Returned if there is an error in transitioning the Order state +""" +type OrderStateTransitionError implements ErrorResult { + errorCode: ErrorCode! + message: String! + transitionError: String! + fromState: String! + toState: String! +} + +""" +Retured when attemting to create a Customer with an email address already registered to an existing User. +""" +type EmailAddressConflictError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Retured when the maximum order size limit has been reached. +""" +type OrderLimitError implements ErrorResult { + errorCode: ErrorCode! + message: String! + maxItems: Int! +} + +""" +Retured when attemting to set a negative OrderLine quantity. +""" +type NegativeQuantityError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned when attempting to add more items to the Order than are available +""" +type InsufficientStockError implements ErrorResult { + errorCode: ErrorCode! + message: String! + quantityAvailable: Int! + order: Order! +} + +""" +The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). +""" +scalar JSON + +""" +A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. +""" +scalar DateTime + +""" +The `Upload` scalar type represents a file upload. +""" +scalar Upload + +interface PaginatedList { + items: [Node!]! + totalItems: Int! +} + +interface Node { + id: ID! +} + +interface ErrorResult { + errorCode: ErrorCode! + message: String! +} + +type Adjustment { + adjustmentSource: String! + type: AdjustmentType! + description: String! + amount: Int! +} + +type TaxLine { + description: String! + taxRate: Float! +} + +type ConfigArg { + name: String! + value: String! +} + +type ConfigArgDefinition { + name: String! + type: String! + list: Boolean! + required: Boolean! + defaultValue: JSON + label: String + description: String + ui: JSON +} + +type ConfigurableOperation { + code: String! + args: [ConfigArg!]! +} + +type ConfigurableOperationDefinition { + code: String! + args: [ConfigArgDefinition!]! + description: String! +} + +type DeletionResponse { + result: DeletionResult! + message: String +} + +input ConfigArgInput { + name: String! + + """ + A JSON stringified representation of the actual value + """ + value: String! +} + +input ConfigurableOperationInput { + code: String! + arguments: [ConfigArgInput!]! +} + +input StringOperators { + eq: String + notEq: String + contains: String + notContains: String + in: [String!] + notIn: [String!] + regex: String +} + +input BooleanOperators { + eq: Boolean +} + +input NumberRange { + start: Float! + end: Float! +} + +input NumberOperators { + eq: Float + lt: Float + lte: Float + gt: Float + gte: Float + between: NumberRange +} + +input DateRange { + start: DateTime! + end: DateTime! +} + +input DateOperators { + eq: DateTime + before: DateTime + after: DateTime + between: DateRange +} + +""" +Used to construct boolean expressions for filtering search results +by FacetValue ID. Examples: + +* ID=1 OR ID=2: `{ facetValueFilters: [{ or: [1,2] }] }` +* ID=1 AND ID=2: `{ facetValueFilters: [{ and: 1 }, { and: 2 }] }` +* ID=1 AND (ID=2 OR ID=3): `{ facetValueFilters: [{ and: 1 }, { or: [2,3] }] }` +""" +input FacetValueFilterInput { + and: ID + or: [ID!] +} + +input SearchInput { + term: String + facetValueIds: [ID!] + facetValueOperator: LogicalOperator + facetValueFilters: [FacetValueFilterInput!] + collectionId: ID + collectionSlug: String + groupByProduct: Boolean + take: Int + skip: Int + sort: SearchResultSortParameter +} + +input SearchResultSortParameter { + name: SortOrder + price: SortOrder +} + +input CreateCustomerInput { + title: String + firstName: String! + lastName: String! + phoneNumber: String + emailAddress: String! + customFields: JSON +} + +input CreateAddressInput { + fullName: String + company: String + streetLine1: String! + streetLine2: String + city: String + province: String + postalCode: String + countryCode: String! + phoneNumber: String + defaultShippingAddress: Boolean + defaultBillingAddress: Boolean + customFields: JSON +} + +input UpdateAddressInput { + id: ID! + fullName: String + company: String + streetLine1: String + streetLine2: String + city: String + province: String + postalCode: String + countryCode: String + phoneNumber: String + defaultShippingAddress: Boolean + defaultBillingAddress: Boolean + customFields: JSON +} + +""" +Indicates that an operation succeeded, where we do not want to return any more specific information. +""" +type Success { + success: Boolean! +} + +type ShippingMethodQuote { + id: ID! + price: Int! + priceWithTax: Int! + code: String! + name: String! + description: String! + + """ + Any optional metadata returned by the ShippingCalculator in the ShippingCalculationResult + """ + metadata: JSON +} + +type PaymentMethodQuote { + id: ID! + code: String! + name: String! + description: String! + isEligible: Boolean! + eligibilityMessage: String +} + +type Country implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + code: String! + name: String! + enabled: Boolean! + translations: [CountryTranslation!]! +} + +type CountryTranslation { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + name: String! +} + +type CountryList implements PaginatedList { + items: [Country!]! + totalItems: Int! +} + +""" +@description +ISO 4217 currency code + +@docsCategory common +""" +enum CurrencyCode { + """ + United Arab Emirates dirham + """ + AED + + """ + Afghan afghani + """ + AFN + + """ + Albanian lek + """ + ALL + + """ + Armenian dram + """ + AMD + + """ + Netherlands Antillean guilder + """ + ANG + + """ + Angolan kwanza + """ + AOA + + """ + Argentine peso + """ + ARS + + """ + Australian dollar + """ + AUD + + """ + Aruban florin + """ + AWG + + """ + Azerbaijani manat + """ + AZN + + """ + Bosnia and Herzegovina convertible mark + """ + BAM + + """ + Barbados dollar + """ + BBD + + """ + Bangladeshi taka + """ + BDT + + """ + Bulgarian lev + """ + BGN + + """ + Bahraini dinar + """ + BHD + + """ + Burundian franc + """ + BIF + + """ + Bermudian dollar + """ + BMD + + """ + Brunei dollar + """ + BND + + """ + Boliviano + """ + BOB + + """ + Brazilian real + """ + BRL + + """ + Bahamian dollar + """ + BSD + + """ + Bhutanese ngultrum + """ + BTN + + """ + Botswana pula + """ + BWP + + """ + Belarusian ruble + """ + BYN + + """ + Belize dollar + """ + BZD + + """ + Canadian dollar + """ + CAD + + """ + Congolese franc + """ + CDF + + """ + Swiss franc + """ + CHF + + """ + Chilean peso + """ + CLP + + """ + Renminbi (Chinese) yuan + """ + CNY + + """ + Colombian peso + """ + COP + + """ + Costa Rican colon + """ + CRC + + """ + Cuban convertible peso + """ + CUC + + """ + Cuban peso + """ + CUP + + """ + Cape Verde escudo + """ + CVE + + """ + Czech koruna + """ + CZK + + """ + Djiboutian franc + """ + DJF + + """ + Danish krone + """ + DKK + + """ + Dominican peso + """ + DOP + + """ + Algerian dinar + """ + DZD + + """ + Egyptian pound + """ + EGP + + """ + Eritrean nakfa + """ + ERN + + """ + Ethiopian birr + """ + ETB + + """ + Euro + """ + EUR + + """ + Fiji dollar + """ + FJD + + """ + Falkland Islands pound + """ + FKP + + """ + Pound sterling + """ + GBP + + """ + Georgian lari + """ + GEL + + """ + Ghanaian cedi + """ + GHS + + """ + Gibraltar pound + """ + GIP + + """ + Gambian dalasi + """ + GMD + + """ + Guinean franc + """ + GNF + + """ + Guatemalan quetzal + """ + GTQ + + """ + Guyanese dollar + """ + GYD + + """ + Hong Kong dollar + """ + HKD + + """ + Honduran lempira + """ + HNL + + """ + Croatian kuna + """ + HRK + + """ + Haitian gourde + """ + HTG + + """ + Hungarian forint + """ + HUF + + """ + Indonesian rupiah + """ + IDR + + """ + Israeli new shekel + """ + ILS + + """ + Indian rupee + """ + INR + + """ + Iraqi dinar + """ + IQD + + """ + Iranian rial + """ + IRR + + """ + Icelandic króna + """ + ISK + + """ + Jamaican dollar + """ + JMD + + """ + Jordanian dinar + """ + JOD + + """ + Japanese yen + """ + JPY + + """ + Kenyan shilling + """ + KES + + """ + Kyrgyzstani som + """ + KGS + + """ + Cambodian riel + """ + KHR + + """ + Comoro franc + """ + KMF + + """ + North Korean won + """ + KPW + + """ + South Korean won + """ + KRW + + """ + Kuwaiti dinar + """ + KWD + + """ + Cayman Islands dollar + """ + KYD + + """ + Kazakhstani tenge + """ + KZT + + """ + Lao kip + """ + LAK + + """ + Lebanese pound + """ + LBP + + """ + Sri Lankan rupee + """ + LKR + + """ + Liberian dollar + """ + LRD + + """ + Lesotho loti + """ + LSL + + """ + Libyan dinar + """ + LYD + + """ + Moroccan dirham + """ + MAD + + """ + Moldovan leu + """ + MDL + + """ + Malagasy ariary + """ + MGA + + """ + Macedonian denar + """ + MKD + + """ + Myanmar kyat + """ + MMK + + """ + Mongolian tögrög + """ + MNT + + """ + Macanese pataca + """ + MOP + + """ + Mauritanian ouguiya + """ + MRU + + """ + Mauritian rupee + """ + MUR + + """ + Maldivian rufiyaa + """ + MVR + + """ + Malawian kwacha + """ + MWK + + """ + Mexican peso + """ + MXN + + """ + Malaysian ringgit + """ + MYR + + """ + Mozambican metical + """ + MZN + + """ + Namibian dollar + """ + NAD + + """ + Nigerian naira + """ + NGN + + """ + Nicaraguan córdoba + """ + NIO + + """ + Norwegian krone + """ + NOK + + """ + Nepalese rupee + """ + NPR + + """ + New Zealand dollar + """ + NZD + + """ + Omani rial + """ + OMR + + """ + Panamanian balboa + """ + PAB + + """ + Peruvian sol + """ + PEN + + """ + Papua New Guinean kina + """ + PGK + + """ + Philippine peso + """ + PHP + + """ + Pakistani rupee + """ + PKR + + """ + Polish złoty + """ + PLN + + """ + Paraguayan guaraní + """ + PYG + + """ + Qatari riyal + """ + QAR + + """ + Romanian leu + """ + RON + + """ + Serbian dinar + """ + RSD + + """ + Russian ruble + """ + RUB + + """ + Rwandan franc + """ + RWF + + """ + Saudi riyal + """ + SAR + + """ + Solomon Islands dollar + """ + SBD + + """ + Seychelles rupee + """ + SCR + + """ + Sudanese pound + """ + SDG + + """ + Swedish krona/kronor + """ + SEK + + """ + Singapore dollar + """ + SGD + + """ + Saint Helena pound + """ + SHP + + """ + Sierra Leonean leone + """ + SLL + + """ + Somali shilling + """ + SOS + + """ + Surinamese dollar + """ + SRD + + """ + South Sudanese pound + """ + SSP + + """ + São Tomé and Príncipe dobra + """ + STN + + """ + Salvadoran colón + """ + SVC + + """ + Syrian pound + """ + SYP + + """ + Swazi lilangeni + """ + SZL + + """ + Thai baht + """ + THB + + """ + Tajikistani somoni + """ + TJS + + """ + Turkmenistan manat + """ + TMT + + """ + Tunisian dinar + """ + TND + + """ + Tongan paʻanga + """ + TOP + + """ + Turkish lira + """ + TRY + + """ + Trinidad and Tobago dollar + """ + TTD + + """ + New Taiwan dollar + """ + TWD + + """ + Tanzanian shilling + """ + TZS + + """ + Ukrainian hryvnia + """ + UAH + + """ + Ugandan shilling + """ + UGX + + """ + United States dollar + """ + USD + + """ + Uruguayan peso + """ + UYU + + """ + Uzbekistan som + """ + UZS + + """ + Venezuelan bolívar soberano + """ + VES + + """ + Vietnamese đồng + """ + VND + + """ + Vanuatu vatu + """ + VUV + + """ + Samoan tala + """ + WST + + """ + CFA franc BEAC + """ + XAF + + """ + East Caribbean dollar + """ + XCD + + """ + CFA franc BCEAO + """ + XOF + + """ + CFP franc (franc Pacifique) + """ + XPF + + """ + Yemeni rial + """ + YER + + """ + South African rand + """ + ZAR + + """ + Zambian kwacha + """ + ZMW + + """ + Zimbabwean dollar + """ + ZWL +} + +interface CustomField { + name: String! + type: String! + list: Boolean! + label: [LocalizedString!] + description: [LocalizedString!] + readonly: Boolean + internal: Boolean +} + +type StringCustomFieldConfig implements CustomField { + name: String! + type: String! + list: Boolean! + length: Int + label: [LocalizedString!] + description: [LocalizedString!] + readonly: Boolean + internal: Boolean + pattern: String + options: [StringFieldOption!] +} + +type StringFieldOption { + value: String! + label: [LocalizedString!] +} + +type LocaleStringCustomFieldConfig implements CustomField { + name: String! + type: String! + list: Boolean! + length: Int + label: [LocalizedString!] + description: [LocalizedString!] + readonly: Boolean + internal: Boolean + pattern: String +} + +type IntCustomFieldConfig implements CustomField { + name: String! + type: String! + list: Boolean! + label: [LocalizedString!] + description: [LocalizedString!] + readonly: Boolean + internal: Boolean + min: Int + max: Int + step: Int +} + +type FloatCustomFieldConfig implements CustomField { + name: String! + type: String! + list: Boolean! + label: [LocalizedString!] + description: [LocalizedString!] + readonly: Boolean + internal: Boolean + min: Float + max: Float + step: Float +} + +type BooleanCustomFieldConfig implements CustomField { + name: String! + type: String! + list: Boolean! + label: [LocalizedString!] + description: [LocalizedString!] + readonly: Boolean + internal: Boolean +} + +""" +Expects the same validation formats as the `` HTML element. +See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#Additional_attributes +""" +type DateTimeCustomFieldConfig implements CustomField { + name: String! + type: String! + list: Boolean! + label: [LocalizedString!] + description: [LocalizedString!] + readonly: Boolean + internal: Boolean + min: String + max: String + step: Int +} + +type RelationCustomFieldConfig implements CustomField { + name: String! + type: String! + list: Boolean! + label: [LocalizedString!] + description: [LocalizedString!] + readonly: Boolean + internal: Boolean + entity: String! + scalarFields: [String!]! +} + +type LocalizedString { + languageCode: LanguageCode! + value: String! +} + +union CustomFieldConfig = + StringCustomFieldConfig + | LocaleStringCustomFieldConfig + | IntCustomFieldConfig + | FloatCustomFieldConfig + | BooleanCustomFieldConfig + | DateTimeCustomFieldConfig + | RelationCustomFieldConfig + +type CustomerGroup implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + name: String! + customers(options: CustomerListOptions): CustomerList! +} + +input CustomerListOptions { + skip: Int + take: Int + sort: CustomerSortParameter + filter: CustomerFilterParameter +} + +type Customer implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + title: String + firstName: String! + lastName: String! + phoneNumber: String + emailAddress: String! + addresses: [Address!] + orders(options: OrderListOptions): OrderList! + user: User + customFields: JSON +} + +type CustomerList implements PaginatedList { + items: [Customer!]! + totalItems: Int! +} + +type FacetValue implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + facet: Facet! + name: String! + code: String! + translations: [FacetValueTranslation!]! + customFields: JSON +} + +type FacetValueTranslation { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + name: String! +} + +type Facet implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + name: String! + code: String! + values: [FacetValue!]! + translations: [FacetTranslation!]! + customFields: JSON +} + +type FacetTranslation { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + name: String! +} + +type FacetList implements PaginatedList { + items: [Facet!]! + totalItems: Int! +} + +type HistoryEntry implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + type: HistoryEntryType! + data: JSON! +} + +enum HistoryEntryType { + CUSTOMER_REGISTERED + CUSTOMER_VERIFIED + CUSTOMER_DETAIL_UPDATED + CUSTOMER_ADDED_TO_GROUP + CUSTOMER_REMOVED_FROM_GROUP + CUSTOMER_ADDRESS_CREATED + CUSTOMER_ADDRESS_UPDATED + CUSTOMER_ADDRESS_DELETED + CUSTOMER_PASSWORD_UPDATED + CUSTOMER_PASSWORD_RESET_REQUESTED + CUSTOMER_PASSWORD_RESET_VERIFIED + CUSTOMER_EMAIL_UPDATE_REQUESTED + CUSTOMER_EMAIL_UPDATE_VERIFIED + CUSTOMER_NOTE + ORDER_STATE_TRANSITION + ORDER_PAYMENT_TRANSITION + ORDER_FULFILLMENT + ORDER_CANCELLATION + ORDER_REFUND_TRANSITION + ORDER_FULFILLMENT_TRANSITION + ORDER_NOTE + ORDER_COUPON_APPLIED + ORDER_COUPON_REMOVED + ORDER_MODIFIED +} + +type HistoryEntryList implements PaginatedList { + items: [HistoryEntry!]! + totalItems: Int! +} + +input HistoryEntryListOptions { + skip: Int + take: Int + sort: HistoryEntrySortParameter + filter: HistoryEntryFilterParameter +} + +""" +@description +Languages in the form of a ISO 639-1 language code with optional +region or script modifier (e.g. de_AT). The selection available is based +on the [Unicode CLDR summary list](https://unicode-org.github.io/cldr-staging/charts/37/summary/root.html) +and includes the major spoken languages of the world and any widely-used variants. + +@docsCategory common +""" +enum LanguageCode { + """ + Afrikaans + """ + af + + """ + Akan + """ + ak + + """ + Albanian + """ + sq + + """ + Amharic + """ + am + + """ + Arabic + """ + ar + + """ + Armenian + """ + hy + + """ + Assamese + """ + as + + """ + Azerbaijani + """ + az + + """ + Bambara + """ + bm + + """ + Bangla + """ + bn + + """ + Basque + """ + eu + + """ + Belarusian + """ + be + + """ + Bosnian + """ + bs + + """ + Breton + """ + br + + """ + Bulgarian + """ + bg + + """ + Burmese + """ + my + + """ + Catalan + """ + ca + + """ + Chechen + """ + ce + + """ + Chinese + """ + zh + + """ + Simplified Chinese + """ + zh_Hans + + """ + Traditional Chinese + """ + zh_Hant + + """ + Church Slavic + """ + cu + + """ + Cornish + """ + kw + + """ + Corsican + """ + co + + """ + Croatian + """ + hr + + """ + Czech + """ + cs + + """ + Danish + """ + da + + """ + Dutch + """ + nl + + """ + Flemish + """ + nl_BE + + """ + Dzongkha + """ + dz + + """ + English + """ + en + + """ + Australian English + """ + en_AU + + """ + Canadian English + """ + en_CA + + """ + British English + """ + en_GB + + """ + American English + """ + en_US + + """ + Esperanto + """ + eo + + """ + Estonian + """ + et + + """ + Ewe + """ + ee + + """ + Faroese + """ + fo + + """ + Finnish + """ + fi + + """ + French + """ + fr + + """ + Canadian French + """ + fr_CA + + """ + Swiss French + """ + fr_CH + + """ + Fulah + """ + ff + + """ + Galician + """ + gl + + """ + Ganda + """ + lg + + """ + Georgian + """ + ka + + """ + German + """ + de + + """ + Austrian German + """ + de_AT + + """ + Swiss High German + """ + de_CH + + """ + Greek + """ + el + + """ + Gujarati + """ + gu + + """ + Haitian Creole + """ + ht + + """ + Hausa + """ + ha + + """ + Hebrew + """ + he + + """ + Hindi + """ + hi + + """ + Hungarian + """ + hu + + """ + Icelandic + """ + is + + """ + Igbo + """ + ig + + """ + Indonesian + """ + id + + """ + Interlingua + """ + ia + + """ + Irish + """ + ga + + """ + Italian + """ + it + + """ + Japanese + """ + ja + + """ + Javanese + """ + jv + + """ + Kalaallisut + """ + kl + + """ + Kannada + """ + kn + + """ + Kashmiri + """ + ks + + """ + Kazakh + """ + kk + + """ + Khmer + """ + km + + """ + Kikuyu + """ + ki + + """ + Kinyarwanda + """ + rw + + """ + Korean + """ + ko + + """ + Kurdish + """ + ku + + """ + Kyrgyz + """ + ky + + """ + Lao + """ + lo + + """ + Latin + """ + la + + """ + Latvian + """ + lv + + """ + Lingala + """ + ln + + """ + Lithuanian + """ + lt + + """ + Luba-Katanga + """ + lu + + """ + Luxembourgish + """ + lb + + """ + Macedonian + """ + mk + + """ + Malagasy + """ + mg + + """ + Malay + """ + ms + + """ + Malayalam + """ + ml + + """ + Maltese + """ + mt + + """ + Manx + """ + gv + + """ + Maori + """ + mi + + """ + Marathi + """ + mr + + """ + Mongolian + """ + mn + + """ + Nepali + """ + ne + + """ + North Ndebele + """ + nd + + """ + Northern Sami + """ + se + + """ + Norwegian Bokmål + """ + nb + + """ + Norwegian Nynorsk + """ + nn + + """ + Nyanja + """ + ny + + """ + Odia + """ + or + + """ + Oromo + """ + om + + """ + Ossetic + """ + os + + """ + Pashto + """ + ps + + """ + Persian + """ + fa + + """ + Dari + """ + fa_AF + + """ + Polish + """ + pl + + """ + Portuguese + """ + pt + + """ + Brazilian Portuguese + """ + pt_BR + + """ + European Portuguese + """ + pt_PT + + """ + Punjabi + """ + pa + + """ + Quechua + """ + qu + + """ + Romanian + """ + ro + + """ + Moldavian + """ + ro_MD + + """ + Romansh + """ + rm + + """ + Rundi + """ + rn + + """ + Russian + """ + ru + + """ + Samoan + """ + sm + + """ + Sango + """ + sg + + """ + Sanskrit + """ + sa + + """ + Scottish Gaelic + """ + gd + + """ + Serbian + """ + sr + + """ + Shona + """ + sn + + """ + Sichuan Yi + """ + ii + + """ + Sindhi + """ + sd + + """ + Sinhala + """ + si + + """ + Slovak + """ + sk + + """ + Slovenian + """ + sl + + """ + Somali + """ + so + + """ + Southern Sotho + """ + st + + """ + Spanish + """ + es + + """ + European Spanish + """ + es_ES + + """ + Mexican Spanish + """ + es_MX + + """ + Sundanese + """ + su + + """ + Swahili + """ + sw + + """ + Congo Swahili + """ + sw_CD + + """ + Swedish + """ + sv + + """ + Tajik + """ + tg + + """ + Tamil + """ + ta + + """ + Tatar + """ + tt + + """ + Telugu + """ + te + + """ + Thai + """ + th + + """ + Tibetan + """ + bo + + """ + Tigrinya + """ + ti + + """ + Tongan + """ + to + + """ + Turkish + """ + tr + + """ + Turkmen + """ + tk + + """ + Ukrainian + """ + uk + + """ + Urdu + """ + ur + + """ + Uyghur + """ + ug + + """ + Uzbek + """ + uz + + """ + Vietnamese + """ + vi + + """ + Volapük + """ + vo + + """ + Welsh + """ + cy + + """ + Western Frisian + """ + fy + + """ + Wolof + """ + wo + + """ + Xhosa + """ + xh + + """ + Yiddish + """ + yi + + """ + Yoruba + """ + yo + + """ + Zulu + """ + zu +} + +type Order implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + + """ + The date & time that the Order was placed, i.e. the Customer + completed the checkout and the Order is no longer "active" + """ + orderPlacedAt: DateTime + + """ + A unique code for the Order + """ + code: String! + state: String! + + """ + An order is active as long as the payment process has not been completed + """ + active: Boolean! + customer: Customer + shippingAddress: OrderAddress + billingAddress: OrderAddress + lines: [OrderLine!]! + + """ + Surcharges are arbitrary modifications to the Order total which are neither + ProductVariants nor discounts resulting from applied Promotions. For example, + one-off discounts based on customer interaction, or surcharges based on payment + methods. + """ + surcharges: [Surcharge!]! + discounts: [Discount!]! + + """ + An array of all coupon codes applied to the Order + """ + couponCodes: [String!]! + + """ + Promotions applied to the order. Only gets populated after the payment process has completed. + """ + promotions: [Promotion!]! + payments: [Payment!] + fulfillments: [Fulfillment!] + totalQuantity: Int! + + """ + The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level + discounts which have been prorated (proportionally distributed) amongst the OrderItems. + To get a total of all OrderLines which does not account for prorated discounts, use the + sum of `OrderLine.discountedLinePrice` values. + """ + subTotal: Int! + + """ + Same as subTotal, but inclusive of tax + """ + subTotalWithTax: Int! + currencyCode: CurrencyCode! + shippingLines: [ShippingLine!]! + shipping: Int! + shippingWithTax: Int! + + """ + Equal to subTotal plus shipping + """ + total: Int! + + """ + The final payable amount. Equal to subTotalWithTax plus shippingWithTax + """ + totalWithTax: Int! + + """ + A summary of the taxes being applied to this Order + """ + taxSummary: [OrderTaxSummary!]! + history(options: HistoryEntryListOptions): HistoryEntryList! + customFields: JSON +} + +""" +A summary of the taxes being applied to this order, grouped +by taxRate. +""" +type OrderTaxSummary { + """ + A description of this tax + """ + description: String! + + """ + The taxRate as a percentage + """ + taxRate: Float! + + """ + The total net price or OrderItems to which this taxRate applies + """ + taxBase: Int! + + """ + The total tax being applied to the Order at this taxRate + """ + taxTotal: Int! +} + +type OrderAddress { + fullName: String + company: String + streetLine1: String + streetLine2: String + city: String + province: String + postalCode: String + country: String + countryCode: String + phoneNumber: String + customFields: JSON +} + +type OrderList implements PaginatedList { + items: [Order!]! + totalItems: Int! +} + +type ShippingLine { + shippingMethod: ShippingMethod! + price: Int! + priceWithTax: Int! + discountedPrice: Int! + discountedPriceWithTax: Int! + discounts: [Discount!]! +} + +type Discount { + adjustmentSource: String! + type: AdjustmentType! + description: String! + amount: Int! + amountWithTax: Int! +} + +type OrderItem implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + cancelled: Boolean! + + """ + The price of a single unit, excluding tax and discounts + """ + unitPrice: Int! + + """ + The price of a single unit, including tax but excluding discounts + """ + unitPriceWithTax: Int! + + """ + The price of a single unit including discounts, excluding tax. + + If Order-level discounts have been applied, this will not be the + actual taxable unit price (see `proratedUnitPrice`), but is generally the + correct price to display to customers to avoid confusion + about the internal handling of distributed Order-level discounts. + """ + discountedUnitPrice: Int! + + """ + The price of a single unit including discounts and tax + """ + discountedUnitPriceWithTax: Int! + + """ + The actual unit price, taking into account both item discounts _and_ prorated (proportially-distributed) + Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax + and refund calculations. + """ + proratedUnitPrice: Int! + + """ + The proratedUnitPrice including tax + """ + proratedUnitPriceWithTax: Int! + unitTax: Int! + taxRate: Float! + adjustments: [Adjustment!]! + taxLines: [TaxLine!]! + fulfillment: Fulfillment + refundId: ID +} + +type OrderLine implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + productVariant: ProductVariant! + featuredAsset: Asset + + """ + The price of a single unit, excluding tax and discounts + """ + unitPrice: Int! + + """ + The price of a single unit, including tax but excluding discounts + """ + unitPriceWithTax: Int! + + """ + Non-zero if the unitPrice has changed since it was initially added to Order + """ + unitPriceChangeSinceAdded: Int! + + """ + Non-zero if the unitPriceWithTax has changed since it was initially added to Order + """ + unitPriceWithTaxChangeSinceAdded: Int! + + """ + The price of a single unit including discounts, excluding tax. + + If Order-level discounts have been applied, this will not be the + actual taxable unit price (see `proratedUnitPrice`), but is generally the + correct price to display to customers to avoid confusion + about the internal handling of distributed Order-level discounts. + """ + discountedUnitPrice: Int! + + """ + The price of a single unit including discounts and tax + """ + discountedUnitPriceWithTax: Int! + + """ + The actual unit price, taking into account both item discounts _and_ prorated (proportially-distributed) + Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax + and refund calculations. + """ + proratedUnitPrice: Int! + + """ + The proratedUnitPrice including tax + """ + proratedUnitPriceWithTax: Int! + quantity: Int! + items: [OrderItem!]! + taxRate: Float! + + """ + The total price of the line excluding tax and discounts. + """ + linePrice: Int! + + """ + The total price of the line including tax bit excluding discounts. + """ + linePriceWithTax: Int! + + """ + The price of the line including discounts, excluding tax + """ + discountedLinePrice: Int! + + """ + The price of the line including discounts and tax + """ + discountedLinePriceWithTax: Int! + + """ + The actual line price, taking into account both item discounts _and_ prorated (proportially-distributed) + Order-level discounts. This value is the true economic value of the OrderLine, and is used in tax + and refund calculations. + """ + proratedLinePrice: Int! + + """ + The proratedLinePrice including tax + """ + proratedLinePriceWithTax: Int! + + """ + The total tax on this line + """ + lineTax: Int! + discounts: [Discount!]! + taxLines: [TaxLine!]! + order: Order! + customFields: JSON +} + +type Payment implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + method: String! + amount: Int! + state: String! + transactionId: String + errorMessage: String + refunds: [Refund!]! + metadata: JSON +} + +type Refund implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + items: Int! + shipping: Int! + adjustment: Int! + total: Int! + method: String + state: String! + transactionId: String + reason: String + orderItems: [OrderItem!]! + paymentId: ID! + metadata: JSON +} + +type Fulfillment implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + orderItems: [OrderItem!]! + state: String! + method: String! + trackingCode: String + customFields: JSON +} + +type Surcharge implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + description: String! + sku: String + taxLines: [TaxLine!]! + price: Int! + priceWithTax: Int! + taxRate: Float! +} + +type ProductOptionGroup implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + code: String! + name: String! + options: [ProductOption!]! + translations: [ProductOptionGroupTranslation!]! + customFields: JSON +} + +type ProductOptionGroupTranslation { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + name: String! +} + +type ProductOption implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + code: String! + name: String! + groupId: ID! + group: ProductOptionGroup! + translations: [ProductOptionTranslation!]! + customFields: JSON +} + +type ProductOptionTranslation { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + name: String! +} + +type SearchReindexResponse { + success: Boolean! +} + +type SearchResponse { + items: [SearchResult!]! + totalItems: Int! + facetValues: [FacetValueResult!]! +} + +""" +Which FacetValues are present in the products returned +by the search, and in what quantity. +""" +type FacetValueResult { + facetValue: FacetValue! + count: Int! +} + +type SearchResultAsset { + id: ID! + preview: String! + focalPoint: Coordinate +} + +type SearchResult { + sku: String! + slug: String! + productId: ID! + productName: String! + productAsset: SearchResultAsset + productVariantId: ID! + productVariantName: String! + productVariantAsset: SearchResultAsset + price: SearchResultPrice! + priceWithTax: SearchResultPrice! + currencyCode: CurrencyCode! + description: String! + facetIds: [ID!]! + facetValueIds: [ID!]! + + """ + An array of ids of the Collections in which this result appears + """ + collectionIds: [ID!]! + + """ + A relevence score for the result. Differs between database implementations + """ + score: Float! +} + +""" +The price of a search result product, either as a range or as a single price +""" +union SearchResultPrice = PriceRange | SinglePrice + +""" +The price value where the result has a single price +""" +type SinglePrice { + value: Int! +} + +""" +The price range where the result has more than one price +""" +type PriceRange { + min: Int! + max: Int! +} + +type Product implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + name: String! + slug: String! + description: String! + featuredAsset: Asset + assets: [Asset!]! + variants: [ProductVariant!]! + optionGroups: [ProductOptionGroup!]! + facetValues: [FacetValue!]! + translations: [ProductTranslation!]! + collections: [Collection!]! + customFields: JSON +} + +type ProductTranslation { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + name: String! + slug: String! + description: String! +} + +type ProductList implements PaginatedList { + items: [Product!]! + totalItems: Int! +} + +type ProductVariant implements Node { + id: ID! + product: Product! + productId: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + sku: String! + name: String! + featuredAsset: Asset + assets: [Asset!]! + price: Int! + currencyCode: CurrencyCode! + priceWithTax: Int! + stockLevel: String! + taxRateApplied: TaxRate! + taxCategory: TaxCategory! + options: [ProductOption!]! + facetValues: [FacetValue!]! + translations: [ProductVariantTranslation!]! + customFields: ProductVariantCustomFields +} + +type ProductVariantTranslation { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + name: String! +} + +type Promotion implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + startsAt: DateTime + endsAt: DateTime + couponCode: String + perCustomerUsageLimit: Int + name: String! + enabled: Boolean! + conditions: [ConfigurableOperation!]! + actions: [ConfigurableOperation!]! +} + +type PromotionList implements PaginatedList { + items: [Promotion!]! + totalItems: Int! +} + +type Role implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + code: String! + description: String! + permissions: [Permission!]! + channels: [Channel!]! +} + +type RoleList implements PaginatedList { + items: [Role!]! + totalItems: Int! +} + +type ShippingMethod implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + code: String! + name: String! + description: String! + fulfillmentHandlerCode: String! + checker: ConfigurableOperation! + calculator: ConfigurableOperation! + translations: [ShippingMethodTranslation!]! + customFields: JSON +} + +type ShippingMethodTranslation { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + languageCode: LanguageCode! + name: String! + description: String! +} + +type ShippingMethodList implements PaginatedList { + items: [ShippingMethod!]! + totalItems: Int! +} + +type Tag implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + value: String! +} + +type TagList implements PaginatedList { + items: [Tag!]! + totalItems: Int! +} + +type TaxCategory implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + name: String! + isDefault: Boolean! +} + +type TaxRate implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + name: String! + enabled: Boolean! + value: Float! + category: TaxCategory! + zone: Zone! + customerGroup: CustomerGroup +} + +type TaxRateList implements PaginatedList { + items: [TaxRate!]! + totalItems: Int! +} + +type User implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + identifier: String! + verified: Boolean! + roles: [Role!]! + lastLogin: DateTime + authenticationMethods: [AuthenticationMethod!]! + customFields: JSON +} + +type AuthenticationMethod implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + strategy: String! +} + +type Zone implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + name: String! + members: [Country!]! +} + +""" +Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state. +""" +type OrderModificationError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned when attempting to set a ShippingMethod for which the Order is not eligible +""" +type IneligibleShippingMethodError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state. +""" +type OrderPaymentStateError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned when attempting to add a Payment using a PaymentMethod for which the Order is not eligible. +""" +type IneligiblePaymentMethodError implements ErrorResult { + errorCode: ErrorCode! + message: String! + eligibilityCheckerMessage: String +} + +""" +Returned when a Payment fails due to an error. +""" +type PaymentFailedError implements ErrorResult { + errorCode: ErrorCode! + message: String! + paymentErrorMessage: String! +} + +""" +Returned when a Payment is declined by the payment provider. +""" +type PaymentDeclinedError implements ErrorResult { + errorCode: ErrorCode! + message: String! + paymentErrorMessage: String! +} + +""" +Returned if the provided coupon code is invalid +""" +type CouponCodeInvalidError implements ErrorResult { + errorCode: ErrorCode! + message: String! + couponCode: String! +} + +""" +Returned if the provided coupon code is invalid +""" +type CouponCodeExpiredError implements ErrorResult { + errorCode: ErrorCode! + message: String! + couponCode: String! +} + +""" +Returned if the provided coupon code is invalid +""" +type CouponCodeLimitError implements ErrorResult { + errorCode: ErrorCode! + message: String! + couponCode: String! + limit: Int! +} + +""" +Retured when attemting to set the Customer for an Order when already logged in. +""" +type AlreadyLoggedInError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Retured when attemting to register or verify a customer account without a password, when one is required. +""" +type MissingPasswordError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Retured when attemting to verify a customer account with a password, when a password has already been set. +""" +type PasswordAlreadySetError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Retured if the verification token (used to verify a Customer's email address) is either +invalid or does not match any expected tokens. +""" +type VerificationTokenInvalidError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned if the verification token (used to verify a Customer's email address) is valid, but has +expired according to the `verificationTokenDuration` setting in the AuthOptions. +""" +type VerificationTokenExpiredError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Retured if the token used to change a Customer's email address is either +invalid or does not match any expected tokens. +""" +type IdentifierChangeTokenInvalidError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Retured if the token used to change a Customer's email address is valid, but has +expired according to the `verificationTokenDuration` setting in the AuthOptions. +""" +type IdentifierChangeTokenExpiredError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Retured if the token used to reset a Customer's password is either +invalid or does not match any expected tokens. +""" +type PasswordResetTokenInvalidError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Retured if the token used to reset a Customer's password is valid, but has +expired according to the `verificationTokenDuration` setting in the AuthOptions. +""" +type PasswordResetTokenExpiredError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned if `authOptions.requireVerification` is set to `true` (which is the default) +and an unverified user attempts to authenticate. +""" +type NotVerifiedError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned when invoking a mutation which depends on there being an active Order on the +current session. +""" +type NoActiveOrderError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +input AuthenticationInput { + native: NativeAuthInput +} + +input RegisterCustomerInput { + emailAddress: String! + title: String + firstName: String + lastName: String + phoneNumber: String + password: String +} + +input UpdateCustomerInput { + title: String + firstName: String + lastName: String + phoneNumber: String + customFields: JSON +} + +input UpdateOrderInput { + customFields: JSON +} + +""" +Passed as input to the `addPaymentToOrder` mutation. +""" +input PaymentInput { + """ + This field should correspond to the `code` property of a PaymentMethodHandler. + """ + method: String! + + """ + This field should contain arbitrary data passed to the specified PaymentMethodHandler's `createPayment()` method + as the "metadata" argument. For example, it could contain an ID for the payment and other + data generated by the payment provider. + """ + metadata: JSON! +} + +input CollectionListOptions { + skip: Int + take: Int + sort: CollectionSortParameter + filter: CollectionFilterParameter +} + +input OrderListOptions { + skip: Int + take: Int + sort: OrderSortParameter + filter: OrderFilterParameter +} + +input ProductListOptions { + skip: Int + take: Int + sort: ProductSortParameter + filter: ProductFilterParameter +} + +union UpdateOrderItemsResult = + Order + | OrderModificationError + | OrderLimitError + | NegativeQuantityError + | InsufficientStockError + +union RemoveOrderItemsResult = Order | OrderModificationError + +union SetOrderShippingMethodResult = + Order + | OrderModificationError + | IneligibleShippingMethodError + | NoActiveOrderError + +union ApplyCouponCodeResult = + Order + | CouponCodeExpiredError + | CouponCodeInvalidError + | CouponCodeLimitError + +union AddPaymentToOrderResult = + Order + | OrderPaymentStateError + | IneligiblePaymentMethodError + | PaymentFailedError + | PaymentDeclinedError + | OrderStateTransitionError + | NoActiveOrderError + +union TransitionOrderToStateResult = Order | OrderStateTransitionError + +union SetCustomerForOrderResult = + Order + | AlreadyLoggedInError + | EmailAddressConflictError + | NoActiveOrderError + +union RegisterCustomerAccountResult = + Success + | MissingPasswordError + | NativeAuthStrategyError + +union RefreshCustomerVerificationResult = Success | NativeAuthStrategyError + +union VerifyCustomerAccountResult = + CurrentUser + | VerificationTokenInvalidError + | VerificationTokenExpiredError + | MissingPasswordError + | PasswordAlreadySetError + | NativeAuthStrategyError + +union UpdateCustomerPasswordResult = + Success + | InvalidCredentialsError + | NativeAuthStrategyError + +union RequestUpdateCustomerEmailAddressResult = + Success + | InvalidCredentialsError + | EmailAddressConflictError + | NativeAuthStrategyError + +union UpdateCustomerEmailAddressResult = + Success + | IdentifierChangeTokenInvalidError + | IdentifierChangeTokenExpiredError + | NativeAuthStrategyError + +union RequestPasswordResetResult = Success | NativeAuthStrategyError + +union ResetPasswordResult = + CurrentUser + | PasswordResetTokenInvalidError + | PasswordResetTokenExpiredError + | NativeAuthStrategyError + +union NativeAuthenticationResult = + CurrentUser + | InvalidCredentialsError + | NotVerifiedError + | NativeAuthStrategyError + +union AuthenticationResult = + CurrentUser + | InvalidCredentialsError + | NotVerifiedError + +union ActiveOrderResult = Order | NoActiveOrderError + +input CollectionFilterParameter { + createdAt: DateOperators + updatedAt: DateOperators + languageCode: StringOperators + name: StringOperators + slug: StringOperators + position: NumberOperators + description: StringOperators +} + +input CollectionSortParameter { + id: SortOrder + createdAt: SortOrder + updatedAt: SortOrder + name: SortOrder + slug: SortOrder + position: SortOrder + description: SortOrder +} + +input ProductFilterParameter { + createdAt: DateOperators + updatedAt: DateOperators + languageCode: StringOperators + name: StringOperators + slug: StringOperators + description: StringOperators +} + +input ProductSortParameter { + id: SortOrder + createdAt: SortOrder + updatedAt: SortOrder + name: SortOrder + slug: SortOrder + description: SortOrder +} + +input ProductVariantFilterParameter { + createdAt: DateOperators + updatedAt: DateOperators + languageCode: StringOperators + sku: StringOperators + name: StringOperators + price: NumberOperators + currencyCode: StringOperators + priceWithTax: NumberOperators + stockLevel: StringOperators + discountPrice: NumberOperators +} + +input ProductVariantSortParameter { + id: SortOrder + productId: SortOrder + createdAt: SortOrder + updatedAt: SortOrder + sku: SortOrder + name: SortOrder + price: SortOrder + priceWithTax: SortOrder + stockLevel: SortOrder + discountPrice: SortOrder +} + +input CustomerFilterParameter { + createdAt: DateOperators + updatedAt: DateOperators + title: StringOperators + firstName: StringOperators + lastName: StringOperators + phoneNumber: StringOperators + emailAddress: StringOperators +} + +input CustomerSortParameter { + id: SortOrder + createdAt: SortOrder + updatedAt: SortOrder + title: SortOrder + firstName: SortOrder + lastName: SortOrder + phoneNumber: SortOrder + emailAddress: SortOrder +} + +input OrderFilterParameter { + createdAt: DateOperators + updatedAt: DateOperators + orderPlacedAt: DateOperators + code: StringOperators + state: StringOperators + active: BooleanOperators + totalQuantity: NumberOperators + subTotal: NumberOperators + subTotalWithTax: NumberOperators + currencyCode: StringOperators + shipping: NumberOperators + shippingWithTax: NumberOperators + total: NumberOperators + totalWithTax: NumberOperators +} + +input OrderSortParameter { + id: SortOrder + createdAt: SortOrder + updatedAt: SortOrder + orderPlacedAt: SortOrder + code: SortOrder + state: SortOrder + totalQuantity: SortOrder + subTotal: SortOrder + subTotalWithTax: SortOrder + shipping: SortOrder + shippingWithTax: SortOrder + total: SortOrder + totalWithTax: SortOrder +} + +input HistoryEntryFilterParameter { + createdAt: DateOperators + updatedAt: DateOperators + type: StringOperators +} + +input HistoryEntrySortParameter { + id: SortOrder + createdAt: SortOrder + updatedAt: SortOrder +} + +type ProductVariantCustomFields { + discountPrice: Int +} + +input NativeAuthInput { + username: String! + password: String! +} 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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /dev/null +++ b/packages/vendure/src/api/endpoints/catalog/products.ts @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/vendure/src/api/endpoints/checkout/index.ts b/packages/vendure/src/api/endpoints/checkout/index.ts new file mode 100644 index 0000000..e063dbf --- /dev/null +++ b/packages/vendure/src/api/endpoints/checkout/index.ts @@ -0,0 +1,58 @@ +import { NextApiHandler } from 'next' +import { CommerceAPI, createEndpoint, GetAPISchema } from '@vercel/commerce/api' +import { CheckoutSchema } from '@vercel/commerce/types/checkout' +import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout' + +const getCheckout: CheckoutEndpoint['handlers']['getCheckout'] = async ({ + req, + res, + config, +}) => { + try { + const html = ` + + + + + + Checkout + + +

+ + + +

Checkout not yet implemented :(

+

+ See #64 +

+
+ + + ` + + res.status(200) + res.setHeader('Content-Type', 'text/html') + res.write(html) + res.end() + } catch (error) { + console.error(error) + + const message = 'An unexpected error ocurred' + + res.status(500).json({ data: null, errors: [{ message }] }) + } +} + +export type CheckoutAPI = GetAPISchema + +export type CheckoutEndpoint = CheckoutAPI['endpoint'] + +export const handlers: CheckoutEndpoint['handlers'] = { getCheckout } + +const checkoutApi = createEndpoint({ + handler: checkoutEndpoint, + handlers, +}) + +export default checkoutApi 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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /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 0000000..491bf0a --- /dev/null +++ b/packages/vendure/src/api/endpoints/wishlist/index.tsx @@ -0,0 +1 @@ +export default function noopApi(...args: any[]): void {} diff --git a/packages/vendure/src/api/index.ts b/packages/vendure/src/api/index.ts new file mode 100644 index 0000000..cbe56be --- /dev/null +++ b/packages/vendure/src/api/index.ts @@ -0,0 +1,56 @@ +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' +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 VendureConfig extends CommerceAPIConfig {} + +const API_URL = process.env.NEXT_PUBLIC_VENDURE_SHOP_API_URL + +if (!API_URL) { + throw new Error( + `The environment variable NEXT_PUBLIC_VENDURE_SHOP_API_URL is missing and it's required to access your store` + ) +} + +const ONE_DAY = 60 * 60 * 24 +const config: VendureConfig = { + commerceUrl: API_URL, + apiToken: '', + cartCookie: '', + customerCookie: '', + cartCookieMaxAge: ONE_DAY * 30, + fetch: fetchGraphqlApi, +} + +const operations = { + login, + getAllPages, + getPage, + getSiteInfo, + getCustomerWishlist, + getAllProductPaths, + getAllProducts, + getProduct, +} + +export const provider = { config, operations } + +export type Provider = typeof provider + +export function getCommerceApi

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

{ + return commerceApi(customProvider) +} diff --git a/packages/vendure/src/api/operations/get-all-pages.ts b/packages/vendure/src/api/operations/get-all-pages.ts new file mode 100644 index 0000000..7865cf9 --- /dev/null +++ b/packages/vendure/src/api/operations/get-all-pages.ts @@ -0,0 +1,40 @@ +import { VendureConfig } from '../' +import { OperationContext } from '@vercel/commerce/api/operations' +import { Provider } from '../' + +export type Page = any + +export type GetAllPagesResult = + T + +export default function getAllPagesOperation({ + commerce, +}: OperationContext) { + async function getAllPages(opts?: { + config?: Partial + preview?: boolean + }): Promise + + async function getAllPages(opts: { + url: string + config?: Partial + preview?: boolean + }): Promise> + + async function getAllPages({ + config: cfg, + preview, + }: { + url?: string + config?: Partial + preview?: boolean + } = {}): Promise { + const config = commerce.getConfig(cfg) + + return { + pages: [], + } + } + + return getAllPages +} diff --git a/packages/vendure/src/api/operations/get-all-product-paths.ts b/packages/vendure/src/api/operations/get-all-product-paths.ts new file mode 100644 index 0000000..bdb4797 --- /dev/null +++ b/packages/vendure/src/api/operations/get-all-product-paths.ts @@ -0,0 +1,55 @@ +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 '@vercel/commerce/types/product' +import { VendureConfig } from '../' + +export type GetAllProductPathsResult = { + products: Array<{ node: { path: string } }> +} + +export default function getAllProductPathsOperation({ + commerce, +}: OperationContext) { + async function getAllProductPaths< + T extends GetAllProductPathsOperation + >(opts?: { + variables?: T['variables'] + config?: VendureConfig + }): Promise + + async function getAllProductPaths( + opts: { + variables?: T['variables'] + config?: VendureConfig + } & OperationOptions + ): Promise + + async function getAllProductPaths({ + query = getAllProductPathsQuery, + variables, + config: cfg, + }: { + query?: string + variables?: T['variables'] + config?: VendureConfig + } = {}): Promise { + const config = commerce.getConfig(cfg) + // RecursivePartial forces the method to check for every prop in the data, which is + // required in case there's a custom `query` + const { data } = await config.fetch(query, { + variables, + }) + const products = data.products.items + + return { + products: products.map((p) => ({ path: `/${p.slug}` })), + } + } + + return getAllProductPaths +} diff --git a/packages/vendure/src/api/operations/get-all-products.ts b/packages/vendure/src/api/operations/get-all-products.ts new file mode 100644 index 0000000..f609ac8 --- /dev/null +++ b/packages/vendure/src/api/operations/get-all-products.ts @@ -0,0 +1,46 @@ +import { Product } from '@vercel/commerce/types/product' +import { Provider, VendureConfig } from '../' +import { GetAllProductsQuery } from '../../../schema' +import { normalizeSearchResult } from '../../utils/normalize' +import { getAllProductsQuery } from '../../utils/queries/get-all-products-query' +import { OperationContext } from '@vercel/commerce/api/operations' + +export type ProductVariables = { first?: number } + +export default function getAllProductsOperation({ + commerce, +}: OperationContext) { + async function getAllProducts(opts?: { + variables?: ProductVariables + config?: Partial + preview?: boolean + }): Promise<{ products: Product[] }> + + async function getAllProducts({ + query = getAllProductsQuery, + variables: { ...vars } = {}, + config: cfg, + }: { + query?: string + variables?: ProductVariables + config?: Partial + preview?: boolean + } = {}): Promise<{ products: Product[] | any[] }> { + const config = commerce.getConfig(cfg) + const variables = { + input: { + take: vars.first, + groupByProduct: true, + }, + } + const { data } = await config.fetch(query, { + variables, + }) + + return { + products: data.search.items.map((item) => normalizeSearchResult(item)), + } + } + + return getAllProducts +} diff --git a/packages/vendure/src/api/operations/get-customer-wishlist.ts b/packages/vendure/src/api/operations/get-customer-wishlist.ts new file mode 100644 index 0000000..35fca53 --- /dev/null +++ b/packages/vendure/src/api/operations/get-customer-wishlist.ts @@ -0,0 +1,23 @@ +import { OperationContext } from '@vercel/commerce/api/operations' +import { Provider, VendureConfig } from '../' + +export default function getCustomerWishlistOperation({ + commerce, +}: OperationContext) { + async function getCustomerWishlist({ + config: cfg, + variables, + includeProducts, + }: { + url?: string + variables: any + config?: Partial + includeProducts?: boolean + }): Promise { + // Not implemented as Vendure does not ship with wishlist functionality at present + const config = commerce.getConfig(cfg) + return { wishlist: {} } + } + + return getCustomerWishlist +} diff --git a/packages/vendure/src/api/operations/get-page.ts b/packages/vendure/src/api/operations/get-page.ts new file mode 100644 index 0000000..909277b --- /dev/null +++ b/packages/vendure/src/api/operations/get-page.ts @@ -0,0 +1,45 @@ +import { VendureConfig, Provider } from '../' +import { OperationContext } from '@vercel/commerce/api/operations' + +export type Page = any + +export type GetPageResult = T + +export type PageVariables = { + id: number +} + +export default function getPageOperation({ + commerce, +}: OperationContext) { + async function getPage(opts: { + url?: string + variables: PageVariables + config?: Partial + preview?: boolean + }): Promise + + async function getPage(opts: { + url: string + variables: V + config?: Partial + preview?: boolean + }): Promise> + + async function getPage({ + url, + variables, + config: cfg, + preview, + }: { + url?: string + variables: PageVariables + config?: Partial + preview?: boolean + }): Promise { + const config = commerce.getConfig(cfg) + return {} + } + + return getPage +} diff --git a/packages/vendure/src/api/operations/get-product.ts b/packages/vendure/src/api/operations/get-product.ts new file mode 100644 index 0000000..6b58e96 --- /dev/null +++ b/packages/vendure/src/api/operations/get-product.ts @@ -0,0 +1,69 @@ +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 '../../utils/queries/get-product-query' + +export default function getProductOperation({ + commerce, +}: OperationContext) { + async function getProduct({ + query = getProductQuery, + variables, + config: cfg, + }: { + query?: string + variables: { slug: string } + config?: Partial + preview?: boolean + }): Promise { + const config = commerce.getConfig(cfg) + + const locale = config.locale + const { data } = await config.fetch(query, { variables }) + const product = data.product + + if (product) { + const getOptionGroupName = (id: string): string => { + return product.optionGroups.find((og) => og.id === id)!.name + } + return { + product: { + id: product.id, + name: product.name, + description: product.description, + slug: product.slug, + images: product.assets.map((a) => ({ + url: a.preview, + alt: a.name, + })), + variants: product.variants.map((v) => ({ + id: v.id, + options: v.options.map((o) => ({ + // This __typename property is required in order for the correct + // variant selection to work, see `components/product/helpers.ts` + // `getVariant()` function. + __typename: 'MultipleChoiceOption', + id: o.id, + displayName: getOptionGroupName(o.groupId), + values: [{ label: o.name }], + })), + })), + price: { + value: product.variants[0].priceWithTax / 100, + currencyCode: product.variants[0].currencyCode, + }, + options: product.optionGroups.map((og) => ({ + id: og.id, + displayName: og.name, + values: og.options.map((o) => ({ label: o.name })), + })), + } as Product, + } + } + + return {} + } + + return getProduct +} diff --git a/packages/vendure/src/api/operations/get-site-info.ts b/packages/vendure/src/api/operations/get-site-info.ts new file mode 100644 index 0000000..ce2f5fa --- /dev/null +++ b/packages/vendure/src/api/operations/get-site-info.ts @@ -0,0 +1,50 @@ +import { Provider, VendureConfig } from '../' +import { GetCollectionsQuery } from '../../../schema' +import { arrayToTree } from '../../utils/array-to-tree' +import { getCollectionsQuery } from '../../utils/queries/get-collections-query' +import { OperationContext } from '@vercel/commerce/api/operations' +import { Category } from '@vercel/commerce/types/site' + +export type GetSiteInfoResult< + T extends { categories: any[]; brands: any[] } = { + categories: Category[] + brands: any[] + } +> = T + +export default function getSiteInfoOperation({ + commerce, +}: OperationContext) { + async function getSiteInfo({ + query = getCollectionsQuery, + variables, + config: cfg, + }: { + query?: string + variables?: any + config?: Partial + preview?: boolean + } = {}): Promise { + const config = commerce.getConfig(cfg) + // RecursivePartial forces the method to check for every prop in the data, which is + // required in case there's a custom `query` + const { data } = await config.fetch(query, { + variables, + }) + const collections = data.collections?.items.map((i) => ({ + ...i, + entityId: i.id, + path: i.slug, + productCount: i.productVariants.totalItems, + })) + const categories = arrayToTree(collections).children + const brands = [] as any[] + + return { + categories: categories ?? [], + brands, + } + } + + return getSiteInfo +} diff --git a/packages/vendure/src/api/operations/login.ts b/packages/vendure/src/api/operations/login.ts new file mode 100644 index 0000000..07ee5fa --- /dev/null +++ b/packages/vendure/src/api/operations/login.ts @@ -0,0 +1,60 @@ +import type { ServerResponse } from 'http' +import type { + OperationContext, + OperationOptions, +} from '@vercel/commerce/api/operations' +import { ValidationError } from '@vercel/commerce/utils/errors' +import type { LoginOperation } from '../../types/login' +import type { LoginMutation } from '../../../schema' +import { Provider, VendureConfig } from '..' +import { loginMutation } from '../../utils/mutations/log-in-mutation' + +export default function loginOperation({ + commerce, +}: OperationContext) { + async function login(opts: { + variables: T['variables'] + config?: Partial + res: ServerResponse + }): Promise + + async function login( + opts: { + variables: T['variables'] + config?: Partial + res: ServerResponse + } & OperationOptions + ): Promise + + async function login({ + query = loginMutation, + variables, + res: response, + config: cfg, + }: { + query?: string + variables: T['variables'] + res: ServerResponse + config?: Partial + }): Promise { + const config = commerce.getConfig(cfg) + + const { data, res } = await config.fetch(query, { + variables, + }) + switch (data.login.__typename) { + case 'NativeAuthStrategyError': + case 'InvalidCredentialsError': + case 'NotVerifiedError': + throw new ValidationError({ + code: data.login.errorCode, + message: data.login.message, + }) + } + return { + result: data.login.id, + } + } + + return login +} diff --git a/packages/vendure/src/api/utils/fetch-graphql-api.ts b/packages/vendure/src/api/utils/fetch-graphql-api.ts new file mode 100644 index 0000000..7c0fbc7 --- /dev/null +++ b/packages/vendure/src/api/utils/fetch-graphql-api.ts @@ -0,0 +1,36 @@ +import { FetcherError } from '@vercel/commerce/utils/errors' +import type { GraphQLFetcher } from '@vercel/commerce/api' +import { getCommerceApi } from '../' +import fetch from './fetch' + +const fetchGraphqlApi: GraphQLFetcher = async ( + query: string, + { variables, preview } = {}, + fetchOptions +) => { + const config = getCommerceApi().getConfig() + const res = await fetch(config.commerceUrl, { + ...fetchOptions, + method: 'POST', + headers: { + ...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 Vendure API' }], + status: res.status, + }) + } + + return { data: json.data, res } +} + +export default fetchGraphqlApi diff --git a/packages/vendure/src/api/utils/fetch.ts b/packages/vendure/src/api/utils/fetch.ts new file mode 100644 index 0000000..9d9fff3 --- /dev/null +++ b/packages/vendure/src/api/utils/fetch.ts @@ -0,0 +1,3 @@ +import zeitFetch from '@vercel/fetch' + +export default zeitFetch() diff --git a/packages/vendure/src/auth/index.ts b/packages/vendure/src/auth/index.ts new file mode 100644 index 0000000..36e757a --- /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/packages/vendure/src/auth/use-login.tsx b/packages/vendure/src/auth/use-login.tsx new file mode 100644 index 0000000..ce1a454 --- /dev/null +++ b/packages/vendure/src/auth/use-login.tsx @@ -0,0 +1,53 @@ +import { useCallback } from 'react' +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 '@vercel/commerce/utils/errors' +import useCustomer from '../customer/use-customer' +import { LoginMutation, LoginMutationVariables } from '../../schema' +import { loginMutation } from '../utils/mutations/log-in-mutation' + +export default useLogin as UseLogin + +export const handler: MutationHook = { + fetchOptions: { + query: loginMutation, + }, + async fetcher({ input: { email, password }, options, fetch }) { + if (!(email && password)) { + throw new CommerceError({ + message: 'A email and password are required to login', + }) + } + + const variables: LoginMutationVariables = { + username: email, + password, + } + + const { login } = await fetch({ + ...options, + variables, + }) + + if (login.__typename !== 'CurrentUser') { + throw new ValidationError(login) + } + + return null + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCustomer() + + return useCallback( + async function login(input) { + const data = await fetch({ input }) + await mutate() + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/vendure/src/auth/use-logout.tsx b/packages/vendure/src/auth/use-logout.tsx new file mode 100644 index 0000000..8a099cf --- /dev/null +++ b/packages/vendure/src/auth/use-logout.tsx @@ -0,0 +1,35 @@ +import { useCallback } from 'react' +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 '../utils/mutations/log-out-mutation' +import { LogoutHook } from '../types/logout' + +export default useLogout as UseLogout + +export const handler: MutationHook = { + fetchOptions: { + query: logoutMutation, + }, + async fetcher({ options, fetch }) { + await fetch({ + ...options, + }) + return null + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCustomer() + + return useCallback( + async function logout() { + const data = await fetch() + await mutate(null, false) + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/vendure/src/auth/use-signup.tsx b/packages/vendure/src/auth/use-signup.tsx new file mode 100644 index 0000000..0c19c91 --- /dev/null +++ b/packages/vendure/src/auth/use-signup.tsx @@ -0,0 +1,71 @@ +import { useCallback } from 'react' +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' +import { signupMutation } from '../utils/mutations/sign-up-mutation' +import { SignupHook } from '../types/signup' + +export default useSignup as UseSignup + +export type SignupInput = { + email: string + firstName: string + lastName: string + password: string +} + +export const handler: MutationHook = { + fetchOptions: { + query: signupMutation, + }, + 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', + }) + } + const variables: SignupMutationVariables = { + input: { + firstName, + lastName, + emailAddress: email, + password, + }, + } + const { registerCustomerAccount } = await fetch({ + ...options, + variables, + }) + + if (registerCustomerAccount.__typename !== 'Success') { + throw new ValidationError(registerCustomerAccount) + } + + return null + }, + 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/packages/vendure/src/cart/index.ts b/packages/vendure/src/cart/index.ts new file mode 100644 index 0000000..3b8ba99 --- /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/packages/vendure/src/cart/use-add-item.tsx b/packages/vendure/src/cart/use-add-item.tsx new file mode 100644 index 0000000..d7bb0bf --- /dev/null +++ b/packages/vendure/src/cart/use-add-item.tsx @@ -0,0 +1,54 @@ +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 { normalizeCart } from '../utils/normalize' +import { addItemToOrderMutation } from '../utils/mutations/add-item-to-order-mutation' +import { AddItemHook } from '../types/cart' + +export default useAddItem as UseAddItem + +export const handler: MutationHook = { + fetchOptions: { + query: addItemToOrderMutation, + }, + async fetcher({ input, options, fetch }) { + if ( + input.quantity && + (!Number.isInteger(input.quantity) || input.quantity! < 1) + ) { + throw new CommerceError({ + message: 'The item quantity has to be a valid integer greater than 0', + }) + } + + const { addItemToOrder } = await fetch({ + ...options, + variables: { + quantity: input.quantity || 1, + variantId: input.variantId, + }, + }) + + if (addItemToOrder.__typename === 'Order') { + return normalizeCart(addItemToOrder) + } + throw new CommerceError(addItemToOrder) + }, + 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/vendure/src/cart/use-cart.tsx b/packages/vendure/src/cart/use-cart.tsx new file mode 100644 index 0000000..750f110 --- /dev/null +++ b/packages/vendure/src/cart/use-cart.tsx @@ -0,0 +1,46 @@ +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' +import { GetCartHook } from '../types/cart' + +export type CartResult = { + activeOrder?: CartFragment + addItemToOrder?: CartFragment + adjustOrderLine?: CartFragment + removeOrderLine?: CartFragment +} + +export default useCart as UseCart + +export const handler: SWRHook = { + fetchOptions: { + query: getCartQuery, + }, + async fetcher({ input: { cartId }, options, fetch }) { + const { activeOrder } = await fetch(options) + return activeOrder ? normalizeCart(activeOrder) : null + }, + 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/vendure/src/cart/use-remove-item.tsx b/packages/vendure/src/cart/use-remove-item.tsx new file mode 100644 index 0000000..2aa3165 --- /dev/null +++ b/packages/vendure/src/cart/use-remove-item.tsx @@ -0,0 +1,56 @@ +import { useCallback } from 'react' +import { + HookFetcherContext, + MutationHook, + MutationHookContext, + SWRHook, +} 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' +import { normalizeCart } from '../utils/normalize' +import { RemoveItemHook } from '../types/cart' +import { removeOrderLineMutation } from '../utils/mutations/remove-order-line-mutation' + +export default useRemoveItem as UseRemoveItem + +export const handler: MutationHook = { + fetchOptions: { + query: removeOrderLineMutation, + }, + async fetcher({ input, options, fetch }) { + const variables: RemoveOrderLineMutationVariables = { + orderLineId: input.itemId, + } + const { removeOrderLine } = await fetch({ + ...options, + variables, + }) + + if (removeOrderLine.__typename === 'Order') { + return normalizeCart(removeOrderLine) + } + throw new CommerceError(removeOrderLine) + }, + useHook: + ({ fetch }) => + () => { + const { mutate } = useCart() + + return useCallback( + async function removeItem(input) { + const data = await fetch({ input: { itemId: input.id } }) + await mutate(data, false) + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/vendure/src/cart/use-update-item.tsx b/packages/vendure/src/cart/use-update-item.tsx new file mode 100644 index 0000000..2f3c8d4 --- /dev/null +++ b/packages/vendure/src/cart/use-update-item.tsx @@ -0,0 +1,84 @@ +import { useCallback } from 'react' +import { + HookFetcherContext, + MutationHook, + MutationHookContext, +} 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' +import { normalizeCart } from '../utils/normalize' +import { adjustOrderLineMutation } from '../utils/mutations/adjust-order-line-mutation' +import { UpdateItemHook } from '../types/cart' + +export type UpdateItemActionInput = T extends LineItem + ? Partial + : UpdateItemHook['actionInput'] + +export default useUpdateItem as UseUpdateItem + +export const handler = { + fetchOptions: { + query: adjustOrderLineMutation, + }, + async fetcher(context: HookFetcherContext) { + const { input, options, fetch } = context + const variables: AdjustOrderLineMutationVariables = { + quantity: input.item.quantity || 1, + orderLineId: input.itemId, + } + const { adjustOrderLine } = await fetch({ + ...options, + variables, + }) + + if (adjustOrderLine.__typename === 'Order') { + return normalizeCart(adjustOrderLine) + } + throw new CommerceError(adjustOrderLine) + }, + useHook: + ({ fetch }: MutationHookContext) => + ( + ctx: { + item?: LineItem + wait?: number + } = {} + ) => { + const { item } = ctx + const { mutate } = useCart() + + return useCallback( + async function addItem(input: UpdateItemActionInput) { + const itemId = 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: { + item: { + productId, + variantId, + quantity: input.quantity, + }, + itemId, + }, + }) + await mutate(data, false) + return data + }, + [fetch, mutate] + ) + }, +} diff --git a/packages/vendure/src/checkout/use-checkout.tsx b/packages/vendure/src/checkout/use-checkout.tsx new file mode 100644 index 0000000..76997be --- /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/packages/vendure/src/commerce.config.json b/packages/vendure/src/commerce.config.json new file mode 100644 index 0000000..70806f0 --- /dev/null +++ b/packages/vendure/src/commerce.config.json @@ -0,0 +1,6 @@ +{ + "provider": "vendure", + "features": { + "wishlist": false + } +} 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 0000000..4f85c84 --- /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 0000000..77d149e --- /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 0000000..6c903ec --- /dev/null +++ b/packages/vendure/src/customer/index.ts @@ -0,0 +1 @@ +export { default as useCustomer } from './use-customer' diff --git a/packages/vendure/src/customer/use-customer.tsx b/packages/vendure/src/customer/use-customer.tsx new file mode 100644 index 0000000..80da077 --- /dev/null +++ b/packages/vendure/src/customer/use-customer.tsx @@ -0,0 +1,37 @@ +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' + +export default useCustomer as UseCustomer + +export const handler: SWRHook = { + fetchOptions: { + query: activeCustomerQuery, + }, + async fetcher({ options, fetch }) { + const { activeCustomer } = await fetch({ + ...options, + }) + return activeCustomer + ? ({ + firstName: activeCustomer.firstName ?? '', + lastName: activeCustomer.lastName ?? '', + email: activeCustomer.emailAddress ?? '', + } as any) + : null + }, + useHook: + ({ useData }) => + (input) => { + return useData({ + swrOptions: { + revalidateOnFocus: false, + ...input?.swrOptions, + }, + }) + }, +} diff --git a/packages/vendure/src/fetcher.ts b/packages/vendure/src/fetcher.ts new file mode 100644 index 0000000..ad0d4bc --- /dev/null +++ b/packages/vendure/src/fetcher.ts @@ -0,0 +1,53 @@ +import { Fetcher } from '@vercel/commerce/utils/types' +import { FetcherError } from '@vercel/commerce/utils/errors' + +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 }) +} + +export const fetcher: Fetcher = async ({ + url, + method = 'POST', + variables, + query, + body: bodyObj, +}) => { + const shopApiUrl = + process.env.NEXT_PUBLIC_VENDURE_LOCAL_URL || + process.env.NEXT_PUBLIC_VENDURE_SHOP_API_URL + if (!shopApiUrl) { + throw new Error( + 'The Vendure Shop API url has not been provided. Please define NEXT_PUBLIC_VENDURE_SHOP_API_URL in .env.local' + ) + } + const hasBody = Boolean(variables || query) + const body = hasBody ? JSON.stringify({ query, variables }) : undefined + const headers = hasBody ? { 'Content-Type': 'application/json' } : undefined + const res = await fetch(shopApiUrl, { + method, + body, + headers, + credentials: 'include', + }) + if (res.ok) { + const { data, errors } = await res.json() + if (errors) { + throw await new FetcherError({ status: res.status, errors }) + } + return data + } + + throw await getError(res) +} diff --git a/packages/vendure/src/index.tsx b/packages/vendure/src/index.tsx new file mode 100644 index 0000000..14d0d4c --- /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 0000000..2e6842f --- /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 0000000..426a3ed --- /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 0000000..fd42d70 --- /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/packages/vendure/src/product/use-search.tsx b/packages/vendure/src/product/use-search.tsx new file mode 100644 index 0000000..86c6467 --- /dev/null +++ b/packages/vendure/src/product/use-search.tsx @@ -0,0 +1,64 @@ +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' + +export default useSearch as UseSearch + +export type SearchProductsInput = { + search?: string + categoryId?: string + brandId?: string + sort?: string +} + +export type SearchProductsData = { + products: Product[] + found: boolean +} + +export const handler: SWRHook = { + fetchOptions: { + query: searchQuery, + }, + async fetcher({ input, options, fetch }) { + const { categoryId, brandId } = input + + const variables: SearchQueryVariables = { + input: { + term: input.search, + collectionId: input.categoryId?.toString(), + groupByProduct: true, + // TODO: what is the "sort" value? + }, + } + const { search } = await fetch({ + query: searchQuery, + variables, + }) + + return { + found: search.totalItems > 0, + products: search.items.map((item) => normalizeSearchResult(item)) ?? [], + } + }, + 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/vendure/src/provider.ts b/packages/vendure/src/provider.ts new file mode 100644 index 0000000..73f7dd5 --- /dev/null +++ b/packages/vendure/src/provider.ts @@ -0,0 +1,22 @@ +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 { fetcher } from './fetcher' + +export const vendureProvider = { + locale: 'en-us', + cartCookie: 'session', + fetcher, + cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, + customer: { useCustomer }, + 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 0000000..e6838fb --- /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 0000000..d139db6 --- /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 0000000..23b8daa --- /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 0000000..c637055 --- /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 0000000..7ab0b7f --- /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 0000000..283a575 --- /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 0000000..1de06f8 --- /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 0000000..12f6b02 --- /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 0000000..72ca02f --- /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 0000000..3f0d1af --- /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 0000000..96a2e47 --- /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 0000000..af92d9f --- /dev/null +++ b/packages/vendure/src/types/wishlist.ts @@ -0,0 +1 @@ +export * from '@vercel/commerce/types/wishlist' diff --git a/packages/vendure/src/utils/array-to-tree.ts b/packages/vendure/src/utils/array-to-tree.ts new file mode 100644 index 0000000..403cf22 --- /dev/null +++ b/packages/vendure/src/utils/array-to-tree.ts @@ -0,0 +1,67 @@ +export type HasParent = { id: string; parent?: { id: string } | null } +export type TreeNode = T & { + children: Array> + expanded: boolean +} +export type RootNode = { + id?: string + children: Array> +} + +export function arrayToTree( + nodes: T[], + currentState?: RootNode +): RootNode { + const topLevelNodes: Array> = [] + const mappedArr: { [id: string]: TreeNode } = {} + const currentStateMap = treeToMap(currentState) + + // First map the nodes of the array to an object -> create a hash table. + for (const node of nodes) { + mappedArr[node.id] = { ...(node as any), children: [] } + } + + for (const id of nodes.map((n) => n.id)) { + if (mappedArr.hasOwnProperty(id)) { + const mappedElem = mappedArr[id] + mappedElem.expanded = currentStateMap.get(id)?.expanded ?? false + const parent = mappedElem.parent + if (!parent) { + continue + } + // If the element is not at the root level, add it to its parent array of children. + const parentIsRoot = !mappedArr[parent.id] + if (!parentIsRoot) { + if (mappedArr[parent.id]) { + mappedArr[parent.id].children.push(mappedElem) + } else { + mappedArr[parent.id] = { children: [mappedElem] } as any + } + } else { + topLevelNodes.push(mappedElem) + } + } + } + // tslint:disable-next-line:no-non-null-assertion + const rootId = topLevelNodes.length ? topLevelNodes[0].parent!.id : undefined + return { id: rootId, children: topLevelNodes } +} + +/** + * Converts an existing tree (as generated by the arrayToTree function) into a flat + * Map. This is used to persist certain states (e.g. `expanded`) when re-building the + * tree. + */ +function treeToMap( + tree?: RootNode +): Map> { + const nodeMap = new Map>() + function visit(node: TreeNode) { + nodeMap.set(node.id, node) + node.children.forEach(visit) + } + if (tree) { + visit(tree as TreeNode) + } + return nodeMap +} diff --git a/packages/vendure/src/utils/fragments/cart-fragment.ts b/packages/vendure/src/utils/fragments/cart-fragment.ts new file mode 100644 index 0000000..54ac089 --- /dev/null +++ b/packages/vendure/src/utils/fragments/cart-fragment.ts @@ -0,0 +1,44 @@ +export const cartFragment = /* GraphQL */ ` + fragment Cart on Order { + id + code + createdAt + totalQuantity + subTotal + subTotalWithTax + total + totalWithTax + currencyCode + customer { + id + } + lines { + id + quantity + linePriceWithTax + discountedLinePriceWithTax + unitPriceWithTax + discountedUnitPriceWithTax + featuredAsset { + id + preview + } + discounts { + description + amount + } + productVariant { + id + name + sku + price + priceWithTax + stockLevel + product { + slug + } + productId + } + } + } +` diff --git a/packages/vendure/src/utils/fragments/search-result-fragment.ts b/packages/vendure/src/utils/fragments/search-result-fragment.ts new file mode 100644 index 0000000..e143ce2 --- /dev/null +++ b/packages/vendure/src/utils/fragments/search-result-fragment.ts @@ -0,0 +1,23 @@ +export const searchResultFragment = /* GraphQL */ ` + fragment SearchResult on SearchResult { + productId + productName + description + slug + sku + currencyCode + productAsset { + id + preview + } + priceWithTax { + ... on SinglePrice { + value + } + ... on PriceRange { + min + max + } + } + } +` diff --git a/packages/vendure/src/utils/mutations/add-item-to-order-mutation.ts b/packages/vendure/src/utils/mutations/add-item-to-order-mutation.ts new file mode 100644 index 0000000..5ed41d9 --- /dev/null +++ b/packages/vendure/src/utils/mutations/add-item-to-order-mutation.ts @@ -0,0 +1,15 @@ +import { cartFragment } from '../fragments/cart-fragment' + +export const addItemToOrderMutation = /* GraphQL */ ` + mutation addItemToOrder($variantId: ID!, $quantity: Int!) { + addItemToOrder(productVariantId: $variantId, quantity: $quantity) { + __typename + ...Cart + ... on ErrorResult { + errorCode + message + } + } + } + ${cartFragment} +` diff --git a/packages/vendure/src/utils/mutations/adjust-order-line-mutation.ts b/packages/vendure/src/utils/mutations/adjust-order-line-mutation.ts new file mode 100644 index 0000000..ce9864b --- /dev/null +++ b/packages/vendure/src/utils/mutations/adjust-order-line-mutation.ts @@ -0,0 +1,15 @@ +import { cartFragment } from '../fragments/cart-fragment' + +export const adjustOrderLineMutation = /* GraphQL */ ` + mutation adjustOrderLine($orderLineId: ID!, $quantity: Int!) { + adjustOrderLine(orderLineId: $orderLineId, quantity: $quantity) { + __typename + ...Cart + ... on ErrorResult { + errorCode + message + } + } + } + ${cartFragment} +` diff --git a/packages/vendure/src/utils/mutations/log-in-mutation.ts b/packages/vendure/src/utils/mutations/log-in-mutation.ts new file mode 100644 index 0000000..75e2ddb --- /dev/null +++ b/packages/vendure/src/utils/mutations/log-in-mutation.ts @@ -0,0 +1,14 @@ +export const loginMutation = /* GraphQL */ ` + mutation login($username: String!, $password: String!) { + login(username: $username, password: $password) { + __typename + ... on CurrentUser { + id + } + ... on ErrorResult { + errorCode + message + } + } + } +` diff --git a/packages/vendure/src/utils/mutations/log-out-mutation.ts b/packages/vendure/src/utils/mutations/log-out-mutation.ts new file mode 100644 index 0000000..6f222c5 --- /dev/null +++ b/packages/vendure/src/utils/mutations/log-out-mutation.ts @@ -0,0 +1,7 @@ +export const logoutMutation = /* GraphQL */ ` + mutation logout { + logout { + success + } + } +` diff --git a/packages/vendure/src/utils/mutations/remove-order-line-mutation.ts b/packages/vendure/src/utils/mutations/remove-order-line-mutation.ts new file mode 100644 index 0000000..47a8903 --- /dev/null +++ b/packages/vendure/src/utils/mutations/remove-order-line-mutation.ts @@ -0,0 +1,15 @@ +import { cartFragment } from '../fragments/cart-fragment' + +export const removeOrderLineMutation = /* GraphQL */ ` + mutation removeOrderLine($orderLineId: ID!) { + removeOrderLine(orderLineId: $orderLineId) { + __typename + ...Cart + ... on ErrorResult { + errorCode + message + } + } + } + ${cartFragment} +` diff --git a/packages/vendure/src/utils/mutations/sign-up-mutation.ts b/packages/vendure/src/utils/mutations/sign-up-mutation.ts new file mode 100644 index 0000000..410e395 --- /dev/null +++ b/packages/vendure/src/utils/mutations/sign-up-mutation.ts @@ -0,0 +1,14 @@ +export const signupMutation = /* GraphQL */ ` + mutation signup($input: RegisterCustomerInput!) { + registerCustomerAccount(input: $input) { + __typename + ... on Success { + success + } + ... on ErrorResult { + errorCode + message + } + } + } +` diff --git a/packages/vendure/src/utils/normalize.ts b/packages/vendure/src/utils/normalize.ts new file mode 100644 index 0000000..adde436 --- /dev/null +++ b/packages/vendure/src/utils/normalize.ts @@ -0,0 +1,62 @@ +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 { + id: item.productId, + name: item.productName, + description: item.description, + slug: item.slug, + path: item.slug, + images: [ + { + url: item.productAsset?.preview + ? item.productAsset?.preview + '?w=800&mode=crop' + : '', + }, + ], + variants: [], + price: { + value: (item.priceWithTax as any).min / 100, + currencyCode: item.currencyCode, + }, + options: [], + sku: item.sku, + } +} + +export function normalizeCart(order: CartFragment): Cart { + return { + id: order.id.toString(), + createdAt: order.createdAt, + taxesIncluded: true, + lineItemsSubtotalPrice: order.subTotalWithTax / 100, + currency: { code: order.currencyCode }, + subtotalPrice: order.subTotalWithTax / 100, + totalPrice: order.totalWithTax / 100, + customerId: order.customer?.id, + lineItems: order.lines?.map((l) => ({ + id: l.id, + name: l.productVariant.name, + quantity: l.quantity, + url: l.productVariant.product.slug, + variantId: l.productVariant.id, + productId: l.productVariant.productId, + images: [{ url: l.featuredAsset?.preview + '?preset=thumb' || '' }], + discounts: l.discounts.map((d) => ({ value: d.amount / 100 })), + path: '', + variant: { + id: l.productVariant.id, + name: l.productVariant.name, + sku: l.productVariant.sku, + price: l.discountedUnitPriceWithTax / 100, + listPrice: l.unitPriceWithTax / 100, + image: { + url: l.featuredAsset?.preview + '?preset=thumb' || '', + }, + requiresShipping: true, + }, + })), + } +} diff --git a/packages/vendure/src/utils/queries/active-customer-query.ts b/packages/vendure/src/utils/queries/active-customer-query.ts new file mode 100644 index 0000000..65b2807 --- /dev/null +++ b/packages/vendure/src/utils/queries/active-customer-query.ts @@ -0,0 +1,10 @@ +export const activeCustomerQuery = /* GraphQL */ ` + query activeCustomer { + activeCustomer { + id + firstName + lastName + emailAddress + } + } +` diff --git a/packages/vendure/src/utils/queries/get-all-product-paths-query.ts b/packages/vendure/src/utils/queries/get-all-product-paths-query.ts new file mode 100644 index 0000000..29922dc --- /dev/null +++ b/packages/vendure/src/utils/queries/get-all-product-paths-query.ts @@ -0,0 +1,9 @@ +export const getAllProductPathsQuery = /* GraphQL */ ` + query getAllProductPaths($first: Int = 100) { + products(options: { take: $first }) { + items { + slug + } + } + } +` diff --git a/packages/vendure/src/utils/queries/get-all-products-query.ts b/packages/vendure/src/utils/queries/get-all-products-query.ts new file mode 100644 index 0000000..1b44b20 --- /dev/null +++ b/packages/vendure/src/utils/queries/get-all-products-query.ts @@ -0,0 +1,12 @@ +import { searchResultFragment } from '../fragments/search-result-fragment' + +export const getAllProductsQuery = /* GraphQL */ ` + query getAllProducts($input: SearchInput!) { + search(input: $input) { + items { + ...SearchResult + } + } + } + ${searchResultFragment} +` diff --git a/packages/vendure/src/utils/queries/get-cart-query.ts b/packages/vendure/src/utils/queries/get-cart-query.ts new file mode 100644 index 0000000..7faac35 --- /dev/null +++ b/packages/vendure/src/utils/queries/get-cart-query.ts @@ -0,0 +1,10 @@ +import { cartFragment } from '../fragments/cart-fragment' + +export const getCartQuery = /* GraphQL */ ` + query activeOrder { + activeOrder { + ...Cart + } + } + ${cartFragment} +` diff --git a/packages/vendure/src/utils/queries/get-collections-query.ts b/packages/vendure/src/utils/queries/get-collections-query.ts new file mode 100644 index 0000000..ed09196 --- /dev/null +++ b/packages/vendure/src/utils/queries/get-collections-query.ts @@ -0,0 +1,21 @@ +export const getCollectionsQuery = /* GraphQL */ ` + query getCollections { + collections { + items { + id + name + description + slug + productVariants { + totalItems + } + parent { + id + } + children { + id + } + } + } + } +` diff --git a/packages/vendure/src/utils/queries/get-product-query.ts b/packages/vendure/src/utils/queries/get-product-query.ts new file mode 100644 index 0000000..f36c730 --- /dev/null +++ b/packages/vendure/src/utils/queries/get-product-query.ts @@ -0,0 +1,45 @@ +export const getProductQuery = /* GraphQL */ ` + query getProduct($slug: String!) { + product(slug: $slug) { + id + name + slug + description + assets { + id + preview + name + } + collections { + name + slug + } + variants { + id + priceWithTax + currencyCode + options { + id + name + code + groupId + group { + id + options { + name + } + } + } + } + optionGroups { + id + code + name + options { + id + name + } + } + } + } +` diff --git a/packages/vendure/src/utils/queries/search-query.ts b/packages/vendure/src/utils/queries/search-query.ts new file mode 100644 index 0000000..f95c437 --- /dev/null +++ b/packages/vendure/src/utils/queries/search-query.ts @@ -0,0 +1,13 @@ +import { searchResultFragment } from '../fragments/search-result-fragment' + +export const searchQuery = /* GraphQL */ ` + query search($input: SearchInput!) { + search(input: $input) { + items { + ...SearchResult + } + totalItems + } + } + ${searchResultFragment} +` 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 0000000..75f067c --- /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 0000000..a2d3a8a --- /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/packages/vendure/src/wishlist/use-wishlist.tsx b/packages/vendure/src/wishlist/use-wishlist.tsx new file mode 100644 index 0000000..ab41921 --- /dev/null +++ b/packages/vendure/src/wishlist/use-wishlist.tsx @@ -0,0 +1,46 @@ +// 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 '@vercel/commerce/utils/types' +import { Product } from '../../schema' + +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/vendure/taskfile.js b/packages/vendure/taskfile.js new file mode 100644 index 0000000..39b1b2a --- /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 0000000..cd04ab2 --- /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/site/.env.template b/site/.env.template new file mode 100644 index 0000000..a9eb798 --- /dev/null +++ b/site/.env.template @@ -0,0 +1,56 @@ +# 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 +# @vercel/commerce-sfcc +COMMERCE_PROVIDER= + +BIGCOMMERCE_STOREFRONT_API_URL= +BIGCOMMERCE_STOREFRONT_API_TOKEN= +BIGCOMMERCE_STORE_API_URL= +BIGCOMMERCE_STORE_API_TOKEN= +BIGCOMMERCE_STORE_API_CLIENT_ID= +BIGCOMMERCE_CHANNEL_ID= +BIGCOMMERCE_STORE_URL= +BIGCOMMERCE_STORE_API_STORE_HASH= +BIGCOMMERCE_STORE_API_CLIENT_SECRET= + + +NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN= +NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN= + +NEXT_PUBLIC_SWELL_STORE_ID= +NEXT_PUBLIC_SWELL_PUBLIC_KEY= + +NEXT_PUBLIC_SALEOR_API_URL= +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= + +SFCC_CLIENT_ID= +SFCC_CLIENT_SECRET= +SFCC_ORG_ID= +SFCC_SHORT_CODE= +SFCC_SITE_ID=RefArch \ No newline at end of file diff --git a/site/.eslintrc b/site/.eslintrc new file mode 100644 index 0000000..96856ac --- /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 0000000..22f1bf4 --- /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 0000000..105738c --- /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 0000000..e1076ed --- /dev/null +++ b/site/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/site/assets/aboutpng.png b/site/assets/aboutpng.png new file mode 100644 index 0000000..1d6ec45 Binary files /dev/null and b/site/assets/aboutpng.png differ diff --git a/site/assets/aboutteam01.png b/site/assets/aboutteam01.png new file mode 100644 index 0000000..f3798e9 Binary files /dev/null and b/site/assets/aboutteam01.png differ diff --git a/site/assets/aboutteam02.png b/site/assets/aboutteam02.png new file mode 100644 index 0000000..0c0e2c2 Binary files /dev/null and b/site/assets/aboutteam02.png differ diff --git a/site/assets/aboutteam03.png b/site/assets/aboutteam03.png new file mode 100644 index 0000000..ce9dc4b Binary files /dev/null and b/site/assets/aboutteam03.png differ diff --git a/site/assets/arrow_down.png b/site/assets/arrow_down.png new file mode 100644 index 0000000..89b4b50 Binary files /dev/null and b/site/assets/arrow_down.png differ diff --git a/site/assets/banner1.png b/site/assets/banner1.png new file mode 100644 index 0000000..21c8fff Binary files /dev/null and b/site/assets/banner1.png differ diff --git a/site/assets/banner2.png b/site/assets/banner2.png new file mode 100644 index 0000000..26f58b6 Binary files /dev/null and b/site/assets/banner2.png differ diff --git a/site/assets/banner3.png b/site/assets/banner3.png new file mode 100644 index 0000000..1327d22 Binary files /dev/null and b/site/assets/banner3.png differ diff --git a/site/assets/bannerHome.png b/site/assets/bannerHome.png new file mode 100644 index 0000000..0640230 Binary files /dev/null and b/site/assets/bannerHome.png differ diff --git a/site/assets/banner_page.png b/site/assets/banner_page.png new file mode 100644 index 0000000..162f7d2 Binary files /dev/null and b/site/assets/banner_page.png differ diff --git a/site/assets/base.css b/site/assets/base.css new file mode 100644 index 0000000..37e1419 --- /dev/null +++ b/site/assets/base.css @@ -0,0 +1,121 @@ +:root { + --primary: #ffffff; + --primary-2: #f1f3f5; + --secondary: #000000; + --secondary-2: #111; + --selection: var(--cyan); + --text-base: #000000; + --text-primary: #000000; + --text-secondary: white; + --hover: rgba(0, 0, 0, 0.075); + --hover-1: rgba(0, 0, 0, 0.15); + --hover-2: rgba(0, 0, 0, 0.25); + --cyan: #22b8cf; + --green: #37b679; + --red: #da3c3c; + --purple: #f81ce5; + --blue: #0070f3; + --pink: #ff0080; + --pink-light: #ff379c; + --magenta: #eb367f; + --violet: #7928ca; + --violet-dark: #4c2889; + --accent-0: #fff; + --accent-1: #fafafa; + --accent-2: #eaeaea; + --accent-3: #999999; + --accent-4: #888888; + --accent-5: #666666; + --accent-6: #444444; + --accent-7: #333333; + --accent-8: #111111; + --accent-9: #000; + --font-sans: -apple-system, system-ui, BlinkMacSystemFont, 'Helvetica Neue', + 'Helvetica', sans-serif; +} + +[data-theme='dark'] { + --primary: #000000; + --primary-2: #111; + --secondary: #ffffff; + --secondary-2: #f1f3f5; + --hover: rgba(255, 255, 255, 0.075); + --hover-1: rgba(255, 255, 255, 0.15); + --hover-2: rgba(255, 255, 255, 0.25); + --selection: var(--purple); + --text-base: white; + --text-primary: white; + --text-secondary: black; + --accent-9: #fff; + --accent-8: #fafafa; + --accent-7: #eaeaea; + --accent-6: #999999; + --accent-5: #888888; + --accent-4: #666666; + --accent-3: #444444; + --accent-2: #333333; + --accent-1: #111111; + --accent-0: #000; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +html, +body { + height: 100%; + box-sizing: border-box; + touch-action: manipulation; + font-family: var(--font-sans); + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + background-color: var(--primary); + color: var(--text-primary); + overscroll-behavior-x: none; +} + +body { + position: relative; + min-height: 100%; + margin: 0; +} + +a { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} + +.animated { + animation-duration: 1s; + animation-fill-mode: both; + -webkit-animation-duration: 1s; + -webkit-animation-fill-mode: both; +} + +.fadeIn { + animation-name: fadeIn; + -webkit-animation-name: fadeIn; +} + +@-webkit-keyframes fadeIn { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + +@keyframes fadeIn { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} diff --git a/site/assets/bg-home1-newleter.jpg b/site/assets/bg-home1-newleter.jpg new file mode 100644 index 0000000..5f8cfe8 Binary files /dev/null and b/site/assets/bg-home1-newleter.jpg differ diff --git a/site/assets/bg-home1-newleter.png b/site/assets/bg-home1-newleter.png new file mode 100644 index 0000000..5f8cfe8 Binary files /dev/null and b/site/assets/bg-home1-newleter.png differ diff --git a/site/assets/chrome-bug.css b/site/assets/chrome-bug.css new file mode 100644 index 0000000..245ec8f --- /dev/null +++ b/site/assets/chrome-bug.css @@ -0,0 +1,12 @@ +/** + * Chrome has a bug with transitions on load since 2012! + * + * To prevent a "pop" of content, you have to disable all transitions until + * the page is done loading. + * + * https://lab.laukstein.com/bug/input + * https://twitter.com/timer150/status/1345217126680899584 + */ +body.loading * { + transition: none !important; +} diff --git a/site/assets/components.css b/site/assets/components.css new file mode 100644 index 0000000..ebebcc2 --- /dev/null +++ b/site/assets/components.css @@ -0,0 +1,3 @@ +.fit { + min-height: calc(100vh - 88px); +} diff --git a/site/assets/deals_of_day_1.jpg b/site/assets/deals_of_day_1.jpg new file mode 100644 index 0000000..03a3ea5 Binary files /dev/null and b/site/assets/deals_of_day_1.jpg differ diff --git a/site/assets/deals_of_day_2.jpg b/site/assets/deals_of_day_2.jpg new file mode 100644 index 0000000..26474ba Binary files /dev/null and b/site/assets/deals_of_day_2.jpg differ diff --git a/site/assets/ebaylogo.png b/site/assets/ebaylogo.png new file mode 100644 index 0000000..6807bf1 Binary files /dev/null and b/site/assets/ebaylogo.png differ diff --git a/site/assets/enlang.jpg b/site/assets/enlang.jpg new file mode 100644 index 0000000..121f364 Binary files /dev/null and b/site/assets/enlang.jpg differ diff --git a/site/assets/icon_menu.png b/site/assets/icon_menu.png new file mode 100644 index 0000000..665ede3 Binary files /dev/null and b/site/assets/icon_menu.png differ diff --git a/site/assets/image_1.png b/site/assets/image_1.png new file mode 100644 index 0000000..84d1dab Binary files /dev/null and b/site/assets/image_1.png differ diff --git a/site/assets/image_2.png b/site/assets/image_2.png new file mode 100644 index 0000000..56be216 Binary files /dev/null and b/site/assets/image_2.png differ diff --git a/site/assets/image_3.png b/site/assets/image_3.png new file mode 100644 index 0000000..a93763d Binary files /dev/null and b/site/assets/image_3.png differ diff --git a/site/assets/image_4.png b/site/assets/image_4.png new file mode 100644 index 0000000..38ad68f Binary files /dev/null and b/site/assets/image_4.png differ diff --git a/site/assets/image_5.png b/site/assets/image_5.png new file mode 100644 index 0000000..f9de8a9 Binary files /dev/null and b/site/assets/image_5.png differ diff --git a/site/assets/image_6.png b/site/assets/image_6.png new file mode 100644 index 0000000..50c351c Binary files /dev/null and b/site/assets/image_6.png differ diff --git a/site/assets/image_7.png b/site/assets/image_7.png new file mode 100644 index 0000000..a45b4b4 Binary files /dev/null and b/site/assets/image_7.png differ diff --git a/site/assets/imgWorking.jpg b/site/assets/imgWorking.jpg new file mode 100644 index 0000000..cd47abe Binary files /dev/null and b/site/assets/imgWorking.jpg differ diff --git a/site/assets/logo1.png b/site/assets/logo1.png new file mode 100644 index 0000000..26d1f4f Binary files /dev/null and b/site/assets/logo1.png differ diff --git a/site/assets/logo2.png b/site/assets/logo2.png new file mode 100644 index 0000000..663c7bf Binary files /dev/null and b/site/assets/logo2.png differ diff --git a/site/assets/logo3.png b/site/assets/logo3.png new file mode 100644 index 0000000..03678c8 Binary files /dev/null and b/site/assets/logo3.png differ diff --git a/site/assets/logo4.png b/site/assets/logo4.png new file mode 100644 index 0000000..1297c88 Binary files /dev/null and b/site/assets/logo4.png differ diff --git a/site/assets/logo5.png b/site/assets/logo5.png new file mode 100644 index 0000000..1a5e98d Binary files /dev/null and b/site/assets/logo5.png differ diff --git a/site/assets/logo6.png b/site/assets/logo6.png new file mode 100644 index 0000000..63f8b4b Binary files /dev/null and b/site/assets/logo6.png differ diff --git a/site/assets/main.css b/site/assets/main.css new file mode 100644 index 0000000..54dd1e5 --- /dev/null +++ b/site/assets/main.css @@ -0,0 +1,7 @@ +@tailwind base; +@import './base.css'; + +@tailwind components; +@import './components.css'; + +@tailwind utilities; diff --git a/site/assets/payment.png b/site/assets/payment.png new file mode 100644 index 0000000..55c2d1b Binary files /dev/null and b/site/assets/payment.png differ diff --git a/site/assets/seller_1.png b/site/assets/seller_1.png new file mode 100644 index 0000000..1ba5e27 Binary files /dev/null and b/site/assets/seller_1.png differ diff --git a/site/assets/seller_2.png b/site/assets/seller_2.png new file mode 100644 index 0000000..8436e83 Binary files /dev/null and b/site/assets/seller_2.png differ diff --git a/site/assets/seller_3.png b/site/assets/seller_3.png new file mode 100644 index 0000000..5a478dd Binary files /dev/null and b/site/assets/seller_3.png differ diff --git a/site/assets/seller_4.png b/site/assets/seller_4.png new file mode 100644 index 0000000..986c396 Binary files /dev/null and b/site/assets/seller_4.png differ diff --git a/site/assets/seller_5.png b/site/assets/seller_5.png new file mode 100644 index 0000000..55b8327 Binary files /dev/null and b/site/assets/seller_5.png differ diff --git a/site/assets/seller_6.png b/site/assets/seller_6.png new file mode 100644 index 0000000..6bfbc90 Binary files /dev/null and b/site/assets/seller_6.png differ diff --git a/site/assets/seller_7.png b/site/assets/seller_7.png new file mode 100644 index 0000000..5559a20 Binary files /dev/null and b/site/assets/seller_7.png differ diff --git a/site/assets/seller_8.png b/site/assets/seller_8.png new file mode 100644 index 0000000..59002d8 Binary files /dev/null and b/site/assets/seller_8.png differ diff --git a/site/assets/seller_9.png b/site/assets/seller_9.png new file mode 100644 index 0000000..825c80f Binary files /dev/null and b/site/assets/seller_9.png differ diff --git a/site/commerce-config.js b/site/commerce-config.js new file mode 100644 index 0000000..f92f221 --- /dev/null +++ b/site/commerce-config.js @@ -0,0 +1,106 @@ +/** + * 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', + '@vercel/commerce-sfcc', +] + +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 0000000..ad72b58 --- /dev/null +++ b/site/commerce.config.json @@ -0,0 +1,9 @@ +{ + "features": { + "cart": true, + "search": true, + "wishlist": false, + "customerAuth": false, + "customCheckout": false + } +} diff --git a/site/components/AddHead.js b/site/components/AddHead.js new file mode 100644 index 0000000..2f681f0 --- /dev/null +++ b/site/components/AddHead.js @@ -0,0 +1,12 @@ +import Head from 'next/head' +import React from "react"; + +const AddHead = () => { + return ( + + + + + ) +} +export default AddHead; \ No newline at end of file diff --git a/site/components/Copyright.js b/site/components/Copyright.js new file mode 100644 index 0000000..732f899 --- /dev/null +++ b/site/components/Copyright.js @@ -0,0 +1,66 @@ +import React from "react"; +import { Container, Box, Grid } from '@mui/material'; + +// import images +import paymentImages from '../assets/payment.png'; + +// makestyle +import { makeStyles } from "@material-ui/core/styles"; + + +const colorHover = '#40c6ff'; +const colorDefaul = '#666'; +const colorBorder = '#f4f4f4'; + +const Item = () => { }; +const useStyle_copyright = makeStyles({ + + Copyright: { + borderTop: ' 1px solid', + borderColor: `${colorBorder}`, + color: `${colorDefaul}`, + backgroundColor: '#fff', + padding: '10px 0px', + marginTop: ' 7px', + '& p': { + padding: '0px', + margin: '0px', + '& a': { + color: `${colorHover}`, + } + } + }, + payment: { + display: 'flex', + justifyContent: 'right', + alignItems: 'center', + '@media (max-width: 600px)': { + justifyContent: 'left', + marginTop: '30px', + } + } +}); +const Copyright = () => { + const classes = useStyle_copyright() + return ( +

+ + + + + +

Estore - Designed by Netbase JSC . Copyright © 2006 - 2017. All Rights Reserved.

+
+ +
+ +
+
+
+
+
+
+
+ ) +} +export default Copyright; diff --git a/site/components/Countdown.js b/site/components/Countdown.js new file mode 100644 index 0000000..0ed791c --- /dev/null +++ b/site/components/Countdown.js @@ -0,0 +1,64 @@ +import React, { useEffect, useRef, useState } from "react"; +// import { countdown } from "../utils/countdown"; +import { countdown } from './countdowns'; +import Grid from '@mui/material/Grid'; +import Box from '@mui/material/Box'; +import Typography from '@mui/material/Typography'; + + + +const TIME = 42 * 24 * 60 * 60; + +export default function CountDown() { + const [time, setTime] = useState(TIME); + const { days, hours, minutes, seconds } = countdown(time); + + useEffect(() => { + const secTimer = setInterval(() => { + setTime((prevState) => prevState - 1); + }, 1000); + return () => clearInterval(secTimer); + }, []); + + return ( + + + {days} + days + + + {hours} + hours + + + {minutes} + mins + + + {seconds} + secs + + + ); +} + +const styles = { + circle: { + width: 51, + height: 51, + borderRadius: 30, + backgroundColor: "#eee", + display: "flex", + justifyContent: "center", + alignItems: "center", + flexDirection: "column", + marginRight: 15, + }, + value: { margin: 0, fontSize: 20, fontWeight: "bold", color: "#666" }, + label: { + margin: 0, + fontSize: 12, + color: '#444', + fontWeight: 'bold', + }, +}; diff --git a/site/components/DealsOfDay.js b/site/components/DealsOfDay.js new file mode 100644 index 0000000..9a22580 --- /dev/null +++ b/site/components/DealsOfDay.js @@ -0,0 +1,253 @@ +import React from "react"; + +import CountDown from "./Countdown"; +import Grid from '@mui/material/Grid'; +import Box from '@mui/material/Box'; +import Typography from '@mui/material/Typography'; +import Image_1 from '../assets/deals_of_day_1.jpg'; +import Image_2 from '../assets/deals_of_day_2.jpg'; +import { Container } from "@mui/material"; +import { makeStyles } from "@material-ui/core/styles"; +import Link from "next/link"; + +const colorHover = '#40c6ff'; +const useStyles = makeStyles({ + dealsOfDay: { + display: "flex", + alignItems: "center", + flexDirection: "column", + marginTop: "50px" + + }, + circle: { + width: 45, + height: 45, + borderRadius: 25, + backgroundColor: "#40c6ff", + position: "absolute", + top: 16, + left: 16, + display: "flex", + justifyContent: "center", + alignItems: "center", + }, + button: { + width: 125, + height: 40, + borderRadius: 20, + border: "2px solid rgb(64,198,255)", + color: "rgb(64,198,255)", + display: "flex", + justifyContent: "center", + alignItems: "center", + marginTop: 30, + cursor: "pointer", + '&:hover': { + background: "rgb(64,198,255)", + color: "#ffff", + transition: 'all 0.25s', + + } + }, + layoutDealsDay: { + display: "flex", + justifyContent: "space-between", + width: "95%", + flexWrap: "wrap", + '@media (max-width: 768px)': { + display: "flex" + } + }, + layoutIteam: { + display: "flex", + alignItems: "center", + width: "45%", + '@media (max-width: 600px)': { + display: "block", + width: "100%", + marginBottom: "30px" + }, + '@media (max-width: 768px)': { + display: "flex", + }, + '@media (max-width: 1100px)': { + display: "block", + }, + + }, + buttonLink: { + textDecoration: "none", + '&:hover': { + color: "#fff", + transition: 'all 0.25s', + } + }, + nameProSales: { + fontFamily: 'Mulish,sans-serif', + fontSize: '19px', + fontWeight: 'bold', + color: '#444', + marginBottom: '10px', + }, + titleHome: { + fontFamily: 'Merriweather,sans-serif', + color: '#444444', + fontSize: '24px', + fontWeight: 'bold', + margin: '30px 0px 25px 0px', + '& span': { + position: 'relative', + display: 'inline-block', + '&::after': { + position: 'absolute', + content: '""', + width: '15px', + height: '1px', + left: '-30px', + top: '18px', + backgroundColor: `${colorHover}`, + }, + '&::before': { + position: 'absolute', + content: '""', + width: '15px', + height: '1px', + right: '-30px', + top: '18px', + backgroundColor: `${colorHover}`, + } + } + }, +}); +export default function DealsOfDay() { + const classes = useStyles(); + return ( + + + + + DEALS OF DAY + + + + + + + + -22% + + + + + + + Softcover Trade Book + + + + + + $5700 + + $2600 + + + Black finish thin profile metal pole and base. White polyresin + torchiere shade. + + + + + SHOP NOW + + + + + + + + + -39% + + + + + + + Sharp Contrast + + + + + + $10000 + + $7800 + + + Caramel Ice Cream with a Swirl of Caramel & Fudge Covered Caramel + Chunks. Caramel lovers wont want to... + + + + + SHOP NOW + + + + + + + + ); +} + + diff --git a/site/components/Footer.js b/site/components/Footer.js new file mode 100644 index 0000000..7f27c4f --- /dev/null +++ b/site/components/Footer.js @@ -0,0 +1,256 @@ +import React from "react"; +import { Container, Box, Grid } from '@mui/material'; +import Link from "next/link"; + +// add font +import HomeIcon from '@mui/icons-material/Home'; +import LocalPhoneIcon from '@mui/icons-material/LocalPhone'; +import MailIcon from '@mui/icons-material/Mail'; +import PublicIcon from '@mui/icons-material/Public'; +import FacebookSharpIcon from '@mui/icons-material/FacebookSharp'; +import TwitterIcon from '@mui/icons-material/Twitter'; +import GoogleIcon from '@mui/icons-material/Google'; +import LinkedInIcon from '@mui/icons-material/LinkedIn'; +import FiberManualRecordIcon from '@mui/icons-material/FiberManualRecord'; +import FavoriteIcon from '@mui/icons-material/Favorite'; + +// makestyle +import { makeStyles } from "@material-ui/core/styles"; + +const colorHeading = '#323232'; +const colorHover = '#40c6ff'; +const colorDefaul = '#666'; + +// import images +import imgWorking from '../assets/imgWorking.jpg'; + +const useStyle_footer = makeStyles({ + box_f: { + '@media (max-width: 899px)': { + marginBottom: '25px', + Clear: 'both', + overflow: 'hidden', + } + }, + footer_main: { + backgroundColor: '#fff', + paddingTop: '45px', + paddingBottom: '8px', + }, + title_f: { + fontSize: '16px', + fontWeight: 'bold', + margin: '10px 0px 14px 0px', + borderBottom: 'none', + paddingBottom: '0px', + fontFamily: 'Merriweather', + color: `${colorHeading}`, + }, + address_f: { + listStyle: 'none', + padding: '0px', + margin: '0px 0px 15px 0px', + '& li': { + padding: '8px 0px', + marginBottom: '3px', + borderBottom: 'none', + color: `${colorDefaul}`, + '&:first-child': { + paddingRight: '30px', + }, + '& svg': { + fontSize: '16px', + color: `${colorDefaul}`, + marginRight: '15px', + }, + '& a': { + color: `${colorDefaul}`, + '&:hover': { + color: `${colorHover}`, + } + } + } + }, + social_f: { + listStyle: 'none', + padding: '0px', + margin: '0px', + float: 'left', + '& li': { + display: 'inline-flex', + padding: '0px', + margin: '0px', + '& a': { + width: 40, + height: 40, + display: 'inline-flex', + justifyContent: 'center', + alignItems: 'center', + marginRight: '15px', + borderRadius: '50%', + transition: '0.35s', + border: '1px solid #666', + '& svg': { + fontSize: ' 16px', + color: `${colorDefaul}`, + }, + '&:hover': { + borderColor: `${colorHover}`, + backgroundColor: `${colorHover}`, + '& svg': { + color: "#fff", + }, + } + } + } + }, + menu_footer: { + listStyle: 'none', + padding: '0px', + margin: '0px', + '& li': { + display: 'flex', + alignItems: 'center', + lineHeight: '30px', + '& svg': { + fontSize: '8px', + marginRight: '15px', + color: `${colorDefaul}`, + + }, + '& a': { + color: `${colorDefaul}`, + fontSize: '16px', + '&:hover': { + color: `${colorHover}`, + } + } + + } + }, + descWorking: { + color: `${colorDefaul}`, + fontSize: '16px', + '& span': { + display: 'block', + lineHeight: '30px', + } + }, + boxWorking: { + backgroundImage: `url(${imgWorking.src})`, + backgroundRepeat: 'no-repeat', + backgroundSize: 'cover', + minHeight: '160px', + width: ' 100%', + borderRadius: '10px', + marginTop: '10px', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + flexDirection: 'column', + color: '#fff', + fontSize: '16px', + '& svg': { + color: '#fe7fa9', + marginTop: '10px', + } + } + +}); +const Footer = () => { + const classes = useStyle_footer() + return ( +
+ + + + + +
+

Contact us

+ +
    +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
+
+
+ + + + +
+

My account

+ +
+
+ +
+

Working Time

+
+ Mon to Fri:8:30 am - 6:00 pm + Sat and Sun:10:00 am – 5:00 pm +
+
+ + Time In Works + 8:30 am - 6:00 pm +
+
+
+
+
+
+
+
+ ) +} +export default Footer; diff --git a/site/components/HeaderCenter.js b/site/components/HeaderCenter.js new file mode 100644 index 0000000..934346e --- /dev/null +++ b/site/components/HeaderCenter.js @@ -0,0 +1,28 @@ +import React from "react"; +import { Container, Grid } from '@mui/material'; +import MenuListComposition from '../components/menu'; +import ResponsiveAppBar from '../components/menuPhu'; + +// import banerHome +import bannerHome from '../assets/bannerHome.png'; + + +const HeaderCenter = () => { + return ( + <> + + + + + + + + + + + + + + ) +} +export default HeaderCenter; \ No newline at end of file diff --git a/site/components/HeaderMid.js b/site/components/HeaderMid.js new file mode 100644 index 0000000..c4efba9 --- /dev/null +++ b/site/components/HeaderMid.js @@ -0,0 +1,250 @@ +import React from "react"; +import { Container, Box, Grid } from '@mui/material'; +import { AppProvider } from "@lib/context/AppContext"; +// import icon +import SearchOutlinedIcon from '@mui/icons-material/SearchOutlined'; +// import logo +import LogoeBay from '../assets/ebaylogo.png'; +import arrow_down from '../assets/arrow_down.png'; +// makestyle +import { makeStyles } from "@material-ui/core/styles"; +import Link from 'next/link'; +import CartIcon from "./cart/CartIcon"; +import PropTypes from 'prop-types'; +import { useState } from "react"; +// import { useLazyQuery } from "@apollo/client"; +// import client from "../libs/apollo/ApolloClient"; +import { useRouter } from "next/router"; + +export const PER_PAGE_FIRST = 9; +export const PER_PAGE_REST = 12; + + +const GET_SEARCH_RESULTS = `query Product($collectionSlug: String!) { + search(input: {collectionSlug: $collectionSlug , take: 12}) { + items { + productName + price { + ... on SinglePrice { + __typename + value + } + } + slug + productAsset { + preview + } + } + } + }`; + +const Item = () => { }; +const useStyle_searchHeader = makeStyles({ + + HeaderMidItem: { + borderBottom: '1px solid #eee', + paddingTop: 15, + paddingBottom: 15, + backgroundColor: '#fff', + }, + logo: { + '@media (max-width: 899px)': { + margin: '15px 0px', + textAlign: 'center', + } + }, + SearchHeader: { + width: '100%', + display: 'flex', + position: 'relative', + '& select': { + width: ' 25%', + float: 'left', + height: '36px', + paddingLeft: '15px', + border: '1px solid #d1d3d4', + borderRight: 'none', + borderRadius: '50px 0 0 50px', + color: '#666', + minWidth: '187px', + appearance: 'none', + backgroundImage: `url(${arrow_down.src})`, + backgroundRepeat: 'no-repeat', + backgroundPosition: 'right 10px top 14px', + fontSize: '15px', + fontFamily: "Mulish,'sans-serif'", + fontWeight: 400, + '&:focus': { + outline: 'none', + }, + '@media (max-width: 599px)': { + display: 'none', + } + }, + '& input': { + height: '36px', + width: ' 100%', + padding: '0px 95px 0px 15px', + border: '1px solid #d1d3d4', + borderRadius: '0px 50px 50px 0px', + color: '#666', + fontSize: '15px', + fontFamily: "Mulish,'sans-serif'", + fontWeight: 400, + '&:focus': { + outline: 'none', + }, + '@media (max-width: 599px)': { + borderRadius: '50px', + } + }, + '& button': { + position: 'absolute', + right: '10px', + top: '0px', + border: 'none', + backgroundColor: 'transparent', + overflow: 'hidden', + width: '60px', + height: '36px', + padding: 0, + borderLeft: '1px solid #d1d3d4', + zIndex: 10, + '&:hover': { + cursor: 'pointer', + }, + '& svg': { + fontSize: '25', + margin: '7px -9px 0px 0px', + color: '#444', + } + } + }, + boxCart: { + textAlign: 'right', + }, + cartHeader: { + position: 'relative', + display: 'inline-block', + width: '30px', + height: '30px', + '& svg': { + fontSize: '30px', + }, + + + } +}); + + + +const HeaderMid = (props) => { + + const router = useRouter(); + // const handleSubmit = (value) => { + // //console.log(value); + // router.push(`?cat=${value}`); + // }; + + + const [searchQuery, setSearchQuery] = useState(''); + const [searchError, setSearchError] = useState(''); + const [queryResultPosts, setQueryResultPosts] = useState({}); + const [showResultInfo, setShowResultInfo] = useState(false); + + const handleSubmit = (event, value) => { + + event.preventDefault(); + setShowResultInfo(false) + router.push(`/searchresult?collectionSlug=${searchQuery}`); + }; + + const changeSearchQuery = (e) => { + setSearchQuery(e.target.value); + } + + const classes = useStyle_searchHeader(); + + return ( + <> + +
+ + + + + +
+ + + + + +
+
+ +
+ + setSearchQuery(event?.target?.value)} + /> + + + +
+
+ + + +
+
+
+
+
+
+ + ); +}; + +HeaderMid.PropTypes = { + searchQuery: PropTypes.string, + setSearchQuery: PropTypes.func, + handleSearchForm: PropTypes.func +} + +HeaderMid.defaultProps = { + searchQuery: '', + setSearchQuery: () => null, + handleSearchForm: () => null +} +export async function getStaticProps() { + const { data, errors } = await client.query({ + query: GET_SEARCH_RESULTS, + }); + const defaultProps = { + props: { + data: { ...data, slug: 'slug' } + }, + revalidate: 1, + }; +} + + +export default HeaderMid; diff --git a/site/components/auth/ForgotPassword.tsx b/site/components/auth/ForgotPassword.tsx new file mode 100644 index 0000000..dbac371 --- /dev/null +++ b/site/components/auth/ForgotPassword.tsx @@ -0,0 +1,78 @@ +import { FC, useEffect, useState, useCallback } from 'react' +import { validate } from 'email-validator' +import { useUI } from '@components/ui/context' +import { Logo, Button, Input } from '@components/ui' + +interface Props {} + +const ForgotPassword: FC = () => { + // Form State + const [email, setEmail] = useState('') + const [loading, setLoading] = useState(false) + const [message, setMessage] = useState('') + const [dirty, setDirty] = useState(false) + const [disabled, setDisabled] = useState(false) + + const { setModalView, closeModal } = useUI() + + const handleResetPassword = async (e: React.SyntheticEvent) => { + e.preventDefault() + + if (!dirty && !disabled) { + setDirty(true) + handleValidation() + } + } + + const handleValidation = useCallback(() => { + // Unable to send form unless fields are valid. + if (dirty) { + setDisabled(!validate(email)) + } + }, [email, dirty]) + + useEffect(() => { + handleValidation() + }, [handleValidation]) + + return ( +
+
+ +
+
+ {message && ( +
{message}
+ )} + + +
+ +
+ + + Do you have an account? + {` `} + setModalView('LOGIN_VIEW')} + > + Log In + + +
+
+ ) +} + +export default ForgotPassword diff --git a/site/components/auth/LoginView.tsx b/site/components/auth/LoginView.tsx new file mode 100644 index 0000000..3c8faef --- /dev/null +++ b/site/components/auth/LoginView.tsx @@ -0,0 +1,103 @@ +import { FC, useEffect, useState, useCallback } from 'react' +import { Logo, Button, Input } from '@components/ui' +import useLogin from '@framework/auth/use-login' +import { useUI } from '@components/ui/context' +import { validate } from 'email-validator' + +const LoginView: React.FC = () => { + // Form State + const [email, setEmail] = useState('') + const [password, setPassword] = useState('') + const [loading, setLoading] = useState(false) + const [message, setMessage] = useState('') + const [dirty, setDirty] = useState(false) + const [disabled, setDisabled] = useState(false) + const { setModalView, closeModal } = useUI() + + const login = useLogin() + + const handleLogin = async (e: React.SyntheticEvent) => { + e.preventDefault() + + if (!dirty && !disabled) { + setDirty(true) + handleValidation() + } + + try { + setLoading(true) + setMessage('') + await login({ + email, + password, + }) + setLoading(false) + closeModal() + } catch (e: any) { + setMessage(e.errors[0].message) + setLoading(false) + setDisabled(false) + } + } + + const handleValidation = useCallback(() => { + // Test for Alphanumeric password + const validPassword = /^(?=.*[a-zA-Z])(?=.*[0-9])/.test(password) + + // Unable to send form unless fields are valid. + if (dirty) { + setDisabled(!validate(email) || password.length < 7 || !validPassword) + } + }, [email, password, dirty]) + + useEffect(() => { + handleValidation() + }, [handleValidation]) + + return ( +
+
+ +
+
+ {message && ( + + )} + + + + +
+ Don't have an account? + {` `} + setModalView('SIGNUP_VIEW')} + > + Sign Up + +
+
+
+ ) +} + +export default LoginView diff --git a/site/components/auth/SignUpView.tsx b/site/components/auth/SignUpView.tsx new file mode 100644 index 0000000..a85a3bc --- /dev/null +++ b/site/components/auth/SignUpView.tsx @@ -0,0 +1,114 @@ +import { FC, useEffect, useState, useCallback } from 'react' +import { validate } from 'email-validator' +import { Info } from '@components/icons' +import { useUI } from '@components/ui/context' +import { Logo, Button, Input } from '@components/ui' +import useSignup from '@framework/auth/use-signup' + +interface Props {} + +const SignUpView: FC = () => { + // Form State + const [email, setEmail] = useState('') + const [password, setPassword] = useState('') + const [firstName, setFirstName] = useState('') + const [lastName, setLastName] = useState('') + const [loading, setLoading] = useState(false) + const [message, setMessage] = useState('') + const [dirty, setDirty] = useState(false) + const [disabled, setDisabled] = useState(false) + + const signup = useSignup() + const { setModalView, closeModal } = useUI() + + const handleSignup = async (e: React.SyntheticEvent) => { + e.preventDefault() + + if (!dirty && !disabled) { + setDirty(true) + handleValidation() + } + + try { + setLoading(true) + setMessage('') + await signup({ + email, + firstName, + lastName, + password, + }) + setLoading(false) + closeModal() + } catch ({ errors }) { + setMessage(errors[0].message) + setLoading(false) + } + } + + const handleValidation = useCallback(() => { + // Test for Alphanumeric password + const validPassword = /^(?=.*[a-zA-Z])(?=.*[0-9])/.test(password) + + // Unable to send form unless fields are valid. + if (dirty) { + setDisabled(!validate(email) || password.length < 7 || !validPassword) + } + }, [email, password, dirty]) + + useEffect(() => { + handleValidation() + }, [handleValidation]) + + return ( +
+
+ +
+
+ {message && ( +
{message}
+ )} + + + + + + + + {' '} + + Info: Passwords must be longer than 7 chars and + include numbers.{' '} + + +
+ +
+ + + Do you have an account? + {` `} + setModalView('LOGIN_VIEW')} + > + Log In + + +
+
+ ) +} + +export default SignUpView diff --git a/site/components/auth/index.ts b/site/components/auth/index.ts new file mode 100644 index 0000000..11571fa --- /dev/null +++ b/site/components/auth/index.ts @@ -0,0 +1,3 @@ +export { default as LoginView } from './LoginView' +export { default as SignUpView } from './SignUpView' +export { default as ForgotPassword } from './ForgotPassword' diff --git a/site/components/cart/AddToCartButton.js b/site/components/cart/AddToCartButton.js new file mode 100644 index 0000000..3bbf425 --- /dev/null +++ b/site/components/cart/AddToCartButton.js @@ -0,0 +1,87 @@ +import Link from 'next/link'; +import React from 'react'; +import { useState, useContext } from 'react'; +//import { AppContext } from '../../libs/context/AppContext'; +//import { addFirstProduct, updateCart } from '../../function'; + +//import { makeStyles } from "@material-ui/core/styles"; +//import { AppProvider } from '../../libs/context/AppContext'; +import { makeStyles } from "@material-ui/core/styles"; + + +const colorHover = '#40c6ff'; + +const useStyles = makeStyles({ + btnviewcart: { + margin: '25px', + }, + AddToCartButton: { + borderRadius: '20px', + backgroundColor: `${colorHover}`, + height: '40px', + lineHeight: '34px', + padding: '0px 30px', + color: '#fff', + border: 'none', + textTransform: 'uppercase', + fontSize: '16px', + marginTop: '20px', + '&:hover': { + cursor: 'pointer', + }, + '&:last-child': { + marginLeft: '20px', + } + } +}); + + +const AddToCartButton = (props) => { + + const classes = useStyles(); + const { product } = props; + //const [cart, setCart] = useContext(AppContext); + const [showViewCart, setShowViewCart] = useState(false); + + + // const handleAddToCartClick = () => { + // if (process.browser) { + // let existingCart = localStorage.getItem('woo-next-cart'); + + // // if cart has item(s) already, then update the exiting + + // if (existingCart) { + // existingCart = JSON.parse(existingCart); + + // const qtyToBeAdded = 1; + + // const updatedCart = updateCart(existingCart, product, qtyToBeAdded); + // setCart(updatedCart); + + // } else { + // // add new cart + // const newCart = addFirstProduct(product); + // setCart(newCart); + // } + // setShowViewCart(true); + // } + // }; + + + return ( + + + + {showViewCart ? ( + + + + + + ) : ''} + + + ) +}; + +export default AddToCartButton; diff --git a/site/components/cart/CartIcon.js b/site/components/cart/CartIcon.js new file mode 100644 index 0000000..d041b55 --- /dev/null +++ b/site/components/cart/CartIcon.js @@ -0,0 +1,57 @@ +import React from 'react'; +import { useContext } from 'react'; +import { AppContext, AppProvider } from '../../lib/context/AppContext'; +import Link from 'next/link'; +import { makeStyles } from "@material-ui/core/styles"; +import LocalMallOutlinedIcon from '@mui/icons-material/LocalMallOutlined'; + + +const useStyles = makeStyles({ + containercart: { + position: 'relative', + cursor: 'pointer', + marginTop: '5px', + '& span': { + position: 'absolute', + bottom: '0px', + right: '-6px', + width: '20px', + height: '20px', + backgroundColor: '#40c6ff', + display: 'inline-flex', + justifyContent: 'center', + alignItems: 'center', + color: 'black', + borderRadius: '50%', + color: '#fff' + } + } +}); + +const CartIcon = () => { + + const classes = useStyles(); + const [cart, setCart] = useContext(AppContext); + const productsCount = (null !== cart && Object.keys(cart).length) ? cart.totalProductsCount : ''; + const totalPrice = (null !== cart && Object.keys(cart).length) ? cart.totalProductsPrice : ''; + + //console.log('productsCount',productsCount); + // console.log('totalPrice', totalPrice); + + return ( + + + + +
+ + {parseInt(productsCount) ? { parseInt(productsCount) } : ''} +
+ +
+ +
+ ) +}; + +export default CartIcon; diff --git a/site/components/cart/CartItem/CartItem.module.css b/site/components/cart/CartItem/CartItem.module.css new file mode 100644 index 0000000..dd43314 --- /dev/null +++ b/site/components/cart/CartItem/CartItem.module.css @@ -0,0 +1,32 @@ +.root { + @apply flex flex-col py-4; +} + +.root:first-child { + padding-top: 0; +} + +.quantity { + appearance: textfield; + @apply w-8 border-accent-2 border mx-3 rounded text-center text-sm text-black; +} + +.quantity::-webkit-outer-spin-button, +.quantity::-webkit-inner-spin-button { + @apply appearance-none m-0; +} + +.productImage { + position: absolute; + transform: scale(1.9); + width: 100%; + height: 100%; + left: 30% !important; + top: 30% !important; + z-index: 1; +} + +.productName { + @apply font-medium cursor-pointer pb-1; + margin-top: -4px; +} diff --git a/site/components/cart/CartItem/CartItem.tsx b/site/components/cart/CartItem/CartItem.tsx new file mode 100644 index 0000000..ecd3e39 --- /dev/null +++ b/site/components/cart/CartItem/CartItem.tsx @@ -0,0 +1,159 @@ +import { ChangeEvent, FocusEventHandler, useEffect, useState } from 'react' +import cn from 'clsx' +import Image from 'next/image' +import Link from 'next/link' +import s from './CartItem.module.css' +import { useUI } from '@components/ui/context' +import type { LineItem } from '@commerce/types/cart' +import usePrice from '@framework/product/use-price' +import useUpdateItem from '@framework/cart/use-update-item' +import useRemoveItem from '@framework/cart/use-remove-item' +import Quantity from '@components/ui/Quantity' + +type ItemOption = { + name: string + nameId: number + value: string + valueId: number +} + +const placeholderImg = '/product-img-placeholder.svg' + +const CartItem = ({ + item, + variant = 'default', + currencyCode, + ...rest +}: { + variant?: 'default' | 'display' + item: LineItem + currencyCode: string +}) => { + const { closeSidebarIfPresent } = useUI() + const [removing, setRemoving] = useState(false) + const [quantity, setQuantity] = useState(item.quantity) + const removeItem = useRemoveItem() + const updateItem = useUpdateItem({ item }) + + const { price } = usePrice({ + amount: item.variant.price * item.quantity, + baseAmount: item.variant.listPrice * item.quantity, + currencyCode, + }) + + const handleChange = async ({ + target: { value }, + }: ChangeEvent) => { + setQuantity(Number(value)) + await updateItem({ quantity: Number(value) }) + } + + const increaseQuantity = async (n = 1) => { + const val = Number(quantity) + n + setQuantity(val) + await updateItem({ quantity: val }) + } + + const handleRemove = async () => { + setRemoving(true) + try { + await removeItem(item) + } catch (error) { + setRemoving(false) + } + } + + // TODO: Add a type for this + const options = (item as any).options + + useEffect(() => { + // Reset the quantity state if the item quantity changes + 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 ( +
  • +
    + +
    + + + closeSidebarIfPresent()} + > + {item.name} + + + + {options && options.length > 0 && ( +
    + {options.map((option: ItemOption, i: number) => ( +
    + {option.name} + {option.name === 'Color' ? ( + + ) : ( + + {option.value} + + )} + {i === options.length - 1 ? '' : } +
    + ))} +
    + )} + {variant === 'display' && ( +
    {quantity}x
    + )} +
    +
    + {price} +
    +
    + {variant === 'default' && ( + increaseQuantity(1)} + decrease={() => increaseQuantity(-1)} + /> + )} +
  • + ) +} + +export default CartItem diff --git a/site/components/cart/CartItem/index.ts b/site/components/cart/CartItem/index.ts new file mode 100644 index 0000000..b5f6dc5 --- /dev/null +++ b/site/components/cart/CartItem/index.ts @@ -0,0 +1 @@ +export { default } from './CartItem' diff --git a/site/components/cart/CartSidebarView/CartSidebarView.module.css b/site/components/cart/CartSidebarView/CartSidebarView.module.css new file mode 100644 index 0000000..c9ffbed --- /dev/null +++ b/site/components/cart/CartSidebarView/CartSidebarView.module.css @@ -0,0 +1,11 @@ +.root { + min-height: 100vh; +} + +.root.empty { + @apply bg-secondary text-secondary; +} + +.lineItemsList { + @apply py-4 space-y-6 sm:py-0 sm:space-y-0 sm:divide-y sm:divide-accent-2 border-accent-2; +} diff --git a/site/components/cart/CartSidebarView/CartSidebarView.tsx b/site/components/cart/CartSidebarView/CartSidebarView.tsx new file mode 100644 index 0000000..327602c --- /dev/null +++ b/site/components/cart/CartSidebarView/CartSidebarView.tsx @@ -0,0 +1,131 @@ +import cn from 'clsx' +import Link from 'next/link' +import { FC } from 'react' +import s from './CartSidebarView.module.css' +import CartItem from '../CartItem' +import { Button, Text } from '@components/ui' +import { useUI } from '@components/ui/context' +import { Bag, Cross, Check } from '@components/icons' +import useCart from '@framework/cart/use-cart' +import usePrice from '@framework/product/use-price' +import SidebarLayout from '@components/common/SidebarLayout' + +const CartSidebarView: FC = () => { + const { closeSidebar, setSidebarView } = useUI() + const { data, isLoading, isEmpty } = useCart() + + const { price: subTotal } = usePrice( + data && { + amount: Number(data.subtotalPrice), + currencyCode: data.currency.code, + } + ) + const { price: total } = usePrice( + data && { + amount: Number(data.totalPrice), + currencyCode: data.currency.code, + } + ) + const handleClose = () => closeSidebar() + const goToCheckout = () => setSidebarView('CHECKOUT_VIEW') + + const error = null + const success = null + + return ( + + {isLoading || isEmpty ? ( +
    + + + +

    + Your cart is empty +

    +

    + Biscuit oat cake wafer icing ice cream tiramisu pudding cupcake. +

    +
    + ) : error ? ( +
    + + + +

    + We couldn’t process the purchase. Please check your card information + and try again. +

    +
    + ) : success ? ( +
    + + + +

    + Thank you for your order. +

    +
    + ) : ( + <> +
    + + + + My Cart + + + +
      + {data!.lineItems.map((item: any) => ( + + ))} +
    +
    + +
    +
      +
    • + Subtotal + {subTotal} +
    • +
    • + Taxes + Calculated at checkout +
    • +
    • + Shipping + FREE +
    • +
    +
    + Total + {total} +
    +
    + {process.env.COMMERCE_CUSTOMCHECKOUT_ENABLED ? ( + + ) : ( + + )} +
    +
    + + )} +
    + ) +} + +export default CartSidebarView diff --git a/site/components/cart/CartSidebarView/index.ts b/site/components/cart/CartSidebarView/index.ts new file mode 100644 index 0000000..0262e44 --- /dev/null +++ b/site/components/cart/CartSidebarView/index.ts @@ -0,0 +1 @@ +export { default } from './CartSidebarView' diff --git a/site/components/cart/cart-page/CartItemsContainer.js b/site/components/cart/cart-page/CartItemsContainer.js new file mode 100644 index 0000000..da4fa4a --- /dev/null +++ b/site/components/cart/cart-page/CartItemsContainer.js @@ -0,0 +1,356 @@ +import * as React from "react"; +import Link from 'next/link'; +import { useContext, useState } from 'react'; +import { AppContext } from '../../../libs/context/AppContext'; +//import { getFormattedCart, getUpdatedItems } from '../../../functions'; +import CartItem from './Cartitem'; +import { v4 } from 'uuid'; +import { Button, Grid } from '@mui/material'; +import { useMutation, useQuery } from '@apollo/client'; +import { removeItemFromCart } from '../../../function'; +import { makeStyles } from "@material-ui/core/styles"; +import Box from '@mui/material/Box'; +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import ListItemText from '@mui/material/ListItemText'; +import Typography from '@mui/material/Typography'; +import Paper from '@mui/material/Paper'; +import Radio from '@mui/material/Radio'; +import RadioGroup from '@mui/material/RadioGroup'; +import FormControlLabel from '@mui/material/FormControlLabel'; +import FormControl from '@mui/material/FormControl'; +import Divider from '@mui/material/Divider'; +import Table from '@mui/material/Table'; +import TableBody from '@mui/material/TableBody'; +import TableCell from '@mui/material/TableCell'; +import TableContainer from '@mui/material/TableContainer'; +import TableHead from '@mui/material/TableHead'; +import TableRow from '@mui/material/TableRow'; +import Modal from "@mui/material/Modal"; +import TextField from '@material-ui/core/TextField'; +import { useRouter } from "next/router"; +import { useFormik } from 'formik'; +import * as yup from 'yup'; + + +//import UPDATE_CART from "../../../mutations/update-cart"; +//import GET_CART from "../../../queries/get-cart"; +//import CLEAR_CART_MUTATION from "../../../mutations/clear-cart"; +// import { isEmpty } from 'lodash' +const style = { + position: "absolute", + top: "50%", + left: "50%", + transform: "translate(-50%, -50%)", + width: 400, + bgcolor: "background.paper", + border: "2px solid #000", + boxShadow: 24, + p: 4 +}; + +const useStyles_cart = makeStyles(theme => ({ + wooNextCartWrapper: { + display: "flex", + "@media (max-width: 768px)": { + display: "block" + } + }, + buttonCheckout: { + textAlign: "center", + marginTop: "10px", + marginBottom: "15px", + paddingBottom: "20px" + }, + cartTotal: { + background: "rgb(231, 235, 240)", + marginTop: "30px" + }, + tableCart: { + paddingRight: "50px" + }, + buttonContinue: { + marginTop: "20px" + }, + cartTotalLeft: { + paddingTop: "16px" + } + +})); + +const validationSchema = yup.object({ + email: yup + .string('Enter your email') + .email('Enter a valid email') + .required('Email is required'), + password: yup + .string('Enter your password') + .min(6, 'Password should be of minimum 6 characters length') + .required('Password is required'), +}); +const CartItemsContainer = () => { + + + // @TODO wil use it in future variations of the project. + const [cart, setCart] = useContext(AppContext); + //console.warn(cart); + //const [requestError, setRequestError] = useState(null); + + // Get Cart Data. + // const { loading, error, data, refetch } = useQuery(GET_CART, { + // notifyOnNetworkStatusChange: true, + // onCompleted: () => { + + // // Update cart in the localStorage. + // const updatedCart = getFormattedCart(data); + // localStorage.setItem('woo-next-cart', JSON.stringify(updatedCart)); + + // // Update cart data in React Context. + // setCart(updatedCart); + // } + // }); + + // Update Cart Mutation. + // const [updateCart, { data: updateCartResponse, loading: updateCartProcessing, error: updateCartError }] = useMutation(UPDATE_CART, { + // onCompleted: () => { + // refetch(); + // }, + // onError: (error) => { + // if (error) { + // const errorMessage = error?.graphQLErrors?.[0]?.message ? error.graphQLErrors[0].message : ''; + // setRequestError(errorMessage); + // } + // } + // }); + + // Update Cart Mutation. + // const [clearCart, { data: clearCartRes, loading: clearCartProcessing, error: clearCartError }] = useMutation(CLEAR_CART_MUTATION, { + // onCompleted: () => { + // refetch(); + // }, + // onError: (error) => { + // if (error) { + // const errorMessage = !isEmpty(error?.graphQLErrors?.[0]) ? error.graphQLErrors[0]?.message : ''; + // setRequestError(errorMessage); + // } + // } + // }); + + /* + * Handle remove product click. + * + * @param {Object} event event + * @param {Integer} Product Id. + * + * @return {void} + */ + const handleRemoveProductClick = (event, productId) => { + const updatedCart = removeItemFromCart(productId); + + setCart(updatedCart); + }; + // Clear the entire cart. + // const handleClearCart = (event) => { + + // event.stopPropagation(); + + // if (clearCartProcessing) { + // return; + // } + + // clearCart({ + // variables: { + // input: { + // clientMutationId: v4(), + // all: true + // } + // }, + // }); + // } + const router = useRouter(); + const classes = useStyles_cart(); + const [open, setOpen] = React.useState(false); + const handleOpen = () => setOpen(true); + const handleClose = () => setOpen(false); + const handleChange = () => { + setChecked((prev) => !prev); + }; + const formik = useFormik({ + initialValues: { + email: 'admin@gmail.com', + password: 'admin123', + }, + validationSchema: validationSchema, + onSubmit: (values) => { + if (values.email == 'admin@gmail.com' && values.password == 'admin123') { + router.push('/checkout'); + } else { + alert('Wrong user'); + } + }, + }); + return ( +
    + {cart ? ( +
    + + + + + + + Delete + Product + + Price + Quantity + Total + + + + {cart?.products?.length && ( + cart.products.map(item => ( + + )) + )} + +
    +
    + + + + + + +
    +
    + + + Cart Total + + + + + Subtotal: + + ${cart.totalProductsPrice} + + + + + Shipping: + + + + } label="FreeShipping" /> + + + + + + Clock Shop: + + + + } label="Flat Rate" /> + + + + + + + Total: + + ${cart.totalProductsPrice} + + + + {/*Proceeed to checkout */} + + + + + + Login + +
    + + Username or email address * + + + + Password * + + + + + +
    +
    + +
    + + {/* + + */} + +
    +
    +
    + {/* Display Errors if any */} + {/* {requestError ?
    {requestError}
    : ''} */} +
    + ) : ( +
    +

    No items in the cart

    + + + +
    + )} +
    + + ); +}; + +export default CartItemsContainer; diff --git a/site/components/cart/cart-page/Cartitem.js b/site/components/cart/cart-page/Cartitem.js new file mode 100644 index 0000000..f174b15 --- /dev/null +++ b/site/components/cart/cart-page/Cartitem.js @@ -0,0 +1,95 @@ +import { useState } from 'react'; +import CloseIcon from '@mui/icons-material/Close'; +import { updateCart2 } from "../../../function"; +import Table from '@mui/material/Table'; +import TableBody from '@mui/material/TableBody'; +import TableCell from '@mui/material/TableCell'; +import TableRow from '@mui/material/TableRow'; +import Typography from '@mui/material/Typography'; +import TextField from '@mui/material/TextField'; +import { makeStyles } from "@material-ui/core/styles"; + + +const useStyles_cartItem = makeStyles(theme => ({ + cartelementPrice:{ + color: "rgb(64,198,255)", + }, + cartelementTotal:{ + color: "rgb(64,198,255)", + }, + cartqtyinput:{ + width:"50%", + height:"40px", + paddingLeft:"10px", + + } + +})); + +const CartItem = ({ + item, + setCart, + handleRemoveProductClick, + +}) => { + + const [productCount, setProductCount] = useState(item.qty); + + + const handleQtyChange = (event) => { + if (process.browser) { + const newQty = event.target.value; + setProductCount(newQty); + + //console.warn(newQty); + + // LAY DU LIEU TU LOCALSTORAGE + let existingCart = localStorage.getItem('woo-next-cart'); + existingCart = JSON.parse(existingCart); + //@TOTO Update the cart + const updatedCart = updateCart2(existingCart, item, false, newQty); + setCart(updatedCart); + } + + }; + + const classes = useStyles_cartItem(); + return ( + + {/*Icon close */} + + handleRemoveProductClick(event, item?.productId)}> + + + + {/* image */} + + + + {/* image */} + + {item?.name} + + {/* PRICE */} + + {'$ ' + item?.price} + + {/* QUANTITY */} + + + + {/* Total */} + + {item.totalPrice} + + + ) +}; + +export default CartItem; diff --git a/site/components/cart/index.ts b/site/components/cart/index.ts new file mode 100644 index 0000000..3e53fa3 --- /dev/null +++ b/site/components/cart/index.ts @@ -0,0 +1,2 @@ +export { default as CartSidebarView } from './CartSidebarView' +export { default as CartItem } from './CartItem' diff --git a/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.module.css b/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.module.css new file mode 100644 index 0000000..34c1b48 --- /dev/null +++ b/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.module.css @@ -0,0 +1,7 @@ +.root { + min-height: calc(100vh - 322px); +} + +.lineItemsList { + @apply py-4 space-y-6 sm:py-0 sm:space-y-0 sm:divide-y sm:divide-accent-2 border-accent-2; +} diff --git a/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx b/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx new file mode 100644 index 0000000..21a20c4 --- /dev/null +++ b/site/components/checkout/CheckoutSidebarView/CheckoutSidebarView.tsx @@ -0,0 +1,122 @@ +import Link from 'next/link' +import { FC, useState } from 'react' +import CartItem from '@components/cart/CartItem' +import { Button, Text } from '@components/ui' +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 s from './CheckoutSidebarView.module.css' +import { useCheckoutContext } from '../context' + +const CheckoutSidebarView: FC = () => { + const [loadingSubmit, setLoadingSubmit] = useState(false) + const { 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( + cartData && { + amount: Number(cartData.subtotalPrice), + currencyCode: cartData.currency.code, + } + ) + const { price: total } = usePrice( + cartData && { + amount: Number(cartData.totalPrice), + currencyCode: cartData.currency.code, + } + ) + + return ( + setSidebarView('CART_VIEW')} + > +
    + + + Checkout + + + + setSidebarView('PAYMENT_VIEW')} + /> + setSidebarView('SHIPPING_VIEW')} + /> + +
      + {cartData!.lineItems.map((item: any) => ( + + ))} +
    +
    + +
    +
      +
    • + Subtotal + {subTotal} +
    • +
    • + Taxes + Calculated at checkout +
    • +
    • + Shipping + FREE +
    • +
    +
    + Total + {total} +
    +
    + {/* Once data is correctly filled */} + +
    +
    +
    + ) +} + +export default CheckoutSidebarView diff --git a/site/components/checkout/CheckoutSidebarView/index.ts b/site/components/checkout/CheckoutSidebarView/index.ts new file mode 100644 index 0000000..168bc58 --- /dev/null +++ b/site/components/checkout/CheckoutSidebarView/index.ts @@ -0,0 +1 @@ +export { default } from './CheckoutSidebarView' diff --git a/site/components/checkout/PaymentMethodView/PaymentMethodView.module.css b/site/components/checkout/PaymentMethodView/PaymentMethodView.module.css new file mode 100644 index 0000000..f3880c7 --- /dev/null +++ b/site/components/checkout/PaymentMethodView/PaymentMethodView.module.css @@ -0,0 +1,17 @@ +.fieldset { + @apply flex flex-col my-3; +} + +.fieldset .label { + @apply text-accent-7 uppercase text-xs font-medium mb-2; +} + +.fieldset .input, +.fieldset .select { + @apply p-2 border border-accent-2 w-full text-sm font-normal; +} + +.fieldset .input:focus, +.fieldset .select:focus { + @apply outline-none shadow-outline-normal; +} diff --git a/site/components/checkout/PaymentMethodView/PaymentMethodView.tsx b/site/components/checkout/PaymentMethodView/PaymentMethodView.tsx new file mode 100644 index 0000000..115619c --- /dev/null +++ b/site/components/checkout/PaymentMethodView/PaymentMethodView.tsx @@ -0,0 +1,130 @@ +import { FC } from 'react' +import cn from 'clsx' + +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 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 { setSidebarView } = useUI() + const addCard = useAddCard() + + async function handleSubmit(event: React.ChangeEvent
    ) { + event.preventDefault() + + 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') + } + + return ( + + setSidebarView('CHECKOUT_VIEW')}> +
    + Payment Method +
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    + ) +} + +export default PaymentMethodView diff --git a/site/components/checkout/PaymentMethodView/index.ts b/site/components/checkout/PaymentMethodView/index.ts new file mode 100644 index 0000000..951b3c3 --- /dev/null +++ b/site/components/checkout/PaymentMethodView/index.ts @@ -0,0 +1 @@ +export { default } from './PaymentMethodView' diff --git a/site/components/checkout/PaymentWidget/PaymentWidget.module.css b/site/components/checkout/PaymentWidget/PaymentWidget.module.css new file mode 100644 index 0000000..38dcab0 --- /dev/null +++ b/site/components/checkout/PaymentWidget/PaymentWidget.module.css @@ -0,0 +1,4 @@ +.root { + @apply border border-accent-2 px-6 py-5 mb-4 text-center + flex items-center cursor-pointer hover:border-accent-4; +} diff --git a/site/components/checkout/PaymentWidget/PaymentWidget.tsx b/site/components/checkout/PaymentWidget/PaymentWidget.tsx new file mode 100644 index 0000000..9b496bb --- /dev/null +++ b/site/components/checkout/PaymentWidget/PaymentWidget.tsx @@ -0,0 +1,28 @@ +import { FC } from 'react' +import s from './PaymentWidget.module.css' +import { ChevronRight, CreditCard, Check } from '@components/icons' + +interface ComponentProps { + onClick?: () => any + isValid?: boolean +} + +const PaymentWidget: FC = ({ onClick, isValid }) => { + /* Shipping Address + Only available with checkout set to true - + This means that the provider does offer checkout functionality. */ + return ( +
    +
    + + + Add Payment Method + + {/* VISA #### #### #### 2345 */} +
    +
    {isValid ? : }
    +
    + ) +} + +export default PaymentWidget diff --git a/site/components/checkout/PaymentWidget/index.ts b/site/components/checkout/PaymentWidget/index.ts new file mode 100644 index 0000000..18cadea --- /dev/null +++ b/site/components/checkout/PaymentWidget/index.ts @@ -0,0 +1 @@ +export { default } from './PaymentWidget' diff --git a/site/components/checkout/ShippingView/ShippingView.module.css b/site/components/checkout/ShippingView/ShippingView.module.css new file mode 100644 index 0000000..157d317 --- /dev/null +++ b/site/components/checkout/ShippingView/ShippingView.module.css @@ -0,0 +1,21 @@ +.fieldset { + @apply flex flex-col my-3; +} + +.fieldset .label { + @apply text-accent-7 uppercase text-xs font-medium mb-2; +} + +.fieldset .input, +.fieldset .select { + @apply p-2 border border-accent-2 w-full text-sm font-normal; +} + +.fieldset .input:focus, +.fieldset .select:focus { + @apply outline-none shadow-outline-normal; +} + +.radio { + @apply bg-black; +} diff --git a/site/components/checkout/ShippingView/ShippingView.tsx b/site/components/checkout/ShippingView/ShippingView.tsx new file mode 100644 index 0000000..ef7c743 --- /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/site/components/checkout/ShippingView/index.ts b/site/components/checkout/ShippingView/index.ts new file mode 100644 index 0000000..428e7e4 --- /dev/null +++ b/site/components/checkout/ShippingView/index.ts @@ -0,0 +1 @@ +export { default } from './ShippingView' diff --git a/site/components/checkout/ShippingWidget/ShippingWidget.module.css b/site/components/checkout/ShippingWidget/ShippingWidget.module.css new file mode 100644 index 0000000..38dcab0 --- /dev/null +++ b/site/components/checkout/ShippingWidget/ShippingWidget.module.css @@ -0,0 +1,4 @@ +.root { + @apply border border-accent-2 px-6 py-5 mb-4 text-center + flex items-center cursor-pointer hover:border-accent-4; +} diff --git a/site/components/checkout/ShippingWidget/ShippingWidget.tsx b/site/components/checkout/ShippingWidget/ShippingWidget.tsx new file mode 100644 index 0000000..1418a2b --- /dev/null +++ b/site/components/checkout/ShippingWidget/ShippingWidget.tsx @@ -0,0 +1,31 @@ +import { FC } from 'react' +import s from './ShippingWidget.module.css' +import { ChevronRight, MapPin, Check } from '@components/icons' + +interface ComponentProps { + onClick?: () => any + isValid?: boolean +} + +const ShippingWidget: FC = ({ onClick, isValid }) => { + /* Shipping Address + Only available with checkout set to true - + This means that the provider does offer checkout functionality. */ + return ( +
    +
    + + + Add Shipping Address + + {/* + 1046 Kearny Street.
    + San Franssisco, California +
    */} +
    +
    {isValid ? : }
    +
    + ) +} + +export default ShippingWidget diff --git a/site/components/checkout/ShippingWidget/index.ts b/site/components/checkout/ShippingWidget/index.ts new file mode 100644 index 0000000..88e6dca --- /dev/null +++ b/site/components/checkout/ShippingWidget/index.ts @@ -0,0 +1 @@ +export { default } from './ShippingWidget' diff --git a/site/components/checkout/context.tsx b/site/components/checkout/context.tsx new file mode 100644 index 0000000..b53b45a --- /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/site/components/collection.js b/site/components/collection.js new file mode 100644 index 0000000..decc06c --- /dev/null +++ b/site/components/collection.js @@ -0,0 +1,117 @@ +import React, { Component, useState } from "react"; +import Grid from "@mui/material/Grid"; +import Container from "@mui/material/Container"; +import Paper from "@mui/material/Paper"; +import Link from "next/link"; +import List from "@mui/material/List"; +import ListItem from "@mui/material/ListItem"; +import Divider from "@mui/material/Divider"; + +import ListItemButton from "@mui/material/ListItemButton"; +import ListItemText from "@mui/material/ListItemText"; +import Rating from "@mui/material/Rating"; +import { makeStyles } from "@material-ui/core/styles"; +import { Box } from "@mui/system"; + +const colorHeading = "#323232"; +const colorHover = "#40c6ff"; +const colorDefaul = "#666"; +const useStyles = makeStyles((theme) => ({ + itemProduct: { + marginBottom: 20, + }, + cardButton: { + paddingBottom: 15, + }, + productImg: { + width: "100%", + height: "auto", + display: "inline-block", + textAlign: "center", + }, + cardBody: { + textAlign: "center", + "& h3": { + fontSize: "19px", + fontWeight: "bold", + color: "#444", + marginTop: "12px", + marginBottom: "10px", + fontFamily: "Mulish,sans-serif", + }, + "& h4": { + marginTop: "6px", + marginBottom: "0px", + }, + }, + cardTitle: { + "&:hover": { + color: `${colorHover}`, + }, + }, + startRating: { + "& span": { + color: "#ffcc35", + fontSize: "18px", + }, + }, + cardPrice: { + color: `${colorHover}`, + fontSize: "22px", + fontWeight: "500", + fontFamily: "Mulish,sans-serif", + }, + regular_price: { + textDecoration: "line-through", + marginRight: "15px", + color: "#999", + fontWeight: "400", + }, + box_product: { + border: "1px solid #efefef", + padding: "15px 15px 22px 15px", + transition: "0.35s", + "&:hover": { + boxShadow: "0 10px 6px -6px #ccc", + }, + }, +})); + +export default function Collection(props) { + const classes = useStyles(); + const { product } = props; + //console.warn(product); + let imageURl = ""; + return ( + <> + + + + + + + + + +

    + + {product.product.name} + +

    + + + +

    + ${product.product.price.value} +

    + +
    +
    +
    + + ); +} diff --git a/site/components/common/Avatar/Avatar.tsx b/site/components/common/Avatar/Avatar.tsx new file mode 100644 index 0000000..6635384 --- /dev/null +++ b/site/components/common/Avatar/Avatar.tsx @@ -0,0 +1,24 @@ +import { FC, useRef, useEffect } from 'react' +import { useUserAvatar } from '@lib/hooks/useUserAvatar' + +interface Props { + className?: string + children?: any +} + +const Avatar: FC = ({}) => { + let ref = useRef() as React.MutableRefObject + let { userAvatar } = useUserAvatar() + + return ( +
    + {/* Add an image - We're generating a gradient as placeholder */} +
    + ) +} + +export default Avatar diff --git a/site/components/common/Avatar/index.ts b/site/components/common/Avatar/index.ts new file mode 100644 index 0000000..a4600ec --- /dev/null +++ b/site/components/common/Avatar/index.ts @@ -0,0 +1 @@ +export { default } from './Avatar' diff --git a/site/components/common/FeatureBar/FeatureBar.module.css b/site/components/common/FeatureBar/FeatureBar.module.css new file mode 100644 index 0000000..50ebeca --- /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/site/components/common/FeatureBar/FeatureBar.tsx b/site/components/common/FeatureBar/FeatureBar.tsx new file mode 100644 index 0000000..0755286 --- /dev/null +++ b/site/components/common/FeatureBar/FeatureBar.tsx @@ -0,0 +1,39 @@ +import cn from 'clsx' +import s from './FeatureBar.module.css' + +interface FeatureBarProps { + className?: string + title: string + description?: string + hide?: boolean + action?: React.ReactNode +} + +const FeatureBar: React.FC = ({ + title, + description, + className, + action, + hide, +}) => { + const rootClassName = cn( + s.root, + { + transform: true, + 'translate-y-0 opacity-100': !hide, + 'translate-y-full opacity-0': hide, + }, + className + ) + return ( +
    + {title} + + {description} + + {action && action} +
    + ) +} + +export default FeatureBar diff --git a/site/components/common/FeatureBar/index.ts b/site/components/common/FeatureBar/index.ts new file mode 100644 index 0000000..d78bc9d --- /dev/null +++ b/site/components/common/FeatureBar/index.ts @@ -0,0 +1 @@ +export { default } from './FeatureBar' diff --git a/site/components/common/Footer/Footer.module.css b/site/components/common/Footer/Footer.module.css new file mode 100644 index 0000000..2ba4920 --- /dev/null +++ b/site/components/common/Footer/Footer.module.css @@ -0,0 +1,13 @@ +.root { + @apply border-t border-accent-2; +} + +.link { + & > svg { + @apply transform duration-75 ease-linear; + } + + &:hover > svg { + @apply scale-110; + } +} diff --git a/site/components/common/Footer/Footer.tsx b/site/components/common/Footer/Footer.tsx new file mode 100644 index 0000000..18e9b40 --- /dev/null +++ b/site/components/common/Footer/Footer.tsx @@ -0,0 +1,117 @@ +import { FC } from 'react' +import cn from 'clsx' +import Link from 'next/link' +import { useRouter } from 'next/router' +import type { Page } from '@commerce/types/page' +import getSlug from '@lib/get-slug' +import { Github, Vercel } from '@components/icons' +import { Logo, Container } from '@components/ui' +import { I18nWidget } from '@components/common' +import s from './Footer.module.css' + +interface Props { + className?: string + children?: any + pages?: Page[] +} + +const links = [ + { + name: 'Home', + url: '/', + }, +] + +const Footer: FC = ({ className, pages }) => { + const { sitePages } = usePages(pages) + const rootClassName = cn(s.root, className) + + return ( + + ) +} + +function usePages(pages?: Page[]) { + const { locale } = useRouter() + const sitePages: Page[] = [] + + if (pages) { + pages.forEach((page) => { + const slug = page.url && getSlug(page.url) + if (!slug) return + if (locale && !slug.startsWith(`${locale}/`)) return + sitePages.push(page) + }) + } + + return { + sitePages: sitePages.sort(bySortOrder), + } +} + +// Sort pages by the sort order assigned in the BC dashboard +function bySortOrder(a: Page, b: Page) { + return (a.sort_order ?? 0) - (b.sort_order ?? 0) +} + +export default Footer diff --git a/site/components/common/Footer/index.ts b/site/components/common/Footer/index.ts new file mode 100644 index 0000000..5d06e9b --- /dev/null +++ b/site/components/common/Footer/index.ts @@ -0,0 +1 @@ +export { default } from './Footer' diff --git a/site/components/common/Head/Head.tsx b/site/components/common/Head/Head.tsx new file mode 100644 index 0000000..ed43c0d --- /dev/null +++ b/site/components/common/Head/Head.tsx @@ -0,0 +1,17 @@ +import type { VFC } from 'react' +import { SEO } from '@components/common' + +const Head: VFC = () => { + return ( + + + + + ) +} + +export default Head diff --git a/site/components/common/Head/index.ts b/site/components/common/Head/index.ts new file mode 100644 index 0000000..b317a12 --- /dev/null +++ b/site/components/common/Head/index.ts @@ -0,0 +1 @@ +export { default } from './Head' diff --git a/site/components/common/HomeAllProductsGrid/HomeAllProductsGrid.module.css b/site/components/common/HomeAllProductsGrid/HomeAllProductsGrid.module.css new file mode 100644 index 0000000..ec2f8ea --- /dev/null +++ b/site/components/common/HomeAllProductsGrid/HomeAllProductsGrid.module.css @@ -0,0 +1,23 @@ +.root { + @apply py-12 flex flex-col w-full px-6; + + @screen md { + @apply flex-row; + } + + & .asideWrapper { + @apply pr-3 w-full relative; + + @screen md { + @apply w-48; + } + } + + & .aside { + @apply flex flex-row w-full justify-around mb-12; + + @screen md { + @apply mb-0 block sticky top-32; + } + } +} diff --git a/site/components/common/HomeAllProductsGrid/HomeAllProductsGrid.tsx b/site/components/common/HomeAllProductsGrid/HomeAllProductsGrid.tsx new file mode 100644 index 0000000..0a40bff --- /dev/null +++ b/site/components/common/HomeAllProductsGrid/HomeAllProductsGrid.tsx @@ -0,0 +1,73 @@ +import { FC } from 'react' +import Link from 'next/link' +import type { Product } from '@commerce/types/product' +import { Grid } from '@components/ui' +import { ProductCard } from '@components/product' +import s from './HomeAllProductsGrid.module.css' +import { getCategoryPath, getDesignerPath } from '@lib/search' + +interface Props { + categories?: any + brands?: any + products?: Product[] +} + +const HomeAllProductsGrid: FC = ({ + categories, + brands, + products = [], +}) => { + return ( +
    +
    +
    + + +
    +
    +
    + + {products.map((product) => ( + + ))} + +
    +
    + ) +} + +export default HomeAllProductsGrid diff --git a/site/components/common/HomeAllProductsGrid/index.ts b/site/components/common/HomeAllProductsGrid/index.ts new file mode 100644 index 0000000..31d313d --- /dev/null +++ b/site/components/common/HomeAllProductsGrid/index.ts @@ -0,0 +1 @@ +export { default } from './HomeAllProductsGrid' diff --git a/site/components/common/I18nWidget/I18nWidget.module.css b/site/components/common/I18nWidget/I18nWidget.module.css new file mode 100644 index 0000000..5b486d5 --- /dev/null +++ b/site/components/common/I18nWidget/I18nWidget.module.css @@ -0,0 +1,48 @@ +.root { + @apply relative; +} + +.button { + @apply h-10 px-2 rounded-md border border-accent-2 flex items-center justify-center transition-colors ease-linear; +} + +.button:hover { + @apply border-accent-3 shadow-sm; +} + +.button:focus { + @apply outline-none; +} + +.dropdownMenu { + @apply fixed right-0 top-12 mt-2 origin-top-right outline-none bg-primary z-40 w-full h-full; +} + +.item { + @apply flex cursor-pointer px-6 py-3 transition ease-in-out duration-150 text-primary leading-6 font-medium items-center; + text-transform: capitalize; +} + +.item:hover { + @apply bg-accent-1; +} + +.icon { + transition: transform 0.2s ease; +} + +.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/site/components/common/I18nWidget/I18nWidget.tsx b/site/components/common/I18nWidget/I18nWidget.tsx new file mode 100644 index 0000000..d09dd1d --- /dev/null +++ b/site/components/common/I18nWidget/I18nWidget.tsx @@ -0,0 +1,101 @@ +import cn from 'clsx' +import Link from 'next/link' +import { FC, useState } from 'react' +import { useRouter } from 'next/router' +import s from './I18nWidget.module.css' +import { Cross, ChevronUp } from '@components/icons' +import ClickOutside from '@lib/click-outside' +interface LOCALE_DATA { + name: string + img: { + filename: string + alt: string + } +} + +const LOCALES_MAP: Record = { + es: { + name: 'Español', + img: { + filename: 'flag-es-co.svg', + alt: 'Bandera Colombiana', + }, + }, + 'en-US': { + name: 'English', + img: { + filename: 'flag-en-us.svg', + alt: 'US Flag', + }, + }, +} + +const I18nWidget: FC = () => { + const [display, setDisplay] = useState(false) + const { + locale, + locales, + defaultLocale = 'en-US', + asPath: currentPath, + } = useRouter() + + const options = locales?.filter((val) => val !== locale) + const currentLocale = locale || defaultLocale + + return ( + setDisplay(false)}> + + + ) +} + +export default I18nWidget diff --git a/site/components/common/I18nWidget/index.ts b/site/components/common/I18nWidget/index.ts new file mode 100644 index 0000000..46525c3 --- /dev/null +++ b/site/components/common/I18nWidget/index.ts @@ -0,0 +1 @@ +export { default } from './I18nWidget' diff --git a/site/components/common/Layout/Layout.js b/site/components/common/Layout/Layout.js new file mode 100644 index 0000000..fac4d74 --- /dev/null +++ b/site/components/common/Layout/Layout.js @@ -0,0 +1,30 @@ +import React from "react"; + +// import header footer all pages +import AddHead from "../../AddHead"; +import SideBarTop from "../../sidebar"; +import HeaderMid from "../../HeaderMid"; +import HeaderCenter from "../../HeaderCenter"; +import Footer from "../../Footer"; +import Copyright from "../../Copyright"; +//import { AppProvider } from "./context/Appcontext"; + +const Layout = ({ children }) => { + return ( + // +
    + + + + + + {children} + +
    + + +
    + //
    + ) +} +export default Layout; \ No newline at end of file diff --git a/site/components/common/Navbar/Navbar.module.css b/site/components/common/Navbar/Navbar.module.css new file mode 100644 index 0000000..faa86d1 --- /dev/null +++ b/site/components/common/Navbar/Navbar.module.css @@ -0,0 +1,35 @@ +.root { + @apply sticky top-0 bg-primary z-40 transition-all duration-150; + min-height: 74px; +} + +.nav { + @apply relative flex flex-row justify-between py-4 md:py-4; +} + +.navMenu { + @apply hidden ml-6 space-x-4 lg:block; +} + +.link { + @apply inline-flex items-center leading-6 + transition ease-in-out duration-75 cursor-pointer + text-accent-5; +} + +.link:hover { + @apply text-accent-9; +} + +.link:focus { + @apply outline-none text-accent-8; +} + +.logo { + @apply cursor-pointer rounded-full border transform duration-100 ease-in-out; + + &:hover { + @apply shadow-md; + transform: scale(1.05); + } +} diff --git a/site/components/common/Navbar/Navbar.tsx b/site/components/common/Navbar/Navbar.tsx new file mode 100644 index 0000000..9286ef1 --- /dev/null +++ b/site/components/common/Navbar/Navbar.tsx @@ -0,0 +1,56 @@ +import { FC } from 'react' +import Link from 'next/link' +import s from './Navbar.module.css' +import NavbarRoot from './NavbarRoot' +import { Logo, Container } from '@components/ui' +import { Searchbar, UserNav } from '@components/common' + +interface Link { + href: string + label: string +} + +interface NavbarProps { + links?: Link[] +} + +const Navbar: FC = ({ links }) => ( + + +
    +
    + + + + + + +
    + {process.env.COMMERCE_SEARCH_ENABLED && ( +
    + +
    + )} +
    + +
    +
    + {process.env.COMMERCE_SEARCH_ENABLED && ( +
    + +
    + )} +
    +
    +) + +export default Navbar diff --git a/site/components/common/Navbar/NavbarRoot.tsx b/site/components/common/Navbar/NavbarRoot.tsx new file mode 100644 index 0000000..16556e8 --- /dev/null +++ b/site/components/common/Navbar/NavbarRoot.tsx @@ -0,0 +1,33 @@ +import { FC, useState, useEffect } from 'react' +import throttle from 'lodash.throttle' +import cn from 'clsx' +import s from './Navbar.module.css' + +const NavbarRoot: FC = ({ children }) => { + const [hasScrolled, setHasScrolled] = useState(false) + + useEffect(() => { + const handleScroll = throttle(() => { + const offset = 0 + const { scrollTop } = document.documentElement + const scrolled = scrollTop > offset + + if (hasScrolled !== scrolled) { + setHasScrolled(scrolled) + } + }, 200) + + document.addEventListener('scroll', handleScroll) + return () => { + document.removeEventListener('scroll', handleScroll) + } + }, [hasScrolled]) + + return ( +
    + {children} +
    + ) +} + +export default NavbarRoot diff --git a/site/components/common/Navbar/index.ts b/site/components/common/Navbar/index.ts new file mode 100644 index 0000000..e6400ae --- /dev/null +++ b/site/components/common/Navbar/index.ts @@ -0,0 +1 @@ +export { default } from './Navbar' diff --git a/site/components/common/SEO/SEO.tsx b/site/components/common/SEO/SEO.tsx new file mode 100644 index 0000000..b5e3ad2 --- /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 0000000..e20ec86 --- /dev/null +++ b/site/components/common/SEO/index.ts @@ -0,0 +1 @@ +export { default } from './SEO' diff --git a/site/components/common/Searchbar/Searchbar.module.css b/site/components/common/Searchbar/Searchbar.module.css new file mode 100644 index 0000000..7f20ed9 --- /dev/null +++ b/site/components/common/Searchbar/Searchbar.module.css @@ -0,0 +1,29 @@ +.root { + @apply relative text-sm bg-accent-0 text-base w-full transition-colors duration-150 border border-accent-2; +} + +.input { + @apply bg-transparent px-3 py-2 appearance-none w-full transition duration-150 ease-in-out pr-10; +} + +.input::placeholder { + @apply text-accent-3; +} + +.input:focus { + @apply outline-none shadow-outline-normal; +} + +.iconContainer { + @apply absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none; +} + +.icon { + @apply h-5 w-5; +} + +@screen sm { + .input { + min-width: 300px; + } +} diff --git a/site/components/common/Searchbar/Searchbar.tsx b/site/components/common/Searchbar/Searchbar.tsx new file mode 100644 index 0000000..0d9c8e8 --- /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/site/components/common/Searchbar/index.ts b/site/components/common/Searchbar/index.ts new file mode 100644 index 0000000..e6c0e36 --- /dev/null +++ b/site/components/common/Searchbar/index.ts @@ -0,0 +1 @@ +export { default } from './Searchbar' diff --git a/site/components/common/SidebarLayout/SidebarLayout.module.css b/site/components/common/SidebarLayout/SidebarLayout.module.css new file mode 100644 index 0000000..a8940dc --- /dev/null +++ b/site/components/common/SidebarLayout/SidebarLayout.module.css @@ -0,0 +1,20 @@ +.root { + @apply relative h-full flex flex-col; +} + +.header { + @apply sticky top-0 pl-4 py-4 pr-6 + flex items-center justify-between + bg-accent-0 box-border w-full z-10; + min-height: 66px; +} + +.container { + @apply flex flex-col flex-1 box-border; +} + +@screen lg { + .header { + min-height: 74px; + } +} diff --git a/site/components/common/SidebarLayout/SidebarLayout.tsx b/site/components/common/SidebarLayout/SidebarLayout.tsx new file mode 100644 index 0000000..b291e8a --- /dev/null +++ b/site/components/common/SidebarLayout/SidebarLayout.tsx @@ -0,0 +1,49 @@ +import React, { FC } from 'react' +import { Cross, ChevronLeft } from '@components/icons' +import { UserNav } from '@components/common' +import cn from 'clsx' +import s from './SidebarLayout.module.css' + +type ComponentProps = { className?: string } & ( + | { handleClose: () => any; handleBack?: never } + | { handleBack: () => any; handleClose?: never } +) + +const SidebarLayout: FC = ({ + children, + className, + handleBack, + handleClose, +}) => { + return ( +
    +
    + {handleClose && ( + + )} + {handleBack && ( + + )} + + +
    +
    {children}
    +
    + ) +} + +export default SidebarLayout diff --git a/site/components/common/SidebarLayout/index.ts b/site/components/common/SidebarLayout/index.ts new file mode 100644 index 0000000..45ded0c --- /dev/null +++ b/site/components/common/SidebarLayout/index.ts @@ -0,0 +1 @@ +export { default } from './SidebarLayout' diff --git a/site/components/common/UserNav/CustomerMenuContent/CustomerMenuContent.module.css b/site/components/common/UserNav/CustomerMenuContent/CustomerMenuContent.module.css new file mode 100644 index 0000000..93a183a --- /dev/null +++ b/site/components/common/UserNav/CustomerMenuContent/CustomerMenuContent.module.css @@ -0,0 +1,31 @@ +.root { + @apply inset-0 fixed; + left: 72px; + z-index: 10; + height: 100vh; + min-width: 100vw; + transition: none; +} + +@media screen(lg) { + .root { + @apply static; + min-width: inherit; + height: inherit; + } +} + +.link { + @apply text-primary flex cursor-pointer px-6 py-3 + transition ease-in-out duration-150 leading-6 + font-medium items-center capitalize w-full box-border + outline-0; +} + +.link:hover { + @apply bg-accent-1 outline-none; +} + +.link.active { + @apply font-bold bg-accent-2; +} diff --git a/site/components/common/UserNav/CustomerMenuContent/CustomerMenuContent.tsx b/site/components/common/UserNav/CustomerMenuContent/CustomerMenuContent.tsx new file mode 100644 index 0000000..992d171 --- /dev/null +++ b/site/components/common/UserNav/CustomerMenuContent/CustomerMenuContent.tsx @@ -0,0 +1,86 @@ +import cn from 'clsx' +import { useTheme } from 'next-themes' +import { useRouter } from 'next/router' +import { Moon, Sun } from '@components/icons' +import s from './CustomerMenuContent.module.css' +import useLogout from '@framework/auth/use-logout' +import { + DropdownContent, + DropdownMenuItem, +} from '@components/ui/Dropdown/Dropdown' + +const LINKS = [ + { + name: 'My Orders', + href: '/orders', + }, + { + name: 'My Profile', + href: '/profile', + }, + { + name: 'My Cart', + href: '/cart', + }, +] + +export default function CustomerMenuContent() { + const router = useRouter() + const logout = useLogout() + const { pathname } = useRouter() + const { theme, setTheme } = useTheme() + + function handleClick(_: React.MouseEvent, href: string) { + router.push(href) + } + + return ( + + {LINKS.map(({ name, href }) => ( + + handleClick(e, href)} + > + {name} + + + ))} + + { + setTheme(theme === 'dark' ? 'light' : 'dark') + }} + > +
    + Theme: {theme}{' '} +
    +
    + {theme == 'dark' ? ( + + ) : ( + + )} +
    +
    +
    + + logout()} + > + Logout + + +
    + ) +} diff --git a/site/components/common/UserNav/CustomerMenuContent/index.ts b/site/components/common/UserNav/CustomerMenuContent/index.ts new file mode 100644 index 0000000..b465e81 --- /dev/null +++ b/site/components/common/UserNav/CustomerMenuContent/index.ts @@ -0,0 +1 @@ +export { default } from './CustomerMenuContent' diff --git a/site/components/common/UserNav/MenuSidebarView/MenuSidebarView.module.css b/site/components/common/UserNav/MenuSidebarView/MenuSidebarView.module.css new file mode 100644 index 0000000..6c05b01 --- /dev/null +++ b/site/components/common/UserNav/MenuSidebarView/MenuSidebarView.module.css @@ -0,0 +1,7 @@ +.root { + @apply px-4 sm:px-6 sm:w-full flex-1 z-20; +} + +.item { + @apply text-xl font-bold py-2; +} diff --git a/site/components/common/UserNav/MenuSidebarView/MenuSidebarView.tsx b/site/components/common/UserNav/MenuSidebarView/MenuSidebarView.tsx new file mode 100644 index 0000000..a4ed5b5 --- /dev/null +++ b/site/components/common/UserNav/MenuSidebarView/MenuSidebarView.tsx @@ -0,0 +1,42 @@ +import Link from 'next/link' +import s from './MenuSidebarView.module.css' +import { useUI } from '@components/ui/context' +import SidebarLayout from '@components/common/SidebarLayout' +import type { Link as LinkProps } from './index' + +export default function MenuSidebarView({ + links = [], +}: { + links?: LinkProps[] +}) { + const { closeSidebar } = useUI() + + return ( + closeSidebar()}> +
    + +
    +
    + ) +} + +MenuSidebarView diff --git a/site/components/common/UserNav/MenuSidebarView/index.ts b/site/components/common/UserNav/MenuSidebarView/index.ts new file mode 100644 index 0000000..bdb5f8b --- /dev/null +++ b/site/components/common/UserNav/MenuSidebarView/index.ts @@ -0,0 +1,5 @@ +export { default } from './MenuSidebarView' +export interface Link { + href: string + label: string +} diff --git a/site/components/common/UserNav/UserNav.module.css b/site/components/common/UserNav/UserNav.module.css new file mode 100644 index 0000000..814cd05 --- /dev/null +++ b/site/components/common/UserNav/UserNav.module.css @@ -0,0 +1,59 @@ +.root { + @apply relative flex items-center; +} + +.list { + @apply flex flex-row items-center justify-items-end h-full; +} + +.item { + @apply ml-6 cursor-pointer relative transition ease-in-out + duration-100 flex items-center outline-none text-primary; +} + +.item:hover { + @apply text-accent-6 transition scale-110 duration-100; +} + +.item:first-child { + @apply ml-0; +} + +.item:focus, +.item:active { + @apply outline-none; +} + +.bagCount { + @apply border border-accent-1 bg-secondary text-secondary absolute rounded-full right-3 top-3 flex items-center justify-center font-bold text-xs; + padding-left: 2.5px; + padding-right: 2.5px; + min-width: 1.25rem; + min-height: 1.25rem; +} + +.avatarButton { + @apply inline-flex justify-center rounded-full; +} + +.mobileMenu { + @apply flex lg:hidden ml-6 text-white; +} + +.avatarButton:focus, +.mobileMenu:focus { + @apply outline-none; +} + +.dropdownDesktop { + @apply hidden -z-10; +} + +@media screen(lg) { + .dropdownDesktop { + @apply block; + } + .dropdownMobile { + @apply hidden; + } +} diff --git a/site/components/common/UserNav/UserNav.tsx b/site/components/common/UserNav/UserNav.tsx new file mode 100644 index 0000000..4368395 --- /dev/null +++ b/site/components/common/UserNav/UserNav.tsx @@ -0,0 +1,103 @@ +import cn from 'clsx' +import Link from 'next/link' +import s from './UserNav.module.css' +import { Avatar } from '@components/common' +import useCart from '@framework/cart/use-cart' +import { useUI } from '@components/ui/context' +import { Heart, Bag, Menu } from '@components/icons' +import CustomerMenuContent from './CustomerMenuContent' +import useCustomer from '@framework/customer/use-customer' +import React from 'react' +import { + Dropdown, + DropdownTrigger as DropdownTriggerInst, + Button, +} from '@components/ui' + +import type { LineItem } from '@commerce/types/cart' + +const countItem = (count: number, item: LineItem) => count + item.quantity + +const UserNav: React.FC<{ + className?: string +}> = ({ className }) => { + const { data } = useCart() + const { data: isCustomerLoggedIn } = useCustomer() + const { + toggleSidebar, + closeSidebarIfPresent, + openModal, + setSidebarView, + openSidebar, + } = useUI() + + const itemsCount = data?.lineItems.reduce(countItem, 0) ?? 0 + const DropdownTrigger = isCustomerLoggedIn + ? DropdownTriggerInst + : React.Fragment + + return ( + + ) +} + +export default UserNav diff --git a/site/components/common/UserNav/index.ts b/site/components/common/UserNav/index.ts new file mode 100644 index 0000000..0024bd0 --- /dev/null +++ b/site/components/common/UserNav/index.ts @@ -0,0 +1,3 @@ +export { default } from './UserNav' +export { default as MenuSidebarView } from './MenuSidebarView' +export { default as CustomerMenuContent } from './CustomerMenuContent' diff --git a/site/components/common/index.ts b/site/components/common/index.ts new file mode 100644 index 0000000..a2b3ae8 --- /dev/null +++ b/site/components/common/index.ts @@ -0,0 +1,9 @@ +export { default as Avatar } from './Avatar' +export { default as FeatureBar } from './FeatureBar' +export { default as Footer } from './Footer' +export { default as Navbar } from './Navbar' +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/site/components/countdowns.js b/site/components/countdowns.js new file mode 100644 index 0000000..c903e4d --- /dev/null +++ b/site/components/countdowns.js @@ -0,0 +1,34 @@ +export function countdown(secondsTime) { + const days = Math.floor(secondsTime / 86400); + const hours = Math.floor(secondsTime / 3600); + const minutes = Math.floor(secondsTime / 60); + const seconds = secondsTime; + + let h = 0; + let m = 0; + let s = 0; + + if (hours > 0) { + const tmp = days > 0 ? hours - 24 * days : hours; + if (tmp > 0) { + h = tmp; + } + } + if (minutes > 0) { + const tmp = hours > 0 ? minutes - 60 * hours : minutes; + if (tmp > 0) { + m = tmp; + } + } + return { + // days, + // hours: h, + // minutes: m, + // seconds: s, + seconds: secondsTime % 60, + minutes: parseInt(secondsTime / 60, 10) % 60, + hours: parseInt(secondsTime / (60 * 60), 10) % 24, + days: parseInt(secondsTime / (60 * 60 * 24), 10), + }; + } + \ No newline at end of file diff --git a/site/components/formEmail.js b/site/components/formEmail.js new file mode 100644 index 0000000..31e5c34 --- /dev/null +++ b/site/components/formEmail.js @@ -0,0 +1,118 @@ +import React from 'react'; +import { makeStyles } from "@material-ui/core/styles"; +import Button from '@mui/material/Button'; +import Grid from "@mui/material/Grid"; +import Container from "@mui/material/Container"; +import Typography from "@mui/material/Typography"; +// import images +import bgEmail from '../assets/bg-home1-newleter.png'; +import { Box, FormGroup, Input } from '@mui/material'; + + +const useStylesEmail = makeStyles({ + custormForm:{ + marginTop: "50px", + background: `url(${bgEmail.src})`, + backgroundPosition: "center !important", + backgroundRepeat: "no-repeat !important", + backgroundSize: "cover !important", + paddingTop: "80px", + paddingBottom: "52px", + '@media (max-width: 768px)': { + width: "100%", + textAlign:"center" + } + }, + form:{ + display: "flex", + position: "relative", + '@media (max-width: 768px)': { + display: 'inline-block', + } + }, + + text:{ + lineHeight: '35px', + fontSize: "30px", + fontWeight: 700, + fontFamily: 'Merriweather,sans-serif', + color: '#323232', + }, + + formInput:{ + width: "70%", + paddingLeft: "20px", + paddingRight: "20px", + border: "none", + borderRadius: 0, + height: "45px", + '&:focus':{ + outline: 'none' + }, + '@media (max-width: 768px)': { + width: "100%", + } + + }, + + formFields:{ + marginTop: "20px", + display:"block", + }, + formButton:{ + width: "20%", + float: "right", + borderRadius: "24px", + color: "#fff", + background: "#59ccfc", + border: "none", + height: "45px", + '&:hover':{ + background: '#38acdd', + }, + '@media (max-width: 768px)': { + width: "100%", + marginTop:"30px" + } + }, +}); + + + +export default function NameForm() { + const classes = useStylesEmail(); + return ( + + + + + + + + + Subscribe to our newsletter + + + + + + + + + + + + + + + + + ) + } + diff --git a/site/components/icons/ArrowLeft.tsx b/site/components/icons/ArrowLeft.tsx new file mode 100644 index 0000000..8cc1e12 --- /dev/null +++ b/site/components/icons/ArrowLeft.tsx @@ -0,0 +1,27 @@ +const ArrowLeft = ({ ...props }) => { + return ( + + + + + ) +} + +export default ArrowLeft diff --git a/site/components/icons/ArrowRight.tsx b/site/components/icons/ArrowRight.tsx new file mode 100644 index 0000000..e644951 --- /dev/null +++ b/site/components/icons/ArrowRight.tsx @@ -0,0 +1,28 @@ +const ArrowRight = ({ ...props }) => { + return ( + + + + + ) +} + +export default ArrowRight diff --git a/site/components/icons/Bag.tsx b/site/components/icons/Bag.tsx new file mode 100644 index 0000000..de2cde0 --- /dev/null +++ b/site/components/icons/Bag.tsx @@ -0,0 +1,33 @@ +const Bag = ({ ...props }) => { + return ( + + + + + + ) +} + +export default Bag diff --git a/site/components/icons/Check.tsx b/site/components/icons/Check.tsx new file mode 100644 index 0000000..89c91a1 --- /dev/null +++ b/site/components/icons/Check.tsx @@ -0,0 +1,21 @@ +const Check = ({ ...props }) => { + return ( + + + + ) +} + +export default Check diff --git a/site/components/icons/ChevronDown.tsx b/site/components/icons/ChevronDown.tsx new file mode 100644 index 0000000..542e805 --- /dev/null +++ b/site/components/icons/ChevronDown.tsx @@ -0,0 +1,20 @@ +const ChevronDown = ({ ...props }) => { + return ( + + + + ) +} + +export default ChevronDown diff --git a/site/components/icons/ChevronLeft.tsx b/site/components/icons/ChevronLeft.tsx new file mode 100644 index 0000000..4efb6a5 --- /dev/null +++ b/site/components/icons/ChevronLeft.tsx @@ -0,0 +1,20 @@ +const ChevronLeft = ({ ...props }) => { + return ( + + + + ) +} + +export default ChevronLeft diff --git a/site/components/icons/ChevronRight.tsx b/site/components/icons/ChevronRight.tsx new file mode 100644 index 0000000..8da0122 --- /dev/null +++ b/site/components/icons/ChevronRight.tsx @@ -0,0 +1,20 @@ +const ChevronRight = ({ ...props }) => { + return ( + + + + ) +} + +export default ChevronRight diff --git a/site/components/icons/ChevronUp.tsx b/site/components/icons/ChevronUp.tsx new file mode 100644 index 0000000..69b9959 --- /dev/null +++ b/site/components/icons/ChevronUp.tsx @@ -0,0 +1,20 @@ +const ChevronUp = ({ ...props }) => { + return ( + + + + ) +} + +export default ChevronUp diff --git a/site/components/icons/CreditCard.tsx b/site/components/icons/CreditCard.tsx new file mode 100644 index 0000000..958c311 --- /dev/null +++ b/site/components/icons/CreditCard.tsx @@ -0,0 +1,21 @@ +const CreditCard = ({ ...props }) => { + return ( + + + + + ) +} + +export default CreditCard diff --git a/site/components/icons/Cross.tsx b/site/components/icons/Cross.tsx new file mode 100644 index 0000000..12e115a --- /dev/null +++ b/site/components/icons/Cross.tsx @@ -0,0 +1,21 @@ +const Cross = ({ ...props }) => { + return ( + + + + + ) +} + +export default Cross diff --git a/site/components/icons/DoubleChevron.tsx b/site/components/icons/DoubleChevron.tsx new file mode 100644 index 0000000..198c304 --- /dev/null +++ b/site/components/icons/DoubleChevron.tsx @@ -0,0 +1,22 @@ +const DoubleChevron = ({ ...props }) => { + return ( + + + + ) +} + +export default DoubleChevron diff --git a/site/components/icons/Github.tsx b/site/components/icons/Github.tsx new file mode 100644 index 0000000..1195a3c --- /dev/null +++ b/site/components/icons/Github.tsx @@ -0,0 +1,20 @@ +const Github = ({ ...props }) => { + return ( + + + + ) +} + +export default Github diff --git a/site/components/icons/Heart.tsx b/site/components/icons/Heart.tsx new file mode 100644 index 0000000..afa2f6a --- /dev/null +++ b/site/components/icons/Heart.tsx @@ -0,0 +1,22 @@ +const Heart = ({ ...props }) => { + return ( + + + + ) +} + +export default Heart diff --git a/site/components/icons/Info.tsx b/site/components/icons/Info.tsx new file mode 100644 index 0000000..67c79cf --- /dev/null +++ b/site/components/icons/Info.tsx @@ -0,0 +1,22 @@ +const Info = ({ ...props }) => { + return ( + + + + + + ) +} + +export default Info diff --git a/site/components/icons/MapPin.tsx b/site/components/icons/MapPin.tsx new file mode 100644 index 0000000..6323b9c --- /dev/null +++ b/site/components/icons/MapPin.tsx @@ -0,0 +1,20 @@ +const MapPin = ({ ...props }) => { + return ( + + + + + ) +} + +export default MapPin diff --git a/site/components/icons/Menu.tsx b/site/components/icons/Menu.tsx new file mode 100644 index 0000000..3f280e3 --- /dev/null +++ b/site/components/icons/Menu.tsx @@ -0,0 +1,21 @@ +const Menu = ({ ...props }) => { + return ( + + + + ) +} + +export default Menu diff --git a/site/components/icons/Minus.tsx b/site/components/icons/Minus.tsx new file mode 100644 index 0000000..1e9411d --- /dev/null +++ b/site/components/icons/Minus.tsx @@ -0,0 +1,15 @@ +const Minus = ({ ...props }) => { + return ( + + + + ) +} + +export default Minus diff --git a/site/components/icons/Moon.tsx b/site/components/icons/Moon.tsx new file mode 100644 index 0000000..e02f2a3 --- /dev/null +++ b/site/components/icons/Moon.tsx @@ -0,0 +1,20 @@ +const Moon = ({ ...props }) => { + return ( + + + + ) +} + +export default Moon diff --git a/site/components/icons/Plus.tsx b/site/components/icons/Plus.tsx new file mode 100644 index 0000000..ad030b9 --- /dev/null +++ b/site/components/icons/Plus.tsx @@ -0,0 +1,22 @@ +const Plus = ({ ...props }) => { + return ( + + + + + ) +} + +export default Plus diff --git a/site/components/icons/Star.tsx b/site/components/icons/Star.tsx new file mode 100644 index 0000000..d98f55e --- /dev/null +++ b/site/components/icons/Star.tsx @@ -0,0 +1,16 @@ +const Star = ({ ...props }) => { + return ( + + + + ) +} + +export default Star diff --git a/site/components/icons/Sun.tsx b/site/components/icons/Sun.tsx new file mode 100644 index 0000000..d3684bc --- /dev/null +++ b/site/components/icons/Sun.tsx @@ -0,0 +1,28 @@ +const Sun = ({ ...props }) => { + return ( + + + + + + + + + + + + ) +} + +export default Sun diff --git a/site/components/icons/Trash.tsx b/site/components/icons/Trash.tsx new file mode 100644 index 0000000..b005ea8 --- /dev/null +++ b/site/components/icons/Trash.tsx @@ -0,0 +1,43 @@ +const Trash = ({ ...props }) => { + return ( + + + + + + + ) +} + +export default Trash diff --git a/site/components/icons/Vercel.tsx b/site/components/icons/Vercel.tsx new file mode 100644 index 0000000..96e619f --- /dev/null +++ b/site/components/icons/Vercel.tsx @@ -0,0 +1,40 @@ +const Vercel = ({ ...props }) => { + return ( + + + + + + + + + + ) +} + +export default Vercel diff --git a/site/components/icons/index.ts b/site/components/icons/index.ts new file mode 100644 index 0000000..12e0cc2 --- /dev/null +++ b/site/components/icons/index.ts @@ -0,0 +1,23 @@ +export { default as Bag } from './Bag' +export { default as Sun } from './Sun' +export { default as Moon } from './Moon' +export { default as Menu } from './Menu' +export { default as Info } from './Info' +export { default as Star } from './Star' +export { default as Plus } from './Plus' +export { default as Heart } from './Heart' +export { default as Trash } from './Trash' +export { default as Cross } from './Cross' +export { default as Minus } from './Minus' +export { default as Check } from './Check' +export { default as Github } from './Github' +export { default as Vercel } from './Vercel' +export { default as MapPin } from './MapPin' +export { default as ArrowLeft } from './ArrowLeft' +export { default as ArrowRight } from './ArrowRight' +export { default as CreditCard } from './CreditCard' +export { default as ChevronUp } from './ChevronUp' +export { default as ChevronLeft } from './ChevronLeft' +export { default as ChevronDown } from './ChevronDown' +export { default as ChevronRight } from './ChevronRight' +export { default as DoubleChevron } from './DoubleChevron' diff --git a/site/components/imglist.js b/site/components/imglist.js new file mode 100644 index 0000000..63754df --- /dev/null +++ b/site/components/imglist.js @@ -0,0 +1,191 @@ +import * as React from "react"; +import { makeStyles } from "@material-ui/core/styles"; +import ImageList from "@mui/material/ImageList"; +import ImageListItem from "@mui/material/ImageListItem"; +import Box from "@mui/material/Box"; +import ImageListItemBar from '@mui/material/ImageListItemBar'; +import Image1 from '../assets/seller_1.png'; +import Image2 from '../assets/seller_2.png'; +import Image3 from '../assets/seller_3.png'; +import Image4 from '../assets/seller_4.png'; +import Image5 from '../assets/seller_5.png'; +import Image6 from '../assets/seller_6.png'; +import Image7 from '../assets/seller_7.png'; +import Image8 from '../assets/seller_8.png'; +import Image9 from '../assets/seller_9.png'; +import { Grid } from "@mui/material"; +import { display } from "@mui/system"; +import Link from "next/link"; + +const useStyles = makeStyles({ + wrapperImage:{ + display:"flex", + alignItems:"center", + marginTop:'50px', + + '@media (max-width: 768px)': { + display:"block", + alignItems:"inherit" + + } + }, + rowImage:{ + display:"flex", + marginBottom:"20px", + '@media (max-width: 600px)': { + display:"block", + marginBottom:"30px" + + + } + }, + box_1Image:{ + boxSizing: "border-box", + paddingRight: "15px", + '@media (max-width: 768px)': { + paddingRight: "0px", + marginBottom:"30px" + } + }, + box_Image:{ + marginBottom:"30px" + }, + box_2Image:{ + display:"flex", + paddingRight: "15px", + paddingLeft: "15px", + '@media (max-width: 768px)': { + paddingRight: "0px", + marginBottom:"30px", + paddingLeft: "0px", + + }, + '@media (max-width: 600px)': { + paddingLeft: "0px", + display:"block", +} + + }, + box_2Image1:{ + paddingRight:"15px", + marginBottom:"30px", + '@media (max-width: 768px)': { + paddingRight: "0px", + marginBottom:"30px" + }, + }, + box_2Image2:{ + paddingRight:"30px", + '@media (max-width: 600px)': { + paddingRight: "0px", + marginBottom:"30px" + + + }, + }, + box_3Image:{ + paddingRight: "15px", + paddingLeft: "15px", + '@media (max-width: 768px)': { + width:"100%", + paddingLeft: "0px", + marginBottom:"30px" + }, + '@media (max-width: 600px)': { + paddingRight: "0px", +} + + }, + box_4Image:{ + paddingLeft: "15px", + '@media (max-width: 768px)': { + width:"100%" + }, + '@media (max-width: 600px)': { + paddingLeft: "0px", + } + }, + Image:{ + width:"100%", + transition: "all .5s", + '@media (max-width: 768px)': { + width:"100%", + } + } +}) + +export default function NewImageList() { + const classes = useStyles(); + return ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} + diff --git a/site/components/menu.js b/site/components/menu.js new file mode 100644 index 0000000..80b20b8 --- /dev/null +++ b/site/components/menu.js @@ -0,0 +1,243 @@ +import * as React from "react"; +import ClickAwayListener from "@mui/material/ClickAwayListener"; +import Grow from "@mui/material/Grow"; +import Paper from "@mui/material/Paper"; +import Popper from "@mui/material/Popper"; +import MenuItem from "@mui/material/MenuItem"; +import MenuList from "@mui/material/MenuList"; +import MenuIcon from "@mui/icons-material/Menu"; + +import ListItemIcon from "@mui/material/ListItemIcon"; +import Box from '@mui/material/Box'; + +// icon import +import HomeIcon from '@mui/icons-material/Home'; +import PushPinIcon from '@mui/icons-material/PushPin'; +import PhoneIphoneSharpIcon from '@mui/icons-material/PhoneIphoneSharp'; +import LanguageSharpIcon from '@mui/icons-material/LanguageSharp'; +import TheatersIcon from '@mui/icons-material/Theaters'; +import SportsBaseballIcon from '@mui/icons-material/SportsBaseball'; +import DiamondIcon from '@mui/icons-material/Diamond'; +import FitnessCenterIcon from '@mui/icons-material/FitnessCenter'; +import FastfoodIcon from '@mui/icons-material/Fastfood'; +import ChairIcon from '@mui/icons-material/Chair'; +import BookIcon from '@mui/icons-material/Book'; +import ListIcon from '@mui/icons-material/List'; + +// makestyle +import { makeStyles } from "@material-ui/core/styles"; + +const colorHover = '#40c6ff'; +const useStyle_category_header = makeStyles({ + + buttonCategory: { + color: '#444', + fontSize: '14px', + fontWeight: 'bold', + textTransform: 'uppercase', + display: 'flex', + justifyContent: 'left', + alignItems: 'center', + height: '43px', + paddingRight: '15px', + border: '0px', + background: '#fff', + borderTopLeftRadius: '2px', + borderTopRightRadius: '2px', + minWidth: '270px', + marginTop: 13, + '@media (max-width: 899px) ': { + marginTop: '0px', + }, + '&.active': { + cursor: 'pointer', + background: `${colorHover}`, + color: '#fff', + '& svg': { + marginLeft: '10px', + transition: 'all 0.25s', + color: '#fff', + } + }, + '& svg': { + marginLeft: '-5px', + fontSize: '30px', + color: '#444', + transition: 'all 0.25s', + }, + '&:aria-expanded="true"': { + cursor: 'pointer', + background: `${colorHover}`, + color: '#fff', + '& svg': { + marginLeft: '10px', + transition: 'all 0.25s', + color: '#fff', + } + }, + '&:hover': { + cursor: 'pointer', + background: `${colorHover}`, + color: '#fff', + '& svg': { + marginLeft: '10px', + transition: 'all 0.25s', + color: '#fff', + } + } + }, + listCategoryHome: { + minWidth: '270px', + zIndex: '100', + '& li': { + fontSize: '14px', + textTransform: 'capitalize', + lineHeight: ' 45px', + height: '45px', + '& a': { + color: '#444', + }, + '& svg': { + fontSize: '14px', + }, + '&:hover': { + backgroundColor: 'rgba(64,198,255,0.4)', + '& svg': { + color: '#fff', + } + } + } + }, + Category: { + zIndex: 10 + } +}); + +export default function MenuListComposition() { + + const classes = useStyle_category_header() + + const [open, setOpen] = React.useState(false); + const anchorRef = React.useRef(null); + + const handleToggle = () => { + setOpen((prevOpen) => !prevOpen); + }; + + const handleClose = (event) => { + if (anchorRef.current && anchorRef.current.contains(event.target)) { + return; + } + + setOpen(false); + }; + + function handleListKeyDown(event) { + if (event.key === "Tab") { + event.preventDefault(); + setOpen(false); + } else if (event.key === "Escape") { + setOpen(false); + } + } + + // return focus to the button when we transitioned from !open -> open + const prevOpen = React.useRef(open); + React.useEffect(() => { + if (prevOpen.current === true && open === false) { + anchorRef.current.focus(); + } + + prevOpen.current = open; + }, [open]); + + return ( + + + + + {({ TransitionProps, placement }) => ( + + + + + + {" "} + + + + Homepage + + + {" "} + + + + Custom Prints + + + {" "} + + + + Free file check + + + {" "} + + + + Graphic Design + + + {" "} + + + + Mailing + + + + + + + )} + + + + ); +} diff --git a/site/components/menuPhu.js b/site/components/menuPhu.js new file mode 100644 index 0000000..ddaaf72 --- /dev/null +++ b/site/components/menuPhu.js @@ -0,0 +1,159 @@ +import * as React from 'react'; +import Link from 'next/link'; +import { useState } from 'react'; + + + + +// makestyle +import { makeStyles } from "@material-ui/core/styles"; +const colorHover = '#40c6ff'; +const colorDefaul = '#666'; + + +const useStyle_menuMain = makeStyles({ + navmenu: { + padding: '0px', + margin: '0px', + display: 'flex', + justifyContent: 'left', + alignItems: 'center', + minHeight: '64px', + '& li': { + float: 'left', + listStyle: 'none', + display: 'inline-block', + '& a': { + color: `${colorDefaul}`, + padding: ' 0px 22px', + fontSize: '16px', + fontFamily: 'Mulish,sans-serif', + textTransform: 'uppercase', + '&:hover': { + color: `${colorHover}`, + } + }, + '&:first-child': { + '& a': { + paddingLeft: '0px', + } + }, + } + }, + hamburger: { + display: 'none', + }, + bar: { + display: 'block', + width: '24px', + height: '3px', + margin: '5px auto', + transition: 'all 0.3s ease-in-out', + backgroundColor: '#222222', + }, + '@media (max-width: 899px) ': { + navbar: { + position: 'relative', + }, + navmenu: { + display: 'block', + position: 'absolute', + right: '0px', + top: '100px', + flexDirection: 'column', + backgroundColor: '#fff', + width: ' 100%', + textAlign: 'left', + maxWidth: '270px', + minWidth: '270px', + transition: '0.3s', + boxShadow: ' 0 10px 27px rgba(0, 0, 0, 0.05)', + opacity: '0', + padding: ' 0px 10px', + '&.active': { + top: '44px', + opacity: '1', + zIndex: '100', + }, + '& li': { + float: 'none', + display: 'block', + height: '40px', + lineHeight: '40px', + '& a': { + padding: '0px', + fontSize: '14px', + } + } + }, + hamburger: { + position: 'absolute', + display: 'block', + cursor: 'pointer', + right: '0px', + top: '10px', + padding: '0px', + backgroundColor: '#fff', + border: 'none', + '&.active': { + outline: 'none', + '& span:nth-child(1)': { + transform: 'translateY(8px) rotate(45deg)', + }, + '& span:nth-child(2)': { + opacity: '0', + }, + '& span:nth-child(3)': { + transform: 'translateY(-8px) rotate(-45deg)', + } + } + } + } +}); + +const ResponsiveAppBar = () => { + const classes = useStyle_menuMain() + const [isOpen, setIsOpen] = useState(false); + const openMenu = () => setIsOpen(!isOpen); + return ( + <> + + + ) +}; +export default ResponsiveAppBar; diff --git a/site/components/newlistimg.js b/site/components/newlistimg.js new file mode 100644 index 0000000..0caa951 --- /dev/null +++ b/site/components/newlistimg.js @@ -0,0 +1,161 @@ +import * as React from "react"; +import { makeStyles } from "@material-ui/core/styles"; +import ImageList from "@mui/material/ImageList"; +import ImageListItem from "@mui/material/ImageListItem"; +import Box from "@mui/material/Box"; +import ImageListItemBar from '@mui/material/ImageListItemBar'; +import Image1 from '../assets/image_1.png'; +import Image2 from '../assets/image_2.png'; +import Image3 from '../assets/image_3.png'; +import Image4 from '../assets/image_4.png'; +import Image5 from '../assets/image_5.png'; +import Image6 from '../assets/image_6.png'; +import Image7 from '../assets/image_7.png'; +import { Grid } from "@mui/material"; +import { display } from "@mui/system"; +import Link from "next/link"; + + +const useStyles = makeStyles({ + wrapperImage:{ + display:"flex", + marginTop:"50px", + + '@media (max-width: 768px)': { + display:"block", + + } + + }, + rowImage:{ + display:"flex", + marginBottom:"20px", + '@media (max-width: 600px)': { + display:"block", + marginBottom:"30px" + + + } + }, + box_1Image:{ + boxSizing: "border-box", + paddingRight: "15px", + '@media (max-width: 768px)': { + paddingRight: "0px", + marginBottom:"30px" + } + }, + box_Image:{ + marginBottom:"30px" + }, + box_2Image:{ + paddingRight: "15px", + paddingLeft: "15px", + '@media (max-width: 768px)': { + paddingRight: "0px", + marginBottom:"30px" + + }, + '@media (max-width: 600px)': { + paddingLeft: "0px", +} + + }, + box_3Image:{ + paddingRight: "15px", + paddingLeft: "15px", + '@media (max-width: 768px)': { + width:"100%", + paddingLeft: "0px", + marginBottom:"30px" + }, + '@media (max-width: 600px)': { + paddingRight: "0px", +} + + }, + box_4Image:{ + paddingLeft: "15px", + '@media (max-width: 768px)': { + width:"100%" + }, + '@media (max-width: 600px)': { + paddingLeft: "0px", + } + }, + Image:{ + width:"100%", + transition: "all .5s", + '@media (max-width: 768px)': { + width:"100%", + } + } +}) + +export default function NewImageList() { + const classes = useStyles(); + return ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} + diff --git a/site/components/product.js b/site/components/product.js new file mode 100644 index 0000000..fb5133d --- /dev/null +++ b/site/components/product.js @@ -0,0 +1,112 @@ +import React, { Component, useState } from 'react'; +import Grid from "@mui/material/Grid"; +import Container from "@mui/material/Container"; +import Paper from "@mui/material/Paper"; +import Link from 'next/link'; +import Rating from '@mui/material/Rating'; +import { makeStyles } from "@material-ui/core/styles"; +import { Box } from '@mui/system'; + +const colorHeading = '#323232'; +const colorHover = '#40c6ff'; +const colorDefaul = '#666'; +const useStyles = makeStyles(theme => ({ + itemProduct: { + marginBottom: 20, + }, + cardButton: { + paddingBottom: 15, + }, + productImg: { + width: '100%', + height: 'auto', + display: 'inline-block', + textAlign: 'center', + }, + cardBody: { + textAlign: 'center', + '& h3': { + fontSize: '19px', + fontWeight: 'bold', + color: '#444', + marginTop: '12px', + marginBottom: '10px', + fontFamily: 'Mulish,sans-serif', + }, + '& h4': { + marginTop: '6px', + marginBottom: '0px', + }, + }, + cardTitle: { + '&:hover': { + color: `${colorHover}`, + } + }, + startRating: { + '& span': { + color: '#ffcc35', + fontSize: '18px', + } + }, + cardPrice: { + color: `${colorHover}`, + fontSize: '22px', + fontWeight: '500', + fontFamily: 'Mulish,sans-serif', + }, + regular_price: { + textDecoration: 'line-through', + marginRight: '15px', + color: '#999', + fontWeight: '400', + }, + box_product: { + border: '1px solid #efefef', + padding: '15px 15px 22px 15px', + transition: '0.35s', + '&:hover': { + boxShadow: '0 10px 6px -6px #ccc', + } + } +}) +) + +export default function Product(props) { + const classes = useStyles(); + const { product } = props; + //console.warn(product); + let imageURl = ''; + return ( + <> + + + + + + + + + + +

    + + + {product?.name} + + +

    + + + +

    + ${product.price.value} +

    + + +
    +
    +
    + + ); +} diff --git a/site/components/product/ProductCard/ProductCard.module.css b/site/components/product/ProductCard/ProductCard.module.css new file mode 100644 index 0000000..d5d441f --- /dev/null +++ b/site/components/product/ProductCard/ProductCard.module.css @@ -0,0 +1,114 @@ +.root { + @apply relative max-h-full w-full box-border overflow-hidden + bg-no-repeat bg-center bg-cover transition-transform + ease-linear cursor-pointer inline-block bg-accent-1; + height: 100% !important; +} + +.root:hover { + & .productImage { + transform: scale(1.2625); + } + + & .header .name span, + & .header .price, + & .wishlistButton { + @apply bg-secondary text-secondary; + } + + &:nth-child(6n + 1) .header .name span, + &:nth-child(6n + 1) .header .price, + &:nth-child(6n + 1) .wishlistButton { + @apply bg-violet text-white; + } + + &:nth-child(6n + 5) .header .name span, + &:nth-child(6n + 5) .header .price, + &:nth-child(6n + 5) .wishlistButton { + @apply bg-blue text-white; + } + + &:nth-child(6n + 3) .header .name span, + &:nth-child(6n + 3) .header .price, + &:nth-child(6n + 3) .wishlistButton { + @apply bg-pink text-white; + } + + &:nth-child(6n + 6) .header .name span, + &:nth-child(6n + 6) .header .price, + &:nth-child(6n + 6) .wishlistButton { + @apply bg-cyan text-white; + } +} + +.header { + @apply transition-colors ease-in-out duration-500 + absolute top-0 left-0 z-20 pr-16; +} + +.header .name { + @apply pt-0 max-w-full w-full leading-extra-loose + transition-colors ease-in-out duration-500; + font-size: 2rem; + letter-spacing: 0.4px; +} + +.header .name span { + @apply py-4 px-6 bg-primary text-primary font-bold + transition-colors ease-in-out duration-500; + font-size: inherit; + letter-spacing: inherit; + box-decoration-break: clone; + -webkit-box-decoration-break: clone; +} + +.header .price { + @apply pt-2 px-6 pb-4 text-sm bg-primary text-accent-9 + font-semibold inline-block tracking-wide + transition-colors ease-in-out duration-500; +} + +.imageContainer { + @apply flex items-center justify-center overflow-hidden; +} + +.imageContainer > div { + min-width: 100%; +} + +.imageContainer .productImage { + @apply transform transition-transform duration-500 + object-cover scale-120; +} + +.root .wishlistButton { + @apply top-0 right-0 z-30 absolute; +} + +/* Variant Simple */ +.simple .header .name { + @apply pt-2 text-lg leading-10 -mt-1; +} + +.simple .header .price { + @apply text-sm; +} + +/* Variant Slim */ +.slim { + @apply bg-transparent relative overflow-hidden + box-border; +} + +.slim .header { + @apply absolute inset-0 flex items-center justify-end mr-8 z-20; +} + +.slim span { + @apply bg-accent-9 text-accent-0 inline-block p-3 + font-bold text-xl break-words; +} + +.root:global(.secondary) .header span { + @apply bg-accent-0 text-accent-9; +} diff --git a/site/components/product/ProductCard/ProductCard.tsx b/site/components/product/ProductCard/ProductCard.tsx new file mode 100644 index 0000000..c70461f --- /dev/null +++ b/site/components/product/ProductCard/ProductCard.tsx @@ -0,0 +1,138 @@ +import { FC } from 'react' +import cn from 'clsx' +import Link from 'next/link' +import type { Product } from '@commerce/types/product' +import s from './ProductCard.module.css' +import Image, { ImageProps } from 'next/image' +import WishlistButton from '@components/wishlist/WishlistButton' +import usePrice from '@framework/product/use-price' +import ProductTag from '../ProductTag' + +interface Props { + className?: string + product: Product + noNameTag?: boolean + imgProps?: Omit + variant?: 'default' | 'slim' | 'simple' +} + +const placeholderImg = '/product-img-placeholder.svg' + +const ProductCard: FC = ({ + product, + imgProps, + className, + noNameTag = false, + variant = 'default', +}) => { + const { price } = usePrice({ + amount: product.price.value, + baseAmount: product.price.retailPrice, + currencyCode: product.price.currencyCode!, + }) + + const rootClassName = cn( + s.root, + { [s.slim]: variant === 'slim', [s.simple]: variant === 'simple' }, + className + ) + + return ( + + + {variant === 'slim' && ( + <> +
    + {product.name} +
    + {product?.images && ( +
    + {product.name +
    + )} + + )} + + {variant === 'simple' && ( + <> + {process.env.COMMERCE_WISHLIST_ENABLED && ( + + )} + {!noNameTag && ( +
    +

    + {product.name} +

    +
    + {`${price} ${product.price?.currencyCode}`} +
    +
    + )} +
    + {product?.images && ( +
    + {product.name +
    + )} +
    + + )} + + {variant === 'default' && ( + <> + {process.env.COMMERCE_WISHLIST_ENABLED && ( + + )} + +
    + {product?.images && ( +
    + {product.name +
    + )} +
    + + )} +
    + + ) +} + +export default ProductCard diff --git a/site/components/product/ProductCard/index.ts b/site/components/product/ProductCard/index.ts new file mode 100644 index 0000000..4559faa --- /dev/null +++ b/site/components/product/ProductCard/index.ts @@ -0,0 +1 @@ +export { default } from './ProductCard' diff --git a/site/components/product/ProductOptions/ProductOptions.tsx b/site/components/product/ProductOptions/ProductOptions.tsx new file mode 100644 index 0000000..5ce658f --- /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/site/components/product/ProductOptions/index.ts b/site/components/product/ProductOptions/index.ts new file mode 100644 index 0000000..252415a --- /dev/null +++ b/site/components/product/ProductOptions/index.ts @@ -0,0 +1 @@ +export { default } from './ProductOptions' diff --git a/site/components/product/ProductSidebar/ProductSidebar.module.css b/site/components/product/ProductSidebar/ProductSidebar.module.css new file mode 100644 index 0000000..b6ecc2b --- /dev/null +++ b/site/components/product/ProductSidebar/ProductSidebar.module.css @@ -0,0 +1,84 @@ +.root { + @apply relative grid items-start gap-1 grid-cols-1 overflow-x-hidden; + min-height: auto; +} + +.main { + @apply relative px-0 pb-0 box-border flex flex-col col-span-1; + min-height: 500px; +} + +.header { + @apply transition-colors ease-in-out duration-500 + absolute top-0 left-0 z-20 pr-16; +} + +.header .name { + @apply pt-0 max-w-full w-full leading-extra-loose; + font-size: 2rem; + letter-spacing: 0.4px; +} + +.header .name span { + @apply py-4 px-6 bg-primary text-primary font-bold; + font-size: inherit; + letter-spacing: inherit; + box-decoration-break: clone; + -webkit-box-decoration-break: clone; +} + +.header .price { + @apply pt-2 px-6 pb-4 text-sm bg-primary text-accent-9 + font-semibold inline-block tracking-wide; +} + +.sidebar { + @apply flex flex-col col-span-1 mx-auto max-w-8xl px-6 py-6 w-full h-full; +} + +.sliderContainer { + @apply flex items-center justify-center overflow-x-hidden bg-violet; +} + +.imageContainer { + @apply text-center; +} + +.imageContainer > div, +.imageContainer > div > div { + @apply h-full; +} + +.sliderContainer .img { + @apply w-full h-auto max-h-full object-cover; +} + +.button { + width: 100%; +} + +.wishlistButton { + @apply absolute z-30 top-0 right-0; +} + +.relatedProductsGrid { + @apply grid grid-cols-2 py-2 gap-2 md:grid-cols-4 md:gap-7; +} + +@screen lg { + .root { + @apply grid-cols-12; + } + + .main { + @apply mx-0 col-span-8; + } + + .sidebar { + @apply col-span-4 py-6; + } + + .imageContainer { + max-height: 600px; + } +} diff --git a/site/components/product/ProductSidebar/ProductSidebar.tsx b/site/components/product/ProductSidebar/ProductSidebar.tsx new file mode 100644 index 0000000..4ac3cb5 --- /dev/null +++ b/site/components/product/ProductSidebar/ProductSidebar.tsx @@ -0,0 +1,89 @@ +import s from './ProductSidebar.module.css' +import { useAddItem } from '@framework/cart' +import { FC, useEffect, useState } from 'react' +import { ProductOptions } from '@components/product__' +import type { Product } from '@commerce/types/product' +import { Button, Text, Rating, Collapse, useUI } from '@components/ui' +import { + getProductVariant, + selectDefaultOptionFromProduct, + SelectedOptions, +} from '../helpers' + +interface ProductSidebarProps { + product: Product + className?: string +} + +const ProductSidebar: FC = ({ product, className }) => { + const addItem = useAddItem() + const { openSidebar } = useUI() + const [loading, setLoading] = useState(false) + const [selectedOptions, setSelectedOptions] = useState({}) + + useEffect(() => { + selectDefaultOptionFromProduct(product, setSelectedOptions) + }, [product]) + + const variant = getProductVariant(product, selectedOptions) + const addToCart = async () => { + setLoading(true) + try { + await addItem({ + productId: String(product.id), + variantId: String(variant ? variant.id : product.variants[0]?.id), + }) + openSidebar() + setLoading(false) + } catch (err) { + setLoading(false) + } + } + + return ( +
    + + +
    + +
    36 reviews
    +
    +
    + {process.env.COMMERCE_CART_ENABLED && ( + + )} +
    +
    + + This is a limited edition production run. Printing starts when the + drop ends. + + + This is a limited edition production run. Printing starts when the + drop ends. Reminder: Bad Boys For Life. Shipping may take 10+ days due + to COVID-19. + +
    +
    + ) +} + +export default ProductSidebar diff --git a/site/components/product/ProductSidebar/index.ts b/site/components/product/ProductSidebar/index.ts new file mode 100644 index 0000000..7e00359 --- /dev/null +++ b/site/components/product/ProductSidebar/index.ts @@ -0,0 +1 @@ +export { default } from './ProductSidebar' diff --git a/site/components/product/ProductSlider/ProductSlider.module.css b/site/components/product/ProductSlider/ProductSlider.module.css new file mode 100644 index 0000000..b95bffd --- /dev/null +++ b/site/components/product/ProductSlider/ProductSlider.module.css @@ -0,0 +1,57 @@ +.root { + @apply relative w-full h-full select-none; + overflow: hidden; +} + +.slider { + @apply relative h-full transition-opacity duration-150; + opacity: 0; +} + +.slider.show { + opacity: 1; +} + +.thumb { + @apply overflow-hidden inline-block cursor-pointer h-full; + width: 125px; + width: calc(100% / 3); +} + +.thumb.selected { + @apply bg-white; +} + +.thumb img { + height: 85% !important; +} + +.album { + width: 100%; + height: 100%; + @apply bg-violet-dark; + box-sizing: content-box; + overflow-y: hidden; + overflow-x: auto; + white-space: nowrap; + height: 125px; + scrollbar-width: none; +} + +/* Hide scrollbar for Chrome, Safari and Opera */ +.album::-webkit-scrollbar { + display: none; +} + +@screen md { + .thumb:hover { + transform: scale(1.02); + } + + .album { + height: 182px; + } + .thumb { + width: 235px; + } +} diff --git a/site/components/product/ProductSlider/ProductSlider.tsx b/site/components/product/ProductSlider/ProductSlider.tsx new file mode 100644 index 0000000..009d058 --- /dev/null +++ b/site/components/product/ProductSlider/ProductSlider.tsx @@ -0,0 +1,129 @@ +import { useKeenSlider } from 'keen-slider/react' +import React, { + Children, + isValidElement, + useState, + useRef, + useEffect, +} from 'react' +import cn from 'clsx' +import { a } from '@react-spring/web' +import s from './ProductSlider.module.css' +import ProductSliderControl from '../ProductSliderControl' + +interface ProductSliderProps { + children: React.ReactNode[] + className?: string +} + +const ProductSlider: React.FC = ({ + children, + className = '', +}) => { + const [currentSlide, setCurrentSlide] = useState(0) + const [isMounted, setIsMounted] = useState(false) + const sliderContainerRef = useRef(null) + const thumbsContainerRef = useRef(null) + + const [ref, slider] = useKeenSlider({ + loop: true, + slides: { perView: 1 }, + created: () => setIsMounted(true), + slideChanged(s) { + const slideNumber = s.track.details.rel + setCurrentSlide(slideNumber) + + if (thumbsContainerRef.current) { + const $el = document.getElementById(`thumb-${slideNumber}`) + if (slideNumber >= 3) { + thumbsContainerRef.current.scrollLeft = $el!.offsetLeft + } else { + thumbsContainerRef.current.scrollLeft = 0 + } + } + }, + }) + + // Stop the history navigation gesture on touch devices + useEffect(() => { + const preventNavigation = (event: TouchEvent) => { + // Center point of the touch area + const touchXPosition = event.touches[0].pageX + // Size of the touch area + const touchXRadius = event.touches[0].radiusX || 0 + + // We set a threshold (10px) on both sizes of the screen, + // if the touch area overlaps with the screen edges + // it's likely to trigger the navigation. We prevent the + // touchstart event in that case. + if ( + touchXPosition - touchXRadius < 10 || + touchXPosition + touchXRadius > window.innerWidth - 10 + ) + event.preventDefault() + } + + const slider = sliderContainerRef.current! + + slider.addEventListener('touchstart', preventNavigation) + + return () => { + if (slider) { + slider.removeEventListener('touchstart', preventNavigation) + } + } + }, []) + + const onPrev = React.useCallback(() => slider.current?.prev(), [slider]) + const onNext = React.useCallback(() => slider.current?.next(), [slider]) + + return ( +
    +
    + {slider && } + {Children.map(children, (child) => { + // Add the keen-slider__slide className to children + if (isValidElement(child)) { + return { + ...child, + props: { + ...child.props, + className: `${ + child.props.className ? `${child.props.className} ` : '' + }keen-slider__slide`, + }, + } + } + return child + })} +
    + + + {slider && + Children.map(children, (child, idx) => { + if (isValidElement(child)) { + return { + ...child, + props: { + ...child.props, + className: cn(child.props.className, s.thumb, { + [s.selected]: currentSlide === idx, + }), + id: `thumb-${idx}`, + onClick: () => { + slider.current?.moveToIdx(idx) + }, + }, + } + } + return child + })} + +
    + ) +} + +export default ProductSlider diff --git a/site/components/product/ProductSlider/index.ts b/site/components/product/ProductSlider/index.ts new file mode 100644 index 0000000..5044404 --- /dev/null +++ b/site/components/product/ProductSlider/index.ts @@ -0,0 +1 @@ +export { default } from './ProductSlider' diff --git a/site/components/product/ProductSliderControl/ProductSliderControl.module.css b/site/components/product/ProductSliderControl/ProductSliderControl.module.css new file mode 100644 index 0000000..c744e75 --- /dev/null +++ b/site/components/product/ProductSliderControl/ProductSliderControl.module.css @@ -0,0 +1,29 @@ +.control { + @apply bg-violet absolute bottom-10 right-10 flex flex-row + border-accent-0 border text-accent-0 z-30 shadow-xl select-none; + height: 48px; +} + +.leftControl, +.rightControl { + @apply px-9 cursor-pointer; + transition: background-color 0.2s ease; +} + +.leftControl:hover, +.rightControl:hover { + background-color: var(--violet-dark); +} + +.leftControl:focus, +.rightControl:focus { + @apply outline-none; +} + +.rightControl { + @apply border-l border-accent-0; +} + +.leftControl { + margin-right: -1px; +} diff --git a/site/components/product/ProductSliderControl/ProductSliderControl.tsx b/site/components/product/ProductSliderControl/ProductSliderControl.tsx new file mode 100644 index 0000000..29b30b7 --- /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/site/components/product/ProductSliderControl/index.ts b/site/components/product/ProductSliderControl/index.ts new file mode 100644 index 0000000..5b63c46 --- /dev/null +++ b/site/components/product/ProductSliderControl/index.ts @@ -0,0 +1 @@ +export { default } from './ProductSliderControl' diff --git a/site/components/product/ProductTag/ProductTag.module.css b/site/components/product/ProductTag/ProductTag.module.css new file mode 100644 index 0000000..c36b43a --- /dev/null +++ b/site/components/product/ProductTag/ProductTag.module.css @@ -0,0 +1,31 @@ +.root { + @apply transition-colors ease-in-out duration-500 + absolute top-0 left-0 z-20 pr-16; +} + +.root .name { + @apply pt-0 max-w-full w-full leading-extra-loose; + font-size: 2rem; + letter-spacing: 0.4px; + line-height: 2.1em; +} + +.root .name span { + @apply py-4 px-6 bg-primary text-primary font-bold; + min-height: 70px; + font-size: inherit; + letter-spacing: inherit; + box-decoration-break: clone; + -webkit-box-decoration-break: clone; +} + +.root .name span.fontsizing { + display: flex; + padding-top: 1.5rem; +} + +.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/site/components/product/ProductTag/ProductTag.tsx b/site/components/product/ProductTag/ProductTag.tsx new file mode 100644 index 0000000..0db4866 --- /dev/null +++ b/site/components/product/ProductTag/ProductTag.tsx @@ -0,0 +1,36 @@ +import cn from 'clsx' +import { inherits } from 'util' +import s from './ProductTag.module.css' + +interface ProductTagProps { + className?: string + name: string + price: string + fontSize?: number +} + +const ProductTag: React.FC = ({ + name, + price, + className = '', + fontSize = 32, +}) => { + return ( +
    +

    + + {name} + +

    +
    {price}
    +
    + ) +} + +export default ProductTag diff --git a/site/components/product/ProductTag/index.ts b/site/components/product/ProductTag/index.ts new file mode 100644 index 0000000..cb345e8 --- /dev/null +++ b/site/components/product/ProductTag/index.ts @@ -0,0 +1 @@ +export { default } from './ProductTag' diff --git a/site/components/product/ProductView/ProductView.module.css b/site/components/product/ProductView/ProductView.module.css new file mode 100644 index 0000000..e68c76f --- /dev/null +++ b/site/components/product/ProductView/ProductView.module.css @@ -0,0 +1,59 @@ +.root { + @apply relative grid items-start gap-1 grid-cols-1 overflow-x-hidden; + min-height: auto; +} + +.main { + @apply relative px-0 pb-0 box-border flex flex-col col-span-1; + min-height: 500px; +} + +.sidebar { + @apply flex flex-col col-span-1 mx-auto max-w-8xl px-6 py-6 w-full h-full; +} + +.sliderContainer { + @apply flex items-center justify-center overflow-x-hidden bg-violet; +} + +.imageContainer { + @apply text-center h-full relative; +} + +.imageContainer > span { + height: 100% !important; +} + +.sliderContainer .img { + @apply w-full h-full max-h-full object-cover; +} + +.button { + width: 100%; +} + +.wishlistButton { + @apply absolute z-30 top-0 right-0; +} + +.relatedProductsGrid { + @apply grid grid-cols-2 py-2 gap-2 md:grid-cols-4 md:gap-7; +} + +@screen lg { + .root { + @apply grid-cols-12; + } + + .main { + @apply mx-0 col-span-8; + } + + .sidebar { + @apply col-span-4 py-6; + } + + .imageContainer { + max-height: 600px; + } +} diff --git a/site/components/product/ProductView/ProductView.tsx b/site/components/product/ProductView/ProductView.tsx new file mode 100644 index 0000000..6617c77 --- /dev/null +++ b/site/components/product/ProductView/ProductView.tsx @@ -0,0 +1,113 @@ +import cn from 'clsx' +import Image from 'next/image' +import s from './ProductView.module.css' +import { FC } from 'react' +import type { Product } from '@commerce/types/product' +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 { + product: Product + relatedProducts: Product[] +} + +const ProductView: FC = ({ product, relatedProducts }) => { + const { price } = usePrice({ + amount: product.price.value, + baseAmount: product.price.retailPrice, + currencyCode: product.price.currencyCode!, + }) + + return ( + <> + +
    +
    + +
    + + {product.images.map((image, i) => ( +
    + {image.alt +
    + ))} +
    +
    + {process.env.COMMERCE_WISHLIST_ENABLED && ( + + )} +
    + + +
    +
    +
    + Related Products +
    + {relatedProducts.map((p) => ( +
    + +
    + ))} +
    +
    +
    + + + ) +} + +export default ProductView diff --git a/site/components/product/ProductView/index.ts b/site/components/product/ProductView/index.ts new file mode 100644 index 0000000..9ac1448 --- /dev/null +++ b/site/components/product/ProductView/index.ts @@ -0,0 +1 @@ +export { default } from './ProductView' diff --git a/site/components/product/Swatch/Swatch.module.css b/site/components/product/Swatch/Swatch.module.css new file mode 100644 index 0000000..79a69e5 --- /dev/null +++ b/site/components/product/Swatch/Swatch.module.css @@ -0,0 +1,54 @@ +.swatch { + box-sizing: border-box; + composes: root from '@components/ui/Button/Button.module.css'; + @apply h-10 w-10 bg-primary text-primary rounded-full mr-3 inline-flex + items-center justify-center cursor-pointer transition duration-150 ease-in-out + p-0 shadow-none border-accent-3 border box-border select-none; + margin-right: calc(0.75rem - 1px); + overflow: hidden; + width: 48px; + height: 48px; +} + +.swatch::before, +.swatch::after { + box-sizing: border-box; +} + +.swatch:hover { + @apply transform scale-110 bg-hover; +} + +.swatch > span { + @apply absolute; +} + +.color { + @apply text-black transition duration-150 ease-in-out; +} + +.color :hover { + @apply text-black; +} + +.color.dark, +.color.dark:hover { + color: white !important; +} + +.active { + @apply border-accent-9 border-2; + padding-right: 1px; + padding-left: 1px; +} + +.textLabel { + @apply w-auto px-4; + min-width: 3rem; +} + +.active.textLabel { + @apply border-accent-9 border-2; + padding-right: calc(1rem - 1px); + padding-left: calc(1rem - 1px); +} diff --git a/site/components/product/Swatch/Swatch.tsx b/site/components/product/Swatch/Swatch.tsx new file mode 100644 index 0000000..865f433 --- /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/site/components/product/Swatch/index.ts b/site/components/product/Swatch/index.ts new file mode 100644 index 0000000..c8a7954 --- /dev/null +++ b/site/components/product/Swatch/index.ts @@ -0,0 +1 @@ +export { default } from './Swatch' diff --git a/site/components/product/helpers.ts b/site/components/product/helpers.ts new file mode 100644 index 0000000..77e385b --- /dev/null +++ b/site/components/product/helpers.ts @@ -0,0 +1,32 @@ +import type { Product } from '@commerce/types/product' +export type SelectedOptions = Record +import { Dispatch, SetStateAction } from 'react' + +export function getProductVariant(product: Product, opts: SelectedOptions) { + const variant = product.variants.find((variant) => { + return Object.entries(opts).every(([key, value]) => + variant.options.find((option) => { + if ( + option.__typename === 'MultipleChoiceOption' && + option.displayName.toLowerCase() === key.toLowerCase() + ) { + return option.values.find((v) => v.label.toLowerCase() === value) + } + }) + ) + }) + return variant +} + +export function selectDefaultOptionFromProduct( + product: Product, + updater: Dispatch> +) { + // Selects the default option + product.variants[0]?.options?.forEach((v) => { + updater((choices) => ({ + ...choices, + [v.displayName.toLowerCase()]: v.values[0].label.toLowerCase(), + })) + }) +} diff --git a/site/components/product/index.ts b/site/components/product/index.ts new file mode 100644 index 0000000..8b70f8e --- /dev/null +++ b/site/components/product/index.ts @@ -0,0 +1,5 @@ +export { default as Swatch } from './Swatch' +export { default as ProductView } from './ProductView' +export { default as ProductCard } from './ProductCard' +export { default as ProductSlider } from './ProductSlider' +export { default as ProductOptions } from './ProductOptions' diff --git a/site/components/search.tsx b/site/components/search.tsx new file mode 100644 index 0000000..664085e --- /dev/null +++ b/site/components/search.tsx @@ -0,0 +1,439 @@ +import cn from 'clsx' +import type { SearchPropsType } from '@lib/search-props' +import Link from 'next/link' +import { useState } from 'react' +import { useRouter } from 'next/router' + +import { Layout } from '@components/common' +import { ProductCard } from '@components/product' +import type { Product } from '@commerce/types/product' +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 = { + 'trending-desc': 'Trending', + 'latest-desc': 'Latest arrivals', + 'price-asc': 'Price: Low to high', + 'price-desc': 'Price: High to low', +} + +import { + filterQuery, + getCategoryPath, + getDesignerPath, + useSearchMeta, +} from '@lib/search' + +export default function Search({ categories, brands }: SearchPropsType) { + const [activeFilter, setActiveFilter] = useState('') + const [toggleFilter, setToggleFilter] = useState(false) + + const router = useRouter() + const { asPath, locale } = router + const { q, sort } = router.query + // `q` can be included but because categories and designers can't be searched + // in the same way of products, it's better to ignore the search input if one + // of those is selected + const query = filterQuery({ sort }) + + const { pathname, category, brand } = useSearchMeta(asPath) + const activeCategory = categories.find((cat: any) => cat.slug === category) + const activeBrand = brands.find( + (b: any) => getSlug(b.node.path) === `brands/${brand}` + )?.node + + const { data } = useSearch({ + search: typeof q === 'string' ? q : '', + categoryId: activeCategory?.id, + brandId: (activeBrand as any)?.entityId, + sort: typeof sort === 'string' ? sort : '', + locale, + }) + + const handleClick = (event: any, filter: string) => { + if (filter !== activeFilter) { + setToggleFilter(true) + } else { + setToggleFilter(!toggleFilter) + } + setActiveFilter(filter) + } + + return ( + +
    +
    + {/* Categories */} +
    +
    + + + +
    + +
    + + {/* Designs */} +
    +
    + + + +
    + +
    +
    + {/* Products */} +
    + {(q || activeCategory || activeBrand) && ( +
    + {data ? ( + <> + + Showing {data.products.length} results{' '} + {q && ( + <> + for "{q}" + + )} + + + {q ? ( + <> + There are no products that match "{q}" + + ) : ( + <> + There are no products that match the selected category. + + )} + + + ) : q ? ( + <> + Searching for: "{q}" + + ) : ( + <>Searching... + )} +
    + )} + {data ? ( +
    + {data.products.map((product: Product) => ( + + ))} +
    + ) : ( +
    + {rangeMap(12, (i) => ( + +
    + + ))} +
    + )}{' '} +
    + + {/* Sort */} +
    +
    +
    + + + +
    + +
    +
    +
    + + ) +} + +Search.Layout = Layout diff --git a/site/components/sidebar.js b/site/components/sidebar.js new file mode 100644 index 0000000..fb5c1b3 --- /dev/null +++ b/site/components/sidebar.js @@ -0,0 +1,189 @@ +import React from "react"; +import { Container, Box, Grid, Hidden } from '@mui/material'; +import Link from "next/link"; + + +// import icon + +import LanguageIcon from '@mui/icons-material/Language'; +import EditSharpIcon from '@mui/icons-material/EditSharp'; +import LoginSharpIcon from '@mui/icons-material/LoginSharp'; +// makestyle +import { makeStyles } from "@material-ui/core/styles"; + +// import images +import arrow_down from '../assets/arrow_down.png'; + +const colorHeading = '#323232'; +const colorHover = '#40c6ff'; +const colorDefaul = '#666'; + +const useStyle_HeaderTop = makeStyles({ + headerTop: { + padding: '10px', + backgroundColor: '#f3f3f3', + }, + menuTop: { + listStyle: 'none', + padding: '0px', + margin: '0px', + '& li': { + color:"#999", + float: 'left', + padding: '0px 10px', + position: 'relative', + '&:first-child': { + paddingLeft: '0px', + '&::before': { + display: 'none', + } + }, + '&::before': { + position: 'absolute', + content: '""', + width: '1px', + height: '14px', + left: '0px', + top: '6px', + backgroundColor: '#999999', + }, + '& a': { + color: '#999', + fontSize: '14px', + fontFamily: "Mulish,'sans-serif'", + '&:hover': { + color: `${colorHover}`, + } + } + } + }, + headerTopRight: { + listStyle: 'none', + padding: '0px', + margin: '0px', + float: 'right', + '& li': { + float: 'left', + padding: '0px 10px', + position: 'relative', + display: 'inline-flex', + alignItems: 'center', + '&:first-child': { + paddingLeft: '0px', + '&::before': { + display: 'none', + } + }, + '&::before': { + position: 'absolute', + content: '""', + width: '1px', + height: '14px', + left: '0px', + top: '4px', + backgroundColor: '#999999', + }, + '& a': { + color: '#999', + fontSize: '14px', + fontFamily: "Mulish,'sans-serif'", + display: 'inline-flex', + alignItems: 'center', + '&:hover': { + color: `${colorHover}`, + }, + '& svg': { + fontSize: '14px', + marginRight: '5px', + } + }, + '& svg': { + fontSize: '14px', + marginRight: '5px', + color: '#999', + }, + '& select': { + border: 'none', + color: '#999', + fontSize: '14px', + fontFamily: "Mulish,'sans-serif'", + '&:focus': { + outline: 'none', + } + } + }, + '@media (max-width: 899px)': { + textAlign: 'center', + float: 'none', + '& li': { + float: 'none', + display: 'inline-block', + } + }, + '@media (max-width: 425px)': { + '& li': { + '& span': { + display: 'none', + } + } + } + }, + curency: { + '& select': { + paddingRight: '15px', + background: 'transparent', + appearance: 'none', + backgroundImage: `url(${arrow_down.src})`, + backgroundRepeat: 'no-repeat', + backgroundPosition: 'right 1px top 6px;', + } + }, + language: { + '& select': { + background: 'transparent', + appearance: 'none', + backgroundImage: `url(${arrow_down.src})`, + backgroundRepeat: 'no-repeat', + backgroundPosition: 'right 1px top 7px;', + } + } +}); + +const SideBarTop = () => { + const classes = useStyle_HeaderTop() + return ( +
    + + + + +
      +
    • Call Support Free:1800123456
    • +
    +
    +
    + + +
      +
    • + +
    • +
    • + + +
    • +
    +
    +
    +
    +
    +
    + ); +} +export default SideBarTop; diff --git a/site/components/single-product/categories-carousel/index.js b/site/components/single-product/categories-carousel/index.js new file mode 100644 index 0000000..d47ef79 --- /dev/null +++ b/site/components/single-product/categories-carousel/index.js @@ -0,0 +1,93 @@ +import { isEmpty, isArray } from 'lodash'; +import { useState, useRef } from 'react'; +import { makeStyles } from '@mui/styles'; + + +const colorHover = '#40c6ff'; +const useStyles_category_meta = makeStyles({ + category_meta: { + marginBottom: '15px', + }, + category_meta_title: { + minWidth: '0px', + display: 'inline-block', + }, + category_meta_name: { + color: '#000', + } +}); + +const CategoriesCarousel = ({ gallery }) => { + const activeIndexRef = useRef({ activeIndex: 0 }); + const slideRef = useRef(0); + const [slide, setSlide] = useState(0); + const [restartSlide, setRestartSlide] = useState(0); + const { activeIndex } = activeIndexRef.current; + const classes = useStyles_category_meta(); + + + + if (isEmpty(gallery) || !isArray(gallery)) { + return null; + } + + /** + * Change to next slide. + */ + const nextSlide = () => { + + if (1 === gallery.length) { + return null; + } + + /** + * If if autoplay is set to true + * and all slides are finished playing, + * set the activeIndex to one and restart the slide from start. + */ + if (activeIndexRef.current.activeIndex === gallery.length - 1) { + + activeIndexRef.current.activeIndex = 0; + setRestartSlide(restartSlide + 1); + + } else { + + // If its not the last slide increment active index by one. + activeIndexRef.current.activeIndex = + activeIndexRef.current.activeIndex + 1; + + } + + slideRef.current = slideRef.current + 1; + setSlide(slideRef.current); + + }; + + return ( +
    +
    + Categories: + { + gallery.map((item, index) => { + const opacity = (activeIndex === index || 1 === gallery.length) ? 'opacity-10' : 'opacity-0'; + return ( + + {item.name}. + + ) + }) + } + {/*
    + + +
    */} +
    +
    + ) +} + +export default CategoriesCarousel diff --git a/site/components/single-product/gallery-carousel/index.js b/site/components/single-product/gallery-carousel/index.js new file mode 100644 index 0000000..4a91ce0 --- /dev/null +++ b/site/components/single-product/gallery-carousel/index.js @@ -0,0 +1,100 @@ +import { isEmpty, isArray } from 'lodash'; +import { useState, useRef } from 'react'; + +// makestyle +import { makeStyles } from "@material-ui/core/styles"; + + + +const useStyle_ImagesThumbnail = makeStyles({ + thumbnail_detail: { + width: '90%', + display: 'flex', + '& div.img-item': { + width: '25%', + marginRight: '20px', + '& img': { + width: '100%', + }, + '&:last-child': { + marginRight: '0px', + }, + '@media (max-width:575px)': { + marginRight: '10px', + } + } + } + +}); + +const GalleryCarousel = ({ gallery }) => { + const activeIndexRef = useRef({ activeIndex: 0 }); + const slideRef = useRef(0); + const [slide, setSlide] = useState(0); + const [restartSlide, setRestartSlide] = useState(0); + const { activeIndex } = activeIndexRef.current; + const classes = useStyle_ImagesThumbnail() + if (isEmpty(gallery) || !isArray(gallery)) { + return null; + } + + + /** + * Change to next slide. + */ + const nextSlide = () => { + + if (1 === gallery.length) { + return null; + } + + /** + * If if autoplay is set to true + * and all slides are finished playing, + * set the activeIndex to one and restart the slide from start. + */ + if (activeIndexRef.current.activeIndex === gallery.length - 1) { + + activeIndexRef.current.activeIndex = 0; + setRestartSlide(restartSlide + 1); + + } else { + + // If its not the last slide increment active index by one. + activeIndexRef.current.activeIndex = + activeIndexRef.current.activeIndex + 1; + + } + + slideRef.current = slideRef.current + 1; + setSlide(slideRef.current); + + }; + + return ( +
    + { + gallery.map((item, index) => { + const opacity = (activeIndex === index || 1 === gallery.length) ? 'opacity-10' : 'opacity-1'; + return ( +
    + {item?.name +
    + ) + }) + } + {/*
    + + +
    */} +
    + ) +} + +export default GalleryCarousel diff --git a/site/components/single-product/price/index.js b/site/components/single-product/price/index.js new file mode 100644 index 0000000..9522502 --- /dev/null +++ b/site/components/single-product/price/index.js @@ -0,0 +1,75 @@ +import { isEmpty } from "lodash"; +import { makeStyles } from '@mui/styles' + + +const colorHover = '#40c6ff'; + +const useStyle_price = makeStyles({ + product_price: { + fontSize: '20px', + color: `${colorHover}`, + padding: '0px', + margin: '0px', + '& span': { + '&.regular_price': { + textDecoration: 'line-through', + marginRight: '15px', + color: '#999', + }, + '&:nth-child(2)': { + margin: '0px 15px', + }, + '&:nth-child(3)': { + display: 'none', + } + }, + }, + +}) + +const Price = ({ regularPrice = 0, salesPrice }) => { + const classes = useStyle_price() + + if (isEmpty(salesPrice)) { + return null; + } + + /** + * Get discount percent. + * + * @param {String} regularPrice + * @param {String} salesPrice + */ + const discountPercent = (regularPrice, salesPrice) => { + if (isEmpty(regularPrice) || isEmpty(salesPrice)) { + return null; + } + + const formattedRegularPrice = parseInt(regularPrice?.substring(1)); + const formattedSalesPrice = parseInt(salesPrice?.substring(1)); + + const discountPercent = ((formattedRegularPrice - formattedSalesPrice) / formattedRegularPrice) * 100; + + return { + discountPercent: formattedSalesPrice !== formattedRegularPrice ? `(${discountPercent.toFixed(2)}%) OFF` : null, + strikeThroughClass: formattedSalesPrice < formattedRegularPrice ? 'regular_price' : '' + } + } + + const productMeta = discountPercent(regularPrice, salesPrice); + + return ( +
    + {/* Discounted price */} + {regularPrice} + + {/* Regular price */} + {productMeta?.discountPercent ? {salesPrice} : null} + + {/* Discount percent */} + {productMeta?.discountPercent} +
    + ) +} + +export default Price diff --git a/site/components/single-product/related-product/index.js b/site/components/single-product/related-product/index.js new file mode 100644 index 0000000..06e380d --- /dev/null +++ b/site/components/single-product/related-product/index.js @@ -0,0 +1,77 @@ +import { isEmpty, isArray } from 'lodash'; +import { useState, useRef } from 'react'; + +const RelatedProduct = ({ gallery }) => { + + const activeIndexRef = useRef({ activeIndex: 0 }); + const slideRef = useRef(0); + const [slide, setSlide] = useState(0); + const [restartSlide, setRestartSlide] = useState(0); + const { activeIndex } = activeIndexRef.current; + + if (isEmpty(gallery) || !isArray(gallery)) { + return null; + } + + + /** + * Change to next slide. + */ + const nextSlide = () => { + + if (1 === gallery.length) { + return null; + } + + /** + * If if autoplay is set to true + * and all slides are finished playing, + * set the activeIndex to one and restart the slide from start. + */ + if (activeIndexRef.current.activeIndex === gallery.length - 1) { + + activeIndexRef.current.activeIndex = 0; + setRestartSlide(restartSlide + 1); + + } else { + + // If its not the last slide increment active index by one. + activeIndexRef.current.activeIndex = + activeIndexRef.current.activeIndex + 1; + + } + + slideRef.current = slideRef.current + 1; + setSlide(slideRef.current); + + }; + + return ( +
    +
    + { + gallery.map((item, index) => { + const opacity = (activeIndex === index || 1 === gallery.length) ? 'opacity-10' : 'opacity-0'; + return ( +
    + {item?.altText +
    + ) + }) + } + {/*
    + + +
    */} +
    +
    + ) +} + +export default RelatedProduct diff --git a/site/components/slider.js b/site/components/slider.js new file mode 100644 index 0000000..7f103f4 --- /dev/null +++ b/site/components/slider.js @@ -0,0 +1,129 @@ +import * as React from "react"; +import { useTheme } from "@mui/material/styles"; +import Box from "@mui/material/Box"; +import MobileStepper from "@mui/material/MobileStepper"; +import Paper from "@mui/material/Paper"; +import SwipeableViews from "react-swipeable-views"; +import { autoPlay } from "react-swipeable-views-utils"; +import Banner_1 from '../assets/banner1.png'; +import Banner_2 from '../assets/banner2.png'; +import Banner_3 from '../assets/banner3.png'; + + +// makestyle +import { makeStyles } from "@material-ui/core/styles"; + +const useStyle_sliderHome = makeStyles({ + slider_images: { + width: '100%', + '@media(min-width:992px)': { + minHeight: '650px', + }, + '@media(max-width:991px)': { + minHeight: '550px', + objectFit: 'cover', + }, + '@media(max-width:575px)': { + minHeight: '400px', + objectFit: 'cover', + }, + }, + dotSlider: { + padding: '0px', + justifyContent: 'center', + marginTop: '-45px', + zIndex: 10, + position: 'relative', + background: 'transparent', + '& div.MuiMobileStepper-dot': { + width: '12px', + height: '12px', + boxShadow: '0 0 0 2px rgb(255 255 255)', + backgroundColor: 'rgba(255,255,255,0.3)', + border: 'none', + borderRadius: '50%', + margin: '0px 7px', + position: 'relative', + '&::after': { + position: 'absolute', + content: '""', + width: '6px', + height: '6px', + borderRadius: '50%', + background: '#fff', + top: '6px', + left: '0px', + right: '0px', + margin: 'auto', + transform: 'translateY(-50%)', + display: 'none', + }, + '&:hover': { + cursor: 'pointer', + }, + '&.MuiMobileStepper-dotActive': { + '&::after': { + display: 'block', + } + } + } + } +}); + + +const AutoPlaySwipeableViews = autoPlay(SwipeableViews); + +const images = [ + { + imgPath: Banner_1.src + }, + { + + imgPath: Banner_2.src + }, + { + + imgPath: Banner_3.src + + } +]; + +function SwipeableTextMobileStepper() { + const classes = useStyle_sliderHome(); + + const theme = useTheme(); + const [activeStep, setActiveStep] = React.useState(0); + const maxSteps = images.length; + const handleStepChange = (step) => { + setActiveStep(step); + }; + + return ( + + + {images.map((step, index) => ( +
    + {Math.abs(activeStep - index) <= 2 ? ( + + ) : null} +
    + ))} +
    + +
    + ); +} + +export default SwipeableTextMobileStepper; diff --git a/site/components/tab.js b/site/components/tab.js new file mode 100644 index 0000000..274de82 --- /dev/null +++ b/site/components/tab.js @@ -0,0 +1,140 @@ +import * as React from "react"; +import { makeStyles } from "@material-ui/core/styles"; +import Box from "@mui/material/Box"; +import { Typography } from "@mui/material"; +import Link from "@mui/material/Link"; +import { Button } from '@mui/material'; +import { useRouter } from "next/router"; + + +const colorHover = '#40c6ff'; +const useStyles = makeStyles({ + product: { + marginTop: "50px", + textAlign: "center", + marginBottom: "30px" + }, + tabsProduct: { + paddingBottom: 25, + textAlign: "center" + }, + title: { + color: "#444444", + fontSize: 24, + fontWeight: "bold", + textAlign: "center", + marginBottom: 20 + }, + tabsTitle: { + display: "inline-flex", + '@media (max-width: 767px)': { + + display: "inline-block ", + width: "100%" + + } + }, + + tabs: { + marginRight: 12, + '@media (max-width: 767px)': { + display: "block", + margin: "0px 0px 20px 0px", + width: "100%" + + } + }, + tabText: { + textTransform: "capitalize", + textDecoration: "none", + color: "#444", + fontSize: 16, + padding: "6px 20px", + border: "solid 1px#e3e3e3", + WebkitBorderRadius: 32, + borderRadius: 32, + cursor: "pointer", + '@media (max-width: 750px)': { + width: "100%", + display: "block" + }, + "&:hover": { + backgroundColor: "rgb(64,198,255)", + color: "#fff", + transition: "width 2s" + }, + "&:active": { + backgroundColor: "rgb(64,198,255)", + color: "#fff", + transition: "width 2s" + } + + }, + titleHome: { + fontFamily: 'Merriweather,sans-serif', + color: '#444444', + fontSize: '24px', + fontWeight: 'bold', + margin: '30px 0px 25px 0px', + '& span': { + position: 'relative', + display: 'inline-block', + '&::after': { + position: 'absolute', + content: '""', + width: '15px', + height: '1px', + left: '-30px', + top: '18px', + backgroundColor: `${colorHover}`, + }, + '&::before': { + position: 'absolute', + content: '""', + width: '15px', + height: '1px', + right: '-30px', + top: '18px', + backgroundColor: `${colorHover}`, + } + } + }, +}); + +export default function Tab() { + const classes = useStyles(); + const router = useRouter(); + const handleSubmit = (value) => { + //console.log(value); + router.push(`?slug=${value}`); + }; + return ( + <> + + + NEW PRODUCT + + + + + + + + + + + + + + + + + + + + + + + + ); +} diff --git a/site/components/tabSeller.js b/site/components/tabSeller.js new file mode 100644 index 0000000..c0e3e8c --- /dev/null +++ b/site/components/tabSeller.js @@ -0,0 +1,133 @@ +import * as React from "react"; +import { makeStyles } from "@material-ui/core/styles"; +import Box from "@mui/material/Box"; +import { Typography } from "@mui/material"; +import Link from "@mui/material/Link"; +import { useRouter } from "next/router"; +import { Button } from "@mui/material"; + + +const colorHover = '#40c6ff'; +const useStyles = makeStyles({ + product: { + marginTop: "50px", + textAlign: "center", + marginBottom: "30px" + }, + tabsProduct: { + paddingBottom: 25, + textAlign: "center" + }, + title: { + color: "#444444", + fontSize: 24, + fontWeight: "bold", + textAlign: "center", + marginBottom: 20 + }, + tabsTitle: { + display: "inline-flex", + '@media (max-width: 767px)': { + + display: "inline-block ", + width: "100%" + + } + }, + + tabs: { + marginRight: 12, + '@media (max-width: 767px)': { + display: "block", + margin: "0px 0px 20px 0px", + width: "100%" + + } + }, + tabText: { + textTransform: "capitalize", + textDecoration: "none", + color: "#444", + fontSize: 16, + padding: "6px 20px", + border: "solid 1px#e3e3e3", + WebkitBorderRadius: 32, + borderRadius: 32, + cursor: "pointer", + '@media (max-width: 750px)': { + width: "100%", + display: "block" + }, + "&:hover": { + backgroundColor: "rgb(64,198,255)", + color: "#fff", + transition: "width 2s" + }, + + }, + titleHome: { + fontFamily: 'Merriweather,sans-serif', + color: '#444444', + fontSize: '24px', + fontWeight: 'bold', + margin: '30px 0px 25px 0px', + '& span': { + position: 'relative', + display: 'inline-block', + '&::after': { + position: 'absolute', + content: '""', + width: '15px', + height: '1px', + left: '-30px', + top: '18px', + backgroundColor: `${colorHover}`, + }, + '&::before': { + position: 'absolute', + content: '""', + width: '15px', + height: '1px', + right: '-30px', + top: '18px', + backgroundColor: `${colorHover}`, + } + } + }, +}); + +export default function TabSeller() { + const classes = useStyles(); + const router = useRouter(); + const handleSubmit = (value) => { + //console.log(value); + router.push(`?slug1=${value}`); + }; + return ( + <> + + + Best Seller + + + + + + + + + + + + + + + + + + + + + + ); +} diff --git a/site/components/tabsLogo.js b/site/components/tabsLogo.js new file mode 100644 index 0000000..faba4f7 --- /dev/null +++ b/site/components/tabsLogo.js @@ -0,0 +1,118 @@ +import * as React from "react"; +import { makeStyles } from "@material-ui/core/styles"; +import Box from "@mui/material/Box"; +import { Container, Grid, Typography } from "@mui/material"; +import Link from "@mui/material/Link"; +import Logo1 from '../assets/logo1.png'; +import Logo2 from '../assets/logo2.png'; +import Logo3 from '../assets/logo3.png'; +import Logo4 from '../assets/logo4.png'; +import Logo5 from '../assets/logo5.png'; +import Logo6 from '../assets/logo6.png'; +import { ClassNames } from "@emotion/react"; + + + +const colorHover = '#40c6ff'; +const useStyles = makeStyles({ + listLogo: { + display: "flex", + '@media (max-width: 768px)': { + display: "block", + with: "100%", + + }, + + }, + logoGroup: { + display: "flex", + marginLeft:"-9px", + '@media (max-width: 350px)': { + display: "block", + with: "100%", + + + }, + }, + imgLogo: { + width: "100%", + display: "block", + border: "1px solid #efefef", + marginLeft: "15px", + marginRight: "15px", + marginBottom: "30px", + }, + titleHome: { + textAlign: 'center', + fontFamily: 'Merriweather,sans-serif', + color: '#444444', + fontSize: '24px', + fontWeight: 'bold', + margin: '30px 0px 25px 0px', + '& span': { + position: 'relative', + display: 'inline-block', + '&::after': { + position: 'absolute', + content: '""', + width: '15px', + height: '1px', + left: '-30px', + top: '18px', + backgroundColor: `${colorHover}`, + }, + '&::before': { + position: 'absolute', + content: '""', + width: '15px', + height: '1px', + right: '-30px', + top: '18px', + backgroundColor: `${colorHover}`, + } + } + }, +}); + +export default function Logo() { + const classes = useStyles(); + return ( + <> + + + + OUTLET BRAND STUFF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ) +} diff --git a/site/components/ui/Button/Button.module.css b/site/components/ui/Button/Button.module.css new file mode 100644 index 0000000..34bdea1 --- /dev/null +++ b/site/components/ui/Button/Button.module.css @@ -0,0 +1,57 @@ +.root { + @apply bg-accent-9 text-accent-0 cursor-pointer inline-flex + px-10 py-5 leading-6 transition ease-in-out duration-150 + shadow-sm text-center justify-center uppercase + border border-transparent items-center text-sm font-semibold + tracking-wide; + max-height: 64px; +} + +.root:hover { + @apply border-accent-9 bg-accent-6; +} + +.root:focus { + @apply shadow-outline-normal outline-none; +} + +.root[data-active] { + @apply bg-accent-6; +} + +.loading { + @apply bg-accent-1 text-accent-3 border-accent-2 cursor-not-allowed; +} + +.slim { + @apply py-2 transform-none normal-case; +} + +.ghost { + @apply border border-accent-2 bg-accent-0 text-accent-9 text-sm; +} + +.ghost:hover { + @apply border-accent-9 bg-accent-9 text-accent-0; +} + +.naked { + @apply bg-transparent font-semibold border-none shadow-none outline-none py-0 px-0; +} + +.naked:hover, +.naked:focus { + @apply bg-transparent border-none; +} + +.disabled, +.disabled:hover { + @apply text-accent-4 border-accent-2 bg-accent-1 cursor-not-allowed; + filter: grayscale(1); + -webkit-transform: translateZ(0); + -webkit-perspective: 1000; + -webkit-backface-visibility: hidden; +} + +.progress { +} diff --git a/site/components/ui/Button/Button.tsx b/site/components/ui/Button/Button.tsx new file mode 100644 index 0000000..47d474f --- /dev/null +++ b/site/components/ui/Button/Button.tsx @@ -0,0 +1,75 @@ +import cn from 'clsx' +import React, { + forwardRef, + ButtonHTMLAttributes, + JSXElementConstructor, + useRef, +} from 'react' +import mergeRefs from 'react-merge-refs' +import s from './Button.module.css' +import { LoadingDots } from '@components/ui' + +export interface ButtonProps extends ButtonHTMLAttributes { + href?: string + className?: string + variant?: 'flat' | 'slim' | 'ghost' | 'naked' + active?: boolean + type?: 'submit' | 'reset' | 'button' + Component?: string | JSXElementConstructor + width?: string | number + loading?: boolean + disabled?: boolean +} + +// eslint-disable-next-line react/display-name +const Button: React.FC = forwardRef((props, buttonRef) => { + const { + className, + variant = 'flat', + children, + active, + width, + loading = false, + disabled = false, + style = {}, + Component = 'button', + ...rest + } = props + const ref = useRef(null) + + const rootClassName = cn( + s.root, + { + [s.ghost]: variant === 'ghost', + [s.slim]: variant === 'slim', + [s.naked]: variant === 'naked', + [s.loading]: loading, + [s.disabled]: disabled, + }, + className + ) + + return ( + + {children} + {loading && ( + + + + )} + + ) +}) + +export default Button diff --git a/site/components/ui/Button/index.ts b/site/components/ui/Button/index.ts new file mode 100644 index 0000000..aa076c5 --- /dev/null +++ b/site/components/ui/Button/index.ts @@ -0,0 +1,2 @@ +export { default } from './Button' +export * from './Button' diff --git a/site/components/ui/Collapse/Collapse.module.css b/site/components/ui/Collapse/Collapse.module.css new file mode 100644 index 0000000..fb4a82a --- /dev/null +++ b/site/components/ui/Collapse/Collapse.module.css @@ -0,0 +1,25 @@ +.root { + @apply border-b border-accent-2 py-4 flex flex-col outline-none; +} + +.header { + @apply flex flex-row items-center; +} + +.header .label { + @apply text-base font-medium; +} + +.content { + @apply pt-3 overflow-hidden pl-8; +} + +.icon { + @apply mr-3 text-accent-6; + margin-left: -6px; + transition: transform 0.2s ease; +} + +.icon.open { + transform: rotate(90deg); +} diff --git a/site/components/ui/Collapse/Collapse.tsx b/site/components/ui/Collapse/Collapse.tsx new file mode 100644 index 0000000..8ec71ee --- /dev/null +++ b/site/components/ui/Collapse/Collapse.tsx @@ -0,0 +1,46 @@ +import cn from 'clsx' +import React, { FC, ReactNode, useState } from 'react' +import s from './Collapse.module.css' +import { ChevronRight } from '@components/icons' +import { useSpring, a } from '@react-spring/web' +import useMeasure from 'react-use-measure' + +export interface CollapseProps { + title: string + children: ReactNode +} + +const Collapse: FC = ({ title, children }) => { + const [isActive, setActive] = useState(false) + const [ref, { height: viewHeight }] = useMeasure() + + const animProps = useSpring({ + height: isActive ? viewHeight : 0, + config: { tension: 250, friction: 32, clamp: true, duration: 150 }, + opacity: isActive ? 1 : 0, + }) + + const toggle = () => setActive((x) => !x) + + return ( +
    +
    + + {title} +
    + +
    + {children} +
    +
    +
    + ) +} + +export default React.memo(Collapse) diff --git a/site/components/ui/Collapse/index.ts b/site/components/ui/Collapse/index.ts new file mode 100644 index 0000000..1e584a5 --- /dev/null +++ b/site/components/ui/Collapse/index.ts @@ -0,0 +1,2 @@ +export { default } from './Collapse' +export * from './Collapse' diff --git a/site/components/ui/Container/Container.tsx b/site/components/ui/Container/Container.tsx new file mode 100644 index 0000000..d8425f3 --- /dev/null +++ b/site/components/ui/Container/Container.tsx @@ -0,0 +1,27 @@ +import cn from 'clsx' +import React, { FC } from 'react' + +interface ContainerProps { + className?: string + children?: any + el?: HTMLElement + clean?: boolean +} + +const Container: FC = ({ + children, + className, + el = 'div', + clean = false, // Full Width Screen +}) => { + const rootClassName = cn(className, { + 'mx-auto max-w-7xl px-6 w-full': !clean, + }) + + let Component: React.ComponentType> = + el as any + + return {children} +} + +export default Container diff --git a/site/components/ui/Container/index.ts b/site/components/ui/Container/index.ts new file mode 100644 index 0000000..9dbd596 --- /dev/null +++ b/site/components/ui/Container/index.ts @@ -0,0 +1 @@ +export { default } from './Container' diff --git a/site/components/ui/Dropdown/Dropdown.module.css b/site/components/ui/Dropdown/Dropdown.module.css new file mode 100644 index 0000000..46b2469 --- /dev/null +++ b/site/components/ui/Dropdown/Dropdown.module.css @@ -0,0 +1,32 @@ +.root { + @apply bg-accent-0; + animation: none; + transition: none; + min-width: 100%; +} + +@media screen(lg) { + .root { + @apply bg-accent-0; + box-shadow: hsl(206 22% 7% / 45%) 0px 10px 38px -10px, + hsl(206 22% 7% / 20%) 0px 10px 20px -15px; + min-width: 14rem; + will-change: transform, opacity; + animation-duration: 600ms; + animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); + animation-fill-mode: forwards; + transform-origin: var(--radix-dropdown-menu-content-transform-origin); + animation-name: slideIn; + } +} + +@keyframes slideIn { + 0% { + opacity: 0; + transform: translateY(2px); + } + 100% { + opacity: 1; + transform: translateY(0px); + } +} diff --git a/site/components/ui/Dropdown/Dropdown.tsx b/site/components/ui/Dropdown/Dropdown.tsx new file mode 100644 index 0000000..566b962 --- /dev/null +++ b/site/components/ui/Dropdown/Dropdown.tsx @@ -0,0 +1,22 @@ +import cn from 'clsx' +import React from 'react' +import s from './Dropdown.module.css' +import * as DropdownMenu from '@radix-ui/react-dropdown-menu' + +export const Dropdown = DropdownMenu.Root +export const DropdownMenuItem = DropdownMenu.Item +export const DropdownTrigger = DropdownMenu.Trigger +export const DropdownMenuLabel = DropdownMenu.Label +export const DropdownMenuGroup = DropdownMenu.Group + +export const DropdownContent = React.forwardRef< + HTMLDivElement, + { children: React.ReactNode } & DropdownMenu.DropdownMenuContentProps & + React.RefAttributes +>(function DropdownContent({ children, className, ...props }, forwardedRef) { + return ( + +
    {children}
    +
    + ) +}) diff --git a/site/components/ui/Grid/Grid.module.css b/site/components/ui/Grid/Grid.module.css new file mode 100644 index 0000000..9e6ab69 --- /dev/null +++ b/site/components/ui/Grid/Grid.module.css @@ -0,0 +1,135 @@ +.root { + @apply grid grid-cols-1 gap-0; +} +.root > * { + @apply row-span-1 bg-transparent box-border overflow-hidden; + height: 500px; + max-height: 800px; +} + +.default > * { + @apply bg-transparent; +} + +.layoutNormal { + @apply gap-3; +} + +.layoutA { + & > *:nth-child(6n + 1), + & > *:nth-child(6n + 5) { + @apply row-span-2 lg:col-span-2; + height: var(--row-height); + } + + &.filled { + & > *:nth-child(6n + 1) { + @apply bg-violet; + } + + & > *:nth-child(6n + 2) { + @apply bg-accent-8; + } + + & > *:nth-child(6n + 3) { + @apply bg-pink; + } + + & > *:nth-child(6n + 6) { + @apply bg-cyan; + } + } +} + +.layoutB { + & > *:nth-child(6n + 2), + & > *:nth-child(6n + 4) { + @apply row-span-2 lg:col-span-2; + height: var(--row-height); + } + + &.filled { + & > *:nth-child(6n + 1) { + @apply bg-violet; + } + + & > *:nth-child(6n + 2) { + @apply bg-accent-8; + } + + & > *:nth-child(6n + 3) { + @apply bg-pink; + } + + & > *:nth-child(6n + 6) { + @apply bg-cyan; + } + } +} + +.layoutC { + & > *:nth-child(12n + 1), + & > *:nth-child(12n + 8) { + @apply row-span-2 lg:col-span-2; + height: var(--row-height); + } + + &.filled { + & > *:nth-child(12n + 1) { + @apply bg-violet; + height: var(--row-height); + } + + & > *:nth-child(12n + 8) { + @apply bg-cyan; + height: var(--row-height); + } + + & > *:nth-child(6n + 3) { + @apply bg-pink; + } + } +} + +.layoutD { + & > *:nth-child(12n + 2), + & > *:nth-child(12n + 7) { + @apply row-span-2 lg:col-span-2; + height: var(--row-height); + } + + &.filled { + & > *:nth-child(12n + 2) { + @apply bg-violet; + } + + & > *:nth-child(12n + 7) { + @apply bg-cyan; + } + + & > *:nth-child(6n + 3) { + @apply bg-pink; + } + } +} + +@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/site/components/ui/Grid/Grid.tsx b/site/components/ui/Grid/Grid.tsx new file mode 100644 index 0000000..9b033c0 --- /dev/null +++ b/site/components/ui/Grid/Grid.tsx @@ -0,0 +1,34 @@ +import cn from 'clsx' +import { FC, ReactNode, Component } from 'react' +import s from './Grid.module.css' + +interface GridProps { + className?: string + children?: ReactNode[] | Component[] | any[] + layout?: 'A' | 'B' | 'C' | 'D' | 'normal' + variant?: 'default' | 'filled' +} + +const Grid: FC = ({ + className, + layout = 'A', + children, + variant = 'default', +}) => { + const rootClassName = cn( + s.root, + { + [s.layoutA]: layout === 'A', + [s.layoutB]: layout === 'B', + [s.layoutC]: layout === 'C', + [s.layoutD]: layout === 'D', + [s.layoutNormal]: layout === 'normal', + [s.default]: variant === 'default', + [s.filled]: variant === 'filled', + }, + className + ) + return
    {children}
    +} + +export default Grid diff --git a/site/components/ui/Grid/index.ts b/site/components/ui/Grid/index.ts new file mode 100644 index 0000000..ddb5129 --- /dev/null +++ b/site/components/ui/Grid/index.ts @@ -0,0 +1 @@ +export { default } from './Grid' diff --git a/site/components/ui/Hero/Hero.module.css b/site/components/ui/Hero/Hero.module.css new file mode 100644 index 0000000..a0f1798 --- /dev/null +++ b/site/components/ui/Hero/Hero.module.css @@ -0,0 +1,30 @@ +.root { + @apply flex flex-col py-16 mx-auto; +} + +.title { + @apply text-accent-0 font-extrabold text-4xl leading-none tracking-tight; +} + +.description { + @apply mt-4 text-xl leading-8 text-accent-2 mb-1 lg:max-w-4xl; +} + +@screen lg { + .root { + @apply flex-row items-start justify-center py-32; + } + .title { + @apply text-5xl max-w-xl text-right leading-10 -mt-3; + line-height: 3.5rem; + } + .description { + @apply mt-0 ml-6; + } +} + +@screen xl { + .title { + @apply text-6xl; + } +} diff --git a/site/components/ui/Hero/Hero.tsx b/site/components/ui/Hero/Hero.tsx new file mode 100644 index 0000000..58d13e5 --- /dev/null +++ b/site/components/ui/Hero/Hero.tsx @@ -0,0 +1,33 @@ +import React, { FC } from 'react' +import { Container } from '@components/ui' +import { ArrowRight } from '@components/icons' +import s from './Hero.module.css' +import Link from 'next/link' +interface HeroProps { + className?: string + headline: string + description: string +} + +const Hero: FC = ({ headline, description }) => { + return ( +
    + +
    +

    {headline}

    +
    +

    {description}

    + + + Read it here + + + +
    +
    +
    +
    + ) +} + +export default Hero diff --git a/site/components/ui/Hero/index.ts b/site/components/ui/Hero/index.ts new file mode 100644 index 0000000..b08fa5a --- /dev/null +++ b/site/components/ui/Hero/index.ts @@ -0,0 +1 @@ +export { default } from './Hero' diff --git a/site/components/ui/Input/Input.module.css b/site/components/ui/Input/Input.module.css new file mode 100644 index 0000000..34507f4 --- /dev/null +++ b/site/components/ui/Input/Input.module.css @@ -0,0 +1,7 @@ +.root { + @apply bg-primary py-2 px-6 w-full appearance-none transition duration-150 ease-in-out pr-10 border border-accent-3 text-accent-6; +} + +.root:focus { + @apply outline-none shadow-outline-normal; +} diff --git a/site/components/ui/Input/Input.tsx b/site/components/ui/Input/Input.tsx new file mode 100644 index 0000000..8a17588 --- /dev/null +++ b/site/components/ui/Input/Input.tsx @@ -0,0 +1,37 @@ +import cn from 'clsx' +import s from './Input.module.css' +import React, { InputHTMLAttributes } from 'react' + +export interface InputProps extends InputHTMLAttributes { + className?: string + onChange?: (...args: any[]) => any +} + +const Input: React.FC = (props) => { + const { className, children, onChange, ...rest } = props + + const rootClassName = cn(s.root, {}, className) + + const handleOnChange = (e: any) => { + if (onChange) { + onChange(e.target.value) + } + return null + } + + return ( + + ) +} + +export default Input diff --git a/site/components/ui/Input/index.ts b/site/components/ui/Input/index.ts new file mode 100644 index 0000000..aa97178 --- /dev/null +++ b/site/components/ui/Input/index.ts @@ -0,0 +1 @@ +export { default } from './Input' diff --git a/site/components/ui/Link/Link.tsx b/site/components/ui/Link/Link.tsx new file mode 100644 index 0000000..27f30e8 --- /dev/null +++ b/site/components/ui/Link/Link.tsx @@ -0,0 +1,11 @@ +import NextLink, { LinkProps as NextLinkProps } from 'next/link' + +const Link: React.FC = ({ href, children, ...props }) => { + return ( + + {children} + + ) +} + +export default Link diff --git a/site/components/ui/Link/index.ts b/site/components/ui/Link/index.ts new file mode 100644 index 0000000..518d372 --- /dev/null +++ b/site/components/ui/Link/index.ts @@ -0,0 +1 @@ +export { default } from './Link' diff --git a/site/components/ui/LoadingDots/LoadingDots.module.css b/site/components/ui/LoadingDots/LoadingDots.module.css new file mode 100644 index 0000000..6054de3 --- /dev/null +++ b/site/components/ui/LoadingDots/LoadingDots.module.css @@ -0,0 +1,33 @@ +.root { + @apply inline-flex text-center items-center leading-7; +} + +.root .dot { + @apply rounded-full h-2 w-2; + background-color: currentColor; + animation-name: blink; + animation-duration: 1.4s; + animation-iteration-count: infinite; + animation-fill-mode: both; + margin: 0 2px; +} + +.root .dot:nth-of-type(2) { + animation-delay: 0.2s; +} + +.root .dot::nth-of-type(3) { + animation-delay: 0.4s; +} + +@keyframes blink { + 0% { + opacity: 0.2; + } + 20% { + opacity: 1; + } + 100% { + opacity: 0.2; + } +} diff --git a/site/components/ui/LoadingDots/LoadingDots.tsx b/site/components/ui/LoadingDots/LoadingDots.tsx new file mode 100644 index 0000000..27ce9f2 --- /dev/null +++ b/site/components/ui/LoadingDots/LoadingDots.tsx @@ -0,0 +1,13 @@ +import s from './LoadingDots.module.css' + +const LoadingDots: React.FC = () => { + return ( + + + + + + ) +} + +export default LoadingDots diff --git a/site/components/ui/LoadingDots/index.ts b/site/components/ui/LoadingDots/index.ts new file mode 100644 index 0000000..63df282 --- /dev/null +++ b/site/components/ui/LoadingDots/index.ts @@ -0,0 +1 @@ +export { default } from './LoadingDots' diff --git a/site/components/ui/Logo/Logo.tsx b/site/components/ui/Logo/Logo.tsx new file mode 100644 index 0000000..f15bde4 --- /dev/null +++ b/site/components/ui/Logo/Logo.tsx @@ -0,0 +1,21 @@ +const Logo = ({ className = '', ...props }) => ( + + + + +) + +export default Logo diff --git a/site/components/ui/Logo/index.ts b/site/components/ui/Logo/index.ts new file mode 100644 index 0000000..93dce23 --- /dev/null +++ b/site/components/ui/Logo/index.ts @@ -0,0 +1 @@ +export { default } from './Logo' diff --git a/site/components/ui/Marquee/Marquee.module.css b/site/components/ui/Marquee/Marquee.module.css new file mode 100644 index 0000000..e5ecb16 --- /dev/null +++ b/site/components/ui/Marquee/Marquee.module.css @@ -0,0 +1,22 @@ +.root { + @apply w-full min-w-full relative flex flex-row items-center overflow-hidden py-0; + max-height: 320px; +} + +.root > div { + max-height: 320px; + padding: 0; + margin: 0; +} + +.root > div > * > *:nth-child(2) * { + max-height: 100%; +} + +.primary { + @apply bg-accent-0; +} + +.secondary { + @apply bg-accent-9; +} diff --git a/site/components/ui/Marquee/Marquee.tsx b/site/components/ui/Marquee/Marquee.tsx new file mode 100644 index 0000000..cf5bd43 --- /dev/null +++ b/site/components/ui/Marquee/Marquee.tsx @@ -0,0 +1,39 @@ +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' + +interface MarqueeProps { + className?: string + children?: ReactNode[] | Component[] | any[] + variant?: 'primary' | 'secondary' +} + +const Marquee: FC = ({ + className = '', + children, + variant = 'primary', +}) => { + const rootClassName = cn( + s.root, + { + [s.primary]: variant === 'primary', + [s.secondary]: variant === 'secondary', + }, + className + ) + + return ( + + {Children.map(children, (child) => ({ + ...child, + props: { + ...child.props, + className: cn(child.props.className, `${variant}`), + }, + }))} + + ) +} + +export default Marquee diff --git a/site/components/ui/Marquee/index.ts b/site/components/ui/Marquee/index.ts new file mode 100644 index 0000000..b59b755 --- /dev/null +++ b/site/components/ui/Marquee/index.ts @@ -0,0 +1 @@ +export { default } from './Marquee' diff --git a/site/components/ui/Modal/Modal.module.css b/site/components/ui/Modal/Modal.module.css new file mode 100644 index 0000000..f30d7c9 --- /dev/null +++ b/site/components/ui/Modal/Modal.module.css @@ -0,0 +1,17 @@ +.root { + @apply fixed bg-black bg-opacity-40 flex items-center inset-0 z-50 justify-center; + backdrop-filter: blur(0.8px); + -webkit-backdrop-filter: blur(0.8px); +} + +.modal { + @apply bg-primary p-12 border border-accent-2 relative; +} + +.modal:focus { + @apply outline-none; +} + +.close { + @apply hover:text-accent-5 transition ease-in-out duration-150 focus:outline-none absolute right-0 top-0 m-6; +} diff --git a/site/components/ui/Modal/Modal.tsx b/site/components/ui/Modal/Modal.tsx new file mode 100644 index 0000000..40ed3b3 --- /dev/null +++ b/site/components/ui/Modal/Modal.tsx @@ -0,0 +1,55 @@ +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 } from 'body-scroll-lock' + +interface ModalProps { + className?: string + children?: any + onClose: () => void + onEnter?: () => void | null +} + +const Modal: FC = ({ children, onClose }) => { + const ref = useRef() as React.MutableRefObject + + const handleKey = useCallback( + (e: KeyboardEvent) => { + if (e.key === 'Escape') { + return onClose() + } + }, + [onClose] + ) + + useEffect(() => { + const modal = ref.current + + if (modal) { + disableBodyScroll(modal, { reserveScrollBarGap: true }) + window.addEventListener('keydown', handleKey) + } + return () => { + clearAllBodyScrollLocks() + window.removeEventListener('keydown', handleKey) + } + }, [handleKey]) + + return ( +
    +
    + + {children} +
    +
    + ) +} + +export default Modal diff --git a/site/components/ui/Modal/index.ts b/site/components/ui/Modal/index.ts new file mode 100644 index 0000000..e24753a --- /dev/null +++ b/site/components/ui/Modal/index.ts @@ -0,0 +1 @@ +export { default } from './Modal' diff --git a/site/components/ui/Quantity/Quantity.module.css b/site/components/ui/Quantity/Quantity.module.css new file mode 100644 index 0000000..fa60cc5 --- /dev/null +++ b/site/components/ui/Quantity/Quantity.module.css @@ -0,0 +1,27 @@ +.actions { + @apply flex p-1 border-accent-2 border items-center justify-center + w-12 text-accent-7; + transition-property: border-color, background, color, transform, box-shadow; + + transition-duration: 0.15s; + transition-timing-function: ease; + user-select: none; +} + +.actions:hover { + @apply border bg-accent-1 border-accent-3 text-accent-9; + transition: border-color; + z-index: 10; +} + +.actions:focus { + @apply outline-none; +} + +.actions:disabled { + @apply cursor-not-allowed; +} + +.input { + @apply bg-transparent px-4 w-full h-full focus:outline-none select-none pointer-events-auto; +} diff --git a/site/components/ui/Quantity/Quantity.tsx b/site/components/ui/Quantity/Quantity.tsx new file mode 100644 index 0000000..7317ddb --- /dev/null +++ b/site/components/ui/Quantity/Quantity.tsx @@ -0,0 +1,62 @@ +import React, { FC } from 'react' +import s from './Quantity.module.css' +import { Cross, Plus, Minus } from '@components/icons' +import cn from 'clsx' +export interface QuantityProps { + value: number + increase: () => any + decrease: () => any + handleRemove: React.MouseEventHandler + handleChange: React.ChangeEventHandler + max?: number +} + +const Quantity: FC = ({ + value, + increase, + decrease, + handleChange, + handleRemove, + max = 6, +}) => { + return ( +
    + + + + +
    + ) +} + +export default Quantity diff --git a/site/components/ui/Quantity/index.ts b/site/components/ui/Quantity/index.ts new file mode 100644 index 0000000..5ee880c --- /dev/null +++ b/site/components/ui/Quantity/index.ts @@ -0,0 +1,2 @@ +export { default } from './Quantity' +export * from './Quantity' diff --git a/site/components/ui/README.md b/site/components/ui/README.md new file mode 100644 index 0000000..5bf4fe5 --- /dev/null +++ b/site/components/ui/README.md @@ -0,0 +1,3 @@ +# UI + +Building blocks to build a rich graphical interfaces. Components should be atomic and pure. Serve one purpose. diff --git a/site/components/ui/Rating/Rating.module.css b/site/components/ui/Rating/Rating.module.css new file mode 100644 index 0000000..e69de29 diff --git a/site/components/ui/Rating/Rating.tsx b/site/components/ui/Rating/Rating.tsx new file mode 100644 index 0000000..efd2ca0 --- /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/site/components/ui/Rating/index.ts b/site/components/ui/Rating/index.ts new file mode 100644 index 0000000..1354efb --- /dev/null +++ b/site/components/ui/Rating/index.ts @@ -0,0 +1,2 @@ +export { default } from './Rating' +export * from './Rating' diff --git a/site/components/ui/Sidebar/Sidebar.module.css b/site/components/ui/Sidebar/Sidebar.module.css new file mode 100644 index 0000000..71a8599 --- /dev/null +++ b/site/components/ui/Sidebar/Sidebar.module.css @@ -0,0 +1,14 @@ +.root { + @apply fixed inset-0 h-full z-50 box-border outline-none; +} + +.sidebar { + @apply h-full flex flex-col text-base bg-accent-0 shadow-xl overflow-y-auto overflow-x-hidden; + -webkit-overflow-scrolling: touch !important; +} + +.backdrop { + @apply absolute inset-0 bg-black bg-opacity-40 duration-100 ease-linear; + backdrop-filter: blur(0.8px); + -webkit-backdrop-filter: blur(0.8px); +} diff --git a/site/components/ui/Sidebar/Sidebar.tsx b/site/components/ui/Sidebar/Sidebar.tsx new file mode 100644 index 0000000..3c01cbd --- /dev/null +++ b/site/components/ui/Sidebar/Sidebar.tsx @@ -0,0 +1,57 @@ +import cn from 'clsx' +import s from './Sidebar.module.css' +import { useEffect, useRef } from 'react' +import { disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock' +interface SidebarProps { + children: any + onClose: () => void +} + +const Sidebar: React.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/site/components/ui/Sidebar/index.ts b/site/components/ui/Sidebar/index.ts new file mode 100644 index 0000000..877187c --- /dev/null +++ b/site/components/ui/Sidebar/index.ts @@ -0,0 +1 @@ +export { default } from './Sidebar' diff --git a/site/components/ui/Skeleton/Skeleton.module.css b/site/components/ui/Skeleton/Skeleton.module.css new file mode 100644 index 0000000..37c164d --- /dev/null +++ b/site/components/ui/Skeleton/Skeleton.module.css @@ -0,0 +1,48 @@ +.skeleton { + @apply block; + background-image: linear-gradient( + 270deg, + var(--accent-0), + var(--accent-2), + var(--accent-0), + var(--accent-1) + ); + background-size: 400% 100%; + animation: loading 8s ease-in-out infinite; +} + +.wrapper { + @apply block relative; + + &:not(.show)::before { + content: none; + } + + &::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 100; + background-image: linear-gradient( + 270deg, + var(--accent-0), + var(--accent-2), + var(--accent-0), + var(--accent-1) + ); + background-size: 400% 100%; + animation: loading 8s ease-in-out infinite; + } +} + +@keyframes loading { + 0% { + background-position: 200% 0; + } + 100% { + background-position: -200% 0; + } +} diff --git a/site/components/ui/Skeleton/Skeleton.tsx b/site/components/ui/Skeleton/Skeleton.tsx new file mode 100644 index 0000000..f4ca677 --- /dev/null +++ b/site/components/ui/Skeleton/Skeleton.tsx @@ -0,0 +1,57 @@ +import React, { CSSProperties } from 'react' +import cn from 'clsx' +import px from '@lib/to-pixels' +import s from './Skeleton.module.css' + +interface SkeletonProps { + show?: boolean + block?: boolean + className?: string + style?: CSSProperties + width?: string | number + height?: string | number + boxHeight?: string | number +} + +const Skeleton: React.FC = ({ + style, + width, + height, + children, + className, + show = true, + boxHeight = height, +}) => { + // Automatically calculate the size if there are children + // and no fixed sizes are specified + const shouldAutoSize = !!children && !(width || height) + + // Defaults + width = width || 24 + height = height || 24 + boxHeight = boxHeight || height + + return ( + + {children} + + ) +} + +export default Skeleton diff --git a/site/components/ui/Skeleton/index.ts b/site/components/ui/Skeleton/index.ts new file mode 100644 index 0000000..3ec6c00 --- /dev/null +++ b/site/components/ui/Skeleton/index.ts @@ -0,0 +1 @@ +export { default } from './Skeleton' diff --git a/site/components/ui/Text/Text.module.css b/site/components/ui/Text/Text.module.css new file mode 100644 index 0000000..dd35ff6 --- /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/site/components/ui/Text/Text.tsx b/site/components/ui/Text/Text.tsx new file mode 100644 index 0000000..486b77d --- /dev/null +++ b/site/components/ui/Text/Text.tsx @@ -0,0 +1,70 @@ +import React, { + FunctionComponent, + JSXElementConstructor, + CSSProperties, +} from 'react' +import cn from 'clsx' +import s from './Text.module.css' + +interface TextProps { + variant?: Variant + className?: string + style?: CSSProperties + children?: React.ReactNode | any + html?: string + onClick?: () => any +} + +type Variant = 'heading' | 'body' | 'pageHeading' | 'sectionHeading' + +const Text: FunctionComponent = ({ + style, + className = '', + variant = 'body', + children, + html, + onClick, +}) => { + const componentsMap: { + [P in Variant]: React.ComponentType | string + } = { + body: 'div', + heading: 'h1', + pageHeading: 'h1', + sectionHeading: 'h2', + } + + const Component: + | JSXElementConstructor + | React.ReactElement + | React.ComponentType + | string = componentsMap![variant!] + + const htmlContentProps = html + ? { + dangerouslySetInnerHTML: { __html: html }, + } + : {} + + return ( + + {children} + + ) +} + +export default Text diff --git a/site/components/ui/Text/index.ts b/site/components/ui/Text/index.ts new file mode 100644 index 0000000..e1e5fa7 --- /dev/null +++ b/site/components/ui/Text/index.ts @@ -0,0 +1 @@ +export { default } from './Text' diff --git a/site/components/ui/context.tsx b/site/components/ui/context.tsx new file mode 100644 index 0000000..ca2bfd7 --- /dev/null +++ b/site/components/ui/context.tsx @@ -0,0 +1,216 @@ +import React, { FC, useCallback, useMemo } from 'react' +import { ThemeProvider } from 'next-themes' + +export interface State { + displaySidebar: boolean + displayDropdown: boolean + displayModal: boolean + sidebarView: string + modalView: string + userAvatar: string +} + +const initialState = { + displaySidebar: false, + displayDropdown: false, + displayModal: false, + modalView: 'LOGIN_VIEW', + sidebarView: 'CART_VIEW', + userAvatar: '', +} + +type Action = + | { + type: 'OPEN_SIDEBAR' + } + | { + type: 'CLOSE_SIDEBAR' + } + | { + type: 'OPEN_DROPDOWN' + } + | { + type: 'CLOSE_DROPDOWN' + } + | { + type: 'OPEN_MODAL' + } + | { + type: 'CLOSE_MODAL' + } + | { + type: 'SET_MODAL_VIEW' + view: MODAL_VIEWS + } + | { + type: 'SET_SIDEBAR_VIEW' + view: SIDEBAR_VIEWS + } + | { + type: 'SET_USER_AVATAR' + value: string + } + +type MODAL_VIEWS = + | 'SIGNUP_VIEW' + | 'LOGIN_VIEW' + | 'FORGOT_VIEW' + | 'NEW_SHIPPING_ADDRESS' + | 'NEW_PAYMENT_METHOD' + +type SIDEBAR_VIEWS = 'CART_VIEW' | 'CHECKOUT_VIEW' | 'PAYMENT_METHOD_VIEW' + +export const UIContext = React.createContext(initialState) + +UIContext.displayName = 'UIContext' + +function uiReducer(state: State, action: Action) { + switch (action.type) { + case 'OPEN_SIDEBAR': { + return { + ...state, + displaySidebar: true, + } + } + case 'CLOSE_SIDEBAR': { + return { + ...state, + displaySidebar: false, + } + } + case 'OPEN_DROPDOWN': { + return { + ...state, + displayDropdown: true, + } + } + case 'CLOSE_DROPDOWN': { + return { + ...state, + displayDropdown: false, + } + } + case 'OPEN_MODAL': { + return { + ...state, + displayModal: true, + displaySidebar: false, + } + } + case 'CLOSE_MODAL': { + return { + ...state, + displayModal: false, + } + } + case 'SET_MODAL_VIEW': { + return { + ...state, + modalView: action.view, + } + } + case 'SET_SIDEBAR_VIEW': { + return { + ...state, + sidebarView: action.view, + } + } + case 'SET_USER_AVATAR': { + return { + ...state, + userAvatar: action.value, + } + } + } +} + +export const UIProvider: FC = (props) => { + const [state, dispatch] = React.useReducer(uiReducer, initialState) + + const openSidebar = useCallback( + () => dispatch({ type: 'OPEN_SIDEBAR' }), + [dispatch] + ) + const closeSidebar = useCallback( + () => dispatch({ type: 'CLOSE_SIDEBAR' }), + [dispatch] + ) + const toggleSidebar = useCallback( + () => + state.displaySidebar + ? dispatch({ type: 'CLOSE_SIDEBAR' }) + : dispatch({ type: 'OPEN_SIDEBAR' }), + [dispatch, state.displaySidebar] + ) + const closeSidebarIfPresent = useCallback( + () => state.displaySidebar && dispatch({ type: 'CLOSE_SIDEBAR' }), + [dispatch, state.displaySidebar] + ) + + const openDropdown = useCallback( + () => dispatch({ type: 'OPEN_DROPDOWN' }), + [dispatch] + ) + const closeDropdown = useCallback( + () => dispatch({ type: 'CLOSE_DROPDOWN' }), + [dispatch] + ) + + const openModal = useCallback( + () => dispatch({ type: 'OPEN_MODAL' }), + [dispatch] + ) + const closeModal = useCallback( + () => dispatch({ type: 'CLOSE_MODAL' }), + [dispatch] + ) + + const setUserAvatar = useCallback( + (value: string) => dispatch({ type: 'SET_USER_AVATAR', value }), + [dispatch] + ) + + const setModalView = useCallback( + (view: MODAL_VIEWS) => dispatch({ type: 'SET_MODAL_VIEW', view }), + [dispatch] + ) + + const setSidebarView = useCallback( + (view: SIDEBAR_VIEWS) => dispatch({ type: 'SET_SIDEBAR_VIEW', view }), + [dispatch] + ) + + const value = useMemo( + () => ({ + ...state, + openSidebar, + closeSidebar, + toggleSidebar, + closeSidebarIfPresent, + openDropdown, + closeDropdown, + openModal, + closeModal, + setModalView, + setSidebarView, + setUserAvatar, + }), + [state] + ) + + return +} + +export const useUI = () => { + const context = React.useContext(UIContext) + if (context === undefined) { + throw new Error(`useUI must be used within a UIProvider`) + } + return context +} + +export const ManagedUIContext: FC = ({ children }) => ( + + {children} + +) diff --git a/site/components/ui/index.ts b/site/components/ui/index.ts new file mode 100644 index 0000000..e4b37af --- /dev/null +++ b/site/components/ui/index.ts @@ -0,0 +1,17 @@ +export { default as Hero } from './Hero' +export { default as Logo } from './Logo' +export { default as Grid } from './Grid' +export { default as Button } from './Button' +export { default as Sidebar } from './Sidebar' +export { default as Marquee } from './Marquee' +export { default as Container } from './Container' +export { default as LoadingDots } from './LoadingDots' +export { default as Skeleton } from './Skeleton' +export { default as Modal } from './Modal' +export { default as Text } from './Text' +export { default as Input } from './Input' +export { default as Collapse } from './Collapse' +export { default as Quantity } from './Quantity' +export { default as Rating } from './Rating' +export * from './Dropdown/Dropdown' +export { useUI } from './context' diff --git a/site/components/wishlist/WishlistButton/WishlistButton.module.css b/site/components/wishlist/WishlistButton/WishlistButton.module.css new file mode 100644 index 0000000..3bdf1e7 --- /dev/null +++ b/site/components/wishlist/WishlistButton/WishlistButton.module.css @@ -0,0 +1,33 @@ +.root { + transition-duration: 0.2s; + transition-timing-function: ease; + transition-property: color, background-color, opacity; + @apply p-3 text-accent-9 flex items-center + justify-center font-semibold cursor-pointer + bg-accent-0 text-sm; +} + +.root:focus { + @apply outline-none; +} + +.icon { + transition-duration: 0.2s; + transition-timing-function: ease; + transition-property: transform, fill; + color: currentColor; +} + +.icon.loading { + fill: var(--pink-light); +} + +.icon.inWishlist { + fill: var(--pink); +} + +@screen lg { + .root { + @apply p-4; + } +} diff --git a/site/components/wishlist/WishlistButton/WishlistButton.tsx b/site/components/wishlist/WishlistButton/WishlistButton.tsx new file mode 100644 index 0000000..f4e0fb3 --- /dev/null +++ b/site/components/wishlist/WishlistButton/WishlistButton.tsx @@ -0,0 +1,84 @@ +import React, { FC, useState } from 'react' +import cn from 'clsx' +import { useUI } from '@components/ui' +import { Heart } from '@components/icons' +import useAddItem from '@framework/wishlist/use-add-item' +import useCustomer from '@framework/customer/use-customer' +import useWishlist from '@framework/wishlist/use-wishlist' +import useRemoveItem from '@framework/wishlist/use-remove-item' +import s from './WishlistButton.module.css' +import type { Product, ProductVariant } from '@commerce/types/product' + +type Props = { + productId: Product['id'] + variant: ProductVariant +} & React.ButtonHTMLAttributes + +const WishlistButton: FC = ({ + productId, + variant, + className, + ...props +}) => { + const { data } = useWishlist() + const addItem = useAddItem() + const removeItem = useRemoveItem() + const { data: customer } = useCustomer() + const { openModal, setModalView } = useUI() + const [loading, setLoading] = useState(false) + + // @ts-ignore Wishlist is not always enabled + const itemInWishlist = data?.items?.find( + // @ts-ignore Wishlist is not always enabled + (item) => + item.product_id === Number(productId) && + item.variant_id === Number(variant.id) + ) + + const handleWishlistChange = async (e: any) => { + e.preventDefault() + + if (loading) return + + // A login is required before adding an item to the wishlist + if (!customer) { + setModalView('LOGIN_VIEW') + return openModal() + } + + setLoading(true) + + try { + if (itemInWishlist) { + await removeItem({ id: itemInWishlist.id! }) + } else { + await addItem({ + productId, + variantId: variant?.id!, + }) + } + + setLoading(false) + } catch (err) { + setLoading(false) + } + } + + return ( + + ) +} + +export default WishlistButton diff --git a/site/components/wishlist/WishlistButton/index.ts b/site/components/wishlist/WishlistButton/index.ts new file mode 100644 index 0000000..66e8807 --- /dev/null +++ b/site/components/wishlist/WishlistButton/index.ts @@ -0,0 +1 @@ +export { default } from './WishlistButton' diff --git a/site/components/wishlist/WishlistCard/WishlistCard.module.css b/site/components/wishlist/WishlistCard/WishlistCard.module.css new file mode 100644 index 0000000..fb2d026 --- /dev/null +++ b/site/components/wishlist/WishlistCard/WishlistCard.module.css @@ -0,0 +1,38 @@ +.root { + @apply relative grid sm:grid-cols-1 lg:grid-cols-12 + w-full gap-6 px-3 py-6 border-b border-accent-2 + transition duration-100 ease-in-out; +} + +.root:nth-child(3n + 1) .imageWrapper { + @apply bg-violet; +} + +.root:nth-child(3n + 2) .imageWrapper { + @apply bg-pink; +} + +.root:nth-child(3n + 3) .imageWrapper { + @apply bg-blue; +} + +.imageWrapper { + @apply col-span-3; + min-width: 230px; + width: 230px; + height: 230px; +} + +.description { + @apply col-span-7 flex flex-col; +} + +.actions { + @apply absolute bg-accent-0 p-3 top-0 right-4; +} + +@media screen(lg) { + .actions { + @apply static col-span-2 flex flex-col justify-between space-y-4; + } +} diff --git a/site/components/wishlist/WishlistCard/WishlistCard.tsx b/site/components/wishlist/WishlistCard/WishlistCard.tsx new file mode 100644 index 0000000..6af6c91 --- /dev/null +++ b/site/components/wishlist/WishlistCard/WishlistCard.tsx @@ -0,0 +1,108 @@ +import { FC, useState } from 'react' +import cn from 'clsx' +import Link from 'next/link' +import Image from 'next/image' +import s from './WishlistCard.module.css' +import { Trash } from '@components/icons' +import { Button, Text } from '@components/ui' + +import { useUI } from '@components/ui/context' +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' + +const placeholderImg = '/product-img-placeholder.svg' + +const WishlistCard: React.FC<{ + item: Wishlist +}> = ({ item }) => { + const product: Product = item.product + const { price } = usePrice({ + amount: product.price?.value, + baseAmount: product.price?.retailPrice, + currencyCode: product.price?.currencyCode!, + }) + // @ts-ignore Wishlist is not always enabled + const removeItem = useRemoveItem({ wishlist: { includeProducts: true } }) + const [loading, setLoading] = useState(false) + const [removing, setRemoving] = useState(false) + + // TODO: fix this missing argument issue + /* @ts-ignore */ + const addItem = useAddItem() + const { openSidebar } = useUI() + + const handleRemove = async () => { + setRemoving(true) + + 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: item.id! }) + } catch (error) { + setRemoving(false) + } + } + const addToCart = async () => { + setLoading(true) + try { + await addItem({ + productId: String(product.id), + variantId: String(product.variants[0].id), + }) + openSidebar() + setLoading(false) + } catch (err) { + setLoading(false) + } + } + + return ( +
    +
    + {product.images[0]?.alt +
    + +
    +
    +

    + + {product.name} + +

    +
    + +
    +
    +
    + +
    +
    +
    +
    {price}
    +
    + +
    +
    +
    + ) +} + +export default WishlistCard diff --git a/site/components/wishlist/WishlistCard/index.ts b/site/components/wishlist/WishlistCard/index.ts new file mode 100644 index 0000000..ef57280 --- /dev/null +++ b/site/components/wishlist/WishlistCard/index.ts @@ -0,0 +1 @@ +export { default } from './WishlistCard' diff --git a/site/components/wishlist/index.ts b/site/components/wishlist/index.ts new file mode 100644 index 0000000..8aee9f8 --- /dev/null +++ b/site/components/wishlist/index.ts @@ -0,0 +1,2 @@ +export { default as WishlistCard } from './WishlistCard' +export { default as WishlistButton } from './WishlistButton' diff --git a/site/config/seo_meta.json b/site/config/seo_meta.json new file mode 100644 index 0000000..c9c5fc2 --- /dev/null +++ b/site/config/seo_meta.json @@ -0,0 +1,25 @@ +{ + "title": "ACME Storefront | Powered by Next.js Commerce", + "titleTemplate": "%s - ACME Storefront", + "description": "Next.js Commerce - https://www.nextjs.org/commerce", + "openGraph": { + "title": "ACME Storefront | Powered by Next.js Commerce", + "description": "Next.js Commerce - https://www.nextjs.org/commerce", + "type": "website", + "url": "https://nextjs.org/commerce", + "site_name": "Next.js Commerce", + "images": [ + { + "url": "/card.png", + "width": "800", + "height": "600", + "alt": "Next.js Commerce" + } + ] + }, + "twitter": { + "handle": "@nextjs", + "site": "@nextjs", + "cardType": "summary_large_image" + } +} diff --git a/site/global.d.ts b/site/global.d.ts new file mode 100644 index 0000000..498a1f9 --- /dev/null +++ b/site/global.d.ts @@ -0,0 +1,2 @@ +// Declarations for modules without types +declare module 'next-themes' diff --git a/site/lib/addqueries/collections.js b/site/lib/addqueries/collections.js new file mode 100644 index 0000000..353f5ac --- /dev/null +++ b/site/lib/addqueries/collections.js @@ -0,0 +1,44 @@ +export const getCollections = `query getProduct($slug: String!) { + product(slug: $slug) { + id + name + slug + description + assets { + id + preview + name + } + collections { + name + slug + } + variants { + id + priceWithTax + currencyCode + options { + id + name + code + groupId + group { + id + options { + name + } + } + } + } + optionGroups { + id + code + name + options { + id + name + } + } + } + } + ` \ No newline at end of file diff --git a/site/lib/api/commerce.ts b/site/lib/api/commerce.ts new file mode 100644 index 0000000..3330bde --- /dev/null +++ b/site/lib/api/commerce.ts @@ -0,0 +1,10 @@ +import { getCommerceApi } from '@framework/api' + +export default getCommerceApi() + +export const testApi = () => { + const url = process.env.NEXT_PUBLIC_VENDURE_SHOP_API_URL; + const token = process.env.VENDURE_TOKEN; + + return fetch(`${url}?vendure-token=${token}`); +}; \ No newline at end of file diff --git a/site/lib/click-outside/click-outside.tsx b/site/lib/click-outside/click-outside.tsx new file mode 100644 index 0000000..973345b --- /dev/null +++ b/site/lib/click-outside/click-outside.tsx @@ -0,0 +1,83 @@ +import React, { + useRef, + useEffect, + MouseEvent, + FC, + ReactElement, + forwardRef, + Ref, +} from 'react' +import mergeRefs from 'react-merge-refs' +import hasParent from './has-parent' + +interface ClickOutsideProps { + active: boolean + onClick: (e?: MouseEvent) => void + ref?: Ref +} + +/** + * Use forward ref to allow this component to be used with other components like + * focus-trap-react, that rely on the same type of ref forwarding to direct children + */ +const ClickOutside: FC = forwardRef( + ({ active = true, onClick, children }, forwardedRef) => { + const innerRef = useRef() + + const child = children ? (React.Children.only(children) as any) : undefined + + if (!child || child.type === React.Fragment) { + /** + * React Fragments can't be used, as it would not be possible to pass the ref + * created here to them. + */ + throw new Error('A valid non Fragment React Children should be provided') + } + + if (typeof onClick != 'function') { + throw new Error('onClick must be a valid function') + } + + useEffect(() => { + if (active) { + document.addEventListener('mousedown', handleClick) + document.addEventListener('touchstart', handleClick) + } + return () => { + if (active) { + document.removeEventListener('mousedown', handleClick) + document.removeEventListener('touchstart', handleClick) + } + } + }) + + const handleClick = (event: any) => { + /** + * Check if the clicked element is contained by the top level tag provided to the + * ClickOutside component, if not, Outside clicked! Fire onClick cb + */ + if (!hasParent(event.target, innerRef?.current)) { + onClick(event) + } + } + + /** + * Preserve the child ref prop if exists and merge it with the one used here and the + * proxied by the forwardRef method + */ + const composedRefCallback = (element: ReactElement) => { + if (typeof child.ref === 'function') { + child.ref(element) + } else if (child.ref) { + child.ref.current = element + } + } + + return React.cloneElement(child, { + ref: mergeRefs([composedRefCallback, innerRef, forwardedRef]), + }) + } +) + +ClickOutside.displayName = 'ClickOutside' +export default ClickOutside diff --git a/site/lib/click-outside/has-parent.js b/site/lib/click-outside/has-parent.js new file mode 100644 index 0000000..06cd3ca --- /dev/null +++ b/site/lib/click-outside/has-parent.js @@ -0,0 +1,5 @@ +import isInDOM from './is-in-dom' + +export default function hasParent(element, root) { + return root && root.contains(element) && isInDOM(element) +} diff --git a/site/lib/click-outside/index.ts b/site/lib/click-outside/index.ts new file mode 100644 index 0000000..2df916f --- /dev/null +++ b/site/lib/click-outside/index.ts @@ -0,0 +1 @@ +export { default } from './click-outside' diff --git a/site/lib/click-outside/is-in-dom.js b/site/lib/click-outside/is-in-dom.js new file mode 100644 index 0000000..5d7438e --- /dev/null +++ b/site/lib/click-outside/is-in-dom.js @@ -0,0 +1,3 @@ +export default function isInDom(obj) { + return Boolean(obj.closest('body')) +} diff --git a/site/lib/colors.ts b/site/lib/colors.ts new file mode 100644 index 0000000..43947c3 --- /dev/null +++ b/site/lib/colors.ts @@ -0,0 +1,206 @@ +import random from 'lodash.random' + +export function getRandomPairOfColors() { + const colors = ['#37B679', '#DA3C3C', '#3291FF', '#7928CA', '#79FFE1'] + const getRandomIdx = () => random(0, colors.length - 1) + let idx = getRandomIdx() + let idx2 = getRandomIdx() + + // Has to be a different color + while (idx2 === idx) { + idx2 = getRandomIdx() + } + + // Returns a pair of colors + return [colors[idx], colors[idx2]] +} + +function hexToRgb(hex: string = '') { + // @ts-ignore + const match = hex.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i) + + if (!match) { + return [0, 0, 0] + } + + let colorString = match[0] + + if (match[0].length === 3) { + colorString = colorString + .split('') + .map((char: string) => { + return char + char + }) + .join('') + } + + const integer = parseInt(colorString, 16) + const r = (integer >> 16) & 0xff + const g = (integer >> 8) & 0xff + const b = integer & 0xff + + return [r, g, b] +} + +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', +} + +export function isDark(color: string = ''): boolean { + color = color.toLowerCase() + // Equation from http://24ways.org/2010/calculating-color-contrast + let rgb = colorMap[color] ? hexToRgb(colorMap[color]) : hexToRgb(color) + const res = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000 + return res < 128 +} diff --git a/site/lib/context/AppContext.js b/site/lib/context/AppContext.js new file mode 100644 index 0000000..d4179ab --- /dev/null +++ b/site/lib/context/AppContext.js @@ -0,0 +1,25 @@ +import React , {useState,useEffect} from "react"; + +export const AppContext = React.createContext([ + {}, + () => { } +]); + +export const AppProvider = (props) => { + + const [cart, setCart] = useState(null); + useEffect(() => { + if (process.browser) { + let cartData = localStorage.getItem('woo-next-cart'); + cartData = null !== cartData ? JSON.parse(cartData) : ''; + setCart(cartData); + } + }, []); + + return ( + + {props.children} + + ); + +}; \ No newline at end of file diff --git a/site/lib/focus-trap.tsx b/site/lib/focus-trap.tsx new file mode 100644 index 0000000..d886d6d --- /dev/null +++ b/site/lib/focus-trap.tsx @@ -0,0 +1,67 @@ +import React, { useEffect, RefObject } from 'react' +import { tabbable } from 'tabbable' + +interface Props { + children: React.ReactNode | any + focusFirst?: boolean +} + +export default function FocusTrap({ children, focusFirst = false }: Props) { + const root: RefObject = React.useRef() + const anchor: RefObject = React.useRef(document.activeElement) + + const returnFocus = () => { + // Returns focus to the last focused element prior to trap. + if (anchor) { + anchor.current.focus() + } + } + + const trapFocus = () => { + // Focus the container element + if (root.current) { + root.current.focus() + if (focusFirst) { + selectFirstFocusableEl() + } + } + } + + const selectFirstFocusableEl = () => { + // Try to find focusable elements, if match then focus + // Up to 6 seconds of load time threshold + let match = false + let end = 60 // Try to find match at least n times + let i = 0 + const timer = setInterval(() => { + if (!match !== i > end) { + match = !!tabbable(root.current).length + if (match) { + // Attempt to focus the first el + tabbable(root.current)[0].focus() + } + i = i + 1 + } else { + // Clear interval after n attempts + clearInterval(timer) + } + }, 100) + } + + useEffect(() => { + setTimeout(trapFocus, 20) + return () => { + returnFocus() + } + }, [root, children]) + + 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 0000000..329c5a2 --- /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/site/lib/hooks/useAcceptCookies.ts b/site/lib/hooks/useAcceptCookies.ts new file mode 100644 index 0000000..7f33adf --- /dev/null +++ b/site/lib/hooks/useAcceptCookies.ts @@ -0,0 +1,24 @@ +import Cookies from 'js-cookie' +import { useEffect, useState } from 'react' + +const COOKIE_NAME = 'accept_cookies' + +export const useAcceptCookies = () => { + const [acceptedCookies, setAcceptedCookies] = useState(true) + + useEffect(() => { + if (!Cookies.get(COOKIE_NAME)) { + setAcceptedCookies(false) + } + }, []) + + const acceptCookies = () => { + setAcceptedCookies(true) + Cookies.set(COOKIE_NAME, 'accepted', { expires: 365 }) + } + + return { + acceptedCookies, + onAcceptCookies: acceptCookies, + } +} diff --git a/site/lib/hooks/useUserAvatar.ts b/site/lib/hooks/useUserAvatar.ts new file mode 100644 index 0000000..840daae --- /dev/null +++ b/site/lib/hooks/useUserAvatar.ts @@ -0,0 +1,26 @@ +import { useEffect } from 'react' +import { useUI } from '@components/ui/context' +import { getRandomPairOfColors } from '@lib/colors' + +export const useUserAvatar = (name = 'userAvatar') => { + const { userAvatar, setUserAvatar } = useUI() + + useEffect(() => { + if (!userAvatar && localStorage.getItem(name)) { + // Get bg from localStorage and push it to the context. + setUserAvatar(localStorage.getItem(name)) + } + if (!localStorage.getItem(name)) { + // bg not set locally, generating one, setting localStorage and context to persist. + const bg = getRandomPairOfColors() + const value = `linear-gradient(140deg, ${bg[0]}, ${bg[1]} 100%)` + localStorage.setItem(name, value) + setUserAvatar(value) + } + }, []) + + return { + userAvatar, + setUserAvatar, + } +} diff --git a/site/lib/range-map.ts b/site/lib/range-map.ts new file mode 100644 index 0000000..886f20d --- /dev/null +++ b/site/lib/range-map.ts @@ -0,0 +1,7 @@ +export default function rangeMap(n: number, fn: (i: number) => any) { + const arr = [] + while (n > arr.length) { + arr.push(fn(arr.length)) + } + return arr +} diff --git a/site/lib/search-props.tsx b/site/lib/search-props.tsx new file mode 100644 index 0000000..6910e0d --- /dev/null +++ b/site/lib/search-props.tsx @@ -0,0 +1,27 @@ +import type { GetStaticPropsContext, InferGetStaticPropsType } from 'next' + +import commerce from '@lib/api/commerce' + +export async function getSearchStaticProps({ + preview, + locale, + locales, +}: GetStaticPropsContext) { + const config = { locale, locales } + const pagesPromise = commerce.getAllPages({ config, preview }) + const siteInfoPromise = commerce.getSiteInfo({ config, preview }) + const { pages } = await pagesPromise + const { categories, brands } = await siteInfoPromise + return { + props: { + pages, + categories, + brands, + }, + revalidate: 200, + } +} + +export type SearchPropsType = InferGetStaticPropsType< + typeof getSearchStaticProps +> diff --git a/site/lib/search.tsx b/site/lib/search.tsx new file mode 100644 index 0000000..eaeaf66 --- /dev/null +++ b/site/lib/search.tsx @@ -0,0 +1,52 @@ +import { useEffect, useState } from 'react' +import getSlug from './get-slug' + +export function useSearchMeta(asPath: string) { + const [pathname, setPathname] = useState('/search') + const [category, setCategory] = useState() + const [brand, setBrand] = useState() + + useEffect(() => { + // Only access asPath after hydration to avoid a server mismatch + const path = asPath.split('?')[0] + const parts = path.split('/') + + let c = parts[2] + let b = parts[3] + + if (c === 'designers') { + c = parts[4] + } + + if (path !== pathname) setPathname(path) + if (c !== category) setCategory(c) + if (b !== brand) setBrand(b) + }, [asPath, pathname, category, brand]) + + return { pathname, category, brand } +} + +// Removes empty query parameters from the query object +export const filterQuery = (query: any) => + Object.keys(query).reduce((obj, key) => { + if (query[key]?.length) { + obj[key] = query[key] + } + return obj + }, {}) + +export const getCategoryPath = (path: string, brand?: string) => { + const category = getSlug(path) + + return `/search${brand ? `/designers/${brand}` : ''}${ + category ? `/${category}` : '' + }` +} + +export const getDesignerPath = (path: string, category?: string) => { + const designer = getSlug(path).replace(/^brands/, 'designers') + + return `/search${designer ? `/${designer}` : ''}${ + category ? `/${category}` : '' + }` +} diff --git a/site/lib/to-pixels.ts b/site/lib/to-pixels.ts new file mode 100644 index 0000000..1701a85 --- /dev/null +++ b/site/lib/to-pixels.ts @@ -0,0 +1,13 @@ +// Convert numbers or strings to pixel value +// Helpful for styled-jsx when using a prop +// height: ${toPixels(height)}; (supports height={20} and height="20px") + +const toPixels = (value: string | number) => { + if (typeof value === 'number') { + return `${value}px` + } + + return value +} + +export default toPixels diff --git a/site/lib/usage-warns.ts b/site/lib/usage-warns.ts new file mode 100644 index 0000000..2033cd0 --- /dev/null +++ b/site/lib/usage-warns.ts @@ -0,0 +1,26 @@ +/** + * The utils here are used to help developers use the example + */ + +export function missingLocaleInPages(): [string[], () => void] { + const invalidPaths: string[] = [] + const log = () => { + if (invalidPaths.length) { + const single = invalidPaths.length === 1 + const pages = single ? 'page' : 'pages' + + console.log( + `The ${pages} "${invalidPaths.join(', ')}" ${ + single ? 'does' : 'do' + } not include a locale, or the locale is not supported. When using i18n, web pages from +BigCommerce are expected to have a locale or they will be ignored.\n +Please update the ${pages} to include the default locale or make the ${pages} invisible by +unchecking the "Navigation Menu" option in the settings of ${ + single ? 'the' : 'each' + } web page\n` + ) + } + } + + return [invalidPaths, log] +} diff --git a/site/next-env.d.ts b/site/next-env.d.ts new file mode 100644 index 0000000..4f11a03 --- /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/site/next.config.js b/site/next.config.js new file mode 100644 index 0000000..22ecc1e --- /dev/null +++ b/site/next.config.js @@ -0,0 +1,41 @@ +const commerce = require('./commerce.config.json') +const { withCommerceConfig, getProviderName } = require('./commerce-config') + +const provider = commerce.provider || getProviderName() +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({ + commerce, + i18n: { + locales: ['en-US', 'es'], + defaultLocale: 'en-US', + }, + rewrites() { + return [ + (isBC || isShopify || isSwell || isVendure || isSaleor) && { + source: '/checkout', + destination: '/api/checkout', + }, + // The logout is also an action so this route is not required, but it's also another way + // you can allow a logout! + isBC && { + source: '/logout', + destination: '/api/logout?redirect_to=/', + }, + // For Vendure, rewrite the local api url to the remote (external) api url. This is required + // to make the session cookies work. + isVendure && + process.env.NEXT_PUBLIC_VENDURE_LOCAL_URL && { + source: `${process.env.NEXT_PUBLIC_VENDURE_LOCAL_URL}/:path*`, + destination: `${process.env.NEXT_PUBLIC_VENDURE_SHOP_API_URL}/:path*`, + }, + ].filter(Boolean) + }, +}) + +// Don't delete this console log, useful to see the commerce config in Vercel deployments +console.log('next.config.js', JSON.stringify(module.exports, null, 2)) diff --git a/site/package.json b/site/package.json new file mode 100644 index 0000000..f5cc032 --- /dev/null +++ b/site/package.json @@ -0,0 +1,117 @@ +{ + "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": { + "@emotion/react": "^11.9.0", + "@emotion/styled": "^11.8.1", + "@material-ui/core": "4.12.3", + "@material-ui/styles": "^4.11.5", + "@mui/icons-material": "^5.8.0", + "@mui/material": "^5.8.1", + "@mui/styles": "^5.8.0", + "@radix-ui/react-dropdown-menu": "^0.1.6", + "@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", + "graphql": "^16.5.0", + "graphql-tag": "^2.12.6", + "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-swipeable-views": "^0.14.0", + "react-swipeable-views-utils": "^0.14.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/site/pages/404.tsx b/site/pages/404.tsx new file mode 100644 index 0000000..bd08501 --- /dev/null +++ b/site/pages/404.tsx @@ -0,0 +1,35 @@ +import type { GetStaticPropsContext } from 'next' +import commerce from '@lib/api/commerce' +import { Layout } from '@components/common' +import { Text } from '@components/ui' + +export async function getStaticProps({ + preview, + locale, + locales, +}: GetStaticPropsContext) { + const config = { locale, locales } + const { pages } = await commerce.getAllPages({ config, preview }) + const { categories, brands } = await commerce.getSiteInfo({ config, preview }) + return { + props: { + pages, + categories, + brands, + }, + revalidate: 200, + } +} + +export default function NotFound() { + return ( +
    + Not Found + + The requested page doesn't exist or you don't have access to it. + +
    + ) +} + +NotFound.Layout = Layout diff --git a/site/pages/[...pages].tsx b/site/pages/[...pages].tsx new file mode 100644 index 0000000..609283c --- /dev/null +++ b/site/pages/[...pages].tsx @@ -0,0 +1,88 @@ +import type { + GetStaticPathsContext, + GetStaticPropsContext, + InferGetStaticPropsType, +} from 'next' +import commerce from '@lib/api/commerce' +import { Text } from '@components/ui' +// import { Layout } from '@components/common' +import Layout from '@components/common/Layout/Layout' +import getSlug from '@lib/get-slug' +import { missingLocaleInPages } from '@lib/usage-warns' +import type { Page } from '@commerce/types/page' +import { useRouter } from 'next/router' + +export async function getStaticProps({ + preview, + params, + locale, + locales, +}: GetStaticPropsContext<{ pages: string[] }>) { + const config = { locale, locales } + const pagesPromise = commerce.getAllPages({ config, preview }) + const siteInfoPromise = commerce.getSiteInfo({ config, preview }) + const { pages } = await pagesPromise + const { categories } = await siteInfoPromise + const path = params?.pages.join('/') + const slug = locale ? `${locale}/${path}` : path + const pageItem = pages.find((p: Page) => + p.url ? getSlug(p.url) === slug : false + ) + const data = + pageItem && + (await commerce.getPage({ + variables: { id: pageItem.id! }, + config, + preview, + })) + + const page = data?.page + + if (!page) { + return { + notFound: true, + } + } + + return { + props: { pages, page, categories }, + revalidate: 60 * 60, // Every hour + } +} + +export async function getStaticPaths({ locales }: GetStaticPathsContext) { + const config = { locales } + const { pages }: { pages: Page[] } = await commerce.getAllPages({ config }) + const [invalidPaths, log] = missingLocaleInPages() + const paths = pages + .map((page) => page.url) + .filter((url) => { + if (!url || !locales) return url + // If there are locales, only include the pages that include one of the available locales + if (locales.includes(getSlug(url).split('/')[0])) return url + + invalidPaths.push(url) + }) + log() + + return { + paths, + fallback: 'blocking', + } +} + +export default function Pages({ + page, +}: {page: Page}) { + const router = useRouter() + + return router.isFallback ? ( +

    Loading...

    // TODO (BC) Add Skeleton Views + ) : ( +
    + {page?.body && } +
    + ) +} + +Pages.Layout = Layout diff --git a/site/pages/_app.js b/site/pages/_app.js new file mode 100644 index 0000000..bb0f5db --- /dev/null +++ b/site/pages/_app.js @@ -0,0 +1,13 @@ +import './styles/globals.css' +import Layout from '../components/common/Layout/Layout'; + +function MyApp({ Component, pageProps }) { + + return ( + + + + ) +} + +export default MyApp diff --git a/site/pages/_document.js b/site/pages/_document.js new file mode 100644 index 0000000..bea6e07 --- /dev/null +++ b/site/pages/_document.js @@ -0,0 +1,63 @@ +import React from 'react'; +import Document, { Html, Head, Main, NextScript } from 'next/document'; +import { ServerStyleSheets } from '@material-ui/styles'; // works with @material-ui/core/styles, if you prefer to use it. + +export default class MyDocument extends Document { + render() { + return ( + + + {/* Not exactly required, but this is the PWA primary color */} + {/* */} + + +
    + + + + ); + } +} + +// `getInitialProps` belongs to `_document` (instead of `_app`), +// it's compatible with server-side generation (SSG). +MyDocument.getInitialProps = async (ctx) => { + // Resolution order + // + // On the server: + // 1. app.getInitialProps + // 2. page.getInitialProps + // 3. document.getInitialProps + // 4. app.render + // 5. page.render + // 6. document.render + // + // On the server with error: + // 1. document.getInitialProps + // 2. app.render + // 3. page.render + // 4. document.render + // + // On the client + // 1. app.getInitialProps + // 2. page.getInitialProps + // 3. app.render + // 4. page.render + + // Render app and page and get the context of the page with collected side effects. + const sheets = new ServerStyleSheets(); + const originalRenderPage = ctx.renderPage; + + ctx.renderPage = () => + originalRenderPage({ + enhanceApp: (App) => (props) => sheets.collect(), + }); + + const initialProps = await Document.getInitialProps(ctx); + + return { + ...initialProps, + // Styles fragment is rendered after the app and page rendering finish. + styles: [...React.Children.toArray(initialProps.styles), sheets.getStyleElement()], + }; +}; \ No newline at end of file diff --git a/site/pages/about.js b/site/pages/about.js new file mode 100644 index 0000000..9fc6f87 --- /dev/null +++ b/site/pages/about.js @@ -0,0 +1,456 @@ +import * as React from "react"; +import { makeStyles } from "@material-ui/core/styles"; +import Box from "@mui/material/Box"; +import Grid from "@mui/material/Grid"; +import Container from "@mui/material/Container"; +import Breadcrumbs from "@mui/material/Breadcrumbs"; +import Typography from "@mui/material/Typography"; +import FormControl from "@mui/material/FormControl"; +import Button from "@mui/material/Button"; +import Inventory2OutlinedIcon from "@mui/icons-material/Inventory2Outlined"; +import ShoppingCartIcon from "@mui/icons-material/ShoppingCart"; +import PublicIcon from "@mui/icons-material/Public"; +import Banner from '../assets/img/banner_page.png'; +import AboutTeam from '../assets/img/aboutpng.png'; +import AboutTeam_1 from '../assets/img/aboutteam01.png'; +import AboutTeam_2 from '../assets/img/aboutteam02.png'; +import AboutTeam_3 from '../assets/img/aboutteam03.png'; + + +const useStyles = makeStyles({ + pageAbout: { + marginBottom: "60px", + minHeight: "200px", + backgroundImage:`url(${Banner.src})`, + backgroundSize: "cover" + }, + + titlePageAbout: { + display: "flex", + paddingTop: "75px", + paddingBottom: "75px", + "@media (max-width: 1200px)": { + display: "inline-block", + + } + }, + + rightTextPageAbout: { + float: "right", + paddingTop:"12px", + "@media (max-width: 768px)": { + float: "inherit" + } + }, + services: { + display: "flex", + margin: "40px", + "@media (max-width: 767px)": { + display: "block", + textAlign: "-webkit-center" + + } + }, + avartar: { + height: "auto", + maxWidth: "100%", + display: "block" + }, + profileItem: { + position: "relative", + textAlign: "center", + margin: "15px", + "&:hover content": { + top: 0, + visibility: "visible", + opacity: 1 + } + }, + author: { + position: "relative", + textAlign: "center", + margin: " 0 0px 140px 0px" + }, + msTeamInfo: { + position: "absolute", + padding: "15px 0", + zIndex: 11, + width: "90%", + bottom: "-50px", + left: "50%", + transform: "translateX(-50%)", + background: "rgb(64,198,255)" + }, + name: { + fontSize: "16px", + lineHeight: "24px", + color: "#fff", + fontWeight: "bold", + textTransform: "capitalize", + margin: "0 0 2px 0" + }, + job: { + fontSize: "14px", + lineHeight: "24px", + color: "#fff", + margin: 0 + }, + content: { + position: "absolute", + zIndex: "10", + maxWidth: "100%", + height: "100%", + top: "-80px", + left: 0, + padding: "20px", + textAlign: "left", + background: "rgba(41, 53, 68, 0.9)", + visibility: "hidden", + opacity: 0, + transition: "all .7s", + borderRadius: "3px", + fontZize: "14px", + lineHeight: "24px", + color: "#999" + }, + profileOutTeam:{ + display:"flex", + '@media (max-width: 768px)': { + display:"block" + },'@media (max-width: 600px)': { + display:"block" +} + }, + profile_item:{ + display:"contents", + '@media (max-width: 768px)': { + display:"flex" + }, + '@media (max-width: 600px)': { + display:"block" +}, + }, + aboutIcon:{ + border: "1px solid #fff", + borderRadius: "40px", + color: "#fff", + fontSize: "80px", + padding: "15px", + margin: "10px", + background: "#40c6ff", + }, + textTile:{ + color: "white", + fontFamily:"Merriweather", + fontSize:"50px", + fontWeight:700 + }, + titleText:{ + color: "white", + fontFamily:"Muli", + fontWeight:400, + fontSize:"14px" + }, + textAbout_main:{ + textAlign: "center", + fontWeight: "700", + lineHeight: "32px", + fontSize:"36px", + color:"#293544", + fontFamily:"Merriweather" + } +}); + +export default function About() { + const classes = useStyles(); + return ( + <> + + + + + + + About + + + + + + + + Home + + + About + + + + + + + + + + + Get to know Multistore + + + Multistore vision is to create Indias most reliable and + frictionless commerce ecosystem that creates life-changing + experiences for buyers and sellers. + + + + + + + 35 Million+ + + + Products + + + + + + 250,000 + + + Sellers + + + + + + 6000+ + + + Cities + + + + + + In February 2010, Kunal Bahl along with Rohit Bansal, started + Multistore.com Indias largest online marketplace, with the widest + assortment of 30 million plus products across 800 plus Boxerse + categories from over 125,000 regional, national, and international + brands and retailers. + + + With millions of users and more than 300,000 sellers, Multistore is + the shopping destination for Internet users across the country, + delivering to 6000+ cities and towns in India. + + + In its journey till now, Multistore has partnered with several + global marquee investors and inBoxiduals such as SoftBank, + BlackRock, Temasek, Foxconn, Alibaba, eBay Inc., Premji Invest, + Intel Capital, Bessemer Venture Partners, Mr. Ratan Tata, among + others. + + + + + Our Team + + + Each member of our team is a specialist in his or her field. + Together, we make sure youre investing where the best returns are, + while building loyalty across every touchpoint. + + + + + + + + + Philip Demarco + + +

    Philip Demarco

    +

    Business Analyst

    +
    +
    + + + By testing and launching new partners and internal tech + solutions, he increases both efficiency and performance + + + + {" "} + + + + + + {" "} + + + +
    +
    + + + + + Philip Demarco + + +

    Philip Demarco

    +

    Business Analyst

    +
    +
    + + + By testing and launching new partners and internal tech + solutions, he increases both efficiency and performance + + + + {" "} + + + + + + {" "} + + + +
    +
    +
    + + + + + + Philip Demarco + + +

    Philip Demarco

    +

    Business Analyst

    +
    +
    + + + By testing and launching new partners and internal tech + solutions, he increases both efficiency and performance + + + + {" "} + + + + + + {" "} + + + +
    +
    + + + + + Philip Demarco + + +

    Philip Demarco

    +

    Business Analyst

    +
    +
    + + + By testing and launching new partners and internal tech + solutions, he increases both efficiency and performance + + + + {" "} + + + + + + {" "} + + + +
    +
    +
    +
    +
    + + ); +} diff --git a/site/pages/api/cart.ts b/site/pages/api/cart.ts new file mode 100644 index 0000000..6428911 --- /dev/null +++ b/site/pages/api/cart.ts @@ -0,0 +1,4 @@ +import cartApi from '@framework/api/endpoints/cart' +import commerce from '@lib/api/commerce' + +export default cartApi(commerce) diff --git a/site/pages/api/catalog/products.ts b/site/pages/api/catalog/products.ts new file mode 100644 index 0000000..631bfd5 --- /dev/null +++ b/site/pages/api/catalog/products.ts @@ -0,0 +1,4 @@ +import productsApi from '@framework/api/endpoints/catalog/products' +import commerce from '@lib/api/commerce' + +export default productsApi(commerce) diff --git a/site/pages/api/checkout.ts b/site/pages/api/checkout.ts new file mode 100644 index 0000000..7bf0fd9 --- /dev/null +++ b/site/pages/api/checkout.ts @@ -0,0 +1,4 @@ +import checkoutApi from '@framework/api/endpoints/checkout' +import commerce from '@lib/api/commerce' + +export default checkoutApi(commerce) diff --git a/site/pages/api/customer/address.ts b/site/pages/api/customer/address.ts new file mode 100644 index 0000000..5815ea4 --- /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 0000000..6f88b8c --- /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/site/pages/api/customer/index.ts b/site/pages/api/customer/index.ts new file mode 100644 index 0000000..0c86e76 --- /dev/null +++ b/site/pages/api/customer/index.ts @@ -0,0 +1,4 @@ +import customerApi from '@framework/api/endpoints/customer' +import commerce from '@lib/api/commerce' + +export default customerApi(commerce) diff --git a/site/pages/api/login.ts b/site/pages/api/login.ts new file mode 100644 index 0000000..9d0b6ae --- /dev/null +++ b/site/pages/api/login.ts @@ -0,0 +1,4 @@ +import loginApi from '@framework/api/endpoints/login' +import commerce from '@lib/api/commerce' + +export default loginApi(commerce) diff --git a/site/pages/api/logout.ts b/site/pages/api/logout.ts new file mode 100644 index 0000000..0cf0fc4 --- /dev/null +++ b/site/pages/api/logout.ts @@ -0,0 +1,4 @@ +import logoutApi from '@framework/api/endpoints/logout' +import commerce from '@lib/api/commerce' + +export default logoutApi(commerce) diff --git a/site/pages/api/signup.ts b/site/pages/api/signup.ts new file mode 100644 index 0000000..e19d67e --- /dev/null +++ b/site/pages/api/signup.ts @@ -0,0 +1,4 @@ +import singupApi from '@framework/api/endpoints/signup' +import commerce from '@lib/api/commerce' + +export default singupApi(commerce) diff --git a/site/pages/api/wishlist.ts b/site/pages/api/wishlist.ts new file mode 100644 index 0000000..3b96812 --- /dev/null +++ b/site/pages/api/wishlist.ts @@ -0,0 +1,4 @@ +import wishlistApi from '@framework/api/endpoints/wishlist' +import commerce from '@lib/api/commerce' + +export default wishlistApi(commerce) diff --git a/site/pages/cart.js b/site/pages/cart.js new file mode 100644 index 0000000..6f8232d --- /dev/null +++ b/site/pages/cart.js @@ -0,0 +1,98 @@ +import Container from "@mui/material/Container"; +import CartItemsContainer from '../components/cart/cart-page/CartItemsContainer'; +import { AppProvider } from "../libs/context/AppContext"; +import Typography from '@mui/material/Typography'; +import Box from '@mui/material/Box';import Banner from '../assets/img/banner_page.png'; +import Breadcrumbs from "@mui/material/Breadcrumbs"; +import Grid from "@mui/material/Grid"; +import { makeStyles } from "@material-ui/core/styles"; + +const useStyles = makeStyles({ + page: { + marginBottom: "60px", + minHeight: "200px", + backgroundImage:`url(${Banner.src})`, + backgroundSize: "cover" + }, + + titlePage: { + + display: "flex", + paddingTop: "75px", + paddingBottom: "75px", + "@media (max-width: 768px)": { + display: "block" + } + }, + + rightTextPage: { + paddingTop:"12px", + float: "right", + "@media (max-width: 768px)": { + float: "inherit" + } + }, + textTile:{ + color: "white", + fontFamily:"Merriweather", + fontSize:"50px", + fontWeight:700 + }, + titleText:{ + color: "white", + fontFamily:"Muli", + fontWeight:400, + fontSize:"14px" + }, + }) + +const Cart = (props) => { + const classes = useStyles(); + + + return ( + + + + + + + + Cart + + + + + + + + + Home + + + + Cart + + + + + + + + + + {props.children} + + + ) +}; + +export default Cart; diff --git a/site/pages/cart.tsx b/site/pages/cart.tsx new file mode 100644 index 0000000..6823f7b --- /dev/null +++ b/site/pages/cart.tsx @@ -0,0 +1,192 @@ +import type { GetStaticPropsContext } from 'next' +import useCart from '@framework/cart/use-cart' +import usePrice from '@framework/product/use-price' +import commerce from '@lib/api/commerce' +import { Layout } from '@components/common' +import { Button, Text, Container } 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, + locale, + locales, +}: GetStaticPropsContext) { + const config = { locale, locales } + const pagesPromise = commerce.getAllPages({ config, preview }) + const siteInfoPromise = commerce.getSiteInfo({ config, preview }) + const { pages } = await pagesPromise + const { categories } = await siteInfoPromise + return { + props: { pages, categories }, + } +} + +export default function Cart() { + const error = null + const success = null + const { data, isLoading, isEmpty } = useCart() + const { openSidebar, setSidebarView } = useUI() + + const { price: subTotal } = usePrice( + data && { + amount: Number(data.subtotalPrice), + currencyCode: data.currency.code, + } + ) + const { price: total } = usePrice( + data && { + amount: Number(data.totalPrice), + currencyCode: data.currency.code, + } + ) + + const goToCheckout = () => { + openSidebar() + setSidebarView('CHECKOUT_VIEW') + } + + return ( + +
    + {isLoading || isEmpty ? ( +
    + + + +

    + Your cart is empty +

    +

    + Biscuit oat cake wafer icing ice cream tiramisu pudding cupcake. +

    +
    + ) : error ? ( +
    + + + +

    + We couldn’t process the purchase. Please check your card + information and try again. +

    +
    + ) : success ? ( +
    + + + +

    + Thank you for your order. +

    +
    + ) : ( +
    + My Cart + Review your Order +
      + {data!.lineItems.map((item: any) => ( + + ))} +
    +
    + + Before you leave, take a look at these items. We picked them + just for you + +
    + {[1, 2, 3, 4, 5, 6].map((x) => ( +
    + ))} +
    +
    +
    + )} +
    +
    +
    + {process.env.COMMERCE_CUSTOMCHECKOUT_ENABLED && ( + <> + {/* Shipping Address */} + {/* Only available with customCheckout set to true - Meaning that the provider does offer checkout functionality. */} +
    +
    + +
    +
    + + Add Shipping Address + {/* + 1046 Kearny Street.
    + San Franssisco, California +
    */} +
    +
    + {/* Payment Method */} + {/* Only available with customCheckout set to true - Meaning that the provider does offer checkout functionality. */} +
    +
    + +
    +
    + + Add Payment Method + {/* VISA #### #### #### 2345 */} +
    +
    + + )} +
    +
      +
    • + Subtotal + {subTotal} +
    • +
    • + Taxes + Calculated at checkout +
    • +
    • + Estimated Shipping + FREE +
    • +
    +
    + Total + {total} +
    +
    +
    +
    + {isEmpty ? ( + + ) : ( + <> + {process.env.COMMERCE_CUSTOMCHECKOUT_ENABLED ? ( + + ) : ( + + )} + + )} +
    +
    +
    +
    + + ) +} + +Cart.Layout = Layout diff --git a/site/pages/collection/[slug].js b/site/pages/collection/[slug].js new file mode 100644 index 0000000..08c39be --- /dev/null +++ b/site/pages/collection/[slug].js @@ -0,0 +1,314 @@ +import Link from "next/link"; +import Container from "@mui/material/Container"; +import { useRouter } from 'next/router'; +import AddToCartButton from '../../components/cart/AddToCartButton'; +import { isEmpty } from 'lodash'; +import GalleryCarousel from '../../components/single-product/gallery-carousel'; +import CategoriesCarousel from '../../components/single-product/categories-carousel'; +import RelatedProduct from '../../components/single-product/related-product'; +import Price from '../../components/single-product/price'; +import { ImageList } from '@mui/material'; +import { ImageListItem } from '@mui/material'; +import { Grid } from '@mui/material'; +import { makeStyles } from "@material-ui/core/styles"; +import Rating from '@mui/material/Rating'; +import Breadcrumbs from "@mui/material/Breadcrumbs"; +import Banner from '../../assets/banner_page.png'; +import Typography from '@mui/material/Typography'; +import Box from '@mui/material/Box'; +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import ListItemButton from '@mui/material/ListItemButton'; +import ListItemText from '@mui/material/ListItemText'; +import Divider from '@mui/material/Divider'; +import Collection from "../../components/collection"; +import commerce from "@lib/api/commerce"; + + + + const colorHover = '#40c6ff'; + const useStyles_pageShop = makeStyles(theme => ({ + pageShop: { + marginBottom: "60px", + minHeight: "200px", + backgroundImage: `url(${Banner.src})`, + backgroundSize: "cover" + }, + + titlePage: { + display: "flex", + paddingTop: "75px", + paddingBottom: "75px", + "@media (max-width: 768px)": { + display: "block" + } + }, + + rightTextPage: { + float: "right", + paddingTop: "12px", + "@media (max-width: 768px)": { + float: "inherit" + } + }, + productCategory: { + display: "flex", + "@media (max-width: 768px)": { + display: "flex", + flexDirection: "column-reverse" + } + }, + productCategoryText: { + marginRight: "25px" + }, + textCartegory: { + padding: '10px 0px', + borderBottom: '1px solid #ccc', + color: '#676c77', + transition: '0.21s', + '& div.MuiTreeItem-content': { + padding: '0px!important', + '&:hover': { + background: '#fff', + }, + '&:focus': { + background: '#fff', + }, + '& svg': { + color: '#676c77', + } + }, + '&:hover': { + color: '#000', + } + }, + titleCartegory: { + marginBottom: "10px", + marginTop: "10px", + }, + titleSideBarCategory: { + position: 'relative', + borderBottom: ' 1px solid #ccc', + paddingBottom: '15px', + marginBottom: '20px', + fontFamily: 'Merriweather,sans-serif', + fontWeight: 'bold', + fontSize: '24px', + '&:before': { + position: 'absolute', + content: '""', + width: '60px', + height: '1px', + bottom: '-1px', + backgroundColor: `${colorHover}`, + } + }, + categoryText: { + paddingLeft: "0px", + '&:hover': { + backgroundColor: "#fff !important", + } + }, + textTile: { + color: "white", + fontFamily: "Merriweather", + fontSize: "50px", + fontWeight: 700 + }, + titleText: { + color: "white", + fontFamily: "Muli", + fontWeight: 400, + fontSize: "14px" + }, + })) + + + +export default function Product(props) { + const classes = useStyles_pageShop(); + + const {productrelate } = props; + //console.warn(productrelate); + + const router = useRouter() + const handleSubmit = (slug) => { + router.push(`${slug}`); + }; + // If the page is not yet generated, this will be displayed + // initially until getStaticProps() finishes running + if (router.isFallback) { + return
    Loading...
    + } + + return ( + + + + + + + + Shop + + + + + + + + Home + + + Shop + + + + + + + + + + + + Product Category + + + + + handleSubmit(`custom-prints`)} > + Custom Prints + + + + + + + + + handleSubmit(`free-file-check`)} > + Free file check + + + + + + + + + handleSubmit(`graphic-design`)} > + Graphic Design + + + + + + + + + handleSubmit(`mailing`)}> + Mailing + + + + + + + + + + + {productrelate.length ? ( + productrelate.map(product => ) + ) : ''} + + + + + + ); +}; + +export async function getStaticProps({ + params, + locale, + locales, + preview, +} ){ + const config = { locale, locales } + const productPromise = commerce.getProduct({ + variables: { slug: params.slug }, + config, + preview, + }) + + + const allProductsPromise = commerce.getAllProducts({ + variables: { first: 4 }, + config, + preview, + }) + const { product } = await productPromise + + + + //console.log('product', product); + //console.warn('Related Product:', relatedProducts); + + if (!product) { + throw new Error(`Product with slug '${params.slug}' not found`) + } + + return { + props: { + + product, + }, + revalidate: 200, + } +} + +export async function getStaticPaths({ locales }) +{ + const { products } = await commerce.getAllProductPaths() + + return { + paths: locales + ? locales.reduce((arr, locale) => { + // Add a product path for every locale + products.forEach((product) => { + arr.push(`/${locale}/collection${product.path}`) + }) + return arr + }, []) + : products.map((product) => `/collection${product.path}`), + fallback: 'blocking', + } +} + +// export async function getServerSideProps(context) { + +// const { params: { slug } } = context +// //console.log(context); + +// const result= await client.query({ +// query: COLLECTION_QUERY, +// variables: { slug } +// }); + +// return { +// props: { +// productrelate: result.data.collection.productVariants.items, +// }, + +// }; +// } diff --git a/site/pages/contact.js b/site/pages/contact.js new file mode 100644 index 0000000..35bdf85 --- /dev/null +++ b/site/pages/contact.js @@ -0,0 +1,256 @@ +import * as React from "react"; +import { makeStyles } from "@material-ui/core/styles"; +import Box from "@mui/material/Box"; +import Grid from "@mui/material/Grid"; +import Container from "@mui/material/Container"; +import Breadcrumbs from "@mui/material/Breadcrumbs"; +import Typography from "@mui/material/Typography"; +import FormControl from "@mui/material/FormControl"; +import Button from "@mui/material/Button"; +import LocalPhoneIcon from "@mui/icons-material/LocalPhone"; +import AddLocationIcon from "@mui/icons-material/AddLocation"; +import EmailIcon from "@mui/icons-material/Email"; +import Banner from '../assets/img/banner_page.png'; + + + const useStyles = makeStyles({ + pageAccout: { + marginBottom: "60px", + minHeight: "200px", + background:`url(${Banner.src})`, + backgroundSize: "cover" + }, + + titlePage: { + display: "flex", + paddingTop: "75px", + paddingBottom: "75px", + "@media (max-width: 768px)": { + display: "block" + } + }, + textTile:{ + color: "white", + fontFamily:"Merriweather", + fontSize:"50px", + fontWeight:700 + }, + titleText:{ + color: "white", + fontFamily:"Muli", + fontWeight:400, + fontSize:"14px" + }, + rightTextPage: { + paddingTop:"12px", + float: "right", + "@media (max-width: 768px)": { + float: "inherit" + } + }, + inputAccout: { + width: "100%", + minHeight: "40px", + paddingLeft: "10px", + marginTop: "10px", + marginBottom: "10px", + border:"1px solid #ccc", + outline:"none", + borderRadius:"5px" + + + }, + inputAccoutMasage: { + width: "100%", + height: "200px", + paddingLeft: "10px", + marginTop: "10px", + marginBottom: "10px", + border:"1px solid #ccc", + outline:"none", + borderRadius:"5px", + '&:focus':{ + outline:"none" + } + }, + formPage: { + display: "flex", + padding: "30px", + "@media (max-width: 768px)": { + display: "block" + } + }, + loginPage: { + "@media (max-width: 768px)": { + marginBottom: "40px" + } + }, + textFormPage:{ + marginBottom:"30px", + textAlign:"left", + fontFamily:"Merriweather", + fontWeight:700, + fontStyle:"normal" + }, + icon:{ + border: "1px solid", + borderRadius: "40px", + fontSize: "60px", + padding: "15px", + margin: "10px" + }, + texticon:{ + paddingTop:"25px", + fontSize:"19px", + fontFamily:"Muli", + fontWeight:700, + color: "#666666" + } +}); + +export default function ContactUS() { + const classes = useStyles(); + return ( + + <> + + + + + + + + Contact + + + + + + + + Home + + + Contact + + + + + + + + + + + + + Contact us + + + + + + + + + + + + + + + + + + + Location + + + + + 0-800-12-345-6 880 + + + + + + 257 Charlington Gates Road Morrison, Nr. 568 + + + + + + info@jruitstemplate.com + + + + + + + + + ); +} diff --git a/site/pages/index.js b/site/pages/index.js new file mode 100644 index 0000000..19a1fa1 --- /dev/null +++ b/site/pages/index.js @@ -0,0 +1,149 @@ +import React from 'react' +import { Container, Grid } from '@mui/material'; +// slider +// import SwipeableTextMobileStepper from '../components/slider'; +// end slider +import SwipeableTextMobileStepper from '../components/slider' + +// product + +// end product tabs +import Product from '../components/product' + +// newlistimg +import NewImageList from '../components/newlistimg'; +// end newlistimg + +// imglist +import SellerImageList from '../components/imglist'; +// end imglist + +// form Email +import NameForm from '../components/formEmail'; + +// end form Email + +//import request data +// import { AppProvider } from '../libs/context/AppContext'; +import { AppProvider } from '../lib/context/AppContext'; +import DealsOfDay from 'components/DealsOfDay'; +import Tab from 'components/tab'; +import TabSeller from 'components/tabSeller'; +import Logo from 'components/tabsLogo'; +import Collection from 'components/collection'; +import commerce from '@lib/api/commerce'; + +export async function getStaticProps({ + preview, + locale, + locales, +}) { + const config = { locale, locales } + const productsPromise = commerce.getAllProducts({ + variables: { first: 8 }, + config, + preview, + // Saleor provider only + ...({ featured: true }), + }) + const pagesPromise = commerce.getAllPages({ config, preview }) + const siteInfoPromise = commerce.getSiteInfo({ config, preview }) + const { products } = await productsPromise + const { pages } = await pagesPromise + const { categories, brands } = await siteInfoPromise + + return { + props: { + products, + categories, + brands, + pages, + }, + revalidate: 60, + } +} + + +const Home = (props) => { + const { products,productseller, products2, productseller2 } = props; + // console.log('products',products); + // console.log(productseller); + return ( + +
    + {/* + + + */} + + + + + + {products.length ? ( + products.map(product => ) + ) : ''} + + {/* + {products.length ? ( + products.map(product => ) + ) : ''} + */} + + + + + + + {products.length ? ( + products.map(product => ) + ) : ''} + + {/* + {products.length ? ( + products.map(product => ) + ) : ''} + */} + + + + + {/*
    + */} +
    +
    + ) +} +export default Home; + + +// export async function getServerSideProps({ query }) { + +// const slug = query.slug ? query.slug : ''; +// const slug1 = query.slug1 ? query.slug1 : ''; +// //const cat = query.cat ? query.cat : ""; +// //const cat1 = query.cat1 ? query.cat1 : ""; +// const result = !slug ? await client.query({ +// query: PRODUCT_QUERY, +// }) : await client.query ({ +// query: COLLECTION_QUERY, +// variables: { slug }, +// }); + +// /*PRODUCTS SELLER */ +// const result2 = !slug1 ? await client.query({ +// query: PRODUCT_SELLER, +// }) : await client.query ({ +// query: COLLECTION_QUERY2, +// variables: { slug1 }, +// }); +// return { +// props: { +// products: !slug ? result.data.products.items : '', +// products2: slug ? result.data.collection.productVariants.items : '', +// /*PRODUCTS SELLER */ +// productseller: !slug1 ? result2.data.products.items : '', +// productseller2: slug1 ? result2.data.collection.productVariants.items : '', +// }, +// }; +// } \ No newline at end of file diff --git a/site/pages/myaccount.js b/site/pages/myaccount.js new file mode 100644 index 0000000..ee275e4 --- /dev/null +++ b/site/pages/myaccount.js @@ -0,0 +1,294 @@ +import * as React from "react"; +import ReactDOM from 'react-dom'; +import { useFormik } from 'formik'; +import * as yup from 'yup'; +import { makeStyles } from "@material-ui/core/styles"; +import Box from "@mui/material/Box"; +import Grid from "@mui/material/Grid"; +import Container from "@mui/material/Container"; +import Breadcrumbs from "@mui/material/Breadcrumbs"; +import Typography from "@mui/material/Typography"; +import FormControl from "@mui/material/FormControl"; +import Button from "@mui/material/Button"; +import FormControlLabel from "@mui/material/FormControlLabel"; +import Checkbox from "@mui/material/Checkbox"; +import TextField from '@material-ui/core/TextField'; +import Banner from '../assets/img/banner_page.png'; +import { useRouter } from "next/router"; + + + +const useStyles = makeStyles({ + pageAccout: { + marginBottom: "60px", + minHeight: "200px", + background: `url(${Banner.src})`, + backgroundSize: "cover" + }, + + + titlePage: { + display: "flex", + paddingTop: "75px", + paddingBottom: "75px", + '@media (max-width: 768px)': { + display: "block", + } + + }, + + textTile: { + color: "white", + fontFamily: "Merriweather", + fontSize: "50px", + fontWeight: 700 + }, + titleText: { + color: "white", + fontFamily: "Muli", + fontWeight: 400, + fontSize: "14px" + }, + rightTextPage: { + paddingTop: "12px", + float: "right", + '@media (max-width: 768px)': { + float: "inherit", + } + }, + inputAccout: { + width: "100%", + minHeight: "55px", + paddingLeft: "10px", + marginTop: "10px" + }, + formPage: { + display: "flex", + border: "1px solid #ccc", + padding: "30px", + '@media (max-width: 768px)': { + display: "block", + + } + }, + loginPage: { + '@media (max-width: 768px)': { + marginBottom: "40px", + } + }, + formLogin: { + width: "100%", + paddingRight: "25px", + + }, + + regisPage: { + '@media (max-width: 768px)': { + marginTop: "40px", + } + }, + textFormPage:{ + marginBottom:"30px", + textAlign:"left", + fontFamily:"Merriweather", + fontWeight:700, + fontStyle:"normal" + }, +}); + +const validationSchema = yup.object({ + email: yup + .string('Enter your email') + .email('Enter a valid email') + .required('Email is required'), + password: yup + .string('Enter your password') + .min(6, 'Password should be of minimum 6 characters length') + .required('Password is required'), +}); + + +export default function MyAccout() { + const router = useRouter(); + const [checked, setChecked] = React.useState(false); + const [isChecked, setStatusChecked] = React.useState(false); + const handleChange = () => { + setChecked((prev) => !prev); + }; + + const handleOnclickShow = () => { + setStatusChecked((item) => true); + }; + const handleOnclickHidden = () => { + setStatusChecked((item) => false); + }; + const classes = useStyles(); + const handleSubmit = (e) => { + e.preventDefault(); + } + const formik = useFormik({ + initialValues: { + email: 'admin@gmail.com', + password: 'admin123', + }, + validationSchema: validationSchema, + onSubmit: (values) => { + if (values.email == 'admin@gmail.com' && values.password == 'admin123') { + router.push('/profile'); + } else { + alert('Wrong user'); + } + }, + }); + const formik2 = useFormik({ + initialValues: { + email: 'youremail@gmail.com', + password: '', + }, + validationSchema: validationSchema, + onSubmit: (values) => { + if (values.email == 'admin@gmail.com' && values.password == 'admin123') { + router.push('/profile'); + } else { + alert('Wrong user'); + } + }, + }); + + return ( + <> + + + + + + + My account + + + + + + + + Home + + + My account + + + + + + + + + + + + + Login + +
    + Username or email address * + + Password * + + + + + } + label="Remember me" + /> + + + Lost your password? + + + + + +
    + + + + Register + +
    + Username or email address * + + Password * + + + + + + +
    +
    +
    +
    + + ); +} diff --git a/site/pages/orders.tsx b/site/pages/orders.tsx new file mode 100644 index 0000000..58f4445 --- /dev/null +++ b/site/pages/orders.tsx @@ -0,0 +1,42 @@ +import type { GetStaticPropsContext } from 'next' +import commerce from '@lib/api/commerce' +import { Bag } from '@components/icons' +import { Layout } from '@components/common' +import { Container, Text } from '@components/ui' + +export async function getStaticProps({ + preview, + locale, + locales, +}: GetStaticPropsContext) { + const config = { locale, locales } + const pagesPromise = commerce.getAllPages({ config, preview }) + const siteInfoPromise = commerce.getSiteInfo({ config, preview }) + const { pages } = await pagesPromise + const { categories } = await siteInfoPromise + + return { + props: { pages, categories }, + } +} + +export default function Orders() { + return ( + + My Orders +
    + + + +

    + No orders found +

    +

    + Biscuit oat cake wafer icing ice cream tiramisu pudding cupcake. +

    +
    +
    + ) +} + +Orders.Layout = Layout diff --git a/site/pages/product/[slug].js b/site/pages/product/[slug].js new file mode 100644 index 0000000..616520f --- /dev/null +++ b/site/pages/product/[slug].js @@ -0,0 +1,475 @@ +import Link from "next/link"; +import Container from "@mui/material/Container"; +import { useRouter } from 'next/router'; +import AddToCartButton from '../../components/cart/AddToCartButton'; +import { isEmpty } from 'lodash'; +import GalleryCarousel from "@components/single-product/gallery-carousel"; +import CategoriesCarousel from "@components/single-product/categories-carousel"; +import RelatedProduct from "@components/single-product/related-product"; +import Price from "@components/single-product/price"; +import { ImageList } from '@mui/material'; +import { ImageListItem } from '@mui/material'; +import { Grid } from '@mui/material'; +import { makeStyles } from "@material-ui/core/styles"; +//import { makeStyles } from "@mui/material"; +import Rating from '@mui/material/Rating'; +import Breadcrumbs from "@mui/material/Breadcrumbs"; +//import Banner from '../../assets/img/banner_page.png'; +import Typography from '@mui/material/Typography'; +import Box from '@mui/material/Box'; +import commerce, {testApi} from "@lib/api/commerce"; +import Banner from '../../assets/banner_page.png'; + + +const colorHeading = '#323232'; +const colorHover = '#40c6ff'; +const colorDefaul = '#666'; + +const useStyle_productDetail = makeStyles({ + page: { + marginBottom: "60px", + minHeight: "200px", + backgroundImage: `url(${Banner.src})`, + backgroundSize: "cover" + }, + + titlePage: { + display: "flex", + paddingTop: "75px", + paddingBottom: "75px", + "@media (max-width: 768px)": { + display: "block" + } + }, + + rightTextPage: { + paddingTop: "12px", + float: "right", + "@media (max-width: 768px)": { + float: "inherit" + } + }, + + + + imgagesDetail: { + '& img': { + width: '90%' + } + }, + galleryImages: { + '& img': { + width: '25%', + border: '1px solid #ccc', + } + }, + name_product_detail: { + fontSize: '30px', + color: `${colorHeading}`, + fontFamily: 'Merriweather', + }, + priceproduct :{ + color:'#40c6ff', + display:'inline', + fontSize:'20px', + fontWeight:'700', + margin:'0px 15p', + }, + + description_shot: { + overflow: 'hidden', + whiteSpace: 'normal', + textOverflow: 'ellipsis', + height: '60px', + fontSize: '14px', + color: '#000', + textAlign: 'justify', + lineHeight: '23px', + }, + product_meta: { + marginTop: '30px', + padding: '30px 0px', + float: 'left', + width: '100%', + marginBottom: '15px', + borderTop: '1px solid #e4e4e4', + borderBottom: '1px solid #e4e4e4', + fontSize: '16px', + color: '#676c77', + }, + sku_title: { + marginBottom: '15px', + }, + description_detail: { + marginTop: '70px', + paddingTop: '50px', + borderTop: '1px solid #e4e4e4', + width: '100%', + '& h4': { + marginTop: '0px', + fontSize: '20px', + textTransform: 'uppercase', + fontFamily: 'Merriweather', + } + }, + description_item: { + fontSize: '16px', + lineHeight: '23px', + color: '#000', + '& span': { + fontSize: '16px', + lineHeight: '23px', + color: '#000', + } + }, + box_related_products: { + width: '100%', + marginTop: '30px', + float: 'left', + margin: '0px -15px', + '& h4': { + fontSize: '20px', + textTransform: 'uppercase', + textAlign: 'center', + }, + }, + related_products: { + display: 'inline-block', + width: '25%', + padding: '0px 15px', + marginBottom: '30px', + '& img': { + width: '100%', + }, + '@media (max-width:899px)': { + width: '50%', + }, + '@media (max-width:767px)': { + width: '100%', + } + }, + box_product: { + border: '1px solid #efefef', + padding: '15px 15px 22px 15px', + transition: '0.35s', + '&:hover': { + boxShadow: '0 10px 6px -6px #ccc', + } + }, + cardBody: { + textAlign: 'center', + '& h3': { + fontSize: '19px', + fontWeight: 'bold', + color: '#444', + marginTop: '12px', + marginBottom: '10px', + fontFamily: 'Mulish,sans-serif', + lineHeight: '24px', + overflow: 'hidden', + display: '-webkit-box', + '-webkit-box-orient': 'vertical', + '-webkit-line-clamp': '1', + }, + '& h4': { + marginTop: '6px', + marginBottom: '0px', + }, + }, + startRating: { + textAlign: 'center', + '& span': { + color: '#ffcc35', + fontSize: '18px', + } + }, + cardPrice: { + color: `${colorHover}`, + fontSize: '22px', + fontWeight: '500', + fontFamily: 'Mulish,sans-serif', + }, + textTile: { + color: "white", + fontFamily: "Merriweather", + fontSize: "50px", + fontWeight: 700 + }, + titleText: { + color: "white", + fontFamily: "Muli", + fontWeight: 400, + fontSize: "14px" + }, +}) + +export default function Product(props) { + const classes = useStyle_productDetail(); + const { product,relatedProducts } = props; + + // console.log('productsssssss', product); + //console.warn(productrelate); + + const router = useRouter() + + // If the page is not yet generated, this will be displayed + // initially until getStaticProps() finishes running + if (router.isFallback) { + return
    Loading...
    + } + + return ( + <> + + + + + + + Product Detail + + + + + + + + + Home + + + + Product Detail + + + + + + + + +
    + {product ? ( +
    + + + +
    + +
    + {!isEmpty(product?.images[0]) ? ( + + ) : !isEmpty(product?.images) ? ( + Product Image + ) : null} +
    +
    +
    + +
    +

    {product.name}

    +

    ${product.price.value}

    +
    + {} +
    +
    + SKU: N/A +
    + {!isEmpty(product.collections) ? ( + + ) : !isEmpty(product.name) ? ( +
    + {product?.collections?.name} +
    + ) : null} +
    +
    + +
    +

    Detail

    +
    +
    +
    +
    +

    Related products

    + {relatedProducts.length ? ( + relatedProducts.map(item => ( +
    +
    + + + {item?.name} + + +
    +

    + + {item.name} + +

    +
    + +
    +

    + ${item.price.value} +

    +
    +
    +
    + ) + ) + + ) : ''} +
    + + +
    + ) : ( + '' + ) + } +
    + + ); +}; + +export async function getStaticProps({ + params, + locale, + locales, + preview, + } ){ + const config = { locale, locales } + const pagesPromise = commerce.getAllPages({ config, preview }) + const siteInfoPromise = commerce.getSiteInfo({ config, preview }) + const productPromise = commerce.getProduct({ + variables: { slug: params.slug }, + config, + preview, + }) + + const testPromise = await testApi(); + + // if (testPromise.ok) { + // const test = await testPromise.json(); + + // console.log(test); + // } + + const allProductsPromise = commerce.getAllProducts({ + variables: { first: 4 }, + config, + preview, + }) + const { pages } = await pagesPromise + const { categories } = await siteInfoPromise + const { product } = await productPromise + const { products: relatedProducts } = await allProductsPromise + + + + //console.log('product', product); + //console.warn('Related Product:', relatedProducts); + + if (!product) { + throw new Error(`Product with slug '${params.slug}' not found`) + } + + return { + props: { + pages, + product, + relatedProducts, + categories, + }, + revalidate: 200, + } + } + + export async function getStaticPaths({ locales }) + { + const { products } = await commerce.getAllProductPaths() + + return { + paths: locales + ? locales.reduce((arr, locale) => { + // Add a product path for every locale + products.forEach((product) => { + arr.push(`/${locale}/product${product.path}`) + }) + return arr + }, []) + : products.map((product) => `/product${product.path}`), + fallback: 'blocking', + } + } + +// export async function getServerSideProps(context) { + +// const { params: { slug } } = context +// // console.log(context); +// // const slug = query.slug ? query.slug : ""; + +// const result= await client.query({ +// query: PRODUCT_BY_SLUG_QUERY, +// variables: { slug } +// }); +// const result2= await client.query({ +// query: PRODUCT_SLUGS, + +// }); + +// return { +// props: { +// product: result.data.product, +// productrelate: result2.data.products.items, +// }, + +// }; +// } + +// export async function getStaticPaths() { +// const { data } = await client.query({ +// query: PRODUCT_SLUGS +// }) + +// const pathsData = [] + +// data?.products?.items && data?.products?.items.map((product) => { +// if (!isEmpty(product?.slug)) { +// pathsData.push({ params: { slug: product?.slug } }) +// } +// }) + +// return { +// paths: pathsData, +// fallback: true +// } +// } diff --git a/site/pages/profile.js b/site/pages/profile.js new file mode 100644 index 0000000..6cd35ca --- /dev/null +++ b/site/pages/profile.js @@ -0,0 +1,336 @@ +import * as React from "react"; +import { makeStyles } from "@material-ui/core/styles"; +import { Container, Grid, Link } from "@mui/material"; +import Paper from '@mui/material/Paper'; +import Typography from '@mui/material/Typography'; +import Divider from '@mui/material/Divider'; +import MenuList from '@mui/material/MenuList'; +import MenuItem from '@mui/material/MenuItem'; +import ListItemText from "@mui/material/ListItemText"; +import Button from "@mui/material/Button"; +import IconButton from "@mui/material/IconButton"; +import PhotoCamera from "@mui/icons-material/PhotoCamera"; +import Stack from "@mui/material/Stack"; +import { styled } from "@mui/material/styles"; +import Box from '@mui/material/Box'; +import TextareaAutosize from '@mui/material/TextareaAutosize'; +import AddIcon from '@mui/icons-material/Add'; +import ListItemIcon from '@mui/material/ListItemIcon'; +import Accordion from '@mui/material/Accordion'; +import AccordionSummary from '@mui/material/AccordionSummary'; +import Banner from '../assets/img/banner_page.png'; +import Breadcrumbs from "@mui/material/Breadcrumbs"; + + + +const useStyles = makeStyles({ + page: { + marginBottom: "60px", + minHeight: "200px", + backgroundImage:`url(${Banner.src})`, + backgroundSize: "cover" + }, + + titlePage: { + display: "flex", + paddingTop: "75px", + paddingBottom: "75px", + "@media (max-width: 768px)": { + display: "block" + } + }, + + rightTextPage: { + float: "right", + paddingTop:"12px", + "@media (max-width: 768px)": { + float: "inherit" + } + }, + + + main_profile:{ + display:"flex", + '@media (max-width: 899px)': { + display:"block" + } + }, + wallet:{ + marginTop:70 + }, + profile:{ + marginTop:50, + marginBottom:50 + }, + formProfileMain:{ + marginLeft:"80px", + '@media (max-width: 768px)': { + marginLeft:"0px", + } + + }, + formProfile:{ + marginTop:70, + + padding:25 + }, + formNameProfile:{ + width:"100%", + height:50 + }, + contactProfile:{ + padding:20, + marginTop:25 + }, + addressProfile:{ + padding:20, + marginTop:25, + marginBottom:10 + }, + accor:{ + width:"50%", + marginLeft:"15px", + '@media (max-width: 768px)': { + marginLeft:"0px", + margin:"4px" + } + }, + textTile:{ + color: "white", + fontFamily:"Merriweather", + fontSize:"50px", + fontWeight:700 + }, + titleText:{ + color: "white", + fontFamily:"Muli", + fontWeight:400, + fontSize:"14px" + }, +}) +const Input = styled("input")({ + display: "none" + }); +export default function Profile() { + const classes = useStyles(); + return ( + <> + + + + + + + Profile + + + + + + + + Home + + + Profile + + + + + + + + + + + + + + + + + + + Wallet + + + + + + Total Points + + 0 + + + + Points Used + + 0 + + + + Available Points + + 0 + + + + + + + + + + + Profile + + + + + Change Password + + + + My orders + + + + My Refunds + + + + Need Help + + + + + Log Out + + + + + + + + + + + + + + + Name + + + + + + Bio + + + + + + + + Contact Number + + add + + + + + + + 0362788997 + + + + + 0362788997 + + + + + + + + Address + + add + + + + + + + 0362788997 + + + + + 0362788997 + + + + + + + + + + ); +} diff --git a/site/pages/profile.tsx b/site/pages/profile.tsx new file mode 100644 index 0000000..4c88305 --- /dev/null +++ b/site/pages/profile.tsx @@ -0,0 +1,52 @@ +import type { GetStaticPropsContext } from 'next' +import useCustomer from '@framework/customer/use-customer' +import commerce from '@lib/api/commerce' +import { Layout } from '@components/common' +import { Container, Text } from '@components/ui' + +export async function getStaticProps({ + preview, + locale, + locales, +}: GetStaticPropsContext) { + const config = { locale, locales } + const pagesPromise = commerce.getAllPages({ config, preview }) + const siteInfoPromise = commerce.getSiteInfo({ config, preview }) + const { pages } = await pagesPromise + const { categories } = await siteInfoPromise + + return { + props: { pages, categories }, + } +} + +export default function Profile() { + const { data } = useCustomer() + return ( + + My Profile +
    + {data && ( +
    +
    + + Full Name + + + {data.firstName} {data.lastName} + +
    +
    + + Email + + {data.email} +
    +
    + )} +
    +
    + ) +} + +Profile.Layout = Layout diff --git a/site/pages/search.tsx b/site/pages/search.tsx new file mode 100644 index 0000000..23f0ee0 --- /dev/null +++ b/site/pages/search.tsx @@ -0,0 +1,9 @@ +import { getSearchStaticProps } from '@lib/search-props' +import type { GetStaticPropsContext } from 'next' +import Search from '@components/search' + +export async function getStaticProps(context: GetStaticPropsContext) { + return getSearchStaticProps(context) +} + +export default Search diff --git a/site/pages/search/[category].tsx b/site/pages/search/[category].tsx new file mode 100644 index 0000000..02eddd0 --- /dev/null +++ b/site/pages/search/[category].tsx @@ -0,0 +1,16 @@ +import { getSearchStaticProps } from '@lib/search-props' +import type { GetStaticPathsResult, GetStaticPropsContext } from 'next' +import Search from '@components/search' + +export async function getStaticProps(context: GetStaticPropsContext) { + return getSearchStaticProps(context) +} + +export function getStaticPaths(): GetStaticPathsResult { + return { + paths: [], + fallback: 'blocking', + } +} + +export default Search diff --git a/site/pages/search/designers/[name].tsx b/site/pages/search/designers/[name].tsx new file mode 100644 index 0000000..02eddd0 --- /dev/null +++ b/site/pages/search/designers/[name].tsx @@ -0,0 +1,16 @@ +import { getSearchStaticProps } from '@lib/search-props' +import type { GetStaticPathsResult, GetStaticPropsContext } from 'next' +import Search from '@components/search' + +export async function getStaticProps(context: GetStaticPropsContext) { + return getSearchStaticProps(context) +} + +export function getStaticPaths(): GetStaticPathsResult { + return { + paths: [], + fallback: 'blocking', + } +} + +export default Search diff --git a/site/pages/search/designers/[name]/[category].tsx b/site/pages/search/designers/[name]/[category].tsx new file mode 100644 index 0000000..02eddd0 --- /dev/null +++ b/site/pages/search/designers/[name]/[category].tsx @@ -0,0 +1,16 @@ +import { getSearchStaticProps } from '@lib/search-props' +import type { GetStaticPathsResult, GetStaticPropsContext } from 'next' +import Search from '@components/search' + +export async function getStaticProps(context: GetStaticPropsContext) { + return getSearchStaticProps(context) +} + +export function getStaticPaths(): GetStaticPathsResult { + return { + paths: [], + fallback: 'blocking', + } +} + +export default Search diff --git a/site/pages/shop.js b/site/pages/shop.js new file mode 100644 index 0000000..e21451f --- /dev/null +++ b/site/pages/shop.js @@ -0,0 +1,310 @@ +import React from 'react' +import Grid from "@mui/material/Grid"; +import Container from "@mui/material/Container"; +import Typography from '@mui/material/Typography'; +import { Box } from '@mui/system'; +import Breadcrumbs from "@mui/material/Breadcrumbs"; +import { makeStyles } from "@material-ui/core/styles"; +import Product from '../components/product'; +import Collection from '../components/collection'; +import Divider from '@mui/material/Divider'; +import { useRouter } from "next/router"; +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import ListItemButton from '@mui/material/ListItemButton'; +import ListItemText from '@mui/material/ListItemText'; +import Banner from '../assets/banner_page.png'; +import commerce from '@lib/api/commerce'; + + + +// const PRODUCT_QUERY = gql`query Product{ +// products(options: {take:12}) { +// items { +// name +// slug +// assets { +// name +// source +// } +// variants { +// price +// } +// collections { +// name +// id +// slug +// } +// } +// } +// }`; + +// const COLLECTION_QUERY = gql`query Product($slug:String!) { +// collection(slug: $slug) { +// name +// productVariants { +// items { +// product { +// name +// description +// slug +// assets { +// source +// } +// variants { +// price +// } +// collections{ +// name +// slug +// } +// } +// } +// } +// } +// }`; + +const colorHover = '#40c6ff'; +const useStyles_pageShop = makeStyles(theme => ({ + pageShop: { + marginBottom: "60px", + minHeight: "200px", + backgroundImage: `url(${Banner.src})`, + backgroundSize: "cover" + }, + + titlePage: { + display: "flex", + paddingTop: "75px", + paddingBottom: "75px", + "@media (max-width: 768px)": { + display: "block" + } + }, + + rightTextPage: { + float: "right", + paddingTop: "12px", + "@media (max-width: 768px)": { + float: "inherit" + } + }, + productCategory: { + display: "flex", + "@media (max-width: 768px)": { + display: "flex", + flexDirection: "column-reverse" + } + }, + productCategoryText: { + marginRight: "25px" + }, + textCartegory: { + padding: '10px 0px', + borderBottom: '1px solid #ccc', + color: '#676c77', + transition: '0.21s', + '& div.MuiTreeItem-content': { + padding: '0px!important', + '&:hover': { + background: '#fff', + }, + '&:focus': { + background: '#fff', + }, + '& svg': { + color: '#676c77', + } + }, + '&:hover': { + color: '#000', + } + }, + titleCartegory: { + marginBottom: "10px", + marginTop: "10px", + }, + titleSideBarCategory: { + position: 'relative', + borderBottom: ' 1px solid #ccc', + paddingBottom: '15px', + marginBottom: '20px', + fontFamily: 'Merriweather,sans-serif', + fontWeight: 'bold', + fontSize: '24px', + '&:before': { + position: 'absolute', + content: '""', + width: '60px', + height: '1px', + bottom: '-1px', + backgroundColor: `${colorHover}`, + } + }, + categoryText: { + paddingLeft: "0px", + '&:hover': { + backgroundColor: "#fff !important", + } + }, + textTile: { + color: "white", + fontFamily: "Merriweather", + fontSize: "50px", + fontWeight: 700 + }, + titleText: { + color: "white", + fontFamily: "Muli", + fontWeight: 400, + fontSize: "14px" + }, +})) + +export default function Shop(props) { + const classes = useStyles_pageShop(); + const {collection,products } = props; + // console.log('Shop Product', products); + + const router = useRouter(); + const handleSubmit = (slug) => { + router.push(`collection/${slug}`); + }; + + return ( + + + + + + + + + Shop + + + + + + + + Home + + + Shop + + + + + + + + + + + + Product Category + + + + + handleSubmit(`custom-prints`)} > + Custom Prints + + + + + + + + + handleSubmit(`free-file-check`)} > + Free file check + + + + + + + + + handleSubmit(`graphic-design`)} > + Graphic Design + + + + + + + + + handleSubmit(`mailing`)}> + Mailing + + + + + + + + + + + {products.length ? ( + products.map(product => ) + ) : ''} + + + + + + + ); +} + +export async function getStaticProps({ + preview, + locale, + locales, +}) { + const config = { locale, locales } + const productsPromise = commerce.getAllProducts({ + variables: { first: 12 }, + config, + preview, + // Saleor provider only + ...({ featured: true }), + }) + const { products } = await productsPromise + + + return { + props: { + products, + }, + revalidate: 60, + } +} + +// export async function getServerSideProps({ query }) { + +// const result = await client.query({ +// query: PRODUCT_QUERY, +// }); + + + +// return { +// props: { +// products: result.data.products.items, +// }, +// }; +// } \ No newline at end of file diff --git a/site/pages/styles/Home.module.css b/site/pages/styles/Home.module.css new file mode 100644 index 0000000..32a57d5 --- /dev/null +++ b/site/pages/styles/Home.module.css @@ -0,0 +1,116 @@ +.container { + padding: 0 2rem; +} + +.main { + min-height: 100vh; + padding: 4rem 0; + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.footer { + display: flex; + flex: 1; + padding: 2rem 0; + border-top: 1px solid #eaeaea; + justify-content: center; + align-items: center; +} + +.footer a { + display: flex; + justify-content: center; + align-items: center; + flex-grow: 1; +} + +.title a { + color: #0070f3; + text-decoration: none; +} + +.title a:hover, +.title a:focus, +.title a:active { + text-decoration: underline; +} + +.title { + margin: 0; + line-height: 1.15; + font-size: 4rem; +} + +.title, +.description { + text-align: center; +} + +.description { + margin: 4rem 0; + line-height: 1.5; + font-size: 1.5rem; +} + +.code { + background: #fafafa; + border-radius: 5px; + padding: 0.75rem; + font-size: 1.1rem; + font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, + Bitstream Vera Sans Mono, Courier New, monospace; +} + +.grid { + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + max-width: 800px; +} + +.card { + margin: 1rem; + padding: 1.5rem; + text-align: left; + color: inherit; + text-decoration: none; + border: 1px solid #eaeaea; + border-radius: 10px; + transition: color 0.15s ease, border-color 0.15s ease; + max-width: 300px; +} + +.card:hover, +.card:focus, +.card:active { + color: #0070f3; + border-color: #0070f3; +} + +.card h2 { + margin: 0 0 1rem 0; + font-size: 1.5rem; +} + +.card p { + margin: 0; + font-size: 1.25rem; + line-height: 1.5; +} + +.logo { + height: 1em; + margin-left: 0.5rem; +} + +@media (max-width: 600px) { + .grid { + width: 100%; + flex-direction: column; + } +} diff --git a/site/pages/styles/globals.css b/site/pages/styles/globals.css new file mode 100644 index 0000000..e2e6d0f --- /dev/null +++ b/site/pages/styles/globals.css @@ -0,0 +1,16 @@ +html, +body { + padding: 0; + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, + Helvetica Neue, sans-serif; +} + +a { + color: inherit; + text-decoration: none; +} + +* { + box-sizing: border-box; +} diff --git a/site/pages/thankiu.js b/site/pages/thankiu.js new file mode 100644 index 0000000..526d05f --- /dev/null +++ b/site/pages/thankiu.js @@ -0,0 +1,112 @@ +import * as React from 'react'; +import { makeStyles } from "@material-ui/core/styles"; +import { Container, Grid, Paper } from '@mui/material'; +import { Box } from '@mui/system'; +import Typography from "@mui/material/Typography"; +import Link from 'next/link'; +import CheckCircleIcon from '@mui/icons-material/CheckCircle'; +import Button from "@mui/material/Button"; + + + + +const useStyles = makeStyles({ + pageThank:{ + textAlign:"center", + marginBottom:50, + marginTop:50 + }, + viewOrder: { + borderRadius: '20px', + height: '40px', + lineHeight: '34px', + padding: '0px 30px', + color: '#fff', + border: 'none', + textTransform: 'uppercase', + fontSize: '16px', + marginTop: '20px', + '&:hover': { + cursor: 'pointer', + } + }, + icon:{ + paddingTop:30, + paddingBottom:20 + }, + iconCheck:{ + color:"green", + fontSize:"60px", + marginTop:"4px", + marginLeft:"6px", + }, + text:{ + color:"#40c6ff", + marginTop:"30px", + marginBottom:"20px", + + }, + textmain:{ + fontWeight:600, + fontSize:"48px" + }, + title:{ + width:"815px", + margin:"auto", + marginTop:"20px", + marginBottom:"60px" + + }, + titlemain:{ + fontSize:"24px" + }, + button:{ + display:"inline-flex", + marginBottom:"15px" + }, + buttonShop:{ + margin:"15px", + }, + buttonOrder:{ + margin:"15px" + } + +}) +export default function About() { + const classes = useStyles(); + + return ( + <> + + + + + + + + + Order confirmed + + + + You order is confirmed. You will receive an order confirmation email/SMS shortly with the expected delivery date for your items. + + + + + + + + + + + + + + + + + + + ); +} diff --git a/site/pages/wishlist.tsx b/site/pages/wishlist.tsx new file mode 100644 index 0000000..a654b12 --- /dev/null +++ b/site/pages/wishlist.tsx @@ -0,0 +1,82 @@ +import type { GetStaticPropsContext } from 'next' +import commerce from '@lib/api/commerce' +import { Heart } from '@components/icons' +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' +import Layout from '@components/common/Layout/Layout' + +export async function getStaticProps({ + preview, + locale, + locales, +}: GetStaticPropsContext) { + // Disabling page if Feature is not available + if (!process.env.COMMERCE_WISHLIST_ENABLED) { + return { + notFound: true, + } + } + + const config = { locale, locales } + const pagesPromise = commerce.getAllPages({ config, preview }) + const siteInfoPromise = commerce.getSiteInfo({ config, preview }) + const { pages } = await pagesPromise + const { categories } = await siteInfoPromise + + return { + props: { + pages, + categories, + }, + } +} + +export default function Wishlist() { + const { data: customer } = useCustomer() + // @ts-ignore Shopify - Fix this types + const { data, isLoading, isEmpty } = useWishlist({ includeProducts: true }) + + return ( + +
    + My Wishlist +
    + {isLoading ? ( +
    + {rangeMap(12, (i) => ( + +
    + + ))} +
    + ) : isEmpty ? ( +
    + + + +

    + Your wishlist is empty +

    +

    + Biscuit oat cake wafer icing ice cream tiramisu pudding cupcake. +

    +
    + ) : ( +
    + {data && + // @ts-ignore - Wishlist Item Type + data.items?.map((item) => ( + + ))} +
    + )} +
    +
    + + ) +} + +Wishlist.Layout = Layout diff --git a/site/postcss.config.js b/site/postcss.config.js new file mode 100644 index 0000000..5f89537 --- /dev/null +++ b/site/postcss.config.js @@ -0,0 +1,20 @@ +module.exports = { + plugins: [ + 'tailwindcss/nesting', + 'tailwindcss', + 'autoprefixer', + 'postcss-flexbugs-fixes', + [ + 'postcss-preset-env', + { + autoprefixer: { + flexbox: 'no-2009', + }, + stage: 3, + features: { + 'custom-properties': false, + }, + }, + ], + ], +} diff --git a/site/public/assets/drop-shirt-0.png b/site/public/assets/drop-shirt-0.png new file mode 100644 index 0000000..b698a83 Binary files /dev/null and b/site/public/assets/drop-shirt-0.png differ diff --git a/site/public/assets/drop-shirt-1.png b/site/public/assets/drop-shirt-1.png new file mode 100644 index 0000000..42aa8e4 Binary files /dev/null and b/site/public/assets/drop-shirt-1.png differ diff --git a/site/public/assets/drop-shirt-2.png b/site/public/assets/drop-shirt-2.png new file mode 100644 index 0000000..dc243dc Binary files /dev/null and b/site/public/assets/drop-shirt-2.png differ diff --git a/site/public/assets/drop-shirt.png b/site/public/assets/drop-shirt.png new file mode 100644 index 0000000..b698a83 Binary files /dev/null and b/site/public/assets/drop-shirt.png differ diff --git a/site/public/assets/lightweight-jacket-0.png b/site/public/assets/lightweight-jacket-0.png new file mode 100644 index 0000000..a62a0bd Binary files /dev/null and b/site/public/assets/lightweight-jacket-0.png differ diff --git a/site/public/assets/lightweight-jacket-1.png b/site/public/assets/lightweight-jacket-1.png new file mode 100644 index 0000000..fe2d70a Binary files /dev/null and b/site/public/assets/lightweight-jacket-1.png differ diff --git a/site/public/assets/lightweight-jacket-2.png b/site/public/assets/lightweight-jacket-2.png new file mode 100644 index 0000000..75cc22d Binary files /dev/null and b/site/public/assets/lightweight-jacket-2.png differ diff --git a/site/public/assets/t-shirt-0.png b/site/public/assets/t-shirt-0.png new file mode 100644 index 0000000..80ad64d Binary files /dev/null and b/site/public/assets/t-shirt-0.png differ diff --git a/site/public/assets/t-shirt-1.png b/site/public/assets/t-shirt-1.png new file mode 100644 index 0000000..bd3fab6 Binary files /dev/null and b/site/public/assets/t-shirt-1.png differ diff --git a/site/public/assets/t-shirt-2.png b/site/public/assets/t-shirt-2.png new file mode 100644 index 0000000..eb591ef Binary files /dev/null and b/site/public/assets/t-shirt-2.png differ diff --git a/site/public/assets/t-shirt-3.png b/site/public/assets/t-shirt-3.png new file mode 100644 index 0000000..ff32516 Binary files /dev/null and b/site/public/assets/t-shirt-3.png differ diff --git a/site/public/assets/t-shirt-4.png b/site/public/assets/t-shirt-4.png new file mode 100644 index 0000000..8a908d7 Binary files /dev/null and b/site/public/assets/t-shirt-4.png differ diff --git a/site/public/bg-products.svg b/site/public/bg-products.svg new file mode 100644 index 0000000..2118c32 --- /dev/null +++ b/site/public/bg-products.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/site/public/card.png b/site/public/card.png new file mode 100644 index 0000000..40fcf42 Binary files /dev/null and b/site/public/card.png differ diff --git a/site/public/cursor-left.png b/site/public/cursor-left.png new file mode 100644 index 0000000..3c292b0 Binary files /dev/null and b/site/public/cursor-left.png differ diff --git a/site/public/cursor-right.png b/site/public/cursor-right.png new file mode 100644 index 0000000..e3b46de Binary files /dev/null and b/site/public/cursor-right.png differ diff --git a/site/public/favicon.ico b/site/public/favicon.ico new file mode 100644 index 0000000..c4826c9 Binary files /dev/null and b/site/public/favicon.ico differ diff --git a/site/public/flag-en-us.svg b/site/public/flag-en-us.svg new file mode 100644 index 0000000..5e77dee --- /dev/null +++ b/site/public/flag-en-us.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/public/flag-es-ar.svg b/site/public/flag-es-ar.svg new file mode 100644 index 0000000..4d6ffc4 --- /dev/null +++ b/site/public/flag-es-ar.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/site/public/flag-es-co.svg b/site/public/flag-es-co.svg new file mode 100644 index 0000000..6188203 --- /dev/null +++ b/site/public/flag-es-co.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/site/public/flag-es.svg b/site/public/flag-es.svg new file mode 100644 index 0000000..5e8e8f0 --- /dev/null +++ b/site/public/flag-es.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/public/icon-144x144.png b/site/public/icon-144x144.png new file mode 100644 index 0000000..aeeaabd Binary files /dev/null and b/site/public/icon-144x144.png differ diff --git a/site/public/icon-192x192.png b/site/public/icon-192x192.png new file mode 100644 index 0000000..055ecf3 Binary files /dev/null and b/site/public/icon-192x192.png differ diff --git a/site/public/icon-512x512.png b/site/public/icon-512x512.png new file mode 100644 index 0000000..754628c Binary files /dev/null and b/site/public/icon-512x512.png differ diff --git a/site/public/icon.png b/site/public/icon.png new file mode 100644 index 0000000..c4df8c7 Binary files /dev/null and b/site/public/icon.png differ diff --git a/site/public/product-img-placeholder.svg b/site/public/product-img-placeholder.svg new file mode 100644 index 0000000..fbb43bb --- /dev/null +++ b/site/public/product-img-placeholder.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/site/public/site.webmanifest b/site/public/site.webmanifest new file mode 100644 index 0000000..bb792da --- /dev/null +++ b/site/public/site.webmanifest @@ -0,0 +1,22 @@ +{ + "name": "Next.js Commerce", + "short_name": "Next.js Commerce", + "description": "Next.js Commerce -> https://www.nextjs.org/commerce", + "display": "standalone", + "start_url": "/", + "theme_color": "#fff", + "background_color": "#000000", + "orientation": "portrait", + "icons": [ + { + "src": "/icon-192x192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "/icon-512x512.png", + "type": "image/png", + "sizes": "512x512" + } + ] +} \ No newline at end of file diff --git a/site/public/slider-arrows.png b/site/public/slider-arrows.png new file mode 100644 index 0000000..0740919 Binary files /dev/null and b/site/public/slider-arrows.png differ diff --git a/site/public/vercel.svg b/site/public/vercel.svg new file mode 100644 index 0000000..c0a8ee4 --- /dev/null +++ b/site/public/vercel.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/site/tailwind.config.js b/site/tailwind.config.js new file mode 100644 index 0000000..09a8d21 --- /dev/null +++ b/site/tailwind.config.js @@ -0,0 +1,58 @@ +module.exports = { + content: [ + './pages/**/*.{js,ts,jsx,tsx}', + './components/**/*.{js,ts,jsx,tsx}', + ], + safelist: ['outline-none'], + theme: { + extend: { + maxWidth: { + '8xl': '1920px', + }, + colors: { + primary: 'var(--primary)', + 'primary-2': 'var(--primary-2)', + secondary: 'var(--secondary)', + 'secondary-2': 'var(--secondary-2)', + hover: 'var(--hover)', + 'hover-1': 'var(--hover-1)', + 'hover-2': 'var(--hover-2)', + 'accent-0': 'var(--accent-0)', + 'accent-1': 'var(--accent-1)', + 'accent-2': 'var(--accent-2)', + 'accent-3': 'var(--accent-3)', + 'accent-4': 'var(--accent-4)', + 'accent-5': 'var(--accent-5)', + 'accent-6': 'var(--accent-6)', + 'accent-7': 'var(--accent-7)', + 'accent-8': 'var(--accent-8)', + 'accent-9': 'var(--accent-9)', + violet: 'var(--violet)', + 'violet-light': 'var(--violet-light)', + 'violet-dark': 'var(--violet-dark)', + pink: 'var(--pink)', + 'pink-light': 'var(--pink-light)', + cyan: 'var(--cyan)', + blue: 'var(--blue)', + green: 'var(--green)', + red: 'var(--red)', + }, + textColor: { + base: 'var(--text-base)', + primary: 'var(--text-primary)', + secondary: 'var(--text-secondary)', + }, + boxShadow: { + 'outline-normal': '0 0 0 2px var(--accent-2)', + magical: + 'rgba(0, 0, 0, 0.02) 0px 30px 30px, rgba(0, 0, 0, 0.03) 0px 0px 8px, rgba(0, 0, 0, 0.05) 0px 1px 0px', + }, + lineHeight: { + 'extra-loose': '2.2', + }, + scale: { + 120: '1.2', + }, + }, + }, +} diff --git a/site/tsconfig.json b/site/tsconfig.json new file mode 100644 index 0000000..fdadc2b --- /dev/null +++ b/site/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "target": "esnext", + "module": "esnext", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "esModuleInterop": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "paths": { + "@lib/*": ["lib/*"], + "@utils/*": ["utils/*"], + "@config/*": ["config/*"], + "@assets/*": ["assets/*"], + "@components/*": ["components/*"], + "@commerce": ["../packages/commerce/src"], + "@commerce/*": ["../packages/commerce/src/*"], + "@framework": ["..\\packages\\vendure\\src"], + "@framework/*": ["..\\packages\\vendure\\src/*"] + } + }, + "include": ["next-env.d.ts", "**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"], + "exclude": ["node_modules"] +} diff --git a/turbo.json b/turbo.json new file mode 100644 index 0000000..8e38ccd --- /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 new file mode 100644 index 0000000..bc62747 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,8369 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@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.16.7" + +"@babel/compat-data@^7.16.4": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.8.tgz#31560f9f29fdf1868de8cb55049538a1b9732a60" + integrity sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q== + +"@babel/core@^7.14.0": + version "7.16.12" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.12.tgz#5edc53c1b71e54881315923ae2aedea2522bb784" + integrity sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.16.8" + "@babel/helper-compilation-targets" "^7.16.7" + "@babel/helper-module-transforms" "^7.16.7" + "@babel/helpers" "^7.16.7" + "@babel/parser" "^7.16.12" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.16.10" + "@babel/types" "^7.16.8" + 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.14.0", "@babel/generator@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.8.tgz#359d44d966b8cd059d543250ce79596f792f2ebe" + integrity sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw== + dependencies: + "@babel/types" "^7.16.8" + jsesc "^2.5.1" + source-map "^0.5.0" + +"@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.16.7" + +"@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.16.4" + "@babel/helper-validator-option" "^7.16.7" + browserslist "^4.17.5" + semver "^6.3.0" + +"@babel/helper-create-class-features-plugin@^7.16.7": + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.10.tgz#8a6959b9cc818a88815ba3c5474619e9c0f2c21c" + integrity sha512-wDeej0pu3WN/ffTxMNCPW5UCiOav8IcLRxSIyp/9+IF2xJUM9h/OYjg0IJLHaL6F8oU8kqMz9nc1vryXhMsgXg== + dependencies: + "@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-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/types" "^7.16.7" + +"@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/helper-get-function-arity" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/types" "^7.16.7" + +"@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.16.7" + +"@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.16.7" + +"@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.16.7" + +"@babel/helper-module-imports@^7.12.13", "@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/types" "^7.16.7" + +"@babel/helper-module-transforms@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz#7665faeb721a01ca5327ddc6bba15a5cb34b6a41" + integrity sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng== + dependencies: + "@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.16.7" + "@babel/types" "^7.16.7" + +"@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/types" "^7.16.7" + +"@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@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-plugin-utils@^7.17.12": + version "7.17.12" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.17.12.tgz#86c2347da5acbf5583ba0a10aed4c9bf9da9cf96" + integrity sha512-JDkf04mqtN3y4iAbO1hv9U2ARpPyPL1zqyWs/2WG1pgSq9llHFjStX5jdxb84himgJm+8Ng+x0oiWF/nw/XQKA== + +"@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/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-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.16.7" + +"@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.16.0" + +"@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/types" "^7.16.7" + +"@babel/helper-validator-identifier@^7.14.9", "@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.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.7.tgz#7e3504d708d50344112767c3542fc5e357fffefc" + integrity sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw== + dependencies: + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.16.7" + "@babel/types" "^7.16.7" + +"@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.14.0", "@babel/parser@^7.16.10", "@babel/parser@^7.16.12", "@babel/parser@^7.16.7", "@babel/parser@^7.16.8": + version "7.16.12" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.12.tgz#9474794f9a650cf5e2f892444227f98e28cdf8b6" + integrity sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A== + +"@babel/plugin-proposal-class-properties@^7.0.0": + 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.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + +"@babel/plugin-proposal-object-rest-spread@^7.0.0": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.16.7.tgz#94593ef1ddf37021a25bdcb5754c4a8d534b01d8" + integrity sha512-3O0Y4+dw94HA86qSg9IHfyPktgR7q3gpNVAeiKQd+8jBKFaU5NQS1Yatgo4wY+UFNuLjvxcSmzcsHqrhgTyBUA== + dependencies: + "@babel/compat-data" "^7.16.4" + "@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.16.7" + +"@babel/plugin-syntax-class-properties@^7.0.0": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@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.16.7" + +"@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== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@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.16.7" + +"@babel/plugin-syntax-jsx@^7.12.13": + version "7.17.12" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.17.12.tgz#834035b45061983a491f60096f61a2e7c5674a47" + integrity sha512-spyY3E3AURfxh/RHtjx5j6hs8am5NbUBGfcZ2vB3uShSpZdQyXSf5rR5Mk76vbtlAZOelyVQ71Fg0x9SG4fsog== + dependencies: + "@babel/helper-plugin-utils" "^7.17.12" + +"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-transform-arrow-functions@^7.0.0": + 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.16.7" + +"@babel/plugin-transform-block-scoped-functions@^7.0.0": + 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.16.7" + +"@babel/plugin-transform-block-scoping@^7.0.0": + 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.16.7" + +"@babel/plugin-transform-classes@^7.0.0": + 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.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.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.16.7" + +"@babel/plugin-transform-destructuring@^7.0.0": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.16.7.tgz#ca9588ae2d63978a4c29d3f33282d8603f618e23" + integrity sha512-VqAwhTHBnu5xBVDCvrvqJbtLUa++qZaWC0Fgr2mqokBlulZARGyIvZDoqbPlPaKImQ9dKAcCzbv+ul//uqu70A== + dependencies: + "@babel/helper-plugin-utils" "^7.16.7" + +"@babel/plugin-transform-flow-strip-types@^7.0.0": + 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.16.7" + "@babel/plugin-syntax-flow" "^7.16.7" + +"@babel/plugin-transform-for-of@^7.0.0": + 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.16.7" + +"@babel/plugin-transform-function-name@^7.0.0": + 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-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.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.16.7" + +"@babel/plugin-transform-member-expression-literals@^7.0.0": + 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.16.7" + +"@babel/plugin-transform-modules-commonjs@^7.0.0": + 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.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.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.16.7" + "@babel/helper-replace-supers" "^7.16.7" + +"@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.16.7" + +"@babel/plugin-transform-property-literals@^7.0.0": + 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.16.7" + +"@babel/plugin-transform-react-display-name@^7.0.0": + 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.16.7" + +"@babel/plugin-transform-react-jsx@^7.0.0": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.16.7.tgz#86a6a220552afd0e4e1f0388a68a372be7add0d4" + integrity sha512-8D16ye66fxiE8m890w0BpPpngG9o9OVBBy0gH2E+2AR7qMR2ZpTYJEqLxAsoroenMId0p/wMW+Blc0meDgu0Ag== + dependencies: + "@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.16.7" + +"@babel/plugin-transform-shorthand-properties@^7.0.0": + 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.16.7" + +"@babel/plugin-transform-spread@^7.0.0": + 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.16.7" + "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" + +"@babel/plugin-transform-template-literals@^7.0.0": + 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.16.7" + +"@babel/runtime-corejs3@^7.10.2": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.16.8.tgz#ea533d96eda6fdc76b1812248e9fbd0c11d4a1a7" + integrity sha512-3fKhuICS1lMz0plI5ktOE/yEtBRMVxplzRkdn6mJQ197XiY0JnrzYV0+Mxozq3JZ8SBV9Ecurmw1XsGbwOf+Sg== + dependencies: + core-js-pure "^3.20.2" + regenerator-runtime "^0.13.4" + +"@babel/runtime@7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.0.0.tgz#adeb78fedfc855aa05bc041640f3f6f98e85424c" + integrity sha512-7hGhzlcmg01CvH1EHdSPVXYX1aJ8KCEyz6I9xYIi/asDtzBPMyMhVibhM/K6g/5qnKBwjZtp10bNZIEFTRW1MA== + dependencies: + regenerator-runtime "^0.12.0" + +"@babel/runtime@7.4.5": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.5.tgz#582bb531f5f9dc67d2fcb682979894f75e253f12" + integrity sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ== + dependencies: + regenerator-runtime "^0.13.2" + +"@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.16.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.7.tgz#03ff99f64106588c9c403c6ecb8c3bafbbdff1fa" + integrity sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ== + dependencies: + regenerator-runtime "^0.13.4" + +"@babel/runtime@^7.13.10": + 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/runtime@^7.17.2", "@babel/runtime@^7.2.0", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.7": + version "7.18.3" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.3.tgz#c7b654b57f6f63cf7f8b418ac9ca04408c4579f4" + integrity sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug== + dependencies: + regenerator-runtime "^0.13.4" + +"@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.16.7" + "@babel/parser" "^7.16.7" + "@babel/types" "^7.16.7" + +"@babel/traverse@^7.14.0", "@babel/traverse@^7.16.10", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8": + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.10.tgz#448f940defbe95b5a8029975b051f75993e8239f" + integrity sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.16.8" + "@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.16.10" + "@babel/types" "^7.16.8" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@7.15.0": + version "7.15.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.0.tgz#61af11f2286c4e9c69ca8deb5f4375a73c72dcbd" + integrity sha512-OBvfqnllOIdX4ojTHpwZbpvz4j3EWyjkZEdmjH0/cgsd6QOdSgU8rLSk6ard/pcW7rlmjdVSX/AWOaORR1uNOQ== + dependencies: + "@babel/helper-validator-identifier" "^7.14.9" + to-fast-properties "^2.0.0" + +"@babel/types@^7.0.0", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.8.tgz#0ba5da91dd71e0a4e7781a30f22770831062e3c1" + integrity sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg== + dependencies: + "@babel/helper-validator-identifier" "^7.16.7" + to-fast-properties "^2.0.0" + +"@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: + "@babel/runtime" "^7.7.4" + axios "^0.21.1" + +"@commerce-apps/core@^1.5.5": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@commerce-apps/core/-/core-1.5.5.tgz#e82e3c3cbb2a184789eeb8668d004a799792f9d0" + integrity sha512-AlNLY2Mv0/2sNbJq74MHrYKiCXyJytekgfrxUcaYARnB8KGvexV4MhHiVYj1TYVINroLrO4rW0D9uKLCn7nHxA== + dependencies: + "@keyv/redis" "^2.2.0" + dotenv "^8.6.0" + fetch-to-curl "^0.5.2" + ioredis "^4.28.1" + jsonwebtoken "^8.5.1" + keyv "^4.0.4" + lodash "^4.17.21" + loglevel "^1.8.0" + make-fetch-happen "^8.0.14" + minipass-fetch "^1.4.1" + qs "^6.10.2" + quick-lru "^5.1.1" + retry "^0.13.1" + snyk "^1.759.0" + ssri "^8.0.1" + tslib "^1.14.1" + +"@emotion/babel-plugin@^11.7.1": + version "11.9.2" + resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.9.2.tgz#723b6d394c89fb2ef782229d92ba95a740576e95" + integrity sha512-Pr/7HGH6H6yKgnVFNEj2MVlreu3ADqftqjqwUvDy/OJzKFgxKeTQ+eeUf20FOTuHVkDON2iNa25rAXVYtWJCjw== + dependencies: + "@babel/helper-module-imports" "^7.12.13" + "@babel/plugin-syntax-jsx" "^7.12.13" + "@babel/runtime" "^7.13.10" + "@emotion/hash" "^0.8.0" + "@emotion/memoize" "^0.7.5" + "@emotion/serialize" "^1.0.2" + babel-plugin-macros "^2.6.1" + convert-source-map "^1.5.0" + escape-string-regexp "^4.0.0" + find-root "^1.1.0" + source-map "^0.5.7" + stylis "4.0.13" + +"@emotion/cache@^11.7.1": + version "11.7.1" + resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.7.1.tgz#08d080e396a42e0037848214e8aa7bf879065539" + integrity sha512-r65Zy4Iljb8oyjtLeCuBH8Qjiy107dOYC6SJq7g7GV5UCQWMObY4SJDPGFjiiVpPrOJ2hmJOoBiYTC7hwx9E2A== + dependencies: + "@emotion/memoize" "^0.7.4" + "@emotion/sheet" "^1.1.0" + "@emotion/utils" "^1.0.0" + "@emotion/weak-memoize" "^0.2.5" + stylis "4.0.13" + +"@emotion/hash@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.8.0.tgz#bbbff68978fefdbe68ccb533bc8cbe1d1afb5413" + integrity sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow== + +"@emotion/is-prop-valid@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-1.1.2.tgz#34ad6e98e871aa6f7a20469b602911b8b11b3a95" + integrity sha512-3QnhqeL+WW88YjYbQL5gUIkthuMw7a0NGbZ7wfFVk2kg/CK5w8w5FFa0RzWjyY1+sujN0NWbtSHH6OJmWHtJpQ== + dependencies: + "@emotion/memoize" "^0.7.4" + +"@emotion/memoize@^0.7.4", "@emotion/memoize@^0.7.5": + version "0.7.5" + resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.5.tgz#2c40f81449a4e554e9fc6396910ed4843ec2be50" + integrity sha512-igX9a37DR2ZPGYtV6suZ6whr8pTFtyHL3K/oLUotxpSVO2ASaprmAe2Dkq7tBo7CRY7MMDrAa9nuQP9/YG8FxQ== + +"@emotion/react@^11.9.0": + version "11.9.0" + resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.9.0.tgz#b6d42b1db3bd7511e7a7c4151dc8bc82e14593b8" + integrity sha512-lBVSF5d0ceKtfKCDQJveNAtkC7ayxpVlgOohLgXqRwqWr9bOf4TZAFFyIcNngnV6xK6X4x2ZeXq7vliHkoVkxQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@emotion/babel-plugin" "^11.7.1" + "@emotion/cache" "^11.7.1" + "@emotion/serialize" "^1.0.3" + "@emotion/utils" "^1.1.0" + "@emotion/weak-memoize" "^0.2.5" + hoist-non-react-statics "^3.3.1" + +"@emotion/serialize@^1.0.2", "@emotion/serialize@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-1.0.3.tgz#99e2060c26c6292469fb30db41f4690e1c8fea63" + integrity sha512-2mSSvgLfyV3q+iVh3YWgNlUc2a9ZlDU7DjuP5MjK3AXRR0dYigCrP99aeFtaB2L/hjfEZdSThn5dsZ0ufqbvsA== + dependencies: + "@emotion/hash" "^0.8.0" + "@emotion/memoize" "^0.7.4" + "@emotion/unitless" "^0.7.5" + "@emotion/utils" "^1.0.0" + csstype "^3.0.2" + +"@emotion/sheet@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.1.0.tgz#56d99c41f0a1cda2726a05aa6a20afd4c63e58d2" + integrity sha512-u0AX4aSo25sMAygCuQTzS+HsImZFuS8llY8O7b9MDRzbJM0kVJlAz6KNDqcG7pOuQZJmj/8X/rAW+66kMnMW+g== + +"@emotion/styled@^11.8.1": + version "11.8.1" + resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-11.8.1.tgz#856f6f63aceef0eb783985fa2322e2bf66d04e17" + integrity sha512-OghEVAYBZMpEquHZwuelXcRjRJQOVayvbmNR0zr174NHdmMgrNkLC6TljKC5h9lZLkN5WGrdUcrKlOJ4phhoTQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@emotion/babel-plugin" "^11.7.1" + "@emotion/is-prop-valid" "^1.1.2" + "@emotion/serialize" "^1.0.2" + "@emotion/utils" "^1.1.0" + +"@emotion/unitless@^0.7.5": + version "0.7.5" + resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.5.tgz#77211291c1900a700b8a78cfafda3160d76949ed" + integrity sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg== + +"@emotion/utils@^1.0.0", "@emotion/utils@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-1.1.0.tgz#86b0b297f3f1a0f2bdb08eeac9a2f49afd40d0cf" + integrity sha512-iRLa/Y4Rs5H/f2nimczYmS5kFJEbpiVvgN3XVfZ022IYhuNA1IRSHEizcof88LtCTXtl9S2Cxt32KgaXEu72JQ== + +"@emotion/weak-memoize@^0.2.5": + version "0.2.5" + resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz#8eed982e2ee6f7f4e44c253e12962980791efd46" + integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA== + +"@endemolshinegroup/cosmiconfig-typescript-loader@3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@endemolshinegroup/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-3.0.2.tgz#eea4635828dde372838b0909693ebd9aafeec22d" + integrity sha512-QRVtqJuS1mcT56oHpVegkKBlgtWjXw/gHNWO3eL9oyB5Sc7HBoc2OLG/nYpVfT/Jejvo3NUrD0Udk7XgoyDKkA== + dependencies: + lodash.get "^4" + make-error "^1" + ts-node "^9" + tslib "^2" + +"@eslint/eslintrc@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318" + integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.2.0" + 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" + +"@gar/promisify@^1.0.1": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" + integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== + +"@graphql-codegen/cli@^2.3.1": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@graphql-codegen/cli/-/cli-2.4.0.tgz#7df3ee2bdd5b88a5904ee6f52eafeb370ef70e51" + integrity sha512-4iiHH2AxBE17lX5cFdFg6+kh7I6uKQLYG0IZRalRbW/grKL7kuVp/RDUjmVB2GNJTJEhjxYLMJFJZocUmAUBlw== + dependencies: + "@graphql-codegen/core" "2.4.0" + "@graphql-codegen/plugin-helpers" "^2.3.2" + "@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.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" + 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" + mkdirp "^1.0.4" + string-env-interpolation "^1.0.1" + ts-log "^2.2.3" + 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@2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@graphql-codegen/core/-/core-2.4.0.tgz#d94dcc088b5e117c847ce5b10c4fe1eb7325e180" + integrity sha512-5RiYE1+07jayp/3w/bkyaCXtfKNeKmRabpPP4aRi369WeH2cH37l2K8NbhkIU+zhpnhoqMID61TO56x2fKldZQ== + dependencies: + "@graphql-codegen/plugin-helpers" "^2.3.2" + "@graphql-tools/schema" "^8.1.2" + "@graphql-tools/utils" "^8.1.1" + tslib "~2.3.0" + +"@graphql-codegen/plugin-helpers@^2.3.2": + version "2.3.2" + resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-2.3.2.tgz#3f9ba625791901d19be733db1dfc9a3dbd0dac44" + integrity sha512-19qFA5XMAWaAY64sBljjDPYfHjE+QMk/+oalCyY13WjSlcLDvYPfmFlCNgFSsydArDELlHR8T1GMbA7C42M8TA== + dependencies: + "@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.3.0" + +"@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" "^2.3.2" + "@graphql-tools/utils" "^8.1.1" + tslib "~2.3.0" + +"@graphql-codegen/typescript-operations@^2.2.2": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-operations/-/typescript-operations-2.2.2.tgz#028f2850ae85021d8932b5670e5feca7b0d5c767" + integrity sha512-J50AuTA37RYv67hP2oHbfr3iGxexTCoadQsbr5pEUGucrIupCA0hLEJH2W+9/h6YNh0UlZT3kRTJp81ARoAjOA== + dependencies: + "@graphql-codegen/plugin-helpers" "^2.3.2" + "@graphql-codegen/typescript" "^2.4.2" + "@graphql-codegen/visitor-plugin-common" "2.5.2" + auto-bind "~4.0.0" + tslib "~2.3.0" + +"@graphql-codegen/typescript@^2.4.2": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript/-/typescript-2.4.2.tgz#a239d5fd8f11140d5d4c81cfae7ff02054b724dc" + integrity sha512-8ajWidiFqF1KNAywtb/692SjwTyjzrDHo1sf2Q7Z+rh9qDEIrh83VHB8naT/1CefOvxj3MS6GbcsvJMizaE/AQ== + dependencies: + "@graphql-codegen/plugin-helpers" "^2.3.2" + "@graphql-codegen/schema-ast" "^2.4.1" + "@graphql-codegen/visitor-plugin-common" "2.5.2" + auto-bind "~4.0.0" + tslib "~2.3.0" + +"@graphql-codegen/visitor-plugin-common@2.5.2": + version "2.5.2" + resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-2.5.2.tgz#90aa4add41e17bca83f1c7c8ad674f2a06065efd" + integrity sha512-qDMraPmumG+vEGAz42/asRkdgIRmQWH5HTc320UX+I6CY6eE/Ey85cgzoqeQGLV8gu4sj3UkNx/3/r79eX4u+Q== + dependencies: + "@graphql-codegen/plugin-helpers" "^2.3.2" + "@graphql-tools/optimize" "^1.0.1" + "@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" + graphql-tag "^2.11.0" + parse-filepath "^1.0.2" + tslib "~2.3.0" + +"@graphql-tools/apollo-engine-loader@^7.0.5": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-7.2.2.tgz#1463f5d2d95b5ca2b602b35b4922b38935013860" + integrity sha512-jrtA1IvgbaHzla9nyBngNyvajudTcQAVE3//mgrK+DoN7UpUhtoXfxTOOq2tzZN67o4a6Bv/RJsxB3rSI3NLzg== + dependencies: + "@graphql-tools/utils" "^8.5.1" + cross-undici-fetch "^0.1.19" + sync-fetch "0.3.1" + tslib "~2.3.0" + +"@graphql-tools/batch-execute@^8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-8.3.1.tgz#0b74c54db5ac1c5b9a273baefc034c2343ebbb74" + integrity sha512-63kHY8ZdoO5FoeDXYHnAak1R3ysMViMPwWC2XUblFckuVLMUPmB2ONje8rjr2CvzWBHAW8c1Zsex+U3xhKtGIA== + dependencies: + "@graphql-tools/utils" "^8.5.1" + dataloader "2.0.0" + tslib "~2.3.0" + value-or-promise "1.0.11" + +"@graphql-tools/code-file-loader@^7.0.6": + version "7.2.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/code-file-loader/-/code-file-loader-7.2.3.tgz#b53e8809528da07911423c3a511e5fccf9121a12" + integrity sha512-aNVG3/VG5cUpS389rpCum+z7RY98qvPwOzd+J4LVr+f5hWQbDREnSFM+5RVTDfULujrsi7edKaGxGKp68pGmAA== + dependencies: + "@graphql-tools/graphql-tag-pluck" "^7.1.3" + "@graphql-tools/utils" "^8.5.1" + globby "^11.0.3" + tslib "~2.3.0" + unixify "^1.0.0" + +"@graphql-tools/delegate@^8.4.1", "@graphql-tools/delegate@^8.4.2": + version "8.4.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-8.4.3.tgz#ad73ed7cc3b4cad9242c6d4835a5ae0b640f7164" + integrity sha512-hKTJdJXJnKL0+2vpU+Kt7OHQTIXZ9mBmNBwHsYiG5WNArz/vNI7910r6TC2XMf/e7zhyyK+mXxMDBmDQkkJagA== + dependencies: + "@graphql-tools/batch-execute" "^8.3.1" + "@graphql-tools/schema" "^8.3.1" + "@graphql-tools/utils" "^8.5.4" + dataloader "2.0.0" + tslib "~2.3.0" + value-or-promise "1.0.11" + +"@graphql-tools/git-loader@^7.0.5": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@graphql-tools/git-loader/-/git-loader-7.1.2.tgz#7a7b5fc366bcc9e2e14e0463ff73f1a19aafabbd" + integrity sha512-vIMrISQPKQgHS893b8K/pEE1InPV+7etzFhHoyQRhYkVHXP2RBkfI64Wq9bNPezF8Ss/dwIjI/keLaPp9EQDmA== + dependencies: + "@graphql-tools/graphql-tag-pluck" "^7.1.3" + "@graphql-tools/utils" "^8.5.1" + is-glob "4.0.3" + micromatch "^4.0.4" + tslib "~2.3.0" + unixify "^1.0.0" + +"@graphql-tools/github-loader@^7.0.5": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@graphql-tools/github-loader/-/github-loader-7.2.2.tgz#632351eac56cbbda25e38ff7ea7bcb256f30a277" + integrity sha512-prk7fWkPQdkOIGv/tFxNFAmxrBbWwc/ztOk2m5tAfmdiVM0HR3MC5Ckx3kLpODVG7lpxKRamMsPCIqmjhrCLWQ== + dependencies: + "@graphql-tools/graphql-tag-pluck" "^7.1.3" + "@graphql-tools/utils" "^8.5.1" + cross-undici-fetch "^0.1.19" + sync-fetch "0.3.1" + tslib "~2.3.0" + +"@graphql-tools/graphql-file-loader@^7.0.5", "@graphql-tools/graphql-file-loader@^7.3.2": + version "7.3.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-file-loader/-/graphql-file-loader-7.3.3.tgz#7cee2f84f08dc13fa756820b510248b857583d36" + integrity sha512-6kUJZiNpYKVhum9E5wfl5PyLLupEDYdH7c8l6oMrk6c7EPEVs6iSUyB7yQoWrtJccJLULBW2CRQ5IHp5JYK0mA== + dependencies: + "@graphql-tools/import" "^6.5.7" + "@graphql-tools/utils" "^8.5.1" + globby "^11.0.3" + tslib "~2.3.0" + unixify "^1.0.0" + +"@graphql-tools/graphql-tag-pluck@^7.1.3": + version "7.1.5" + resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-tag-pluck/-/graphql-tag-pluck-7.1.5.tgz#229ed40f38430cdea750f112cbfad89fbc29129c" + integrity sha512-NKbFcjlg7cbK+scLXc6eVxXIhX4k8QL6lZ/y5Ju7yrpIN18k2vA78dI6W3Qb5qdftxbDNuC+kDmScZfzzxVPjQ== + dependencies: + "@babel/parser" "^7.16.8" + "@babel/traverse" "^7.16.8" + "@babel/types" "^7.16.8" + "@graphql-tools/utils" "^8.5.1" + tslib "~2.3.0" + +"@graphql-tools/import@^6.5.7": + version "6.6.5" + resolved "https://registry.yarnpkg.com/@graphql-tools/import/-/import-6.6.5.tgz#e1ec593960288ceda7d5c56c0073c702b1bdcfa0" + integrity sha512-w0/cYuhrr2apn+iGoTToCqt65x2NN2iHQyqRNk/Zw1NJ+e8/C3eKVw0jmW4pYQvSocuPxL4UCSI56SdKO7m3+Q== + dependencies: + "@graphql-tools/utils" "8.6.1" + resolve-from "5.0.0" + tslib "~2.3.0" + +"@graphql-tools/json-file-loader@^7.1.2", "@graphql-tools/json-file-loader@^7.3.2": + version "7.3.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/json-file-loader/-/json-file-loader-7.3.3.tgz#45cfde77b9dc4ab6c21575305ae537d2814d237f" + integrity sha512-CN2Qk9rt+Gepa3rb3X/mpxYA5MIYLwZBPj2Njw6lbZ6AaxG+O1ArDCL5ACoiWiBimn1FCOM778uhRM9znd0b3Q== + dependencies: + "@graphql-tools/utils" "^8.5.1" + globby "^11.0.3" + tslib "~2.3.0" + unixify "^1.0.0" + +"@graphql-tools/load@^7.3.0", "@graphql-tools/load@^7.4.1": + version "7.5.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/load/-/load-7.5.1.tgz#8c7f846d2185ddc1d44fdfbf1ed9cb678f69e40b" + integrity sha512-j9XcLYZPZdl/TzzqA83qveJmwcCxgGizt5L1+C1/Z68brTEmQHLdQCOR3Ma3ewESJt6DU05kSTu2raKaunkjRg== + dependencies: + "@graphql-tools/schema" "8.3.1" + "@graphql-tools/utils" "^8.6.0" + p-limit "3.1.0" + tslib "~2.3.0" + +"@graphql-tools/merge@^8.2.1": + version "8.2.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-8.2.1.tgz#bf83aa06a0cfc6a839e52a58057a84498d0d51ff" + integrity sha512-Q240kcUszhXiAYudjuJgNuLgy9CryDP3wp83NOZQezfA6h3ByYKU7xI6DiKrdjyVaGpYN3ppUmdj0uf5GaXzMA== + dependencies: + "@graphql-tools/utils" "^8.5.1" + tslib "~2.3.0" + +"@graphql-tools/optimize@^1.0.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/optimize/-/optimize-1.1.1.tgz#dcd59ba1ee34431e5e9b086b57fe0bdb1a176669" + integrity sha512-y0TEfPyGmJaQjnsTRs/UP7/ZHaB3i68VAsXW4H2doUFKY6rIOUz+ruME/uWsfy/VeTWBNqGX8/m/X7YFEi5OJQ== + dependencies: + tslib "~2.3.0" + +"@graphql-tools/prisma-loader@^7.0.6": + version "7.1.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/prisma-loader/-/prisma-loader-7.1.1.tgz#2a769919c97a3f7f7807668d3155c47999b0965c" + integrity sha512-9hVpG3BNsXAYMLPlZhSHubk6qBmiHLo/UlU0ldL100sMpqI46iBaHNhTNXZCSdd81hT+4HNqaDXNFqyKJ22OGQ== + dependencies: + "@graphql-tools/url-loader" "^7.4.2" + "@graphql-tools/utils" "^8.5.1" + "@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 "^10.0.0" + graphql-request "^3.3.0" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.0" + isomorphic-fetch "^3.0.0" + js-yaml "^4.0.0" + json-stable-stringify "^1.0.1" + jsonwebtoken "^8.5.1" + lodash "^4.17.20" + replaceall "^0.1.6" + scuid "^1.1.0" + tslib "~2.3.0" + yaml-ast-parser "^0.0.43" + +"@graphql-tools/relay-operation-optimizer@^6.3.7": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/relay-operation-optimizer/-/relay-operation-optimizer-6.4.1.tgz#28572444e2c00850c889a84472f3cc7405dc1ad8" + integrity sha512-2b9D5L+31sIBnvmcmIW5tfvNUV+nJFtbHpUyarTRDmFT6EZ2cXo4WZMm9XJcHQD/Z5qvMXfPHxzQ3/JUs4xI+w== + dependencies: + "@graphql-tools/utils" "^8.5.1" + relay-compiler "12.0.0" + tslib "~2.3.0" + +"@graphql-tools/schema@8.3.1", "@graphql-tools/schema@^8.1.2", "@graphql-tools/schema@^8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-8.3.1.tgz#1ee9da494d2da457643b3c93502b94c3c4b68c74" + integrity sha512-3R0AJFe715p4GwF067G5i0KCr/XIdvSfDLvTLEiTDQ8V/hwbOHEKHKWlEBHGRQwkG5lwFQlW1aOn7VnlPERnWQ== + dependencies: + "@graphql-tools/merge" "^8.2.1" + "@graphql-tools/utils" "^8.5.1" + tslib "~2.3.0" + value-or-promise "1.0.11" + +"@graphql-tools/url-loader@^7.0.11", "@graphql-tools/url-loader@^7.4.2": + version "7.7.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/url-loader/-/url-loader-7.7.1.tgz#2faabdc1d2c47edc8edc9cc938eee2767189869f" + integrity sha512-K/5amdeHtKYI976HVd/AXdSNvLL7vx5QVjMlwN0OHeYyxSgC+UOH+KkS7cshYgL13SekGu0Mxbg9ABfgQ34ECA== + dependencies: + "@graphql-tools/delegate" "^8.4.1" + "@graphql-tools/utils" "^8.5.1" + "@graphql-tools/wrap" "^8.3.1" + "@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@8.6.1", "@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.5.3", "@graphql-tools/utils@^8.5.4", "@graphql-tools/utils@^8.6.0": + version "8.6.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.6.1.tgz#52c7eb108f2ca2fd01bdba8eef85077ead1bf882" + integrity sha512-uxcfHCocp4ENoIiovPxUWZEHOnbXqj3ekWc0rm7fUhW93a1xheARNHcNKhwMTR+UKXVJbTFQdGI1Rl5XdyvDBg== + dependencies: + tslib "~2.3.0" + +"@graphql-tools/wrap@^8.3.1": + version "8.3.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-8.3.3.tgz#014aa04a6cf671ffe477516255d1134777da056a" + integrity sha512-TpXN1S4Cv+oMA1Zsg9Nu4N9yrFxLuJkX+CTtSRrrdfETGHIxqfyDkm5slPDCckxP+RILA00g8ny2jzsYyNvX1w== + dependencies: + "@graphql-tools/delegate" "^8.4.2" + "@graphql-tools/schema" "^8.3.1" + "@graphql-tools/utils" "^8.5.3" + tslib "~2.3.0" + value-or-promise "1.0.11" + +"@humanwhocodes/config-array@^0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914" + integrity sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.4" + +"@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== + +"@keyv/redis@^2.2.0": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@keyv/redis/-/redis-2.2.3.tgz#af5b1ea32d847a63ce24012844af7323b3c421a7" + integrity sha512-d9Maf1LzT6Ti5hWsVzaWFriFmXrscK1eUl/etNquQgAJxH7Drecbn+uNZXMc6xb78Ju9szy0fD9RAp/G9RzAdg== + dependencies: + ioredis "^4.28.5" + +"@material-ui/core@4.12.3": + version "4.12.3" + resolved "https://registry.yarnpkg.com/@material-ui/core/-/core-4.12.3.tgz#80d665caf0f1f034e52355c5450c0e38b099d3ca" + integrity sha512-sdpgI/PL56QVsEJldwEe4FFaFTLUqN+rd7sSZiRCdx2E/C7z5yK0y/khAWVBH24tXwto7I1hCzNWfJGZIYJKnw== + dependencies: + "@babel/runtime" "^7.4.4" + "@material-ui/styles" "^4.11.4" + "@material-ui/system" "^4.12.1" + "@material-ui/types" "5.1.0" + "@material-ui/utils" "^4.11.2" + "@types/react-transition-group" "^4.2.0" + clsx "^1.0.4" + hoist-non-react-statics "^3.3.2" + popper.js "1.16.1-lts" + prop-types "^15.7.2" + react-is "^16.8.0 || ^17.0.0" + react-transition-group "^4.4.0" + +"@material-ui/styles@^4.11.4", "@material-ui/styles@^4.11.5": + version "4.11.5" + resolved "https://registry.yarnpkg.com/@material-ui/styles/-/styles-4.11.5.tgz#19f84457df3aafd956ac863dbe156b1d88e2bbfb" + integrity sha512-o/41ot5JJiUsIETME9wVLAJrmIWL3j0R0Bj2kCOLbSfqEkKf0fmaPt+5vtblUh5eXr2S+J/8J3DaCb10+CzPGA== + dependencies: + "@babel/runtime" "^7.4.4" + "@emotion/hash" "^0.8.0" + "@material-ui/types" "5.1.0" + "@material-ui/utils" "^4.11.3" + clsx "^1.0.4" + csstype "^2.5.2" + hoist-non-react-statics "^3.3.2" + jss "^10.5.1" + jss-plugin-camel-case "^10.5.1" + jss-plugin-default-unit "^10.5.1" + jss-plugin-global "^10.5.1" + jss-plugin-nested "^10.5.1" + jss-plugin-props-sort "^10.5.1" + jss-plugin-rule-value-function "^10.5.1" + jss-plugin-vendor-prefixer "^10.5.1" + prop-types "^15.7.2" + +"@material-ui/system@^4.12.1": + version "4.12.2" + resolved "https://registry.yarnpkg.com/@material-ui/system/-/system-4.12.2.tgz#f5c389adf3fce4146edd489bf4082d461d86aa8b" + integrity sha512-6CSKu2MtmiJgcCGf6nBQpM8fLkuB9F55EKfbdTC80NND5wpTmKzwdhLYLH3zL4cLlK0gVaaltW7/wMuyTnN0Lw== + dependencies: + "@babel/runtime" "^7.4.4" + "@material-ui/utils" "^4.11.3" + csstype "^2.5.2" + prop-types "^15.7.2" + +"@material-ui/types@5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@material-ui/types/-/types-5.1.0.tgz#efa1c7a0b0eaa4c7c87ac0390445f0f88b0d88f2" + integrity sha512-7cqRjrY50b8QzRSYyhSpx4WRw2YuO0KKIGQEVk5J8uoz2BanawykgZGoWEqKm7pVIbzFDN0SpPcVV4IhOFkl8A== + +"@material-ui/utils@^4.11.2", "@material-ui/utils@^4.11.3": + version "4.11.3" + resolved "https://registry.yarnpkg.com/@material-ui/utils/-/utils-4.11.3.tgz#232bd86c4ea81dab714f21edad70b7fdf0253942" + integrity sha512-ZuQPV4rBK/V1j2dIkSSEcH5uT6AaHuKWFfotADHsC0wVL1NLd2WkFCm4ZZbX33iO4ydl6V0GPngKm8HZQ2oujg== + dependencies: + "@babel/runtime" "^7.4.4" + prop-types "^15.7.2" + react-is "^16.8.0 || ^17.0.0" + +"@mui/base@5.0.0-alpha.82": + version "5.0.0-alpha.82" + resolved "https://registry.yarnpkg.com/@mui/base/-/base-5.0.0-alpha.82.tgz#19645af6790a79587517a5782ee32bf9ab7f7ac8" + integrity sha512-WUVDjCGnLXzmGxrmfW31blhucg0sRX4YddK2Falq7FlVzwdJaPgWn/xzPZmdLL0+WXon0gQVnDrq2qvggE/GMg== + dependencies: + "@babel/runtime" "^7.17.2" + "@emotion/is-prop-valid" "^1.1.2" + "@mui/types" "^7.1.3" + "@mui/utils" "^5.8.0" + "@popperjs/core" "^2.11.5" + clsx "^1.1.1" + prop-types "^15.8.1" + react-is "^17.0.2" + +"@mui/icons-material@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.8.0.tgz#c85768434bda885c64a8e4b9e222e73912244570" + integrity sha512-ScwLxa0q5VYV70Jfc60V/9VD0b9SvIeZ0Jddx2Dt2pBUFFO9vKdrbt9LYiT+4p21Au5NdYIb2XSHj46CLN1v3g== + dependencies: + "@babel/runtime" "^7.17.2" + +"@mui/material@^5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@mui/material/-/material-5.8.1.tgz#ff3c0dc65cf975362f8b141d4713a6d88b9f08e9" + integrity sha512-Vl3BHFzOcAT5TJfvzoQUyuo/Xckn+/NSRyJ8upM4Hbz6Y1egW6P8f1RCa4FdkEfPSd5wSSYdmPfAiEh8eI4rPg== + dependencies: + "@babel/runtime" "^7.17.2" + "@mui/base" "5.0.0-alpha.82" + "@mui/system" "^5.8.1" + "@mui/types" "^7.1.3" + "@mui/utils" "^5.8.0" + "@types/react-transition-group" "^4.4.4" + clsx "^1.1.1" + csstype "^3.0.11" + hoist-non-react-statics "^3.3.2" + prop-types "^15.8.1" + react-is "^17.0.2" + react-transition-group "^4.4.2" + +"@mui/private-theming@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@mui/private-theming/-/private-theming-5.8.0.tgz#7d927e7e12616dc10b0dcbe665df2c00ed859796" + integrity sha512-MjRAneTmCKLR9u2S4jtjLUe6gpHxlbb4g2bqpDJ2PdwlvwsWIUzbc/gVB4dvccljXeWxr5G2M/Co2blXisvFIw== + dependencies: + "@babel/runtime" "^7.17.2" + "@mui/utils" "^5.8.0" + prop-types "^15.8.1" + +"@mui/styled-engine@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@mui/styled-engine/-/styled-engine-5.8.0.tgz#89ed42efe7c8749e5a60af035bc5d3a6bea362bf" + integrity sha512-Q3spibB8/EgeMYHc+/o3RRTnAYkSl7ROCLhXJ830W8HZ2/iDiyYp16UcxKPurkXvLhUaILyofPVrP3Su2uKsAw== + dependencies: + "@babel/runtime" "^7.17.2" + "@emotion/cache" "^11.7.1" + prop-types "^15.8.1" + +"@mui/styles@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@mui/styles/-/styles-5.8.0.tgz#43ac26adaf30e911c97b71d60c536d55398d4993" + integrity sha512-kssqBWhCFo7AMiu93QziR8qxq3z8bJm2qCYdmNadE5NvEla7Xwu3twNJUWnCEoeDeoFMk/2H0ACMOdrasI9ANw== + dependencies: + "@babel/runtime" "^7.17.2" + "@emotion/hash" "^0.8.0" + "@mui/private-theming" "^5.8.0" + "@mui/types" "^7.1.3" + "@mui/utils" "^5.8.0" + clsx "^1.1.1" + csstype "^3.0.11" + hoist-non-react-statics "^3.3.2" + jss "^10.8.2" + jss-plugin-camel-case "^10.8.2" + jss-plugin-default-unit "^10.8.2" + jss-plugin-global "^10.8.2" + jss-plugin-nested "^10.8.2" + jss-plugin-props-sort "^10.8.2" + jss-plugin-rule-value-function "^10.8.2" + jss-plugin-vendor-prefixer "^10.8.2" + prop-types "^15.8.1" + +"@mui/system@^5.8.1": + version "5.8.1" + resolved "https://registry.yarnpkg.com/@mui/system/-/system-5.8.1.tgz#57863657c5dc3edb6b2b11836dede3e0c4871ae9" + integrity sha512-kWJMEN62+HJb4LMRNEAZQYc++FPYsqPsU9dCL7ByLgmz/ZzRrZ8FjDi2r4j0ZeE4kaVvqBXh+RA7tLzmCKqV9w== + dependencies: + "@babel/runtime" "^7.17.2" + "@mui/private-theming" "^5.8.0" + "@mui/styled-engine" "^5.8.0" + "@mui/types" "^7.1.3" + "@mui/utils" "^5.8.0" + clsx "^1.1.1" + csstype "^3.0.11" + prop-types "^15.8.1" + +"@mui/types@^7.1.3": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@mui/types/-/types-7.1.3.tgz#d7636f3046110bcccc63e6acfd100e2ad9ca712a" + integrity sha512-DDF0UhMBo4Uezlk+6QxrlDbchF79XG6Zs0zIewlR4c0Dt6GKVFfUtzPtHCH1tTbcSlq/L2bGEdiaoHBJ9Y1gSA== + +"@mui/utils@^5.8.0": + version "5.8.0" + resolved "https://registry.yarnpkg.com/@mui/utils/-/utils-5.8.0.tgz#4b1d19cbcf70773283375e763b7b3552b84cb58f" + integrity sha512-7LgUtCvz78676iC0wpTH7HizMdCrTphhBmRWimIMFrp5Ph6JbDFVuKS1CwYnWWxRyYKL0QzXrDL0lptAU90EXg== + dependencies: + "@babel/runtime" "^7.17.2" + "@types/prop-types" "^15.7.5" + "@types/react-is" "^16.7.1 || ^17.0.0" + prop-types "^15.8.1" + react-is "^17.0.2" + +"@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.0.8" + resolved "https://registry.yarnpkg.com/@next/bundle-analyzer/-/bundle-analyzer-12.0.8.tgz#a4fef1b14f8a4a87c09d97a3d909deddc88d12f8" + integrity sha512-tRwFyAkJA0h+rwt4exq31T59qo4qwp7vPoR3yC8gIpK/E5NAwafyk40aNpk4OWhiQ2IvJMFutukMzY3xl79NXA== + dependencies: + webpack-bundle-analyzer "4.3.0" + +"@next/env@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/env/-/env-12.0.8.tgz#a32ca0a97d464307f2e6ff106ce09b19aac108cf" + integrity sha512-Wa0gOeioB9PHap9wtZDZEhgOSE3/+qE/UALWjJHuNvH4J3oE+13EjVOiEsr1JcPCXUN8ESQE+phDKlo6qJ8P9g== + +"@next/eslint-plugin-next@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-12.0.8.tgz#8bb026891dd3b61053e13289efcb163f66ea3dac" + integrity sha512-bf7O0Mvs1h3vIdbbi0hijG+6YG3ED/ebQfmUltrQSgGtHVKGADDoE2qQhwE+mrvxuz9BD8y3mJDOSy0PBLKGBA== + dependencies: + glob "7.1.7" + +"@next/react-refresh-utils@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/react-refresh-utils/-/react-refresh-utils-12.0.8.tgz#481760a95ef442abd091663db6582d4dc1b31f06" + integrity sha512-Bq4T/aOOFQUkCF9b8k9x+HpjOevu65ZPxsYJOpgEtBuJyvb+sZREtDDLKb/RtjUeLMrWrsGD0aLteyFFtiS8Og== + +"@next/swc-android-arm64@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.0.8.tgz#f8dc9663da367a75982730cac058339fb310d79a" + integrity sha512-BiXMcOZNnXSIXv+FQvbRgbMb+iYayLX/Sb2MwR0wja+eMs46BY1x/ssXDwUBADP1M8YtrGTlSPHZqUiCU94+Mg== + +"@next/swc-darwin-arm64@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.0.8.tgz#d6aced7d0a04815dd1324e7982accb3de6a643e8" + integrity sha512-6EGMmvcIwPpwt0/iqLbXDGx6oKHAXzbowyyVXK8cqmIvhoghRFjqfiNGBs+ar6wEBGt68zhwn/77vE3iQWoFJw== + +"@next/swc-darwin-x64@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.0.8.tgz#f4fe58d2ed852538410b15a0c80d78908050c716" + integrity sha512-todxgQOGP/ucz5UH2kKR3XGDdkWmWr0VZAAbzgTbiFm45Ol4ih602k2nNR3xSbza9IqNhxNuUVsMpBgeo19CFQ== + +"@next/swc-linux-arm-gnueabihf@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.0.8.tgz#2c02d824fb46e8c6094d7e758c5d7e965070f574" + integrity sha512-KULmdrfI+DJxBuhEyV47MQllB/WpC3P2xbwhHezxL/LkC2nkz5SbV4k432qpx2ebjIRf9SjdQ5Oz1FjD8Urayw== + +"@next/swc-linux-arm64-gnu@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.0.8.tgz#fc32caf3373b299558ede1d889e8555b9ba10ffb" + integrity sha512-1XO87wgIVPvt5fx5i8CqdhksRdcpqyzCOLW4KrE0f9pUCIT04EbsFiKdmsH9c73aqjNZMnCMXpbV+cn4hN8x1w== + +"@next/swc-linux-arm64-musl@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.0.8.tgz#c2d3d7bc2c34da81412b74bdd6e11d0615ae1886" + integrity sha512-NStRZEy/rkk2G18Yhc/Jzi1Q2Dv+zH176oO8479zlDQ5syRfc6AvRHVV4iNRc8Pai58If83r/nOJkwFgGwkKLw== + +"@next/swc-linux-x64-gnu@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.0.8.tgz#029d84f856801b818e5525ab1406f2446821d48c" + integrity sha512-rHxTGtTEDFsdT9/VjewzxE19S7W1NE+aZpm4TwbT1pSNGK9KQxQGcXjqoHMeB+VZCFknzNEoIU/vydbjZMlAuw== + +"@next/swc-linux-x64-musl@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.0.8.tgz#db572da90ab3bce0bc58595c6b8c2d32ec64a2d3" + integrity sha512-1F4kuFRQE10GSx7LMSvRmjMXFGpxT30g8rZzq9r/p/WKdErA4WB4uxaKEX0P8AINfuN63i4luKdR+LoacgBhYw== + +"@next/swc-win32-arm64-msvc@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.0.8.tgz#f33e2e56a96489935f87c6dd28f79a7b7ed3778f" + integrity sha512-QuRe49jqCV61TysGopC1P0HPqFAMZMWe1nbIQLyOkDLkULmZR8N2eYZq7fwqvZE5YwhMmJA/grwWFVBqSEh5Kg== + +"@next/swc-win32-ia32-msvc@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.0.8.tgz#0f6c7f3e50fc1a4752aed5c862f53c86ce77e3b8" + integrity sha512-0RV3/julybJr1IlPCowIWrJJZyAl+sOakJEM15y1NOOsbwTQ5eKZZXSi+7e23TN4wmy5HwNvn2dKzgOEVJ+jbA== + +"@next/swc-win32-x64-msvc@12.0.8": + version "12.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.0.8.tgz#eae6d4c94dc8aae8ba177e2de02080339d0d4563" + integrity sha512-tTga6OFfO2JS+Yt5hdryng259c/tzNgSWkdiU2E+RBHiysAIOta57n4PJ8iPahOSqEqjaToPI76wM+o441GaNQ== + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + 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" + +"@npmcli/fs@^1.0.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.1.1.tgz#72f719fe935e687c56a4faecf3c03d06ba593257" + integrity sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ== + dependencies: + "@gar/promisify" "^1.0.1" + semver "^7.3.5" + +"@npmcli/move-file@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@npmcli/move-file/-/move-file-1.1.2.tgz#1a82c3e372f7cae9253eb66d72543d6b8685c674" + integrity sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg== + dependencies: + mkdirp "^1.0.4" + rimraf "^3.0.2" + +"@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== + +"@popperjs/core@^2.11.5": + version "2.11.5" + resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.5.tgz#db5a11bf66bdab39569719555b0f76e138d7bd64" + integrity sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw== + +"@radix-ui/popper@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/popper/-/popper-0.1.0.tgz#c387a38f31b7799e1ea0d2bb1ca0c91c2931b063" + integrity sha512-uzYeElL3w7SeNMuQpXiFlBhTT+JyaNMCwDfjKkrzugEcYrf5n52PHqncNdQPUtR42hJh8V9FsqyEDbDxkeNjJQ== + dependencies: + "@babel/runtime" "^7.13.10" + csstype "^3.0.4" + +"@radix-ui/primitive@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/primitive/-/primitive-0.1.0.tgz#6206b97d379994f0d1929809db035733b337e543" + integrity sha512-tqxZKybwN5Fa3VzZry4G6mXAAb9aAqKmPtnVbZpL0vsBwvOHTBwsjHVPXylocYLwEtBY9SCe665bYnNB515uoA== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-arrow@0.1.4": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-arrow/-/react-arrow-0.1.4.tgz#a871448a418cd3507d83840fdd47558cb961672b" + integrity sha512-BB6XzAb7Ml7+wwpFdYVtZpK1BlMgqyafSQNGzhIpSZ4uXvXOHPlR5GP8M449JkeQzgQjv9Mp1AsJxFC0KuOtuA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "0.1.4" + +"@radix-ui/react-collection@0.1.4": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-collection/-/react-collection-0.1.4.tgz#734061ffd5bb93e88889d49b87391a73a63824c9" + integrity sha512-3muGI15IdgaDFjOcO7xX8a35HQRBRF6LH9pS6UCeZeRmbslkVeHyJRQr2rzICBUoX7zgIA0kXyMDbpQnJGyJTA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "0.1.0" + "@radix-ui/react-context" "0.1.1" + "@radix-ui/react-primitive" "0.1.4" + "@radix-ui/react-slot" "0.1.2" + +"@radix-ui/react-compose-refs@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-compose-refs/-/react-compose-refs-0.1.0.tgz#cff6e780a0f73778b976acff2c2a5b6551caab95" + integrity sha512-eyclbh+b77k+69Dk72q3694OHrn9B3QsoIRx7ywX341U9RK1ThgQjMFZoPtmZNQTksXHLNEiefR8hGVeFyInGg== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-context@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-0.1.1.tgz#06996829ea124d9a1bc1dbe3e51f33588fab0875" + integrity sha512-PkyVX1JsLBioeu0jB9WvRpDBBLtLZohVDT3BB5CTSJqActma8S8030P57mWZb4baZifMvN7KKWPAA40UmWKkQg== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-dismissable-layer@0.1.5": + version "0.1.5" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-0.1.5.tgz#9379032351e79028d472733a5cc8ba4a0ea43314" + integrity sha512-J+fYWijkX4M4QKwf9dtu1oC0U6e6CEl8WhBp3Ad23yz2Hia0XCo6Pk/mp5CAFy4QBtQedTSkhW05AdtSOEoajQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "0.1.0" + "@radix-ui/react-compose-refs" "0.1.0" + "@radix-ui/react-primitive" "0.1.4" + "@radix-ui/react-use-body-pointer-events" "0.1.1" + "@radix-ui/react-use-callback-ref" "0.1.0" + "@radix-ui/react-use-escape-keydown" "0.1.0" + +"@radix-ui/react-dropdown-menu@^0.1.6": + version "0.1.6" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-0.1.6.tgz#3203229788cd57e552c9f19dcc7008e2b545919c" + integrity sha512-RZhtzjWwJ4ZBN7D8ek4Zn+ilHzYuYta9yIxFnbC0pfqMnSi67IQNONo1tuuNqtFh9SRHacPKc65zo+kBBlxtdg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "0.1.0" + "@radix-ui/react-compose-refs" "0.1.0" + "@radix-ui/react-context" "0.1.1" + "@radix-ui/react-id" "0.1.5" + "@radix-ui/react-menu" "0.1.6" + "@radix-ui/react-primitive" "0.1.4" + "@radix-ui/react-use-controllable-state" "0.1.0" + +"@radix-ui/react-focus-guards@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-guards/-/react-focus-guards-0.1.0.tgz#ba3b6f902cba7826569f8edc21ff8223dece7def" + integrity sha512-kRx/swAjEfBpQ3ns7J3H4uxpXuWCqN7MpALiSDOXiyo2vkWv0L9sxvbpZeTulINuE3CGMzicVMuNc/VWXjFKOg== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-focus-scope@0.1.4": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-scope/-/react-focus-scope-0.1.4.tgz#c830724e212d42ffaaa81aee49533213d09b47df" + integrity sha512-fbA4ES3H4Wkxp+OeLhvN6SwL7mXNn/aBtUf7DRYxY9+Akrf7dRxl2ck4lgcpPsSg3zSDsEwLcY+h5cmj5yvlug== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "0.1.0" + "@radix-ui/react-primitive" "0.1.4" + "@radix-ui/react-use-callback-ref" "0.1.0" + +"@radix-ui/react-id@0.1.5": + version "0.1.5" + resolved "https://registry.yarnpkg.com/@radix-ui/react-id/-/react-id-0.1.5.tgz#010d311bedd5a2884c1e9bb6aaaa4e6cc1d1d3b8" + integrity sha512-IPc4H/63bes0IZ1GJJozSEkSWcDyhNGtKFWUpJ+XtaLyQ1X3x7Mf6fWwWhDcpqlYEP+5WtAvfqcyEsyjP+ZhBQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-layout-effect" "0.1.0" + +"@radix-ui/react-menu@0.1.6": + version "0.1.6" + resolved "https://registry.yarnpkg.com/@radix-ui/react-menu/-/react-menu-0.1.6.tgz#7f9521a10f6a9cd819b33b33d5ed9538d79b2e75" + integrity sha512-ho3+bhpr3oAFkOBJ8VkUb1BcGoiZBB3OmcWPqa6i5RTUKrzNX/d6rauochu2xDlWjiRtpVuiAcsTVOeIC4FbYQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "0.1.0" + "@radix-ui/react-collection" "0.1.4" + "@radix-ui/react-compose-refs" "0.1.0" + "@radix-ui/react-context" "0.1.1" + "@radix-ui/react-dismissable-layer" "0.1.5" + "@radix-ui/react-focus-guards" "0.1.0" + "@radix-ui/react-focus-scope" "0.1.4" + "@radix-ui/react-id" "0.1.5" + "@radix-ui/react-popper" "0.1.4" + "@radix-ui/react-portal" "0.1.4" + "@radix-ui/react-presence" "0.1.2" + "@radix-ui/react-primitive" "0.1.4" + "@radix-ui/react-roving-focus" "0.1.5" + "@radix-ui/react-use-callback-ref" "0.1.0" + "@radix-ui/react-use-direction" "0.1.0" + aria-hidden "^1.1.1" + react-remove-scroll "^2.4.0" + +"@radix-ui/react-popper@0.1.4": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-popper/-/react-popper-0.1.4.tgz#dfc055dcd7dfae6a2eff7a70d333141d15a5d029" + integrity sha512-18gDYof97t8UQa7zwklG1Dr8jIdj3u+rVOQLzPi9f5i1YQak/pVGkaqw8aY+iDUknKKuZniTk/7jbAJUYlKyOw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/popper" "0.1.0" + "@radix-ui/react-arrow" "0.1.4" + "@radix-ui/react-compose-refs" "0.1.0" + "@radix-ui/react-context" "0.1.1" + "@radix-ui/react-primitive" "0.1.4" + "@radix-ui/react-use-rect" "0.1.1" + "@radix-ui/react-use-size" "0.1.1" + "@radix-ui/rect" "0.1.1" + +"@radix-ui/react-portal@0.1.4": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-portal/-/react-portal-0.1.4.tgz#17bdce3d7f1a9a0b35cb5e935ab8bc562441a7d2" + integrity sha512-MO0wRy2eYRTZ/CyOri9NANCAtAtq89DEtg90gicaTlkCfdqCLEBsLb+/q66BZQTr3xX/Vq01nnVfc/TkCqoqvw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "0.1.4" + "@radix-ui/react-use-layout-effect" "0.1.0" + +"@radix-ui/react-presence@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-presence/-/react-presence-0.1.2.tgz#9f11cce3df73cf65bc348e8b76d891f0d54c1fe3" + integrity sha512-3BRlFZraooIUfRlyN+b/Xs5hq1lanOOo/+3h6Pwu2GMFjkGKKa4Rd51fcqGqnVlbr3jYg+WLuGyAV4KlgqwrQw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "0.1.0" + "@radix-ui/react-use-layout-effect" "0.1.0" + +"@radix-ui/react-primitive@0.1.4": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-0.1.4.tgz#6c233cf08b0cb87fecd107e9efecb3f21861edc1" + integrity sha512-6gSl2IidySupIMJFjYnDIkIWRyQdbu/AHK7rbICPani+LW4b0XdxBXc46og/iZvuwW8pjCS8I2SadIerv84xYA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-slot" "0.1.2" + +"@radix-ui/react-roving-focus@0.1.5": + version "0.1.5" + resolved "https://registry.yarnpkg.com/@radix-ui/react-roving-focus/-/react-roving-focus-0.1.5.tgz#cc48d17a36b56f253d54905b0fd60ee134cb97ee" + integrity sha512-ClwKPS5JZE+PaHCoW7eu1onvE61pDv4kO8W4t5Ra3qMFQiTJLZMdpBQUhksN//DaVygoLirz4Samdr5Y1x1FSA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "0.1.0" + "@radix-ui/react-collection" "0.1.4" + "@radix-ui/react-compose-refs" "0.1.0" + "@radix-ui/react-context" "0.1.1" + "@radix-ui/react-id" "0.1.5" + "@radix-ui/react-primitive" "0.1.4" + "@radix-ui/react-use-callback-ref" "0.1.0" + "@radix-ui/react-use-controllable-state" "0.1.0" + +"@radix-ui/react-slot@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-0.1.2.tgz#e6f7ad9caa8ce81cc8d532c854c56f9b8b6307c8" + integrity sha512-ADkqfL+agEzEguU3yS26jfB50hRrwf7U4VTwAOZEmi/g+ITcBWe12yM46ueS/UCIMI9Py+gFUaAdxgxafFvY2Q== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "0.1.0" + +"@radix-ui/react-use-body-pointer-events@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-body-pointer-events/-/react-use-body-pointer-events-0.1.1.tgz#63e7fd81ca7ffd30841deb584cd2b7f460df2597" + integrity sha512-R8leV2AWmJokTmERM8cMXFHWSiv/fzOLhG/JLmRBhLTAzOj37EQizssq4oW0Z29VcZy2tODMi9Pk/htxwb+xpA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-layout-effect" "0.1.0" + +"@radix-ui/react-use-callback-ref@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-0.1.0.tgz#934b6e123330f5b3a6b116460e6662cbc663493f" + integrity sha512-Va041McOFFl+aV+sejvl0BS2aeHx86ND9X/rVFmEFQKTXCp6xgUK0NGUAGcgBlIjnJSbMYPGEk1xKSSlVcN2Aw== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-use-controllable-state@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-0.1.0.tgz#4fced164acfc69a4e34fb9d193afdab973a55de1" + integrity sha512-zv7CX/PgsRl46a52Tl45TwqwVJdmqnlQEQhaYMz/yBOD2sx2gCkCFSoF/z9mpnYWmS6DTLNTg5lIps3fV6EnXg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-callback-ref" "0.1.0" + +"@radix-ui/react-use-direction@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-direction/-/react-use-direction-0.1.0.tgz#97ac1d52e497c974389e7988f809238ed72e7df7" + integrity sha512-NajpY/An9TCPSfOVkgWIdXJV+VuWl67PxB6kOKYmtNAFHvObzIoh8o0n9sAuwSAyFCZVq211FEf9gvVDRhOyiA== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-use-escape-keydown@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-0.1.0.tgz#dc80cb3753e9d1bd992adbad9a149fb6ea941874" + integrity sha512-tDLZbTGFmvXaazUXXv8kYbiCcbAE8yKgng9s95d8fCO+Eundv0Jngbn/hKPhDDs4jj9ChwRX5cDDnlaN+ugYYQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-callback-ref" "0.1.0" + +"@radix-ui/react-use-layout-effect@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-0.1.0.tgz#ebf71bd6d2825de8f1fbb984abf2293823f0f223" + integrity sha512-+wdeS51Y+E1q1Wmd+1xSSbesZkpVj4jsg0BojCbopWvgq5iBvixw5vgemscdh58ep98BwUbsFYnrywFhV9yrVg== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-use-rect@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-rect/-/react-use-rect-0.1.1.tgz#6c15384beee59c086e75b89a7e66f3d2e583a856" + integrity sha512-kHNNXAsP3/PeszEmM/nxBBS9Jbo93sO+xuMTcRfwzXsmxT5gDXQzAiKbZQ0EecCPtJIzqvr7dlaQi/aP1PKYqQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/rect" "0.1.1" + +"@radix-ui/react-use-size@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-size/-/react-use-size-0.1.1.tgz#f6b75272a5d41c3089ca78c8a2e48e5f204ef90f" + integrity sha512-pTgWM5qKBu6C7kfKxrKPoBI2zZYZmp2cSXzpUiGM3qEBQlMLtYhaY2JXdXUCxz+XmD1YEjc8oRwvyfsD4AG4WA== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/rect@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/rect/-/rect-0.1.1.tgz#95b5ba51f469bea6b1b841e2d427e17e37d38419" + integrity sha512-g3hnE/UcOg7REdewduRPAK88EPuLZtaq7sA9ouu8S+YEtnyFRI16jgv6GZYe3VMoQLL1T171ebmEPtDjyxWLzw== + dependencies: + "@babel/runtime" "^7.13.10" + +"@react-spring/animated@~9.4.0": + version "9.4.2" + resolved "https://registry.yarnpkg.com/@react-spring/animated/-/animated-9.4.2.tgz#1dc107233ce4a44b023abac829f3b2ea8327a128" + integrity sha512-Dzum5Ho8e+LIAegAqRyoQFakD2IVH3ZQ2nsFXJorAFq3Xjv6IVPz/+TNxb/wSvnsMludfoF+ZIf319FSFmgD5w== + dependencies: + "@react-spring/shared" "~9.4.0" + "@react-spring/types" "~9.4.0" + +"@react-spring/core@~9.4.0": + version "9.4.2" + resolved "https://registry.yarnpkg.com/@react-spring/core/-/core-9.4.2.tgz#c20249535b3acaead015d17e1c4ce839ec3d4c9f" + integrity sha512-Ej/ULwdx8rQtMAWEpLgwbKcQEx6vPfjyG3cxLP05zAInpCoWkYpl+sXOp9tn3r99mTNQPTTt7BgQsSnmQA8+rQ== + dependencies: + "@react-spring/animated" "~9.4.0" + "@react-spring/rafz" "~9.4.0" + "@react-spring/shared" "~9.4.0" + "@react-spring/types" "~9.4.0" + +"@react-spring/rafz@~9.4.0": + version "9.4.2" + resolved "https://registry.yarnpkg.com/@react-spring/rafz/-/rafz-9.4.2.tgz#40a663d407cd116d436f662c6849f8e5b56234b6" + integrity sha512-rSm+G8E/XEEpnCGtT/xYN6o8VvEXlU8wN/hyKp4Q44XAZzGSMHLIFP7pY94/MmWsxCxjkw1AxUWhiFYxWrnI5Q== + +"@react-spring/shared@~9.4.0": + version "9.4.2" + resolved "https://registry.yarnpkg.com/@react-spring/shared/-/shared-9.4.2.tgz#45e103eee04f5e857ab2c575c2a84d3a883f0bfa" + integrity sha512-mZtbQLpMm6Vy5+O1MSlY9KuAcMO8rdUQvtdnC7Or7y7xiZlnzj8oAILyO6Y2rD2ZC1PmgVS0gMev/8T+MykW+Q== + dependencies: + "@react-spring/rafz" "~9.4.0" + "@react-spring/types" "~9.4.0" + +"@react-spring/types@~9.4.0": + version "9.4.2" + resolved "https://registry.yarnpkg.com/@react-spring/types/-/types-9.4.2.tgz#f0518f6d23a0b0f699a71976483323ac84bc4ace" + integrity sha512-GGiIscTM+CEUNV52anj3g5FqAZKL2+eRKtvBOAlC99qGBbvJ3qTLImrUR/I3lXY7PRuLgzI6kh34quA1oUxWYQ== + +"@react-spring/web@^9.4.1": + version "9.4.2" + resolved "https://registry.yarnpkg.com/@react-spring/web/-/web-9.4.2.tgz#ea8bb224c236d10097da463ea9e950f0939b7a5f" + integrity sha512-sWfA9NkVuvVOpjSlMkD2zcF6X3i8NSHTeH/uHCGKsN3mYqgkhvAF+E8GASO/H4KKGNhbRvgCZiwJXOtOGyUg6A== + dependencies: + "@react-spring/animated" "~9.4.0" + "@react-spring/core" "~9.4.0" + "@react-spring/shared" "~9.4.0" + "@react-spring/types" "~9.4.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" + resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz#a21117b19ee9be70c379ec1877537ef2e1c63301" + integrity sha512-c/qwwcHyafOQuVQJj0IlBjf5yYgBI7YPJ77k4fOJYesb41jio65eaJODRUmfYKhTOFBrIZ66kgvGPlNbjuoRdQ== + dependencies: + any-observable "^0.3.0" + +"@sindresorhus/is@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" + integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== + +"@spree/storefront-api-v2-sdk@^5.1.1": + version "5.1.2" + resolved "https://registry.yarnpkg.com/@spree/storefront-api-v2-sdk/-/storefront-api-v2-sdk-5.1.2.tgz#6e4842c7307071adda45c975edb5ecbd9316e319" + integrity sha512-Jw9J/rUG9pyegjSWaXFSA1or/2KTgXiXdlE+hjMx3htveoxL1V+uqz7ke6UkdJMv7uB2cJtYOCpg8JzrQZgg1A== + +"@swc/core-android-arm-eabi@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.2.138.tgz#4605fa4afc0bb515798a7b7ebd274eb06f67775b" + integrity sha512-N79aTHj/jZNa8nXjOrfAaYYBkJxCQ9ZVFikQKSbBETU8usk7qAWDdCs94Y0q/Sow+9uiqguRVOrPFKSrN8LMTg== + +"@swc/core-android-arm64@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.2.138.tgz#7bb94a78d7253ca8b6ec92be435c5a7686dbd68c" + integrity sha512-ZNRqTjZpNrB39pCX5OmtnNTnzU3X1GjZX2xDouS1jknEE+TPz1ZJsM4zNlz6AObd7caJhU7qRyWNDM0nlcnJZQ== + +"@swc/core-darwin-arm64@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.138.tgz#8a31dbdb90626f503a837ee71fa3bb7866ac3eb1" + integrity sha512-DlT0s3Iw3bmOCk4jln0Q9AC1H7q75bZojyODcPXQ2T24s6LcBeD1lNAfyQ2RmaQJTlBM04LjNYqvjA2HAR4ckw== + +"@swc/core-darwin-x64@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.2.138.tgz#cc389708336dabc411a6d4705c2be17f9407054b" + integrity sha512-+8ahwSnUTPCmpB1VkMTJdfcFU+ZGQ5JnA1dpSvDhB/u8wV2Dpk0ozpX+3xjqYXoUdhZvdHW1FxKZrhMhscJriA== + +"@swc/core-freebsd-x64@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.138.tgz#2f29b1e8f133825fefb558a071f3bdb67dcf3c32" + integrity sha512-4icXrpDBN2r24PIRF2DBZ9IPgnXnEqO7/bySIUoL7ul8su2yoRP4Xp3Xi+XP+uBvtrVttwYtzGPNikVggVSK1Q== + +"@swc/core-linux-arm-gnueabihf@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.138.tgz#255c2011d865ff8f8118753f8900b51545c30000" + integrity sha512-YdEKUvT9GGBEsKSyXc/YJ0cWSetBV3JhxouYLCv4AoQsTrDU5vDQDFUWlT21pzlbwC66ffbpYxnugpsqBm5XKg== + +"@swc/core-linux-arm64-gnu@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.138.tgz#89813e14240bde17aaa914a47e84626a10ae13ec" + integrity sha512-cn/YrVvghCgSpagzHins1BQnJ07J53aCvlp57iXDA2xfH/HwXTijIy+UzqpQaLeKKQ8gMXmfzj/M7WklccN8jw== + +"@swc/core-linux-arm64-musl@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.138.tgz#c33351846218a4bd471505c9215233608f648ab9" + integrity sha512-aYoeZ46gaewTYYShHwlYhL8ARrLILiEnTWJFEWoUfAfbDwi4zaLyymRYmdpUyRHr+D9jloM5BKFNWnRPBTyCEg== + +"@swc/core-linux-x64-gnu@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.138.tgz#0be2226c7c701d8f58051ca47e78f24d479a9faa" + integrity sha512-gt9qP426kkIx4Yu2Dd9U2S44OE8ynRi47rt2HvdHaBlMsGfMH28EyMet3UT61ZVHMEoDxADQctz0JD1/29Ha1Q== + +"@swc/core-linux-x64-musl@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.138.tgz#07feede753206a4858dd275a0a4f99501909010e" + integrity sha512-lySbIVGApaDQVKPwH8D+9J5dkrawJTrBm86vY7F9sDPR5yCq5Buxx6Pn1X6VKE6e5vlEEb1zbVQmCrFgdUcgig== + +"@swc/core-win32-arm64-msvc@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.138.tgz#04e7dbfefb2e933433be32254c52c65add15c086" + integrity sha512-UmDtaC9ds1SNNfhYrHW1JvBhy7wKb/Y9RcQOsfG3StxqqnYkOWDkQt9dY5O9lAG8Iw/TCxzjJhm6ul48eMv9OQ== + +"@swc/core-win32-ia32-msvc@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.138.tgz#7d897c97ac5338e8a947d6c0c032e8068b521a2e" + integrity sha512-evapKq/jVKMI5KDXUvpu3rhYf/L0VIg92TTphpxJSNjo7k5w9n68RY3MXtm1BmtCR4ZWtx0OEXzr9ckUDcqZDA== + +"@swc/core-win32-x64-msvc@1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.138.tgz#6a54a72ed035d3b327f2576f4a586da093dc4898" + integrity sha512-wYrARtnPg/svsQd0oovbth2JAhOugAgbnaOS0CMiWB4vaFBx+1GHJl5wzdhh9jt1kzsu4xZ4237tUeMH+s6d0A== + +"@swc/core@^1.2.138": + version "1.2.138" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.2.138.tgz#e54d8488094f7f90cb00455cb0380693c0935865" + integrity sha512-XMbpq6y2BiTju5KCtveM3h32Ma3chGm/fQEjErZmWNOcPIpupGLPosSU1bH35Udee4GHNJH3NfkZIDR0cjHWIg== + optionalDependencies: + "@swc/core-android-arm-eabi" "1.2.138" + "@swc/core-android-arm64" "1.2.138" + "@swc/core-darwin-arm64" "1.2.138" + "@swc/core-darwin-x64" "1.2.138" + "@swc/core-freebsd-x64" "1.2.138" + "@swc/core-linux-arm-gnueabihf" "1.2.138" + "@swc/core-linux-arm64-gnu" "1.2.138" + "@swc/core-linux-arm64-musl" "1.2.138" + "@swc/core-linux-x64-gnu" "1.2.138" + "@swc/core-linux-x64-musl" "1.2.138" + "@swc/core-win32-arm64-msvc" "1.2.138" + "@swc/core-win32-ia32-msvc" "1.2.138" + "@swc/core-win32-x64-msvc" "1.2.138" + +"@szmarczak/http-timer@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" + integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== + dependencies: + defer-to-connect "^1.0.1" + +"@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@1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" + integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== + +"@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@^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.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.33" + resolved "https://registry.yarnpkg.com/@types/json-stable-stringify/-/json-stable-stringify-1.0.33.tgz#099b0712d824d15e2660c20e1c16e6a8381f308c" + integrity sha512-qEWiQff6q2tA5gcJGWwzplQcXdJtm+0oy6IHGHzlOf3eFAkGE/FIPXZK9ofWgNSHVp8AFFI33PJJshS0ei3Gvw== + +"@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" "*" + +"@types/lodash.debounce@^4.0.6": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@types/lodash.debounce/-/lodash.debounce-4.0.6.tgz#c5a2326cd3efc46566c47e4c0aa248dc0ee57d60" + integrity sha512-4WTmnnhCfDvvuLMaF3KV4Qfki93KebocUF45msxhYyjMttZDQYzHkO639ohhk8+oco2cluAFL3t5+Jn4mleylQ== + dependencies: + "@types/lodash" "*" + +"@types/lodash.random@^3.2.6": + version "3.2.6" + resolved "https://registry.yarnpkg.com/@types/lodash.random/-/lodash.random-3.2.6.tgz#64b08abad168dca39c778ed40cce75b2f9e168eb" + integrity sha512-RRr0pKm+3USvG/HTkuRKA8v2EqXu19VXC09j4VL2UQec8Yx8Fn6wYTPGjYdmX4UFd23ykS7SLFkiULS/rv8kTA== + dependencies: + "@types/lodash" "*" + +"@types/lodash.throttle@^4.1.6": + version "4.1.6" + resolved "https://registry.yarnpkg.com/@types/lodash.throttle/-/lodash.throttle-4.1.6.tgz#f5ba2c22244ee42ff6c2c49e614401a870c1009c" + integrity sha512-/UIH96i/sIRYGC60NoY72jGkCJtFN5KVPhEMMMTjol65effe1gPn0tycJqV5tlSwMTzX8FqzB5yAj0rfGHTPNg== + dependencies: + "@types/lodash" "*" + +"@types/lodash@*": + version "4.14.178" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8" + integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== + +"@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== + dependencies: + "@types/node" "*" + +"@types/node@*", "@types/node@>=8.1.0", "@types/node@^17.0.8": + version "17.0.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.10.tgz#616f16e9d3a2a3d618136b1be244315d95bd7cab" + integrity sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog== + +"@types/node@10.12.18": + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== + +"@types/parse-json@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" + integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== + +"@types/prop-types@*": + 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/prop-types@^15.7.5": + version "15.7.5" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" + integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== + +"@types/react-is@^16.7.1 || ^17.0.0": + version "17.0.3" + resolved "https://registry.yarnpkg.com/@types/react-is/-/react-is-17.0.3.tgz#2d855ba575f2fc8d17ef9861f084acc4b90a137a" + integrity sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw== + dependencies: + "@types/react" "*" + +"@types/react-transition-group@^4.2.0", "@types/react-transition-group@^4.4.4": + version "4.4.4" + resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.4.tgz#acd4cceaa2be6b757db61ed7b432e103242d163e" + integrity sha512-7gAPz7anVK5xzbeQW9wFBDg7G++aPLAFY0QaSMOou9rJZpbuI58WAuJrgu+qR92l61grlnCUe7AFX8KGahAgug== + dependencies: + "@types/react" "*" + +"@types/react@*": + version "18.0.9" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.9.tgz#d6712a38bd6cd83469603e7359511126f122e878" + integrity sha512-9bjbg1hJHUm4De19L1cHiW0Jvx3geel6Qczhjd0qY5VKVE2X5+x77YxAepuCwVh4vrgZJdgEJw48zrhRIeF4Nw== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + +"@types/react@^17.0.38": + version "17.0.38" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.38.tgz#f24249fefd89357d5fa71f739a686b8d7c7202bd" + integrity sha512-SI92X1IA+FMnP3qM5m4QReluXzhcmovhZnLNm3pyeQlooi02qI7sLiepEYqT678uNiyc25XfCqxREFpy3W7YhQ== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + +"@types/scheduler@*": + 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.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.4.tgz#1dc497280d8049a5450854dd698ee7e6ea9e60b8" + integrity sha512-qn1LkcFEKK8RPp459jkjzsfpbsx36BBt3oC3pITYtkoBw/aVX+EZFa5j3ThCRTNpLFvIMr5dSTD4RaMdilIOpA== + dependencies: + "@types/node" "*" + +"@types/ws@^8.0.0": + version "8.2.2" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.2.2.tgz#7c5be4decb19500ae6b3d563043cd407bf366c21" + integrity sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg== + dependencies: + "@types/node" "*" + +"@typescript-eslint/parser@^5.0.0": + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.10.1.tgz#4ce9633cc33fc70bc13786cb793c1a76fe5ad6bd" + integrity sha512-GReo3tjNBwR5RnRO0K2wDIDN31cM3MmDtgyQ85oAxAmC5K3j/g85IjP+cDfcqDsDDBf1HNKQAD0WqOYL8jXqUA== + dependencies: + "@typescript-eslint/scope-manager" "5.10.1" + "@typescript-eslint/types" "5.10.1" + "@typescript-eslint/typescript-estree" "5.10.1" + debug "^4.3.2" + +"@typescript-eslint/scope-manager@5.10.1": + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.1.tgz#f0539c73804d2423506db2475352a4dec36cd809" + integrity sha512-Lyvi559Gvpn94k7+ElXNMEnXu/iundV5uFmCUNnftbFrUbAJ1WBoaGgkbOBm07jVZa682oaBU37ao/NGGX4ZDg== + dependencies: + "@typescript-eslint/types" "5.10.1" + "@typescript-eslint/visitor-keys" "5.10.1" + +"@typescript-eslint/types@5.10.1": + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.1.tgz#dca9bd4cb8c067fc85304a31f38ec4766ba2d1ea" + integrity sha512-ZvxQ2QMy49bIIBpTqFiOenucqUyjTQ0WNLhBM6X1fh1NNlYAC6Kxsx8bRTY3jdYsYg44a0Z/uEgQkohbR0H87Q== + +"@typescript-eslint/typescript-estree@5.10.1": + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.1.tgz#b268e67be0553f8790ba3fe87113282977adda15" + integrity sha512-PwIGnH7jIueXv4opcwEbVGDATjGPO1dx9RkUl5LlHDSe+FXxPwFL5W/qYd5/NHr7f6lo/vvTrAzd0KlQtRusJQ== + dependencies: + "@typescript-eslint/types" "5.10.1" + "@typescript-eslint/visitor-keys" "5.10.1" + 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.10.1": + version "5.10.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.1.tgz#29102de692f59d7d34ecc457ed59ab5fc558010b" + integrity sha512-NjQ0Xinhy9IL979tpoTRuLKxMc0zJC7QVSdeerXs2/QvOy2yRkzX5dRb10X5woNUdJgU8G3nYRDlI33sq1K4YQ== + dependencies: + "@typescript-eslint/types" "5.10.1" + 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== + dependencies: + "@types/node-fetch" "2.3.2" + "@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== + dependencies: + async-retry "^1.3.1" + debug "^3.1.0" + +"@vercel/fetch@^6.1.1": + 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== + dependencies: + "@types/async-retry" "1.2.1" + "@vercel/fetch-cached-dns" "^2.0.2" + "@vercel/fetch-retry" "^5.0.2" + agentkeepalive "3.4.1" + debug "3.1.0" + +"@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== + dependencies: + "@types/async-retry" "1.2.1" + "@types/lru-cache" "4.1.1" + "@types/node" "10.12.18" + async-retry "1.2.3" + lru-cache "5.1.1" + +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" + integrity sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A== + dependencies: + acorn "^7.0.0" + acorn-walk "^7.0.0" + xtend "^4.0.2" + +acorn-walk@^7.0.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" + integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== + +acorn-walk@^8.0.0: + 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, 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, agent-base@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + 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== + dependencies: + humanize-ms "^1.2.1" + +agentkeepalive@^4.1.3: + 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: + version "3.1.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + +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" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-escapes@^4.2.1, ansi-escapes@^4.3.0, ansi-escapes@^4.3.1: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +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" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + 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@^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== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +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-hidden@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/aria-hidden/-/aria-hidden-1.1.3.tgz#bb48de18dc84787a3c6eee113709c473c64ec254" + integrity sha512-RhVWFtKH5BiGMycI72q2RAFMLQi8JP9bLuQXgR5a8Znp7P5KOIADSJeyfI8PCVxLEp067B2HbP5JIiI/PXIZeA== + dependencies: + tslib "^1.0.0" + +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" + integrity sha512-/PZEKASyXWmUTkNhuxnmqybv1CmIdY5rp3axLy3Dv6SYfaBb+EgS7Nl991mquHT1N2u0YAnE3IOafVNRM6Y9dw== + dependencies: + "@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-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.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= + +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= + +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" + integrity sha512-tfDb02Th6CE6pJUF2gjW5ZVjsgwlucVXOEQMvEX9JgSJMs9gAX+Nz3xRuJBKuUYjTSYORqvDBORdAQ3LU59g7Q== + dependencies: + retry "0.12.0" + +async-retry@^1.3.1: + 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.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.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.19.1" + caniuse-lite "^1.0.30001297" + fraction.js "^4.1.2" + normalize-range "^0.1.2" + picocolors "^1.0.0" + postcss-value-parser "^4.2.0" + +axe-core@^4.3.5: + version "4.3.5" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.3.5.tgz#78d6911ba317a8262bfee292aeafcc1e04b49cc5" + integrity sha512-WKTW1+xAzhMS5dJsxWkliixlO/PqC4VhmO9T4juNYcaTg9jzWiJsou6m5pxWYGfigWbwzJWeFY6z47a+4neRXA== + +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: + follow-redirects "^1.14.0" + +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" + resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" + integrity sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ== + dependencies: + object.assign "^4.1.0" + +babel-plugin-macros@^2.6.1: + version "2.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz#0f958a7cc6556b1e65344465d99111a1e5e10138" + integrity sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg== + dependencies: + "@babel/runtime" "^7.7.2" + cosmiconfig "^6.0.0" + resolve "^1.12.0" + +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.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== + dependencies: + "@babel/plugin-proposal-class-properties" "^7.0.0" + "@babel/plugin-proposal-object-rest-spread" "^7.0.0" + "@babel/plugin-syntax-class-properties" "^7.0.0" + "@babel/plugin-syntax-flow" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + "@babel/plugin-transform-arrow-functions" "^7.0.0" + "@babel/plugin-transform-block-scoped-functions" "^7.0.0" + "@babel/plugin-transform-block-scoping" "^7.0.0" + "@babel/plugin-transform-classes" "^7.0.0" + "@babel/plugin-transform-computed-properties" "^7.0.0" + "@babel/plugin-transform-destructuring" "^7.0.0" + "@babel/plugin-transform-flow-strip-types" "^7.0.0" + "@babel/plugin-transform-for-of" "^7.0.0" + "@babel/plugin-transform-function-name" "^7.0.0" + "@babel/plugin-transform-literals" "^7.0.0" + "@babel/plugin-transform-member-expression-literals" "^7.0.0" + "@babel/plugin-transform-modules-commonjs" "^7.0.0" + "@babel/plugin-transform-object-super" "^7.0.0" + "@babel/plugin-transform-parameters" "^7.0.0" + "@babel/plugin-transform-property-literals" "^7.0.0" + "@babel/plugin-transform-react-display-name" "^7.0.0" + "@babel/plugin-transform-react-jsx" "^7.0.0" + "@babel/plugin-transform-shorthand-properties" "^7.0.0" + "@babel/plugin-transform-spread" "^7.0.0" + "@babel/plugin-transform-template-literals" "^7.0.0" + babel-plugin-syntax-trailing-function-commas "^7.0.0-beta.0" + +backo2@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" + integrity sha1-MasayLEpNjRj41s+u2n038+6eUc= + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +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== + +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" + +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== + +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== + +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" + +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" + +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" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + 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" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browserslist@^4.17.5, browserslist@^4.19.1: + version "4.19.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.19.1.tgz#4ac0435b35ab655896c31d53018b6dd5e9e4c9a3" + integrity sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A== + dependencies: + caniuse-lite "^1.0.30001286" + electron-to-chromium "^1.4.17" + escalade "^3.1.1" + node-releases "^2.0.1" + picocolors "^1.0.0" + +bser@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== + dependencies: + node-int64 "^0.4.0" + +buffer-equal-constant-time@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" + integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= + +buffer-from@^1.0.0: + 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@^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== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + +cacache@^15.0.5: + version "15.3.0" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.3.0.tgz#dc85380fb2f556fe3dda4c719bfa0ec875a7f1eb" + integrity sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ== + dependencies: + "@npmcli/fs" "^1.0.0" + "@npmcli/move-file" "^1.0.1" + chownr "^2.0.0" + fs-minipass "^2.0.0" + glob "^7.1.4" + infer-owner "^1.0.4" + lru-cache "^6.0.0" + minipass "^3.1.1" + minipass-collect "^1.0.2" + minipass-flush "^1.0.5" + minipass-pipeline "^1.2.2" + mkdirp "^1.0.3" + p-map "^4.0.0" + promise-inflight "^1.0.1" + rimraf "^3.0.2" + ssri "^8.0.1" + tar "^6.0.2" + unique-filename "^1.1.1" + +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" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" + integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^3.0.0" + lowercase-keys "^2.0.0" + normalize-url "^4.1.0" + responselike "^1.0.2" + +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +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== + dependencies: + pascal-case "^3.1.2" + tslib "^2.0.3" + +camelcase-css@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" + integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +caniuse-lite@^1.0.30001283, caniuse-lite@^1.0.30001286, caniuse-lite@^1.0.30001297, caniuse-lite@^1.0.30001299: + version "1.0.30001301" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001301.tgz#ebc9086026534cab0dab99425d9c3b4425e5f450" + integrity sha512-csfD/GpHMqgEL3V3uIgosvh+SVIQvCh43SNu9HRbP1lnxkKm1kjDG4f32PP571JplkLjfS+mg2p1gxR7MYrrIA== + +capital-case@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/capital-case/-/capital-case-1.0.4.tgz#9d130292353c9249f6b00fa5852bee38a717e669" + integrity sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + upper-case-first "^2.0.2" + +chalk@^1.0.0, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +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" + +change-case-all@1.0.14: + version "1.0.14" + resolved "https://registry.yarnpkg.com/change-case-all/-/change-case-all-1.0.14.tgz#bac04da08ad143278d0ac3dda7eccd39280bfba1" + integrity sha512-CWVm2uT7dmSHdO/z1CXT/n47mWonyypzBbuCy5tN7uMg22BsfkhwT6oHmFCAk+gL1LOOxhdbB9SZz3J1KTY3gA== + dependencies: + change-case "^4.1.2" + is-lower-case "^2.0.2" + is-upper-case "^2.0.2" + lower-case "^2.0.2" + lower-case-first "^2.0.2" + sponge-case "^1.0.1" + swap-case "^2.0.2" + title-case "^3.0.3" + upper-case "^2.0.2" + upper-case-first "^2.0.2" + +change-case@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/change-case/-/change-case-4.1.2.tgz#fedfc5f136045e2398c0410ee441f95704641e12" + integrity sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A== + dependencies: + camel-case "^4.1.2" + capital-case "^1.0.4" + constant-case "^3.0.4" + dot-case "^3.0.4" + header-case "^2.0.4" + no-case "^3.0.4" + param-case "^3.0.4" + pascal-case "^3.1.2" + path-case "^3.0.4" + sentence-case "^3.0.4" + snake-case "^3.0.4" + tslib "^2.0.3" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +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 "^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 "^1.0.0" + +chokidar@^3.5.2: + 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" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +chownr@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" + integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== + +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: + 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" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + +cli-cursor@^2.0.0, cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + 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" + integrity sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ= + dependencies: + slice-ansi "0.0.4" + string-width "^1.0.1" + +cli-truncate@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" + integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg== + dependencies: + 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" + integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== + +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +clone-response@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + 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.0.4, 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== + +cluster-key-slot@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz#30474b2a981fb12172695833052bc0d01336d10d" + integrity sha512-2Nii8p3RwAPiFwsnZvukotvow2rIHM+yQ6ZcBXGHdniadkYGZYiGmkHJIbZPIV9nfv7m/U1IPMVVcAhoWFeklw== + +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= + +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== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +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== + +colorette@^1.2.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" + integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== + +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" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.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@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== + +commerce-sdk@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/commerce-sdk/-/commerce-sdk-2.7.0.tgz#a66ed6a29d74500ca91e9e518ba1a389e9327794" + integrity sha512-jMOSKhXOQaSSSOa/G/NfklAP2TUCvAOEON/Af/81As36+KwQLK1LkdfhKnBW+XsIHa3hXrC2ED3VZZhq7c96oA== + dependencies: + "@commerce-apps/core" "^1.5.5" + lodash "^4.17.21" + retry "^0.12.0" + tslib "^2.3.1" + +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== + +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= + +constant-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-3.0.4.tgz#3b84a9aeaf4cf31ec45e6bf5de91bdfb0589faf1" + integrity sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + upper-case "^2.0.2" + +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.5.0, 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" + integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== + dependencies: + 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== + +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.20.3" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.20.3.tgz#6cc4f36da06c61d95254efc54024fe4797fd5d02" + integrity sha512-Q2H6tQ5MtPtcC7f3HxJ48i4Q7T9ybPKgvWyuH7JXIoNa2pm0KuBnycsET/qw1SLLZYfbsbrZQNMeIOClb+6WIA== + +core-util-is@~1.0.0: + 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" + resolved "https://registry.yarnpkg.com/cosmiconfig-toml-loader/-/cosmiconfig-toml-loader-1.0.0.tgz#0681383651cceff918177debe9084c0d3769509b" + integrity sha512-H/2gurFWVi7xXvCyvsWRLCMekl4tITJcX0QEsDMpzxtuxDyM59xLatYNg4s/k9AA/HdtCYfj2su8mgA0GSDLDA== + dependencies: + "@iarna/toml" "^2.2.5" + +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" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.10.0" + +cosmiconfig@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982" + integrity sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg== + dependencies: + "@types/parse-json" "^4.0.0" + import-fresh "^3.1.0" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.7.2" + +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.4, cross-fetch@^3.0.6: + 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.7" + +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== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +cross-undici-fetch@^0.1.19: + version "0.1.19" + resolved "https://registry.yarnpkg.com/cross-undici-fetch/-/cross-undici-fetch-0.1.19.tgz#1bef41652c33ec812b51cd3b4e1295114cd62d4c" + integrity sha512-bNBuesVn09Iy15mAM/hpt97fLWSexblVYpUYa5FjbtLHA7om9w3g1uRGGwrEnmVxy3wouNvZyJwQzAPHXgOrxQ== + dependencies: + 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@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/css-blank-pseudo/-/css-blank-pseudo-3.0.2.tgz#f8660f6a48b17888a9277e53f25cc5abec1f0169" + integrity sha512-hOb1LFjRR+8ocA071xUSmg5VslJ8NGo/I2qpUpdeAYyBVCgupS5O8SEVo4SxEMYyFBNodBkzG3T1iqW9HCXxew== + dependencies: + postcss-selector-parser "^6.0.8" + +css-has-pseudo@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/css-has-pseudo/-/css-has-pseudo-3.0.3.tgz#4824a34cb92dae7e09ea1d3fd19691b653412098" + integrity sha512-0gDYWEKaGacwxCqvQ3Ypg6wGdD1AztbMm5h1JsactG2hP2eiflj808QITmuWBpE7sjSEVrAlZhPTVd/nNMj/hQ== + dependencies: + postcss-selector-parser "^6.0.8" + +css-prefers-color-scheme@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/css-prefers-color-scheme/-/css-prefers-color-scheme-6.0.2.tgz#d5c03a980caab92d8beeee176a8795d331e0c727" + integrity sha512-gv0KQBEM+q/XdoKyznovq3KW7ocO7k+FhPP+hQR1MenJdu0uPGS6IZa9PzlbqBeS6XcZJNAoqoFxlAUW461CrA== + +css-vendor@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/css-vendor/-/css-vendor-2.0.8.tgz#e47f91d3bd3117d49180a3c935e62e3d9f7f449d" + integrity sha512-x9Aq0XTInxrkuFeHKbYC7zWY8ai7qJ04Kxd9MnvbC1uO5DagxoHQjm4JvG+vCdXOoFtCjbL2XSZfxmoYa9uQVQ== + dependencies: + "@babel/runtime" "^7.8.3" + is-in-browser "^1.0.2" + +cssdb@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cssdb/-/cssdb-5.1.0.tgz#ec728d5f5c0811debd0820cbebda505d43003400" + integrity sha512-/vqjXhv1x9eGkE/zO6o8ZOI7dgdZbLVLUGyVRbPgk6YipXbW87YzUCcO+Jrmi5bwJlAH6oD+MNeZyRgXea1GZw== + +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== + +csstype@^2.5.2: + version "2.6.20" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.20.tgz#9229c65ea0b260cf4d3d997cb06288e36a8d6dda" + integrity sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA== + +csstype@^3.0.11: + version "3.1.0" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.0.tgz#4ddcac3718d787cf9df0d1b7d15033925c8f29f2" + integrity sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA== + +csstype@^3.0.2: + version "3.0.10" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.10.tgz#2ad3a7bed70f35b965707c092e5f30b327c290e5" + integrity sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA== + +csstype@^3.0.4: + version "3.0.11" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.11.tgz#d66700c5eacfac1940deb4e3ee5642792d85cd33" + integrity sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw== + +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" + resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-2.0.0.tgz#41eaf123db115987e21ca93c005cd7753c55fe6f" + integrity sha512-YzhyDAwA4TaQIhM5go+vCLmU0UikghC/t9DTQYZR2M/UvZ1MdOhPezSDZcjj9uqQJOMqjLcpWtyW2iNINdlatQ== + +date-fns@^1.27.2: + version "1.30.1" + 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.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.1.tgz#38881d8f4166a5c5848020c11827b834bcb3e0a5" + integrity sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug== + +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.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, debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +decamelize@^1.2.0: + version "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" + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= + dependencies: + mimic-response "^1.0.0" + +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" + integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== + +define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + 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" + integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +denque@^1.1.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/denque/-/denque-1.5.1.tgz#07f670e29c9a78f8faecb2566a1e2c11929c5cbf" + integrity sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw== + +depd@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +dependency-graph@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.11.0.tgz#ac0ce7ed68a54da22165a85e97a01d53f5eb2e27" + integrity sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg== + +detect-indent@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" + integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== + +detect-node-es@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/detect-node-es/-/detect-node-es-1.1.0.tgz#163acdf643330caa0b4cd7c21e7ee7755d6fa493" + integrity sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ== + +detective@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.0.tgz#feb2a77e85b904ecdea459ad897cc90a99bd2a7b" + integrity sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg== + dependencies: + acorn-node "^1.6.1" + defined "^1.0.0" + minimist "^1.1.1" + +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== + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +dlv@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79" + integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA== + +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" + +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" + +dom-helpers@^5.0.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.2.1.tgz#d9400536b2bf8225ad98fe052e029451ac40e902" + integrity sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA== + dependencies: + "@babel/runtime" "^7.8.7" + csstype "^3.0.2" + +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + +dotenv@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" + integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== + +dotenv@^12.0.3: + version "12.0.4" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-12.0.4.tgz#87e302cfddeef475fcaf9a617f7b44f80ac555bc" + integrity sha512-oWdqbSywffzH1l4WXKPHWA0TWYpqp7IyLfqjipT4upoIFS0HPMqtNotykQpD4iIg0BqtNmdgPCh2WMvMt7yTiw== + +dotenv@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" + integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== + +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" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= + +duplexer@^0.1.2: + version "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" + integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== + dependencies: + safe-buffer "^5.0.1" + +electron-to-chromium@^1.4.17: + version "1.4.52" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.52.tgz#ce44c6d6cc449e7688a4356b8c261cfeafa26833" + integrity sha512-JGkh8HEh5PnVrhU4HbpyyO0O791dVY6k7AdqfDeqbcRMeoGxtNHWT77deR2nhvbLe4dKpxjlDEvdEwrvRLGu2Q== + +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= + +email-validator@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/email-validator/-/email-validator-2.0.4.tgz#b8dfaa5d0dae28f1b03c95881d904d4e40bfe7ed" + integrity sha512-gYCwo7kh5S3IDyZPLZf6hSS0MnZT8QmJFqYvbqlDZSbwdZlY6QZWxJ4i/6UhITOJ4XzyI647Bm2MXKCLqnJ4nQ== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +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== + +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.12: + 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" + +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +err-code@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" + integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA== + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +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" + internal-slot "^1.0.3" + is-callable "^1.2.4" + is-negative-zero "^2.0.1" + 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" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.1" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +escape-string-regexp@^4.0.0: + version "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.0.8" + resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-12.0.8.tgz#7a15114230db97d1bc727fc5db2f469416b62e0f" + integrity sha512-H40jvqy/yeku3r9D556ALLaM3ZmS55hj9/MTK59fWbzsqTaYlybSkUmIBG0ZFEnBazr0NnBGwrYA5cnsFYR7RQ== + dependencies: + "@next/eslint-plugin-next" "12.0.8" + "@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.3.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" + integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== + +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.2" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.2.tgz#1d0aa455dcf41052339b63cada8ab5fd57577129" + integrity sha512-zquepFnWCY2ISMFwD/DqzaM++H+7PDzOpUvotJWm/y1BAFt5R4oeULgdrTejKqLkz7MA/tgstsUMNYc7wNdTrg== + 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.28.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.28.0.tgz#8f3ff450677571a659ce76efc6d80b6a525adbdf" + integrity sha512-IOlFIRHzWfEQQKcAD4iyYDndHwTQiCMcJVJjxempf203jnNLUnW34AXLrV33+nEXoifJE2ZEGmcjKPL8957eSw== + 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.0.4" + object.entries "^1.1.5" + object.fromentries "^2.0.5" + object.hasown "^1.1.0" + object.values "^1.1.5" + prop-types "^15.7.2" + resolve "^2.0.0-next.3" + semver "^6.3.0" + string.prototype.matchall "^4.0.6" + +eslint-scope@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153" + integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg== + 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.1.0, eslint-visitor-keys@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1" + integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ== + +eslint@^8.6.0: + version "8.7.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.7.0.tgz#22e036842ee5b7cf87b03fe237731675b4d3633c" + integrity sha512-ifHYzkBGrzS2iDU7KjhCAVMGCvF6M3Xfs8X8b37cgrUlDt6bWRTpRh6T/gtSXv1HJ/BUGgmjvNvOEGu85Iif7w== + dependencies: + "@eslint/eslintrc" "^1.0.5" + "@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.0" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.2.0" + espree "^9.3.0" + 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.2.0, espree@^9.3.0: + version "9.3.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.0.tgz#c1240d79183b72aaee6ccfa5a90bc9111df085a8" + integrity sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ== + dependencies: + acorn "^8.7.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^3.1.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== + +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" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + +eventemitter3@^3.1.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" + integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== + +execa@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + 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" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +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-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.2" + merge2 "^1.3.0" + 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.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" + +fb-watchman@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" + integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== + dependencies: + bser "2.1.1" + +fbjs-css-vars@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz#216551136ae02fe255932c3ec8775f18e2c078b8" + integrity sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ== + +fbjs@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-3.0.2.tgz#dfae08a85c66a58372993ce2caf30863f569ff94" + integrity sha512-qv+boqYndjElAJHNN3NoM8XuwQZ1j2m3kEvTgdle8IDjr6oUbkEpvABWtj/rQl3vq4ew7dnElBxL4YJAwTVqQQ== + dependencies: + cross-fetch "^3.0.4" + 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.30" + +fetch-to-curl@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fetch-to-curl/-/fetch-to-curl-0.5.2.tgz#9f007ecb3547edeffee49394ff076727dc56d603" + integrity sha512-ygmvsJlU+V4GE91lflkRNAJ956xm5MFl6QukIyxkd6yojTxr6gjp4BsYh7hYXlwVw+ffnMlAIXOTWsWJdk017Q== + +figures@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +figures@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" + integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== + 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" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-root@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" + integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng== + +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: + locate-path "^2.0.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== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +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: + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + version "3.2.4" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" + integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== + +follow-redirects@^1.14.0: + version "1.14.7" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685" + integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== + +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" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" + integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +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: + node-domexception "1.0.0" + web-streams-polyfill "4.0.0-beta.1" + +fraction.js@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.1.2.tgz#13e420a92422b6cf244dff8690ed89401029fbe8" + integrity sha512-o2RiJQ6DZaR/5+Si0qJUIy637QMRudSi9kU/FFzx9EZazrIdnBgpU+3sEWCxAVhH2RtxW2Oz+T4p2o8uOPVcgA== + +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-minipass@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" + integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== + dependencies: + minipass "^3.0.0" + +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@^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== + +function-bind@^1.1.1: + version "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" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + +get-caller-file@^2.0.1, get-caller-file@^2.0.5: + version "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.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== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + +get-nonce@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-nonce/-/get-nonce-1.0.1.tgz#fdf3f0278073820d2ce9426c18f07481b1e0cdf3" + integrity sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q== + +get-stream@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + +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.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.3" + +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== + 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" + +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, 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== + +globals@^13.6.0, globals@^13.9.0: + version "13.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.12.0.tgz#4d733760304230a0082ed96e21e5c565f898089e" + integrity sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg== + 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.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +got@^9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" + integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== + dependencies: + "@sindresorhus/is" "^0.14.0" + "@szmarczak/http-timer" "^1.1.2" + cacheable-request "^6.0.0" + decompress-response "^3.3.0" + duplexer3 "^0.1.4" + get-stream "^4.1.0" + lowercase-keys "^1.0.1" + mimic-response "^1.0.1" + p-cancelable "^1.0.0" + to-readable-stream "^1.0.0" + url-parse-lax "^3.0.0" + +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@^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" "^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.7.0" + resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-3.7.0.tgz#c7406e537084f8b9788541e3e6704340ca13055b" + integrity sha512-dw5PxHCgBneN2DDNqpWu8QkbbJ07oOziy8z+bK/TAXufsOLaETuVO4GkXrbs0WjhdKhBMN3BkpN/RIvUHkmNUQ== + dependencies: + cross-fetch "^3.0.6" + extract-files "^9.0.0" + form-data "^3.0.0" + +graphql-sse@^1.0.1: + version "1.0.6" + resolved "https://registry.yarnpkg.com/graphql-sse/-/graphql-sse-1.0.6.tgz#4f98e0a06f2020542ed054399116108491263224" + integrity sha512-y2mVBN2KwNrzxX2KBncQ6kzc6JWvecxuBernrl0j65hsr6MAS3+Yn8PTFSOgRmtolxugepxveyZVQEuaNEbw3w== + +graphql-tag@^2.11.0, graphql-tag@^2.12.6: + 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@^5.4.1: + version "5.5.5" + resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.5.5.tgz#f375486d3f196e2a2527b503644693ae3a8670a9" + integrity sha512-hvyIS71vs4Tu/yUYHPvGXsTgo0t3arU820+lT5VjZS2go0ewp2LqyCgxEN56CzOG7Iys52eRhHBiD1gGRdiQtw== + +graphql@^16.5.0: + version "16.5.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.5.0.tgz#41b5c1182eaac7f3d47164fb247f61e4dfb69c85" + integrity sha512-qbHgh8Ix+j/qY+a/ZcJnFQ+j8ezakqPiHwPiZhV/3PgGlgf96QMBB5/f2rkiC9sgLoy/xvT6TSiaf2nTHJh5iA== + +gzip-size@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462" + integrity sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q== + dependencies: + duplexer "^0.1.2" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-bigints@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + 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== + +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" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +header-case@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/header-case/-/header-case-2.0.4.tgz#5a42e63b55177349cf405beb8d775acabb92c063" + integrity sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q== + dependencies: + capital-case "^1.0.4" + tslib "^2.0.3" + +hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" + integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== + dependencies: + react-is "^16.7.0" + +http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.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-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" + agent-base "6" + debug "4" + +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: + "@tootallnate/once" "2" + agent-base "6" + debug "4" + +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" + integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== + dependencies: + agent-base "6" + debug "4" + +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + +humanize-ms@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" + integrity sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0= + dependencies: + ms "^2.0.0" + +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== + +hyphenate-style-name@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz#691879af8e220aea5750e8827db4ef62a54e361d" + integrity sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ== + +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: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +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== + +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" + resolved "https://registry.yarnpkg.com/immutability-helper/-/immutability-helper-3.1.1.tgz#2b86b2286ed3b1241c9e23b7b21e0444f52f77b7" + integrity sha512-Q0QaXjPjwIju/28TsugCHNEASwoCcJSyJV3uO1sOIQGI0jKgm9f41Lvz0DZj3n46cNCyAZTsEYoY4C2bVRUzyQ== + +immutable@~3.7.6: + version "3.7.6" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.7.6.tgz#13b4d3cb12befa15482a26fe1b2ebae640071e4b" + integrity sha1-E7TTyxK++hVIKib+Gy665kAHHks= + +import-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-3.0.0.tgz#20845547718015126ea9b3676b7592fb8bd4cf92" + integrity sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg== + dependencies: + import-from "^3.0.0" + +import-fresh@^3.0.0, import-fresh@^3.1.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== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.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" + integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= + +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + +infer-owner@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" + integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3, inherits@~2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +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@^8.0.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.0.tgz#f44f008dd344bbfc4b30031f45d984e034a3ac3a" + integrity sha512-0crLweprevJ02tTuA6ThpoAERAGyVILC4sS74uib58Xf/zSr1/ZWtmm7D5CI+bSQEaA04f0K7idaHpQbSWgiVQ== + dependencies: + ansi-escapes "^4.2.1" + 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.21" + mute-stream "0.0.8" + ora "^5.4.1" + run-async "^2.4.0" + rxjs "^7.2.0" + 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" + +ioredis@^4.28.1, ioredis@^4.28.5: + version "4.28.5" + resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-4.28.5.tgz#5c149e6a8d76a7f8fa8a504ffc85b7d5b6797f9f" + integrity sha512-3GYo0GJtLqgNXj4YhrisLaNNvWSNwSS2wS4OELGfGxH8I69+XfNdnmV1AyN+ZqMh0i7eX+SWjrwFKDBDgfBC1A== + dependencies: + cluster-key-slot "^1.1.0" + debug "^4.3.1" + denque "^1.1.0" + lodash.defaults "^4.2.0" + lodash.flatten "^4.4.0" + lodash.isarguments "^3.1.0" + p-map "^2.1.0" + redis-commands "1.7.0" + redis-errors "^1.2.0" + redis-parser "^3.0.0" + standard-as-callback "^2.1.0" + +ip@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= + +is-absolute@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" + integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA== + dependencies: + is-relative "^1.0.0" + is-windows "^1.0.1" + +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: + 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-bigint@^1.0.1: + 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" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-boolean-object@^1.1.0: + 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-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-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.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" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-fullwidth-code-point@^3.0.0: + version "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-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.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-in-browser@^1.0.2, is-in-browser@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-in-browser/-/is-in-browser-1.1.3.tgz#56ff4db683a078c6082eb95dad7dc62e1d04f835" + integrity sha1-Vv9NtoOgeMYILrldrX3GLh0E+DU= + +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-lambda@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" + integrity sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU= + +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" + integrity sha512-bVcMJy4X5Og6VZfdOZstSexlEy20Sr0k/p/b2IlQJlfdKAQuMpiv5w2Ccxb8sKdRUNAG1PnHVHjFSdRDVS6NlQ== + dependencies: + tslib "^2.0.3" + +is-negative-zero@^2.0.1: + 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.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-observable@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" + integrity sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA== + dependencies: + symbol-observable "^1.1.0" + +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.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-tostringtag "^1.0.0" + +is-relative@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" + integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA== + 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.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.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" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +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" + integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ== + dependencies: + unc-path-regex "^0.1.2" + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +is-upper-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-upper-case/-/is-upper-case-2.0.2.tgz#f1105ced1fe4de906a5f39553e7d3803fd804649" + integrity sha512-44pxmxAvnnAOwBg4tHPnkfvgjPwbc5QIsSstNU+YcJ1ovxVzCWpSGosPJOZh/a1tdl81fbgnLc9LLv+x2ywbPQ== + dependencies: + tslib "^2.0.3" + +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: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "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" + integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA== + dependencies: + node-fetch "^2.6.1" + whatwg-fetch "^3.4.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== + +iterall@^1.2.1: + version "1.3.0" + 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@^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.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= + +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + 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" + integrity sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8= + dependencies: + jsonify "~0.0.0" + +json-to-pretty-yaml@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/json-to-pretty-yaml/-/json-to-pretty-yaml-1.2.2.tgz#f4cd0bd0a5e8fe1df25aaf5ba118b099fd992d5b" + integrity sha1-9M0L0KXo/h3yWq9boRiwmf2ZLVs= + dependencies: + remedial "^1.0.7" + remove-trailing-spaces "^1.0.6" + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + +json5@^2.1.2: + version "2.2.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" + integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== + dependencies: + minimist "^1.2.5" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= + +jsonwebtoken@^8.5.1: + version "8.5.1" + resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz#00e71e0b8df54c2121a1f26137df2280673bcc0d" + integrity sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w== + dependencies: + jws "^3.2.2" + lodash.includes "^4.3.0" + lodash.isboolean "^3.0.3" + lodash.isinteger "^4.0.4" + lodash.isnumber "^3.0.3" + lodash.isplainobject "^4.0.6" + lodash.isstring "^4.0.1" + lodash.once "^4.0.0" + ms "^2.1.1" + semver "^5.6.0" + +jss-plugin-camel-case@^10.5.1, jss-plugin-camel-case@^10.8.2: + version "10.9.0" + resolved "https://registry.yarnpkg.com/jss-plugin-camel-case/-/jss-plugin-camel-case-10.9.0.tgz#4921b568b38d893f39736ee8c4c5f1c64670aaf7" + integrity sha512-UH6uPpnDk413/r/2Olmw4+y54yEF2lRIV8XIZyuYpgPYTITLlPOsq6XB9qeqv+75SQSg3KLocq5jUBXW8qWWww== + dependencies: + "@babel/runtime" "^7.3.1" + hyphenate-style-name "^1.0.3" + jss "10.9.0" + +jss-plugin-default-unit@^10.5.1, jss-plugin-default-unit@^10.8.2: + version "10.9.0" + resolved "https://registry.yarnpkg.com/jss-plugin-default-unit/-/jss-plugin-default-unit-10.9.0.tgz#bb23a48f075bc0ce852b4b4d3f7582bc002df991" + integrity sha512-7Ju4Q9wJ/MZPsxfu4T84mzdn7pLHWeqoGd/D8O3eDNNJ93Xc8PxnLmV8s8ZPNRYkLdxZqKtm1nPQ0BM4JRlq2w== + dependencies: + "@babel/runtime" "^7.3.1" + jss "10.9.0" + +jss-plugin-global@^10.5.1, jss-plugin-global@^10.8.2: + version "10.9.0" + resolved "https://registry.yarnpkg.com/jss-plugin-global/-/jss-plugin-global-10.9.0.tgz#fc07a0086ac97aca174e37edb480b69277f3931f" + integrity sha512-4G8PHNJ0x6nwAFsEzcuVDiBlyMsj2y3VjmFAx/uHk/R/gzJV+yRHICjT4MKGGu1cJq2hfowFWCyrr/Gg37FbgQ== + dependencies: + "@babel/runtime" "^7.3.1" + jss "10.9.0" + +jss-plugin-nested@^10.5.1, jss-plugin-nested@^10.8.2: + version "10.9.0" + resolved "https://registry.yarnpkg.com/jss-plugin-nested/-/jss-plugin-nested-10.9.0.tgz#cc1c7d63ad542c3ccc6e2c66c8328c6b6b00f4b3" + integrity sha512-2UJnDrfCZpMYcpPYR16oZB7VAC6b/1QLsRiAutOt7wJaaqwCBvNsosLEu/fUyKNQNGdvg2PPJFDO5AX7dwxtoA== + dependencies: + "@babel/runtime" "^7.3.1" + jss "10.9.0" + tiny-warning "^1.0.2" + +jss-plugin-props-sort@^10.5.1, jss-plugin-props-sort@^10.8.2: + version "10.9.0" + resolved "https://registry.yarnpkg.com/jss-plugin-props-sort/-/jss-plugin-props-sort-10.9.0.tgz#30e9567ef9479043feb6e5e59db09b4de687c47d" + integrity sha512-7A76HI8bzwqrsMOJTWKx/uD5v+U8piLnp5bvru7g/3ZEQOu1+PjHvv7bFdNO3DwNPC9oM0a//KwIJsIcDCjDzw== + dependencies: + "@babel/runtime" "^7.3.1" + jss "10.9.0" + +jss-plugin-rule-value-function@^10.5.1, jss-plugin-rule-value-function@^10.8.2: + version "10.9.0" + resolved "https://registry.yarnpkg.com/jss-plugin-rule-value-function/-/jss-plugin-rule-value-function-10.9.0.tgz#379fd2732c0746fe45168011fe25544c1a295d67" + integrity sha512-IHJv6YrEf8pRzkY207cPmdbBstBaE+z8pazhPShfz0tZSDtRdQua5jjg6NMz3IbTasVx9FdnmptxPqSWL5tyJg== + dependencies: + "@babel/runtime" "^7.3.1" + jss "10.9.0" + tiny-warning "^1.0.2" + +jss-plugin-vendor-prefixer@^10.5.1, jss-plugin-vendor-prefixer@^10.8.2: + version "10.9.0" + resolved "https://registry.yarnpkg.com/jss-plugin-vendor-prefixer/-/jss-plugin-vendor-prefixer-10.9.0.tgz#aa9df98abfb3f75f7ed59a3ec50a5452461a206a" + integrity sha512-MbvsaXP7iiVdYVSEoi+blrW+AYnTDvHTW6I6zqi7JcwXdc6I9Kbm234nEblayhF38EftoenbM+5218pidmC5gA== + dependencies: + "@babel/runtime" "^7.3.1" + css-vendor "^2.0.8" + jss "10.9.0" + +jss@10.9.0, jss@^10.5.1, jss@^10.8.2: + version "10.9.0" + resolved "https://registry.yarnpkg.com/jss/-/jss-10.9.0.tgz#7583ee2cdc904a83c872ba695d1baab4b59c141b" + integrity sha512-YpzpreB6kUunQBbrlArlsMpXYyndt9JATbt95tajx0t4MTJJcCJdd4hdNpHmOIDiUJrF/oX5wtVFrS3uofWfGw== + dependencies: + "@babel/runtime" "^7.3.1" + csstype "^3.0.2" + is-in-browser "^1.1.3" + tiny-warning "^1.0.2" + +"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" + integrity sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA== + dependencies: + buffer-equal-constant-time "1.0.1" + ecdsa-sig-formatter "1.0.11" + safe-buffer "^5.0.1" + +jws@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304" + integrity sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA== + dependencies: + jwa "^1.4.1" + safe-buffer "^5.0.1" + +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== + +keycode@^2.1.7: + version "2.2.1" + resolved "https://registry.yarnpkg.com/keycode/-/keycode-2.2.1.tgz#09c23b2be0611d26117ea2501c2c391a01f39eff" + integrity sha512-Rdgz9Hl9Iv4QKi8b0OlCRQEzp4AgVxyCtz5S/+VIHezDmrDhkp2N2TqBWOLz0/gbeREXOOiI9/4b8BY9uw2vFg== + +keyv@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" + integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== + dependencies: + json-buffer "3.0.0" + +keyv@^4.0.4: + version "4.1.1" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.1.1.tgz#02c538bfdbd2a9308cc932d4096f05ae42bfa06a" + integrity sha512-tGv1yP6snQVDSM4X6yxrv2zzq/EvpW+oYiUz6aueW1u9CtS8RzUQYxxmFwgZlO2jSgCxQbchhxaqXXp2hnKGpQ== + dependencies: + json-buffer "3.0.1" + +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" + integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA== + dependencies: + package-json "^6.3.0" + +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.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@^12.1.7: + version "12.3.1" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-12.3.1.tgz#d475b0c0d0a12d91dde58a429ac6268dea485f06" + integrity sha512-Ocht/eT+4/siWOZDJpNUKcKX2UeWW/pDbohJ4gRsrafAjBi79JK8kiNVk2ciIVNKdw0Q4ABptl2nr6uQAlRImw== + dependencies: + 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" + 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" + resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" + integrity sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4= + +listr-update-renderer@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz#4ea8368548a7b8aecb7e06d8c95cb45ae2ede6a2" + integrity sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA== + dependencies: + chalk "^1.1.3" + cli-truncate "^0.2.1" + elegant-spinner "^1.0.1" + figures "^1.7.0" + indent-string "^3.0.0" + log-symbols "^1.0.2" + log-update "^2.3.0" + strip-ansi "^3.0.1" + +listr-verbose-renderer@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz#f1132167535ea4c1261102b9f28dac7cba1e03db" + integrity sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw== + dependencies: + chalk "^2.4.1" + cli-cursor "^2.1.0" + date-fns "^1.27.2" + figures "^2.0.0" + +listr2@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-4.0.1.tgz#e050c1fd390276e191f582603d6e3531cd6fd2b3" + integrity sha512-D65Nl+zyYHL2jQBGmxtH/pU8koPZo5C8iCNE8EoB04RwPgQG1wuaKwVbeZv9LJpiH4Nxs0FCp+nNcG8OqpniiA== + dependencies: + cli-truncate "^2.1.0" + colorette "^2.0.16" + log-update "^4.0.0" + p-map "^4.0.0" + rfdc "^1.3.0" + rxjs "^7.5.2" + through "^2.3.8" + wrap-ansi "^7.0.0" + +listr@^0.14.3: + version "0.14.3" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.3.tgz#2fea909604e434be464c50bddba0d496928fa586" + integrity sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA== + dependencies: + "@samverschueren/stream-to-observable" "^0.3.0" + is-observable "^1.1.0" + is-promise "^2.1.0" + is-stream "^1.1.0" + listr-silent-renderer "^1.1.1" + listr-update-renderer "^0.5.0" + listr-verbose-renderer "^0.5.0" + 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== + dependencies: + big.js "^5.2.2" + emojis-list "^2.0.0" + json5 "^1.0.1" + +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: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= + +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= + +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= + +lodash.defaults@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" + integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw= + +lodash.flatten@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" + integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= + +lodash.get@^4: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= + +lodash.includes@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" + integrity sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8= + +lodash.isarguments@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" + integrity sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo= + +lodash.isboolean@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6" + integrity sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY= + +lodash.isdate@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.isdate/-/lodash.isdate-4.0.1.tgz#35a543673b9d76110de4114b32cc577048a7f366" + integrity sha1-NaVDZzuddhEN5BFLMsxXcEin82Y= + +lodash.isinteger@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" + integrity sha1-YZwK89A/iwTDH1iChAt3sRzWg0M= + +lodash.isnumber@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc" + integrity sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w= + +lodash.isplainobject@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= + +lodash.isstring@^4.0.1: + version "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" + integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= + +lodash.random@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lodash.random/-/lodash.random-3.2.0.tgz#96e24e763333199130d2c9e2fd57f91703cc262d" + integrity sha1-luJOdjMzGZEw0sni/Vf5FwPMJi0= + +lodash.snakecase@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" + integrity sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40= + +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.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.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== + +log-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + integrity sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg= + dependencies: + chalk "^1.0.0" + +log-symbols@^4.0.0, log-symbols@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +log-update@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" + integrity sha1-iDKP19HOeTiykoN0bwsbwSayRwg= + dependencies: + ansi-escapes "^3.0.0" + cli-cursor "^2.0.0" + wrap-ansi "^3.0.1" + +log-update@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" + integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg== + dependencies: + ansi-escapes "^4.3.0" + cli-cursor "^3.1.0" + slice-ansi "^4.0.0" + wrap-ansi "^6.2.0" + +loglevel@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.8.0.tgz#e7ec73a57e1e7b419cb6c6ac06bf050b67356114" + integrity sha512-G6A/nJLRgWOuuwdNuA6koovfEV1YpqqAG4pRUlFaz3jj2QNZ8M4vBqnVA+HBTmU/AMNUtlOsMmSpF6NyOjztbA== + +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lower-case-first@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case-first/-/lower-case-first-2.0.2.tgz#64c2324a2250bf7c37c5901e76a5b5309301160b" + integrity sha512-EVm/rR94FJTZi3zefZ82fLWab+GX14LJN4HrWBcuo6Evmsl9hEfnqxgcHCKb9q+mNf6EVdsjx/qucYFIIB84pg== + dependencies: + tslib "^2.0.3" + +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + +lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== + +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + +lru-cache@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +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: + 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== + +make-fetch-happen@^8.0.14: + version "8.0.14" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz#aaba73ae0ab5586ad8eaa68bd83332669393e222" + integrity sha512-EsS89h6l4vbfJEtBZnENTOFk8mCRpY5ru36Xe5bcX1KYIli2mkSHqoFsp5O1wMDvTJJzxe/4THpCTtygjeeGWQ== + dependencies: + agentkeepalive "^4.1.3" + cacache "^15.0.5" + http-cache-semantics "^4.1.0" + http-proxy-agent "^4.0.1" + https-proxy-agent "^5.0.0" + is-lambda "^1.0.1" + lru-cache "^6.0.0" + minipass "^3.1.3" + minipass-collect "^1.0.2" + minipass-fetch "^1.3.2" + minipass-flush "^1.0.5" + minipass-pipeline "^1.2.4" + promise-retry "^2.0.1" + socks-proxy-agent "^5.0.0" + ssri "^8.0.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" + integrity sha512-S6x5wmcDmsDRRU/c2dkccDwQPXoFczc5+HpQ2lON8pnvHlnvHAHj5WlLVvw6n6vNyHuVugYrFohYxbS+pvFpKQ== + dependencies: + escape-string-regexp "^4.0.0" + +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.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== + +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== + dependencies: + braces "^3.0.1" + picomatch "^2.2.3" + +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.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.51.0" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +mimic-response@^1.0.0, mimic-response@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + +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" + +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== + +minipass-collect@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" + integrity sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA== + dependencies: + minipass "^3.0.0" + +minipass-fetch@^1.3.2, minipass-fetch@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.4.1.tgz#d75e0091daac1b0ffd7e9d41629faff7d0c1f1b6" + integrity sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw== + dependencies: + minipass "^3.1.0" + minipass-sized "^1.0.3" + minizlib "^2.0.0" + optionalDependencies: + encoding "^0.1.12" + +minipass-flush@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/minipass-flush/-/minipass-flush-1.0.5.tgz#82e7135d7e89a50ffe64610a787953c4c4cbb373" + integrity sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw== + dependencies: + minipass "^3.0.0" + +minipass-pipeline@^1.2.2, minipass-pipeline@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz#68472f79711c084657c067c5c6ad93cddea8214c" + integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A== + dependencies: + minipass "^3.0.0" + +minipass-sized@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/minipass-sized/-/minipass-sized-1.0.3.tgz#70ee5a7c5052070afacfbc22977ea79def353b70" + integrity sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g== + dependencies: + minipass "^3.0.0" + +minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3: + version "3.1.6" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.6.tgz#3b8150aa688a711a1521af5e8779c1d3bb4f45ee" + integrity sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ== + dependencies: + yallist "^4.0.0" + +minizlib@^2.0.0, minizlib@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" + integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== + dependencies: + minipass "^3.0.0" + yallist "^4.0.0" + +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.3, mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +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" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@^2.0.0, ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +mute-stream@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== + +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== + +nanoid@^3.1.23, nanoid@^3.1.30: + version "3.2.0" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c" + integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA== + +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: + 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" + +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.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@^12.0.8: + version "12.0.8" + resolved "https://registry.yarnpkg.com/next/-/next-12.0.8.tgz#29138f7cdd045e4bbba466af45bf430e769634b4" + integrity sha512-g5c1Kuh1F8tSXJn2rVvzYBzqe9EXaR6+rY3/KrQ7y0D9FueRLfHI35wM0DRadDcPSc3+vncspfhYH3jnYE/KjA== + dependencies: + "@next/env" "12.0.8" + "@next/react-refresh-utils" "12.0.8" + caniuse-lite "^1.0.30001283" + jest-worker "27.0.0-next.5" + node-fetch "2.6.1" + postcss "8.2.15" + react-is "17.0.2" + react-refresh "0.8.3" + stream-browserify "3.0.0" + styled-jsx "5.0.0-beta.6" + use-subscription "1.5.1" + optionalDependencies: + "@next/swc-android-arm64" "12.0.8" + "@next/swc-darwin-arm64" "12.0.8" + "@next/swc-darwin-x64" "12.0.8" + "@next/swc-linux-arm-gnueabihf" "12.0.8" + "@next/swc-linux-arm64-gnu" "12.0.8" + "@next/swc-linux-arm64-musl" "12.0.8" + "@next/swc-linux-x64-gnu" "12.0.8" + "@next/swc-linux-x64-musl" "12.0.8" + "@next/swc-win32-arm64-msvc" "12.0.8" + "@next/swc-win32-ia32-msvc" "12.0.8" + "@next/swc-win32-x64-msvc" "12.0.8" + +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + +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: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + +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: + 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-releases@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" + integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== + +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= + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +normalize-range@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" + integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= + +normalize-url@^4.1.0: + version "4.5.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" + integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== + +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +nullthrows@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/nullthrows/-/nullthrows-1.1.1.tgz#7818258843856ae971eae4208ad7d7eb19a431b1" + integrity sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw== + +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" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +object-assign@^4.1.0, object-assign@^4.1.1: + version "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.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" + resolved "https://registry.yarnpkg.com/object-keys-normalizer/-/object-keys-normalizer-1.0.1.tgz#db178dbba5e4c7b18b40837c8ef83365ee9348e7" + integrity sha1-2xeNu6Xkx7GLQIN8jvgzZe6TSOc= + dependencies: + lodash.camelcase "^4.3.0" + lodash.snakecase "^4.1.1" + +object-keys@^1.0.12, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object-merge-advanced@12.0.3: + version "12.0.3" + resolved "https://registry.yarnpkg.com/object-merge-advanced/-/object-merge-advanced-12.0.3.tgz#e03c19aa33cf88da6b32187e4907b487668808d9" + integrity sha512-xQIf2Vup1rpKiHr2tQca5jyNYgT4O0kNxOfAp3ZNonm2hS+5yaJgI0Czdk/QMy52bcRwQKX3uc3H8XtAiiYfVA== + dependencies: + "@babel/runtime" "^7.12.13" + array-includes-with-glob "^3.0.6" + lodash.clonedeep "^4.5.0" + lodash.includes "^4.3.0" + lodash.isdate "^4.0.1" + lodash.isplainobject "^4.0.6" + 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" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + 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" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +onetime@^5.1.0, onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +opener@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" + integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== + +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" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +p-cancelable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" + integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== + +p-limit@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + 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" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + 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" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-map@^2.0.0, p-map@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" + integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== + +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== + 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" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +package-json@^6.3.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" + integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ== + dependencies: + got "^9.6.0" + registry-auth-token "^4.0.0" + registry-url "^5.0.0" + semver "^6.2.0" + +param-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5" + integrity sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-filepath@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" + integrity sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE= + dependencies: + is-absolute "^1.0.0" + 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" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +pascal-case@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb" + integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + +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" + resolved "https://registry.yarnpkg.com/path-case/-/path-case-3.0.4.tgz#9168645334eb942658375c56f80b4c0cb5f82c6f" + integrity sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg== + dependencies: + 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" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + 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.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== + +path-root-regex@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" + integrity sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0= + +path-root@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" + integrity sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc= + dependencies: + path-root-regex "^0.1.0" + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +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.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +popper.js@1.16.1-lts: + version "1.16.1-lts" + resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1-lts.tgz#cf6847b807da3799d80ee3d6d2f90df8a3f50b05" + integrity sha512-Kjw8nKRl1m+VrSFCoVGPph93W/qrSO7ZkqPpTf7F4bk/sqcfWK019dWBUpE/fBOsOQY1dks/Bmcbfn1heM/IsA== + +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: + postcss-selector-parser "^6.0.2" + +postcss-color-functional-notation@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/postcss-color-functional-notation/-/postcss-color-functional-notation-4.2.1.tgz#a25e9e1855e14d04319222a689f120b3240d39e0" + integrity sha512-62OBIXCjRXpQZcFOYIXwXBlpAVWrYk8ek1rcjvMING4Q2cf0ipyN9qT+BhHA6HmftGSEnFQu2qgKO3gMscl3Rw== + dependencies: + postcss-value-parser "^4.2.0" + +postcss-color-hex-alpha@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/postcss-color-hex-alpha/-/postcss-color-hex-alpha-8.0.2.tgz#7a248b006dd47bd83063f662352d31fd982f74ec" + integrity sha512-gyx8RgqSmGVK156NAdKcsfkY3KPGHhKqvHTL3hhveFrBBToguKFzhyiuk3cljH6L4fJ0Kv+JENuPXs1Wij27Zw== + dependencies: + postcss-value-parser "^4.2.0" + +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-value-parser "^4.2.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-custom-properties@^12.1.2: + version "12.1.3" + resolved "https://registry.yarnpkg.com/postcss-custom-properties/-/postcss-custom-properties-12.1.3.tgz#8e37651c7188e72e6762eeae8db39755e84d3a64" + integrity sha512-rtu3otIeY532PnEuuBrIIe+N+pcdbX/7JMZfrcL09wc78YayrHw5E8UkDfvnlOhEUrI4ptCuzXQfj+Or6spbGA== + dependencies: + postcss-value-parser "^4.2.0" + +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-selector-parser "^6.0.4" + +postcss-dir-pseudo-class@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/postcss-dir-pseudo-class/-/postcss-dir-pseudo-class-6.0.3.tgz#febfe305e75267913a53bf5094c7679f5cfa9b55" + integrity sha512-qiPm+CNAlgXiMf0J5IbBBEXA9l/Q5HGsNGkL3znIwT2ZFRLGY9U2fTUpa4lqCUXQOxaLimpacHeQC80BD2qbDw== + dependencies: + postcss-selector-parser "^6.0.8" + +postcss-double-position-gradients@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/postcss-double-position-gradients/-/postcss-double-position-gradients-3.0.4.tgz#2484b9785ef3ba81b0f03a279c52ec58fc5344c2" + integrity sha512-qz+s5vhKJlsHw8HjSs+HVk2QGFdRyC68KGRQGX3i+GcnUjhWhXQEmCXW6siOJkZ1giu0ddPwSO6I6JdVVVPoog== + dependencies: + postcss-value-parser "^4.2.0" + +postcss-env-function@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/postcss-env-function/-/postcss-env-function-4.0.4.tgz#4e85359ca4fcdde4ec4b73752a41de818dbe91cc" + integrity sha512-0ltahRTPtXSIlEZFv7zIvdEib7HN0ZbUQxrxIKn8KbiRyhALo854I/CggU5lyZe6ZBvSTJ6Al2vkZecI2OhneQ== + dependencies: + 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@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/postcss-focus-visible/-/postcss-focus-visible-6.0.3.tgz#14635b71a6b9140f488f11f26cbc9965a13f6843" + integrity sha512-ozOsg+L1U8S+rxSHnJJiET6dNLyADcPHhEarhhtCI9DBLGOPG/2i4ddVoFch9LzrBgb8uDaaRI4nuid2OM82ZA== + dependencies: + postcss-selector-parser "^6.0.8" + +postcss-focus-within@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/postcss-focus-within/-/postcss-focus-within-5.0.3.tgz#0b0bf425f14a646bbfd973b463e2d20d85a3a841" + integrity sha512-fk9y2uFS6/Kpp7/A9Hz9Z4rlFQ8+tzgBcQCXAFSrXFGAbKx+4ZZOmmfHuYjCOMegPWoz0pnC6fNzi8j7Xyqp5Q== + dependencies: + postcss-selector-parser "^6.0.8" + +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@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/postcss-gap-properties/-/postcss-gap-properties-3.0.2.tgz#562fbf43a6a721565b3ca0e01008690991d2f726" + integrity sha512-EaMy/pbxtQnKDsnbEjdqlkCkROTQZzolcLKgIE+3b7EuJfJydH55cZeHfm+MtIezXRqhR80VKgaztO/vHq94Fw== + +postcss-image-set-function@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/postcss-image-set-function/-/postcss-image-set-function-4.0.4.tgz#ce91579ab2c1386d412ff5cd5e733c474b1f75ee" + integrity sha512-BlEo9gSTj66lXjRNByvkMK9dEdEGFXRfGjKRi9fo8s0/P3oEk74cAoonl/utiM50E2OPVb/XSu+lWvdW4KtE/Q== + 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-lab-function@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/postcss-lab-function/-/postcss-lab-function-4.0.3.tgz#633745b324afbcd5881da85fe2cef58b17487536" + integrity sha512-MH4tymWmefdZQ7uVG/4icfLjAQmH6o2NRYyVh2mKoB4RXJp9PjsyhZwhH4ouaCQHvg+qJVj3RzeAR1EQpIlXZA== + dependencies: + postcss-value-parser "^4.2.0" + +postcss-load-config@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.1.tgz#2f53a17f2f543d9e63864460af42efdac0d41f87" + integrity sha512-c/9XYboIbSEUZpiD1UQD0IKiUe8n9WHYV7YFe7X7J+ZwCsEKkUJSFWjS9hBU1RR9THR7jMXst8sxiqP0jjo2mg== + dependencies: + lilconfig "^2.0.4" + yaml "^1.10.2" + +postcss-logical@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/postcss-logical/-/postcss-logical-5.0.3.tgz#9934e0fb16af70adbd94217b24d2f315ceb5c2f0" + integrity sha512-P5NcHWYrif0vK8rgOy/T87vg0WRIj3HSknrvp1wzDbiBeoDPVmiVRmkown2eSQdpPveat/MC1ess5uhzZFVnqQ== + +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.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.6" + +postcss-nesting@^10.1.2: + version "10.1.2" + resolved "https://registry.yarnpkg.com/postcss-nesting/-/postcss-nesting-10.1.2.tgz#2e5f811b3d75602ea18a95dd445bde5297145141" + integrity sha512-dJGmgmsvpzKoVMtDMQQG/T6FSqs6kDtUDirIfl4KnjMCiY9/ETX8jdKyCd20swSRAbUYkaBKV20pxkzxoOXLqQ== + dependencies: + postcss-selector-parser "^6.0.8" + +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@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/postcss-overflow-shorthand/-/postcss-overflow-shorthand-3.0.2.tgz#b4e9c89728cd1e4918173dfb95936b75f78d4148" + integrity sha512-odBMVt6PTX7jOE9UNvmnLrFzA9pXS44Jd5shFGGtSHY80QCuJF+14McSy0iavZggRZ9Oj//C9vOKQmexvyEJMg== + +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-place@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/postcss-place/-/postcss-place-7.0.3.tgz#ca8040dfd937c7769a233a3bd6e66e139cf89e62" + integrity sha512-tDQ3m+GYoOar+KoQgj+pwPAvGHAp/Sby6vrFiyrELrMKQJ4AejL0NcS0mm296OKKYA2SRg9ism/hlT/OLhBrdQ== + dependencies: + postcss-value-parser "^4.2.0" + +postcss-preset-env@^7.2.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/postcss-preset-env/-/postcss-preset-env-7.2.3.tgz#01b9b6eea0ff16c27a3d514f10105d56363428a6" + integrity sha512-Ok0DhLfwrcNGrBn8sNdy1uZqWRk/9FId0GiQ39W4ILop5GHtjJs8bu1MY9isPwHInpVEPWjb4CEcEaSbBLpfwA== + dependencies: + autoprefixer "^10.4.2" + browserslist "^4.19.1" + caniuse-lite "^1.0.30001299" + css-blank-pseudo "^3.0.2" + css-has-pseudo "^3.0.3" + css-prefers-color-scheme "^6.0.2" + cssdb "^5.0.0" + postcss-attribute-case-insensitive "^5.0.0" + postcss-color-functional-notation "^4.2.1" + postcss-color-hex-alpha "^8.0.2" + postcss-color-rebeccapurple "^7.0.2" + postcss-custom-media "^8.0.0" + postcss-custom-properties "^12.1.2" + postcss-custom-selectors "^6.0.0" + postcss-dir-pseudo-class "^6.0.3" + postcss-double-position-gradients "^3.0.4" + postcss-env-function "^4.0.4" + postcss-focus-visible "^6.0.3" + postcss-focus-within "^5.0.3" + postcss-font-variant "^5.0.0" + postcss-gap-properties "^3.0.2" + postcss-image-set-function "^4.0.4" + postcss-initial "^4.0.1" + postcss-lab-function "^4.0.3" + postcss-logical "^5.0.3" + postcss-media-minmax "^5.0.0" + postcss-nesting "^10.1.2" + postcss-overflow-shorthand "^3.0.2" + postcss-page-break "^3.0.4" + postcss-place "^7.0.3" + postcss-pseudo-class-any-link "^7.0.2" + postcss-replace-overflow-wrap "^4.0.0" + postcss-selector-not "^5.0.0" + +postcss-pseudo-class-any-link@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-7.0.2.tgz#6284c2f970715c78fe992d2fac1130e9991585c9" + integrity sha512-CG35J1COUH7OOBgpw5O+0koOLUd5N4vUGKUqSAuIe4GiuLHWU96Pqp+UPC8QITTd12zYAFx76pV7qWT/0Aj/TA== + dependencies: + postcss-selector-parser "^6.0.8" + +postcss-replace-overflow-wrap@^4.0.0: + version "4.0.0" + 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@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/postcss-selector-not/-/postcss-selector-not-5.0.0.tgz#ac5fc506f7565dd872f82f5314c0f81a05630dc7" + integrity sha512-/2K3A4TCP9orP4TNS7u3tGdRFVKqz/E6pX3aGnriPG0jU78of8wsUcqE4QAhWEU0d+WnMSF93Ah3F//vUtK+iQ== + dependencies: + balanced-match "^1.0.0" + +postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.6, postcss-selector-parser@^6.0.8: + 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@^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@8.2.15: + version "8.2.15" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.2.15.tgz#9e66ccf07292817d226fc315cbbf9bc148fbca65" + integrity sha512-2zO3b26eJD/8rb106Qu2o7Qgg52ND5HPjcyQiK2B98O388h43A448LCslC0dI2P97wCAQRJsFvwTRcXxTKds+Q== + dependencies: + colorette "^1.2.2" + nanoid "^3.1.23" + source-map "^0.6.1" + +postcss@^8.3.5: + version "8.4.5" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.5.tgz#bae665764dfd4c6fcc24dc0fdf7e7aa00cc77f95" + integrity sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg== + dependencies: + nanoid "^3.1.30" + picocolors "^1.0.0" + source-map-js "^1.0.1" + +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= + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= + +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== + +promise-inflight@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= + +promise-retry@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22" + integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g== + dependencies: + err-code "^2.0.2" + retry "^0.12.0" + +promise@^7.1.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" + integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg== + dependencies: + asap "~2.0.3" + +prop-types@^15.5.4, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, 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.13.1" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +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== + +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== + +qs@^6.10.2, 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== + +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== + +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: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +rc@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +react-dom@^17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" + integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + scheduler "^0.20.2" + +react-event-listener@^0.6.0: + version "0.6.6" + resolved "https://registry.yarnpkg.com/react-event-listener/-/react-event-listener-0.6.6.tgz#758f7b991cad9086dd39fd29fad72127e1d8962a" + integrity sha512-+hCNqfy7o9wvO6UgjqFmBzARJS7qrNoda0VqzvOuioEpoEXKutiKuv92dSz6kP7rYLmyHPyYNLesi5t/aH1gfw== + dependencies: + "@babel/runtime" "^7.2.0" + prop-types "^15.6.0" + warning "^4.0.1" + +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, "react-is@^16.8.0 || ^17.0.0", 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.13.1, react-is@^16.7.0: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +react-merge-refs@^1.1.0: + version "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-remove-scroll-bar@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.2.0.tgz#d4d545a7df024f75d67e151499a6ab5ac97c8cdd" + integrity sha512-UU9ZBP1wdMR8qoUs7owiVcpaPwsQxUDC2lypP6mmixaGlARZa7ZIBx1jcuObLdhMOvCsnZcvetOho0wzPa9PYg== + dependencies: + react-style-singleton "^2.1.0" + tslib "^1.0.0" + +react-remove-scroll@^2.4.0: + version "2.4.4" + resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.4.4.tgz#2dfff377cf17efc00de39dad51c143fc7a1b9e3e" + integrity sha512-EyC5ohYhaeKbThMSQxuN2i+QC5HqV3AJvNZKEdiATITexu0gHm00+5ko0ltNS1ajYJVeDgVG2baRSCei0AUWlQ== + dependencies: + react-remove-scroll-bar "^2.1.0" + react-style-singleton "^2.1.0" + tslib "^1.0.0" + use-callback-ref "^1.2.3" + use-sidecar "^1.0.1" + +react-style-singleton@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.1.1.tgz#ce7f90b67618be2b6b94902a30aaea152ce52e66" + integrity sha512-jNRp07Jza6CBqdRKNgGhT3u9umWvils1xsuMOjZlghBDH2MU0PL2WZor4PGYjXpnRCa9DQSlHMs/xnABWOwYbA== + dependencies: + get-nonce "^1.0.0" + invariant "^2.2.4" + tslib "^1.0.0" + +react-swipeable-views-core@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/react-swipeable-views-core/-/react-swipeable-views-core-0.14.0.tgz#6ac443a7cc7bc5ea022fbd549292bb5fff361cce" + integrity sha512-0W/e9uPweNEOSPjmYtuKSC/SvKKg1sfo+WtPdnxeLF3t2L82h7jjszuOHz9C23fzkvLfdgkaOmcbAxE9w2GEjA== + dependencies: + "@babel/runtime" "7.0.0" + warning "^4.0.1" + +react-swipeable-views-utils@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/react-swipeable-views-utils/-/react-swipeable-views-utils-0.14.0.tgz#6b76e251906747482730c22002fe47ab1014ba32" + integrity sha512-W+fXBOsDqgFK1/g7MzRMVcDurp3LqO3ksC8UgInh2P/tKgb5DusuuB1geKHFc6o1wKl+4oyER4Zh3Lxmr8xbXA== + dependencies: + "@babel/runtime" "7.0.0" + keycode "^2.1.7" + prop-types "^15.6.0" + react-event-listener "^0.6.0" + react-swipeable-views-core "^0.14.0" + shallow-equal "^1.2.1" + +react-swipeable-views@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/react-swipeable-views/-/react-swipeable-views-0.14.0.tgz#149c0df3d92220cc89e3f6d5c04a78dfe46f9b54" + integrity sha512-wrTT6bi2nC3JbmyNAsPXffUXLn0DVT9SbbcFr36gKpbaCgEp7rX/OFxsu5hPc/NBsUhHyoSRGvwqJNNrWTwCww== + dependencies: + "@babel/runtime" "7.0.0" + prop-types "^15.5.4" + react-swipeable-views-core "^0.14.0" + react-swipeable-views-utils "^0.14.0" + warning "^4.0.1" + +react-transition-group@^4.4.0, react-transition-group@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.2.tgz#8b59a56f09ced7b55cbd53c36768b922890d5470" + integrity sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg== + dependencies: + "@babel/runtime" "^7.5.5" + dom-helpers "^5.0.1" + loose-envify "^1.4.0" + prop-types "^15.6.2" + +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.1" + +react@^17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" + integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + +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== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.4.0, readable-stream@^3.5.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== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +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: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +redis-commands@1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.7.0.tgz#15a6fea2d58281e27b1cd1acfb4b293e278c3a89" + integrity sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ== + +redis-errors@^1.0.0, redis-errors@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/redis-errors/-/redis-errors-1.2.0.tgz#eb62d2adb15e4eaf4610c04afe1529384250abad" + integrity sha1-62LSrbFeTq9GEMBK/hUpOEJQq60= + +redis-parser@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-3.0.0.tgz#b66d828cdcafe6b4b8a428a7def4c6bcac31c8b4" + integrity sha1-tm2CjNyv5rS4pCin3vTGvKwxyLQ= + dependencies: + redis-errors "^1.0.0" + +regenerator-runtime@^0.12.0: + version "0.12.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" + integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== + +regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.4: + 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" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250" + integrity sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw== + dependencies: + rc "^1.2.8" + +registry-url@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" + integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw== + dependencies: + rc "^1.2.8" + +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.14.0" + "@babel/generator" "^7.14.0" + "@babel/parser" "^7.14.0" + "@babel/runtime" "^7.0.0" + "@babel/traverse" "^7.14.0" + "@babel/types" "^7.0.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 "12.0.0" + signedsource "^1.0.0" + yargs "^15.3.1" + +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" + resolved "https://registry.yarnpkg.com/remedial/-/remedial-1.0.8.tgz#a5e4fd52a0e4956adbaf62da63a5a46a78c578a0" + integrity sha512-/62tYiOe6DzS5BqVsNpH/nkGlX45C/Sp6V+NtiN6JQNS1Viay7cWkazmRkrQrdFj2eshDe96SIQNIoMxqhzBOg== + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +remove-trailing-spaces@^1.0.6: + version "1.0.8" + 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" + integrity sha1-gdgax663LX9cSUKt8ml6MiBojY4= + +require-directory@^2.1.1: + version "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" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-from@5.0.0, resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +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.12.0, resolve@^1.20.0, resolve@^1.21.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" + +responselike@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= + dependencies: + lowercase-keys "^1.0.0" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + 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, 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, 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== + +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" + +run-async@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +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" + +rxjs@^7.2.0, rxjs@^7.5.2: + version "7.5.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.2.tgz#11e4a3a1dfad85dbf7fb6e33cbba17668497490b" + integrity sha512-PwDt186XaL3QN5qXj/H9DGyHhP3/RYYgZZwqBv9Tv8rsAaiwFH1IsJJlcgD37J7UW5a6O67qX0KWKS3/pu0m4w== + 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== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +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", "safer-buffer@>= 2.1.2 < 3.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +scheduler@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" + integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + +scuid@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/scuid/-/scuid-1.1.0.tgz#d3f9f920956e737a60f72d0e4ad280bf324d5dab" + integrity sha512-MuCAyrGZcTLfQoH2XoBlQ8C6bzwN88XT/0slOGz0pn8+gIP85BOAfYa44ZXQUTOwRwPU0QvgU+V+OSajl/59Xg== + +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.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" + integrity sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + upper-case-first "^2.0.2" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +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= + +shallow-equal@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da" + integrity sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA== + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +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.6" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af" + integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ== + +signedsource@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/signedsource/-/signedsource-1.0.0.tgz#1ddace4981798f93bd833973803d80d52e93ad6a" + integrity sha1-HdrOSYF5j5O9gzlzgD2A1S6TrWo= + +sirv@^1.0.7: + 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.20" + mrmime "^1.0.0" + totalist "^1.0.0" + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= + +slice-ansi@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" + integrity sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^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" + +smart-buffer@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" + integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== + +snake-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c" + integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +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" + +snyk@^1.759.0: + version "1.887.0" + resolved "https://registry.yarnpkg.com/snyk/-/snyk-1.887.0.tgz#7bba222689564dde29cc8327e78fafcd6e2a2af1" + integrity sha512-fkTK/V3Bfi14pYyxGgK0QxijRuVTyewTGFsdBOcWmcGw2asAR8ly4nRc/Tk1dtbmfTWHitWbLYT0xPV82NShow== + +socks-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz#032fb583048a29ebffec2e6a73fca0761f48177e" + integrity sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ== + dependencies: + agent-base "^6.0.2" + debug "4" + socks "^2.3.3" + +socks@^2.3.3: + version "2.6.2" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.2.tgz#ec042d7960073d40d94268ff3bb727dc685f111a" + integrity sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA== + dependencies: + ip "^1.1.5" + smart-buffer "^4.2.0" + +source-map-js@^1.0.1: + 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.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-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.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@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: + 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: + 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" + integrity sha512-dblb9Et4DAtiZ5YSUZHLl4XhH4uK80GhAZrVXdN4O2P4gQ40Wa5UIOPUHlA/nFd2PLblBZWUioLMMAVrgpoYcA== + dependencies: + tslib "^2.0.3" + +ssri@^8.0.0, ssri@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-8.0.1.tgz#638e4e439e2ffbd2cd289776d5ca457c4f51a2af" + integrity sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ== + dependencies: + minipass "^3.1.1" + +standard-as-callback@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/standard-as-callback/-/standard-as-callback-2.1.0.tgz#8953fc05359868a77b5b9739a665c5977bb7df45" + integrity sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A== + +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: + define-property "^0.2.5" + object-copy "^0.1.0" + +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" + +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== + +string-env-interpolation@1.0.1, string-env-interpolation@^1.0.1: + version "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" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +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.1" + +string-width@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.0.tgz#5ab00980cfb29f43e736b113a120a73a0fb569d3" + integrity sha512-7x54QnN21P+XL/v8SuNKvfgsUre6PXpN7mc77N3HlZv+f1SBRGmjxtOud2Z6FZ8DmdkD/IdjCaf9XXbnqmTZGQ== + 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" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +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== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.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" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + 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= + +stripe@^8.197.0: + version "8.199.0" + resolved "https://registry.yarnpkg.com/stripe/-/stripe-8.199.0.tgz#dcd109f16ff0c33da638a0d154c966d0f20c73d1" + integrity sha512-Bc5Zfp6eOOCdde9x5NPrAczeGSKuNwemzjsfGJXWtpbUfQXgJujzTGgkhx2YuzamqakDYJkTgf9w7Ry2uY8QNA== + dependencies: + "@types/node" ">=8.1.0" + qs "^6.6.0" + +styled-jsx@5.0.0-beta.6: + version "5.0.0-beta.6" + resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.0-beta.6.tgz#666552f8831a06f80c9084a47afc4b32b0c9f461" + integrity sha512-b1cM7Xyp2r1lsNpvoZ6wmTI8qxD0557vH2feHakNU8LMkzfJDgTQMul6O7sSYY0GxQ73pKEN69hCDp71w6Q0nA== + dependencies: + "@babel/plugin-syntax-jsx" "7.14.5" + "@babel/types" "7.15.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" + +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== + +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== + +stylis@4.0.13: + version "4.0.13" + resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.0.13.tgz#f5db332e376d13cc84ecfe5dace9a2a51d954c91" + integrity sha512-xGPXiFVl4YED9Jh7Euv2V220mriG9u4B2TA6Ybjc1catrstKD2PpIdU3U0RKpkVBC2EhmL/F0sPCr9vrFTNRag== + +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" + iterall "^1.2.1" + symbol-observable "^1.0.4" + ws "^5.2.0 || ^6.0.0 || ^7.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + 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" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + 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" + resolved "https://registry.yarnpkg.com/swap-case/-/swap-case-2.0.2.tgz#671aedb3c9c137e2985ef51c51f9e98445bf70d9" + integrity sha512-kc6S2YS/2yXbtkSMunBtKdah4VFETZ8Oh6ONSmSd9bRxhqTrtARUCBUiWXH3xVPpvR7tz2CSnkuXVE42EcGnMw== + dependencies: + tslib "^2.0.3" + +swell-js@^4.0.0-next.0: + version "4.0.0-next.0" + resolved "https://registry.yarnpkg.com/swell-js/-/swell-js-4.0.0-next.0.tgz#870599372e3c9eafefeafc2c63863c4032d8be6b" + integrity sha512-OQ1FLft3ruKpQw5P0TiCzs/X2Ma95+Qz+I2Xzs4KC6v+zVaFVUGNs80dQdtjfInisWoFC7iFZF2AITgellVGAg== + dependencies: + "@babel/runtime" "7.4.5" + deepmerge "4.2.2" + isomorphic-fetch "3.0.0" + lodash "4.17.21" + object-keys-normalizer "1.0.1" + object-merge-advanced "12.0.3" + qs "6.7.0" + +swr@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/swr/-/swr-1.2.0.tgz#8649f6e9131ce94bbcf7ffd65c21334da3d1ec20" + integrity sha512-C3IXeKOREn0jQ1ewXRENE7ED7jjGbFTakwB64eLACkCqkF/A0N2ckvpCTftcaSYi5yV36PzoehgVCOVRmtECcA== + +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.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.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-5.2.1.tgz#e3fda7367ddbb172dcda9f871c0fdb36d1c4cd9c" + integrity sha512-40pEZ2mhjaZzK0BnI+QGNjJO8UYx9pP5v7BGe17SORTO0OEuuaAwQTkAp8whcZvqon44wKFOikD+Al11K3JICQ== + +tailwindcss@^3.0.13: + version "3.0.16" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.0.16.tgz#eb6e7a0ecec56e43b9dad439b8cb3a5da1e0c1a3" + integrity sha512-1L8E5Wr+o1c4kxxObNz2owJe94a7BLEMV+2Lz6wzprJdcs3ENSRR9t4OZf2OqtRNS/q/zFPuOKoLtQoy3Lrhhw== + dependencies: + arg "^5.0.1" + chalk "^4.1.2" + chokidar "^3.5.2" + color-name "^1.1.4" + cosmiconfig "^7.0.1" + detective "^5.2.0" + didyoumean "^1.2.2" + dlv "^1.1.3" + 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 "^4.0.0" + postcss-load-config "^3.1.0" + postcss-nested "5.0.6" + postcss-selector-parser "^6.0.8" + postcss-value-parser "^4.2.0" + quick-lru "^5.1.1" + resolve "^1.21.0" + +tar@^6.0.2: + version "6.1.11" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" + integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== + dependencies: + chownr "^2.0.0" + fs-minipass "^2.0.0" + minipass "^3.0.0" + minizlib "^2.1.1" + mkdirp "^1.0.3" + yallist "^4.0.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= + +tiny-warning@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" + integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== + +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" + resolved "https://registry.yarnpkg.com/title-case/-/title-case-3.0.3.tgz#bc689b46f02e411f1d1e1d081f7c3deca0489982" + integrity sha512-e1zGYRvbffpcHIrnuqT0Dh+gEJtDaxDSoG4JAIpq4oDFyooziLBIiYQv0GBT4FUAnUop5uZ1hiIAj7oAF6sOCA== + dependencies: + tslib "^2.0.3" + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +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" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +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@~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.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" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d" + integrity sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg== + dependencies: + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.17" + yn "3.1.1" + +tsconfig-paths@^3.12.0, tsconfig-paths@^3.9.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" + integrity sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.0" + strip-bom "^3.0.0" + +tslib@^1.0.0, tslib@^1.14.1, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: + 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, tslib@^2.3.1, 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== + +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" + +turbo-darwin-64@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo-darwin-64/-/turbo-darwin-64-1.1.2.tgz#b129aaf538821de78d5e2129495c553627174650" + integrity sha512-rua17HnVvAqAU54gVfiQoH7cfopOqANv+yI6NtxLMD8aFfX2cJ9m8SSvH2v2vCaToNDW6OnTkdqDKQpqIHzbCw== + +turbo-darwin-arm64@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo-darwin-arm64/-/turbo-darwin-arm64-1.1.2.tgz#07a783ad2e3e8af600ae7406cc4062ff56ac0351" + integrity sha512-otqSQNYDyKg0KqB3NM0BI4oiRPKdJkUE/XBn8dcUS+zeRLrL00XtaM0eSwynZs1tb6zU/Y+SPMSBRygD1TCOnw== + +turbo-freebsd-64@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo-freebsd-64/-/turbo-freebsd-64-1.1.2.tgz#9e22abf04ec2298f205a57b5c9ce14e22844baf3" + integrity sha512-2nxwVDTAM0DtIQ2i3UOfEsQLF7vp+XZ/b9SKtiHxz710fXvdyuGivYI25axDdcBn8kQ45rnbUnarF1aW8CMGgg== + +turbo-freebsd-arm64@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo-freebsd-arm64/-/turbo-freebsd-arm64-1.1.2.tgz#6095c9012881225a5fdfb55362defa12f24b1f8e" + integrity sha512-ro1Ah96yzgzyT0BJe1mceAqxPxi0pUwzAvN3IKVpMqi4hYkT3aRbzDCaSxzyC6let2Al/NUsgHnbAv38OF2Xkw== + +turbo-linux-32@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo-linux-32/-/turbo-linux-32-1.1.2.tgz#4726e533d6966172b6bc4a960524ec2eb61adaab" + integrity sha512-HKBsETxQMVaf/DJwMg7pypPbGA6KEu0gEf9C8o2aPJvwMPBYgNsNaU08Xizuh5xzEQTzpbIWfQyqdNgMV4RG3Q== + +turbo-linux-64@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo-linux-64/-/turbo-linux-64-1.1.2.tgz#dfe7f3a4c91acecdb84ecab330acee06857e568e" + integrity sha512-IklKsOklcRHIWkTzKg95BQ6jgJ53kLvRMrp8yqzlvZprkWdiyhAgUxrUTTHOOTce2XA3+jdN2+MwixG44uY2vg== + +turbo-linux-arm64@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo-linux-arm64/-/turbo-linux-arm64-1.1.2.tgz#c39b6c50657fa0e82627407c86a5c43f19598e2b" + integrity sha512-3kS6sk2lOtuBBqkcL+yeGqD1yew4UZ1o7XUcbDD8UPwhF2kAfK7Qs0vTJw4lnO1scjhihkoTrmXM7yozvjf4/w== + +turbo-linux-arm@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo-linux-arm/-/turbo-linux-arm-1.1.2.tgz#2f51f93a3aa144b8ba25d7b0e3c53ea186a0e9dd" + integrity sha512-CNbaTvRozq7H/5jpy9OZlzJ6BkeEXF+nF2n9dHiUrbAXd3nq84Qt9odcQJmGnexP19YS9w6l3tIHncX4BgwtqA== + +turbo-linux-mips64le@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo-linux-mips64le/-/turbo-linux-mips64le-1.1.2.tgz#f52b7f410ac289d4e539f108679d2324aa5e271e" + integrity sha512-CDoXVIlW43C6KLgYxe13KkG8h6DswXHxbTVHiZdOwRQ56j46lU+JOVpLoh6wpQGcHvj58VEiypZBRTGVFMeogw== + +turbo-linux-ppc64le@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo-linux-ppc64le/-/turbo-linux-ppc64le-1.1.2.tgz#18d08d3414075d0dcb4be83ca837dda508313996" + integrity sha512-xPVMHoiOJE/qI63jSOXwYIUFQXLdstxDV6fLnRxvq0QnJNxgTKq+mLUeE8M4LDVh1bdqHLcfk/HmyQ6+X1XVkQ== + +turbo-windows-32@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo-windows-32/-/turbo-windows-32-1.1.2.tgz#96033019094bcb091647d6063c3c9b8e83d0acbe" + integrity sha512-Gj1yvPE0aMDSOxGVSBaecLnwsVDT1xX8U0dtLrg52TYY2jlaci0atjHKr9nTFuX7z8uwAf6PopwdriGoCeT3ng== + +turbo-windows-64@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo-windows-64/-/turbo-windows-64-1.1.2.tgz#8eb3f77ab7e04b077752ae2204114c82e5c74697" + integrity sha512-0Ncx/iKhnKrdAU8hJ+8NUcF9jtFr8KoW5mMWfiFzy+mgUbVKbpzWT2eoGR6zJExedQsRvYOejbEX5iihbnj5bA== + +turbo@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/turbo/-/turbo-1.1.2.tgz#751b9651dc3ebe469898db76afab6405666ad0ff" + integrity sha512-3ViHKyAkaBKNKwHASTa1zkVT3tVVhQNLrpxBS7LoN+794ouQUYmy6lf0rTqzG3iTZHtIDwC+piZSdTl4XjEVMg== + optionalDependencies: + turbo-darwin-64 "1.1.2" + turbo-darwin-arm64 "1.1.2" + turbo-freebsd-64 "1.1.2" + turbo-freebsd-arm64 "1.1.2" + turbo-linux-32 "1.1.2" + turbo-linux-64 "1.1.2" + turbo-linux-arm "1.1.2" + turbo-linux-arm64 "1.1.2" + turbo-linux-mips64le "1.1.2" + turbo-linux-ppc64le "1.1.2" + turbo-windows-32 "1.1.2" + turbo-windows-64 "1.1.2" + +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== + +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== + +typescript@^4.5.4: + version "4.5.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" + integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== + +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" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" + integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.1" + has-symbols "^1.0.2" + which-boxed-primitive "^1.0.2" + +unc-path-regex@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" + integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= + +undici@^4.9.3: + version "4.12.2" + resolved "https://registry.yarnpkg.com/undici/-/undici-4.12.2.tgz#f2fc50ca77a774ed8c0e7067c9361ee18a2f422b" + integrity sha512-RZj6SbkQFs5O/pJCboGEo6l5DTCe3Zg4r/8Z/0/2qnIv08+s6zL4akohOPMYWKc3mzwv15WTvsfMWaafZcvYoQ== + +union-value@^1.0.0: + version "1.0.1" + 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" + +unique-filename@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" + integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== + dependencies: + unique-slug "^2.0.0" + +unique-slug@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c" + integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w== + dependencies: + imurmurhash "^0.1.4" + +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" + +unset-value@^1.0.0: + version "1.0.0" + 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" + resolved "https://registry.yarnpkg.com/upper-case-first/-/upper-case-first-2.0.2.tgz#992c3273f882abd19d1e02894cc147117f844324" + integrity sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg== + dependencies: + tslib "^2.0.3" + +upper-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-2.0.2.tgz#d89810823faab1df1549b7d97a76f8662bae6f7a" + integrity sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg== + 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" + integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= + dependencies: + prepend-http "^2.0.0" + +use-callback-ref@^1.2.3: + version "1.2.5" + resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.2.5.tgz#6115ed242cfbaed5915499c0a9842ca2912f38a5" + integrity sha512-gN3vgMISAgacF7sqsLPByqoePooY3n2emTH59Ur5d/M8eg4WTWu1xp8i8DHjohftIyEx0S08RiYxbffr4j8Peg== + +use-sidecar@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.0.5.tgz#ffff2a17c1df42e348624b699ba6e5c220527f2b" + integrity sha512-k9jnrjYNwN6xYLj1iaGhonDghfvmeTmYjAiGvOr7clwKfPjMXJf4/HOr7oT5tJwYafgp2tG2l3eZEOfoELiMcA== + dependencies: + detect-node-es "^1.1.0" + tslib "^1.9.3" + +use-subscription@1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/use-subscription/-/use-subscription-1.5.1.tgz#73501107f02fad84c6dd57965beb0b75c68c42d1" + integrity sha512-Xv2a1P/yReAjAbhylMfFplFKj9GssgTwN7RlcTxBujFQcloStWNDQdc4g4NRWH9xS4i/FDk04vQBptAXoF3VcA== + 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" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +util-nonempty@^3.0.6: + version "3.1.0" + resolved "https://registry.yarnpkg.com/util-nonempty/-/util-nonempty-3.1.0.tgz#927a9472ead1817afca159b209e5806523b752d3" + integrity sha512-OSZlWoCL74Go83Qw/aeZgSmFZnp9d06bF77b1eAOKipkPWhvxjRYB2nmKiGspoVjkJJEJimzxAgBFUQiUV/oZQ== + dependencies: + "@babel/runtime" "^7.14.0" + lodash.isplainobject "^4.0.6" + +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.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" + +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.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== + +warning@^4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" + integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w== + dependencies: + loose-envify "^1.0.0" + +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: + defaults "^1.0.3" + +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" + resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.3.0.tgz#2f3c0ca9041d5ee47fa418693cf56b4a518b578b" + integrity sha512-J3TPm54bPARx6QG8z4cKBszahnUglcv70+N+8gUqv2I5KOFHJbzBiLx+pAp606so0X004fxM7hqRu10MLjJifA== + dependencies: + acorn "^8.0.4" + acorn-walk "^8.0.0" + chalk "^4.1.0" + commander "^6.2.0" + gzip-size "^6.0.0" + lodash "^4.17.20" + opener "^1.5.2" + sirv "^1.0.7" + ws "^7.3.1" + +whatwg-fetch@^3.4.1: + version "3.6.2" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" + integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== + +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: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + 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" + integrity sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo= + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +"ws@^5.2.0 || ^6.0.0 || ^7.0.0", ws@^7.3.1: + version "7.5.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" + integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== + +ws@^8.3.0: + version "8.4.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.4.2.tgz#18e749868d8439f2268368829042894b6907aa0b" + integrity sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA== + +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== + +y18n@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yallist@^3.0.2: + version "3.1.1" + 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" + integrity sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A== + +yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + +yargs-parser@^18.1.2: + version "18.1.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-parser@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.0.tgz#a485d3966be4317426dd56bdb6a30131b281dc55" + integrity sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA== + +yargs@^15.3.1: + version "15.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.2" + +yargs@^17.0.0: + 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.3" + y18n "^5.0.5" + yargs-parser "^21.0.0" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==