From 9e92abdda0aa9cc8f89a8b0afa7a524464e7ad45 Mon Sep 17 00:00:00 2001
From: kibo-chandradeeptalaha
<89371824+kibo-chandradeeptalaha@users.noreply.github.com>
Date: Tue, 24 Aug 2021 19:15:14 +0530
Subject: [PATCH] Icky 161 folder and env setup (#1)
* folder and env setup
* codegen.json headers removed
Co-authored-by: Chandradeepta <43542673+Chandradeepta@users.noreply.github.com>
---
.env.template | 5 +
README.md | 2 +
framework/commerce/config.js | 170 +-
framework/kibocommerce/.env.template | 1 +
framework/kibocommerce/README.md | 1 +
.../kibocommerce/api/endpoints/cart/index.ts | 1 +
.../api/endpoints/catalog/index.ts | 1 +
.../api/endpoints/catalog/products.ts | 1 +
.../api/endpoints/checkout/index.ts | 1 +
.../api/endpoints/customer/index.ts | 1 +
.../kibocommerce/api/endpoints/login/index.ts | 1 +
.../api/endpoints/logout/index.ts | 1 +
.../api/endpoints/signup/index.ts | 1 +
.../api/endpoints/wishlist/index.tsx | 1 +
framework/kibocommerce/api/index.ts | 44 +
.../api/operations/get-all-pages.ts | 19 +
.../api/operations/get-all-product-paths.ts | 15 +
.../api/operations/get-all-products.ts | 25 +
.../api/operations/get-customer-wishlist.ts | 6 +
.../kibocommerce/api/operations/get-page.ts | 13 +
.../api/operations/get-product.ts | 26 +
.../api/operations/get-site-info.ts | 43 +
.../kibocommerce/api/operations/index.ts | 6 +
.../kibocommerce/api/utils/fetch-local.ts | 34 +
framework/kibocommerce/api/utils/fetch.ts | 3 +
framework/kibocommerce/auth/index.ts | 3 +
framework/kibocommerce/auth/use-login.tsx | 16 +
framework/kibocommerce/auth/use-logout.tsx | 17 +
framework/kibocommerce/auth/use-signup.tsx | 19 +
framework/kibocommerce/cart/index.ts | 4 +
framework/kibocommerce/cart/use-add-item.tsx | 17 +
framework/kibocommerce/cart/use-cart.tsx | 42 +
.../kibocommerce/cart/use-remove-item.tsx | 18 +
.../kibocommerce/cart/use-update-item.tsx | 18 +
framework/kibocommerce/codegen.json | 23 +
framework/kibocommerce/commerce.config.json | 9 +
framework/kibocommerce/customer/index.ts | 1 +
.../kibocommerce/customer/use-customer.tsx | 15 +
framework/kibocommerce/data.json | 235 +
framework/kibocommerce/fetcher.ts | 41 +
framework/kibocommerce/index.tsx | 32 +
framework/kibocommerce/next.config.js | 8 +
framework/kibocommerce/product/index.ts | 2 +
framework/kibocommerce/product/use-price.tsx | 2 +
framework/kibocommerce/product/use-search.tsx | 17 +
framework/kibocommerce/provider.ts | 22 +
framework/kibocommerce/schema.d.ts | 11399 ++++++++++++++++
framework/kibocommerce/schema.graphql | 9129 +++++++++++++
.../kibocommerce/wishlist/use-add-item.tsx | 13 +
.../kibocommerce/wishlist/use-remove-item.tsx | 17 +
.../kibocommerce/wishlist/use-wishlist.tsx | 43 +
next-env.d.ts | 3 +
package-lock.json | 11057 +++++++++++++++
package.json | 7 +-
tsconfig.json | 4 +-
55 files changed, 32567 insertions(+), 88 deletions(-)
create mode 100644 framework/kibocommerce/.env.template
create mode 100644 framework/kibocommerce/README.md
create mode 100644 framework/kibocommerce/api/endpoints/cart/index.ts
create mode 100644 framework/kibocommerce/api/endpoints/catalog/index.ts
create mode 100644 framework/kibocommerce/api/endpoints/catalog/products.ts
create mode 100644 framework/kibocommerce/api/endpoints/checkout/index.ts
create mode 100644 framework/kibocommerce/api/endpoints/customer/index.ts
create mode 100644 framework/kibocommerce/api/endpoints/login/index.ts
create mode 100644 framework/kibocommerce/api/endpoints/logout/index.ts
create mode 100644 framework/kibocommerce/api/endpoints/signup/index.ts
create mode 100644 framework/kibocommerce/api/endpoints/wishlist/index.tsx
create mode 100644 framework/kibocommerce/api/index.ts
create mode 100644 framework/kibocommerce/api/operations/get-all-pages.ts
create mode 100644 framework/kibocommerce/api/operations/get-all-product-paths.ts
create mode 100644 framework/kibocommerce/api/operations/get-all-products.ts
create mode 100644 framework/kibocommerce/api/operations/get-customer-wishlist.ts
create mode 100644 framework/kibocommerce/api/operations/get-page.ts
create mode 100644 framework/kibocommerce/api/operations/get-product.ts
create mode 100644 framework/kibocommerce/api/operations/get-site-info.ts
create mode 100644 framework/kibocommerce/api/operations/index.ts
create mode 100644 framework/kibocommerce/api/utils/fetch-local.ts
create mode 100644 framework/kibocommerce/api/utils/fetch.ts
create mode 100644 framework/kibocommerce/auth/index.ts
create mode 100644 framework/kibocommerce/auth/use-login.tsx
create mode 100644 framework/kibocommerce/auth/use-logout.tsx
create mode 100644 framework/kibocommerce/auth/use-signup.tsx
create mode 100644 framework/kibocommerce/cart/index.ts
create mode 100644 framework/kibocommerce/cart/use-add-item.tsx
create mode 100644 framework/kibocommerce/cart/use-cart.tsx
create mode 100644 framework/kibocommerce/cart/use-remove-item.tsx
create mode 100644 framework/kibocommerce/cart/use-update-item.tsx
create mode 100644 framework/kibocommerce/codegen.json
create mode 100644 framework/kibocommerce/commerce.config.json
create mode 100644 framework/kibocommerce/customer/index.ts
create mode 100644 framework/kibocommerce/customer/use-customer.tsx
create mode 100644 framework/kibocommerce/data.json
create mode 100644 framework/kibocommerce/fetcher.ts
create mode 100644 framework/kibocommerce/index.tsx
create mode 100644 framework/kibocommerce/next.config.js
create mode 100644 framework/kibocommerce/product/index.ts
create mode 100644 framework/kibocommerce/product/use-price.tsx
create mode 100644 framework/kibocommerce/product/use-search.tsx
create mode 100644 framework/kibocommerce/provider.ts
create mode 100644 framework/kibocommerce/schema.d.ts
create mode 100644 framework/kibocommerce/schema.graphql
create mode 100644 framework/kibocommerce/wishlist/use-add-item.tsx
create mode 100644 framework/kibocommerce/wishlist/use-remove-item.tsx
create mode 100644 framework/kibocommerce/wishlist/use-wishlist.tsx
create mode 100644 package-lock.json
diff --git a/.env.template b/.env.template
index 1f0fe0536..84659d9d9 100644
--- a/.env.template
+++ b/.env.template
@@ -23,3 +23,8 @@ NEXT_PUBLIC_SALEOR_CHANNEL=
NEXT_PUBLIC_VENDURE_SHOP_API_URL=
NEXT_PUBLIC_VENDURE_LOCAL_URL=
+
+KIBO_API_TOKEN=
+KIBO_API_URL=
+KIBO_CART_COOKIE=
+KIBO_CUSTOMER_COOKIE=
diff --git a/README.md b/README.md
index d53c5ed86..c11d47ba0 100644
--- a/README.md
+++ b/README.md
@@ -153,3 +153,5 @@ After Email confirmation, Checkout should be manually enabled through BigCommerc
BigCommerce team has been notified and they plan to add more details about this subject.
+
+Test change for forked kibocommerce
diff --git a/framework/commerce/config.js b/framework/commerce/config.js
index 28502a04e..051c58b01 100644
--- a/framework/commerce/config.js
+++ b/framework/commerce/config.js
@@ -2,87 +2,89 @@
* This file is expected to be used in next.config.js only
*/
-const path = require('path')
-const fs = require('fs')
-const merge = require('deepmerge')
-const prettier = require('prettier')
-
-const PROVIDERS = [
- 'bigcommerce',
- 'saleor',
- 'shopify',
- 'swell',
- 'vendure',
- 'local',
-]
-
-function getProviderName() {
- return (
- process.env.COMMERCE_PROVIDER ||
- (process.env.BIGCOMMERCE_STOREFRONT_API_URL
- ? 'bigcommerce'
- : process.env.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN
- ? 'shopify'
- : process.env.NEXT_PUBLIC_SWELL_STORE_ID
- ? 'swell'
- : 'local')
- )
-}
-
-function withCommerceConfig(nextConfig = {}) {
- const commerce = nextConfig.commerce || {}
- const name = commerce.provider || getProviderName()
-
- if (!name) {
- throw new Error(
- `The commerce provider is missing, please add a valid provider name or its environment variables`
- )
- }
- if (!PROVIDERS.includes(name)) {
- throw new Error(
- `The commerce provider "${name}" can't be found, please use one of "${PROVIDERS.join(
- ', '
- )}"`
- )
- }
-
- const commerceNextConfig = require(path.join('../', name, 'next.config'))
- const config = merge(nextConfig, commerceNextConfig)
-
- config.env = config.env || {}
-
- Object.entries(config.commerce.features).forEach(([k, v]) => {
- if (v) config.env[`COMMERCE_${k.toUpperCase()}_ENABLED`] = true
- })
-
- // Update paths in `tsconfig.json` to point to the selected provider
- if (config.commerce.updateTSConfig !== false) {
- const tsconfigPath = path.join(process.cwd(), 'tsconfig.json')
- const tsconfig = require(tsconfigPath)
-
- tsconfig.compilerOptions.paths['@framework'] = [`framework/${name}`]
- tsconfig.compilerOptions.paths['@framework/*'] = [`framework/${name}/*`]
-
- // When running for production it may be useful to exclude the other providers
- // from TS checking
- if (process.env.VERCEL) {
- const exclude = tsconfig.exclude.filter(
- (item) => !item.startsWith('framework/')
- )
-
- tsconfig.exclude = PROVIDERS.reduce((exclude, current) => {
- if (current !== name) exclude.push(`framework/${current}`)
- return exclude
- }, exclude)
- }
-
- fs.writeFileSync(
- tsconfigPath,
- prettier.format(JSON.stringify(tsconfig), { parser: 'json' })
- )
- }
-
- return config
-}
-
-module.exports = { withCommerceConfig, getProviderName }
+ const path = require('path')
+ const fs = require('fs')
+ const merge = require('deepmerge')
+ const prettier = require('prettier')
+
+ const PROVIDERS = [
+ 'bigcommerce',
+ 'saleor',
+ 'shopify',
+ 'swell',
+ 'vendure',
+ 'local',
+ 'kibocommerce'
+ ]
+
+ function getProviderName() {
+ return (
+ process.env.COMMERCE_PROVIDER ||
+ (process.env.BIGCOMMERCE_STOREFRONT_API_URL
+ ? 'bigcommerce'
+ : process.env.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN
+ ? 'shopify'
+ : process.env.NEXT_PUBLIC_SWELL_STORE_ID
+ ? 'swell'
+ : 'local')
+ )
+ }
+
+ function withCommerceConfig(nextConfig = {}) {
+ const commerce = nextConfig.commerce || {}
+ const name = commerce.provider || getProviderName()
+
+ if (!name) {
+ throw new Error(
+ `The commerce provider is missing, please add a valid provider name or its environment variables`
+ )
+ }
+ if (!PROVIDERS.includes(name)) {
+ throw new Error(
+ `The commerce provider "${name}" can't be found, please use one of "${PROVIDERS.join(
+ ', '
+ )}"`
+ )
+ }
+
+ const commerceNextConfig = require(path.join('../', name, 'next.config'))
+ const config = merge(nextConfig, commerceNextConfig)
+
+ config.env = config.env || {}
+
+ Object.entries(config.commerce.features).forEach(([k, v]) => {
+ if (v) config.env[`COMMERCE_${k.toUpperCase()}_ENABLED`] = true
+ })
+
+ // Update paths in `tsconfig.json` to point to the selected provider
+ if (config.commerce.updateTSConfig !== false) {
+ const tsconfigPath = path.join(process.cwd(), 'tsconfig.json')
+ const tsconfig = require(tsconfigPath)
+
+ tsconfig.compilerOptions.paths['@framework'] = [`framework/${name}`]
+ tsconfig.compilerOptions.paths['@framework/*'] = [`framework/${name}/*`]
+
+ // When running for production it may be useful to exclude the other providers
+ // from TS checking
+ if (process.env.VERCEL) {
+ const exclude = tsconfig.exclude.filter(
+ (item) => !item.startsWith('framework/')
+ )
+
+ tsconfig.exclude = PROVIDERS.reduce((exclude, current) => {
+ if (current !== name) exclude.push(`framework/${current}`)
+ return exclude
+ }, exclude)
+ }
+
+ fs.writeFileSync(
+ tsconfigPath,
+ prettier.format(JSON.stringify(tsconfig), { parser: 'json' })
+ )
+ }
+
+ return config
+ }
+
+ module.exports = { withCommerceConfig, getProviderName }
+
\ No newline at end of file
diff --git a/framework/kibocommerce/.env.template b/framework/kibocommerce/.env.template
new file mode 100644
index 000000000..a1ddffa50
--- /dev/null
+++ b/framework/kibocommerce/.env.template
@@ -0,0 +1 @@
+COMMERCE_PROVIDER=kibocommerce
\ No newline at end of file
diff --git a/framework/kibocommerce/README.md b/framework/kibocommerce/README.md
new file mode 100644
index 000000000..a3bc1db32
--- /dev/null
+++ b/framework/kibocommerce/README.md
@@ -0,0 +1 @@
+# Next.js Local Provider
diff --git a/framework/kibocommerce/api/endpoints/cart/index.ts b/framework/kibocommerce/api/endpoints/cart/index.ts
new file mode 100644
index 000000000..491bf0ac9
--- /dev/null
+++ b/framework/kibocommerce/api/endpoints/cart/index.ts
@@ -0,0 +1 @@
+export default function noopApi(...args: any[]): void {}
diff --git a/framework/kibocommerce/api/endpoints/catalog/index.ts b/framework/kibocommerce/api/endpoints/catalog/index.ts
new file mode 100644
index 000000000..491bf0ac9
--- /dev/null
+++ b/framework/kibocommerce/api/endpoints/catalog/index.ts
@@ -0,0 +1 @@
+export default function noopApi(...args: any[]): void {}
diff --git a/framework/kibocommerce/api/endpoints/catalog/products.ts b/framework/kibocommerce/api/endpoints/catalog/products.ts
new file mode 100644
index 000000000..491bf0ac9
--- /dev/null
+++ b/framework/kibocommerce/api/endpoints/catalog/products.ts
@@ -0,0 +1 @@
+export default function noopApi(...args: any[]): void {}
diff --git a/framework/kibocommerce/api/endpoints/checkout/index.ts b/framework/kibocommerce/api/endpoints/checkout/index.ts
new file mode 100644
index 000000000..491bf0ac9
--- /dev/null
+++ b/framework/kibocommerce/api/endpoints/checkout/index.ts
@@ -0,0 +1 @@
+export default function noopApi(...args: any[]): void {}
diff --git a/framework/kibocommerce/api/endpoints/customer/index.ts b/framework/kibocommerce/api/endpoints/customer/index.ts
new file mode 100644
index 000000000..491bf0ac9
--- /dev/null
+++ b/framework/kibocommerce/api/endpoints/customer/index.ts
@@ -0,0 +1 @@
+export default function noopApi(...args: any[]): void {}
diff --git a/framework/kibocommerce/api/endpoints/login/index.ts b/framework/kibocommerce/api/endpoints/login/index.ts
new file mode 100644
index 000000000..491bf0ac9
--- /dev/null
+++ b/framework/kibocommerce/api/endpoints/login/index.ts
@@ -0,0 +1 @@
+export default function noopApi(...args: any[]): void {}
diff --git a/framework/kibocommerce/api/endpoints/logout/index.ts b/framework/kibocommerce/api/endpoints/logout/index.ts
new file mode 100644
index 000000000..491bf0ac9
--- /dev/null
+++ b/framework/kibocommerce/api/endpoints/logout/index.ts
@@ -0,0 +1 @@
+export default function noopApi(...args: any[]): void {}
diff --git a/framework/kibocommerce/api/endpoints/signup/index.ts b/framework/kibocommerce/api/endpoints/signup/index.ts
new file mode 100644
index 000000000..491bf0ac9
--- /dev/null
+++ b/framework/kibocommerce/api/endpoints/signup/index.ts
@@ -0,0 +1 @@
+export default function noopApi(...args: any[]): void {}
diff --git a/framework/kibocommerce/api/endpoints/wishlist/index.tsx b/framework/kibocommerce/api/endpoints/wishlist/index.tsx
new file mode 100644
index 000000000..491bf0ac9
--- /dev/null
+++ b/framework/kibocommerce/api/endpoints/wishlist/index.tsx
@@ -0,0 +1 @@
+export default function noopApi(...args: any[]): void {}
diff --git a/framework/kibocommerce/api/index.ts b/framework/kibocommerce/api/index.ts
new file mode 100644
index 000000000..3999d6b48
--- /dev/null
+++ b/framework/kibocommerce/api/index.ts
@@ -0,0 +1,44 @@
+import type { CommerceAPI, CommerceAPIConfig } from '@commerce/api'
+import { getCommerceApi as commerceApi } from '@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 KiboCommerceConfig extends CommerceAPIConfig {}
+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,
+ fetch: createFetcher(() => getCommerceApi().getConfig()),
+}
+
+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/framework/kibocommerce/api/operations/get-all-pages.ts b/framework/kibocommerce/api/operations/get-all-pages.ts
new file mode 100644
index 000000000..7d14893b2
--- /dev/null
+++ b/framework/kibocommerce/api/operations/get-all-pages.ts
@@ -0,0 +1,19 @@
+export type Page = { url: string }
+export type GetAllPagesResult = { pages: Page[] }
+import type { KiboCommerceConfig } 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/framework/kibocommerce/api/operations/get-all-product-paths.ts b/framework/kibocommerce/api/operations/get-all-product-paths.ts
new file mode 100644
index 000000000..fff24e791
--- /dev/null
+++ b/framework/kibocommerce/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/framework/kibocommerce/api/operations/get-all-products.ts b/framework/kibocommerce/api/operations/get-all-products.ts
new file mode 100644
index 000000000..31d2cebd0
--- /dev/null
+++ b/framework/kibocommerce/api/operations/get-all-products.ts
@@ -0,0 +1,25 @@
+import { Product } from '@commerce/types/product'
+import { GetAllProductsOperation } from '@commerce/types/product'
+import type { OperationContext } from '@commerce/api/operations'
+import type { KiboCommerceConfig } 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/framework/kibocommerce/api/operations/get-customer-wishlist.ts b/framework/kibocommerce/api/operations/get-customer-wishlist.ts
new file mode 100644
index 000000000..8c34b9e87
--- /dev/null
+++ b/framework/kibocommerce/api/operations/get-customer-wishlist.ts
@@ -0,0 +1,6 @@
+export default function getCustomerWishlistOperation() {
+ function getCustomerWishlist(): any {
+ return { wishlist: {} }
+ }
+ return getCustomerWishlist
+}
diff --git a/framework/kibocommerce/api/operations/get-page.ts b/framework/kibocommerce/api/operations/get-page.ts
new file mode 100644
index 000000000..b0cfdf58f
--- /dev/null
+++ b/framework/kibocommerce/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/framework/kibocommerce/api/operations/get-product.ts b/framework/kibocommerce/api/operations/get-product.ts
new file mode 100644
index 000000000..d59a7b818
--- /dev/null
+++ b/framework/kibocommerce/api/operations/get-product.ts
@@ -0,0 +1,26 @@
+import type { KiboCommerceConfig } from '../index'
+import { Product } from '@commerce/types/product'
+import { GetProductOperation } from '@commerce/types/product'
+import data from '../../data.json'
+import type { OperationContext } from '@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/framework/kibocommerce/api/operations/get-site-info.ts b/framework/kibocommerce/api/operations/get-site-info.ts
new file mode 100644
index 000000000..31d581767
--- /dev/null
+++ b/framework/kibocommerce/api/operations/get-site-info.ts
@@ -0,0 +1,43 @@
+import { OperationContext } from '@commerce/api/operations'
+import { Category } from '@commerce/types/site'
+import { KiboCommerceConfig } 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/framework/kibocommerce/api/operations/index.ts b/framework/kibocommerce/api/operations/index.ts
new file mode 100644
index 000000000..086fdf83a
--- /dev/null
+++ b/framework/kibocommerce/api/operations/index.ts
@@ -0,0 +1,6 @@
+export { default as getPage } from './get-page'
+export { default as getSiteInfo } from './get-site-info'
+export { default as getAllPages } from './get-all-pages'
+export { default as getProduct } from './get-product'
+export { default as getAllProducts } from './get-all-products'
+export { default as getAllProductPaths } from './get-all-product-paths'
diff --git a/framework/kibocommerce/api/utils/fetch-local.ts b/framework/kibocommerce/api/utils/fetch-local.ts
new file mode 100644
index 000000000..e6ad35ba2
--- /dev/null
+++ b/framework/kibocommerce/api/utils/fetch-local.ts
@@ -0,0 +1,34 @@
+import { FetcherError } from '@commerce/utils/errors'
+import type { GraphQLFetcher } from '@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, {
+ ...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/framework/kibocommerce/api/utils/fetch.ts b/framework/kibocommerce/api/utils/fetch.ts
new file mode 100644
index 000000000..9d9fff3ed
--- /dev/null
+++ b/framework/kibocommerce/api/utils/fetch.ts
@@ -0,0 +1,3 @@
+import zeitFetch from '@vercel/fetch'
+
+export default zeitFetch()
diff --git a/framework/kibocommerce/auth/index.ts b/framework/kibocommerce/auth/index.ts
new file mode 100644
index 000000000..36e757a89
--- /dev/null
+++ b/framework/kibocommerce/auth/index.ts
@@ -0,0 +1,3 @@
+export { default as useLogin } from './use-login'
+export { default as useLogout } from './use-logout'
+export { default as useSignup } from './use-signup'
diff --git a/framework/kibocommerce/auth/use-login.tsx b/framework/kibocommerce/auth/use-login.tsx
new file mode 100644
index 000000000..28351dc7f
--- /dev/null
+++ b/framework/kibocommerce/auth/use-login.tsx
@@ -0,0 +1,16 @@
+import { MutationHook } from '@commerce/utils/types'
+import useLogin, { UseLogin } from '@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/framework/kibocommerce/auth/use-logout.tsx b/framework/kibocommerce/auth/use-logout.tsx
new file mode 100644
index 000000000..9b3fc3e44
--- /dev/null
+++ b/framework/kibocommerce/auth/use-logout.tsx
@@ -0,0 +1,17 @@
+import { MutationHook } from '@commerce/utils/types'
+import useLogout, { UseLogout } from '@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/framework/kibocommerce/auth/use-signup.tsx b/framework/kibocommerce/auth/use-signup.tsx
new file mode 100644
index 000000000..e9ad13458
--- /dev/null
+++ b/framework/kibocommerce/auth/use-signup.tsx
@@ -0,0 +1,19 @@
+import { useCallback } from 'react'
+import useCustomer from '../customer/use-customer'
+import { MutationHook } from '@commerce/utils/types'
+import useSignup, { UseSignup } from '@commerce/auth/use-signup'
+
+export default useSignup as UseSignup
+
+export const handler: MutationHook = {
+ fetchOptions: {
+ query: '',
+ },
+ async fetcher() {
+ return null
+ },
+ useHook:
+ ({ fetch }) =>
+ () =>
+ () => {},
+}
diff --git a/framework/kibocommerce/cart/index.ts b/framework/kibocommerce/cart/index.ts
new file mode 100644
index 000000000..3b8ba990e
--- /dev/null
+++ b/framework/kibocommerce/cart/index.ts
@@ -0,0 +1,4 @@
+export { default as useCart } from './use-cart'
+export { default as useAddItem } from './use-add-item'
+export { default as useRemoveItem } from './use-remove-item'
+export { default as useUpdateItem } from './use-update-item'
diff --git a/framework/kibocommerce/cart/use-add-item.tsx b/framework/kibocommerce/cart/use-add-item.tsx
new file mode 100644
index 000000000..7f3d1061f
--- /dev/null
+++ b/framework/kibocommerce/cart/use-add-item.tsx
@@ -0,0 +1,17 @@
+import useAddItem, { UseAddItem } from '@commerce/cart/use-add-item'
+import { MutationHook } from '@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/framework/kibocommerce/cart/use-cart.tsx b/framework/kibocommerce/cart/use-cart.tsx
new file mode 100644
index 000000000..b3e509a21
--- /dev/null
+++ b/framework/kibocommerce/cart/use-cart.tsx
@@ -0,0 +1,42 @@
+import { useMemo } from 'react'
+import { SWRHook } from '@commerce/utils/types'
+import useCart, { UseCart } from '@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/framework/kibocommerce/cart/use-remove-item.tsx b/framework/kibocommerce/cart/use-remove-item.tsx
new file mode 100644
index 000000000..b4ed583b8
--- /dev/null
+++ b/framework/kibocommerce/cart/use-remove-item.tsx
@@ -0,0 +1,18 @@
+import { MutationHook } from '@commerce/utils/types'
+import useRemoveItem, { UseRemoveItem } from '@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/framework/kibocommerce/cart/use-update-item.tsx b/framework/kibocommerce/cart/use-update-item.tsx
new file mode 100644
index 000000000..06d703f70
--- /dev/null
+++ b/framework/kibocommerce/cart/use-update-item.tsx
@@ -0,0 +1,18 @@
+import { MutationHook } from '@commerce/utils/types'
+import useUpdateItem, { UseUpdateItem } from '@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/framework/kibocommerce/codegen.json b/framework/kibocommerce/codegen.json
new file mode 100644
index 000000000..cf25363ed
--- /dev/null
+++ b/framework/kibocommerce/codegen.json
@@ -0,0 +1,23 @@
+{
+ "schema": {
+ "https://t17194-s21127.dev10.kubedev.kibo-dev.com/graphql": {}
+ },
+
+ "generates": {
+ "./framework/kibocommerce/schema.d.ts": {
+ "plugins": ["typescript", "typescript-operations"],
+ "config": {
+ "scalars": {
+ "ID": "string"
+ }
+ }
+ },
+ "./framework/kibocommerce/schema.graphql": {
+ "plugins": ["schema-ast"]
+ }
+ },
+ "hooks": {
+ "afterAllFileWrite": ["prettier --write"]
+ }
+ }
+
\ No newline at end of file
diff --git a/framework/kibocommerce/commerce.config.json b/framework/kibocommerce/commerce.config.json
new file mode 100644
index 000000000..0871b8849
--- /dev/null
+++ b/framework/kibocommerce/commerce.config.json
@@ -0,0 +1,9 @@
+{
+ "provider": "kibocommerce",
+ "features": {
+ "wishlist": false,
+ "cart": false,
+ "search": false,
+ "customerAuth": false
+ }
+}
diff --git a/framework/kibocommerce/customer/index.ts b/framework/kibocommerce/customer/index.ts
new file mode 100644
index 000000000..6c903ecc5
--- /dev/null
+++ b/framework/kibocommerce/customer/index.ts
@@ -0,0 +1 @@
+export { default as useCustomer } from './use-customer'
diff --git a/framework/kibocommerce/customer/use-customer.tsx b/framework/kibocommerce/customer/use-customer.tsx
new file mode 100644
index 000000000..41757cd0d
--- /dev/null
+++ b/framework/kibocommerce/customer/use-customer.tsx
@@ -0,0 +1,15 @@
+import { SWRHook } from '@commerce/utils/types'
+import useCustomer, { UseCustomer } from '@commerce/customer/use-customer'
+
+export default useCustomer as UseCustomer
+export const handler: SWRHook = {
+ fetchOptions: {
+ query: '',
+ },
+ async fetcher({ input, options, fetch }) {},
+ useHook: () => () => {
+ return async function addItem() {
+ return {}
+ }
+ },
+}
diff --git a/framework/kibocommerce/data.json b/framework/kibocommerce/data.json
new file mode 100644
index 000000000..18c8ee718
--- /dev/null
+++ b/framework/kibocommerce/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/framework/kibocommerce/fetcher.ts b/framework/kibocommerce/fetcher.ts
new file mode 100644
index 000000000..f8ca0c578
--- /dev/null
+++ b/framework/kibocommerce/fetcher.ts
@@ -0,0 +1,41 @@
+import { FetcherError } from '@commerce/utils/errors'
+import type { Fetcher } from '@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/framework/kibocommerce/index.tsx b/framework/kibocommerce/index.tsx
new file mode 100644
index 000000000..bd2b33d3e
--- /dev/null
+++ b/framework/kibocommerce/index.tsx
@@ -0,0 +1,32 @@
+import * as React from 'react'
+import { ReactNode } from 'react'
+import { kiboCommerceProvider } from './provider'
+import {
+ CommerceConfig,
+ CommerceProvider as CoreCommerceProvider,
+ useCommerce as useCoreCommerce,
+} from '@commerce'
+
+export const localConfig: CommerceConfig = {
+ locale: 'en-us',
+ cartCookie: 'session',
+}
+
+export function CommerceProvider({
+ children,
+ ...config
+}: {
+ children?: ReactNode
+ locale: string
+} & Partial) {
+ return (
+
+ {children}
+
+ )
+}
+
+export const useCommerce = () => useCoreCommerce()
diff --git a/framework/kibocommerce/next.config.js b/framework/kibocommerce/next.config.js
new file mode 100644
index 000000000..ce46b706f
--- /dev/null
+++ b/framework/kibocommerce/next.config.js
@@ -0,0 +1,8 @@
+const commerce = require('./commerce.config.json')
+
+module.exports = {
+ commerce,
+ images: {
+ domains: ['localhost'],
+ },
+}
diff --git a/framework/kibocommerce/product/index.ts b/framework/kibocommerce/product/index.ts
new file mode 100644
index 000000000..426a3edcd
--- /dev/null
+++ b/framework/kibocommerce/product/index.ts
@@ -0,0 +1,2 @@
+export { default as usePrice } from './use-price'
+export { default as useSearch } from './use-search'
diff --git a/framework/kibocommerce/product/use-price.tsx b/framework/kibocommerce/product/use-price.tsx
new file mode 100644
index 000000000..0174faf5e
--- /dev/null
+++ b/framework/kibocommerce/product/use-price.tsx
@@ -0,0 +1,2 @@
+export * from '@commerce/product/use-price'
+export { default } from '@commerce/product/use-price'
diff --git a/framework/kibocommerce/product/use-search.tsx b/framework/kibocommerce/product/use-search.tsx
new file mode 100644
index 000000000..30e699537
--- /dev/null
+++ b/framework/kibocommerce/product/use-search.tsx
@@ -0,0 +1,17 @@
+import { SWRHook } from '@commerce/utils/types'
+import useSearch, { UseSearch } from '@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/framework/kibocommerce/provider.ts b/framework/kibocommerce/provider.ts
new file mode 100644
index 000000000..2b68bf69e
--- /dev/null
+++ b/framework/kibocommerce/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 kiboCommerceProvider = {
+ locale: 'en-us',
+ cartCookie: 'bc_cartId',
+ fetcher,
+ cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },
+ customer: { useCustomer },
+ products: { useSearch },
+ auth: { useLogin, useLogout, useSignup },
+}
+
+export type KibocommerceProvider = typeof kiboCommerceProvider
diff --git a/framework/kibocommerce/schema.d.ts b/framework/kibocommerce/schema.d.ts
new file mode 100644
index 000000000..cf52ddec9
--- /dev/null
+++ b/framework/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